Stage H: DoE rebuilt on BIRTH/SEND/KILL, defs-only workloads; work heat floor on contact (FABRIC-3.8 §3.9, §3.13.7)

Workload capsules the DoE births are definitions only; each defines WL-RUN
(its old birth-time work plus its entry word twice) and WL-DONE-ARGS. The
driver births N workers, SENDs each 'WL-RUN WL-DONE-ARGS SEND', waits in an
ordinary loop for N MU-DONE messages, KILLs them (parked idle), and emits
the marker. The serialized VM-EXEC round-robin is gone.

Kernel: no switch checkpoint after a payload's last word; work heat is the
assessed per-beat charge, and a VM gaining work is raised to the busy set's
floor (Captain Bob's ruling) -- fixes a live stall where a busy-waiting Hera
never yielded, without serializing batch starts.

Evidence: cfg-4 rows spread evenly over Hera and all 8 worker slots (44k
switches); full cfg-4 trials on amd64/aarch64/riscv64 end fail=0 with 8/8
KILL dead; Stage G interleave byte-identical on all three. Acceptance:
dict_hash unchanged, relay 3, idle growth 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Robert Allan James
2026-09-23 23:48:16 -04:00
co-authored by Claude Opus 5.5
parent 81def7b4a5
commit f152a91099
29 changed files with 165584 additions and 153 deletions
+20 -6
View File
@@ -114,15 +114,29 @@ void vm_physics_charge(VMUuid vm_id);
/**
* vm_physics_work_heat_of - Cumulative heat a VM has pulled in by working
*
* FABRIC-3.8.md §3.13.7, ruling C-4 (β), Captain Bob 2026-09-23: the sum of
* every transfer vm_physics_charge() actually moved INTO this VM -- heat
* earned by its own work, independent of any structural endowment (Hera's
* initial Q48_ONE). This is the quantity the switch decision compares
* ("coolest VM with work" = least work heat). Only grows; 0 for an unknown
* or dead VM.
* FABRIC-3.8.md §3.13.7, ruling C-4 (β), Captain Bob 2026-09-23: heat
* earned by the VM's own work -- the charge vm_physics_charge() assessed at
* each of its beats (beats x slope, in the charge carry's sub-unit scale),
* whether or not the rest of the fleet held heat to move -- independent of
* any structural endowment (Hera's initial Q48_ONE). This is the quantity
* the switch decision compares ("coolest VM with work" = least work heat).
* Never decreases, except that it may be raised by
* vm_physics_work_heat_floor(). 0 for an unknown or dead VM.
*/
uint64_t vm_physics_work_heat_of(VMUuid vm_id);
/**
* vm_physics_work_heat_floor - "Floor on contact" (Captain Bob, Stage H)
*
* Raise vm_id's work heat to floor_q48 if it is below it; never lowers it.
* Called when a VM that had no work gains some (sk_vm_switch_signal_note_
* work_gained()), with the lowest work heat among the VMs that currently
* have work -- so a newly-busy VM joins the running set level with its
* floor instead of at whatever it last had (0 for a new VM), which would
* otherwise let it run alone until it "caught up."
*/
void vm_physics_work_heat_floor(VMUuid vm_id, uint64_t floor_q48);
/**
* vm_physics_tick - Heartbeat-gated inference pass
*
@@ -150,6 +150,15 @@ int sk_vm_switch_signal_take_decision_due(void);
*/
struct VM *sk_vm_switch_decide(struct VM *self, int self_competes);
/* Stage H, "floor on contact" (Captain Bob, 2026-09-23): vm_id just gained
* work (kernel_hermes.c: its queue went from empty to one message). If it
* had none before -- not running, not parked mid-task -- raise its work
* heat to the lowest work heat among the VMs that have work now (the one
* running and every eligible participant). A new or long-idle VM thus
* joins the busy set level with its floor, rather than at 0 and running
* alone until it "caught up" with VMs that have worked since boot. */
void sk_vm_switch_signal_note_work_gained(VMUuid vm_id);
/* Reap one participant marked pending_reap (a WIREBIND identity whose
* device detached while it was parked), if any. Call only at a safe point
* (checkpoint, trampoline, idle point) -- same contract the old Stage 3