Native provider byte-resource admission
Factory baseline a4548fc13f84ffecc8c75446d3dd89b211802659, SDK
409a7176096c06c2dd9b7e491e8dc630951e83b4. Product source is unchanged.
This work continues the physical byte checkpoint and addresses
one part of the foundation handoff: obtaining useful
exclusive byte loans from an actual owner, without inventing page observations.
The fifth batch constructs usable metadata byte resources and composes actual Pool operations with a separate root loan. The pilot and counts below retain their original fourth-batch source identity.
Checked producer and resource pilot
The actual VecBacking::pages body is checked with strict Creusot erasure. Its
result is exactly the initialized Vec length divided by the real 65,536-byte
page constant, for every admitted native Vec value. Partial lengths are not
rounded up and an observation alone grants no byte access.
The admission pilot is new proof-side
Rust code. It borrows the actual Vec stored by VecBacking, obtains the page
observation from that checked method, and uses the existing safe split_at_mut
contract to return three exclusive mutable byte slices:
| Loan | Range in the initialized image | Purpose |
|---|---|---|
| Root | [0, 512) |
Store root bytes, separate from provider writes |
| Controls | [512, 65536) |
Remaining first-page provider bytes |
| Payload | [65536, image.len()) |
Other initialized native bytes |
Empty and partial-page images return None before lending those windows, and preserve the complete original image. Every nonempty whole-page image returns the exact page count and initial contents of all three ranges. This does not assume saved header validity, Store ownership bits or an application type.
The loans carry real Rust lifetimes tied to the exclusive backing borrow. They are not arbitrary ghost sequences or synthetic page counts. The pilot also exports the final-image concatenation and preserves the original inner Vec borrow's prophecy. This last frame matters: a contract describing only the backing's successor reference would not reconnect changes to the original Vec.
A general checked client creates an actual shared raw-pointer Perm for the
root loan, keeps it live, and writes one control byte through the distinct
mutable control slice. It proves the complete root and payload views unchanged,
exact first-control-byte replacement and other-control-byte framing. The final
image still belongs to the original Vec after all loans resolve. One- and
two-page owning Vec witnesses check those effects after rejoining; the two-page
case preserves the first payload byte. Empty and poisoned partial-tail witnesses
exercise rejection and unchanged contents. No huge concrete SAT arena is used.
This is a genuine native byte-loan producer in a proof-side adapter. The SDK
bootstrap does not call this new adapter. Only the pages method is an
original-production erasure target; the admission, loan client and witnesses are
new checked code. Do not count this as a complete production-provider proof.
Root-loan boundary
At this historical checkpoint, the page-pool proof owned one Perm<*const [u64]> spanning the entire
control page, including root bytes. Its mutable whole-page token was not a
proof that provider operations may coexist with an outstanding root callback.
The product intentionally avoids materializing references across those roots;
metadata framing alone does not discharge that alias/resource obligation.
This pilot demonstrates a smaller capability split without assuming that obligation away. Its native Vec is pinned by the ordinary exclusive borrow; relocation is prohibited until all loans end. A designated compile-fail control tries to resize the original Vec while the resource remains live and must fail at exactly its E0499 borrow conflict. This is distinct from proving a Wasm growth that preserves separate live root/control/payload capabilities.
That pilot did not establish typed u8-to-u64 permission transport, alignment, opaque backing-key binding, integer-offset/provenance lifting or a constructor for the then-existing PhysicalState. The later resource work uses metadata bytes directly instead; the separate native zero proof checks the actual Vec clear wrapper. Built-in admission, empty provisioning, relocation/growth, Wasm/world authority and actual callback composition remain open. A trusted Wasm constructor alone would add a premise.
Source, tools and controls
The runner selects the actual Backing trait,
VecBacking declaration/implementation and page/root constants. Original method
bodies are retained as unverified erasure targets, never called as assumed proof
algorithms. Removing the inserted target attributes recovers byte-identical
selected source. The checked shadow calls ordinary Vec length; no assumed
try_reserve_exact, resize, fill or high-level provider contract is added.
Existing Creusot standard-library ownership, Vec/slice, allocation and pointer
permission contracts remain part of its TCB.
The pinned immutable Creusot frontend uses strict --erasure-check=error.
The checked target is native64 little-endian; compilation rejects other target
width/endianness. The result is not a Wasm ABI, VM, native allocator implementation
or compiler proof. Functions retain normal-return/partial-correctness scope
unless explicitly marked as terminating; allocating witnesses do not prove OOM
handling or a real host's resource availability.
Every run captures factory/SDK, source, staged-file and pinned binary identities. The seven required report/main-function paths declare the intended scope. After strict translation-only, the runner uses the pinned Why3 task printer to enumerate every main/imported goal from each fresh Coma file before any solver report exists. Prove-only consumes that same translation, and final validation rechecks the translation/import/config/Why3 hashes and matches each report to its independently derived goal set. There is no successful-run goal receipt table. Missing, extra, unsupported or open obligations are refused. The native SDK must remain clean. The runner takes the same Creusot lease as existing consumers, so it cannot race their shared target/cache in one checkout.
Three designated controls accompany the positive suite:
- A changed page-count body must fail exactly its strict-erasure check.
- A client claiming that control mutation changed the root must leave exactly its false root assertion unproved, while every other report/goal closes.
- Resizing the Vec under live returned loans must fail exactly its E0499 check.
Compilation failures, erased-body drift and open proof goals are separate control classes; an unrelated error cannot qualify another class. Generated logs, translations and proof JSON remain ignored and are removed after the summary.
python3 verification/tools/provider_resource.py all
python3 -B tests/verification/run.py discover -p test_provider_resource.py
Development findings
The first prototype stored mutable Perm objects inside Ghost<Guarded<...>>
windows. Its real admission proof closed, but a raw mutable reborrow failed a
Guarded type-invariant obligation; repeating the body with an explicitly held
guard did not close that obligation. This was not accepted as a source defect
or a proved permission transport. The checked pilot instead keeps ordinary
exclusive byte slices and demonstrates a shared raw root permission. The old
prototype is superseded, rather than retained as an alternative capability API.
A second draft omitted the original Vec-reference prophecy frame. The general admission contracts then closed but the owning-image rejoin witness correctly failed. Exporting that real frame made the roundtrip close without a new axiom. This was a proof-interface correction, not a production bug.
Qualified checkpoint
At the source baseline above, the final positive run passes seven complete reports, 32 main/imported goals and 32 discharged leaves. The semantic control has the same complete 32-goal membership and exactly one designated open leaf; all its other obligations close. The erased-body and live-loan-growth controls each fail only their expected compiler error. At the first checkpoint, all six new runner regressions passed, including imported-goal omission and unrelated compiler rejection cases. No production defect was found. Final root integration must rerun these source and staging gates after merging; the source identities above retain their historical qualification.
The task-inventory follow-up integrates shared gate commit a6593e15. Positive
and semantic runs each derive their own fresh task inventories; compiler error
controls retain their exact designated error checks. Seven provider runner
regressions now use authored synthetic expected-goal fixtures, check omitted
imports, and reject a changed inventory before either positive or semantic
report consumption. The proof bodies and SDK source are unchanged by this
qualification upgrade. The fresh follow-up again passes seven reports and
32 independently enumerated goals, with all three designated controls behaving
as expected. All 130 tool-unit checks pass at this merged component source.