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
+5 -4
View File
@@ -438,11 +438,12 @@ int main(void)
v4_cell here = hera->mem[DP] / 4, k, changed = 0, first = -1;
uint64_t hash = v4_image_dict_hash(hera, &im);
memcpy(before, hera->mem, sizeof before);
host.self = 0; host.n = hera; host.line = post_line; host.say = post_say;
host.self = 0; host.n = hera; host.line = post_line; host.say = post_say; host.kernel = 0; /* no kernel here */
char want_line[64]; /* the table's own count, not a number typed here: it was 538, POST grew (#190) */
snprintf(want_line, sizeof want_line, "PARITY:V4_POST tests=%u pass=%u fail=0\n", v4_post_case_count, v4_post_case_count);
CHECK(v4_post_run(&host, v4_post_cases, v4_post_case_count, &tally) && tally.tests == v4_post_case_count
&& tally.pass == v4_post_case_count && tally.fail == 0
const unsigned runs = v4_post_runs(v4_post_cases, v4_post_case_count, 0);
snprintf(want_line, sizeof want_line, "PARITY:V4_POST tests=%u pass=%u fail=0\n", runs, runs);
CHECK(v4_post_run(&host, v4_post_cases, v4_post_case_count, &tally) && tally.tests == runs
&& tally.pass == runs && tally.fail == 0
&& strstr(post_said, want_line) != NULL && strstr(post_said, "POST FAIL") == NULL,
"and passes POST, which the kernel runs on her: %u of %u, %u failed; \"%s\"", tally.pass, tally.tests, tally.fail, post_said);
CHECK(strcmp(tell(10, "RS1"), "42 42 \n") == 0, "while POST runs, what its cases define is on her: \"%s\"", printed);