feat(v4.0.0): messages are whole and wait on the wire -- a node keeps none but the one it is doing

Step 6e, tasks 2 and 3 (docs/v4.0.0/MESH.md 7d).  The nucleus puts, looks
at, takes, moves and drops whole messages through the six addresses after
its ports; its own ring of messages waiting, the refusals owed, (GATE) and
the looking words' use are gone.  SEND, an answer, a NACK and a GONE go or
are refused at once; what a text prints waits for room; a text is not
begun until the wire its answer goes by has room for it, and that room is
kept.  The lone node's host (v4/system/boot.c) keeps its two wires and
does its operations; the test hosts' consoles put and take whole messages
through the fabric.  New: tests/test_host_depth.c, every message path of
a mesh node at every depth of both stacks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rajames
2026-10-08 15:59:37 -04:00
co-authored by Claude Opus 5.5
parent 83694b18be
commit b1d09af043
12 changed files with 1621 additions and 834 deletions
+5 -5
View File
@@ -71,8 +71,8 @@ typedef struct {
int v4_boot_run(const v4_boot *b);
/* Hand the node a line and run it to its end, sending what it prints to
* `out`. The line is sent to the node as a message and what it prints
* comes back as messages (message.h). Returns how it ended -- V4_TEXT_QUIT,
* `out`. The line is put on the node's wire as a message, whole, and what
* it prints comes back as messages (message.h; docs/v4.0.0/MESH.md 7d.5). Returns how it ended -- V4_TEXT_QUIT,
* V4_TEXT_COMPLETED or V4_TEXT_ERROR -- or one of these: */
#define V4_BOOT_LINE_TOO_LONG (-1) /* more than the node's input buffer holds; nothing was run */
#define V4_BOOT_LINE_STOPPED (-2) /* the node stopped on a fault, or never finished */
@@ -81,12 +81,12 @@ int v4_boot_run(const v4_boot *b);
int v4_boot_line(const v4_boot *b, const char *text, unsigned len);
/* A LINE THAT WAITS (docs/v4.0.0/MESH.md 7b.6). V4_BOOT_LINE_WAITING means
* the line has not ended: the node is waiting at its ports for an answer,
* the line has not ended: the node is asleep, waiting for an answer,
* and here there is no one but the console to end that. The host reads the
* next line and hands it over as usual: that breaks the wait, and what is
* returned is how the line that was waiting ended -- in an error,
* Interrupted. The node has kept the line just handed over; the host then
* calls v4_boot_line with no text (0, 0) to have it done, and that returns
* Interrupted. The line just handed over is still on the node's wire; the host
* then calls v4_boot_line with no text (0, 0) to have it done, and that returns
* how it ended, which may be V4_BOOT_LINE_WAITING again. */
/* The dictionary hash of a node started from `im`. */
+2 -2
View File
@@ -27,8 +27,8 @@ typedef struct {
unsigned cell_bits, node_words, data_ring, ret_ring;
/* Where the nucleus waits for a message (v4/capsule/quit.v4, (IDLE)):
* the node's P is there, blocked reading its ports, when it has nothing
* to do. */
* a node that has taken the nucleus in begins there, and with nothing
* to do it is asleep at a wire inside it (operation 8, MESH.md 7d.3). */
v4_cell idle;
v4_cell fault_table; /* (FAULTS): where a fault goes */
v4_cell port; /* word address of the node's port (node.h) */