Direct native runtime experiment and promotion
The selected runtime has moved into the normal product folders:
- Memory owns retained allocation/data admission.
- Collections owns native containers.
- Store owns module composition/access/conversion.
- ABI certificates admit native representations.
- SDK owns endpoint/runtime/root lifecycle.
- RRT owns the persistent orchestration crates and workloads.
This folder preserves historical measurements, source archives and experiment analysis. The live prototype workspace and duplicate launchers are removed after promotion; use current conventions, the whitepaper and normal RRT tooling.
The last selected pre-promotion artifact uses 115.089B instructions / 49 rounds, with 4.8/11.4/18.6s admission-to-completion latency and 269,484,032 bytes fleet grown Wasm capacity. Latest independently audited Motoko uses 118.381B / 49 rounds and 4.8/11.4/19.2s. Those are frozen artifacts; promotion needs its own actual canister qualification. Stable collections and pending-work upgrades remain unfinished. See qualification.
Frozen first experiment
Everything below describes the earlier f627e1f5 control and its deliberate
omissions, not the current workspace. That artifact used 121.861B instructions /
51 rounds with an exact-binary-only lifecycle and transient leaks. Its
recorded results remain useful for
locating the added cost of the composable replacement; they must not be presented
as its measurements. The source is frozen in Git and the archived build packet.
The prototype starts at repository commit 8836ac6e3c45d3543022999fc39480d924d5a758.
The heap-friendly Reactor/Rechain/Takt orchestration and seven JSON graphs are
copied from that commit's current hrrt/ source into the isolated prototype/
workspace, with srrt- package names. It does not select a historical HRRT Wasm
from its filename. In particular, the old cached-wake worktree/artifact still
used public Candid and is not this experiment's source or control.
Frozen control: implemented model
srrt-store::Module<T> binds one private RefCell<T> to one slot in a closed
actor-root directory. Binding checks the compiled type tag, size, alignment and
slot count once. Methods borrow the typed state directly; the hot path performs
only the ordinary RefCell aliasing check. Parents receive services with public
methods, while module state fields remain private. Root construction and service
dependency wiring stay explicit.
Native Vec, VecDeque, BTreeMap, BTreeSet, HashMap and concrete Rc<T>
values own their normal allocations. These replace current Store collections,
encoded records and object/reference metadata. Module lifetime is root lifetime:
there is no dynamic attach/detach graph, reference-edge publication, retirement
queue, resource ID lookup or persistent object codec.
On Wasm, the global allocator reuses the existing platform slab algorithm and shared page authority. Its Heap control and free-list pointers are retained at bootstrap+256, and every allocation claims retained Store-owned page runs. The root directory is at bootstrap+4096. Neither location is inside the 2 MiB startup reset. Runtime recovery therefore cannot reclaim these allocations. This uses the physical page provider, not Store's object/graph/access engines. The ordinary System-backed HRRT codec pool is removed from this workspace.
Reactor queues, peers, completion values, publications and indexes; each Rechain chain's history; replay records; reducer state; the seven typed engine states; logical accounting/metrics/tracing; admission receipts; and benchmark controls are root-attached modules. Callback watches, trait objects, futures, service Rcs, scheduler leases/permits and timer/controller bindings are transient. Watches were split out of Reactor's saved indexes before making those indexes retained.
The generated lifecycle rebuilds transient services from retained module slots.
cdk-rsx-wasm prepare --static-root embeds a SHA-256 digest of the complete raw
artifact and checks it before resetting statics or interpreting retained pointers
on post_upgrade. A mismatch traps. This is identical-artifact KEEP only;
equal user-record sizes or matching public Wire are not an upgrade ABI.
pre_upgrade additionally requires drained SDK callbacks/executor tasks and zero
queued admissions, pending/logical/physical workflows, transport incoming/outgoing,
completions, active exchanges, publications, recipients and subscriptions. Finished
workflow results, blocks, replay evidence and peer state remain retained. Pending
business work is preserved by rejecting the upgrade; it is never converted or
discarded to pass this gate. Timer and cleanup drivers rebuild after binding.
Behavior boundary
Business algorithms, exact request/retry bytes, transport authentication,
acknowledgements, indefinite delivery retries, finite financial replay horizon,
workflow ordering/timeouts, certification and the seven JSON graphs are retained
from the selected source. The new deferred admission owner matches current RRT's
public receipt/status behavior, FIFO and clock construction: created_at , wake
and replay expiry are computed at actual workflow admission. Receipt time stays
separate. Limits remain 4,096 queued requests and 16,384 retained receipts, with
the same validation and overflow rejection before effects. Public interfaces and
internal messages use bounded Wire. Fresh endpoint-derived metadata is required. An explicit interface comparison
found one inherited HRRT port mismatch: Block.payload lacked the RRT byte-field
annotation and described a list of u8. This prototype adds the same byte-field
annotation as RRT; the initial mismatch evidence is retained separately. The final
canonical build's complete interface comparison passed. This is a
public codec correctness fix, not an arena optimization.
The complete-workload comparison must still check all 19,200 workflows, 594,000 visits, 202,800 attempts, 180,000 deliveries, 360,000 frames, 27,600 blocks, all certified tips and an empty transport/workflow/admission/maintenance tail. Matching those totals does not by itself prove arbitrary-input parity. The existing HRRT versus Motoko/RRT orchestration differences remain a separate boundary.
Deliberate omissions
- No arbitrary changed-binary or schema conversion. Rust's native container, allocator and Rc layouts are not frozen persistence contracts.
- No dynamic module detachment, shared-child lifetime/reclamation, moving modules, stable-backed collections, module-local migration, archive fleet or Reader.
- All allocations are retained, including transient ones. Startup drops their static roots without destructing them; unreachable old services/callbacks leak across KEEP. Ordinary allocation/free/realloc costs remain in every measured call. There is no message-boundary arena reset or hidden free work.
- The generic API does not prove that arbitrary user
Tcontains no vtables, futures or borrowed/static references. The closed instantiated state types are reviewed explicitly. No persistent callbacks are permitted. - Native tests exercise the algorithms and a typed retained-image owner. The separate actual Wasm tests establish allocator recovery, IC rollback and the limited KEEP lifecycle; see RESULTS.md.
Checks and build
Native regression commands use the pinned toolchain and exclusively leased targets:
source ver1/tools/env.sh
CARGO_TARGET_DIR=/leased/native cargo test --manifest-path research/experiments/2026-10-20-minimal-runtime/prototype/Cargo.toml --locked --offline --workspace
CARGO_TARGET_DIR=/leased/native cargo test --manifest-path ver1/Cargo.toml --locked --offline -p cdk-rsx-wasm --test profile
The final native workspace suite passed 136 tests. It covers all seven source graphs, exact retry bytes and transport/replay behavior, delayed admission beyond a replay window, FIFO/reopen/receipt preservation, pending capacity and timestamp overflow, typed-image borrow/lifetime checks, and a composed root reopen preserving blocks, replay results, reducer totals and peer state. The canonical transformer's 14 tests pass, including the new exact-artifact guard. Compressed logs and the native receipt are in native-evidence. The subsequent actual Wasm gates and full interface comparison passed, as recorded in RESULTS.md. Native tests do not execute the Wasm-only retained allocator and are not substitutes for those IC KEEP tests.
After source freeze, build.py resolves complete locked offline metadata and
builds fresh Wire, raw Wasm and the canonical exact-artifact transform. It records
source hashes before/after, compiler, commands, outputs, server and verifier:
python3 research/experiments/2026-10-20-minimal-runtime/build.py \
--native-target /leased/native --wasm-target /leased/wasm \
--output /srv/shared/code/icrustmem/rrt/tmp/perf-round12/minimal-runtime/build1 \
--pocket-ic /pinned/pocket-ic --block-verifier /qualified/rrt-fourcans-wire-verify
Before the root-owned matched Heavy16 selection, run actual Wasm smoke tests for
population/drop/reuse, identical-artifact KEEP plus further append/dispatch,
rejected changed-artifact KEEP and late-trap rollback. Run the normal timer
scheduler with the same 500M budget, callback limits and workload settings as
the current Motoko/RRT report. Evidence and reusable binaries belong in main
rrt/tmp/perf-round12/minimal-runtime/, outside the sparse worktree.
A separate --app arena-probe build uses the same allocator, root directory
and generated lifecycle without adding probe endpoints to Fourcans. Its
smoke.mjs performs native-container population/drop/reuse, same-artifact KEEP,
post-KEEP allocation, changed-raw-artifact rejection, late mutation trap rollback
and a second KEEP. It uses the captured canonical tool to transform the changed
raw artifact; it never invokes Cargo or rewrites the measured Fourcans binary.
The changed artifact differs by a custom section, testing the exact artifact
rule rather than claiming schema conversion. Run it with explicit --source-root,
--artifact , --output and --pocket-ic paths after the separate probe build.