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
1.8 KiB
Step 0 of docs/v4.0.0/plans/2026-11-17-the-fabric-step-cost.md -- where a fabric step's time goes (measure only)
2026-11-17, on fa55d350 (clean). The host mesh boot (tests/test_mesh_boot.c: POST 990 of 990 on Hera in the
fabric, 8 places, of which only Hera holds a node during POST), built into a scratch directory with
OPT="-O2 -g -pg -fno-inline" and run once (mesh-boot-run.log: 990/990, 101 checks, 0 failures). gprof:
| What | Share of the time | Calls |
|---|---|---|
| v4_fabric_step's own loops | 19.8% | 81,695,022 steps |
| "hand_over_read" as gprof books it -- in fact awake(), the per-place test (see below) | 28.2% | 5,891,446,122 = 72 a step |
| the engine executing instruction words (v4_exec_op, v4_exec_step_word, stack checks, decoding) | about 25% | 107M words, 361M opcodes |
| the per-retire physics (on_retire, temperature, v4_heat_on_retire) | about 9% | 288M |
| look_about (8-port loop, Hera only) | 2.5% | 163M |
| the mesh's console polling (takes, v4_fabric_device_take, any_running) | about 5% | 81.7M each |
The attribution caveat, said honestly: gprof puts 5.89 billion calls under hand_over_read, whose one call site runs it at most once per place per step (8 here). The count is awake()'s: 9 of the step's passes test awake() for every place, 9 x 8 = 72 a step, and 5,891,446,122 / 81,695,022 = 72.1. The compiler made awake into a clone, awake.isra.0 (symbols.txt), and gprof attributes the clone's samples to the neighbouring symbol.
Finding: about half of the boot's time (19.8% + 28.2% = 48%) is the step walking all its places, nine times a
step, when one node exists. That is the cost f10d2bc8 did not have (one have-mask and one instruction word,
directly). Device polling (about 5%) and look_about (2.5%) are small. The kernel has 16 places, not 8, so its
walk is twice this one's.