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 -6
View File
@@ -3,12 +3,12 @@
*/
/* test_host_node.c -- the host node's size, and the text assembler on it.
*
* Tests named test_host_*.c are built with V4_NODE_WORDS = 16384 (Makefile):
* Tests named test_host_*.c are built with V4_NODE_WORDS = 32768 (Makefile; 16384 until 2026-11-14, #189):
* the host node, which holds the compiler, the dictionary and the text being
* compiled, and so cannot be a 1024-word mesh node.
*
* At 1024 words every slot a branch may sit in reaches the whole node. At
* 16384 slot 3 does not -- its address field is 12 bits -- so this is where
* 32768 slot 3 does not -- its address field is 12 bits -- so this is where
* the text assembler's placement rule (text.h) is exercised: a branch is put
* in a slot only if that slot reaches every word of the node.
*/
@@ -58,7 +58,7 @@ int main(void)
unsigned k, i;
printf("v4 host node tests: V4_CELL_BITS=%d, V4_NODE_WORDS=%u\n", V4_CELL_BITS, (unsigned)V4_NODE_WORDS);
CHECK(V4_NODE_WORDS == 16384u, "the host node is 16384 words");
CHECK(V4_NODE_WORDS == 32768u, "the host node is 32768 words");
/* the node itself at this size */
v4_node_reset(&n);
@@ -111,14 +111,14 @@ int main(void)
CHECK(result("LOOP", 9) == 0, "a short backward jump near the top of the node [%u]", k);
}
/* the node fills up at 16384 words, not before */
/* the node fills up at V4_NODE_WORDS words, not before */
{
size_t at = 0;
at += (size_t)snprintf(src + at, sizeof src - at, ": T ");
for (i = 0; i < V4_NODE_WORDS - 100u; i++) at += (size_t)snprintf(src + at, sizeof src - at, "; ");
CHECK(assemble(src), "16284 words of code fit: %s", v4_text_error(&tx));
CHECK(assemble(src), "%u words of code fit: %s", (unsigned)(V4_NODE_WORDS - 100u), v4_text_error(&tx));
for (i = 0; i < 200u; i++) at += (size_t)snprintf(src + at, sizeof src - at, "; ");
CHECK(!assemble(src) && strstr(v4_text_error(&tx), "does not fit") != NULL, "16484 do not");
CHECK(!assemble(src) && strstr(v4_text_error(&tx), "does not fit") != NULL, "%u do not", (unsigned)(V4_NODE_WORDS + 100u));
CHECK(v4_node_guards_intact(&n), "and nothing was written outside the node");
}