The bench script

One text file drives a run on the head (head/headd.py, sent by tools/bench.py run) and, with the same words, the model (nes-console's pad-log takes the AT lines). A line is a word and its arguments; # starts a comment. Latch indices count the console's controller strobes since the last RESET, from zero, which is the index the bridge's log and the model's log share.

lineon the headon the model
RESETzero the bridge's counters, then pulse the reset relaythe console powers on at latch zero
POWER ON / POWER OFFthe power relaynothing
MODE PASS / MODE INJECTpassed to the bridge: the original pad's byte, or the scripted onethe model has no pad in hand: INJECT is the only mode
SET hhthe byte to hold now (bit 0 = A, set = pressed)the byte from the start
AT n hhfrom latch n on, hold hh; written after latch n-1 so it is in the register at latch nthe controller's schedule, applied at the strobe's rise before latch n
TRIG nthe bridge raises EXT TRIG at latch n; put it after the ARM, which takes secondsnothing (the model renders the frame at n directly)
ARM name [channels] [scale] [offset] [source] [s/div] [depth]the scope set for a single shot: channels 3 or 1,2,4, the trigger from EXT (the bridge's line, the default) or a channel (CH4), the timebase and the memory depth (12 M points with one or two channels, at most 6 M with more); the capture is name.u8 (one channel) or name-chN.u8 (several) with name.toml beside them naming the rate and the trigger's samplenothing
CAPTUREwait for the armed trigger and read the record (a WAIT past the trigger does this too)nothing
WAIT nuntil the bridge has logged latch nrun to poll n
WAIT s Ssecondsnothing

A B1 script, as the plan describes it:

POWER ON
WAIT 2 S
MODE INJECT
SET 00
RESET
AT 120 08          # Start, from poll 120
AT 122 00
ARM game-t300 3 0.5 -1.3
TRIG 300
WAIT 320
CAPTURE

The head writes the run to runs/<stamp>/ (script.txt, head.log with each line as it played, bridge.log with every line the bridge printed, the captures) and bench.py fetches it. compare-logs.py diffs bridge.log against pad-log's output for the same script.

A B2 script, one power-on (tools/b2-align.py sweep plays it N times and classifies each run):

POWER OFF
WAIT 3 S
ARM align 1,2,4 1.0 -2.0 CH4 0.0005 1200000   # master clock, M2, ALE; triggered on ALE's first rise, when rendering starts
POWER ON
CAPTURE
POWER OFF

Pulled at build time from nes-bench/docs/script.md; the repository is the one copy.