Stage D batch 7 (final): mama_forth_words.c groups 5+6 -- dictionary lookup/test words + Stadium primitives; Stage D closed (FABRIC-3.md §XXXII.6)
NAME>XT/RUNCAP-TEST/PAIR-TEST and the six STADIUM-* physics primitives (STADIUM-ADMIT/STADIUM-EVICT/STADIUM-RES-PULL/STADIUM-RES-PUSH/ STADIUM-HEAT@/STADIUM-HEAT!), 12 sites -- closes mama_forth_words.c and the entire kernel-only error-handling audit. All 105 sites from the §XXXII.3 triage now accounted for: 28 already correct, 75 silent sites fixed across repl.c/inference_words.c/ log_words.c/vm_core.c/mama_forth_words.c, 2 special cases resolved by dropping the error per their own documented contract, 1 resolved via console_println() per its own recursion constraint. Verified with awk: zero remaining vm->error=1 sites in mama_forth_words.c lack a diagnostic within the preceding three lines. Three-arch clean qemu acceptance passed. This closes Stage D and the USE/logging/audit thread opened in §XXXII; Stage E (human-vs-unattended identity model) remains open, not started this pass. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BWpNjdwPtFLuVLaAq44L9K
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
90c86c6006
commit
42d4bf3dad
+30
@@ -4669,3 +4669,33 @@ and `ELEVATE-PUBKEY-UNPACK` have no sibling guard in their own function bodies -
|
|||||||
regression unaffected -- including the `mint_pop_string()` signature change compiling cleanly
|
regression unaffected -- including the `mint_pop_string()` signature change compiling cleanly
|
||||||
across all four call sites.
|
across all four call sites.
|
||||||
|
|
||||||
|
**Batch 7 -- DONE, 2026-09-15: groups 5+6 (dictionary lookup/diagnostic-test words `NAME>XT`/
|
||||||
|
`RUNCAP-TEST`/`PAIR-TEST`, and the six `STADIUM-*` physics primitives) -- 12 sites. Closes
|
||||||
|
`mama_forth_words.c`, and with it the entire kernel-only error-handling audit.** `RUNCAP-TEST`
|
||||||
|
and `PAIR-TEST` matched their own existing `console_println()` siblings. `NAME>XT` and all six
|
||||||
|
`STADIUM-*` primitives (`STADIUM-ADMIT`/`STADIUM-EVICT`/`STADIUM-RES-PULL`/`STADIUM-RES-PUSH`/
|
||||||
|
`STADIUM-HEAT@`/`STADIUM-HEAT!`) have no sibling guard -- kept `log_message()`, the file's
|
||||||
|
established default for a function with nothing else to match.
|
||||||
|
|
||||||
|
**Verified:** three-architecture `clean qemu` acceptance (amd64/aarch64/riscv64) passed.
|
||||||
|
|
||||||
|
**Stage D closed.** All 105 sites from §XXXII.3's triage now accounted for: 28 were already
|
||||||
|
correct (untouched), 75 silent sites across `repl.c`/`inference_words.c`/`log_words.c`/
|
||||||
|
`vm_core.c`/`mama_forth_words.c` gained diagnostics (or, for the two flagged special cases,
|
||||||
|
had their error dropped entirely to match their own documented contract), and the one remaining
|
||||||
|
category-iii site (`log_word_append_raw()`) was resolved with `console_println()` per its own
|
||||||
|
recursion constraint. Verified with `awk` across the full file after the final batch: zero
|
||||||
|
`vm->error = 1;` sites anywhere in `mama_forth_words.c` lack a diagnostic within the preceding
|
||||||
|
three lines. Seven commits total for Stage D (`5417ffb`, `1a8c0e4`, `66c2f3e`, `b42c3b1`,
|
||||||
|
`8b5300f`, `90c86c6`, and this one), each its own 3-arch acceptance boot, two real bugs found
|
||||||
|
and fixed along the way (`vm_compile_call()`/`vm_exit_compile_mode()`'s NULL-deref risk,
|
||||||
|
batch 3) that were never part of the original scope but surfaced directly from doing the fix
|
||||||
|
carefully rather than mechanically.
|
||||||
|
|
||||||
|
This closes the four-part initiative opened in §XXXII: Stage A (`USE` fix, root-caused past the
|
||||||
|
original symptom into the Hera-fault-scoping gap it exposed), Stage B (logging policy +
|
||||||
|
level-aware eviction), Stage C (triage), Stage D (fixes, this entry). §XXXII.2's human-vs-
|
||||||
|
unattended identity model remains open as Stage E, not started this pass -- its four design
|
||||||
|
questions (§XXXII.2) still need settling on paper before any code, per that section's own
|
||||||
|
"Stage E" plan.
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Capsule Block Manifest — Auto-generated
|
# Capsule Block Manifest — Auto-generated
|
||||||
<!-- Generated by mkcapsule --manifest 2026-09-15T23:44:09Z -->
|
<!-- Generated by mkcapsule --manifest 2026-09-16T00:15:36Z -->
|
||||||
<!-- DO NOT EDIT — re-run mkcapsule --manifest to refresh. -->
|
<!-- DO NOT EDIT — re-run mkcapsule --manifest to refresh. -->
|
||||||
<!-- Hand-written justifications and immutability notes live -->
|
<!-- Hand-written justifications and immutability notes live -->
|
||||||
<!-- in MANIFEST.md alongside this auto-generated index. -->
|
<!-- in MANIFEST.md alongside this auto-generated index. -->
|
||||||
|
|||||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1226,6 +1226,7 @@ static void mama_word_zuse_eligible_query(VM *vm)
|
|||||||
static void mama_word_name_to_xt(VM *vm)
|
static void mama_word_name_to_xt(VM *vm)
|
||||||
{
|
{
|
||||||
if (vm->dsp < 1) {
|
if (vm->dsp < 1) {
|
||||||
|
log_message(LOG_ERROR, "NAME>XT: stack underflow");
|
||||||
vm->error = 1;
|
vm->error = 1;
|
||||||
vm_push(vm, 0);
|
vm_push(vm, 0);
|
||||||
return;
|
return;
|
||||||
@@ -1238,6 +1239,7 @@ static void mama_word_name_to_xt(VM *vm)
|
|||||||
}
|
}
|
||||||
const uint8_t *name = vm_ptr(vm, (vaddr_t)caddr);
|
const uint8_t *name = vm_ptr(vm, (vaddr_t)caddr);
|
||||||
if (!name) {
|
if (!name) {
|
||||||
|
log_message(LOG_ERROR, "NAME>XT: invalid address on the stack");
|
||||||
vm->error = 1;
|
vm->error = 1;
|
||||||
vm_push(vm, 0);
|
vm_push(vm, 0);
|
||||||
return;
|
return;
|
||||||
@@ -1295,7 +1297,11 @@ static void mama_word_runcap_test(VM *vm)
|
|||||||
cell_t u, caddr;
|
cell_t u, caddr;
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
|
|
||||||
if (vm->dsp < 1) { vm->error = 1; return; }
|
if (vm->dsp < 1) {
|
||||||
|
console_println("RUNCAP-TEST: expects S\" name\" RUNCAP-TEST -- nothing on the stack");
|
||||||
|
vm->error = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
u = vm_pop(vm);
|
u = vm_pop(vm);
|
||||||
caddr = vm_pop(vm);
|
caddr = vm_pop(vm);
|
||||||
|
|
||||||
@@ -1306,7 +1312,11 @@ static void mama_word_runcap_test(VM *vm)
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
const uint8_t *p = vm_ptr(vm, (vaddr_t)caddr);
|
const uint8_t *p = vm_ptr(vm, (vaddr_t)caddr);
|
||||||
if (!p) { vm->error = 1; return; }
|
if (!p) {
|
||||||
|
console_println("RUNCAP-TEST: invalid address on the stack");
|
||||||
|
vm->error = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
for (i = 0; i < (uint32_t)u; i++) vm_name[i] = (char)p[i];
|
for (i = 0; i < (uint32_t)u; i++) vm_name[i] = (char)p[i];
|
||||||
}
|
}
|
||||||
vm_name[u] = '\0';
|
vm_name[u] = '\0';
|
||||||
@@ -1345,7 +1355,11 @@ static void mama_word_pair_test(VM *vm)
|
|||||||
cell_t u, caddr;
|
cell_t u, caddr;
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
|
|
||||||
if (vm->dsp < 1) { vm->error = 1; return; }
|
if (vm->dsp < 1) {
|
||||||
|
console_println("PAIR-TEST: expects S\" name\" PAIR-TEST -- nothing on the stack");
|
||||||
|
vm->error = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
u = vm_pop(vm);
|
u = vm_pop(vm);
|
||||||
caddr = vm_pop(vm);
|
caddr = vm_pop(vm);
|
||||||
|
|
||||||
@@ -1356,7 +1370,11 @@ static void mama_word_pair_test(VM *vm)
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
const uint8_t *p = vm_ptr(vm, (vaddr_t)caddr);
|
const uint8_t *p = vm_ptr(vm, (vaddr_t)caddr);
|
||||||
if (!p) { vm->error = 1; return; }
|
if (!p) {
|
||||||
|
console_println("PAIR-TEST: invalid address on the stack");
|
||||||
|
vm->error = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
for (i = 0; i < (uint32_t)u; i++) console_name[i] = (char)p[i];
|
for (i = 0; i < (uint32_t)u; i++) console_name[i] = (char)p[i];
|
||||||
}
|
}
|
||||||
console_name[u] = '\0';
|
console_name[u] = '\0';
|
||||||
@@ -1924,7 +1942,11 @@ static void mama_word_stadium_admit(VM *vm)
|
|||||||
size_t i;
|
size_t i;
|
||||||
size_t idx;
|
size_t idx;
|
||||||
|
|
||||||
if (vm->dsp < 2) { vm->error = 1; return; }
|
if (vm->dsp < 2) {
|
||||||
|
log_message(LOG_ERROR, "STADIUM-ADMIT: stack underflow");
|
||||||
|
vm->error = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
behaviour_cell = vm_pop(vm);
|
behaviour_cell = vm_pop(vm);
|
||||||
heat_cell = vm_pop(vm);
|
heat_cell = vm_pop(vm);
|
||||||
@@ -1959,7 +1981,11 @@ static void mama_word_stadium_evict(VM *vm)
|
|||||||
{
|
{
|
||||||
cell_t cell_cell;
|
cell_t cell_cell;
|
||||||
|
|
||||||
if (vm->dsp < 0) { vm->error = 1; return; }
|
if (vm->dsp < 0) {
|
||||||
|
log_message(LOG_ERROR, "STADIUM-EVICT: stack underflow");
|
||||||
|
vm->error = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
cell_cell = vm_pop(vm);
|
cell_cell = vm_pop(vm);
|
||||||
if (cell_cell < 0) {
|
if (cell_cell < 0) {
|
||||||
@@ -2001,7 +2027,11 @@ static void mama_word_stadium_res_pull(VM *vm)
|
|||||||
{
|
{
|
||||||
cell_t qty_cell;
|
cell_t qty_cell;
|
||||||
|
|
||||||
if (vm->dsp < 0) { vm->error = 1; return; }
|
if (vm->dsp < 0) {
|
||||||
|
log_message(LOG_ERROR, "STADIUM-RES-PULL: stack underflow");
|
||||||
|
vm->error = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
qty_cell = vm_pop(vm);
|
qty_cell = vm_pop(vm);
|
||||||
if (qty_cell < 0) {
|
if (qty_cell < 0) {
|
||||||
@@ -2021,7 +2051,11 @@ static void mama_word_stadium_res_push(VM *vm)
|
|||||||
{
|
{
|
||||||
cell_t heat_cell;
|
cell_t heat_cell;
|
||||||
|
|
||||||
if (vm->dsp < 0) { vm->error = 1; return; }
|
if (vm->dsp < 0) {
|
||||||
|
log_message(LOG_ERROR, "STADIUM-RES-PUSH: stack underflow");
|
||||||
|
vm->error = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
heat_cell = vm_pop(vm);
|
heat_cell = vm_pop(vm);
|
||||||
if (heat_cell < 0) return;
|
if (heat_cell < 0) return;
|
||||||
@@ -2038,7 +2072,11 @@ static void mama_word_stadium_heat_fetch(VM *vm)
|
|||||||
{
|
{
|
||||||
cell_t cell_cell;
|
cell_t cell_cell;
|
||||||
|
|
||||||
if (vm->dsp < 0) { vm->error = 1; return; }
|
if (vm->dsp < 0) {
|
||||||
|
log_message(LOG_ERROR, "STADIUM-HEAT@: stack underflow");
|
||||||
|
vm->error = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
cell_cell = vm_pop(vm);
|
cell_cell = vm_pop(vm);
|
||||||
if (cell_cell < 0) {
|
if (cell_cell < 0) {
|
||||||
@@ -2060,7 +2098,11 @@ static void mama_word_stadium_heat_store(VM *vm)
|
|||||||
{
|
{
|
||||||
cell_t cell_cell, new_heat_cell;
|
cell_t cell_cell, new_heat_cell;
|
||||||
|
|
||||||
if (vm->dsp < 1) { vm->error = 1; return; }
|
if (vm->dsp < 1) {
|
||||||
|
log_message(LOG_ERROR, "STADIUM-HEAT!: stack underflow");
|
||||||
|
vm->error = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
cell_cell = vm_pop(vm);
|
cell_cell = vm_pop(vm);
|
||||||
new_heat_cell = vm_pop(vm);
|
new_heat_cell = vm_pop(vm);
|
||||||
|
|||||||
Reference in New Issue
Block a user