Stadium: real block-patron admission + MIGRATE dispatch (FABRIC-3.md §B)

stadium_admit()'s mass==1 refusal looked like a hard blocker for 1024-byte
blocks, but stadium_word_dispatch()'s real candidate construction proves
Stadium cells carry pure identity/heat/bookkeeping, never the resident's
actual content -- a block patron follows the same shape (identity=LBN,
payload unused), so this was real, scoped work, not a case for stubbing.

New stadium_blocks.h/.c mirror stadium_words.c's admission/cooling shape,
keyed by (quota_slot, lbn) in a fixed-capacity open-addressing hash table
(tombstone deletion) instead of a dense array, since LBN space isn't
densely bounded like word_id. Wired into block_word_block()/buffer()/
update() (block_words.c), __STARKERNEL__-guarded. stadium_dispatch()'s
MIGRATE case now calls blk_flush(lbn) for real instead of printing
"(stub)". Three new Kconfig constants (STADIUM_BLOCK_HEAT_QUANTUM/
STADIUM_BLOCK_COOL_RATE_Q48/STADIUM_BLOCK_TRACK_CAP_MULT) mirror the
word-patron ones, same three-layer wiring.

VM-COOL/DELIVER/EXPIRE stay explicit punch-list items -- VM-COOL
deferred pending the still-iterating Tripod/Zuse/messaging vision,
DELIVER/EXPIRE are their own future subsystem integrations per
FABRIC.md's own "open, not resolved" notes.

Verified clean compile (zero warnings) and clean boot to REPL with
conservation intact (resident_sum + reservoir == Q48_ONE) on all three
architectures (amd64/aarch64/riscv64); BLOCK/BUFFER touches exercised
live from the REPL with no crash; a 22,000-distinct-block flood loop
against an artificially shrunk Stadium ran clean under heavy admission
load. A live MIGRATE console fire was not directly observed this
session (root-caused to a pre-existing reservoir-floor/density-eviction
interaction unrelated to this change, documented in FABRIC-3.md) --
flagged as an honest follow-up, not silently claimed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CXjAPTEKrgY2Mrk25KoLDn
This commit is contained in:
Robert Allan James
2026-08-25 23:28:59 -04:00
co-authored by Claude Sonnet 5
parent ecdb547786
commit c7c9332321
17 changed files with 27731 additions and 13 deletions
+35
View File
@@ -128,6 +128,41 @@ config STADIUM_WORD_COOL_RATE_Q48
is a reasonable starting point, not the same quantity. Untuned
placeholder: real tuning is DoE work (item 5.1).
config STADIUM_BLOCK_HEAT_QUANTUM
int "Q48.16 heat quantum moved per block touch/starter-grant (STADIUM_BLOCK_HEAT_QUANTUM)"
default 2048
help
FABRIC-3.md §B (MIGRATE punch-list item): same role as
STADIUM_WORD_HEAT_QUANTUM above, for block patrons touched via
BLOCK/BUFFER/UPDATE (stadium_block_dispatch(), stadium_blocks.c).
Default matches the word quantum -- no evidence yet that blocks need a
different starter share, and diverging without data would just be a
second untuned guess instead of one. Real tuning is future DoE work,
same as the word quantum.
config STADIUM_BLOCK_COOL_RATE_Q48
int "Q48.16 fraction of resident block heat removed per tick (STADIUM_BLOCK_COOL_RATE_Q48)"
default 21845
help
FABRIC-3.md §B (MIGRATE punch-list item): same role as
STADIUM_WORD_COOL_RATE_Q48 above, for block patrons. Default matches
the word cool rate for the same reason the heat quantum above does --
untuned placeholder, not a derived optimum.
config STADIUM_BLOCK_TRACK_CAP_MULT
int "Multiplier on stadium_cell_count() for the block residency table's capacity"
default 2
help
FABRIC-3.md §B (MIGRATE punch-list item): stadium_blocks.c's
(quota_slot, lbn) -> cell_index hash table is a fixed-capacity
open-addressing table sized at stadium_blocks_init() as
stadium_cell_count() * this value. At most stadium_cell_count() blocks
can ever be genuinely Stadium-resident at once (cells are shared across
every patron kind), so a multiplier above 1 exists only to keep probe
chains short under normal open-addressing load factors, not to track
more blocks than could ever be admitted. 2 keeps the load factor at or
below 50%. Untuned placeholder, same as the two constants above.
endif # STARFORTH_VARIANT_KERNEL
endmenu