feat(v4): v3's whole POST is v4's POST -- 990 cases, all passed on Hera (#189)

Phase 7, Task 8: PARITY:V4_POST tests=990 pass=990 fail=0 on Hera (mesh-boot); the hosted
product 945 of them, all passed -- the 45 cases of physics.4th's words need the kernel.

- Enlarged, as ruled ("Enlarge v4 to fit"): a node is 32768 words, its data stack 1024
  deep (v3's), host and kernel alike; the dictionary's end moves with them.
- POST's runner compares every value a case leaves (v3's leave 101); V4_POST_KERNEL marks
  a case of the kernel's words, and a host without a kernel does not run it.
- mkpost.py --all is POST's table (make -C v4 post79), with docs/v4.0.0/POST.md; it reads a
  module's #defines (v3's Mama cases are MAMA_IMPLEMENTED, 0: v3's own POST skips all 20);
  it cuts no line between a word and the name it takes.
- Rules for the last of the table: the min/max and array-sum programs written as meant,
  CREATE's 26-character name (FORTH-79: 31), many_defs.
- POST_FLOOR 990.
- Tests sized for a 32-deep stack and a 16384-word node made deep-stack-ready
  (test_host_depth, test_host_quit, test_host_node, hosted-check, depthsweep.py).

make -C v4 test: all v4 tests passed. make -C kernel/tests test: all passed.
depthsweep at 1024: 230 runs, 0 failures. v4-checks running.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
This commit is contained in:
Claude
2026-11-14 08:12:23 +00:00
parent 1aa33f31bf
commit 37469f6c54
23 changed files with 2701 additions and 1299 deletions
+6 -3
View File
@@ -211,12 +211,15 @@ static void watch_mid_spent(void)
if (saw_room_wait) put_spent();
}
/* words that push 1, 2, 4, 8 and 16 values and call nothing while they do */
/* words that push 1, 2, 4, 8, 16, 64 and 256 values and leave no call behind (64 and 256 since the stack is 1024
* deep, #189 Phase 7: in P16s a text for 1012 values was more than a text may be) */
static void fill(char *text, size_t cap, unsigned count)
{
size_t at = 0;
unsigned bit;
text[0] = 0;
for (; count >= 256; count -= 256) at += (size_t)snprintf(text + at, cap - at, "P256 ");
for (; count >= 64; count -= 64) at += (size_t)snprintf(text + at, cap - at, "P64 ");
for (; count >= 16; count -= 16) at += (size_t)snprintf(text + at, cap - at, "P16 ");
for (bit = 8; bit; bit >>= 1) if (count >= bit) { at += (size_t)snprintf(text + at, cap - at, "P%u ", bit); count -= bit; }
}
@@ -245,7 +248,7 @@ static int made(unsigned path)
};
char line[64];
unsigned k;
if (!row() || !told(11, act[path]) || !told(11, ": P1 7 ; : P2 7 7 ; : P4 7 7 7 7 ; : P8 7 7 7 7 7 7 7 7 ;") || !told(11, ": P16 P8 P8 ;")) return 0;
if (!row() || !told(11, act[path]) || !told(11, ": P1 7 ; : P2 7 7 ; : P4 7 7 7 7 ; : P8 7 7 7 7 7 7 7 7 ;") || !told(11, ": P16 P8 P8 ; : P64 P16 P16 P16 P16 ; : P256 P64 P64 P64 P64 ;")) return 0;
if (!told(11, ": N1 ACT ;")) return 0;
for (k = 2; k <= V4_RET_DEPTH + 1u; k++) {
snprintf(line, sizeof line, ": N%u N%u ;", k, k - 1u);
@@ -431,7 +434,7 @@ int main(void)
/* ---- between texts: node 11 passes on, refuses, and holds what it has no room to pass on, with as many
* values waiting on its stack as a text may leave (MESH.md 7d.4: the rule of 28). Not one fault. ---- */
CHECK(row() && told(11, ": P1 7 ; : P2 7 7 ; : P4 7 7 7 7 ; : P8 7 7 7 7 7 7 7 7 ;") && told(11, ": P16 P8 P8 ;") && told(11, "77 5 ROUTE")
CHECK(row() && told(11, ": P1 7 ; : P2 7 7 ; : P4 7 7 7 7 ; : P8 7 7 7 7 7 7 7 7 ;") && told(11, ": P16 P8 P8 ; : P64 P16 P16 P16 P16 ; : P256 P64 P64 P64 P64 ;") && told(11, "77 5 ROUTE")
&& told(12, ": S77 S\" 1 DROP\" 77 SEND ; : PR 1200 0 DO I . LOOP ;") && told(10, ": SLOW 500000 0 DO LOOP ; : BUSY SLOW SLOW ;"), "a row; node 11's way to 77 is a port with no one on it");
for (k = V4_DATA_DEPTH - 12u; k + 4u <= V4_DATA_DEPTH; k++) {
unsigned faults;