Minima: Inside a Stable Block

What the viewer will understand

The viewer can explain how Minima's FixedVec<u64> uses a retained descriptor to find its stable blocks and chooses which bytes to read into a borrowed buffer. The Hylix lesson establishes the mixed-engine canister and its working set. Aim for about three minutes. The next film follows key lookup through three collection layouts.

The worked example

Continue with the mixed-engine composition probe. One actor root attaches payloads and records. The payloads owner's Nyxus Data holds Minima's Root, a FixedVec<u64>, a SlotArena<u64>, and slot bookkeeping. The records owner uses Hylix. Use the fixture's state after seed(256) and mutate(1), where the Hylix film ends. The rewritten vector stores index * 17 + 1012, so the scalar read of index 7 in the fixture's snapshot loop returns 1131. Show that read at vector-relative byte range [56, 64). Probe root · Payload owner's fields · Value formula and scalar loop · Populated fixture

The grouped read uses the same rewritten vector in a teaching example. Call get_many with the sorted indices [7, 9]. The implementation reads [56, 80) in one node and visits (7, 1131) and (9, 1165). Slot 8 lies within the copied span. The native test exercises the grouping algorithm with a different vector. These byte ranges describe requested reads, and the screen movement gives those reads time to be seen. Scalar and grouped implementations · Native span checks

The story in one pass

Start at the real probe and follow the FixedVec descriptor down to its own stable block. Pick out one eight-byte value and copy it into the caller's workspace. Use the same view to group two requested indices into a single span. Then widen to show another collection's block and Hylix's separately mapped pages under the same physical stable-memory authority.

Components and views

  • Reuse the probe canister, actor root, payloads and records modules, Data and Children compartments, and Hylix representations from the preceding film. Keep their positions and use the shared connection styles. Shared visual language
  • A Minima block is one outlined physical 64 KiB cell containing sixteen aligned 4 KiB node positions. Use the same block at every scale. Show the selected node's eight-byte slot boundaries via a closer camera crop and a measured span bracket. The FixedVec and SlotArena own their blocks through separate retained descriptors. Keep any depicted placement schematic, with no absolute addresses.
  • Put a transient Minima Arena box outside the owned tree for the physical provider. Payloads lends this provider to each collection operation. The read route begins at the selected descriptor and passes through the Arena to the physical block. The Hylix adapter uses the same provider, with its page mapping recorded in payloads.Data.arena. Provider binding · Provider and retained mapping
  • Draw the caller's NodeBuffer as a reusable transient tray outside retained Data. Its outline marks the loan of &mut Workspace to one collection operation. Highlight the bytes the read writes into the tray and return the decoded result before closing the outline. The copied bytes can stay in the tray for the next read to overwrite.
  • probe_tree starts at Hylix's final composed_root framing with the replacement vector selected. block_overview includes the descriptor, Arena and whole stable block. vector_node frames the first node, workspace and result path. provider_map fits the two collection owners, the retained page map, the Hylix virtual image, and one physical stable band.

Scene minima_find_block — Follow the vector descriptor

Enters with The Hylix film's closing composed_root frame. Both owners are at revision 1. The rewritten vector in payloads.Data.values is already selected.

Beat minima_owner — Find the retained descriptor

View and focus Begin in probe_tree on payloads.Data.values and widen just enough to see which other Minima fields share its owner.

Narration

Payloads has the vector the last update replaced. Its Nyxus data holds the Minima root and the descriptors for a fixed vector and a slot arena. We'll read the fixed vector.

Cue and animation On “the vector the last update replaced” hold on the selected values field. As the narration names the fields, show the Root, FixedVec<u64> and SlotArena<u64> descriptors. On “read the fixed vector” follow the selected locator toward the provider.

Leaves with The vector descriptor is highlighted. Its physical storage route starts below the module tree.

Beat minima_block — See one allocated block

View and focus Follow the route into block_overview. Keep the descriptor and the boundaries of its physical block in frame.

Narration

The vector descriptor identifies the block. The canister's stable provider reads the requested bytes from it. Minima allocates whole sixty-four kibibyte blocks. This vector uses one block with sixteen aligned node positions.

Cue and animation On “stable provider reads the requested bytes” trace the storage route through the transient Arena. On “allocates whole sixty-four kibibyte blocks” bracket the vector's one owned block. On “sixteen aligned node positions” show the sixteen 4 KiB positions and settle on the first node.

Leaves with The first node is selected. Shade its first 2048 B as occupied by the actual 256 values. The retained descriptor carries the length.

Scene minima_read_scalar — Read one value

Enters with The first node selected in the vector's block. The caller has asked for one value at index 7 during the snapshot.

Beat minima_resolve_index — Locate index seven

View and focus Zoom into vector_node. Anchor on slots 7, 8, and 9, with the workspace beside them.

Narration

Each unsigned sixty-four bit integer takes eight encoded bytes. For index seven, the vector can compute the exact position inside this node. The read starts fifty-six bytes into the vector's first block.

Cue and animation On “For index seven” place the get(7) request above the node and select the eighth slot. On “fifty-six bytes” settle a bracket marked [56, 64) over just that slot.

Leaves with The exact source span is selected and the destination area of the caller's buffer is ready for a new read.

Beat minima_decode_value — Read eight bytes into workspace

View and focus Hold vector_node. Direct the eye from the source bracket to the first eight bytes of NodeBuffer.

Narration

The storage call copies eight bytes into a buffer the caller lends as workspace. The vector decodes those bytes and hands back one thousand one hundred and thirty-one. The caller can use this same buffer for the next operation.

Cue and animation On “copies eight bytes” animate the provider call and one copy into the selected part of the tray. On “hands back” emit an owned result chip marked 1131. Clear the per-operation workspace loan outline after the result exits. Leave the copied bytes in place.

Leaves with The value is visible at the output and the workspace can be borrowed again.

Scene minima_group_reads — Read a span for two requests

Enters with The same vector_node framing and the single-read result visible at the edge of the view.

Beat minima_group_span — Cover the first and last slot

View and focus Keep the camera fixed. Move focus to the incoming sorted list and the three slots it spans.

Narration

Suppose the caller asks for indices seven and nine together. Both are in this node, so get many makes one contiguous read. It starts at index seven and ends just after index nine, for twenty-four bytes in all.

Cue and animation On “seven and nine together” send get_many([7, 9]) into the vector. Draw one [56, 80) bracket on “one contiguous read.” Copy the bracketed span to the borrowed workspace once.

Leaves with The first twenty-four workspace bytes contain the span. The two requested slots are marked at its ends.

Beat minima_group_visit — Visit the requested indices

View and focus Frame the workspace and the two result positions. Keep the copied middle slot legible.

Narration

That span also contains index eight. The visitor receives only the requested values, one thousand one hundred and thirty-one and one thousand one hundred and sixty-five. The workspace holds those bytes for the call. The next vector read asks the provider for its span again.

Cue and animation On “The visitor receives” emit only 7 → 1131 and 9 → 1165, in input order. Keep the per-operation loan outlined while the visitor runs.

Hold On “The workspace holds those bytes” use PauseAndExplain with leader at the tray and balloon text Workspace · borrowed buffer. Hold with the loan still open. Resume on “The next vector read”, close the outline and widen toward provider_map.

Leaves with The results have returned to the caller, the tray is ready for reuse, and the physical stable band enters frame.

Scene minima_share_provider — One physical stable memory

Enters with The vector read complete. Its stable block stays in the canister drawing as the camera widens to include records.

Beat minima_virtual_image — Map Hylix pages

View and focus In provider_map, frame the FixedVec and SlotArena descriptors, the physical stable band, and the contiguous virtual Hylix image.

Narration

The slot arena has its own block. Hylix sees a contiguous virtual image for Records. Its page map lives in the Minima root in Payloads. Each virtual page points to a different physical block in the same stable memory.

Cue and animation On “its own block” trace the slot descriptor through the Arena to the SlotArena block. On “Its page map lives” highlight payloads.Data.arena · Root as the location of the retained mapping. On “Each virtual page” follow one mapping at a time from the Hylix image through the same Arena to a distinct physical block. Use an illustrative layout with disjoint destinations. If the strip starts at offset zero, label block 0 as the format marker.

Leaves with The FixedVec, SlotArena, and Hylix virtual image can each be traced to their physical storage on one band.

Beat minima_choose_collection — Follow the collection next

View and focus Return emphasis to payloads.Data with both module ownership paths readable above the same stable band.

Narration

The payloads module still declares Nyxus memory. Minima is the stable storage engine its collections use through these retained descriptors. The fixed vector knew exactly where to look. With a map, the collection also has to find the key.

Cue and animation On “through these retained descriptors” highlight the rooted descriptor followed in this film. On “find the key” pause an incoming chip labeled 15874 at the edge of the probe. Leave the cut to the matched-lookup fixture to lesson six.

Leaves with The engine composition remains readable in the final view, with the next question framed as a search for a key.

Review notes

  • Check the first-node geometry, indices, values, and spans against the worked example. The fixture's snapshot uses scalar reads. The grouped shot uses the same starting data with the documented get_many operation.
  • Check that the workspace highlight ends with the borrow, the visitor receives two values in input order, and the middle bytes appear only as part of the copied span. Use requested byte ranges as the factual labels and leave instruction fees outside the shot.
  • Scrub minima_virtual_image muted. Every Hylix page should land on a distinct physical block, the Minima collection ownership edges should stay readable, and both modules should still trace to the same actor root. Stable provider and workspace contracts
  • Align the copy, visitor, and held-frame review points to the spoken phrases after Ryan narration is timed.

Previous lesson · Hylix · Next lesson · Collections