Files
LithosAnanake/experiments/bare_metal/runs/doe-amd64-20260803-182139.csv
T
Robert Allan JamesandClaude Sonnet 5 5784d8a1a8 riscv64: finish SBI timer verification and clean up stale timer docs
Punch list §25 item 0.3 complete.

The functional work (FDT reader, `time` CSR switch, SBI TIME extension
arm/re-arm, sie.STIE) was committed separately by Captain Bob as accd79f,
honestly labeled "NOT complete." This finishes it: stale documentation
cleanup, then rigorous verification against the item's literal acceptance
text, which the prior commit had not yet done.

Doc cleanup: every remaining reference to `rdcycle` / "assumed 1 GHz" in
riscv64/timer.c and riscv64/apic.c rewritten to describe the actual `time`
CSR / SBI-armed behavior. Caught and corrected my own arithmetic error in
the process: a draft claimed the ns-overflow bound improved to "~58 years"
under the new counter; direct computation shows the bound is actually
~3.26 days (2^48 ns) and is *frequency-independent* -- s_ns_per_tick and
tick rate scale inversely and cancel. Verified with a script before
writing the final comment, not asserted.

Verification, since "boots to prompt" was not sufficient for this item's
acceptance ("heartbeat_ticks() advances ... within measurement noise"):

- No FORTH word exposes heartbeat_ticks() to the REPL, and adding one would
  be a new primitive outside this item's scope. GDB-over-QEMU-stub reads of
  the static counter failed ("Cannot access memory"), likely a virtual-vs-
  runtime address mismatch; abandoned rather than debugged further, since a
  better instrument was available.
- QEMU's own `-d int` trap tracing (independent of all guest code) shows
  2,797 `cause:5 desc=s_timer` interrupts delivered by the time boot reaches
  the prompt, and the interleaved `desc=supervisor_ecall` entries are exactly
  the SBI set_timer calls from riscv64_timer_rearm(), confirming the full
  interrupt -> handler -> re-arm -> SBI loop.
- Measured rate over a real 10.127 s window: 1,013 further interrupts,
  100.028 Hz observed against 100 Hz configured -- 0.03% deviation. The
  sustained, non-decaying rate is itself proof the one-shot re-arm succeeds
  on every cycle, not just the first.
- Confirmed regression-free on amd64 and aarch64 too: uefi_loader.c, uefi.h,
  boot_info_offsets.h and the new fdt.c/fdt.h are shared across all three
  builds (amd64 also consumes the offset constants via kernel_entry.S), so
  all three were rebuilt and booted. Identical dict_hash
  0x3d4e1daf289da94f on all three, matching the item 0.1/0.2 baseline.

Reported, not fixed, per rule 3:
- DOE_INJECT=1's EXEC-DOE now fails as "UNKNOWN WORD" against the pruned
  Hera-alone capsule -- doe.4th was never loaded by init.4th even before
  item 0.1's prune, so this is a pre-existing gap the prune surfaced, not a
  new defect. Discovered while chasing why a 200-rep injected DoE run
  produced no new CSV rows after 25 minutes; it had failed in the first
  millisecond, not run the whole time.
- repl.c's own comment claims a "Heartbeat: N ticks" diagnostic prints to
  the serial log; no such print exists anywhere in the tree.
- riscv64/arch.c's arch_read_timestamp() still uses rdcycle with a stale
  1 GHz comment, but it has zero callers on this architecture -- dead code,
  left alone.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-03 18:23:37 -04:00

4.0 KiB

1tick_numberelapsed_nstick_interval_nscache_hits_deltabucket_hits_deltaword_executions_deltahot_word_countavg_word_heat_q48window_widthactual_window_sizepredicted_label_hitsjitter_bitsapic_tickstime_trust_q48variance_q48vm_call_depth_maxhera_heat_q48hermes_heat_q48artemis_heat_q48
2110000100000018344573173100065536006553600
3220000100000017354458258200065536006553600
4330000100000018466058258200065536006553600
544000010000001748714096000065536006553600
6550000100000015097858258200065536006553600
7660000100000015911734096000065536006553600
87700001000000188157168568500065536006553600
98800001000000214168368568500065536006553600
10990000100000021619824096000065536006553600
11101000001000000222218456756700065536006553600
12111100001000000207238673173100065536006553600
1312120000100000018926834096000065536006553600
14131300001000000221288073173100065536006553600
15141400001000000204298368568500065536006553600
16151500001000000203308273173100065536006553600
17161600001000000201328356756700065536006553600
18171700001000000190348673173100065536006553600
19181800001000000170357358258200065536006553600
20191900001000000154284473173100065536006553600
21202000001000000154284156756700065536006553600
2221210000100000015332394096000065536006553600
23222200001000000167354258258200065536006553600
24232300001000000176374168568500065536006553600
25242400001000000175373973173100065536006553600
26252500001000000196383773173100065536006553600
2726260000100000019241374096000065536006553600
28272700001000000158403868568500065536006553600
2928280000100000015840354096000065536006553600
3029290000100000016441374096000065536006553600
31303000001000000154433968568500065536006553600
32313100001000000172463558258200065536006553600
33323200001000000180493456756700065536006553600
34333300001000000145513556756700065536006553600
35343400001000000203533758258200065536006553600
36353500001000000154553973173100065536006553600
3736360000100000014457374096000065536006553600
3837370000100000014457354096000065536006553600
3938380000100000013257344096000065536006553600
4039390000100000018057324096000065536006553600
4140400000100000022063294096000065536006553600
42414100001000000215642840962400065536006553600
43424200001000000208682940962400065536006553600
44434300001000000177722740962400065536006553600
45444400001000000199772840962400065536006553600
46454500001000000223822640963000065536006553600
47464600001000000202852440966700065536006553600
484747000010000002189125409619800065536006553600
494848000010000002219226409635000065536006553600
504949000010000002259726409652800065536006553600
5150500000100000021410027409669400065536006553600
5251510000100000022710228409688300065536006553600
53525200001000000208102294096104300065536006553600
54535300001000000207102304096120200065536006553600
55545400001000000200102314096131900065536006553600
56555500001000000205103324096146400065536006553600
57565600001000000211103324096162000065536006553600
58575700001000000193110334096171200065536006553600
595858000010000001905674096177500065536006553600