Rename FABRIC series: FABRIC.md->0, FABRIC-2.md->1, FABRIC-3.md->2, FABRIC-4.md unchanged

FABRIC.md -> FABRIC-0.md
FABRIC-2.md -> FABRIC-1.md
FABRIC-3.md -> FABRIC-2.md (the current/living document)
FABRIC-4.md unchanged (new #3 to follow separately)

Every cross-reference repo-wide updated to match, including doc-comment
citations inside kernel source (.c/.h) files -- done via an ordered
placeholder substitution (FABRIC-3.md->placeholder2, FABRIC-2.md->
placeholder1, FABRIC.md->placeholder0, then placeholders resolved to
final names) in a single pass per file to avoid double-shifting
already-renamed references.

One line in capsules/font.4th grew past the 64-char block-format limit
as a side effect of the longer filename; shortened it and reverified
with mkcapsule --lint (34/34 pass) before rebuilding.

Verified 3-arch boot to ok> (amd64/aarch64/riscv64, each in the
foreground) after the fix; logs and DoE CSVs from this session's
verification runs included per this repo's own audit-artifact
convention.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019YcT3H2PQeyujrzjqS3Var
This commit is contained in:
Robert Allan James
2026-09-04 11:22:51 -04:00
co-authored by Claude Sonnet 5
parent ff2941dfb9
commit b031b802e3
128 changed files with 37154 additions and 9572 deletions
+14 -14
View File
@@ -41,7 +41,7 @@
#include "starkernel/q48_16.h" /* Q48_ONE -- item 4.1's reservoir starts each VM's quota at 1.0 */
#include "vm.h" /* VM_MEMORY_SIZE -- the per-VM footprint stadium_max_vm_count() budgets against */
#include "block_subsystem.h" /* blk_flush() -- STADIUM_BEHAVIOUR_MIGRATE's real write-back action */
#include "starkernel/session.h" /* session_register()/session_set_pinned() -- FABRIC-3.md §H.12 step 4 */
#include "starkernel/session.h" /* session_register()/session_set_pinned() -- FABRIC-2.md §H.12 step 4 */
static StadiumCell *stadium_cell_array = (StadiumCell *)0;
static uint8_t *stadium_bitmap = (uint8_t *)0;
@@ -72,7 +72,7 @@ static size_t link_to_size(uint32_t v) {
}
/*
* StadiumVMQuota - one VM's ownership record (item 3.7, FABRIC.md §22.3).
* StadiumVMQuota - one VM's ownership record (item 3.7, FABRIC-0.md §22.3).
* See stadium.h's stadium_admit() doc for why vm_id needs a linear search
* rather than direct indexing.
*/
@@ -80,7 +80,7 @@ typedef struct {
VMUuid vm_id;
int in_use;
size_t free_head;
uint64_t reservoir; /* item 4.1, FABRIC.md §17.7 -- Q48.16, heat this VM's
uint64_t reservoir; /* item 4.1, FABRIC-0.md §17.7 -- Q48.16, heat this VM's
* quota holds but no resident patron has claimed.
* Invariant: Σ(resident patron heat) + reservoir ==
* Q48_ONE, checked the same way vm_physics_conserved()
@@ -257,12 +257,12 @@ uint8_t *stadium_header_bitmap(void) {
* for a tag that exists is a build failure, not a silent gap -- the compiler
* enforces closedness, not just this comment.
*
* MIGRATE (blocks) is real, FABRIC-3.md §B: write-back via blk_flush(),
* MIGRATE (blocks) is real, FABRIC-2.md §B: write-back via blk_flush(),
* called with the departing patron's identity (the LBN) -- stadium_evict()
* calls this BEFORE zeroing the header, so `identity` is still valid here.
*
* DELIVER (Hermes messages) needs no extra payload action here, confirmed
* 2026-08-26 (FABRIC-3.md §B): capsules/hermes/init.4th's MSG-ALLOC already
* 2026-08-26 (FABRIC-2.md §B): capsules/hermes/init.4th's MSG-ALLOC already
* admits every message with this behaviour, and MSG-FREE-NODE (called from
* both explicit ack and heat-driven reap) already evicts it -- has been
* real and live on every boot for weeks. The actual delivery action
@@ -273,7 +273,7 @@ uint8_t *stadium_header_bitmap(void) {
* message's identity, same shape as MIGRATE's lbn print, instead of
* claiming to be unimplemented.
*
* COOL (words, item 4.1; VMs, FABRIC-3.md §B) needs no extra payload action
* COOL (words, item 4.1; VMs, FABRIC-2.md §B) needs no extra payload action
* here either, same reasoning as DELIVER: stadium_evict()'s own universal
* reservoir credit is the whole of what "cooling off the floor" means for
* both patron kinds -- real and live for both since item 4.1 and this
@@ -282,7 +282,7 @@ uint8_t *stadium_header_bitmap(void) {
* for a VM) instead of a misleading "(stub)" label.
*
* EXPIRE (ACL) alone remains genuinely unbuilt -- no ACL-Stadium
* integration of any kind exists yet (FABRIC-3.md §B).
* integration of any kind exists yet (FABRIC-2.md §B).
*/
void stadium_dispatch(size_t cell_index, StadiumBehaviour behaviour) {
console_puts("Stadium: dispatch cell=");
@@ -318,7 +318,7 @@ void stadium_dispatch(size_t cell_index, StadiumBehaviour behaviour) {
}
/*
* FABRIC.md §19.2/§19.3: density is heat / mass, read on demand from fields
* FABRIC-0.md §19.2/§19.3: density is heat / mass, read on demand from fields
* already in the header -- not a value a scheduler maintains. mass == 0
* (an empty or never-admitted slot; everything is zero-initialized until
* something is actually born into the Stadium, which nothing yet does)
@@ -336,7 +336,7 @@ uint64_t stadium_density(size_t cell_index) {
return header->heat / (uint64_t)header->mass;
}
/* STADIUM_FLAG_PIN moved to stadium.h (FABRIC-3.md §H.12 step 3) -- see its
/* STADIUM_FLAG_PIN moved to stadium.h (FABRIC-2.md §H.12 step 3) -- see its
* doc comment there for why. */
static int bitmap_get(size_t cell_index) {
@@ -352,7 +352,7 @@ static void bitmap_clear(size_t cell_index) {
}
/*
* FABRIC.md §17.2: reap means leaves the floor, not destroyed. Refuses a
* FABRIC-0.md §17.2: reap means leaves the floor, not destroyed. Refuses a
* pinned header (§3) or one with a non-none `contains` (item 1.1: a patron
* holding another cannot be reaped). Refuses an out-of-range index or a cell
* whose discriminator bit is not set -- nothing resident there to reap.
@@ -407,7 +407,7 @@ int stadium_evict(size_t cell_index) {
}
/*
* FABRIC.md §19.3, §22.3, item 3.7: admit into vm_id's own quota. Pops that
* FABRIC-0.md §19.3, §22.3, item 3.7: admit into vm_id's own quota. Pops that
* VM's free-list head first (O(1), no comparison needed -- §19.3's density
* rule only governs the full case). Only if that list is empty does this
* fall back to eviction, scoped to that SAME VM's own residents (quota
@@ -496,7 +496,7 @@ size_t stadium_admit(VMUuid vm_id, const StadiumPatronHeader *candidate) {
}
/*
* FABRIC.md item 4.1a: one-time initial quota grant, not item 1.3's
* FABRIC-0.md item 4.1a: one-time initial quota grant, not item 1.3's
* (still-unbuilt) recurring transfer. See stadium.h's doc for the full
* argument. Two passes over from_vm_id's free list: the first counts it
* (need the length before deciding where to split), the second detaches the
@@ -634,12 +634,12 @@ uint64_t stadium_resident_sum(VMUuid vm_id) {
}
/*
* FABRIC.md item 3.6 / item 4.1: see stadium.h's doc. Idempotent via the
* FABRIC-0.md item 3.6 / item 4.1: see stadium.h's doc. Idempotent via the
* item-3.1 discriminator bitmap -- if cell 0 already reads as resident,
* something already birthed her (or, if it isn't actually Hera, something
* else already claimed cell 0 -- either way this must not clobber it).
*
* FABRIC-3.md §H.12 step 4: pinning no longer happens by setting
* FABRIC-2.md §H.12 step 4: pinning no longer happens by setting
* STADIUM_FLAG_PIN on the candidate before admission -- session.c's
* session_set_pinned() is now the sole choke point for that bit (§H.10).
* Hera is admitted unpinned, then registered as session zero