interplane.Get Omega
Read in your language

aien-sovereign-core-mv

AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination.

Brought by drakestapleton

[27B P1] Choose bounded complete-state RAM or disk reuse by measured time saved

Open · #718 · open 2026-10-23 23:03 UTC

Imported from GitHub aien-dev/aien-sovereign-core-mv#718, by drakestapleton

drakestapleton wrote on 2026-10-23 23:03 UTC

Parent delivery index: #715. New first-party implementation/tests/automation are handwritten seeded .om; use existing compiler, runtime and migration owners. Reconcile current heads, PRs, comments, consumer pins and recovery archives before edits. No permanent Rust/C/.osc/Python implementation or hidden third-party inference engine. Qualify affected replacements before deleting superseded active code. Preserve live service, driver state, visibility and existing hardware coordination. Exact hashes, commands, raw results, negative controls and independent final-source review are required. Hardware NOT_RUN is not PASS.

Gap and ownership

Main kv_persist.rs blob 11129180724f6f0fd992e23e863bfbc301b396d8 provides sealed prefix persistence. qwen38/serve explicitly excludes attention-only persistence. #713 owns complete-state snapshots and restore correctness; #484 owns durable store/identity and #485 owns nonblocking offload. This issue adds bounded snapshot allocation and the reuse decision policy without recreating those systems.

Acceptance

  • Extend #713's complete accepted state: attention KV, all model recurrent states, convolution tails, positions, pending consumed/emitted boundary and drafter state; include sampler state only where its continuation contract requires it.
  • Retain committed-prefix pages/compact state within an explicit byte budget rather than duplicating whole context arenas. Count allocated backing, metadata, COW references, staging and transient scratch; freeing slots is not necessarily released RAM.
  • Choose fresh prefill, best compatible RAM state or disk restore by estimated total completion cost: lookup+read/decrypt/validate+transfer+reconstruction+suffix prefill. A longer disk prefix does not automatically win over a shorter RAM hit.
  • Calibrate on observed timing; bind profiles to model/tokenizer/template/precision/layout/backend and context shape; bound stale-data fallback and avoid eviction/restore oscillation.
  • Record candidate costs, selected source, actual time saved/lost and miss/corruption fallback without exporting private traces. Preserve namespace isolation, checksums/sealing and atomic publication from #484.
  • Test RAM-vs-disk crossover with injected I/O delays; repeated restore+suffix equals fresh prefill; speculative rejection, pending token, cancel/reuse, cross-session COW, quota exhaustion, corrupt/incompatible cache and restart recovery.
  • Prove ready resident work progresses while another restore waits using #485's test contract. Do not hold runtime locks through disk waits.
  • Measure cold prefill, warm RAM, host-page-cache restore and actual NVMe restore separately on the qualified 27B artifact. Report next-turn TTFT, memory, restore/commit cost and full workload latency. Preserve the simpler policy when measured overhead outweighs reuse.

drakestapleton wrote on 2026-10-23 23:15 UTC

Native policy and tests pushed at 631fd32ca3f6bf47dca8082bbea3deee38813e2a (functional source 46f6b43a845c91ae6ffaed9a15d7e52a29d9cebd), branch perf/native-state-reuse-718.

The handwritten .om selector compares seven full-cost phases across fresh/RAM/disk candidates, checks complete-state/profile assertions, accounts for retained plus transient memory, and uses bounded switching margins and observed-cost smoothing. Existing #713 state, #484 store and #485 scheduling ownership is unchanged.

Author tests: 16,210 checks PASS. Independent tests: 24,588 checks PASS; parent rebuilt and replayed them. Six compiling behavioral controls fail as required. Independent final-source review found no blocking defect in this standalone policy scope. Source, contract and reproduction; evidence.

Repository preflight FAIL: browser_mirror::tests::stub_page_screenshot_and_eval (WebSocket read unavailable) and eight dependency advisories. Native serving attachment, actual snapshot/allocation/restore, scheduler overlap and all 27B hardware measurements remain NOT_RUN. This is not a measured speedup, accepted merge or issue completion. Existing sole PR desk retains publication and normal gates.

drakestapleton wrote on 2026-10-24 00:05 UTC

Continued L790 beyond the decision-only component: perf/native-state-reuse-718 at c496b2ed adds a handwritten native backing-page allocator and connects its actual allocation count to the existing cost selector.

Pages share backing through bounded references; writing shared data copies one page, preserves the prior contents, and transfers the writer's reference only on success. Final release unmaps the backing before reducing its charge. Allocation/copy refusal preserves prior ownership and data. Stable slot generations survive reconfiguration and retire before wrapping. This consumes the existing L788 managed mapping compiler, with no new mapping runtime, cache, store or device arena.

Verified 37,905 author checks, 2,437,621 independent checks, 40 allocator/policy integration checks, and the original 16,210 policy checks under the mapped compiler. Actual exhaustion/recovery of the runtime's 128 mapping slots, 1,048,576 balanced references, multi-chunk COW data, stale IDs and quotas were exercised. Three compiling faulty variants were detected. Parent rebuilt the independent suite.

Independent review caught an eight-byte metadata underestimate caused by compiler alignment. Corrected to 17,984 bytes; the unchanged focused budget test fails on old source and passes on final source. Emitted-binary layout confirms the charge. Review, source/compiler/binary pins, raw results and reproduction are in evidence/state-reuse-718/pages/.

This is hosted backing allocation and policy integration, not complete model snapshots. Historical tree-verify-wire retains KV in the live arena while copying recurrent/tail state, so it does not qualify independent shared snapshots. #713 retains full-state composition/restore ownership; #484/#485 retain identity/storage/nonblocking overlap. Namespace/session authority, actual restore-vs-fresh equivalence, GPU/serving attachment and measurements remain open. Existing failed repository preflight and sole review desk remain unchanged; no issue closure or speedup claimed.

drakestapleton wrote on 2026-10-24 01:15 UTC

PR #726 now includes automatic native host qualification at 50a4fc248058fd148385c5d3176616774f6a3e90.

  • The actual verification runner passes SC-NATIVE-STATE-REUSE: all seven suites, clean source tree, no cache reuse. Exact policy/page/integration outputs and budget/quota results are checked. Independent altered-output and compiler-failure controls are rejected; additional controls reject wrong exits, signals, deadlines and reused scratch.
  • The existing offline pin mechanism selects the exact corrected compiler from Omega #676 and verifies source/binary digests. The legacy omega.lock remains unchanged; this dependency is still unmerged.
  • Planning now reports no unmapped paths. Configuration review, compiler integration and the other repository gates remain required. Evidence: native gate results.

Complete-model restore, serving integration and measured inference benefit remain open. No signed release qualification or issue closure is claimed. Authored and verified with Codex at Drake's request.

Sign in to comment