# Status Every rung, its command, its count, and the commit and date it was measured at (charter, methodology "Documents"). The reference is arm7tdmi-python at `f492a9aea77c63e538c948b969a7fd012b451284` (its local `main` on 2026-11-25, the U16 fix; it is not on `origin/main`, so the pin must be pushed before anyone else can fetch it). Rows measured at the previous pin `6c3aa93` say so; the 2026-11-25 rerun at the new pin is the "Repinned" paragraph below the table. "Identical" here is execution fidelity (this crate against the Python); the hardware confidence of each behaviour is the reference's docs/validation.md and docs/undocumented-behavior.md (no GBA hardware is on hand: the strongest evidence there is ARM's documents, alyosha-tas's hardware-checked ROMs and zaydlang's hardware-fuzzed multiply model; the SingleStepTests corpus is emulator-derived, a detector). Measured on Linux x86_64, rustc 1.93.1, the reference on PyPy 7.3.20 (Python 3.11.13), on a shared 32-CPU machine. The single gate is `scripts/ladder.sh` (rungs 0-6, about 2 minutes once the reference caches are full; `FAULTS=1` adds rung 7). | Rung | Command | Result | Measured at | | --- | --- | --- | --- | | 0 tables and the bus schedules | `scripts/rung0.sh` | `src/tables.rs` equal to the reference's `_tables.py` (4,096 ARM, 1,024 Thumb entries); `cargo test` 14 passed: the reference's `tests/test_bus_schedule.py` transcribed (33 ARM and 15 Thumb TRM schedules, the multiply rows m = 1-4, UMULL's early stop, BL's second half, IRQ entry in both states, the still-high line after entry, U14's three mask cases, the access bits), the condition table, the harness's branch-to-self and BIOS stop, zlib's CRC-32, the README example | `fdb441d`, 2026-11-25 | | 1 SingleStepTests ARM7TDMI v1, the reference's gate | `scripts/rung1.sh` | **2,192,923 of 2,192,923** gated cases pass; excluded C2 5,578, C6 1,499, C7 50,000; overridden C6 1: every file's counts (cases, passed, failed, excluded, overridden, the C1/C10 mapped count, failing fields) equal to the reference's `tests/sst_runner.py` at the pin, 45 of 45 files | `a28826a`, 2026-11-25 | | 2 every corpus case in lockstep | `scripts/rung2.sh` | **2,250,000 of 2,250,000** cases identical, the excluded ones included: every bus callback in order (kind, width, address, value, access bits; internal cycles with their address and coprocessor flag), the cycles `step()` returned, all 40 final state words | `a28826a`, 2026-11-25 | | 3 the CPU test ROMs through the CLI | `scripts/rung3.sh` | **15 of 15** ROMs pass (jsmolka arm, thumb; alyosha-tas arm, thumb blx, cpy, Coprocessor_14, Push_no_regs, the eight LDM^ tests): R12 = 0, the printed line, the exit status and the JSON Lines trace of every bus cycle (95,760 instructions, 136,275 bus cycles together) byte for byte the reference CLI's; and 8 of 8 other CLI cases (raw images with `--at` and `--thumb`, an ELF with a Thumb entry, the BIOS stop twice, a store into the read-only cartridge, a run out of cycles) identical | `ab98dba`, 2026-11-25 | | 4 the ROMs, one slice per instruction | `scripts/rung4.sh` | **15 of 15** identical: per instruction the CRC of its bus cycles, the CRC of its end (cycles, 40 state words, sampled I and F masks, pending LDM^ glitch) and the 40 state words | `a28826a`, 2026-11-25 | | 5 random-memory and mask scenarios | `scripts/rung5.sh` | **112 of 112** identical: 2,221,593 instructions, 5,970,785 bus cycles, 16 instructions a slice. 96 random-memory scenarios: a third raw random memory, a third with exception vectors that return and half the ARM words unconditional, a third of those started in Thumb; random states in the seven modes and in values that name no mode; IRQ and FIQ raised and dropped between instructions. The reference's run of those 96 executes every one of its 106 handlers, about 271,000 Thumb instructions, 63,000 IRQ and 141,000 FIQ entries and 3,000 instructions under the LDM^ glitch; one scenario stops at its second instruction on the MSR-sets-T crash below, alike on both sides. 16 mask scenarios (U14): looping code that is half MSR CPSR_c, #imm (random I, F, privileged mode) between moves, both lines changed before almost every instruction | the 96: `a28826a`; the 16: this commit, 2026-11-25 | | 6 multiplies against zaydlang's model | `scripts/rung6.sh` | **7,000,000 of 7,000,000** (MUL, MLA, UMULL, UMLAL, SMULL, SMLAL with S, Thumb MUL; 10^6 each, the reference's own cases): result, C and `m` equal to the model's C code (hardware-fuzzed: a judge, not a detector, for results and C) | `a28826a`, 2026-11-25 | | 7 seeded faults | `scripts/rung7.sh` or `FAULTS=1 scripts/ladder.sh` (`scripts/seeded_faults.py`) | **52 of 52 caught**, the control passing every judge (39 minutes, 3 workers). By rung: 0 15, 1 34, 2 39, 3 30, 4 31, 5 46, 6 3. Every module has faults, and Rust's own forms do too (the glitch flag that replaces the reference's method swap, the constant condition table, `width_mask`, `restore_state`'s SPSR slot for a mode that names no mode, the unwinding BIOS stop is exercised by rung 3). Caught by rung 5 alone: LDRD's internal cycles (U21), FIQ's late mask (U14), the banking of a mode that names no mode, `restore_state`'s SPSR slot, ARM IRQ entry's link. Caught only by the test ROMs (rungs 3-4): the LDM^ glitch (three faults), SWP's operand order, DISPSTAT, the read-only cartridge. **None rests on the emulator-derived corpus (rungs 1-2) alone.** The first run (51 of 52, `a28826a`/`fdb441d`) found two gaps, both closed: no rung saw FIQ's late masking or a writable cartridge (the mask scenarios and the ROM-write CLI case were added), and a fault tree without README.md broke the doctest so rung 0 'caught' everything (fixed; that run's rung-0 column is void) | `ab98dba`, 2026-11-25; the rung-5-only faults rechecked against the regenerated mask scenarios at this commit | **Repinned to `f492a9a` (2026-11-25, the reference's U16 fix).** `FAULTS=1 scripts/ladder.sh` at this commit, the reference caches regenerated under the new pin (the old moved aside to `external/refcache-6c3aa93`): fmt and clippy clean; rung 0 tables equal, `cargo test` 14 passed; rung 1 2,192,923 of 2,192,923, 45 of 45 files equal; rung 2 2,250,000 of 2,250,000; rung 3 15 of 15 ROMs and 8 of 8 CLI cases; rung 4 15 of 15; rung 5 **120 of 120** (the 112 above plus 8 `msrt` scenarios, U16); rung 6 7,000,000 of 7,000,000; rung 7 **53 of 53 caught** (the 52 above plus "a Thumb step mixes bits 31:16 into an ARM word an MSR left in the pipeline", caught by rung 5 alone; by rung: 0 15, 1 34, 2 39, 3 30, 4 31, 5 47, 6 3). Every cached reference result is byte for byte the old pin's except `fuzz-056`'s trace (it had stopped on the crash below at step 1,593) and the 8 new `msrt` traces. The table's other rows stand as measured. ## Reported to the reference 1. **An MSR that sets T crashes the next step** (found by rung 5's random memory, 2026-11-25). MSR writes T without refilling (`_psr.py`; DS 4.6 says software must not change T this way, U16), so the pipeline still holds ARM words; the next `step()` runs `_execute_thumb`, which makes its fetch and then indexes `_thumb_table[op >> 6]` with a 32-bit opcode: `IndexError`. Repro (reference interpreter, pinned source on the path): ```python from arm7tdmi_python import ARM7TDMI, CPUState cpu = ARM7TDMI(lambda a, w, acc: 0xE1A00000, lambda *a: None) regs = [0] * 16; regs[0] = 0x33; regs[15] = 0x08000008 cpu.restore_state(CPUState(registers=regs, cpsr=0x13, pipeline=[0xE129F000, 0xE1A00000])) cpu.step() # MSR CPSR_fc, r0: CPSR = 0x33, Supervisor in Thumb state cpu.step() # IndexError: list index out of range ``` What the ARM7TDMI does here is unknown (U16; a GBA test ROM would settle it); the specification should at least not crash (for instance decode the low halfword, or refill, marked HYPOTHESIS). **Fixed upstream** in arm7tdmi-python `f492a9a` (2026-11-25) and carried down by the repin to it: the Thumb decoder takes bits 15:0 of the word it holds (a HYPOTHESIS: the halfword a Thumb fetch at that word-aligned address takes from D[15:0] with BIGEND = 0, TRM table 3-7; ARM's documents only forbid such an MSR, DS 3.8, DS 4.6, TRM 2.7.2), a no-op whenever the pipeline holds Thumb halfwords. U16 stays open upstream. `core.rs` `execute_thumb` transcribes it. The one cached reference trace that changed is `fuzz-056` (it had stopped at step 1,593 on the crash; it now runs its 20,000 steps); every other trace of rungs 1-6 is byte for byte the one cached at `6c3aa93` (moved aside to `external/refcache-6c3aa93`). Rung 5 gains 8 `msrt` scenarios (MSR CPSR_fc, Rm from registers that set T about half the time, then the two prefetched ARM words' low halfwords, then a Thumb `BX PC` back to ARM: 119 T-setting MSRs with the lines held low; against the old pin all 8 stop on the crash within their first 513 steps), and rung 7 a fault that only they and `fuzz-056` can see. ## Not transcribed, not proven - The reference's tools: `disasm.py`, `debug.py`, `console.py` (and `--debug` in the CLI). - Save states: `CPUState` round trips are what the reference offers; it does not hold the sampled masks or the pending LDM^ glitch (the reference's own open item; still so at `f492a9a`), so no save-at-half rung was built for the core alone. A board's gate should run one. - `privileged()` (nTRANS) is transcribed but no rung observes it: neither side's bus reports nTRANS, so LDRT/STRT's `user_access` is an equivalent mutant at this interface. - Data and prefetch aborts are not in the reference (the GBA never asserts ABORT). ## Speed Not this tier's goal (charter: `-fast` is speed's); recorded for the record and for the play-gba plan. `scripts/speed.sh`, 2026-11-25 at `ab98dba`, the workload the 15 test ROMs (95,760 instructions, 136,275 bus cycles a pass, a fresh harness per ROM), best of 7 trials, each pinned to one CPU with `taskset`, **load average 58-65 on 32 CPUs** (a busy shared machine: treat as lower bounds): | Build | Instructions/s | Bus cycles/s | | --- | ---: | ---: | | native, the crate's release profile (CPU time) | 33.9 M | 48.2 M | | native, fat LTO and one codegen unit (CPU time) | 39.6 M | 56.4 M | | wasm32-unknown-unknown under Node 22.19 (fat LTO, `wasm/`; wall time) | 41.5 M | 59.1 M | | the reference, PyPy 7.3.20 (CPU time) | 0.83 M | | So about 40 times the reference. The wasm figure being above the native one is within this machine's noise (an earlier wasm run at load 86 gave 23.9 M; the native release build gave 38.6 M at load 81): native and wasm are of the same order, and neither is a careful A/B. For play-gba: the GBA runs 16.78 M CPU clocks a second, and with wait states its programs make well under one bus cycle per clock, so the core alone has a few times real-time headroom on this machine; the board (PPU, DMA, timers, sound) is not counted, and no phone was measured. The `-fast` tier the families table expects is where that is settled. ## How to resume `scripts/fetch_reference.sh` (clones the pinned reference into `external/`), the reference's working checkout beside this one with its `reference/` fetched (its `scripts/fetch_references.py`) and its multiply model built (its `scripts/build_referees.py`), then `scripts/ladder.sh`. The reference's cached results go to `external/refcache/` (keyed by the pin; another pin's cache is moved aside). A repin: move the clone to the new commit, change `ARM7TDMI_PYTHON_PIN` in `scripts/env.sh`, carry the reference's changes down module by module, rerun the ladder with `FAULTS=1`.