Stage K-4: quota slots released to the best donor; message cells out of the admission fallback (FABRIC-3.10.8 §4.4)
- stadium_release_quota(): evict every patron but pending messages, mark the slot retiring; stadium_retire_sweep() releases a retiring slot once nothing is resident -- free cells to the best donor (ruled), word row and block-table entries cleared, slot free for reuse. Swept at release and after evictions while any slot is retiring. - Called on KILL and reap, and for the nine synthetic self-test ids after the boot self-tests. Hera's slot never released. - Admission fallback skips DELIVER (message) cells. - Probe (removed): slots in use == live VMs after boot and after 56-64 churned VMs on all three ISAs; forced fallback kept the message cell resident and intact; conserved everywhere; K-1's post-churn Hermes refusal gone (1 2 + . -> 3 on the churned system). Heap growth per 28-VM churn halved (~3.4 KB/VM still retained -- open as K-8). - Standard sequence on amd64/aarch64/riscv64: hash, G, ledger unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
9e41fb03ab
commit
1166713cc9
@@ -538,3 +538,65 @@ The results are identical on all three ISAs:
|
||||
3. The `CONNECT-HERMES` word (`mama_forth_words.c` ~2257) still births and names a Hermes VM.
|
||||
|
||||
**K-3 closes §8 defect 4.**
|
||||
|
||||
### 4.4 K-4 — quota slots released; message cells kept out of the admission fallback (2026-09-26)
|
||||
|
||||
**Change** (stadium.c; ruling: released cells go to the best donor). Release happens in two steps, because a dead VM's slot can still hold cells for messages it **sent** that sit in other VMs' queues.
|
||||
1. **`stadium_release_quota(vm_id)`**, under `g_lock_stadium`, then the slot's lock:
|
||||
- every resident patron except pending messages (DELIVER) is evicted, its heat back to the slot's reservoir; pins are cleared first, since a dead VM's pins no longer matter;
|
||||
- the slot is marked **retiring**, and is never a donor while retiring;
|
||||
- a patron eviction refuses (one holding another) stays resident and is logged.
|
||||
2. **`stadium_retire_sweep()`** runs at release, and after any eviction while a slot is retiring, which is how a retiring slot's last message leaving completes its release. It is one atomic load when nothing is retiring. For each retiring slot with nothing resident:
|
||||
- detach the free list;
|
||||
- clear its word row (`stadium_words_slot_released()`, under the slot lock) and its block-table entries (`stadium_blocks_slot_released()`, under the global lock);
|
||||
- hand the cells to the best donor (one slot lock at a time, each cell's owner set to the donor);
|
||||
- clear the slot and publish `in_use = 0`.
|
||||
|
||||
The dead VM's Q48_ONE share leaves with the slot. The donor gains free cells only, with no heat, so its own sum is unchanged.
|
||||
- **Callers:**
|
||||
- KILL and reap release the VM's slot after its Hermes departure;
|
||||
- `kernel_main.c` releases the nine synthetic self-test ids (hi 0, lo 1, 3, 7, 11, 13, 15, 16, 19, 20) after the last self-test, and prints `Stadium: self-test quotas released=`;
|
||||
- Hera's slot is never released.
|
||||
- **MC-0d finding 3:** the admission fallback skips message (DELIVER) cells. A message leaves Stadium only through its release.
|
||||
|
||||
**Probe** (temporary `K4-PROBE` / `K4-FALLBACK` words, removed before commit). They print:
|
||||
- quota slots in use (and retiring) against live VMs, conservation on every live VM, slots released so far, and heap used;
|
||||
- **the forced fallback:**
|
||||
1. grant a synthetic slot T, and send one real message from it to a synthetic receiver;
|
||||
2. fill T's free list with zero-heat fillers until admission refuses;
|
||||
3. admit a denser candidate (heat 1, pulled from T's reservoir) and check the message cell;
|
||||
4. clean up: the receiver departs (its mail released), then T is released.
|
||||
|
||||
Then two `churn.sh` rounds (28 worker births, jobs and KILLs each), `K4-PROBE` after each, and the standard sequence **on the churned system**, the direct test of K-1's post-churn refusal.
|
||||
|
||||
| ISA | log | self-test quotas released | slots in use = live VMs (boot / churn 1 / churn 2) | fallback: denser admitted, message cell resident and intact | post-churn `1 2 + .` |
|
||||
|---|---|---|---|---|---|
|
||||
| amd64 | `logs/20260926-035738` | 9 | 3=3 / 3=3 / 4=4 † | yes, yes, yes | `3` |
|
||||
| aarch64 | `logs/20260926-042229` | 9 | 3=3 / 3=3 / 3=3 | yes, yes, yes | `3` |
|
||||
| riscv64 | `logs/20260926-044430` | 9 | 3=3 / 3=3 / 3=3 | yes, yes, yes | `3` |
|
||||
|
||||
- Every live VM was conserved at every reading, with 0 Hermes audit failures and 0 slots left retiring.
|
||||
- † amd64: my script's timeout cut the second churn short (36 kills). I ran a third full round, 64 churned VMs in total, past K-1's 56; one worker from the interrupted round was still alive at the final reading.
|
||||
|
||||
**K-1's carried criterion (heap), re-measured:**
|
||||
|
||||
| Heap growth per 28-VM churn round | round 1 | round 2 |
|
||||
|---|---|---|
|
||||
| amd64, K-1 (before K-4) | +324,960 | +201,696 |
|
||||
| aarch64, K-4 | +95,584 | +95,200 |
|
||||
| riscv64, K-4 | +95,584 | +95,200 |
|
||||
|
||||
The per-round growth halved, but about **3.4 KB is still retained per churned VM**, so the "within one allocation" criterion is **still not met**. Registry nodes are kept by design (a node per VM ever born); the rest is unidentified. It stays open as **K-8: find the ~3.4 KB/VM residual**.
|
||||
|
||||
**K-1's post-churn Hermes refusal is gone:** after 56–64 churned VMs, rajames's `1 2 + .` returns `3` on every ISA. That confirms the refusal was the quota leak.
|
||||
|
||||
**Standard sequence** (clean build, with the probe reverted; the tree is byte-identical to the saved stage diff).
|
||||
|
||||
| ISA | log | O-A (G, PREC, LOAD) | M7.1a hash | MINT / WIREBIND / USE / `1 2 + .` | idle growth | UNKNOWN / faults |
|
||||
|---|---|---|---|---|---|---|
|
||||
| amd64 | `logs/20260926-050559` | A=40 B=40, HHH, ok | `0x99b01134c3d3049c` | all ok, `3` | 0 B / 20 s | 0 / 0 |
|
||||
| aarch64 | `logs/20260926-051834` | A=40 B=40, HHH, ok | `0x99b01134c3d3049c` | all ok, `3` | 0 B / 20 s | 0 / 0 |
|
||||
| riscv64 | `logs/20260926-053135` | A=40 B=40, HHH, ok | `0x99b01134c3d3049c` | all ok, `3` | 0 B / 20 s | 0 / 0 |
|
||||
|
||||
- The G string and the ledger line (the K-3 baseline) are unchanged.
|
||||
- **K-4 closes MC-0d findings 2 and 3.** K-1's heap criterion carries on as K-8.
|
||||
|
||||
Reference in New Issue
Block a user