Author SHA1 Message Date
rajames fdf9c1946c Merge pull request 'v4 fabric to spec: the mesh boot, the one adaptive heartbeat, mechanism A (#189)' (#197) from StarForth-v4.0.0 into master
Runner image / Build and publish the runner image (push) Failing after 8m54s
Release / Release ${{ github.ref_name }} (push) Failing after 35m23s
Merge StarForth-v4.0.0: the fabric to spec (v4.0.0-alpha.5), PR #197
2026-11-19 11:19:48 +00:00
Claude b9b2bd81da logs: the protocol on 7975bab0 (the heartbeat's walk in slices): PASS
Acceptance / Acceptance (pull_request) Successful in 31m27s
Build / Image RASPI (push) Successful in 3m7s
Build / Image PC (push) Successful in 3m35s
Build / Image MILKV (push) Successful in 4m2s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 14m45s
Every stage passes. accept-aarch64 passes BIRTH and every later check,
in 459 s. POST is 990/990 on all four boots, with one dict_hash
(0x847bd8ef42f53e14). test-32, the proofs, the images and the docs pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 03:11:18 +00:00
Claude 7975bab049 heartbeat: the Stadium's resident heat, walked a slice each tick -- CI's aarch64 BIRTH stall
The heartbeat's one input walked all 335,544 Stadium cells every tick,
about 15 ms on aarch64 TCG, longer than a tick. At fast pacing it took
the CPU, and a birth missed the session's 300 s on CI. That was my
11-17 change.

Captain Bob ruled: sample less often, scaled by the cells, measured
first, as a slice each tick; the slope inference later.
- stadium_heat_walk_step() walks STADIUM_HEAT_SLICE_CELLS cells per
  tick (Kconfig, 5500, about 0.25 ms on aarch64 TCG).
- A completed walk is one sample.
- The heartbeat's load takes a sample only when a walk is done.

Test first: test_stadium_node (21 checks) and test_heartbeat (13). Both
failed to build before. All kernel host tests pass. Four aarch64 boots
in a row pass 18/18 each, BIRTH included.

The evidence is in logs/20261119-heat-slice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 02:32:38 +00:00
Claude 13fae6df30 qemu_session.py: the CPU snapshot also dumps the code at each PC
Eight words at the PC, by its address, name the function offline. The
image loads where the firmware puts it, and the boot does not print
that address. aarch64's monitor has no $pc, so the address is taken
from the register line; checked on a real, paused QEMU.

Test first: the snapshot test, 6 checks; the new one failed before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 02:32:21 +00:00
Claude b6c87b3045 logs: the protocol on 36b25805 -- FAIL: aarch64 BIRTH stalled here too; the repro boot that caught it
accept-aarch64 failed at BIRTH. The new CPU snapshot showed the kernel
looping, not hung. The other stages passed, including riscv64, the
stick, test-32, the proofs and the images. I ran them before reading
aarch64's result, which was the wrong order.

The repro boot (logs/20261119-012050) gave the code at each PC. Matched
in the loader EFI's map, they name bitmap_get inside
stadium_resident_heat_total, then background_decay and isqrt64. That is
the heartbeat's load, which walked all 335,544 Stadium cells every tick.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 02:32:21 +00:00
Claude 36b258054c qemu_session.py: a failed check prints where the CPUs are (cpu_snapshot)
CI's Acceptance fails on aarch64 at BIRTH on every head since 58d0e887.
The birth takes more than 300 s there and does not reproduce here: about
11 s, unsigned. The heartbeat spiral was ruled out by an instrumented
scratch kernel.

Captain Bob ruled "Diagnose on CI". On a failed check, the session script
asks QEMU's monitor for the registers three times, a second apart, and
prints the program counters, so CI's next failure shows where the kernel
is and whether it moves. A monitor that does not answer does not stop
the run.

Test first: scripts/test_qemu_session_snapshot.sh, 5 checks; 3 failed
before. The register text was checked on real, paused QEMU for aarch64,
riscv64 and x86.

The evidence and the measurements are in logs/20261119-ci-snapshot. The
local aarch64 timing run is in logs/20261118-235613.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 00:29:23 +00:00
Claude c2e42c3cba logs: the protocol on 0565a039 (release: v4.0.0-alpha.5): PASS
Build / Image RASPI (push) Successful in 4m54s
Build / Image PC (push) Successful in 3m52s
Build / Image MILKV (push) Successful in 4m41s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 14m54s
Acceptance / Acceptance (pull_request) Failing after 40m41s
Every stage passes. POST is 990/990 on all four boots, with one
dict_hash (0x847bd8ef42f53e14). test-32, the proofs, the images and the
docs pass. accept-aarch64 (411 s) and docs ran in the background, each
alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 23:39:23 +00:00
Claude 0565a03996 release: v4.0.0-alpha.5
Captain Bob ruled: the line for new work is drawn with a merge, then a
tag, v4.0.0-alpha.5. This sets LITHOS_VERSION in kernel/Makefile and
updates README, CHANGELOG and CLAUDE.md to match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 23:06:05 +00:00
Claude 7099f42a5a logs: the protocol on e29a00f7: PASS
Build / Image RASPI (push) Successful in 4m57s
Build / Image PC (push) Successful in 5m8s
Build / Image MILKV (push) Successful in 5m21s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 14m17s
Acceptance / Acceptance (pull_request) Failing after 43m4s
Every stage passes. POST is 990/990 on all four boots, with one
dict_hash (0x847bd8ef42f53e14). test-32, the proofs, the images and the
docs pass. accept-aarch64 (416 s) and docs ran in the background, each
alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 22:19:53 +00:00
Claude e29a00f717 docs: dict_hash 0x847bd8ef42f53e14 in README and CLAUDE.md; FABRIC-3 XLVIII.28 closes the capsule-blocks work
Captain Bob ruled: the line for new work is drawn with a merge, then a tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 21:43:57 +00:00
Claude 49c6ec82ee logs: the protocol on 53b1e98e: PASS
Build / Image PC (push) Successful in 5m36s
Build / Image MILKV (push) Successful in 5m22s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 14m25s
Build / Image RASPI (push) Successful in 6m41s
Acceptance / Acceptance (pull_request) Failing after 46m7s
This covers capsule blocks steps 1-4 for v4. Every stage passes.
- POST is 990/990 on all four boots.
- One dict_hash on the three ISAs: 0x847bd8ef42f53e14 (new, from
  loading capsules through blocks).
- test-32, the proofs, the images and the docs pass.
- accept-aarch64 (435 s) and docs ran in the background, each alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 21:14:41 +00:00
Claude 53b1e98eb7 plan capsule blocks: v3's INIT is kept as it is (Captain Bob)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 20:40:12 +00:00
Claude 15a8ec8bcf rules: the hosted product is not a concern -- only the gates that run it are kept green (Captain Bob)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 20:34:38 +00:00
Claude 6dcfbe6740 Capsule blocks steps 3+4 for v4: capsules are placed in RAM and load their lowest block
Captain Bob ruled: Block n lands at n-R; the lowest block is
interpreted; chaining is the developer's; together, v4 first.
- v4_blocks_place_capsule copies each Block n into RAM block n - R as 16
  lines of 64, space-padded, in any file order. A later block of the
  same number overwrites. It refuses a block below R.
- The mesh's load(), its capsule reader (CAPSULE-OPEN/(LINES), so a
  child's forth79.4th via BIRTH too), boot.c and test_host_unit's model
  each place a capsule, then interpret "<lowest> LOAD".
- mkdictionary.py skips --> when it types capsules at the hosted prompt.
- The v4 capsules are renumbered into R..2R-1, landing at RAM 1900 and
  up, away from POST's blocks 0-5. Each is chained with -->, and
  centre.4th's gap at 8103 is closed.

Test first:
- test_host_blocks.c gained 6 placement checks; it failed to build
  before.
- test_mesh_boot.c checks forth79's lowest block in RAM block 1900; it
  failed before.

After: POST is 990/990; all 52 tests at 64 bits, test-32, hosted-check
and ASan/UBSan pass; the amd64 kernel builds; the dictionary has 404
words.

Logs are in logs/20261118-capsule-place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 20:33:21 +00:00
Claude bcfca9fa19 plan capsule blocks: (- is a build marker per block, loads verbatim; CI's hook an open stub for the SDK (Captain Bob)
Build / Image PC (push) Successful in 6m11s
Build / Image MILKV (push) Successful in 6m10s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 14m21s
Acceptance / Acceptance (pull_request) Failing after 8m10s
Build / Image RASPI (push) Successful in 6m1s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 19:57:49 +00:00
Claude dd3469f9a3 plan capsule blocks: (- marks a system blob -- the idea, its rulings so far, and what is open
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 19:51:40 +00:00
Claude f30005e1f6 Capsule blocks step 2: mkcapsule makes no claims -- a later write overwrites
Captain Bob ruled "Overwrite. That's it. Deterministic and final", within
a capsule and across capsules, "consistent with VOCABULARY FORGET & FENCE
philosophy, not implementation". Of what only prevented collisions:
"All of it goes".
- The cross-capsule collision gate is gone.
- tools/capsule-reserved.txt and its check are gone.
- The interactive resolver and its claim registry are gone.
- BLOCK_MAP.md says "Blocks used", and marks a shared number "the later
  write overwrites". It is a convenience, not a gate.
- An unknown option is refused with the usage. A removed mode was
  otherwise taken for the capsules directory, with its next argument as
  the output file.

Test first: scripts/test_mkcapsule_overwrite.sh, 9 checks.
- The before-run failed 7. A repeat within one capsule already built,
  since there was never a check for it.
- After: all 9 pass.

step 1's test still passes, the amd64 build is clean, all 40 capsules
lint, and the mesh boot passes 109 checks with POST 990/990.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 19:44:32 +00:00
Claude 6f9900f805 Capsule blocks step 1: the RAM block count is a build knob, BLK_RAM_USER_BLOCKS
Captain Bob ruled that the offset is the RAM block count, not a literal
2048.
- v3/include/blk_layout.h defines it, 2048 by default. block_subsystem.h
  derives BLK_RAM_BLOCKS (2080) and BLK_DISK_START from it.
- Kconfig.kernel has the symbol. kernel/Makefile passes it to the
  kernel's C code and builds mkcapsule and mkartemis with it.
- mkcapsule's two literal 2048s are now the knob.

The default value is unchanged, so the layout and the media are as before.

Test first: scripts/test_capsule_ram_blocks.sh, 8 checks.
- The before-run failed 4: the knob did not exist and mkcapsule ignored
  it. Its three Makefile checks also hit a SIGPIPE flaw in the test,
  fixed before the after-run.
- After: all 8 pass.

The amd64 build and mkartemis build clean. All 40 capsules lint. The
mesh boot passes 109 checks with POST 990/990. test_host_blocks,
test_host_quit, test_host_unit and test-32 pass.

Logs are in logs/20261118-ram-blocks-knob.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 17:35:15 +00:00
Claude cda8aad8b2 plan capsule blocks: no chaining, developer responsible; the work, for ruling
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 17:26:22 +00:00
Claude d36b78cc73 plan capsule blocks: "Block map is a convenience"; chaining open
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 17:25:41 +00:00
Claude ea0fd7c38e plan capsule blocks: the map stays (blocks used), the range tables go (Captain Bob)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 17:24:55 +00:00
Claude 47712e0cd1 plan capsule blocks: land at n, copy down to n-R; where it lands is the developer's responsibility
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 17:24:16 +00:00
Claude 5210abaa4e plan capsule blocks: the offset is the RAM block count, a Kconfig symbol (Captain Bob)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 17:21:39 +00:00
Claude 1061433791 plan capsule blocks: collisions overwrite -- "Deterministic and final" (Captain Bob)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 17:21:15 +00:00
Claude 38c4d5ac69 plan: capsules and their blocks -- the talk so far (rulings 1, 1b, 1c; the fixed 2048 is the bug)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 17:20:37 +00:00
Claude 52e184ef03 logs: the protocol on 913a896e: PASS
Build / Image RASPI (push) Successful in 6m14s
Build / Image PC (push) Successful in 5m28s
Build / Image MILKV (push) Successful in 5m28s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 14m45s
Acceptance / Acceptance (pull_request) Failing after 42m12s
Every stage passes. On all four boots POST is 990/990, with one
dict_hash (0xf4e9fdc94f6bfc77). test-32, the proofs, the images and
the docs pass. accept-aarch64 (397 s) and docs ran in the background,
each alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 16:57:34 +00:00
Claude 913a896e1b docs: dict_hash 0xf4e9fdc94f6bfc77 (404 words) in README and CLAUDE.md; FABRIC-3 XLVIII.27
Ruled by Captain Bob: batch the docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 16:24:03 +00:00
Claude 9bf30f7a21 rules: a long protocol stage may run in the background, but only alone (Captain Bob)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 16:23:01 +00:00
Claude 4ed2df4b56 logs: the protocol on 573d386b: PASS
Build / Image RASPI (push) Successful in 7m25s
Build / Image PC (push) Successful in 6m29s
Build / Image MILKV (push) Successful in 6m52s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 15m13s
Acceptance / Acceptance (pull_request) Failing after 45m42s
Every stage passes. On all four boots POST is 990/990, with one
dict_hash (0xf4e9fdc94f6bfc77, word_count=404). test-32, the proofs,
the images and the docs pass. accept-aarch64 (401 s) and docs ran in
the background, alone, at Captain Bob's rulings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 16:10:38 +00:00
Claude 573d386b51 v4 dictionary: STARSHIPOS's entry (the docs gate refused the build without one)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 15:19:14 +00:00
Claude 66d0af55d0 logs: the protocol on 295cd518 -- FAIL at docs only (STARSHIPOS had no dictionary entry); superseded
All seven other stages passed: POST 990/990 on all four boots, one
dict_hash (0xf4e9fdc94f6bfc77, word_count=404), test-32, the proofs and
the images.

aarch64 went past 590 s twice in the foreground, killed at the BIRTH
step. One background run, at Captain Bob's ruling, passed in 429 s with
the birth's parity recorded.

The docs stage failed because the dictionary gate found no entry for
STARSHIPOS. The entry comes next, then the protocol again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 15:19:14 +00:00
Claude 295cd5185c v4: COLD keeps the vocabularies as sealed -- FORGET's prune, shared
COLD set VOC-LINK to 0, assuming the sealed system has one vocabulary.
With starshipos.4th sealed in, STARSHIPOS fell out of the chain after
COLD. A word defined in it then forgotten, or COLDed away, hung the
node. ACL-INIT-PRIMITIVES would also have skipped its words.

FORGET's loop is now (PRUNE-ALL). It drops the vocabularies above (Q)
and prunes the lists of those that stay. FORGET calls it as before, and
COLD calls it with the sealed DP. No new cell and no new word.

Test first in test_mesh_boot.c: FORGET and COLD of a word in
STARSHIPOS, and STARSHIPOS's own words staying. The before-run hung and
was stopped at 500 s. After: 109 checks pass, POST is 990/990, all 52
64-bit tests and test-32 pass, ASan/UBSan are clean, and the amd64
build is clean.

Found by Captain Bob's "make sure we're not applying incorrect logic".
Ruled: fix first, then the protocol. Logs are in
logs/20261118-cold-vocabularies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 13:35:22 +00:00
Claude 8301d09db0 logs: the protocol on b80bd5cd, superseded before its docs stage
Every boot passed: POST 990/990 on all four, dict_hash
0x3172c04e863199f4 on the three ISAs. test-32, the proofs and the
images passed.

The docs stage was stopped. The protocol is superseded because a latent
fault was found: COLD drops STARSHIPOS from the vocabulary chain
(VOC-LINK 0). Captain Bob ruled: fix first, then the protocol.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 13:14:11 +00:00
Claude b80bd5cd27 plan v4 init.4th: step 1 first; held -- "Capsules are ephemeral. We need to talk later" (Captain Bob)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 09:42:04 +00:00
Claude a98baaacdd plan: v4's init.4th -- design, for ruling
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 00:59:34 +00:00
Claude 4137f1b70d v4: starshipos.4th loaded before POST, as MACHINE.md 3 step 3 says
Captain Bob ruled that MACHINE.md stands. The kernel's system capsules
are now starshipos.4th, centre.4th, hera.4th and physics.4th, after
forth79.4th.

COLD, after POST, leaves FORTH alone in the search order, so the
prompt reaches STARSHIPOS's words by naming the vocabulary. The ruling
is that init.4th will set the search order; the capsule's header now
says so.

Test first in test_mesh_boot.c: its parity line, and `STARSHIPOS S" ok"
DOE`. It failed before the change. 105 checks now pass, POST is
990/990, and ASan/UBSan and the amd64 build are clean.

Logs are in logs/20261118-starshipos.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 00:59:04 +00:00
Claude 9ee797db7f Revert "starshipos.4th: its header says it is not loaded by the boot"
This reverts commit 9ae86b873e.
2026-11-18 00:56:00 +00:00
Claude 9ae86b873e starshipos.4th: its header says it is not loaded by the boot
Ruled by Captain Bob (2026-11-18): leave it unloaded. mkcapsule --lint
passes on all 40 capsules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 00:54:49 +00:00
Claude b789d18ac0 Phase 7 plan, Task 8: the 171 ticked -- done 2026-11-14 (POST-PARITY.md section 6, 990/990, floor 990)
Ruled by Captain Bob.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 00:51:48 +00:00
Claude 58d0e887ff logs: the protocol on c30e4a0a: PASS
Build / Image RASPI (push) Successful in 4m42s
Build / Image PC (push) Successful in 5m57s
Build / Image MILKV (push) Successful in 5m56s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 14m17s
Acceptance / Acceptance (pull_request) Failing after 42m19s
Every stage passes. On all four boots POST is 990/990, with one
dict_hash (0x627f392ccbaa96f1). test-32, the proofs, the images and the
docs pass. The docs stage ran in the background at Captain Bob's ruling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 00:22:20 +00:00
Claude c30e4a0afb CLAUDE.md: POST and parity as of 2026-11-17 (990 tests, 403 words, dict_hash 0x627f392ccbaa96f1)
Ruled by Captain Bob.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 23:49:58 +00:00
Claude 371ea698d4 capsules/README: Hermes's row gone (it moved into the kernel); Hestia and the v4 capsules listed
Build / Image RASPI (push) Successful in 3m53s
Build / Image PC (push) Successful in 4m28s
Build / Image MILKV (push) Successful in 4m33s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 14m8s
Ruled by Captain Bob. The empty capsules/hermes/ is left as it is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 23:45:06 +00:00
Claude 151b52f15a DATASHEET-F18 13.3: births resolved (046ce0be) -- the kernel's mesh fits each born node with the mesh ROM
Ruled by Captain Bob.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 23:39:03 +00:00
Claude b68da43c19 DATASHEET-F18 13.1: per-call-target heat resolved (#189) -- the table is gone, the kernel keeps the word's accounts
Ruled by Captain Bob.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 23:38:43 +00:00
Claude 1fe72399cf v4/README: POST runs at boot; still no K measurement (none found in v4's source)
Ruled by Captain Bob.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 23:38:16 +00:00
Claude 81890760e4 v4/README: the mesh, not the lone node
The kernel boots the fabric with Hera at place 0. Nodes are born and
killed through her. The fabric is lockstep. Each step walks only the
places that hold a node, and every node ticks on the one adaptive
heartbeat.

Ruled by Captain Bob.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 23:37:42 +00:00
Claude c2364b3646 README: v4's POST as of the protocol on edbb79e2 (990 tests, word_count=403, dict_hash 0x627f392ccbaa96f1)
Ruled by Captain Bob. The v3 line is left as it is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 23:36:48 +00:00
Claude f93cde222d docs: FABRIC-3 XLVIII.26 -- mechanism A, and the protocol passing on edbb79e2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 23:36:21 +00:00
Claude 9f172ea977 logs: the protocol on edbb79e2 (mechanism A): PASS
Build / Image RASPI (push) Successful in 3m51s
Build / Image PC (push) Successful in 4m33s
Build / Image MILKV (push) Successful in 3m51s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 14m44s
Every stage passes. On all four boots POST is 990/990, with one
dict_hash (0x627f392ccbaa96f1). aarch64 is inside its 570 s; before
mechanism A it stopped in POST. test-32, the proofs, the images and the
docs pass.

The docs stage runs longer than one foreground command; it ran in the
background at Captain Bob's ruling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 23:18:02 +00:00
Claude edbb79e2af v4 fabric: each pass of a step walks only the places that hold a node (mechanism A)
The fabric keeps its occupied places as a list in ascending order, and
the step's nine passes walk that list in the same order as before. A
place removed mid-walk keeps its link, so the walk goes on to the next
node.

Test first: test_fabric_walk.c, 13 checks.

Every existing fabric and mesh test passes with the same checks, and so
do test-32 and ASan/UBSan. The host mesh boot runs POST 990/990. Over
five alternating runs its median falls from 11.695 s to 7.999 s.

Logs are in logs/20261117-mechanism-a.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 22:23:58 +00:00
Claude d34fa415c3 docs: the slowdown at 046ce0be is not a regression (Captain Bob)
Build / Image RASPI (push) Successful in 2m54s
Build / Image PC (push) Successful in 3m42s
Build / Image MILKV (push) Successful in 3m44s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 12m10s
The direct loop before 046ce0be was architecturally incorrect. The fabric
wiring removed it and exposed the slowdowns, and the instruments (ASan,
UBSan, perf) locate them.

FABRIC-3 XLVIII.24 and .25 and both 11-17 plans are corrected in place,
and every measurement is kept. Mechanism A is the first speed-up found,
not a fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 21:57:23 +00:00
Claude 116297d7cf docs: record 2026-11-17 -- the regression at 046ce0be, the fault dump, the one heartbeat
Build / Image PC (push) Successful in 7m41s
Build / Image MILKV (push) Successful in 7m5s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 13m48s
Build / Image RASPI (push) Successful in 5m48s
FABRIC-3 XLVIII.25 covers the day's work:
- the regression found at 046ce0be (the fabric step walking every place);
- the CI directive and its rulings;
- the fault dump, the diagnose stage and the protocol-report fix;
- the one adaptive heartbeat;
- the protocol on cc09a88b (FAIL: aarch64 stopped in POST);
- next, mechanism A.

XLVIII.24 is corrected in place: its "no measurable cost" was measured
against an already-slow baseline.

The Phase 7 plan's Task 3 tick by execution is marked superseded.
ENGINE.md section 6 records the tick as settled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 21:52:06 +00:00
Claude 8660ab7770 logs: PROTOCOL.md for cc09a88b (the one adaptive heartbeat) -- FAIL: aarch64 STOPPED in POST at 570 s (the fabric step's cost); amd64, riscv64, stick POST 990/990, one dict_hash 0x627f392ccbaa96f1; test-32 PASS; labelled
Build / Image RASPI (push) Successful in 6m19s
Build / Image PC (push) Successful in 5m7s
Build / Image MILKV (push) Successful in 6m24s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 13m55s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 21:20:28 +00:00
Claude cc09a88b67 logs: the one adaptive heartbeat's tests, before and after, labelled
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 20:55:14 +00:00
Claude 00be537503 feat(v4, kernel): ONE adaptive heartbeat -- it paces itself on the Stadium's resident heat; every VM ticks on it, in lockstep
Captain Bob, 2026-11-17: "The adaptive heartbeat is its own thing ... It has its own independent RWOT and slope
provider. Only one output from the entire stadium is used as a load measurement for heart rate pacing. ... ONE
AS IN THE NUMBER 1 heartbeat (the adaptive one) runs the entire system." Ruled one at a time: the kernel's
heartbeat; resident heat its one input; held in POST; the Stadium charged as before today
(docs/v4.0.0/plans/2026-11-17-one-adaptive-heartbeat.md, its first version kept as superseded).

- kernel/src/heartbeat.c, timer.h: heartbeat_pace_from(load) -- its own window of samples, its own slope
  provider (v4's inference arithmetic) every HEARTBEAT_PACE_EVERY samples, Loop #7 setting its own period
  (not stable 20% faster, stable 25% slower, 1/4..4x the 10 ms base). No source (v3's path): nothing runs.
- kernel/src/vm/stadium.c: stadium_resident_heat_total(), read only -- the one output it paces by.
- v4/system/mesh.c, mesh.h: the owner's clock read at every fabric step; each tick delivered, one by one, to
  every node present -- its heartbeat cycle run, active, idle or blocked alike. The tick by execution, the
  nodes' own Loop #7 and the heartrate callback are gone.
- kernel/src/v4/sk_v4.c: the clock gives the heartbeat's bottom half its turn; 0 until POST has ended.
- Tests first, each seen to fail (does not build): kernel/tests/test_heartbeat.c (11 checks),
  test_stadium_node.c (16), test_mesh_boot.c's lockstep checks. Seven Phase 7 checks that assumed the tick by
  execution now drive the test's heartbeat (ruled). POST 990/990 with v3's heat cases as written;
  mesh-boot 103, -on 112, -noop 100, san-mesh-boot 103, every v4 program at both widths, every kernel host
  test: 0 failures. The full `sanitize` target not run (it outlasts the foreground limit).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 20:55:14 +00:00
Claude 4a5c9bfd42 docs(v4): one adaptive heartbeat -- every node ticks in lockstep on the fabric's beat; the design, its four points ruled
Captain Bob, 2026-11-17: "ONE ADAPTIVE HEARTBEAT. EVERY VM USES THAT ONE CLOCK ... THEY ADVANCE ONE TICK!"
Ruled: the beat is the fabric's steps; HEARTBEAT_CHECK_FREQUENCY steps a beat; the Stadium charged on it;
Loop #7 adapts the beat only; the heartbeat first, then mechanism A. Nothing built yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 20:01:21 +00:00
Claude e5cfe1d7d7 docs, logs: the fabric step's cost -- the design (for ruling), and Step 0 measured: about half the boot is the step walking every place, nine times a step, with one node
Captain Bob, 2026-11-17: "Fix the regression"; "Run Step 0, then report". Measure only; no code changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 19:53:14 +00:00
Claude fa55d35013 scripts: test_nightly_dict_hash.sh executable, as its sibling test_nightly_post_count.sh is (ruled 2026-11-17)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 19:45:30 +00:00
Claude 65d562d4e1 logs: PROTOCOL.md for 1b65ac63 -- FAIL (aarch64 STOPPED in POST at 570 s; stick-high's dict_hash check; proofs, images, docs not run), written by the fixed report; the report's test before and after
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 19:44:37 +00:00
Claude 68fd485441 fix(nightly): protocol-report writes its PROTOCOL.md when a boot stopped before POST's line
Under set -euo pipefail its lookups of PARITY:V4_POST / PARITY:V4_SYSTEM in a boot log that has
neither -- an aarch64 boot out of its 570 s in POST, 2026-11-17 -- ended the script silently (exit 1),
so a failing protocol had no report; so did a missing test-32.txt. The lookups are guarded as
dict-hash and post-count already guard theirs: the report is written, Result: FAIL, "none" for the
missing lines, "not run" for test-32 (ruled by Captain Bob: "Fix it, test first").

- scripts/test_nightly_protocol_report.sh (new): seen to fail first (7 of 7,
  logs/20261117-dump/test_protocol_report-before.log), then 7 of 7 pass; dict-hash's and post-count's
  tests still pass. NIGHTLY_PROTO, the protocol's scratch, settable for it as NIGHTLY_OUT is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 19:44:37 +00:00
Claude c890cadc12 logs: the acceptance on 45b11aec's tree (1b65ac63, clean) -- amd64, riscv64, test-32 PASS; aarch64 STOPPED at 570 s in POST; stick-high's stage FAIL on the missing aarch64 dict_hash; two diagnose builds; labelled
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 19:41:16 +00:00
Claude 1b65ac6352 logs: 11-14 whole-POST runs and 11-17's (the stopped aarch64 939-case boot; the fault dump's tests; diagnose's tests; two boots on an unclean tree), each labelled
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 19:14:50 +00:00
Claude f05df5f2a2 memory: the full reading of the record (2026-11-17), and the rules ruled that day -- discrepancies one at a time; POST as v3's
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 19:14:49 +00:00
Claude 45b11aec25 feat(v4, ci): the fault dump on a node's stop, and the EMERGENCY diagnostic build after a failed stage
Captain Bob's CI directive (2026-11-17) and the design he ruled point by point
(docs/v4.0.0/plans/2026-11-17-emergency-diagnostic-build.md).

- v4/system/dump.c, v4/include/v4/dump.h: what a node was doing when it stopped -- the fault's kind,
  address and count; P A B; the data stack, T first; the return stack, R first, each entry named by
  the word it falls in (the backtrace; ROM and below-every-word said so); the running line. Bounded
  dictionary walk; no C library. Ruled: every build, on a stop only (a handled fault keeps its line).
- kernel/src/v4/sk_v4.c: the dump before each of the three halts (not started; POST's blocks not
  let go; a node stopped on a fault) -- Hera and any stopped node. kernel/Makefile links dump.o.
- scripts/nightly.sh diagnose [<stage>]: after a failed stage, that configuration built again with
  EMERGENCY_CONSOLE_ENABLED=1 -- build only, nothing booted (ruled) -- its artifacts kept in
  logs/<TS>/diagnose/ only from a build that passed, with a README saying how to launch it with
  --log-level=debug. Always exits 0: evidence, never a result. The protocol runs it after a failed
  stage and still exits with that stage's code; acceptance.yml, nightly.yml and release.yml run it
  `if: failure()`, before the logs are kept. Any failed stage triggers it (ruled).
- capsules/BLOCK_MAP.md: as the build writes it -- the v4:physics.4th row, missing since 28ffed8f
  (ruled: commit the regenerated map).
- Test first: test_dump.c failed with no dump.c (logs/20261117-dump), then 15 checks at both widths
  and under ASan+UBSan. The diagnose stage: a real EMERGENCY amd64 build; a failing build exits 0 and
  keeps no artifacts (a defect found and fixed this way); the protocol path keeps the stage's exit.
- Also the write-up of the regression at 046ce0be, for ruling.

Not yet: acceptance on a clean tree (the next run); the kernel's stop wiring is compile-tested only
-- no boot reaches a stop on purpose.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 19:14:40 +00:00
Claude 3376255930 logs: two aarch64 development boots of v3's whole POST, STOPPED at 570 s, labelled (#189)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 13:32:30 +00:00
Claude 5b752693ae perf(v4): the lookup keeps its key in B; POST sends one line per suite, not three (#189)
Captain Bob's "Find the TCG cost first", continued. aarch64 still ran out of its 570 s at 281972ab
(logs/20261114-133155, STOPPED); amd64 passed in 253 s (logs/20261114-132732).

- (LOOKUP): the count-and-first-character key in register B while the entries are walked, and the
  xt kept on the stack until an entry passes it -- about 19 opcodes for an entry that cannot be the
  word, from 28. The answer is the same.
- POST: a suite begins with one line, DECIMAL FORTH DEFINITIONS FORGET (POST); its mark is made by
  the state line of its first case run (a skipped kernel case passes it on).

mesh-boot: 15.7 s -> 12.2 s (37.7 s before this work), POST 990 of 990. make -C v4 test: all passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 13:11:47 +00:00
Claude 281972abb2 perf(v4): POST at a boot's pace -- v3's per-suite put-back, and a lookup that rejects by two bytes (#189)
Ruled (Captain Bob, 2026-11-14): "Find the TCG cost first". v3's whole POST took the amd64
accept from about 3 m 15 s to 8 m 45 s, and aarch64 past its 570 s (logs/20261114-091651,
STOPPED, committed). Profiled on the host (gprof, mesh-boot): 87% of the time in POST's
lines, about 280,000 opcodes a line -- the interpreter's dictionary lookup.

- POST puts the dictionary back before each of v3's suites, as v3's run_test_suite does
  ("to remove test-created words"): a mark, (POST), forgotten and made again
  (V4_POST_SUITE). Only the dictionary: SCR, BASE and the rest stay as the cases left them.
- (LOOKUP) tries each entry by its count and first character first -- one fetch of the
  name's first cell, masked -- and only then its hidden flag and the whole name. The answer
  is the same; an entry that cannot be it costs a few opcodes, not some forty.

mesh-boot: 37.7 s -> 15.7 s, POST 990 of 990. make -C v4 test: all v4 tests passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-14 13:26:45 +00:00
Claude 37469f6c54 feat(v4): v3's whole POST is v4's POST -- 990 cases, all passed on Hera (#189)
Phase 7, Task 8: PARITY:V4_POST tests=990 pass=990 fail=0 on Hera (mesh-boot); the hosted
product 945 of them, all passed -- the 45 cases of physics.4th's words need the kernel.

- Enlarged, as ruled ("Enlarge v4 to fit"): a node is 32768 words, its data stack 1024
  deep (v3's), host and kernel alike; the dictionary's end moves with them.
- POST's runner compares every value a case leaves (v3's leave 101); V4_POST_KERNEL marks
  a case of the kernel's words, and a host without a kernel does not run it.
- mkpost.py --all is POST's table (make -C v4 post79), with docs/v4.0.0/POST.md; it reads a
  module's #defines (v3's Mama cases are MAMA_IMPLEMENTED, 0: v3's own POST skips all 20);
  it cuts no line between a word and the name it takes.
- Rules for the last of the table: the min/max and array-sum programs written as meant,
  CREATE's 26-character name (FORTH-79: 31), many_defs.
- POST_FLOOR 990.
- Tests sized for a 32-deep stack and a 16384-word node made deep-stack-ready
  (test_host_depth, test_host_quit, test_host_node, hosted-check, depthsweep.py).

make -C v4 test: all v4 tests passed. make -C kernel/tests test: all passed.
depthsweep at 1024: 230 runs, 0 failures. v4-checks running.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-14 08:12:23 +00:00
Claude 1aa33f31bf feat(v4): v3's whole POST, Task 8 round -- the rules, and v4 where the rulings put it (#189)
v3's whole POST on v4 at 983 of 1010 (the table's own count with its drops), from 850.
What remains is capacity ("Dictionary full", the 100-900-deep stacks): next, as ruled.

Found and fixed under the rulings (docs/v4.0.0/POST-PARITY.md):
- IS and DEFER@ refuse a word DEFER did not make, as v3: error 22, "Not deferred".
  v4's IS stored into any word -- POST's `42 IS DUP` broke DUP for every case after it.
  DEFER marks its word with flag 128 (dict.f18).
- SMUDGE and HIDDEN are compile-only, as v3's table: at the prompt v4's hid the newest word.
- Q./ by zero gives 0 and no error (ruled: v3's table); error 11 retired. The ROM's,
  the test's reference and its hand-assembled copy changed alike.
- FENCE is v3's: it protects what is defined so far. The variable is (FENCE).
- The line's length is (#SRC), no longer SPAN: an EXPECT in a line cut the rest of
  the line off, and 0 EXPECT could not leave SPAN 0 (FORTH-83).
- POST gains V4_POST_HEAD: the values left and how the output begins -- the form of a
  printout whose values are the run's own (TOP-WORDS, WORD-ENTROPY).

post_all_rules.py: the rest of the whole table where it is not taken as v3 ran it --
v4's units for the cases that wrote through HERE as a byte address (CMOVE>, BLANK,
ERASE, FILL wrote into the system's code), the standard's results (COMPARE, SEARCH,
BASE output, THRU, >BODY with FIND's address), v3's descriptions where v3 printed
otherwise, and the cases dropped with their reasons (SP@/SP! by D-2, DABS/DMIN
underflow, CMOVE>.bounds, THRU.negative_end).

make -C v4 test: all v4 tests passed (both widths, mesh-boot, inference).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-14 05:59:11 +00:00
Claude 3338abdc38 feat(v4): 2! 2@ 2, store a double as FORTH-83 says -- the high cell at the lower address (#189)
Captain Bob, 2026-11-14: "Yes, FORTH-83's layout". FORTH83.TXT, "number": "The address of the least
significant 16 bits is two greater than the address of the most significant 16 bits." v4 stored the low
cell first, as v3. dict.f18 (2,) and words.f18 (2@ 2!); test_host_dict.c and test_host_quit.c to the new
layout. POST 539/539; v4 test-64/32 dict and quit pass. Not pushed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-14 03:31:04 +00:00
Claude 0c36693099 docs(v4): authority 79, 83, ANS, then v3; a double stored as FORTH-83 says (#189)
Captain Bob, 2026-11-14. POST-PARITY.md. Not pushed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-14 03:16:23 +00:00
Claude 3de8427827 docs: the FORTH standards v4 is held to -- FORTH-79, FORTH-83, ANS Forth 1994 (#189)
Captain Bob, 2026-11-14: the standard first, in the order 79, 83, ANS, then v3; the texts in the repository
as references. FORTH-79 and FORTH-83 from the University of Vienna's FORTH archive (complang.tuwien.ac.at),
ANS Forth's final draft (dpANS) from Taygeta, as fetched, with their sources in
docs/reference/standards/README.md. Not pushed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-14 03:16:13 +00:00
Claude 1f128df5df docs(v4): whole-POST authority ruled -- the standard first (#189)
Captain Bob, 2026-11-14: FORTH-79 where it defines the word, FORTH-83 for words 79 lacks, v3 (its table where
it contradicts it) only for its own extensions; each rewritten case listed with its reason. POST-PARITY.md.
Not pushed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-14 02:40:06 +00:00
Claude 5cac792627 docs(v4): whole-POST parity ruled -- v3's table, not v3's bugs (#189)
Captain Bob, 2026-11-14: where v3 does not do what its own table says, v4 is held to the table; where a
case's output names v3's internals, to the same form with v4's values; both listed. POST-PARITY.md, the
Phase 7 plan's Task 8. Not pushed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-14 02:19:49 +00:00
Claude fa5a5c7096 tools(v4): mkpost --all -- v3's whole POST as a table, measured on v4: 849 of 1020 (#189)
v4/tools/mkpost.py --all --out FILE: every case of v3's whole POST (its 22 POST modules in test_runner.c's
order, Q48, stress, integration), v3 the reference, without touching system/post_cases.c or its document.
Run on Hera in the kernel's fabric after Phase 7 Task 4: 1020 cases, 849 pass, 171 fail -- by word and kind
in docs/v4.0.0/POST-PARITY.md section 5. Not pushed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-14 01:34:01 +00:00
Claude c64c70bdb7 feat(v4): Phase 7 Task 4 -- v3's entropy, TOP-WORDS, WORD-ENTROPY and (- words (#189)
capsules/v4/physics.4th, blocks 8202-8204: ENTROPY@ ENTROPY! RESET-ENTROPY as kernel requests -35..-37 (a
word's heat by the address ' leaves, a data word's too; an error for what is not a word, as v3's);
TOP-WORDS and WORD-ENTROPY in StarForth, printing in v3's form what the kernel gives them through (HOT#)
(HOT) (XT-HEAT), -38..-40 (the i-th hottest in v3's stable order); (- in StarForth, skipping to the
matching close paren with nesting, as v3's code does. Tests first: test_mesh_boot.c 101 checks, 110 on, 98
without opcode physics. Listing: 403 live words. amd64 PASS, word_count=403. Not pushed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-14 01:31:31 +00:00
Claude 855632b3c0 feat(v4): Phase 7 -- the tick counted as v3's: tokens taken, and words run from code defined at run time (#189)
Captain Bob, 2026-11-14: "v3" ... "we can always change it late". v3 counts an execution per token its
(C) interpreter takes and per word its definitions run. Measured on 8 lines, counting every call on v4 gave
~700 to v3's one for typed lines (the F18 interpreter's own calls) but 1:1 in compiled code, so no single
HEARTBEAT_CHECK_FREQUENCY could match v3. Now INTERPRET counts its tokens in (TOKENS) -- one F18 store, the
map gains the cell -- and the kernel adds them at each call; a call counts, and gets physics, only from
dictionary space or as INTERPRET's or EXECUTE's dispatch (the image gains their addresses). The knob stays
at v3's 256. test_inference.c out of the per-width tests (its own rule). Tests first: test_mesh_boot.c 90,
99 on, 87 without opcode physics; v4 test all pass. amd64 PASS, 181 s, dict_hash 0x5c53b2e18343a9b6.
Not pushed (held to the end of Phase 7).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-14 01:22:35 +00:00
Claude 28ffed8f57 feat(v4): Phase 7 Task 4 -- the loops' words: v3's physics-freeze and inference words, F18 asking the kernel (#189)
capsules/v4/physics.4th, a kernel capsule on Hera (blocks 8200-8201): FREEZE-WORD UNFREEZE-WORD FROZEN?
HEAT! HEAT@ DECAY-RATE@ Q.VARIANCE INFER-DECAY-SLOPE INFER-WINDOW-WIDTH INFER-RUN INFER-WINDOW@ INFER-DECAY@
INFER-VARIANCE@ INFER-FIT@ INFER-EARLY-EXIT@ -- each a KERNEL-WORD, requests -21..-34 (v4/mesh.h), served by
the kernel on any node: "The compudynamics is stadium/fabric" (Captain Bob, 2026-11-14). A word is named as
v3's, the newest visible entry of CONTEXT then FORTH (the image gains CONTEXT's address); the arithmetic is
v4/system/inference.c, v3's to the bit. Q48.16 results are v4's doubles (low cell, then high). HEAT! starts
the word's decay from now. Test first with v3's POST cases in v4's address units: test_mesh_boot.c 86
checks, 95 on, 83 without opcode physics. docs/reference/v4-dictionary.tsv: the 15 words (392 live).
amd64 PASS, word_count=392. Not pushed (held to the end of Phase 7).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-14 00:40:27 +00:00
Claude e1b731f444 feat(v4): Phase 7 Task 3b -- compudynamics on the 32 F18 opcodes as on the words, behind OPCODE_PHYSICS (#189)
Captain Bob, 2026-11-14: "we're supposed to be working on f18 opcode as well as our composed f18
dictionary"; ruled every loop on both, "and an easy revert if opcodes are too granular".

- The engine: a hook at retire (exec.h on_retire), as Part A's at call; NULL unless set. test_exec.c.
- The mesh: 32 opcode records per node, an opcode window, opcode transitions under L4; at every retired
  instruction decay at the opcodes' own slope, heat, temperature, the window, the transition; in each cycle
  all 32 cooled, the opcode window's service, inference on its heat. L8 scores from the words and its gates
  govern both; the tick stays paced by word calls. The window is now one type for words and opcodes.
- The revert: OPCODE_PHYSICS (Kconfig.physics, default y; the kernel's flags) -- 0 and the opcodes are
  counted and charged to the Stadium as in Phase 1. make -C v4 mesh-boot-noop builds and tests it.
- Tests first: test_mesh_boot.c 77 checks as built, 86 with pipelining on, 74 with the revert.
- Measured on amd64, back to back: 219 s on, 196 s off (+12% under TCG). Both boots' logs labelled.
Not pushed (held to the end of Phase 7).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-14 00:29:08 +00:00
Claude b5d99ba98b feat(v4): Phase 7 Task 3 -- the heartbeat snapshot; the loops complete (#189)
Each cycle publishes v3's HeartbeatSnapshot: the tick, the window's width and fill, the decay slope, and the
dictionary's heat as inference last counted it (words over 50, cooling, the heat in all). One copy, not
v3's two, which are for its heartbeat thread. With it every loop v3 runs before its prompt runs on v4's
word records on every node. Test first: test_mesh_boot.c 73 checks, 81 on. Not pushed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-14 00:10:46 +00:00
Claude 6d954ac279 feat(v4): Phase 7 Task 3 -- the inference engine and Loop #7 in each node's heartbeat cycle (#189)
v4/system/inference.c: v3's inference_engine.c and its Q48.16 arithmetic ported to the bit, no C library --
the variance, the window width (Levene), the decay slope (log-linear regression), the run with its 5%
early exit. v4/tests/test_inference.c links v3's own and compares them: POST's fixed cases, 20000 random
multiply/log pairs, 400 random trajectories (make -C v4 inference; in make -C v4 test). In each node's
cycle every 1000 ticks (HEARTBEAT_INFERENCE_FREQUENCY), once the window is warm: the trajectory from the
window's words' heat, the width and slope applied unless it exits early, then Loop #7 -- the heartrate
slower when stable, faster when not, within 1/4..4x; Hera's re-arms the kernel's heartbeat
(heartbeat_set_adaptive_period_ns), as v3's Hera. L8 reads its outcome. Test first: test_mesh_boot.c 72
checks, 80 on. amd64 PASS, 163 s. Not pushed (held to the end of Phase 7).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-13 23:59:18 +00:00
Claude d09eee9a08 feat(v4): Phase 7 Task 3 -- L8, v3's Jacquard selector, in each node's heartbeat cycle (#189)
v3's vm_heartbeat_update_l8 with its table (ssm_jacquard.c, compudynamics.c), rewritten in integers: the
regime from the window's entropy, the prediction CV and the locality of the last 32 calls; the current card
scored (ANOVA from inference, joint convergence under L5/L6), decayed 0.99, the next chosen by UCB1 over 64
cards; its gates L1-L7 applied to the loops, L1 and L4 within the build's ceilings. Every gate off and card 8
at the start, as v3's kernel boot. Applied through card_bits: v3 applies the card's number, one bit off --
filed #196, ruled "v4 correct, v3 as is". v4_mesh_l8_force as v3's ssm_l8_force_config; the exact decay
and window tests hold a card. Test first: test_mesh_boot.c 67 checks, 75 on. amd64 PASS, 156 s.
Not pushed (held to the end of Phase 7).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-13 22:38:36 +00:00
Claude 2379503900 feat(v4): the heartbeat cycle's 256 is Kconfig's HEARTBEAT_CHECK_FREQUENCY (#189)
Captain Bob, 2026-11-13: "The 256 should probably be either a kconfig knob or a feedback loop for RWOT".
It is already Kconfig.heartbeat's HEARTBEAT_CHECK_FREQUENCY (default 256, v3's); the mesh now reads it.
Set in the config or on make's line, the kernel passes it to every object (checked: 128 reaches the
compile). A feedback loop from the window would be a design change, not v3's: not made. Not pushed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-13 22:21:39 +00:00
Claude 7c33b99ebe feat(v4): Phase 7 Task 3 -- background decay and the window's adaptive pass in each node's heartbeat cycle (#189)
In v3's order (vm_heartbeat_run_cycle): the tick; background decay -- 64 words a cycle from a cursor down
the dictionary (v3's vm_tick_apply_background_decay), so a word not called cools; the window's adaptive
pass on its diversity (v3's rolling_window_run_adaptive_pass: halve to 256, double to 4096). Test first:
test_mesh_boot.c, 62 checks (70 with pipelining and the cache on). Inference, L8 and the snapshot next.
Not pushed (held to the end of Phase 7).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-13 22:20:22 +00:00
Claude 5c79bddbbb feat(v4): Phase 7 Task 3, first step -- each node's tick by execution, as v3 (#189)
Captain Bob, 2026-11-13: "By execution, as v3". v3's kernel runs a VM's heartbeat cycle every 256 word
executions (HEARTBEAT_CHECK_FREQUENCY, vm_core.c:912 and :1210), and its tick_count is the count of cycles.
Task 2a had used the kernel's timer heartbeat as the decay clock: corrected. Each node counts its word
calls; every 256th runs its heartbeat cycle at the call; the cycle's loops follow. The kernel no longer
gives the mesh its timer. Test first: test_mesh_boot.c, 59 checks (67 with pipelining and the cache on).
Not pushed (held to the end of Phase 7).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-13 22:17:50 +00:00
Claude e125c2b590 memory: the push point is the end of Phase 7 (#189)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-13 22:14:12 +00:00
Claude 826238e47b docs(v4): Phase 7 plan -- Task 2b measured: no cost (#189)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-13 21:55:59 +00:00
Claude 8871e4f097 logs: the timing comparison -- 2a booted again, 175 s: the host slowed, not Task 2b (#189)
Commit b880a6ea (Task 2a) checked out detached and booted on amd64: 175 s, as slow as Task 2b's 174 s and
181 s, against 2a's 146 s an hour before. 2b has no measurable cost; on the host the mesh boot was no
slower either. Not pushed (held to the Phase 7 boundary).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-13 21:55:52 +00:00
Claude 3a70e824a2 feat(v4): Phase 7 Task 2b -- pipelining and the hot-words cache, built, off as v3 (#189)
Rulings, Captain Bob 2026-11-13: "Build a hot-words cache"; then, v3 being found to have both off
(ENABLE_PIPELINING, ENABLE_HOTWORDS_CACHE: n in Kconfig.physics and kernel/Makefile), "Built, off as v3".

- The kernel, at every call (mesh.c): v3's hit check, the transition, the likeliest next word (kept as each
  count rises; v3 scans 1024 a call -- the same word but in a tie v3's Q48.16 rounding makes), speculation
  at v3's thresholds into the node's cache; a word past heat 50 promoted at its call (v3 promotes at a
  lookup; v4's heat is the kernel's). Counters from the owner's heap, given back when a word goes.
- The node (dict.f18): (LOOKUP) tries (HOT)'s xts first, in F18, calling only C@; the kernel keeps it true
  (entries that go, or whose name is defined again, taken out). Empty unless the build has the cache.
- Tests: test_mesh_boot.c as built (57 checks) and with both on (mesh-boot-on, 65). v4 test: all pass.
- Reported, v3's own: when full, its promote takes the next slot without looking for the word there (a few
  hot words churn all 32 slots); its prefetch misses are never counted. Both reproduced.
- amd64 boots, RESULT: PASS, but 174 s and 181 s against 2a's 146 s, while on the host the mesh boot is no
  slower: being measured. Not pushed (held to the Phase 7 boundary).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-13 21:52:01 +00:00
Claude b880a6eaed feat(v4): Phase 7 Task 2a -- decay, heat, temperature and the rolling window at every call (#189)
As v3's physics_pre_execute, in its order (Captain Bob, 2026-11-13: "Every call, as v3"): a word's heat
decays by the ticks since its last touch at the node's decay slope (Q48.16, v3's arithmetic), unless
frozen or L8 has Loop #3 off; +1; its temperature smoothed 3:1; its ID into the node's Rolling Window of
Truth (4096, warm at 1024, a diversity check due every 512). The kernel's heartbeat is read at each call.
Pipelining and the hot-words cache ruled "Built, off as v3" (Task 2b). Test first: test_mesh_boot.c, 56
checks. amd64 boots, RESULT: PASS, 146 s against Phase 2's 142 s. Not pushed (held).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-13 20:32:36 +00:00
Claude 922451cf52 feat(v4): Phase 7 Task 1 -- v3's physics fields on the word records, and each node's physics state (#189)
v4_mesh_account gains v3's DictPhysics: heat (execution_heat), last_decay_tick, temperature_q8, and the
kernel's own state flags (pinned, frozen); v4_mesh_physics gives each node v3's VM fields -- its tick,
the decay slope (v3's initial 21845, Q48.16), L8's gate on Loop #3. v4_mesh_state_flags derives a word's
flags as v3 does, immediate and hidden read from the node's header when asked. Test first:
test_mesh_boot.c, 48 checks. The kernel gives each of its 16 places its physics. Not pushed (held,
Captain Bob 2026-11-13: "Hold it, go ahead with Task 1").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-13 20:00:28 +00:00
Claude 41f8c1ec28 docs(v4): Phase 7's plan -- the loops on the word records, and v3's whole POST; the inventory (#189)
Rulings, Captain Bob 2026-11-13: the per-call loops "Every call, as v3"; the loops "Rewrite for v4"; Phase 7
accepted on "v3's whole POST", which brings Phase 3's words and Phase 4's ACL in as tasks of it; Mama's
20 cases as v4 words with v3's names -- "do not compose words in C99, use F18 and StarForth"; the C
modules (ACL, break_me) rewritten for v4.

docs/v4.0.0/POST-PARITY.md (Task 0): v3's POST by module against v4 on e8e7ec8b -- 888 cases in the 17
modules mkpost.py reads (550 Required, 317 for words v4 already has, 21 for words it lacks), 146 in the
nine it does not, 12 C tests; about 1,050 in all, 539 on v4 today.

Not pushed: no protocol run covers it yet (rules: batch docs with the next protocol).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-13 19:53:24 +00:00
588 changed files with 741807 additions and 2215 deletions
+6 -4
View File
@@ -198,8 +198,10 @@ removed as an active target.)
**Current status: M7.1** — capsule birth protocol, Mama FORTH vocabulary, Tripod multi-VM
fleet (Hera/Artemis/Hestia — Hermes moved into the kernel as kernel-Hermes, FABRIC-3.6.md
Phase 4, 2026-09-22), and word-level ACL (Phases 1–7) are live; POST at boot verifies parity
hash across amd64/aarch64/riscv64 with a 318-word Mama capsule dictionary (word count as of
2026-11-10, hash `0x8c92508f748f99cf`; corrected 2026-11-10 — this file said 526 words,
hash across amd64/aarch64/riscv64 with a 404-word dictionary (word count as of 2026-11-18, hash
`0x847bd8ef42f53e14`, POST 990/990, `logs/20261118-204012/PROTOCOL.md`, capsules loaded through blocks; before that
`0xf4e9fdc94f6bfc77`, `logs/20261118-151921/PROTOCOL.md`; corrected 2026-11-18 — this file said
403 words, hash `0x627f392ccbaa96f1` (2026-11-17, before `starshipos.4th` loaded); it said 318 words, hash `0x8c92508f748f99cf` (2026-11-10); corrected 2026-11-10 — it said 526 words,
hash `0x82f4ae7cb2e2d424` (2026-10-14, `FABRIC-3.md` §XXXVIII); verify against a live
`PARITY:V4_SYSTEM word_count=` line before citing, it changes with any new C word registration).
@@ -229,7 +231,7 @@ Output: `build/<arch>/kernel/starkernel_loader.efi` + `build/<arch>/kernel/stark
Two independently tracked version strings flow into the generated `include/version.h`:
`VERSION` (`kernel/Makefile` — the embedded StarForth engine version, currently `3.2.0`;
note this does **not** auto-sync with the standalone StarForth repo's own version) and
`LITHOS_VERSION` (`kernel/Makefile` — the kernel version, currently **`4.0.0-alpha.4`**; corrected 2026-11-10 — this file said `2.1.0` (bumped at
`LITHOS_VERSION` (`kernel/Makefile` — the kernel version, currently **`4.0.0-alpha.5`**; corrected 2026-11-18 — this file said `4.0.0-alpha.4`; corrected 2026-11-10 — it said `2.1.0` (bumped at
the `v2.1.0` tag that closed FABRIC-3.6; corrected 2026-10-14 from `3.1.0` / `2.0.0`, which
replaced `2.0.1` on 2026-09-19 per `FABRIC-3.md` §I.2 — `2.0.1` named the SER5
hardware-track line and claimed unverified progress). The versioning policy is
@@ -358,7 +360,7 @@ before each architecture. The prompt is `[zuse@Hera] ok> `.
Do not claim a change is accepted until all three architectures have booted, and their logs are
present in `logs/`:
- **as built (v4)** to `[zuse@Hera] ok> `, with `PARITY:V4_POST tests=538 pass=538 fail=0` (the count
- **as built (v4)** to `[zuse@Hera] ok> `, with `PARITY:V4_POST tests=990 pass=990 fail=0` (2026-11-17; the count
grows with v4's POST) and `POST: PASSED`, and `PARITY:V4_SYSTEM ... dict_hash=` equal across
the three;
- **the PC stick loaded high** (Captain Bob, 2026-10-29, after the SER5 page-faulted in the
File diff suppressed because it is too large Load Diff
+35
View File
@@ -140,3 +140,38 @@ him -> the tag, on his word.
milestone."). What it holds now is all it gets: #189 (the blocker), #191, #192, #193 and what was already in it.
If he proposes another item for alpha.5, remind him of this ruling and offer the next milestone; only his
explicit word that he is overriding it reopens it.
- **Push point: the Phase 7 boundary** (Captain Bob, 2026-11-13: "Yup, phase 7 boundary is our push point";
"I'm not wanting to trigger a new build"). Each push to StarForth-v4.0.0 starts build.yml and moves PR 164's
head. During #189 Phase 7, commit locally and hold; push once, behind a passing protocol, at the Phase 7
boundary -- "End of phase 7" (2026-11-13): when Phase 7 is accepted, v3's whole POST passing on v4, not at
the end of the loops. Before then, only on his word.
## Ruled 2026-11-17 (Captain Bob) -- standing
- **Every discrepancy, ONE AT A TIME.** Wherever I find a discrepancy (doc vs code, v3 vs v4, rule vs practice,
directive vs record), present it to Captain Bob by itself, and let him decide, before the next. Never batch them,
never decide one myself.
- **POST is as v3's works.** Not reproducing v3's tests AS WRITTEN, or a parity mismatch, is THE failure.
- Order given: inspect the debug (EMERGENCY) build first, then write the design for the failure-triggered
diagnostic build -- for his ruling, before building.
## A long stage may run in the background, but only alone (Captain Bob, 2026-11-18)
A protocol stage that takes longer than one foreground command (600 s at most) may run in the
background, on one condition: **nothing else runs at the same time**, no other background process
of any kind, the docs stage included. Captain Bob: "Aarch64 bg is fine as long as there is no other
background process running including docs. In fact that might generalize too."
So:
- **One stage at a time,** foreground or background. A background stage is waited for before the
next stage, or anything else, starts.
- **Still one QEMU at a time.**
- **Today this covers** `accept-aarch64` (401 to 429 s for the boot plus its session) and `docs`.
Any other long stage runs the same way.
## The hosted product is not a concern (Captain Bob, restated 2026-11-18)
"Nobody cares about hosted anymore. I told you that."
- No effort goes into the hosted v4 product (`v4/tools/hosted.c`, `boot.c`'s use by it) for its own
sake.
- It is touched only to keep the gates that still run it green: the docs stage's dictionary check
(`v4/tools/mkdictionary.py`) and `make -C v4 test`. Ruled "Keep the boot.c change", for that reason.
+4
View File
@@ -71,6 +71,10 @@ jobs:
- name: Acceptance 32-bit build
run: scripts/nightly.sh test-32
- name: EMERGENCY diagnostic build (on failure; evidence, not a result)
if: failure()
run: scripts/nightly.sh diagnose # build only; the failed step stays the job's failure
- name: Keep the logs and DoE CSVs
if: always()
uses: actions/upload-artifact@v3
+4
View File
@@ -94,6 +94,10 @@ jobs:
if: always()
run: scripts/nightly.sh proofs
- name: EMERGENCY diagnostic build (on failure; evidence, not a result)
if: failure()
run: scripts/nightly.sh diagnose # build only; the failed step stays the job's failure
- name: Keep the logs and DoE CSVs
if: always()
uses: actions/upload-artifact@v3
+4
View File
@@ -107,6 +107,10 @@ jobs:
build/nightly/
build/nightly-docs/
- name: EMERGENCY diagnostic build (on failure; evidence, not a result)
if: failure()
run: scripts/nightly.sh diagnose # build only; the failed step stays the job's failure
- name: Keep the logs and DoE CSVs
if: always()
uses: actions/upload-artifact@v3
+14
View File
@@ -1,5 +1,19 @@
# Changelog
## 2026-11-18 — LithosAnanke v4.0.0-alpha.5: the fabric to spec
The kernel boots v4's fabric as designed (#189):
- Hera is born in the fabric and runs v3's whole POST, 990 cases, as written.
- Every node ticks on the one adaptive heartbeat, in lockstep.
- Each step walks only the places that hold a node (mechanism A, which brought aarch64 back inside
its 570 s).
- A fault dump prints when a node stops, and a diagnostic build follows any failed stage.
- Capsules are ephemeral: a block lands at its number less the RAM block count, a later write
overwrites, and the loader interprets the lowest block
(`docs/v4.0.0/plans/2026-11-18-capsule-blocks.md`).
`dict_hash` is `0x847bd8ef42f53e14`. `docs/fabric/FABRIC-3.md` XLVIII.25–28.
## 2026-11-10 — LithosAnanke v4.0.0-alpha.4: the plug-and-play stick
The plug-and-play stick (#92), the BAM flush (#155), the Book of Fabric (#138), the Dictionary of v4 (#157), and the .com’s Downloads and Documents pages (#126, #161).
+21
View File
@@ -28,6 +28,18 @@ config STARFORTH_V4
2026-10-14: v3 is being retired. Off builds v3 alone. See
docs/v4.0.0/DECOMPOSITION.md and boards/BRINGUP.md A6.
config BLK_RAM_USER_BLOCKS
int "The VM's user RAM block count (BLK_RAM_USER_BLOCKS)"
default 2048
help
How many blocks of fast RAM a VM sees: LBN 0 .. BLK_RAM_USER_BLOCKS - 1.
The block layout is derived from it (v3/include/blk_layout.h,
block_subsystem.h: BLK_RAM_BLOCKS, BLK_DISK_START). A capsule page
`Block n` must have n at least this, and is copied down by it to be
interpreted (docs/v4.0.0/plans/2026-11-18-capsule-blocks.md). mkcapsule
and mkartemis are built with the same value. Changing it moves where
disk blocks start, so media made with another value do not match.
config PARITY_MODE
bool "Deterministic parity harness mode (PARITY_MODE)"
default n
@@ -99,6 +111,15 @@ config STADIUM_CAPACITY_TICK
tuning is DoE work (item 5.1), same treatment as the other
placeholder constants in this file.
config STADIUM_HEAT_SLICE_CELLS
int "Stadium cells walked per heartbeat tick for the heartbeat's load (STADIUM_HEAT_SLICE_CELLS)"
default 5500
help
The adaptive heartbeat paces by the Stadium's resident heat, walked a
slice each tick: a whole walk is cells / this many ticks. 5500 is about
0.25 ms on aarch64 under TCG (measured 2026-11-19), a tenth of the
fastest tick.
config STADIUM_MEMORY_PERCENT
int "Percent of free physical memory the Stadium claims at boot (STADIUM_MEMORY_PERCENT)"
default 1
+11
View File
@@ -20,6 +20,17 @@ config ENABLE_HOTWORDS_CACHE
migration exists to collapse to one source of truth. Set to y
to enable; also gates L8 Jacquard's L1_heat_tracking bit.
config OPCODE_PHYSICS
bool "Compudynamics on the 32 F18 opcodes as well as the words (OPCODE_PHYSICS)"
default y
help
#189 Phase 7, ruling 7 (Captain Bob, 2026-11-14): every loop -- heat,
decay, temperature, the rolling window, pipelining, inference -- runs
on a v4 node's 32 opcodes, fed at every retired instruction, as on its
composed words. "And an easy revert if opcodes are too granular": this
is it. Off, the opcodes are counted (HEAT-OP) and charged to the
Stadium as in Phase 1, and nothing more.
config ENABLE_PIPELINING
bool "Speculative execution via word transition prediction (ENABLE_PIPELINING)"
default n
+6 -6
View File
@@ -1,4 +1,4 @@
# LithosAnanke v4.0.0-alpha.4
# LithosAnanke v4.0.0-alpha.5
**UEFI-bootable FORTH microkernel.** Boots from firmware, initialises memory and interrupts, then
runs StarForth as its sole userspace runtime. No libc. No OS. Just stone and necessity.
@@ -7,8 +7,8 @@ runs StarForth as its sole userspace runtime. No libc. No OS. Just stone and nec
**Try it in your browser:** [starshipos-f18.com](https://starshipos-f18.com/) — a StarshipOS
machine of your own, booted to `[zuse@Hera] ok>`, thrown away when you leave. **Releases:**
[v4.0.0-alpha.4](https://gitea.starshipos-f18.org/rajames/LithosAnanke/releases),
the kernel `4.0.0-alpha.4` with the StarForth engine `3.2.0`.
[v4.0.0-alpha.5](https://gitea.starshipos-f18.org/rajames/LithosAnanke/releases),
the kernel `4.0.0-alpha.5` with the StarForth engine `3.2.0`.
---
@@ -45,13 +45,13 @@ milestone, #156): what v4 needs of it, the block layer, moves into v4 and the re
| Bare metal | a generic PC (amd64; first on the bench: a Beelink SER5), Raspberry Pi 5 (aarch64), Milk-V Mars (riscv64); Zynq-7020 (ARMv7) not yet ported | Images build; first boots on the bench — `boards/BRINGUP.md` |
**v4 is the default build, and v3 is being retired**: every kernel boots v4 unless its boot
arguments say `system=v3`. POST at boot, on all three ISAs: v4 — **538 tests**,
`PARITY:V4_SYSTEM word_count=317 dict_hash=0xfec8c47cfc6f437f`; v3 — **1052 tests**,
arguments say `system=v3`. POST at boot, on all three ISAs: v4 — **990 tests**,
`PARITY:V4_SYSTEM word_count=404 dict_hash=0x847bd8ef42f53e14` (`logs/20261118-204012/PROTOCOL.md`); v3 — **1052 tests**,
`PARITY:M7.1a word_count=526 hash=0x82f4ae7cb2e2d424`.
**How a change gets in** (the Captain Bob method): `master` is reached only through a pull request
that passed **acceptance** — amd64, aarch64 and riscv64 booted in QEMU to `[zuse@Hera] ok>`, POST
538/538 and one `dict_hash` on all three; the PC stick booted loaded above 2 GiB, as a PC's firmware
990/990 and one `dict_hash` on all three; the PC stick booted loaded above 2 GiB, as a PC's firmware
loads it; and the 32-bit build's tests. Every acceptance boot starts from a fresh stick, so every
run is a first boot. The same stages run nightly and for every release (`scripts/nightly.sh`); the
serial logs are committed.
+26 -24
View File
@@ -6,7 +6,7 @@
## Capsule Summary
| Capsule | Blocks claimed | xxHash64 | Signed |
| Capsule | Blocks used | xxHash64 | Signed |
|---------|----------------|----------|--------|
| `ACL.4th` | 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4015 | `0xf8890c05c0d8f921` | n/a |
| `acl-std79.4th` | 4023, 4024, 4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 4033, 4034, 4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 4043, 4044, 4045, 4046, 4047, 4048 | `0x773bf9209df191d1` | n/a |
@@ -29,10 +29,11 @@
| `sdk.4th` | 5109, 5110, 5111, 5112, 5113, 5114, 5115 | `0x008fdbbb62c94a3a` | n/a |
| `turtle.4th` | 5100, 5101, 5102, 5103, 5104, 5105, 5106, 5107, 5108 | `0x4d470418ca543365` | n/a |
| `user-font-demo.4th` | 4200, 4201, 4202 | `0xce1fd7d1b581a56d` | n/a |
| `v4:centre.4th` | 8100, 8101, 8102, 8104, 8105, 8106, 8107 | `0xccd1b28a101c78b2` | n/a |
| `v4:forth79.4th` | 6000, 6001, 6002 | `0x4055641ee17d176b` | n/a |
| `v4:hera.4th` | 8000, 8001 | `0x85300ad4e6e8b86b` | n/a |
| `v4:starshipos.4th` | 7000, 7001 | `0xb74bfa51f8d4719a` | n/a |
| `v4:centre.4th` | 3964, 3965, 3966, 3967, 3968, 3969, 3970 | `0xea5815290d56dff3` | n/a |
| `v4:forth79.4th` | 3948, 3949, 3950 | `0x4609d6ef54166ef8` | n/a |
| `v4:hera.4th` | 3960, 3961 | `0x78730b1d6effe892` | n/a |
| `v4:physics.4th` | 3972, 3973, 3974, 3975, 3976 | `0x5b0195fc30828bde` | n/a |
| `v4:starshipos.4th` | 3956, 3957 | `0x1734a8f4fe7483a5` | n/a |
| `workload-0.4th` | 2200, 2201 | `0x93f86f60aeba8feb` | n/a |
| `workload-1-lite.4th` | 5058, 5059 | `0x44a7a7e3176dcc8d` | n/a |
| `workload-1.4th` | 4406, 4415, 4425, 4435 | `0x63e251adb0a03613` | n/a |
@@ -104,6 +105,25 @@
| 2160 | `workload-8.4th` | `0x56b7f2f0efa000df` | ok |
| 2200 | `workload-0.4th` | `0x93f86f60aeba8feb` | ok |
| 2201 | `workload-0.4th` | `0x93f86f60aeba8feb` | ok |
| 3948 | `v4:forth79.4th` | `0x4609d6ef54166ef8` | ok |
| 3949 | `v4:forth79.4th` | `0x4609d6ef54166ef8` | ok |
| 3950 | `v4:forth79.4th` | `0x4609d6ef54166ef8` | ok |
| 3956 | `v4:starshipos.4th` | `0x1734a8f4fe7483a5` | ok |
| 3957 | `v4:starshipos.4th` | `0x1734a8f4fe7483a5` | ok |
| 3960 | `v4:hera.4th` | `0x78730b1d6effe892` | ok |
| 3961 | `v4:hera.4th` | `0x78730b1d6effe892` | ok |
| 3964 | `v4:centre.4th` | `0xea5815290d56dff3` | ok |
| 3965 | `v4:centre.4th` | `0xea5815290d56dff3` | ok |
| 3966 | `v4:centre.4th` | `0xea5815290d56dff3` | ok |
| 3967 | `v4:centre.4th` | `0xea5815290d56dff3` | ok |
| 3968 | `v4:centre.4th` | `0xea5815290d56dff3` | ok |
| 3969 | `v4:centre.4th` | `0xea5815290d56dff3` | ok |
| 3970 | `v4:centre.4th` | `0xea5815290d56dff3` | ok |
| 3972 | `v4:physics.4th` | `0x5b0195fc30828bde` | ok |
| 3973 | `v4:physics.4th` | `0x5b0195fc30828bde` | ok |
| 3974 | `v4:physics.4th` | `0x5b0195fc30828bde` | ok |
| 3975 | `v4:physics.4th` | `0x5b0195fc30828bde` | ok |
| 3976 | `v4:physics.4th` | `0x5b0195fc30828bde` | ok |
| 4000 | `ACL.4th` | `0xf8890c05c0d8f921` | ok |
| 4001 | `ACL.4th` | `0xf8890c05c0d8f921` | ok |
| 4002 | `ACL.4th` | `0xf8890c05c0d8f921` | ok |
@@ -365,24 +385,6 @@
| 5113 | `sdk.4th` | `0x008fdbbb62c94a3a` | ok |
| 5114 | `sdk.4th` | `0x008fdbbb62c94a3a` | ok |
| 5115 | `sdk.4th` | `0x008fdbbb62c94a3a` | ok |
| 6000 | `v4:forth79.4th` | `0x4055641ee17d176b` | ok |
| 6001 | `v4:forth79.4th` | `0x4055641ee17d176b` | ok |
| 6002 | `v4:forth79.4th` | `0x4055641ee17d176b` | ok |
| 7000 | `v4:starshipos.4th` | `0xb74bfa51f8d4719a` | ok |
| 7001 | `v4:starshipos.4th` | `0xb74bfa51f8d4719a` | ok |
| 8000 | `v4:hera.4th` | `0x85300ad4e6e8b86b` | ok |
| 8001 | `v4:hera.4th` | `0x85300ad4e6e8b86b` | ok |
| 8100 | `v4:centre.4th` | `0xccd1b28a101c78b2` | ok |
| 8101 | `v4:centre.4th` | `0xccd1b28a101c78b2` | ok |
| 8102 | `v4:centre.4th` | `0xccd1b28a101c78b2` | ok |
| 8104 | `v4:centre.4th` | `0xccd1b28a101c78b2` | ok |
| 8105 | `v4:centre.4th` | `0xccd1b28a101c78b2` | ok |
| 8106 | `v4:centre.4th` | `0xccd1b28a101c78b2` | ok |
| 8107 | `v4:centre.4th` | `0xccd1b28a101c78b2` | ok |
## Conflicts
None.
---
*39 capsule(s) scanned. Re-run `mkcapsule --manifest <dir>` to refresh.*
*40 capsule(s) scanned. Re-run `mkcapsule --manifest <dir>` to refresh.*
+6 -1
View File
@@ -14,8 +14,13 @@ changes the hash and the birth protocol rejects the image.
| `doe.4th` | user | DoE workload words (`EXEC-DOE`) — opt-in |
| `workload-0.4th` … `workload-9.4th` | `(p)` | Numbered personality variants |
| `init-l8-*.4th` | `(p)` | L8 Jacquard mode variants (stable/volatile/diverse/temporal/transition/omni) |
| `hermes/init.4th` | `(p)` | Hermes baby VM personality |
| `artemis/init.4th` | `(p)` | Artemis baby VM personality |
| `hestia/init.4th` | `(p)` | Hestia, the third Tripod leg (Hera/Artemis/Hestia): bind point and drawing-fabric owner |
| `v4/forth79.4th` | v4 | The FORTH-79 Required Word Set as colon definitions, loaded at boot (blocks 6000 up) |
| `v4/starshipos.4th` | v4 | The StarshipOS words in their own vocabulary, `STARSHIPOS`, loaded after `forth79.4th` (blocks 7000 up) |
| `v4/hera.4th` | v4 | What is Hera's alone: `KILL`, `PAUSE`, `RESUME` by number, through the kernel's registry (block 8000) |
| `v4/centre.4th` | v4 | What a node that births others needs: the kernel's requests by number (block 8100) |
| `v4/physics.4th` | v4 | The words of the loops: v3's physics-freeze and inference words, asked of the kernel (block 8200) |
## Block namespace
+13 -7
View File
@@ -1,4 +1,4 @@
Block 8100
Block 3964
( centre.4th -- what a node that births others needs. )
( docs/v4.0.0/MESH.md 9a. Births follow v3: any node may )
( birth on its own ports, and is its children's parent. )
@@ -14,7 +14,8 @@ VARIABLE (T#)
: (TC) ( c -- ) PAD (T#) @ + C! 1 (T#) +! ;
: (TS) ( baddr u -- )
DUP IF 0 DO DUP I + C@ (TC) LOOP DROP ELSE DROP DROP THEN ;
Block 8101
-->
Block 3965
: (TN) ( n -- ) 0 <# #S #> (TS) 32 (TC) ;
: (T) ( -- baddr u ) PAD (T#) @ ;
( The node being born: its number, its place, the port of )
@@ -27,7 +28,8 @@ VARIABLE (KIDC) VARIABLE (PERS) VARIABLE (PERS#)
-1 NODE-ERROR ! ;
: (TOLD) ( how -- ) 1 - IF (FAIL) THEN ;
: (TELL) ( baddr u -- ) (KID#) @ SEND (KID#) @ AWAIT (TOLD) ;
Block 8102
-->
Block 3966
( the system, a capsule of F18 code, cell by cell to its port )
: (NUCLEUS) ( -- )
S" v4:nucleus-64.f18" CAPSULE-OPEN 0= IF (FAIL) THEN
@@ -36,7 +38,8 @@ Block 8102
: (LINES) ( baddr u -- ) CAPSULE-OPEN 0= IF (FAIL) THEN
BEGIN PAD CAPSULE-LINE DUP 0< 0= WHILE PAD SWAP (TELL) REPEAT
DROP ;
Block 8104
-->
Block 3967
( Who it is, where its printing goes, which of its ports )
( leads to everything it is not told of, and who is there. )
: (WHO) ( -- )
@@ -45,7 +48,8 @@ Block 8104
(KIDC) @ (TN) S" DEFAULT-ROUTE " (TS)
(ME) @ (TN) (KIDC) @ (TN) S" NEIGHBOUR" (TS)
(T) 0 (KIDP) @ SEND-ON (KID#) @ AWAIT (TOLD) ;
Block 8105
-->
Block 3968
( number port childport baddr u -- place A NODE IS BORN, )
( its port childport joined to this one's port: empty, then )
( the system, FORTH-79, and its personality if u is not 0. )
@@ -60,7 +64,8 @@ Block 8105
S" (SEAL)" (TELL)
(KID) @ (KID#) @ NODE-PARITY
(KID) @ ;
Block 8106
-->
Block 3969
( number port childport -- place a node with no capsule )
: BIRTH 0 0 BIRTH-AS ;
( Two outer nodes are joined: port 3 of X to port 4 of Y, )
@@ -74,7 +79,8 @@ VARIABLE (XP) VARIABLE (XN) VARIABLE (YP) VARIABLE (YN)
: (JOIN) ( -- )
(XP) @ 3 (YP) @ 4 NODE-WIRE 0= IF (FAIL) THEN
(YN) @ 3 (XN) @ (SAY) (XN) @ 4 (YN) @ (SAY) ;
Block 8107
-->
Block 3970
( n -- A UNIT: four outer nodes, n+1 to n+4, on ports 2 )
( to 5 of this one, each by its own port 2, and joined in a )
( square: 1-2, 2-4, 4-3, 3-1. )
+6 -4
View File
@@ -1,10 +1,11 @@
Block 6000
Block 3948
( forth79.4th -- the FORTH-79 Required Word Set for v4, )
( as colon definitions, loaded when the system boots. )
( docs/v4.0.0/NUCLEUS.md. Blocks 6000 up. )
( docs/v4.0.0/NUCLEUS.md. Blocks 3948 up. )
( A word moves here from the assembled nucleus, v4/capsule, )
( once its colon definition passes POST. )
Block 6001
-->
Block 3949
( U* U/MOD -- FORTH-79 unsigned multiply and divide. )
( Neither v3 nor the v4 nucleus had them. )
( The first two words count the bits in a cell. )
@@ -14,7 +15,8 @@ Block 6001
VARIABLE (UD)
( u1 u2 -- ud the unsigned double product )
: U* UM* ;
Block 6002
-->
Block 3950
( ud u1 -- u2 u3 unsigned: u2 the remainder, u3 the quotient )
( One bit a step: shift ud left, and take u1 from its high )
( cell whenever it goes, counting that in the low cell. )
+3 -2
View File
@@ -1,4 +1,4 @@
Block 8000
Block 3960
( hera.4th -- what is Hera's alone, beside centre.4th, which )
( she loads first. docs/v4.0.0/MESH.md 9a. She decides )
( which nodes there are and which are awake: KILL, PAUSE and )
@@ -14,7 +14,8 @@ Block 8000
: KILL ( n -- )
(THERE?) 0= IF ." KILL: " (NO-NODE) THEN
DUP NODE-KILL NO-ROUTE ;
Block 8001
-->
Block 3961
: PAUSE ( n -- )
(THERE?) 0= IF ." PAUSE: " (NO-NODE) THEN NODE-SLEEP ;
: RESUME ( n -- )
+71
View File
@@ -0,0 +1,71 @@
Block 3972
( physics.4th -- the words of the loops, v3's physics-freeze )
( and inference words, on a node the kernel keeps records )
( for: each asks its kernel, which keeps every word's and )
( opcode's physics and does the arithmetic -- compudynamics )
( is the Stadium/fabric's: #189 Phase 7, Task 4, Captain Bob )
( 2026-11-14. The requests, by their numbers in v4/mesh.h: )
-21 KERNEL-WORD FREEZE-WORD ( baddr u -- )
-22 KERNEL-WORD UNFREEZE-WORD ( baddr u -- )
-23 KERNEL-WORD FROZEN? ( baddr u -- flag )
-24 KERNEL-WORD HEAT! ( n baddr u -- )
-25 KERNEL-WORD HEAT@ ( baddr u -- n )
-26 KERNEL-WORD Q.VARIANCE ( addr u -- d )
-27 KERNEL-WORD INFER-DECAY-SLOPE ( addr u -- d )
-28 KERNEL-WORD INFER-WINDOW-WIDTH ( addr u -- n )
-29 KERNEL-WORD INFER-RUN ( -- )
-->
Block 3973
( and what the last INFER-RUN, or the heartbeat's, found; )
( a q is a Q48.16 double, as qmath.f18's )
-30 KERNEL-WORD INFER-WINDOW@ ( -- u )
-31 KERNEL-WORD INFER-DECAY@ ( -- d )
-32 KERNEL-WORD INFER-VARIANCE@ ( -- d )
-33 KERNEL-WORD INFER-FIT@ ( -- d )
-34 KERNEL-WORD INFER-EARLY-EXIT@ ( -- flag )
( v3's DECAY_RATE_PER_US_Q16, its compile-time constant )
1 CONSTANT DECAY-RATE@
-->
Block 3974
( v3's StarForth module: a word's execution heat, by the )
( address ' leaves; and the hottest -- the kernel's records )
-35 KERNEL-WORD ENTROPY@ ( addr -- n )
-36 KERNEL-WORD ENTROPY! ( n addr -- )
-37 KERNEL-WORD RESET-ENTROPY ( -- )
-38 KERNEL-WORD (HOT#) ( -- n )
-39 KERNEL-WORD (HOT) ( i -- xt heat )
-40 KERNEL-WORD (XT-HEAT) ( xt -- n )
( TOP-WORDS n: the n hottest, in v3's form )
: TOP-WORDS ( n -- )
DUP 1 < IF ." TOP-WORDS: invalid count " 0 .R CR EXIT THEN
." Top " DUP 0 .R ." most frequently used words:" CR
." ==================================" CR
(HOT#) MIN 0 ?DO I (HOT) SWAP I 1+ 0 .R ." . "
>NAME COUNT TYPE ." : " 0 .R CR LOOP ;
-->
Block 3975
( WORD-ENTROPY: every word with heat, then the totals, as v3 )
VARIABLE (WE-T) VARIABLE (WE-N)
: WORD-ENTROPY ( -- )
." Word Usage Statistics (Execution Heat Counts):" CR
." =============================================" CR
0 (WE-T) ! 0 (WE-N) ! LATEST
BEGIN DUP WHILE 1 (WE-N) +!
DUP (XT-HEAT) ?DUP IF OVER >NAME COUNT TYPE ." : "
DUP 0 .R CR (WE-T) +! THEN >LINK @
REPEAT DROP
." -------------------------------------" CR
." Total executions: " (WE-T) @ 0 .R CR
." Total words: " (WE-N) @ 0 .R CR
(WE-T) @ IF ." Average executions per word: "
(WE-T) @ (WE-N) @ / 0 .R CR THEN ;
-->
Block 3976
( (- skips its input to the matching close paren, nesting, )
( as v3's code does -- its documentation says to the line end )
: (- ( -- ) 1
BEGIN DUP 0= IF DROP EXIT THEN
>IN @ SOURCE SWAP DROP < 0= IF DROP EXIT THEN
SOURCE DROP >IN @ + C@ 1 >IN +!
DUP 40 = IF DROP 1+ ELSE 41 = IF 1- THEN THEN
AGAIN ;
+4 -8
View File
@@ -11,8 +11,9 @@
\ N-18 N-17, and (Q/), Q./'s five scratch cells, fixed in the memory map
\ (MACHINE.md 2.1).
\
\ ERRORS. Q./ by zero leaves the result D-11 gives and stores 11, "Division
\ by zero", into NODE-ERROR (D-18).
\ Q./ by zero gives 0 and no error: v3's table, "division by zero yields q=0"
\ (Captain Bob, 2026-11-14, docs/v4.0.0/POST-PARITY.md; it was D-11's Q max or
\ Q min and error 11).
macro SWAP over push push drop pop pop endmacro
macro - push inv pop + inv endmacro \ x y -- x-y
@@ -88,8 +89,6 @@ macro OR over inv and xor endmacro
SWAP push 0 (D+) pop
push over pop SWAP (Q>INT) push (Q>INT) pop SWAP ;
: (QERR11) NODE-ERROR b! 11 !b ;
: (D2*C) ( lo hi cin -- lo' hi' cout )
a! dup -if L1 drop 1 jump L2 L1: drop 0 L2: push
over -if L3 drop 1 jump L4 L3: drop 0 L4:
@@ -137,7 +136,4 @@ macro OR over inv and xor endmacro
OV: drop drop drop pop pop drop drop
(Q/)+4 b! @b -if OVP drop 0 MSB ; OVP: drop -1 MAXHI ;
DIV: (UQ/) (Q/)+4 b! @b -if L3 drop (DNEGATE) ; L3: drop ;
ZERO: drop drop drop
over over OR if Z0 drop -if ZP drop drop 0 MSB jump (QERR11)
ZP: drop drop -1 MAXHI jump (QERR11)
Z0: drop jump (QERR11)
ZERO: drop drop drop drop drop 0 0 ; \ by zero: 0, as v3's table (ruled 2026-11-14)
+5 -4
View File
@@ -1,11 +1,12 @@
Block 7000
Block 3956
( starshipos.4th -- the StarshipOS words, in their own )
( vocabulary, STARSHIPOS: not FORTH-79, so not in FORTH. )
( Loaded when the system boots, after forth79.4th. )
( Blocks 7000 up. New definitions still go into FORTH; the )
( search starts in STARSHIPOS, then FORTH. )
( Blocks 3956 up. New definitions still go into FORTH; the )
( search starts in STARSHIPOS once init.4th sets it. )
VOCABULARY STARSHIPOS STARSHIPOS DEFINITIONS
Block 7001
-->
Block 3957
( DOE baddr u -- as S" name" DOE )
( Intended: run the DoE of that name, from the capsule of )
( that name. As yet it only types the name back -- asked for )
+4 -4
View File
@@ -88,7 +88,7 @@ set HDR-NFA here ", LIST #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK her
DONE: drop jump CR
\ ---- LOAD ----------------------------------------------------------------------
\ The text being interpreted is at (SRC), SPAN characters of it, >IN the
\ The text being interpreted is at (SRC), (#SRC) characters of it, >IN the
\ place in it. LOAD saves those and BLK on the return stack, points them at
\ the block, interprets it, and puts them back; so a block may LOAD another,
\ and the rest of the line LOAD was on is interpreted afterwards. (v3's
@@ -105,11 +105,11 @@ set HDR-NFA here ", LOAD #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK her
: LOAD
-if POS jump BAD
POS: if BAD
BLK a! @ push >IN a! @ push SPAN a! @ push (SRC) a! @ push
BLK a! ! 0 >IN a! ! 1024 SPAN a! !
BLK a! @ push >IN a! @ push (#SRC) a! @ push (SRC) a! @ push
BLK a! ! 0 >IN a! ! 1024 (#SRC) a! !
&(BLK-SRC) (SRC-HOOK) a! !
INTERPRET
pop (SRC) a! ! pop SPAN a! ! pop >IN a! ! pop BLK a! ! ;
pop (SRC) a! ! pop (#SRC) a! ! pop >IN a! ! pop BLK a! ! ;
BAD: drop NODE-ERROR b! 13 !b ;
\ ( -- ) go on with the next block. Only in a block being loaded: at the
+2 -1
View File
@@ -59,7 +59,7 @@ macro ROT push SWAP pop SWAP endmacro
(C)+9 a! !
0 STATE a! ! (CG-RESET)
CFBASE (CFP) a! !
SPAN a! @ >IN a! !
(#SRC) a! @ >IN a! !
(C)+9 a! @ NODE-ERROR b! !b ;
: (ABANDON) -1 jump (ABANDON-AS)
@@ -196,6 +196,7 @@ set HDR-NFA here ", EXECUTE #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK
set HDR-NFA here ", INTERPRET #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK here
: INTERPRET
: (IL) 32 WORD dup C@ if EOL
(TOKENS) b! @b 1 + !b \ a token taken: the tick counts it, as v3's (#189)
drop (LOOKUP) if NUM
dup -3 + a! @ \ xt flags
STATE a! @ if INTERP
+1 -1
View File
@@ -23,7 +23,7 @@ set HDR-LINK 0 \ the newest dictionary entry: none yet
\ 15 Deferred word not set 16 Not a word
\ 17 Storage refused 18 No one on that port
\ 19 Message refused 20 Node gone
\ 21 Interrupted
\ 21 Interrupted 22 Not deferred
\ -1 the word has printed its own message
macro SWAP over push push drop pop pop endmacro
+36 -6
View File
@@ -14,7 +14,7 @@
\ (ENGINE.md 3b; #189 Phase 2, Captain Bob 2026-11-13: "ID field in
\ the header"). The next is in (NEXT-ID); FORGET gives back the
\ IDs of what it removes, which are always the newest
\ xt - 3 flags: 1 immediate, 2 hidden, 4 data
\ xt - 3 flags: 1 immediate, 2 hidden, 4 data, 128 deferred (system.f18)
\ xt - 2 the word address of the name
\ xt - 1 the link: the xt of the entry before this one, 0 for the first
\ xt the code
@@ -89,7 +89,7 @@ set HDR-NFA here ", C, #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK here
drop a DP b! @b -1 + jump C!
FULL: drop ;
set HDR-NFA here ", 2, #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK here
: 2, ( lo hi -- ) SWAP , , ; \ the low cell first, as v3
: 2, ( lo hi -- ) , , ; \ the high cell first: FORTH-83's layout (#189, 2026-11-14)
set HDR-NFA here ", LATEST #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK here
: LATEST ( -- xt ) CURRENT a! @ a! @ ; \ the newest entry of the CURRENT vocabulary
@@ -124,9 +124,9 @@ set HDR-NFA here ", TRAVERSE #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK
NN: if ZERO drop dup C@ 31 and + 1 + ;
ZERO: drop ;
set HDR-NFA here ", SMUDGE #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK here
set HDR-NFA here ", SMUDGE #id, #, 16 #, HDR-NFA #, HDR-LINK set HDR-LINK here
: SMUDGE ( -- ) LATEST if NONE (FLAGS) a! @ 2 xor ! ; NONE: drop ;
set HDR-NFA here ", HIDDEN #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK here
set HDR-NFA here ", HIDDEN #id, #, 16 #, HDR-NFA #, HDR-LINK set HDR-LINK here
: HIDDEN ( -- ) LATEST if NONE (FLAGS) a! @ 2 OR ! ; NONE: drop ;
\ ---- telling the kernel (docs/v4.0.0/ENGINE.md 3b) ------------------------------
@@ -161,6 +161,8 @@ set HDR-NFA here ", (TELL-FORGOTTEN) #id, #, 0 #, HDR-NFA #, HDR-LINK set
\ (D)+0 where the name starts (D)+1 the name being looked up
\ (D)+2 the name being copied, or the entry being looked at
\ (D)+3 a count (D)+4 whether a lookup has gone on to FORTH
\ (D)+5 the name looked up's count and first character, as an entry's first
\ two bytes: each entry is tried by them first (#189 Phase 7: POST's time)
\ ( -- bytes ) what an entry for a name of (D)+3 characters takes: its name
\ cells and four more
@@ -201,17 +203,45 @@ set HDR-NFA here ", (TELL-FORGOTTEN) #id, #, 0 #, HDR-NFA #, HDR-LINK set
\ name fetched, the two names compared byte by byte -- so that the only call
\ it makes is C@: it is called from the interpreter for every word of every
\ line, with the user's return stack beneath it.
\ THE HOT-WORDS CACHE first (v3's hotwords_cache_lookup; #189 Phase 7, Captain
\ Bob 2026-11-13: "Build a hot-words cache", "Built, off as v3"): (HOT) holds
\ its count, the kernel's next slot, this word's index, then up to 32 xts the
\ kernel has put there. A visible one with the name is the answer; then the
\ dictionary, as before. The kernel keeps it true: an entry that goes, or
\ one whose name is defined again, it takes out. Empty unless the kernel's
\ build has ENABLE_HOTWORDS_CACHE.
: (LOOKUP)
dup (D)+1 a! ! \ cut the string to 31 characters
C@ -32 + -if LONG drop jump CUT
LONG: drop 31 (D)+1 a! @ C!
CUT:
0 (HOT)+2 a! !
H: (HOT)+2 a! @ (HOT) a! @ xor if HDONE drop
(HOT)+2 a! @ dup 1 + ! \ i, and i + 1 kept
(HOT)+3 + a! @ if HNONE
(D)+2 a! !
(D)+2 a! @ -3 + a! @ 2 and if HVIS drop jump H
HVIS: drop
(D)+2 a! @ -2 + a! @ 4* (D) a! ! \ its name
(D)+1 a! @ C@ 1 + (D)+3 a! !
HC: (D)+3 a! @ if HSAME -1 + dup !
dup (D) a! @ + C@
SWAP (D)+1 a! @ + C@
xor if HEQ drop jump H
HEQ: drop jump HC
HSAME: drop (D)+2 a! @ ;
HNONE: drop jump H
HDONE: drop
0 (D)+4 a! ! \ not yet on to FORTH
(D)+1 a! @ dup 1 + C@ 2* 2* 2* 2* 2* 2* 2* 2* SWAP C@ + (D)+5 a! !
(D)+5 b! \ B stays on it while the entries are walked
CONTEXT a! @ a! @
L: if END
(D)+2 a! !
dup -2 + a! @ a! @ 65535 and @b xor if PRE
drop -1 + a! @ jump L \ not it: the entry before
PRE: drop (D)+2 a! ! \ its count and first character are the string's: is it visible,
(D)+2 a! @ -3 + a! @ 2 and if VISIBLE drop jump OLDER
VISIBLE: drop
VISIBLE: drop \ and is it all the same?
(D)+2 a! @ -2 + a! @ 4* (D) a! ! \ its name
(D)+1 a! @ C@ 1 + (D)+3 a! ! \ the count byte and the characters
C: (D)+3 a! @ if SAME -1 + dup ! \ k
+1 -1
View File
@@ -25,7 +25,7 @@ store (BOOT)+1 HDR-LINK
\ the word IDs: the system's are 0 .. #ids - 1, numbered as assembled (#189, Phase 2)
store (NEXT-ID) #ids
store (BOOT-ID) #ids
store FENCE DICT-W
store (FENCE) DICT-W
\ nothing has ended badly; nothing has been printed
store (LINE-STATUS) 1
store (OUT^) (OUT)
+14 -10
View File
@@ -10,12 +10,15 @@
\ TIB byte address of the text input buffer; QUERY fills at most 81 bytes
\ >IN word address of the variable: offset in TIB of the next character
\ SPAN word address of the variable: how many characters the last
\ EXPECT or QUERY read
\ EXPECT or QUERY read (FORTH-83), and nothing else
\ (#SRC) word address of the variable: the length of the text being
\ interpreted (until 2026-11-14 that was SPAN, so an EXPECT in a
\ line cut the rest of the line off)
\ WBUF byte address of WORD's buffer, 257 bytes
\ (P) word address of eight cells of scratch for this file
\ (SRC) word address of the variable: the byte address of the text being
\ interpreted. QUERY makes it TIB; LOAD (blocks.f18) makes it a
\ block buffer. >IN is an offset from it and SPAN its length.
\ block buffer. >IN is an offset from it and (#SRC) its length.
\ (SRC-HOOK) word address of a variable: 0, or the address of a word
\ that WORD calls before it looks at the text, to make sure (SRC)
\ is right. LOAD puts one there: a block buffer can be given to
@@ -28,13 +31,14 @@ macro BL 32 endmacro
\ ( -- baddr u ) the input buffer and how much of it is in use
set HDR-NFA here ", SOURCE #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK here
: SOURCE (SRC) a! @ SPAN a! @ -if P drop 0 P: ;
: SOURCE (SRC) a! @ (#SRC) a! @ -if P drop 0 P: ;
\ ( baddr n -- ) FORTH-79: characters from the terminal are stored from
\ baddr upward until a new-line or until n have been received; the new-line
\ is taken but not stored. A zero is added after the text, so the buffer
\ must hold n + 1 bytes. No action for n <= 0. SPAN is how many characters
\ were stored (SPAN is not FORTH-79; v3 has it). A line longer than n leaves
\ must hold n + 1 bytes. For n <= 0 nothing is read and SPAN is 0
\ (FORTH-83). SPAN is how many characters were stored (SPAN is not FORTH-79;
\ FORTH-83 and v3 have it). A line longer than n leaves
\ the rest, its new-line included, to be read next.
\ It is what the prompt reads every line with, with whatever the user has left
\ on the stack beneath it, so it works in (P) -- (P)+0 where the next
@@ -42,7 +46,7 @@ set HDR-NFA here ", SOURCE #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK h
\ and has at most three cells of its own on the data stack (D-2).
set HDR-NFA here ", EXPECT #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK here
: EXPECT
-if NN drop drop ; \ n < 0
-if NN drop drop 0 SPAN a! ! ; \ n < 0
NN: if ZERO
(P)+1 a! ! dup (P)+2 a! ! (P) a! !
L: (P)+1 a! @ if END drop
@@ -54,11 +58,11 @@ set HDR-NFA here ", EXPECT #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK h
END: drop
FIN: 0 (P) a! @ C!
(P) a! @ (P)+2 a! @ - SPAN a! ! ;
ZERO: drop drop ;
ZERO: drop drop 0 SPAN a! ! ;
\ ( -- ) FORTH-79: up to 80 characters, or a line, into TIB; >IN to 0.
set HDR-NFA here ", QUERY #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK here
: QUERY TIB (SRC) a! ! TIB 80 EXPECT 0 >IN a! ! ;
: QUERY TIB (SRC) a! ! TIB 80 EXPECT SPAN a! @ (#SRC) a! ! 0 >IN a! ! ;
\ ---- WORD ------------------------------------------------------------------
\ WORD is called from deep inside the interpreter and compiler, with whatever
@@ -99,7 +103,7 @@ macro (STEP) (P)+6 a! @ 1 + ! endmacro
jump HOOKED
NONE: drop
HOOKED:
SPAN a! @ -if A drop 0 A: (P)+1 a! !
(#SRC) a! @ -if A drop 0 A: (P)+1 a! !
>IN a! @ -if B drop 0 B: (P)+6 a! ! ;
: (WORD-TAKE) ( -- baddr )
@@ -214,4 +218,4 @@ set HDR-NFA here ", \ #id, #, 1 #, HDR-NFA #, HDR-LINK set HDR-LINK here
: BACKSLASH
BLK a! @ if TERM drop >IN a! @ -64 and 64 + ! ;
TERM: drop SPAN a! @ >IN a! ! ;
TERM: drop (#SRC) a! @ >IN a! ! ;
+113 -110
View File
@@ -1,102 +1,105 @@
\ map-32.f18 -- the memory map the system's source is assembled with, 32-bit cells.
\ Generated by v4/tools/mkmap.c (mkmap sys) from v4/tests/host_map.h -- do not edit.
constant N-1 31
constant NODE-ERROR 16382
constant CONSOLE-TX 16380
constant CONSOLE-RX 16378
constant CONSOLE-STATUS 16377
constant BASE 16376
constant TIB 63776
constant >IN 16375
constant SPAN 16374
constant WBUF 64856
constant (P) 16360
constant DP 16373
constant (LATEST) 16372
constant NODE-ERROR 32766
constant CONSOLE-TX 32764
constant CONSOLE-RX 32762
constant CONSOLE-STATUS 32761
constant BASE 32760
constant TIB 129312
constant >IN 32759
constant SPAN 32758
constant WBUF 130392
constant (P) 32744
constant DP 32757
constant (LATEST) 32756
constant DBASE 32768
constant DLIMIT 55296
constant PAD 63656
constant (D) 16352
constant (CG) 16336
constant DLIMIT 116864
constant PAD 129192
constant (D) 32736
constant (CG) 32720
constant CG-BSLOTS 3
constant STATE 16371
constant (C) 16322
constant (CFP) 16370
constant (Q) 14708
constant (F) 16279
constant (S) 15812
constant (W) 16285
constant (X) 15792
constant (BOOT) 15750
constant (NEXT-ID) 15746
constant (BOOT-ID) 15747
constant (LOG-LEVEL) 14707
constant (ACL-HOOK) 14706
constant SCR 15742
constant BLK 15743
constant (SRC) 15744
constant (SRC-HOOK) 15745
constant (LINE-STATUS) 14703
constant (PORT) 14572
constant (ME) 14699
constant (CONSOLE) 14696
constant (ROUTE#) 14695
constant (ROUTE-DEFAULT) 14694
constant (LOST) 14693
constant (PRINT-TO) 14692
constant (PRINT-PORT) 14679
constant (DONE-PORT) 14678
constant (ROUTES) 14616
constant STATE 32755
constant (C) 32706
constant (CFP) 32754
constant (Q) 30065
constant (F) 32663
constant (S) 31204
constant (W) 32669
constant (X) 31184
constant (HOT) 31149
constant (BOOT) 31107
constant (NEXT-ID) 31103
constant (TOKENS) 31105
constant (BOOT-ID) 31104
constant (LOG-LEVEL) 30064
constant (ACL-HOOK) 30063
constant SCR 31099
constant BLK 31100
constant (SRC) 31101
constant (#SRC) 31098
constant (SRC-HOOK) 31102
constant (LINE-STATUS) 30060
constant (PORT) 29929
constant (ME) 30056
constant (CONSOLE) 30053
constant (ROUTE#) 30052
constant (ROUTE-DEFAULT) 30051
constant (LOST) 30050
constant (PRINT-TO) 30049
constant (PRINT-PORT) 30036
constant (DONE-PORT) 30035
constant (ROUTES) 29973
constant -PORTS -8
constant (NEAR) 14648
constant (AWAIT-FROM) 14673
constant (WIRE) 14584
constant (WIRE-A) 14585
constant (WIRE-B) 14586
constant (WIRE-DO) 14587
constant (WIRE-HOW) 14588
constant (WIRE-HAVE) 14589
constant (S-HAVE) 14677
constant (S-MASK) 14676
constant (S-WIRE) 14675
constant (S-ON) 14674
constant (KEEP) 14672
constant (DEFER) 14671
constant (D-MASK) 14704
constant (IN) 14656
constant (ONE) 14663
constant (OUT-HDR) 14600
constant (W-NEED) 14607
constant (W-PORT) 14608
constant (P-WAY) 14609
constant (P-NEED) 14612
constant (H-PORT) 14613
constant (H-NEED) 14614
constant (H-MASK) 14615
constant (A-SELF) 14610
constant (SEND^) 14611
constant (OUT-TEXT) 14248
constant (SEND-TEXT) 13912
constant (QUIET) 14702
constant (REFUSED) 14705
constant (OUT^) 14698
constant (REPLY) 14697
constant (MSG) 14664
constant (OUT) 14312
constant (WORD-DEFINED) 14701
constant (WORD-FORGOTTEN) 14700
constant (NEAR) 30005
constant (AWAIT-FROM) 30030
constant (WIRE) 29941
constant (WIRE-A) 29942
constant (WIRE-B) 29943
constant (WIRE-DO) 29944
constant (WIRE-HOW) 29945
constant (WIRE-HAVE) 29946
constant (S-HAVE) 30034
constant (S-MASK) 30033
constant (S-WIRE) 30032
constant (S-ON) 30031
constant (KEEP) 30029
constant (DEFER) 30028
constant (D-MASK) 30061
constant (IN) 30013
constant (ONE) 30020
constant (OUT-HDR) 29957
constant (W-NEED) 29964
constant (W-PORT) 29965
constant (P-WAY) 29966
constant (P-NEED) 29969
constant (H-PORT) 29970
constant (H-NEED) 29971
constant (H-MASK) 29972
constant (A-SELF) 29967
constant (SEND^) 29968
constant (OUT-TEXT) 29605
constant (SEND-TEXT) 29269
constant (QUIET) 30059
constant (REFUSED) 30062
constant (OUT^) 30055
constant (REPLY) 30054
constant (MSG) 30021
constant (OUT) 29669
constant (WORD-DEFINED) 30058
constant (WORD-FORGOTTEN) 30057
constant BLOCK# -1
constant BUFFER# -2
constant UPDATE# -3
constant SAVE-BUFFERS# -4
constant EMPTY-BUFFERS# -5
constant (Q/) 15752
constant (QE) 15757
constant (QR) 15765
constant (QL) 15770
constant (QT) 15777
constant (QP) 15783
constant (DP) 15787
constant (Q/) 31109
constant (QE) 31114
constant (QR) 31122
constant (QL) 31127
constant (QT) 31134
constant (QP) 31140
constant (DP) 31144
constant ADDR-DIGITS 8
constant MSB -2147483648
constant MAXHI 2147483647
@@ -105,26 +108,26 @@ constant 2N+15 79
constant N-18 14
constant N-17 15
constant MAX-INT 2147483647
constant HLD 16359
constant FENCE 16358
constant CONTEXT 16320
constant CURRENT 16321
constant VOC-LINK 16334
constant HEND 63248
constant -HFLOOR -63186
constant DSTACK-DEPTH 16369
constant RSTACK-DEPTH 16368
constant HEAT-OP 13824
constant (EXEC) 14690
constant (RUNX) 14597
constant ANTICLOCK 13856
constant CFBASE 16288
constant CFEND 16320
constant ROM-UM* 16384
constant ROM-UM/MOD 16385
constant ROM-D+ 16386
constant ROM-DNEGATE 16387
constant ROM-Q.* 16388
constant ROM-Q./ 16389
constant HLD 32743
constant (FENCE) 32742
constant CONTEXT 32704
constant CURRENT 32705
constant VOC-LINK 32718
constant HEND 124816
constant -HFLOOR -124754
constant DSTACK-DEPTH 32753
constant RSTACK-DEPTH 32752
constant HEAT-OP 29216
constant (EXEC) 30047
constant (RUNX) 29954
constant ANTICLOCK 29248
constant CFBASE 32672
constant CFEND 32704
constant ROM-UM* 32768
constant ROM-UM/MOD 32769
constant ROM-D+ 32770
constant ROM-DNEGATE 32771
constant ROM-Q.* 32772
constant ROM-Q./ 32773
constant DICT-W 8192
constant (IMG) 14593
constant (IMG) 29950
+113 -110
View File
@@ -1,102 +1,105 @@
\ map-64.f18 -- the memory map the system's source is assembled with, 64-bit cells.
\ Generated by v4/tools/mkmap.c (mkmap sys) from v4/tests/host_map.h -- do not edit.
constant N-1 63
constant NODE-ERROR 16382
constant CONSOLE-TX 16380
constant CONSOLE-RX 16378
constant CONSOLE-STATUS 16377
constant BASE 16376
constant TIB 63776
constant >IN 16375
constant SPAN 16374
constant WBUF 64856
constant (P) 16360
constant DP 16373
constant (LATEST) 16372
constant NODE-ERROR 32766
constant CONSOLE-TX 32764
constant CONSOLE-RX 32762
constant CONSOLE-STATUS 32761
constant BASE 32760
constant TIB 129312
constant >IN 32759
constant SPAN 32758
constant WBUF 130392
constant (P) 32744
constant DP 32757
constant (LATEST) 32756
constant DBASE 32768
constant DLIMIT 55296
constant PAD 63656
constant (D) 16352
constant (CG) 16336
constant DLIMIT 116864
constant PAD 129192
constant (D) 32736
constant (CG) 32720
constant CG-BSLOTS 3
constant STATE 16371
constant (C) 16322
constant (CFP) 16370
constant (Q) 14708
constant (F) 16279
constant (S) 15812
constant (W) 16285
constant (X) 15792
constant (BOOT) 15750
constant (NEXT-ID) 15746
constant (BOOT-ID) 15747
constant (LOG-LEVEL) 14707
constant (ACL-HOOK) 14706
constant SCR 15742
constant BLK 15743
constant (SRC) 15744
constant (SRC-HOOK) 15745
constant (LINE-STATUS) 14703
constant (PORT) 14572
constant (ME) 14699
constant (CONSOLE) 14696
constant (ROUTE#) 14695
constant (ROUTE-DEFAULT) 14694
constant (LOST) 14693
constant (PRINT-TO) 14692
constant (PRINT-PORT) 14679
constant (DONE-PORT) 14678
constant (ROUTES) 14616
constant STATE 32755
constant (C) 32706
constant (CFP) 32754
constant (Q) 30065
constant (F) 32663
constant (S) 31204
constant (W) 32669
constant (X) 31184
constant (HOT) 31149
constant (BOOT) 31107
constant (NEXT-ID) 31103
constant (TOKENS) 31105
constant (BOOT-ID) 31104
constant (LOG-LEVEL) 30064
constant (ACL-HOOK) 30063
constant SCR 31099
constant BLK 31100
constant (SRC) 31101
constant (#SRC) 31098
constant (SRC-HOOK) 31102
constant (LINE-STATUS) 30060
constant (PORT) 29929
constant (ME) 30056
constant (CONSOLE) 30053
constant (ROUTE#) 30052
constant (ROUTE-DEFAULT) 30051
constant (LOST) 30050
constant (PRINT-TO) 30049
constant (PRINT-PORT) 30036
constant (DONE-PORT) 30035
constant (ROUTES) 29973
constant -PORTS -8
constant (NEAR) 14648
constant (AWAIT-FROM) 14673
constant (WIRE) 14584
constant (WIRE-A) 14585
constant (WIRE-B) 14586
constant (WIRE-DO) 14587
constant (WIRE-HOW) 14588
constant (WIRE-HAVE) 14589
constant (S-HAVE) 14677
constant (S-MASK) 14676
constant (S-WIRE) 14675
constant (S-ON) 14674
constant (KEEP) 14672
constant (DEFER) 14671
constant (D-MASK) 14704
constant (IN) 14656
constant (ONE) 14663
constant (OUT-HDR) 14600
constant (W-NEED) 14607
constant (W-PORT) 14608
constant (P-WAY) 14609
constant (P-NEED) 14612
constant (H-PORT) 14613
constant (H-NEED) 14614
constant (H-MASK) 14615
constant (A-SELF) 14610
constant (SEND^) 14611
constant (OUT-TEXT) 14248
constant (SEND-TEXT) 13912
constant (QUIET) 14702
constant (REFUSED) 14705
constant (OUT^) 14698
constant (REPLY) 14697
constant (MSG) 14664
constant (OUT) 14312
constant (WORD-DEFINED) 14701
constant (WORD-FORGOTTEN) 14700
constant (NEAR) 30005
constant (AWAIT-FROM) 30030
constant (WIRE) 29941
constant (WIRE-A) 29942
constant (WIRE-B) 29943
constant (WIRE-DO) 29944
constant (WIRE-HOW) 29945
constant (WIRE-HAVE) 29946
constant (S-HAVE) 30034
constant (S-MASK) 30033
constant (S-WIRE) 30032
constant (S-ON) 30031
constant (KEEP) 30029
constant (DEFER) 30028
constant (D-MASK) 30061
constant (IN) 30013
constant (ONE) 30020
constant (OUT-HDR) 29957
constant (W-NEED) 29964
constant (W-PORT) 29965
constant (P-WAY) 29966
constant (P-NEED) 29969
constant (H-PORT) 29970
constant (H-NEED) 29971
constant (H-MASK) 29972
constant (A-SELF) 29967
constant (SEND^) 29968
constant (OUT-TEXT) 29605
constant (SEND-TEXT) 29269
constant (QUIET) 30059
constant (REFUSED) 30062
constant (OUT^) 30055
constant (REPLY) 30054
constant (MSG) 30021
constant (OUT) 29669
constant (WORD-DEFINED) 30058
constant (WORD-FORGOTTEN) 30057
constant BLOCK# -1
constant BUFFER# -2
constant UPDATE# -3
constant SAVE-BUFFERS# -4
constant EMPTY-BUFFERS# -5
constant (Q/) 15752
constant (QE) 15757
constant (QR) 15765
constant (QL) 15770
constant (QT) 15777
constant (QP) 15783
constant (DP) 15787
constant (Q/) 31109
constant (QE) 31114
constant (QR) 31122
constant (QL) 31127
constant (QT) 31134
constant (QP) 31140
constant (DP) 31144
constant ADDR-DIGITS 16
constant MSB -9223372036854775808
constant MAXHI 9223372036854775807
@@ -105,26 +108,26 @@ constant 2N+15 143
constant N-18 46
constant N-17 47
constant MAX-INT 9223372036854775807
constant HLD 16359
constant FENCE 16358
constant CONTEXT 16320
constant CURRENT 16321
constant VOC-LINK 16334
constant HEND 63248
constant -HFLOOR -63186
constant DSTACK-DEPTH 16369
constant RSTACK-DEPTH 16368
constant HEAT-OP 13824
constant (EXEC) 14690
constant (RUNX) 14597
constant ANTICLOCK 13856
constant CFBASE 16288
constant CFEND 16320
constant ROM-UM* 16384
constant ROM-UM/MOD 16385
constant ROM-D+ 16386
constant ROM-DNEGATE 16387
constant ROM-Q.* 16388
constant ROM-Q./ 16389
constant HLD 32743
constant (FENCE) 32742
constant CONTEXT 32704
constant CURRENT 32705
constant VOC-LINK 32718
constant HEND 124816
constant -HFLOOR -124754
constant DSTACK-DEPTH 32753
constant RSTACK-DEPTH 32752
constant HEAT-OP 29216
constant (EXEC) 30047
constant (RUNX) 29954
constant ANTICLOCK 29248
constant CFBASE 32672
constant CFEND 32704
constant ROM-UM* 32768
constant ROM-UM/MOD 32769
constant ROM-D+ 32770
constant ROM-DNEGATE 32771
constant ROM-Q.* 32772
constant ROM-Q./ 32773
constant DICT-W 8192
constant (IMG) 14593
constant (IMG) 29950
+3 -3
View File
@@ -6,9 +6,9 @@
\ the host node's vocabulary. Rests on core.f18, forth.f18, numout.f18 and
\ words.f18.
\
\ ERRORS. Q./ by zero, and Q.SQRT and Q.LOG outside their domain, leave the
\ result D-11 and D-12 give and then raise an error (D-18): codes 11,
\ "Division by zero", and 12, "Argument out of range".
\ ERRORS. Q.SQRT and Q.LOG outside their domain leave the result D-12 gives
\ and then raise an error (D-18): code 12, "Argument out of range". Q./ by
\ zero gives 0 and raises none, as v3's table (ruled 2026-11-14).
\
\ Constants the loader supplies:
\ MSB MAXHI the high cells of Q min and Q max
+6 -5
View File
@@ -173,7 +173,7 @@ macro R-CLEAR RSTACK-DEPTH b! a !b endmacro
if TAKEN drop (UNTAKEN) jump M \ not taken: the wire was cut since it was looked at
TAKEN: drop
0 (MSG)+6 a! @ TIB + C! \ a zero after the text
(MSG)+6 a! @ SPAN a! !
(MSG)+6 a! @ (#SRC) a! !
(DONE-PORT) a! @ (KEEP) a! ! \ the room for its answer is kept from here
(CONSOLE) a! @ if P0 jump P1 \ where what it prints goes: the console,
P0: drop (MSG)+1 a! @ \ or whoever sent it;
@@ -183,7 +183,7 @@ macro R-CLEAR RSTACK-DEPTH b! a !b endmacro
jump (LINE)
\ ( -- ) THE TEXT, INTERPRETED. It is in TIB with a zero after it and its
\ length in SPAN, and the return stack is empty. It is interpreted with one
\ length in (#SRC), and the return stack is empty. It is interpreted with one
\ return entry under it, this word's call of INTERPRET; whatever is on the
\ data stack stays there.
: (LINE)
@@ -400,12 +400,12 @@ set HDR-NFA here ", PORT! #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK he
\ ( -- ) WHAT IS IN THE DICTIONARY NOW IS THE SYSTEM: COLD comes back to
\ it and FORGET will not go below it. Whoever has loaded a node's capsules
\ has it do this (system.f18, (BOOT) and FENCE).
\ has it do this (system.f18, (BOOT) and (FENCE)).
set HDR-NFA here ", (SEAL) #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK here
: (SEAL)
DP a! @ (BOOT) a! !
(LATEST) a! @ (BOOT)+1 a! !
DP a! @ 3 + 2/ 2/ FENCE a! !
DP a! @ 3 + 2/ 2/ (FENCE) a! !
(NEXT-ID) a! @ (BOOT-ID) a! ! ;
\ FORTH-79: clear the return stack, set execution mode, return control to
@@ -475,7 +475,7 @@ set HDR-NFA here ", ABORT #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK he
-1 + if M5 -1 + if M6 -1 + if M7 -1 + if M8 -1 + if M9
-1 + if M10 -1 + if M11 -1 + if M12 -1 + if M13 -1 + if M14
-1 + if M15 -1 + if M16 -1 + if M17 -1 + if M18
-1 + if M19 -1 + if M20 -1 + if M21
-1 + if M19 -1 + if M20 -1 + if M21 -1 + if M22
drop 2 jump (DONE)
M1: drop $6167654E (EMIT4) $65766974 (EMIT4) $756F6320 (EMIT4) $746E (EMIT4) CR 2 jump (DONE)
M2: drop $20746F4E (EMIT4) $756E2061 (EMIT4) $7265626D (EMIT4) CR 2 jump (DONE)
@@ -499,6 +499,7 @@ set HDR-NFA here ", ABORT #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK he
M19: drop $7373654D (EMIT4) $20656761 (EMIT4) $75666572 (EMIT4) $646573 (EMIT4) CR 2 jump (DONE)
M20: drop $65646F4E (EMIT4) $6E6F6720 (EMIT4) $65 (EMIT4) CR 2 jump (DONE)
M21: drop $65746E49 (EMIT4) $70757272 (EMIT4) $646574 (EMIT4) CR 2 jump (DONE)
M22: drop $20746F4E (EMIT4) $65666564 (EMIT4) $64657272 (EMIT4) CR 2 jump (DONE)
\ The table the loader gives the node: six words, one for each kind of
\ fault in the node's order, each a jump. A jump fills its word, so they
+42 -23
View File
@@ -4,14 +4,17 @@
\ dict.f18, quit.f18 and forth.f18.
\
\ Constants the loader supplies:
\ FENCE word address of the variable: FORGET will not remove an entry
\ (FENCE) word address of the variable: FORGET will not remove an entry
\ that starts below the address it holds
\ VOC-LINK word address of the variable: the newest vocabulary, or 0
\ (BOOT) word address of two cells: DP and (LATEST) as the loader left them
\ HEAT-OP ANTICLOCK word addresses of HEAT-OP[0] and ANTICLOCK, the heat
\ registers (DECOMPOSITION.md section 7): read-only
set HDR-NFA here ", FENCE #id, #, 8 #, HDR-NFA #, HDR-LINK set HDR-LINK here : FENCE' FENCE ;
\ ( -- ) as v3: what is defined now FORGET will not remove -- the fence is
\ raised to HERE (v3's table; no standard defines FENCE, ruled 2026-11-14).
set HDR-NFA here ", FENCE #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK here
: FENCE DP a! @ 3 + 2/ 2/ (FENCE) a! ! ;
\ ---- the heat registers (DECOMPOSITION.md section 7; #189) -----------------------
\ Captain Bob, 2026-11-12: "Add HEAT-OP". The node counts every instruction it
@@ -92,26 +95,33 @@ set HDR-NFA here ", VLIST #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK he
CUT: drop -1 + a! @ (Q)+1 a! @ a! ! jump L
DONE: drop ;
\ FORGET xxx FORTH-79: remove xxx and every word defined after it, in
\ whatever vocabulary; the space they took is free again. A vocabulary that
\ goes is no longer CONTEXT or CURRENT: FORTH is. A word that is not there
\ is an error, and so is one below FENCE, which is where the capsule's own
\ words are (code 10, "Protected word").
set HDR-NFA here ", FORGET #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK here
: FORGET
32 WORD (LOOKUP) if MISSING
-2 + a! @ \ where its name starts
dup FENCE a! @ inv + 1 + -if OK \ name - fence
drop drop NODE-ERROR b! 10 !b ;
OK: drop
dup (Q) a! ! 4* DP a! ! \ the space from its name on
\ ( -- ) take off every list every entry at or above the address in (Q)+0:
\ FORTH's, and each vocabulary's that stays; a vocabulary defined at or above
\ it goes from the chain. FORGET does this for what it forgets, and COLD for
\ everything since the seal, so a vocabulary sealed into the system stays.
: (PRUNE-ALL)
(LATEST) (PRUNE)
V: VOC-LINK a! @ if PRUNED \ vocabularies that go
dup (Q) a! @ inv + 1 + -if GONE drop jump KEPT
GONE: drop 1 + a! @ VOC-LINK a! ! jump V
KEPT: P: if PRUNED \ the lists of those that stay
dup (PRUNE) 1 + a! @ jump P
PRUNED: drop
PRUNED: drop ;
\ FORGET xxx FORTH-79: remove xxx and every word defined after it, in
\ whatever vocabulary; the space they took is free again. A vocabulary that
\ goes is no longer CONTEXT or CURRENT: FORTH is. A word that is not there
\ is an error, and so is one below the fence, which is where the capsule's own
\ words are (code 10, "Protected word").
set HDR-NFA here ", FORGET #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK here
: FORGET
32 WORD (LOOKUP) if MISSING
-2 + a! @ \ where its name starts
dup (FENCE) a! @ inv + 1 + -if OK \ name - fence
drop drop NODE-ERROR b! 10 !b ;
OK: drop
dup (Q) a! ! 4* DP a! ! \ the space from its name on
(PRUNE-ALL)
CONTEXT a! @ (Q) a! @ inv + 1 + -if C1 drop jump C2
C1: drop (LATEST) CONTEXT a! !
C2: CURRENT a! @ (Q) a! @ inv + 1 + -if C3 drop jump TOLD
@@ -147,15 +157,16 @@ set HDR-NFA here ", WARM #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK her
jump ABORT
\ ( -- ) the system as it was when the capsule had just been loaded:
\ everything defined since is gone, there is one vocabulary, numbers are
\ everything defined since is gone, the vocabularies are as sealed, numbers are
\ decimal, the block buffers are empty. Then as WARM.
set HDR-NFA here ", COLD #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK here
: COLD
(BOOT) a! @ DP a! !
(BOOT)+1 a! @ (LATEST) a! !
(BOOT) a! @ 2/ 2/ FENCE a! !
(BOOT) a! @ 2/ 2/ (FENCE) a! !
(BOOT-ID) a! @ (NEXT-ID) a! !
(LATEST) CONTEXT a! ! (LATEST) CURRENT a! ! 0 VOC-LINK a! !
(LATEST) CONTEXT a! ! (LATEST) CURRENT a! !
(BOOT) a! @ 2/ 2/ (Q) a! ! (PRUNE-ALL) \ the vocabularies as sealed, with what was sealed in them
10 BASE a! ! 0 SCR a! ! 2 (LOG-LEVEL) a! ! 0 (ACL-HOOK) a! ! EMPTY-BUFFERS
(BOOT) a! @ 2/ 2/ (FORGOTTEN) \ the kernel's records of what has gone go too (dict.f18)
$54524F46 (EMIT4) $39372D48 (EMIT4) $6C6F4320 (EMIT4) $74532064 (EMIT4) $747261 (EMIT4) CR
@@ -165,20 +176,28 @@ set HDR-NFA here ", COLD #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK her
\ ---- deferred words (as v3) -------------------------------------------------------
\ DEFER xxx makes xxx, which does whatever word it has been given:
\ ' yyy IS xxx gives it one; DEFER@ xxx leaves the one it has. A deferred
\ word with none is an error (code 15, "Deferred word not set").
\ word with none is an error (code 15, "Deferred word not set"). DEFER marks
\ its word with flag 128 (dict.f18); IS and DEFER@ refuse any other word, as v3
\ does ("was not created by DEFER"): error 22, "Not deferred".
: (DODEFER)
pop a! @ if UNSET push ; \ go to it: it returns to xxx's caller
UNSET: drop NODE-ERROR b! 15 !b ;
set HDR-NFA here ", DEFER #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK here
: DEFER &(DODEFER) (C)+3 a! ! (DATA) (C)+8 a! @ if NONE drop 0 jump , NONE: drop ;
: DEFER &(DODEFER) (C)+3 a! ! (DATA) (C)+8 a! @ if NONE drop LATEST (FLAGS) a! @ 128 OR ! 0 jump , NONE: drop ;
: (is!) a! ! ;
\ ( "name" -- addr ) the data address of the deferred word named next
: (DEFERRED)
32 WORD (LOOKUP) if MISSING
dup (FLAGS) a! @ 128 and if NOTDEF drop jump PFA
NOTDEF: drop drop NODE-ERROR b! 22 !b ;
MISSING: drop jump (UNKNOWN)
: (defer@) a! @ ;
set HDR-NFA here ", IS #id, #, 1 #, HDR-NFA #, HDR-LINK set HDR-LINK here
: IS
(') STATE a! @ if NOW drop (LIT,) &(is!) jump (CALL,)
(DEFERRED) STATE a! @ if NOW drop (LIT,) &(is!) jump (CALL,)
NOW: drop jump (is!)
set HDR-NFA here ", DEFER@ #id, #, 1 #, HDR-NFA #, HDR-LINK set HDR-LINK here
: DEFER@
(') STATE a! @ if NOW drop (LIT,) &(defer@) jump (CALL,)
(DEFERRED) STATE a! @ if NOW drop (LIT,) &(defer@) jump (CALL,)
NOW: drop jump (defer@)
+2 -2
View File
@@ -27,9 +27,9 @@ set HDR-NFA here ", INVERT #id, #, 8 #, HDR-NFA #, HDR-LINK set HDR-LINK h
\ ---- memory ----
set HDR-NFA here ", 2@ #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK here
: 2@ ( addr -- lo hi ) a! @+ @ ;
: 2@ ( addr -- lo hi ) a! @+ @ SWAP ; \ the high cell at addr: FORTH-83 (#189, 2026-11-14)
set HDR-NFA here ", 2! #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK here
: 2! ( lo hi addr -- ) a! SWAP !+ ! ;
: 2! ( lo hi addr -- ) a! !+ ! ; \ the high cell at addr, the low after: FORTH-83
set HDR-NFA here ", -! #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK here
: -! ( n addr -- ) a! NEGATE @ + ! ;

Some files were not shown because too many files have changed in this diff Show More