feat(v4.0.0): the wire in the engine -- whole messages, put and taken in one step

Queues of whole messages on the wires between nodes (v4/wire.h), the six
addresses and ten operations a node asks of the fabric (MESH.md 7d.3), and the
fabric's pool of queues. Engine only: the nucleus does not use any of it yet.
The ports in the host map move to BUF0_W - 140 so that the new addresses are
not among the nucleus variables, with a compile-time check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rajames
2026-10-08 13:50:15 -04:00
co-authored by Claude Opus 5.5
parent 50be766e7b
commit d5cd64605d
14 changed files with 1267 additions and 22 deletions
+8 -3
View File
@@ -1136,19 +1136,24 @@ int main(void)
/* A flush of the output buffer that ends in a fault leaves the buffer full: what is printed next -- the
* error's own message -- must not go past its end (MESH.md 7c.6). */
{
/* The cells just after the buffer that are still plain memory: the ports follow them (host_map.h), and a
* store to a port is not a store to memory -- it blocks the node, which is seen below, as is the pointer
* itself: it is past the end only if something was put there. */
const unsigned plain = (unsigned)(PORT - (OUT_W + OUT_CELLS));
unsigned over = 0, worst = 0, at;
for (k = most > 6 ? most - 6 : 0; k <= most + 3; k++) {
char line[4 * V4_DATA_DEPTH + 16];
size_t n_at = 0;
unsigned m;
boot_bare();
for (m = 0; m < 28; m++) n.mem[OUT_W + 256 + m] = 0;
for (m = 0; m < plain; m++) n.mem[OUT_W + OUT_CELLS + m] = 0;
for (m = 0; m < k; m++) n_at += (size_t)snprintf(line + n_at, sizeof line - n_at, "1 ");
snprintf(line + n_at, sizeof line - n_at, "\n");
(void)say(line);
(void)say("WORDS\n");
for (at = 0; at < 28; at++) if (n.mem[OUT_W + 256 + at] != 0) { over++; worst = k; break; }
if (n.mem[OUT_PTR] > OUT_W + 256) { over++; worst = k; }
for (at = 0; at < plain; at++) if (n.mem[OUT_W + OUT_CELLS + at] != 0) { over++; worst = k; break; }
if (n.mem[OUT_PTR] > OUT_W + OUT_CELLS) { over++; worst = k; }
if (n.asking || n.doing) { over++; worst = k; } /* it stored to a port */
CHECK(strcmp(say("1 2 + .\n"), "3 ok\nok> ") == 0, "WORDS with %u values on the stack: the node goes on", k);
}
CHECK(over == 0, "nothing was ever put past the end of the output buffer (it was, with %u values on the stack)", worst);