feat(v4): a node Hera births carries a mesh node's ROM

MACHINE.md 2.2.  Hera carries the host's ROM; the four outer nodes the
shared math only, and compute UM*, U/MOD and Q./ with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rajames
2026-10-15 20:31:41 -04:00
co-authored by Claude Opus 5.5
parent afd9d46d29
commit d2df3679ac
+16 -2
View File
@@ -12,7 +12,9 @@
* rom_harness.h). That system, assembled, is the nucleus capsule: a node
* that is born is given assembled code, never the source (Captain Bob,
* 2026-10-15). Hera is born empty and is given it through the port her
* requests go to. She is told who she is,
* requests go to. She carries the host's ROM; a node she births carries a
* mesh node's, the shared math only (MACHINE.md 2.2), at the same entries.
* She is told who she is,
* given the words that ask for nodes (v4/include/v4/manage.h), FORTH-79,
* POST, and her own capsule, capsules/v4/hera.4th. Then she is told
* `10 UNIT`, and everything after that is hers: she asks for four nodes,
@@ -143,7 +145,11 @@ static int host_born(void *self)
v4_node_stack_regs_attach(&pool[k].n, DSTACK_REG, RSTACK_REG);
v4_node_error_attach(&pool[k].n, NODE_ERROR);
v4_node_fault_attach(&pool[k].n, w_fault);
v4_node_rom_attach(&pool[k].n, ROM_IMAGE, ROM_IMAGE_WORDS); /* the nucleus calls its math in the ROM (MACHINE.md 2.2) */
/* Hera, who is made first, is the host's node and carries its ROM; a
* node she births carries a mesh node's (MACHINE.md 2.2). The nucleus
* calls its math at the same entries in either. */
if (k == 0) v4_node_rom_attach(&pool[k].n, ROM_IMAGE, ROM_IMAGE_WORDS);
else v4_node_rom_attach(&pool[k].n, MESH_ROM, MESH_ROM_WORDS);
v4_blocks_init(&node_blocks[k], BUF0_W);
if (k != 0) { /* Hera's kernel is wired where she is made */
node_kernel[k].take = node_kernel_take; node_kernel[k].give = 0; node_kernel[k].self = &pool[k];
@@ -458,6 +464,14 @@ int main(void)
CHECK(i == 5, "and execute nothing while they wait");
}
/* ---- the nodes she births carry a mesh node's ROM (MACHINE.md 2.2) ---- */
CHECK(node_numbered(10)->rom == ROM_IMAGE && node_numbered(11)->rom == MESH_ROM && node_numbered(12)->rom == MESH_ROM
&& node_numbered(13)->rom == MESH_ROM && node_numbered(14)->rom == MESH_ROM,
"Hera carries the host's ROM, and the four she birthed a mesh node's");
CHECK(strcmp(tell(11, "12345 67890 UM* . ."), "0 838102050 ") == 0 && ended_from == 11, "11's UM* is its ROM's: \"%s\"", printed);
CHECK(strcmp(tell(12, "100 0 7 U/MOD . ."), "14 2 ") == 0 && ended_from == 12, "12's U/MOD, on its ROM's UM/MOD: \"%s\"", printed);
CHECK(strcmp(tell(13, "65536 0 196608 0 Q./ . ."), "0 21845 ") == 0 && ended_from == 13, "13's Q./: \"%s\"", printed);
/* ---- they talk ---- */
CHECK(strcmp(tell(10, "1 2 + ."), "3 ") == 0 && printed_from == 10, "a line typed at the console is done by Hera");
for (i = 11; i <= 14; i++) {