starkernel: restate VM fleet heat transfer on the virtual tick

Punch list §25 item 2.1 complete.
vm_physics_touch() no longer takes a wall-clock timestamp -- it reads
fleet_heartbeat_tick_count internally, which is execution-paced
(vm_runtime.c:143), not wall-clock. VMPhysics.last_active_ns ->
last_active_tick, VMFleetTouchSample.elapsed_us -> elapsed_ticks, and a
new explicit `touched` flag replaces the old `> 0` sentinel (tick 0 is
a legitimate value a first touch can land on, unlike wall-clock ns).

Verified: three-architecture boot (amd64 x2, aarch64, riscv64), all
reaching ok> with identical dict_hash=0x3d4e1daf289da94f matching the
item-0.10 baseline. No new compiler warnings in the touched files.

Honestly flagged, not fixed: with Tripod pruned to Hera alone (item
0.1), vm_physics_touch()'s fan-out has no other live VM to pull heat
from, so the fleet-heat-sum acceptance criterion is trivially satisfied
rather than genuinely stress-tested -- a real check needs Phase 4's
multi-VM fleet. fleet_transfer_slope_q48's seed (65536/3) was
calibrated for elapsed microseconds and has not been re-fit for elapsed
ticks; left as-is rather than guessed, deferred to item 5.1's DoE work.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Robert Allan James
2026-08-04 13:15:50 -04:00
co-authored by Claude Sonnet 5
parent f2eb877691
commit 542d7dbf0d
13 changed files with 41843 additions and 60 deletions
+32 -1
View File
@@ -2506,7 +2506,7 @@ document and committing that amendment as its own item.*
## 25.3 Phase 2 — Prepare the existing physics
- [ ] **2.1 — Restate heat transfer on the virtual tick.**
- [x] **2.1 — Restate heat transfer on the virtual tick.**
`vm_physics_touch()` scales transfers by wall-clock elapsed time
(`capsule_vm_physics.c:272`). Restate it on **the virtual tick** — the execution-derived
counter of §16.4 as ruled, not the hardware heartbeat, whose interleaving with execution
@@ -2525,6 +2525,37 @@ document and committing that amendment as its own item.*
> fleet heat is what has to be compared. Run 0.10's dict-hash check as well, as a
> regression guard — but it is not evidence for 2.1.
> **DONE 2026-08-04.** `vm_physics_touch()` no longer takes a `now_ns` parameter at all —
> it reads `fleet_heartbeat_tick_count` internally, which `vm_runtime.c:143` confirms is
> execution-paced (advanced once per `vm_tick()` call), not wall-clock. `VMPhysics.last_active_ns`
> → `last_active_tick`; `VMFleetTouchSample.elapsed_us` → `elapsed_ticks`; a new explicit
> `touched` flag replaces the old `> 0` sentinel, which doesn't safely carry over to tick
> counts (a genuine first touch can land on tick 0). The three call sites (VM-EXEC,
> VM-CALL, VM-STEP in `mama_forth_words.c`) dropped `vm_monotonic_ns(vm)` accordingly.
> `vm_physics_heartbeat_tick()`/`vm_physics_tick()`'s own dead `now_ns` parameters were
> left alone — already unused, already documented as such, out of this item's scope.
>
> **Regression: clean.** All three architectures boot to `ok>` with identical
> `dict_hash=0x3d4e1daf289da94f`, matching the item-0.10 baseline, on amd64 (×2), aarch64,
> and riscv64. Logs: `logs/20260804-113146`, `logs/20260804-113233` (amd64 pair),
> `logs/20260804-131020` (aarch64), `logs/20260804-131119` (riscv64). No new compiler
> warnings in the touched files.
>
> **Honest limitation on the fleet-heat-sum acceptance criterion.** With Tripod pruned to
> Hera alone (item 0.1), `vm_physics_touch()`'s fan-out has no other live VM to pull heat
> from — `others_total` is always 0, so the fleet heat sum is trivially `Q48_ONE` on every
> boot regardless of whether the tick logic is correct. The double-boot dict-hash match is
> a valid regression guard (as the acceptance note above already says), but it does not
> actually stress-test this item's new code path. A real check needs at least one other
> live VM to touch, which returns in Phase 4 (Hermes/Artemis) — not fabricated here.
>
> **Unresolved, flagged not fixed:** `fleet_transfer_slope_q48`'s seed (65536/3) was
> calibrated against elapsed wall-clock microseconds; elapsed ticks between touches is a
> different quantity at a different scale, and the seed has not been re-fit against it.
> Left as-is per §25.0 rule 4 (no invented numbers) — a real re-tune is DoE work (item
> 5.1), and can only be meaningfully measured once Phase 4 restores a multi-VM fleet
> anyway, per the limitation just above.
- [ ] **2.2 — Bound the VM registry.**
The registry is a `kmalloc`-backed unbounded list (`capsule_vm_physics.c:71-72`). Give it
the hard bound decided in 1.5.