feat(v4): the system hands no GONE on; (GONE-HOOK) goes (MESH step 7, increment 2)

Ruling 7 as amended: the kernel tells a node's going, so the system's
hand-on is not used.  (GONE-HOOK), (DOWN) and (RUN) go from quit.f18, and
COLD's hook-clearing from system.f18; the cell is free again.  The tests of
the hand-on go with it (mesh: the hand-on checks and the fourth disturbed
exchange; depth sweep: path 10, as before 529ba0fc).  A believed GONE going
no further is still checked.  test_host_unit.c's message for GONE down the
graph now says the kernel tells.  MESH.md: 9a.6 items 5 and 7, and step 7's
record of both increments.

Suite EXIT 0; depth sweep 230 runs, 0 failures; mkcapsule lint 0
violations.  Hosted and bare metal, all three ISAs: word_count=317
dict_hash=0xfec8c47cfc6f437f.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rajames
2026-10-20 13:05:45 -04:00
co-authored by Claude Opus 5.5
parent 9138ebd8bb
commit 6cb8f1285f
9 changed files with 51 additions and 82 deletions
+1 -3
View File
@@ -119,7 +119,7 @@
/* THE IMAGE RECORD: where the system's source says, with `store`, the addresses a host needs (v4/image.h): where the
* node waits for a message, its fault table, and KEY's code. */
#define ROM_IMG (BUF0_W - 119) /* idle, fault table, KEY, the word after KEY: 4 cells */
/* FREE, plain memory: BUF0_W - 22; - 115 .. - 113; BUF0_W - 144 .. - 141 (what a flush makes zero after
/* FREE, plain memory: BUF0_W - 22 .. - 21; - 115 .. - 113; BUF0_W - 144 .. - 141 (what a flush makes zero after
* a full output buffer); and OUT_W - 144 .. OUT_W - 65. They and
* the cells above held the messages waiting, the refusals owed and what went with them (MESH.md 7a, 7b), which a
* node no longer keeps. */
@@ -205,7 +205,6 @@ enum { V4_ROM_ERRORS(ROM_ERR_ENUM_) ROM_ERR_END_ };
#define ROM_ADDR_TOP ((v4_cell)(V4_NODE_WORDS + V4_ROM_WORDS - 1u)) /* the top of the address space */
#define WORD_DEFINED (BUF0_W - 11) /* the xt of the word that is told of each new entry, or 0 */
#define WORD_FORGOTTEN (BUF0_W - 12) /* the xt of the word that is told when entries go, or 0 */
#define GONE_HOOK (BUF0_W - 21) /* the xt of the word a believed GONE is handed to, or 0 (MESH.md 9a.2, ruling 7) */
#define LOG_LEVEL (BUF0_W - 5) /* the level at or below which a message is printed */
#define BOOT_CELLS (BVARS + 14) /* (BOOT): DP and LATEST as the loader left them, 2 cells */
#define BUF0_W (BVARS - (v4_cell)(V4_BLOCK_SLOTS * V4_BLOCK_CELLS)) /* the block window: the kernel's slots, 256 cells each (v4/blocks.h) */
@@ -331,7 +330,6 @@ static unsigned host_branch_slots(void)
X("(OUT)", OUT_W) \
X("(WORD-DEFINED)", WORD_DEFINED) \
X("(WORD-FORGOTTEN)", WORD_FORGOTTEN) \
X("(GONE-HOOK)", GONE_HOOK) \
X("BLOCK#", V4_REQ_BLOCK) /* the kernel's block requests (v4/blocks.h) */ \
X("BUFFER#", V4_REQ_BUFFER) \
X("UPDATE#", V4_REQ_UPDATE) \
+4 -25
View File
@@ -218,10 +218,10 @@ static void fill(char *text, size_t cap, unsigned count)
for (bit = 8; bit; bit >>= 1) if (count >= bit) { at += (size_t)snprintf(text + at, cap - at, "P%u ", bit); count -= bit; }
}
#define PATHS 11u
#define PATHS 10u
static const char *const path_name[PATHS] = { "a text that prints", "SEND", "SEND with no way", "AWAIT answered", "AWAIT ended by a GONE", "passing on while its text waits for room",
"AWAIT broken by a line from the console", "a refusal while its text waits for room", "GONE",
"a spent message refused while its text waits", "AWAIT ended by a GONE that is handed on" };
"a spent message refused while its text waits" };
static char numbers[8192]; /* what 1200 0 DO I . LOOP prints */
/* A row made afresh for one path; node 11 is given the word ACT that takes it, and the words that fill the
@@ -239,7 +239,6 @@ static int made(unsigned path)
": ACT 1200 0 DO I . LOOP ;",
": ACT 44 12 GONE ;",
": ACT 1200 0 DO I . LOOP ;",
": ACT 77 AWAIT DROP ;",
};
char line[64];
unsigned k;
@@ -251,11 +250,6 @@ static int made(unsigned path)
}
if (path == 2 && !told(11, "NO-ROUTES 1 2 ROUTE 10 2 ROUTE 12 3 ROUTE")) return 0; /* no way for any node it has not been told of */
if (path == 4 && !told(12, ": LL 400000 0 DO LOOP ;")) return 0;
/* path 10: node 11 waits on a node 77 that never answers; its centre says 77 is gone, and node 11 hands the
* believed GONE on (MESH.md 9a.2, ruling 7) -- a GONE about 44 to node 12, which knows a way to 44. (Not
* about 12: believing a GONE about 12 makes node 11 forget its way to 12, and a GONE-DOWN never tells a node
* of its own going.) */
if (path == 10 && !told(11, "VARIABLE FWD : DOWN DROP 44 12 GONE 1 FWD +! ; ' DOWN (GONE-HOOK) !")) return 0;
if (path == 5 && !told(10, ": SLOW 500000 0 DO LOOP ; : BUSY SLOW S\" 1 DROP\" 12 SEND SLOW ;")) return 0;
if (path == 9 && !told(10, ": SLOW 500000 0 DO LOOP ; : BUSY SLOW SLOW ;")) return 0;
/* 320 characters: more than fits beside what node 11 itself is waiting to print */
@@ -286,16 +280,12 @@ static int one(unsigned path, const char *what, unsigned depth, const char *text
runs++;
step_cap = 60000000;
if (path == 8 && !told(12, "44 2 ROUTE")) why = "node 12 did not take a way";
if (path == 10 && !(told(11, "0 FWD !") && told(12, "44 NO-ROUTE 44 2 ROUTE"))) why = "node 11 did not clear FWD, or node 12 did not take a way to 44";
ways12 = pool[far].n.mem[ROUTE_COUNT];
forget();
saw_room_wait = 0; saw_passed = 0;
clock12 = pool[far].es.anticlock;
if (why) { }
else if (path == 10) { /* node 11 waits on 77; its centre says 77 is gone */
if (!put_text(11, text) || !run()) why = "it did not come to wait";
else if (!put_text(10, "77 11 GONE") || !run()) why = "the nodes did not come to rest";
} else if (path == 4) { /* node 12 is busy for a long while and sends no answer; node 11 waits; its centre says 12 is gone */
else if (path == 4) { /* node 12 is busy for a long while and sends no answer; node 11 waits; its centre says 12 is gone */
stuck = 1u << far;
if (!put_text(12, "LL") || !put_text(11, text) || !run()) why = "it did not come to wait";
else if (!put_text(10, "12 11 GONE") || !run()) why = "the GONE was not done";
@@ -350,17 +340,6 @@ static int one(unsigned path, const char *what, unsigned depth, const char *text
clean_error = over && is_cut_short(printed, numbers, over) && pool[far].n.mem[REFUSED] == refused12 + 1; break; /* whoever refused it, node 12 was told */
case 8: works = how11 == V4_TEXT_COMPLETED && printed_len == 0 && left == values && pool[far].n.mem[ROUTE_COUNT] == ways12 - 1;
clean_error = over && strcmp(printed, over) == 0; break;
case 10: {
int down = pool[far].n.mem[ROUTE_COUNT] == ways12 - 1; /* node 12 believed the GONE node 11 handed on */
works = how11 == V4_TEXT_ERROR && strcmp(printed, "Node gone\n") == 0 && left == values && down;
clean_error = over && strcmp(printed, over) == 0;
if (works) works = strcmp(tell(11, "FWD @ ."), "1 ") == 0;
else if (clean_error) {
int fwd1 = strcmp(tell(11, "FWD @ ."), "1 ") == 0, fwd0 = strcmp(printed, "0 ") == 0;
clean_error = down ? (fwd1 || fwd0) : fwd0;
}
break;
}
case 9: works = how11 == V4_TEXT_COMPLETED && strcmp(printed, numbers) == 0 && left == values && saw_room_wait > 0
&& pool[mid].n.mem[LOST] == lost11 + 1 && pool[far].n.mem[REFUSED] == refused12 + 1;
clean_error = over && is_cut_short(printed, numbers, over) && pool[mid].n.mem[LOST] == lost11 + 1 && pool[far].n.mem[REFUSED] == refused12 + 1; break; /* it was dropped: its sender was told */
@@ -441,7 +420,7 @@ int main(void)
first_error = 0;
for (k = V4_RET_DEPTH - 18u; k <= V4_RET_DEPTH + 1u; k++) {
snprintf(text, sizeof text, "N%u", k);
r = one(path, "calls deep", k, text, 0, k + ((path == 5 || path == 7 || path == 9) ? 16u : path == 10 ? 14u : 11u) <= V4_RET_DEPTH);
r = one(path, "calls deep", k, text, 0, k + ((path == 5 || path == 7 || path == 9) ? 16u : 11u) <= V4_RET_DEPTH);
if (r == 0 && !first_error) first_error = k;
}
printf(" calls: works to %u deep; %u worked, %u clean errors, %u failures\n", first_error ? first_error - 1u : (unsigned)(V4_RET_DEPTH + 1u), worked - w0, refused_clean - e0, bad - before);
+6 -16
View File
@@ -1096,23 +1096,14 @@ int main(void)
CHECK(undone == 0 && wrong == 0, "whenever the room came, both texts were done, the first first: %u not done, %u in the wrong order, the first when it came at step %u", undone, wrong, first_wrong);
}
/* ---- A BELIEVED GONE IS HANDED ON (MESH.md 9a.2, ruling 7; 9a.3) ----
* The word in (GONE-HOOK) is given the number of the node that is gone, each time a GONE is believed:
* centre.4th puts GONE-DOWN there, which tells the nodes the node birthed. Here node 11 has a word that
* tells node 12; node 12 believes it, since node 11 is its centre, and forgets its way to 44. */
/* ---- A BELIEVED GONE GOES NO FURTHER (MESH.md 9a.2, ruling 7) ----
* The kernel tells each node a node's going; a node does not hand a GONE on. Node 11 believes one from its
* centre and forgets its way to 44, and node 12, which also knows a way to 44, is told nothing. */
CHECK(row() && told(12, "44 2 ROUTE") && told(11, "44 3 ROUTE"), "a row; nodes 11 and 12 each know a way to 44");
{
v4_cell ways11 = pool[mid].n.mem[ROUTE_COUNT], ways12 = pool[far].n.mem[ROUTE_COUNT];
CHECK(told(10, "44 11 GONE") && pool[mid].n.mem[ROUTE_COUNT] == ways11 - 1 && pool[far].n.mem[ROUTE_COUNT] == ways12 && asleep(far),
"with nothing in (GONE-HOOK) node 11 believes a GONE from its centre and tells no one");
CHECK(told(11, "44 3 ROUTE : DOWN 12 GONE ; ' DOWN (GONE-HOOK) !"), "node 11 is given a word to hand a GONE on with");
CHECK(told(10, "44 11 GONE") && pool[mid].n.mem[ROUTE_COUNT] == ways11 - 1 && pool[far].n.mem[ROUTE_COUNT] == ways12 - 1 && asleep(far) && asleep(mid),
"now node 11 believes it and hands it on: node 12 believes it from its centre and forgets 44 too");
CHECK(told(12, "44 2 ROUTE") && told(11, "44 3 ROUTE") && told(12, "44 12 GONE") && pool[mid].n.mem[ROUTE_COUNT] == ways11,
"a GONE that is not believed -- node 12 is not node 11's centre -- is not handed on");
CHECK(v4_fabric_wire_kernel(&f, mid, 0, &kernel_dev), "a kernel on node 11's port 0, for COLD's EMPTY-BUFFERS");
CHECK(strstr(tell(11, "COLD"), "Cold Start") != NULL && strcmp(tell(11, "(GONE-HOOK) @ ."), "0 ") == 0,
"COLD forgets DOWN, so (GONE-HOOK) no longer points at it: \"%s\"", printed);
"node 11 believes a GONE from its centre and tells no one");
CHECK(strcmp(tell(10, "1 2 + ."), "3 ") == 0 && strcmp(tell(11, "1 2 + ."), "3 ") == 0 && strcmp(tell(12, "1 2 + ."), "3 ") == 0, "and every node answers");
}
@@ -1128,16 +1119,15 @@ int main(void)
* (Hera's KILL does: test_host_unit.c). Its wait is ended by the line it is then typed, "Interrupted",
* and it answers. */
{
static const struct { const char *what, *set10, *set11, *set12; v4_cell node; const char *text; } ex[4] = {
static const struct { const char *what, *set10, *set11, *set12; v4_cell node; const char *text; } ex[3] = {
{ "text from the console for node 12, what it prints and how it ended", "1 DROP", "1 DROP", ": A 7 8 * . ;", 12, "A" },
{ "node 11 SENDs node 12 text and waits for its answer", "1 DROP", ": T S\" Q\" 12 SEND 12 AWAIT . ;", "1 DROP", 11, "T" },
{ "a GONE node 10 sends node 11, which node 11 hands on to node 12", ": G 44 11 GONE ;", ": DOWN 12 GONE ; ' DOWN (GONE-HOOK) ! 44 3 ROUTE", "44 2 ROUTE", 10, "G" },
{ "a message node 12 has no way for, and its NACK to node 10", "55 2 ROUTE : N S\" 1 DROP\" 55 SEND ;", "55 3 ROUTE", "NO-ROUTES 1 2 ROUTE 10 2 ROUTE 11 2 ROUTE", 10, "N" }
};
static const char *const how_name[4] = { "", "node 11 removed", "node 12 removed", "the wire between nodes 11 and 12 cut and made again" };
unsigned e, g, whole, tried, wrong, first, all = 0;
step_cap = 2000000;
for (e = 0; e < 4; e++) {
for (e = 0; e < 3; e++) {
CHECK(row() && told(10, ex[e].set10) && told(11, ex[e].set11) && told(12, ex[e].set12) && told(10, ASK) && told(11, ASK) && told(12, ASK), "a row made afresh for: %s", ex[e].what);
step_cap = 2000000;
keep();
+1 -1
View File
@@ -696,7 +696,7 @@ int main(void)
CHECK(ended == 0 && node_numbered(21)->mem[AWAIT_FROM] == 12 && waiting(21), "node 21 of the second unit waits on node 12 of the first");
(void)tell(10, "12 KILL");
CHECK(node_numbered(12) == NULL && strstr(printed, "Node gone") != NULL && node_numbered(21)->mem[AWAIT_FROM] == 0,
"Hera kills node 12: her GONE goes to node 20, which tells its own, and node 21's wait ends: \"%s\"", printed);
"Hera kills node 12: the kernel tells each node it is gone, and node 21's wait ends: \"%s\"", printed);
{
v4_cell ways = node_numbered(22)->mem[ROUTE_COUNT];
CHECK(told(22, "88 3 ROUTE") && told(21, "88 22 GONE") && node_numbered(22)->mem[ROUTE_COUNT] == ways + 1,