Database-inspired stable engine experiments
Selected: packed live tree-node prefixes plus inline decoded allocator metadata. These replace the previous paths in the current stable engine. No alternate legacy allocator, CLOCK mode, owner-chunk mode or fanout switch is installed.
The actual MAIN build saves 37,102,084,821 instructions (6.73140%) on matched complete RRts Heavy16. Native RRT retains its protected measurements exactly. Both newly built artifacts pass all five lifecycle checks.
Complete workload
| Metric | Previous stable, bb5712ad | Current stable, 82c14c8e | Current native, 5db03f36 |
|---|---|---|---|
| Complete instructions | 551,179,449,765 | 514,077,364,944 | 105,264,785,076 |
| Rounds including maintenance | 93 | 85 | 49 |
| Admission p50 / p95 / maximum | 37.2 / 46.2 / 48.6 s | 31.8 / 41.4 / 43.8 s | 4.8 / 11.4 / 18.6 s |
| Root receipt p50 / p95 / maximum | 39 / 47.4 / 49.2 s | 33.6 / 42 / 45 s | 4.8 / 12.6 / 19.2 s |
| Physical calls | 2,786 | 2,571 | 2,434 |
| Heap-page instructions | 68,119,920,000 | 67,071,600,000 | 61,367,040,000 |
| Fleet-grown heap capacity | 269,484,032 B | 269,484,032 B | 269,484,032 B |
| Fleet-grown stable capacity | 292,683,776 B | 288,620,544 B | 0 B |
All runs complete 18,000 roots plus 1,200 children, 594,000 visits, 202,800 task attempts, 180,000 endpoint messages, 360,000 frames and 27,600 blocks. Seven workflow graph files are identical; 1,024 typed blocks are verified. There are no traps, rejected admissions or reoffered frames. The 500M cooperative body threshold and workload limits are unchanged. Whole-entry costs include publication: the largest selected entry is 511,420,833 instructions versus 510,780,813 previously. Lower total work does not impose a tighter per-entry cap. Stable still costs 4.88 times native; parity is not achieved.
Isolated and combined candidates
The last column is the separate populated-map screen's instruction change; it is not Heavy16 throughput. It uses three interleaved 100,000-row maps, 219 committed update entries and a different pinned server. Positive means more instructions. Capacities are grown logical memory, not live bytes or RSS.
| Candidate | Exact source | Heavy16 instructions | Change | Rounds | Admission p50 / p95 / max, s | Map-screen change |
|---|---|---|---|---|---|---|
| Stable control | 9be1a6b3 runtime |
551.179B | — | 93 | 37.2 / 46.2 / 48.6 | — |
| Fanout only | f606845b |
554.285B | +0.563% | 92 | 38.4 / 46.8 / 50.4 | -6.591% |
| Inline allocator metadata | 650d05ba |
536.259B | -2.707% | 91 | 36 / 46.2 / 50.4 | +2.798% |
| Probation + CLOCK | c9034dda |
557.208B | +1.094% | 90 | 36 / 46.2 / 49.2 | +14.186% |
| Packed live node prefix | e553ec7d |
530.079B | -3.828% | 87 | 31.8 / 43.2 / 46.8 | -0.874% |
| Fanout + prefix | b6cc99fb |
528.816B | -4.057% | 94 | 38.4 / 46.8 / 50.4 | -7.461% |
| Boxed hot/cold metadata | 6944e48d |
538.390B | -2.320% | 88 | 34.2 / 43.8 / 48 | +1.596% |
| Prefix + hot/cold metadata | be3435f8 |
514.237B | -6.702% | 88 | 35.4 / 43.8 / 47.4 | +0.722% |
| Collection-owned chunks | 43a4710d |
557.534B | +1.153% | 90 | 36 / 45.6 / 49.2 | -2.819% |
| Prefix + inline metadata — selected | 9570bd50 |
514.077B | -6.731% | 85 | 31.8 / 41.4 / 43.8 | +1.926% |
| Fanout + prefix + hot/cold | a44164db |
517.705B | -6.073% | 84 | 31.2 / 42.6 / 45 | -4.193% |
The inline combination wins complete instructions, with all latency points below the control. Adding fanout improves map-screen scans and footprint, but raises Heavy16 cost by 3.627B against that winner and worsens p95/maximum latency. Hot/cold metadata improves some point-read cases but does not win the complete workload. CLOCK and owner chunks regress Heavy16. Owner allocation and larger fanout remain research evidence for a future index-oriented engine, rather than unconditionally changing the generic stable engine.
The selected combination's map screen costs 1.9265% more overall: scans improve about 5.63%, single transfers about 2.86%, while first lookup and distant separate calls cost more. Extra heap-page fees explain most of the overall regression. This tradeoff is retained explicitly; component gains are not added or advertised as universal wins. Full scenario means, first-call limits and corrected heap units are in probe results.
Implementation and review
The allocator keeps decoded frontier/generation/bin fields inline and publishes changed summaries once at frame finish, after retirement and module publication. Unscoped changes publish synchronously; discard invalidates the cache. Committed stable bytes remain authoritative, and persistence failures trap through the IC. The stable anchor layout, block identities, class slabs and FIFO policy remain.
Map and Set nodes keep contiguous live key and value planes, followed by branch-only children. Structural writes and iterator snapshots omit spare bytes; node allocation classes and the 31-key ceiling remain. Count-dependent point edit offsets stay protected by the mutable Map loan. The compiled interpretation policy admits this new prototype layout; there is no previous-format reader.
Peer review covers publication order, retirement, query discard, stale generations, pin lifetimes and checked KEEP. Fresh MAIN checks pass 158 native tests plus 30 doctests, with nine additional RRts common tests. Actual stable/native Wasm lifecycle checks each pass all five gates. Native protection matches 14 audit and 67 workload vectors; all 25,091 replicated rows match except trace sequence IDs. Query row identity is outside that claim.
The current compiled snapshot contains the exact six selected code/test files
from 9570bd50, while build metadata records then-HEAD 8aa6f759. This is an
actual MAIN working-tree build, not a clean integration-commit rebuild. Immutable
source archives and current inputs were independently checked against the exact
Git blobs. The selected branch and MAIN have identical stable instruction/latency
vectors; observed complete cycles differ by 92, which are not instructions.
See machine-readable qualification and
independent IC audit for hashes and measurement boundaries.
Measurement and reproduction
Matched Heavy16 uses the old pinned 1fc9e6f5 binary and frozen v1 host scripts,
including normal drain and maintenance. Finished replicated instruction totals
include ordinary SDK, Wire, buffering, copying and page charges. Nonreplicated
queries, aborted DTS and scheduler-only accounting are excluded. Subtracting the
exported heap fees does not isolate pure computation or stable source fees.
The newer 2e1dae35 profiler supplies the separate populated-map screen; these
runtimes are not mixed in one control/candidate comparison. The
previous qualification pins the reused controls.
Build the application through rrts/tools/build.py --app fourcans, using a fresh
artifact directory, explicit pinned PocketIC binary, reference interface and
exclusively owned warm target. Use frozen v1 rrt/tools/run-heavy.py for the old
server, selecting that artifact explicitly. The packet records exact source,
manifest, raw audit, output and lifecycle hashes. Targets are shared with content
freshness, never mtime-only reuse. Controls were not rebuilt.
The probe runner was held byte-identical at 8aa6f759 for all eleven runs. After
measurement, its reporting-only correction renamed the mislabeled page count,
derived capacity bytes, recorded the host hash and saved failure traces before
instance deletion. Original results remain unchanged; this host correction does
not claim a new guest benchmark run.
Primary-source research and implementation screens: InnoDB/owner chunks, cache policy, page layout, metadata, hot/cold metadata, prefix + hot/cold, and fanout combination.