Allocator and Store freeze-readiness audit
Audit date: 27 October 2026. Runtime source: SDK
931f8c8087fa15cfeab56eb2f3979f7010e3f06d; harness
ff2d9adeeaa2f959d32f5d8ba6079a3f8f7765f3.
Do not freeze the implementation unchanged yet. The reviewed foundation is plausible for a pinned first release without kernel migration, but a Store scalability fix, a provider-boundary hardening/contract decision and an explicit stable-capacity decision should precede that freeze. This audit changes documentation, not allocator/Store behavior. It introduces no migration, compatibility reader, runtime registry or extra hot-path validation. It does not freeze development now or certify a production release.
Findings and decisions
| Priority | Finding | Consequence | Lean response before freezing |
|---|---|---|---|
| P2 | Store creation scans the directory for a vacant slot | Filling N live module instances performs quadratic slot searches; late-slot churn rereads the live prefix | Add a directory free-head and reuse vacant slot storage for links; retain generation checks. This is the useful small persistent-format change to make before freezing. |
| P2, custom providers | A returned Hylix finalization error can escape after retained attachments changed | Store can retain a child whose buffered stable record was discarded | Make post-callback provider-finalization failure abort execution. Keep pre-entry rejection recoverable. Built-in Arena already traps physical flush failures; this is the public wrapper/provider boundary. |
| Capacity decision | Hylix free capacity stays in its original size class; shrinking retains the original allocation span | Old class peaks can strand space even with no remaining live blocks; Hylix virtual pages are not returned to Minima | Decide whether to return/reassign fully empty slabs before freezing, or explicitly accept historical per-class peaks and budget them. This is fragmentation, not evidence of lost same-class reuse or IC memory shrinking. |
| Performance decision | The Minima Hylix adapter grows one 64 KiB physical block at a time | Large growth repeats backend growth and mapping work per block | Use the existing bulk acquisition mechanism to extend the mapping in batches. The current mapping schema can remain; measure before selecting a change. |
| Qualification | Fragmented retained slab KEEP, small leaked Runtime slabs, high stable addresses and composed Minima/Hylix KEEP need more focused evidence | Existing native and application cohorts do not establish all of those boundaries | Add targeted actual-canister and sparse high-address cases for the eventual frozen release; retain existing guard/rollback gates. |
The four independent source reviews are retained under reviews/: native allocation, Store, stable allocation, and admission/IC. They give exact source lines, triggers, invariants checked, limits and recommendations. No confirmed corruption bug was found in the default Nyxus allocator, default Hylix Arena, Minima authority or current startup/admission path in this bounded review. That is not proof of their absence. The custom-provider finding is reproduced separately below. The synthesis peer review independently checks these classifications, probe results and evidence hashes.
Fresh evidence
The root agent owns all builds. Review agents read source and write notes only. The pinned native environment and one existing target cache were used; no IC canister was installed or upgraded for this audit.
| Check | Result and scope |
|---|---|
| Platform, Nyxus, Hylix, Minima, Store and memory-ABI native cohort | 238 passing tests in 29 groups; zero failures/skips. Includes allocator churn/reuse, failed growth, provider recovery, identity/ownership, codec/cache and admission checks. |
| Capped Hylix class-switch probe | With a 196,608-byte backing cap, allocate/free 60,000 bytes, verify same-class reuse, then request 120,000 bytes: growth aborts despite zero live blocks. A fresh Arena with the same cap accepts that request. |
| Hylix shrink probe | Shrinking a 1,000,000-byte allocation to eight bytes retains its block identity and span. The next large allocation raises high-water from 1,052,672 to 2,101,248 bytes. This measures allocation policy, not live payload or IC fees. |
| Fail-once custom provider | After successful root install, return Err from frame_finish before delegating. Public Store call returns Err(Hylix), one discard occurs, the child attachment remains, and reading its stable record returns Err(Hylix). |
The provider probe deliberately follows the trait's fallible return signature without supplying the README's stronger abort-on-mutation-failure behavior. It demonstrates that the public boundary does not enforce that requirement, not that the built-in Arena normally returns a recoverable physical flush error. The native host supplies no IC rollback; the probe never resumes mutation with the failed Arena and forgets the inconsistent Store to avoid obscuring the observation with its expected destructor failure. An eventual fix requires an actual IC rollback test too.
Evidence preserves source probes, dependency lock, toolchain identity, complete native logs and result summaries by hash. Capacity probes are small deterministic examples, not 500 GiB or instruction benchmarks. The directory complexity finding follows the current search loop; no new IC cost is assigned to it. The fixed native slab geometry also has a capacity cliff: homogeneous 16 KiB allocations need one 64 KiB page each. Other classes can use the remaining buddy space. Accept or change that policy against real headroom requirements; it is not a discovered allocator-corruption defect.
What a useful freeze includes
Pin the complete reviewed kernel/toolchain closure and reproducible build, not just allocator headers or a format magic. Current policies cover Store/allocator helpers, selected runtime and platform code, macros, compiler/standard-library identity, used carriers and owner interpretation dependencies. Frozen owner V1 catalogs are rebuilt under the current kernel policies; they cannot bridge an allocator or Store change. Root V1→V2 conversion remains available for application state under an unchanged kernel class.
Normalized Rust source recipes ignore recognized test-only items, comments and formatting. That exemption is not universal: the compiler/ABI class and owner source strings include raw file bytes. Semantic cfg/external helper inputs still need explicit owner contracts. Catalog equality is not an executable hash; reviewed builder/startup/teardown sources and exact prepared artifacts need their own provenance. The SDK upgrade guide now makes these boundaries explicit.
Local IC source confirms KEEP and failed-upgrade rollback ordering. It is a dirty
tree at 49a94778d9aff90139cadc4f9c14b98b2aae42a4, distinct from the previously
measured frozen PocketIC binary 6a9a75ad…. This source review makes no fresh
runtime or page-cost claim.
Acceptable explicit limits include native pointer/address stability, no moving
compaction or automatic allocator/kernel conversion, normal Rust leaks from
forgotten retained owners/strong cycles, and synchronous whole-subtree
retirement. ChildMap::clear(limit) limits detached roots, not all their nested
work. Large owners should be emptied incrementally while still attached before
final detachment. Do not add a collector or weaken rollback/admission to conceal
these limits.
Selection and performance boundary
No proposed implementation change is selected by this audit. The prior matched Heavy16 qualification remains evidence only for its exact artifacts. No new performance number is claimed, and no changed runtime is being merged under those old measurements. Qualify any follow-up fix with the meaningful native regression, actual KEEP/rollback where affected, and matched Nyxus RRT/Hylix RRts work, instructions, latency and memory. Postponing migration is reasonable after the selected fixes, capacity decisions and release-specific evidence are complete.