Stage G: SEND, and two workers interleave; decision compares work heat (FABRIC-3.8 §3.8, §3.13.7)

SEND ( paddr plen name-c name-u -- ok? ): general kernel-Hermes send to a
named VM, from = calling VM, one block max (refused, not truncated), every
VM. New SK_HERMES_MSG_TYPE_SEND (30).

Ruling C-4 (beta), Captain Bob: the switch decision compares work heat --
the heat each VM pulled in by its own per-beat charges -- not absolute
heat, so Hera's structural endowment no longer makes her hottest. Before
it, the two-worker test ran serial (AAAA...BBBB); after it, byte-identical
on amd64/aarch64/riscv64:
AAABBBBBBBBAAAAAAAABBBBBAAAAABBBBBAAAAABBBBBAAAAABBBBBAAAAABBBBBAAAAABBBBBAAAABB
(40 A, 40 B, 16 runs; ordinary words only, nothing yields). Acceptance:
relay 3, idle growth 0; dict_hash set changed by the new word
(word_count 533) and identical across ISAs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Robert Allan James
2026-09-23 21:01:44 -04:00
co-authored by Claude Opus 5.5
parent c7185facf0
commit 81def7b4a5
18 changed files with 46044 additions and 7 deletions
+12
View File
@@ -111,6 +111,18 @@ void vm_physics_touch(VMUuid vm_id);
*/
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.
*/
uint64_t vm_physics_work_heat_of(VMUuid vm_id);
/**
* vm_physics_tick - Heartbeat-gated inference pass
*
@@ -138,7 +138,9 @@ int sk_vm_switch_signal_take_decision_due(void);
* Among registered participants other than `self` that have work -- a
* pending kernel-Hermes message, or parked on their own stack mid-task
* (top frame not VM_FRAME_IDLE), or (Hera only) pending console input --
* returns the one with the lowest VM-physics heat; among equally cool
* returns the one with the lowest work heat (vm_physics_work_heat_of(): heat
* earned by its own per-beat charges -- ruling C-4 (β), FABRIC-3.8.md
* §3.13.7; Hera's structural endowment doesn't count); among equally cool
* candidates, the one waiting longest (unique wait stamps). With
* self_competes set (the caller still has work), returns a candidate only
* if it is strictly cooler than `self`. Returns NULL when nobody should
+8
View File
@@ -752,6 +752,14 @@ int sk_hermes_reassemble(SkHermesMessage **chunks, int n_chunks,
* Phase 4 entry. */
#define SK_HERMES_MSG_TYPE_ELEVATE_REQUEST 8
/* SK_HERMES_MSG_TYPE_SEND (FABRIC-3.8.md §3.8, Stage G, 2026-09-23) --
* a general message from the FORTH SEND word (repl.c): payload is FORTH
* text the recipient interprets, like CONSOLE_CMD, but from any VM to any
* VM. A fresh kernel-Hermes-space value, clear of messaging.4th's old type
* space and the negotiation types (20-24) listed below -- no FORTH-side
* type ever existed for it to reuse. */
#define SK_HERMES_MSG_TYPE_SEND 30
/* The five negotiation types above (20-24) were chosen clear of
* messaging.4th's own live/reserved type space (PAUSE-EVENT=2,
* RESUME-EVENT=3, KILL-EVENT=4, CONSOLE-CMD-EVENT=7, ELEVATE-REQUEST=8,