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
This commit is contained in:
Claude
2026-11-17 22:23:58 +00:00
parent d34fa415c3
commit edbb79e2af
9 changed files with 802 additions and 11 deletions
@@ -89,3 +89,34 @@ births come later). f10d2bc8 did, for each instruction word, one have-mask and o
## 6. For ruling
Run Step 0 (measure only), then bring back the data and the choice among A, B and C?
## 7. As built: mechanism A (2026-11-17, Captain Bob: "Go")
**What changed:**
- The fabric keeps the places that hold a node as a list in ascending order (`v4_place.next`,
`v4_fabric.first`; `v4_fabric_first` and `v4_fabric_next` in `fabric.h`). `v4_fabric_add` puts a node
into the list and `v4_fabric_remove` takes it out.
- Each of the step's nine passes walks this list, not every place, in the same order as before.
- A place removed while a pass is at it keeps its link, so the walk goes on to the next node, as the loop
over every place did. A node added in a step after the place being walked is walked in that step, as
before.
**Test first:** `v4/tests/test_fabric_walk.c`, 13 checks. It failed to build before the change (no walk)
and passes after.
**Verified** (`logs/20261117-mechanism-a/`):
- Semantics unchanged, every check as before: `test_fabric` 334, `test_host_mesh` 244 (with its
disturbances), `test_host_unit` 126, `test_host_depth`, `test_manage` 78, and all 52 tests at 64 bits.
- The 32-bit build (`test-32`) passes.
- ASan and UBSan are clean on the fabric tests and the mesh boot.
- The host mesh boot runs POST 990 of 990, with 103 checks.
- **The cost** (`timing.txt`, five runs each, alternating OLD = d34fa415 and NEW):
| | Median | Change |
|---|---|---|
| OLD | 11.695 s | |
| NEW | 7.999 s | 32% less |
POST was 990 of 990 in every run. Instruction counts are not given: there is no `perf` in this
container.
- **The gate:** the protocol, next.