Skip to main content

Module pane_memory

Module pane_memory 

Source
Expand description

Cross-strategy pane-memory telemetry (bd-25wj7.1).

Pane history can be retained three ways, each buying undo/redo at a different memory price:

  • Baseline — keep only the single live PaneTree; no undo history at all. The irreducible floor.
  • Checkpointed — the production PaneInteractionTimeline: a baseline snapshot, a periodic checkpoint snapshot, an operation log with per-entry before/after state hashes, and replay to reconstruct historical states.
  • Persistent — the structurally shared PaneVersionStore: a Vec of Arc-shared version roots where unchanged subtrees are physically reused, so navigation is O(1) index moves with no replay and no hashes.

This module turns those three into directly comparable PaneMemoryStrategyFootprints and a single PaneMemoryComparison artifact. Every footprint is decomposed into the same retained-state classes — node structs, leaf payload, extension payload, operation log, state hashes, container/metadata — so the dominant memory driver of each strategy is explicit, not buried in one aggregate number. The byte models reuse the canonical timeline methodology (size_of struct estimates plus measured string payload bytes), so the comparison is deterministic and reproducible: identical inputs yield byte-identical reports, suitable for CI regression artifacts and as concrete baselines for the bounded-retention (bd-25wj7.2) and churn-reduction (bd-25wj7.3) work that depends on this bead.

The retained-state model lives here in the library so it is pure and unit-testable; transient allocation counts (which need allocator instrumentation) are captured by the pane_memory_telemetry bench, which embeds this comparison into its emitted JSON manifest.

Structs§

PaneMemoryComparison
Side-by-side retained-memory comparison across the three strategies.
PaneMemoryStrategyFootprint
Retained-memory footprint of one strategy, decomposed by retained-state class.

Enums§

PaneMemoryDriver
The single retained-state class that dominates a strategy’s footprint.
PaneMemoryStrategy
The history-retention strategy a PaneMemoryStrategyFootprint describes.

Constants§

PANE_MEMORY_TELEMETRY_SCHEMA_VERSION
Schema version for the emitted memory-telemetry artifact. Bump on any breaking change to the footprint/comparison field layout.

Functions§

pane_memory_comparison
Build a deterministic cross-strategy retained-memory comparison.