feat(v4): the mesh boot to spec -- Hera born empty in the kernel's fabric; births, kills, every node stepping together (#189)
ENGINE step 4 Phase 1, Tasks 5b-5d, and the edge cases (Captain Bob, 2026-11-13: "Build it to proper spec"; "Check for the edge cases"; "Yes, add it to v4-checks"). - v4/system/mesh.c, v4/include/v4/mesh.h: the nucleus assembled by the ROM and given to Hera as F18 cells; Hera born empty at place 0, the kernel on port 0, the console on port 1; told she is 10, in the registry, the kernel's words, FORTH-79, sealed, POST, the kernel's capsules. NODE-BORN / NODE-KILL in the owner's room. - No scheduler: v4_mesh_tell returns once the node told says how its text ended, and v4_mesh_step / v4_mesh_busy let the host step the fabric while it waits, so nodes run between lines as during them. A text left "waiting" is owed its end: the next line ends it "Interrupted" and is then run (MESH.md 7b.6). - kernel: sk_v4.c boots through the mesh; its idle steps the fabric while a node can run, and halts only when none can (#151 kept). stadium_return_quota and stadium_ops_forget on a kill. - Tests: v4/tests/test_mesh_boot.c (32 checks: the boot, births, kills, rebirth, a live number, a fault, no such node, Hera not killing herself, no room, a line too long, a node running for ever, a wait broken by the next line), run by `make -C v4 test` and under ASan+UBSan by `sanitize` (v4-checks); kernel/tests quota return; scripts/qemu_session.py births() and the edges on bare metal. - Docs: ENGINE.md 6 "who runs next" struck (settled: no scheduler); the Phase 1 plan; FABRIC-3 XLVIII.23; .claude/memory/rules.md: alpha.5 closed to new work. - Evidence: v4-checks 80 programs under the sanitizers, 0 failures; the hosted builds alike; two stopped v4-checks runs labelled STOPPED; three development amd64 boots labelled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
This commit is contained in:
@@ -6625,3 +6625,24 @@ and memorize frequently so we can pick up where we left off").
|
||||
`test_host_quit.c`), A2's five (`test_host_compile.c`); the depth checks moved to the new figures.
|
||||
- **Next:** Phase 1 -- v4 in the kernel's boot, the Stadium and the heartbeat started; then Phase 2,
|
||||
the word accounts at `call`; then Phase 7, the loops on them.
|
||||
|
||||
### 23. #189 Phase 1: v4 in the kernel's boot -- the Stadium, the opcodes, the fabric, births (2026-11-13)
|
||||
|
||||
- **The Stadium on a v4 boot** (plan `2026-11-13-engine-step4-phase1-v4-in-the-kernels-boot.md`,
|
||||
Tasks 1-4): made for both systems in v3's order, keyed by node ("A new node key": Hera, node 10, is
|
||||
patron zero under hers); v3's checks after POST; the 32 opcodes as Stadium patrons, charged per
|
||||
heartbeat tick ("Both": HEAT-OP's feed, about 0.5 us a charge -- kept); acceptance fails a v4 boot
|
||||
without the physics.
|
||||
- **A wrong turn, and its correction.** Asked "who runs next", I offered choices of scheduling
|
||||
policy, and "Hera by compudynamics now" was ruled on that framing. Captain Bob: "Scheduler? Have we
|
||||
regressed?" The design has none (`JUSTIFICATION.md` 4; `fabric.h`; this file's turn-attractor,
|
||||
"without a scheduler"). The ruling was withdrawn; "Build it to proper spec." And 5a's "Hera as
|
||||
now, in a fabric" could not carry births: the old boot spoke only her console's wire and ran no
|
||||
other node.
|
||||
- **To spec** (Task 5): the kernel boots the fabric (`v4/mesh.h`): the nucleus assembled by the
|
||||
machine's ROM, Hera born empty and given it, every node stepped together. A born node's room comes
|
||||
from the kernel's heap and its Stadium quota from Hera's; killed, both are given back
|
||||
(`stadium_return_quota`). Seen on bare metal: `11 2 2 BIRTH` -- node 11's parity line; Hera sends
|
||||
it `6 7 * .`, it answers 42; `11 KILL`; the Stadium CONSERVED after.
|
||||
- **Next:** Phase 2, the word accounts at `call` -- the kernel's record per word, fed by the hook
|
||||
(A1); then Phase 7, the loops on those records. And retiring v3 as a boot target (#156).
|
||||
|
||||
@@ -471,7 +471,7 @@ these, a group at a time, with POST after each.
|
||||
| ~~How the node tells a dictionary entry from a bare address at `call`~~ Ruled 2026-10-20: the kernel's table of entry addresses, filled by `(WORD-DEFINED)`, emptied by `(WORD-FORGOTTEN)`; a target not in it is a bare routine | Step 3 |
|
||||
| ~~`EXECUTE`, which enters a word by a return~~ Ruled 2026-10-20: `EXECUTE` calls the xt | Step 3 |
|
||||
| ~~`>R R> R@ I J LEAVE`, which cannot be called~~ Ruled 2026-10-20: they stay in line and are checked when the definition holding them is compiled; every other in-line word is called | Step 3 |
|
||||
| Who decides which node runs next, and when: Hera, by compudynamics; preemptive and cooperative | Step 7 |
|
||||
| ~~Who decides which node runs next, and when: Hera, by compudynamics; preemptive and cooperative~~ **Settled 2026-11-13 (#189; Captain Bob, "Build it to proper spec"): no one decides -- there is no scheduler (`JUSTIFICATION.md` 4). Every awake node executes an instruction word at each step of the fabric (`v4/include/v4/fabric.h`), and a node with nothing to do waits at a port. The kernel boots the fabric so (`v4/include/v4/mesh.h`).** | Step 7 |
|
||||
| The node's safe moment for message delivery and switching | Step 7 |
|
||||
| `PAD 42 OVER !`, a byte address given to `!` (D-1) | Step 6 |
|
||||
| Which word patrons' accounts the hosted product keeps, having no Stadium | Step 3 |
|
||||
|
||||
@@ -41,13 +41,18 @@ then Phase 7. HEAT-OP's Stadium feed was ruled into this phase ("Both": the regi
|
||||
- **Q4: "In Phase 1."** The registry (`v4/src/manage.c`) comes into the kernel build in this phase:
|
||||
Task 5 is in. Asked how much -- it needs a fabric of nodes, births that make them, and who runs
|
||||
next (`ENGINE.md` 6, open) -- **"Full births now."**
|
||||
- **Who runs next (`ENGINE.md` 6): "Hera by compudynamics now."** As v3's turn-attractor, agreed
|
||||
with Captain Bob (`FABRIC-3.md`, the turn-attractor: "the next turn to whichever live identity VM
|
||||
currently has the lowest `execution_heat_q48` ... No priority levels, no time slices, no
|
||||
preemption -- the same density comparison Stadium already uses"): the next instruction word goes
|
||||
to the **coolest awake node** that can run, by its resident heat in the Stadium -- its opcode
|
||||
patrons (Task 3) until Phase 2 adds its words. Switching only between instruction words
|
||||
(`ENGINE.md` 3a). A node asleep at its wires, or blocked, is not a candidate.
|
||||
- ~~**Who runs next (`ENGINE.md` 6): "Hera by compudynamics now."**~~ **Withdrawn 2026-11-13** -- the
|
||||
question was put wrongly, as a choice of scheduling policy. The design has no scheduler
|
||||
(`JUSTIFICATION.md` 4: "There is no scheduler to write"; `fabric.h`: "There is no choice of whose
|
||||
turn it is"; FABRIC-3's turn-attractor: "fix the gap without a scheduler"): every awake node steps
|
||||
together, and a node with nothing to do waits at a port. Captain Bob, asked "Scheduler? Have we
|
||||
regressed?", then: **"Build it to proper spec."** The withdrawn ruling, as it was written:
|
||||
~~As v3's turn-attractor, agreed with Captain Bob (`FABRIC-3.md`, the turn-attractor: "the next
|
||||
turn to whichever live identity VM currently has the lowest `execution_heat_q48` ... No priority
|
||||
levels, no time slices, no preemption -- the same density comparison Stadium already uses"): the
|
||||
next instruction word goes to the **coolest awake node** that can run, by its resident heat in the
|
||||
Stadium -- its opcode patrons (Task 3) until Phase 2 adds its words. Switching only between
|
||||
instruction words (`ENGINE.md` 3a). A node asleep at its wires, or blocked, is not a candidate.~~
|
||||
|
||||
## Questions (as they were put)
|
||||
|
||||
@@ -135,30 +140,55 @@ own sources.
|
||||
item: "a boot without the physics fails"). Seen to fail on today's build (Task 1 Step 1).
|
||||
- [ ] **Step 2:** the protocol, all eight stages; then the push, on Captain Bob's word.
|
||||
|
||||
### Task 5: the registry and births (Q4: "Full births now")
|
||||
### Task 5: the registry and births, to spec
|
||||
|
||||
Each its own increment, each test first, each a boot:
|
||||
**5a's "Hera as now, in a fabric" is superseded for births** (2026-11-13): with Hera booted by
|
||||
`v4_boot_run`, her messages to a child are answered "no one is there" (`boot.c` speaks only her
|
||||
console's wire) and nothing runs a child while the boot drives her. To spec -- `MESH.md` 9,
|
||||
`MACHINE.md` 3, and as `v4/tests/test_host_unit.c` already does on the host -- **Hera is born empty in
|
||||
the kernel's fabric, and every node steps together** (`v4_fabric_step`). No scheduler.
|
||||
|
||||
- [x] **5a. A fabric in the kernel, Hera in it.** Ruled 2026-11-13 (Captain Bob): **"Hera as now, in
|
||||
a fabric"** -- she boots by `v4_boot_run` as before (the hosted product's parity kept), and her node
|
||||
is place 0 of the kernel's fabric (`sk_v4.c`), entered in the registry as node 10; her registry
|
||||
requests go to `v4_manage_serve` through `v4_boot`'s new `request` hook, and `centre.4th` and
|
||||
`hera.4th` are loaded on her through its new `capsules` list -- before the seal, so POST runs on
|
||||
them. The fabric has one place: `NODE-BORN` is answered "no room" until 5b. `CAPSULE-OPEN/-LINE`
|
||||
read the kernel's capsule directory, checked as the boot checks; no capsule of F18 code is there
|
||||
until 5b. She is not told her number ((ME) stays 0): the boot's console addresses node 0. Word
|
||||
count 375 (55 from the two capsules), each in the dictionary; `mkdictionary.py` loads the kernel's
|
||||
capsules into the hosted system before `WORDS`, so the live list is the kernel's.
|
||||
Seen to fail first: the acceptance check `NODE-ME .` gave UNKNOWN WORD; then `0 ok`.
|
||||
- [ ] **5b. Births.** `NODE-BORN`: room for a node from the kernel's heap, a place in the fabric, a
|
||||
Stadium quota granted from Hera's under the new node's key (`stadium_node_key(number)`), its
|
||||
opcode patrons; `NODE-KILL` gives the room and the quota back. The capsule words
|
||||
(`CAPSULE-OPEN/-CELL/-LINE`) from the kernel's capsule directory.
|
||||
- [ ] **5c. Who runs next.** The turn-attractor: each step, the coolest awake node that can run
|
||||
executes an instruction word; the opcode charge for every node at the heartbeat's service points.
|
||||
A test that two busy nodes take turns as their heat says, and a sleeping node is never chosen.
|
||||
- [ ] **5d. Acceptance.** A boot births a node from Hera, it answers a line, Hera kills it, and the
|
||||
Stadium is CONSERVED after.
|
||||
- [x] **5a. The registry** (2026-11-13; `f10d2bc8`): Hera at place 0, entered as node 10; `centre.4th`
|
||||
and `hera.4th`; `NODE-ME`. Kept; its boot is replaced by 5b.
|
||||
- [x] **5b. The mesh boot** -- `v4/system/mesh.c` (new), the kernel's boot of the fabric, a host test
|
||||
first (`v4/tests/test_host_meshboot.c`, 64-bit cells, as `test_host_unit.c`):
|
||||
1. the nucleus: the machine's ROM assembles the system on a node of its own (`boot.c`'s
|
||||
`load_system`, shared); written as a capsule of F18 cells (`v4_capsule_write`) -- "a node that
|
||||
is born is given assembled code, never the source" (Captain Bob, 2026-10-15);
|
||||
2. Hera born empty at place 0 of the fabric: the kernel on her port 0 (it gives her the nucleus
|
||||
a cell at a time, and takes her requests -- blocks, the kernel's words, the registry), the
|
||||
console on her port 1 (whole messages); stepped until she sleeps at her wires;
|
||||
3. told she is 10 and where the console is; entered in the registry; the kernel's words;
|
||||
`forth79.4th` a line at a time; sealed; POST (`v4_post_run`, its lines as messages); the
|
||||
kernel's capsules (`centre.4th`, `hera.4th`); sealed;
|
||||
4. the same parity lines as `v4_boot_run` prints, so acceptance reads a mesh boot as it read the
|
||||
other;
|
||||
5. a line from the console is a message to node 10; what any node prints comes back as messages;
|
||||
how it ended is said; `KEY` reads her console registers, fed by the host;
|
||||
6. births: `NODE-BORN` makes a node in room the owner gives, carrying the mesh ROM, wired to the
|
||||
kernel on its port 0 for its blocks; `NODE-KILL` gives the room back. `CAPSULE-OPEN` of
|
||||
`v4:nucleus-64.f18` reads the nucleus a cell at a time.
|
||||
The test: the parity lines; POST passes; `NODE-ME .` 0; `KEY`; `11 2 2 BIRTH` -- node 11 takes in
|
||||
the nucleus and FORTH-79 and answers a line; `11 KILL`.
|
||||
- [x] **5c. The kernel boots by it** (`sk_v4.c`): the prompt's lines go to node 10 as messages; the
|
||||
identity gate, the block chain after POST, the heartbeat's service; a born node's room from the
|
||||
kernel's heap, its Stadium quota granted from Hera's under its node key (`stadium_node_key`), its
|
||||
opcode patrons charged with Hera's; its quota given back when it is killed. The hosted product
|
||||
keeps `v4_boot_run`; `boot.h`'s "differ only in where the text goes" is corrected.
|
||||
- [x] **5d. Acceptance:** a boot births a node from Hera, it answers a line, Hera kills it, the
|
||||
Stadium CONSERVED after; then the protocol.
|
||||
|
||||
**Built (2026-11-13).** 5b: `v4/system/mesh.c`, `v4/include/v4/mesh.h`; `boot.c` shares
|
||||
`v4_boot_assemble` (which `v4_boot_run` now calls), `v4_boot_capsule` and its number printing;
|
||||
the image carries `(ME)`'s address. `v4/tests/test_mesh_boot.c` (in `make -C v4 test`): failed
|
||||
first (no `mesh.c`), then 16 checks -- POST 539/539, `NODE-ME` 0, `11 2 2 BIRTH`, node 11 answers
|
||||
directly and through Hera, `11 KILL`. 5c: `sk_v4.c` boots by it -- 16 places, a born node's room
|
||||
from the kernel's heap, its Stadium quota under its node key granted from Hera's on its first
|
||||
charge and given back when it is killed (`stadium_return_quota`, `stadium_ops_forget`: failed first,
|
||||
then `test_stadium_ops` 20 checks); every node's opcodes charged. A line that waits for an answer
|
||||
is broken by the next line, as a message (`MESH.md` 7b.6). 5d: `qemu_session.py births()`. The
|
||||
amd64 boot: 160 s (about 90 s before -- POST and the lines now go as messages); `dict_hash`
|
||||
changes (Hera is told she is 10).
|
||||
|
||||
## What this phase does not do
|
||||
|
||||
|
||||
Reference in New Issue
Block a user