Allocator predecessor locality experiment

Status: rejected after the standalone screen against d8635bfe951e98561d0b25703155a030d6e7054d / 005041. The measured report records a faster single NodeStore removal but slower batched deletion and insertion, together with more committed capacity at large sizes. Production keeps format 9; no stripe layout or compatibility reader is selected. The proposal below and exact source hashes in manifest.json preserve the experiment, including its original pre-measurement hypotheses.

The corrected V2 profile of the older baseline attributed three expensive NodeStore deletion writes to predecessor links: two previous free-list heads and one next resource-list allocation. They touched three remote payload regions; the current block's buddy state required another region. This experiment moves those allocator-only predecessor words beside buddy metadata, while preserving the existing bounded lists and buddy coalescing algorithm. A fresh comparison against the current baseline must establish whether that improves real workloads.

Layout

This is one experimental format, ICRMEM10 / version 10. There is no old-format adapter, option, migration or second runtime allocator.

A band still contains 32 one-MiB data arenas and one compact 16-KiB live-start bitmap. Its slot-zero arena keeps the existing 8-KiB local buddy tree and inline predecessor words. This deliberate bootstrap policy preserves hot root and small allocation addresses. Arenas 1 through 31 use one 64-KiB stripe each: an 8-KiB buddy tree followed by 32-KiB predecessor words (one u64 per 256-byte granule). Their 64-byte allocation headers keep the inline word zero. Successors remain inline. No side predecessor is read during ordinary payload admission.

Stripes align to logical 64-KiB boundaries; their used 40-KiB prefix also stays in one physical region with the IC retained backing's current 16-MiB +64-byte base. The band stride is a multiple of 64 KiB so later bands preserve this property. Unused stripe bytes and alignment gaps cannot become allocation addresses.

Quantity Baseline Candidate
First data address 25,088 25,088
First arena logical end 1,327,616 1,073,664
First later-arena data address 1,327,616 3,162,624
First later-arena logical end 2,376,192 4,211,200
Non-payload bytes per complete 32-MiB band 278,528 2,162,688
Band stride 33,832,960 35,717,120

The candidate grows only through slot zero's data until a later arena is needed. Growing arena one then reserves the stripe area before publishing that arena's count. All future metadata remains zero-filled and untouched. The larger multi-arena reservation is about 6.45% of payload capacity, including band-tail padding; it is not 6.45% of additional written or physically dirty bytes. Physical backend growth rounds differently from these logical byte counts.

Preserved invariants

  • Independent live-start bits still authorize public block headers. Payload or stale interior headers cannot create allocation authority.
  • Resource ownership, placement, allocation incarnation and group identity are checked at their existing dynamic boundaries.
  • Both allocation-list and free-list predecessors use the same arena-dependent location. Publishing a free start resets its predecessor; allocation takes an already-zero free-list head, preserving that fact while splitting. Stale entries inside coalesced extents grant no authority and are overwritten before reuse.
  • Arena-zero inline predecessors remain part of the 64-byte header read; later predecessors are fetched only when unlinking that allocation. Ordinary payload reads do not load the side plane or change their capability contract.
  • Allocation payload initialization, independent private-pool state, accounting, bounded group trimming and bounded buddy coalescing are unchanged.
  • The IC supplies rollback; no journal, deferred unlink, tombstone scan or debt queue is added.

The old trace suggests four cold bookkeeping regions might become two because its two remote free heads belong to the same arena. That is an address-layout hypothesis, not an observed candidate instruction saving. Forward-link writes remain in payload headers and can still touch remote regions.

Qualification

candidate.patch includes source and focused internal regressions. Apply only inside the measurement owner's coordinated source window. baseline/ and candidate/ contain the exact affected files for independent review/replay. Use the existing native target and toolchain:

source ver1/tools/env.sh
cargo test --manifest-path ver1/Cargo.toml -p cdk-rsx-store --lib
cargo test --manifest-path ver1/Cargo.toml -p cdk-rsx-store --test group_allocation --test placement --test storage_invariants --test private_pool --test storage_access --test read_window

The regressions must cover mixed inline/side links in arenas 0/1/2, unlinking from a free-list middle, coalescing, initialized reuse, stale IDs, reopen, group accounting/cleanup and both placements. The existing band-boundary test crosses 31 to32 and now rejects side-plane, stripe padding and band-tail addresses. Matched ordinary-canister screens should cover allocation, deletion, reuse and lookup at small and large sizes, with instructions, capacity, accessed regions and dirty regions reported separately. Changes to layout can affect unrelated access locality even when no new read is added.