Allocator and Nyxus ownership research after batch 7
Source review on 5 November 2026, frozen factory
4e8875c746b7126da51d3e0eb508dddbe4704463, SDK
16bbcc1f2f4a312631cad3ce74c6b2f044d09cd3. This pass reads implementation,
proofs and authored qualification notes. It runs no compiler, prover, test or
benchmark and reconsumes no removed output. Historical proof identities remain
those in their linked notes. No product, proof, tool or runtime change is made.
The next useful work is to connect the existing contracts on one execution and one owned allocation. Repeating the timed-out whole-page Kani experiments would not establish that connection. The corrected backend and its fresh component replays close the earlier representation/admission findings; they do not supply the still-missing ownership and source-composition theorems.
What is established, and what is not
| Layer | Established checkpoint | Remaining handoff |
|---|---|---|
| Geometry and packed buddy metadata | Actual scalar/word effects; source-erased geometry, split and coalescing loops; universal conservation over all 256 cells of the same transition | Scalar intervals and Perm<PageHeader> do not yet own the selected payload or establish a complete physical allocation history. |
| Global page bins | Actual local field effects for both policies; separate 23-obligation sequence/history model | Initial real-list embedding, live header permissions, and completeness of represented free pages remain caller premises. |
| Existing-bin acquisition | N5 executes complete actual acquisition, both policies, orders six/seven; 2,048 finite native acquisitions per compiler with ownership/retirement controls | No formal whole-acquisition/payload-token theorem. The whole-page symbolic attempts, including the isolated negative, timed out at the original budget. |
| Slab allocation/release | Earlier contiguous partial-allocation body covers classes zero/fifteen and real local cell/pointer effects; N6 adds all-77 geometry/components and a 34-VC general chain model | The all-class components omit actual pop pointer and release-index calculations. Their native lists are empty/singleton and pop assumes bump equals capacity. The general model is not physically embedded. |
| Allocation facade | Actual fixed-layout failure/fast paths for both policies; N7 has a 10-report/93-goal composition of selected successful direct arms and resize suffix | Full entry/branch correspondence, uninitialized-byte state, a general provider and the hinted successful receiver remain open. |
| Nyxus and containers | Runtime/compiler contracts, tests, signatures and native lifetime controls | No end-to-end formal Allocator, retained SharedSlice, element destruction or persistent-container theorem. |
These are overlapping checkpoints, not additive coverage counts. The useful existing producers are documented in buddy acquisition, release composition, global bins, native owned acquisition, partial slabs, slab chains, facade failure/fast paths and successful resize. The retained-region checks establish separate bounded projections, not allocation liveness.
Implementation seams that determine the next split
- Platform allocator:
PageSourceat lines 40–58 promises one disjoint pinned object, correct alignment and exact release.acquire_spanat 321–364 searches bins, selects and removes a free node, splits it, updates the live count, rebins the page and constructs the returned pointer. The checked split starts after selection and removal; the remaining steps cannot be inferred from that fragment alone. - The same source's
allocate/releaseat 150–239 computes real slab cell and release indices;link_slab/unlink_slabat 295–318 edits an intrusive list. Current component extraction, lines 23–56, explicitly separates pop index/word and omits the intervening pointer expression. Reuse the existing contiguous partial-slab producer when possible rather than adding another detached scalar model. - Successful resize staging, lines 91–138,
extracts direct arms/suffix and instantiates
AllocatorHeap<2,1>. In contrast, Nyxus allocation, line 6, importsHintedHeap, which isAllocatorHeap<3,2>. Direct allocations are unbanded, but the ordinary receiver proof is not already a proof of the hinted receiver used by Nyxus. - Platform resize copies
min(old.size(), new.size())bytes at 285–289. Allocator capacity may contain uninitialized bytes even within that old layout. The next contract must preserve byte initialization state, rather than requiring all old bytes to be initialized or manufacturing initialized replacement storage. N7's initializedPerm<[u8]>premise remains valid for its narrower checkpoint. - Nyxus
resizeat 130–162 handles zero-sized transitions, forwards to the actual backend and then zeroes only a successful grown tail. Its Wasm backendPagesat 374–399 delegates toRetainedMemory, whilewithat 401–417 owns the synchronous nonreentrant Heap/provider loan. A private scalar range or format marker is not the physical capability required by those calls. - Nyxus containers (source unavailable)
largely wrap standard containers instantiated with
Nyxus. A small custom SharedSlice implementation (source unavailable) gives a more direct first ownership target: a real sized header, checked dynamic tail, initialized-prefix builder, explicit clone count and final release. Its source-qualifiedNyxusDatarecipe is an authoring/interpretation contract, not an existing formal proof of these operations.
Five proposed work items
A1 — Actual existing-bin acquisition with a live span capability
Priority: foundation producer. Target acquire_span lines 327–364, initially
the existing-bin branch. Export a noncopy capability for the exact returned
base/length, preserved old live loans, exact remaining free partition and correct
single-page bin membership. The payload must be projected from the same owned
page object as the header; a metadata interval or separately allocated header
must not create that permission.
Use Creusot strict-erasure views for selection/removal, consume the existing
split producer, and then check rebin/pointer construction on that same state.
Carry page bytes abstractly with an initialization-state/resource view, avoiding
64 KiB of symbolic element values. Reuse the canonical bin representation and
explicit primitive bridges; do not assume an unproved whole-acquire contract.
Dependencies are a supplied page resource, its header/byte embedding and valid
bin representation. Production PageSource provisioning remains a separate
producer, so the first result must be explicitly conditional on it.
Acceptance: a real owning split and zero-split caller, original order-six/
seven native witnesses as complements, then parameterized valid order/selection
domains; an exact wrong returned-origin or free-complement postcondition and an
erased-body selection mutation. Every support goal must close. If general bins
are too large, first prove one admitted singleton bin and retain the restriction;
fresh-page acquisition, allocation-search completeness and final provider return
stay open. The current borrowed-word clear_free import remains explicit until
its separate frontend/resource obstacle is actually resolved.
A2 — Bind slab model identities to real cells and populated lists
Priority: span-to-object producer. Target the complete partial-slab body at 178–194, nonfinal release at 217–230, and list helpers at 295–318. Export that a live/free/bump partition is represented by the actual slot words and header, that allocation accounts for precisely one reserved stride with a separate requested-byte loan, and that release consumes that live token before overwriting the link word. Preserve neighboring live initialized prefixes and the active partial list.
Start from classes zero/fifteen and the existing contiguous body, which already includes pointer arithmetic and variable-bump reuse. Establish a real two-cell nonmonotone free chain and head/middle/tail list representation before extending to the 77-class geometry producer. Link the 34-VC model by a named, reviewed embedding relation, or prove the required transition invariant in the consuming tool. A separate model and independent field checks do not automatically yield a same-execution physical theorem. Dependencies are a valid supplied slab span and, for fresh creation/final retirement, A1 and the eventual page-return contract.
Acceptance: allocate/pop twice without duplicate ownership; nonfinal release and reuse; a three-header populated-list witness; arbitrary-bump reuse within the stated class scope; exact wrong-cell/chain-loss and missing-neighbor-frame controls. Keep uninitialized padding distinct from initialized user bytes. If whole-chain embedding stalls, export the actual two-cell resource transition and populated-list local frame first, without calling it an arbitrary-history or whole-slab theorem.
A3 — Full direct resize entry, both receivers, with initialization state
Priority: practical facade producer. First prove that the actual full
allocate, release and resize_layout entries select the intended direct
branches for the existing fixed layouts. Include both ordinary <2,1> and
hinted <3,2> receivers. Then replace the stronger initialized-buffer premise
with a byte view that records initialization state, including old capacity.
Export correct success pointer/Layout, exact copied byte state for the minimum extent, untouched replacement tail, copy-before-return of the old capability, and old-token/byte preservation on failure. The existing scalar classifier and geometry facts should discharge branch choices. Retain source-erasure and reverse-audited receiver representation; do not replace the full Heap entry with a trusted success stub. Raw copy over potentially uninitialized storage needs an explicit initialization-preserving primitive law; the current tiny initialized Kani copy test does not prove that law.
Acceptance: owning direct move and failure callers for both policies, selected old initialized bytes among uninitialized capacity, a replacement with an uninitialized tail, exact retirement/prefix controls and a full-entry guard or copy-body mutation. Native checks read only initialized positions. If complete entry staging reaches a generic/trait frontend barrier, first export a checked branch-selection result and the hinted initialized counterpart, recording the remaining bridge. Do not claim general layout, slab or provider refinement from that smaller result.
A4 — First actual Nyxus grow_zeroed consumer
Priority: direct downstream use of A3. Target Nyxus::resize lines 130–162
and its grow_zeroed caller at 110–117. Under the qualified hinted backend
contract, prove that a successful nonzero direct growth preserves the old byte
state and initializes exactly the added logical extent to zero. On backend
failure the old allocation remains live and no zeroing occurs. Keep ordinary
growth/shrink as frame variants of the same source body.
Use erased ghost permissions and the smallest named write-bytes law; add no
runtime ownership map or extra scan. First scope to the direct fixed-layout
path from A3. In-place small-class growth additionally needs A2's reservation
versus requested-length capability. The old-size-zero branch calls the standard
allocator's allocate_zeroed implementation and needs its own source/stdlib
contract; proving only the nonzero path must not be described as the whole API.
Acceptance: dirty added storage becomes zero, old initialized values survive, an exact wrong zero-start control detects prefix destruction, a tail-omission control detects incomplete initialization, and the failure caller retains its token. Require an actually reachable successful caller. A useful fallback is the source-erased nonzero direct zero-tail consumer with the allocation/stdlib leaves and excluded zero-size/in-place paths stated explicitly.
A5 — Small retained owning collection: SharedSlice<u8>
Priority: bounded upper-layer seed in parallel with A1–A3. Target
shared.rs layout/elements/building at 31–114, copy_from_slice at 180–192,
as_slice at 230–235, and clone/drop at 262–299. Export one initialized immutable
tail owned by a live count; clone retains it, a nonfinal drop preserves it, and
the final drop consumes the exact allocation once. For u8, generic element
destructor and callback-unwind semantics can remain outside the first proof.
Use a conditional allocator resource contract while the complete Nyxus allocator
chain is unfinished, and label that assumption explicitly. Check actual sized
header and dynamic-tail offset/extent; do not treat integer layout arithmetic or
the source-policy digest as physical ownership. Cell count specifications,
header/tail permission separation and raw slice construction are likely frontend/
primitive barriers, so prove construction and clone/drop as separate exported
milestones. The simple standard-container wrappers alone would mostly transfer
unproved standard allocator/container laws rather than check this custom code.
Acceptance: construct a short nonempty and empty owner, clone, drop the first
owner while retaining the second's byte loan, then consume the final owner;
require exact wrong-count/early-release controls and a compile rejection for
retirement with a live borrow. If shared ownership cannot yet be expressed,
first check layout plus initialized-prefix construction and
SharedBytes::slice (source unavailable)
at 72–92 against an explicitly supplied live owner. Builder publication,
arbitrary T, destructor panic, upgrade restore and the whole shared-count
history remain separate follow-ups, not implicit consequences.
Scheduling and acceptance policy
Start A1, A2's supplied-span/local-list milestone and A3 independently. A4 waits for the hinted A3 contract. A5 can start with a declared allocator premise, but cannot advertise a completed allocator-to-container proof until that premise is discharged. Small checked producers are preferable to a new generic proof framework or larger solver budgets.
All work should preserve the existing algorithms, layouts and allocation costs through erased proof code outside SDK builds. Reuse the admitted fixed backend, strict body checks, source-derived obligation inventories, reachable positive callers and independent exact controls. Keep the cross-verifier and primitive trust leaves in composition visible. A result on native64 remains native64; no compiled Wasm, provider/world or persistent-upgrade claim follows automatically. The source audit identified proof obligations and dependencies, not an additional confirmed runtime defect.