Kernel preparation and lifecycle qualification
Started 27 October 2026; updated 28 October 2026 UTC. This records work from the allocator and Store audit and qualification through native tests and populated canisters, separated by source. The first two Hylix performance candidates were rejected. Final D passes the matched performance and all 33 actual-canister checks. The benchmark report owns the final measurements and tradeoffs.
Source boundary
The current D SDK source is b0fb29b2b99a7ea7b86408a11d6d219c7a5d45da,
including header-cache implementation 712f14a and its documentation. Its
predecessors remain distinct evidence:
| Candidate | SDK source and delta |
|---|---|
| Initial | Runtime d922af8; documentation successor 08da23d |
| B | cefe6a3: compact Store a15bb97, bounded descriptor cache/scalar helpers 316c0e5, descriptor writeback 88b5a07 |
| C | db1e505: borrowed scalar admission 4773cc8 plus documentation |
| D | b0fb29b: full-Block validated-header cache 712f14a plus documentation |
The measured parent runtime change remains wrapper removal at
f90b228eba1a33effbd6b37a6f408f963c849d5f.
The separate lifecycle fixtures are composition 6db5a9a5, Shop directory gate
d67d551e, explicit saved-slot presence correction c6678838, and dependency
lock 84f19dd4. Parent lock refresh 12f43be5 and unrelated crypto commit
c6838fd3 are preserved; they are not silently substituted into the frozen
performance inputs.
The root build owner used the pinned compiler, canonical prepared artifacts,
fresh receipts and one owner per build/cache. Actual canister gates used the
frozen PocketIC binary with SHA-256
6a9a75ad9b4551d2b0f4a0d954ffb8bd5bbd0ebc44ac00290679b06ad0b2f8e6.
Each cohort retains its own SDK source, prepared bytes and receipts. Matching a
format marker does not authorize KEEP between these changed implementation
contracts.
Implemented changes
- RRts provider wrappers: deleted 920 lines of profiling wrappers, feature plumbing and wrapper-only tests. Normal construction binds the exclusive provider directly to Arena and Store. Ordinary instruction scopes and external PocketIC profiling remain.
- Store vacancies: a persisted free head and links in vacant pointer words replace the live-prefix search. Selecting a vacancy is constant work; appending retains Vec growth costs. Global generation exhaustion precedes mutation, and stale bindings, conversion epochs and attachment ownership keep their checks. The compact root omits its redundant namespace after the existing publication proof, preserving full u64 slot/generation fields and restoring the 64-byte directory budget and original hot-field offsets. High-water capacity is retained.
- Minima growth: the Hylix virtual image and collections share bulk page acquisition. It preflights consumed free generations and the fresh extent, reserves retained destinations, then grows once for the missing fresh blocks. Reused pages are cleared before admission; existing virtual mappings remain fixed and satisfied growth requests avoid the physical provider loan.
- Hylix reuse:
RSXBUF02uses protected 64-byte descriptors in permanent metadata islands. The 16-byte Block keeps its offset and packs a descriptor address in 16-byte units into the high 40 generation bits, with a nonwrapping 24-bit local counter. Generations are opaque, without global temporal ordering. Final slab release invalidates canonical authority before bytes can change class. Free extents split and adjacent extents coalesce within metadata boundaries; releasing a free tail can retreat the logical frontier. - Finalization: the central Hylix frame boundary traps when provider finalization fails after callback execution. Retained ownership and stable publication therefore share IC rollback. Ordinary business errors still finalize; pre-entry provider rejection can remain recoverable.
Hylix can now reuse fully empty capacity across classes instead of retaining every class peak. Live slabs and protected metadata still fragment space, and a request needs a suitable contiguous extent. Resize within capacity keeps its span; neither physical stable memory nor Minima's virtual-page map shrinks. Protected metadata consumes space and can add a cold segment read; the transient descriptor cache now has 16 entries. The byte cache also holds metadata. Smaller stable capacity alone does not qualify instruction or latency regressions.
D: bounded reuse of validated headers
D adds a fixed 16-entry full-Block-to-Header cache beside the descriptor cache. The two entry arrays have a compile-time combined bound of 2,048 bytes. Exact equality checks both offset and complete generation; a colliding index or equal generation at another offset grants no validity. No map, registry or persistent owner is added.
An uncached read still checks protected descriptor authority, counter lifetime, class/extent/slot geometry, complete live object header and requested bounds. Private allocation/header writes install their known-valid result only after a successful coherent write. A hit returns a copied Header and checks the requested range. Cache loans end before provider work or application callbacks, including nested fused visitors. Exclusive Memory ownership and bounded disjoint payload access prevent another supported path from changing a live object's header.
Freeing bypasses the header cache, retains canonical allocation admission and invalidates the exact Block before changing its header, slab or extent. Thus every old token is invalidated before an empty slab can coalesce or change class. Same-identity resize updates the cached length after its header write; zero/growing resize reaches the normal free boundary. Query exit and writable unwind discard header and descriptor entries. Committed frames may retain current validated entries; reopening starts empty. Discard remains cache cleanup, not a rollback journal.
The independent source review found no source
correctness blocker in coded D (545a561d, integrated as 712f14a). Its proof
and focused tests cover exact invalidation, stale-header imitation after
coalescing, resize bounds, collisions, callback loans and discard. This is source
review and native evidence; final actual-target and performance receipts are
separate in the benchmark report.
Qualification cohorts
| Cohort | Result |
|---|---|
| Initial full SDK native | 1,001 passed; 10 ignored |
| Initial RRT / RRts native | 275 / 264 passed |
| Initial fixture native | 15 passed |
| D full SDK native | 1,013 passed; 10 ignored |
| D focused Hylix profile cohort | 86 passed |
Initial actual gates, SDK d922af8/08da23d |
PASS, 33 checks: composition 8, Hylix 10, Shop 5, RRT/RRts Fourcans 5 each |
C actual gates, SDK db1e505 |
PASS, 23 checks: composition 8, Hylix 10, Shop 5 |
D actual gates, SDK b0fb29b |
PASS, 33 checks from final artifacts; earlier passes remain separate |
The final composed gates cover shared authority/mappings, populated KEEP, exact stable image/query purity, reuse, stale slot rejection, update rollback and late restore rollback. Hylix also covers nested ownership, codec/contract rejection and owner-local conversion. The Shop gate checks committed module retirement, survivors and refill through public business keys across repeated KEEP; it does not observe opaque directory indices and marks intentional update-trap rollback NOT_RUN because that API has no trap endpoint. Fourcans checks drained KEEP, preserved history/replay state, fresh work and pending-work upgrade rejection.
The sparse native tests near 500 GiB exercise full-width address arithmetic, reuse and reopen against a sparse provider model. Actual IC tests use bounded populated workloads; they do not allocate or qualify 500 GiB on the IC.
Performance attempts and selection
The matched comparisons retain identical completed logical work and the same frozen server. The recorded RRts outcomes were:
| Candidate | Instructions versus control | Decision |
|---|---|---|
Initial d922af8 |
500,999,899,017 versus 369,549,382,483; +35.57% | Rejected |
B cefe6a3 |
450,752,946,365 versus 369,549,382,483; +21.97% | Rejected |
D b0fb29b |
368,554,918,082 versus 369,549,382,483; −0.2691% | Selected |
The first comparisons are in
/dev/shm/newstack-kernel-prep-20261027/comparison.json; B is in
/dev/shm/newstack-kernel-prep-r2-20261027/comparison.json. They retain their
original source/artifact identities. C's 23 lifecycle checks and bounded
diagnostic profiles are not additional full performance results.
B's complete Nyxus RRT run used 91,443,118,419 instructions versus control
91,443,115,478: an additional 2,941. Page charges, latency and grown memory match
control exactly. Final D's prepared Nyxus artifact is byte-identical to B, with
SHA-256 f18512904eb1128a03337827c5042a2b73002561b42fa7f74808f75533107cde.
That byte equality permits reuse of B's measurement for this exact RRT artifact;
it is not Hylix evidence.
Final D RRts finishes in 36.6 s versus 39.0 s, with lower stable capacity and unchanged heap capacity. It has higher heap page fees and more physical calls; the complete instruction total still decreases and cycles are nearly flat. The final review reconciles the work, source guards and exact ledgers. One matched simulation does not establish general or mainnet performance.
Failed attempts retained
- Initial Hylix exact-read assertions omitted the new cold descriptor access. The corrected fixtures account for metadata separately while preserving warm no-read, exact payload, stale-identity and rollback assertions.
- The first composition fixture persisted
Option<SlotId>without an admitted native enum representation. Compilation rejected it.c6678838uses explicit presence flags and valid SlotId fields; no SDK admission rule was weakened. - Initial Fourcans lifecycle launches lacked their output parent directories. Those infrastructure failures were corrected before the passing reruns; they were not product failures.
Working notes and first/final native logs remain under
playground/kernel-prep-20261027/. Canonical build and Fourcans launch logs are
under the initial, -r2- and -r3- campaign directories in /dev/shm/. Initial
and C composed/Hylix/Shop result.json receipts remain separately under
tests/tmp/kernel-prep-20261027/ and tests/tmp/kernel-prep-r2-20261027/.
Earlier audit evidence and its failure probes remain unchanged.
No production freeze is declared. General allocator/Store-directory/native-image migration and cross-compiler conversion are not implemented. This replaces development formats without legacy readers; same-candidate KEEP does not establish an upgrade path from an older SDK kernel.