Add stadium_conserved() -- FABRIC-3.6.md task 0.7, item 41

Boolean analogue of vm_physics_conserved(), for the Stadium per-VM
quota invariant rather than fleet-wide execution heat
(FABRIC-3.5.md SXXXIX.4). int stadium_conserved(VMUuid vm_id), in
src/starkernel/vm/stadium.c alongside stadium_resident_sum()/
stadium_reservoir_peek() that it's built from, declared in
include/starkernel/vm/stadium.h.

Implements the two-term form -- resident_sum(vm_id) +
reservoir_peek(vm_id) == Q48_ONE -- not the three-term form SXL.4
rules for the eventual system. That ruling's `consumed` term is a
Phase 2 kernel-Hermes ledger deliverable that doesn't exist yet:
nothing draws on any VM's Stadium quota today (task 2.2 is literally
where that wiring gets built), so consumed is honestly zero right now.
Folding it in as a placeholder would be inventing Phase 2 state ahead
of it existing -- the doc comment says so explicitly, so whoever
builds Phase 2's ledger extends this function rather than working
around it.

Wired into the existing per-VM boot diagnostic
(stadium_words_print_boot_diagnostics(), kernel_main.c:810, Hera
only -- the sole existing call site) rather than adding a new one,
printing CONSERVED/DRIFTED the same shape vm_physics_status() already
uses.

Three-arch boot clean: amd64/aarch64/riscv64 all reach [zuse@Hera] ok>,
zero UNKNOWN WORD, all print "Stadium conservation: CONSERVED" with
identical resident_sum=47641 reservoir=17895 sum=65536=Q48_ONE. No
compiler warnings on either edited file (forced recompile checked).

Authorized by Captain Bob ("Yes.").

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Robert Allan James
2026-09-19 13:56:14 -04:00
co-authored by Claude Sonnet 5
parent 9886ad5315
commit 380f0a09c9
11 changed files with 27604 additions and 2 deletions
+16 -1
View File
@@ -259,8 +259,23 @@ it has simply not been attempted.)*
touched, so no 3-arch boot run for this task. All of Phase 0's strips and documentation
corrections (0.1–0.6) are now done; `stadium_conserved()` (0.7) and the `PLOT`/`FB-WIDTH`/
`FB-HEIGHT` registration audit (0.8) remain before Phase 0's gate is fully met.
- [ ] **0.7** — Add `stadium_conserved()`: `Σ patron + reservoir + consumed == Q48_ONE`,
- [x] **0.7** — Add `stadium_conserved()`: `Σ patron + reservoir + consumed == Q48_ONE`,
**epsilon zero** (§XL.4, item 41). *Check:* true on a clean boot, all three arches.
2026-09-19 · `logs/20260919-135137/amd64/`, `logs/20260919-135240/aarch64/`,
`logs/20260919-135417/riscv64/` — all three reach `[zuse@Hera] ok>`, zero `UNKNOWN WORD`,
and print `Stadium conservation: CONSERVED` (all identical: resident_sum=47641
reservoir=17895 sum=65536=`Q48_ONE`). Implemented `int stadium_conserved(VMUuid vm_id)` in
`src/starkernel/vm/stadium.c` (declared `include/starkernel/vm/stadium.h`) as
`stadium_resident_sum(vm_id) + stadium_reservoir_peek(vm_id) == Q48_ONE` — the **two-term**
form, not three. §XL.4's `consumed` term is a Phase 2 kernel-Hermes ledger deliverable that
doesn't exist yet; nothing draws on any VM's Stadium quota today (Phase 2 task 2.2 is
literally where that wiring gets built), so `consumed` is honestly zero right now and
folding it in would be inventing Phase 2 state ahead of it existing. Doc comment on the
function says exactly this, so whoever builds Phase 2's ledger extends this function rather
than working around it. Wired into the existing per-VM boot diagnostic
(`stadium_words_print_boot_diagnostics()`, `kernel_main.c:810`, Hera only — the sole
existing call site) rather than adding a new one. No compiler warnings on either edited
file (checked with a forced recompile).
- [ ] **0.8** — Audit that `PLOT`/`FB-WIDTH`/`FB-HEIGHT` are registered **nowhere** but the
table Hestia will own (item 33). *Check:* read-only; a second site is a defect to report.