fix(v4): a killed node's children become Hera's; Review Focus 4 checked
From the final review of MESH step 7. NODE-KILL left children whose parent was the dead number, so a node born later under it inherited authority over them; they are re-parented to Hera. After UNIT-KILL Hera no longer lists the removed centre, and a later KILL completes (shown to fail with GONE-DOWN's unlisting taken out). test_manage 45/45 both widths; test_host_unit 127/127. Acceptance: amd64, aarch64, riscv64 clean qemu: ok>, POST 538/538, dict_hash=0x248b4edc47f4357e on all three; test-32 0 failures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
9382df69e5
commit
7ad02bf72f
@@ -717,6 +717,11 @@ int main(void)
|
||||
CHECK(node_numbered(10)->mem[LOST] == hera_lost && node_numbered(11)->mem[LOST] == 0 && node_numbered(13)->mem[LOST] == 0 && node_numbered(14)->mem[LOST] == 0
|
||||
&& waiting(10) && waiting(11) && waiting(13) && waiting(14), "nothing was let go in all of this, and all wait again: Hera %ld (%ld before)",
|
||||
(long)node_numbered(10)->mem[LOST], (long)hera_lost);
|
||||
/* Review Focus 4 (the final review of step 7): after UNIT-KILL no node still lists a removed node as its
|
||||
* child -- the next KILL would tell it, and with no way to it that would be an error. */
|
||||
CHECK(strcmp(tell(10, "20 (WHICH) ."), "-1 ") == 0, "Hera no longer lists node 20 among the nodes she birthed: \"%s\"", printed);
|
||||
CHECK(told(10, "14 KILL") && node_numbered(14) == NULL && strcmp(tell(13, "1 2 + ."), "3 ") == 0,
|
||||
"and a KILL after UNIT-KILL tells only the nodes there are: it completes, and the rest go on: \"%s\"", printed);
|
||||
|
||||
printf(" %d checks, %d failures\n", checks, failures);
|
||||
return failures != 0;
|
||||
|
||||
+10
-1
@@ -151,7 +151,16 @@ int main(void)
|
||||
r = birth(a, 13);
|
||||
CHECK(r >= 0, "node 11 births 13");
|
||||
push(h, 11);
|
||||
CHECK(v4_manage_serve(&m, h, V4_REQ_NODE_KILL) == 1 && place_of(h, 13) == r && child(h, 11, 0) == 13, "killing 11 does not kill its child, as in v3");
|
||||
CHECK(v4_manage_serve(&m, h, V4_REQ_NODE_KILL) == 1 && place_of(h, 13) == r, "killing 11 does not kill its child, as in v3");
|
||||
CHECK(child(h, 11, 0) == 0 && child(h, 10, 0) == 13, "its child is Hera's now: no number that is not live is anyone's parent");
|
||||
{
|
||||
/* A NUMBER USED AGAIN INHERITS NOTHING (the final review of step 7): a node born later as 11 is not
|
||||
* the parent of the 13 the old 11 birthed, and may not wire it. */
|
||||
v4_cell again = birth(h, 11), r13 = r;
|
||||
CHECK(again >= 0 && child(h, 11, 0) == 0, "Hera births a new 11: it has no children");
|
||||
push((unsigned)again, again); push((unsigned)again, 3); push((unsigned)again, r13); push((unsigned)again, 2);
|
||||
CHECK(refused((unsigned)again, V4_REQ_NODE_WIRE) && depth((unsigned)again) == 0, "and may not wire the old 11's child");
|
||||
}
|
||||
CHECK(place_of(h, 12) == -1 && place_of(h, 10) == (v4_cell)h, "NODE-PLACE of a number not live is -1");
|
||||
|
||||
printf(" %d checks, %d failures\n", checks, failures);
|
||||
|
||||
Reference in New Issue
Block a user