# Status Every rung, its command, its count, and the commit and date it was measured (charter methodology, "Documents"). Tier: `x-rust-fast`, the speed fork of **a2600-rust `f9af024`** (a2600-python `28fb095` on 6502-rust `129e742`; 6502-python `741419a` on the reference side), merged in `017fd5a` (forked at `07dfaf0`, a2600-python `9475aa1`). All counts are fidelity (this board against a2600-rust and the reference) unless a row says the judge is hardware evidence carried over from the reference; "matches a2600-rust" is not "matches the hardware". **Reference repinned 2026-11-22** (the same code): a2600-python `4ad24f2` (`28fb095` plus documents and its repin of 6502-python) and 6502-python `828b619` (`741419a` after that repository's history rewrite of 2026-11-21, the same tree; `741419a` is on no branch now). The hashes in the rows below are the ones they were measured at. ## Rungs | Rung | Command | Count | Commit, date | | --- | --- | --- | --- | | 1. Tests (the reference's behaviour tests, transcribed, and the fork's own) | `cargo test --release` | 103 pass (a2600-rust's 102 and tests/fast.rs's 1) | `017fd5a`, 2026-11-19 | | Whole ladder, rungs 1-6 | `scripts/ladder.sh` | passed end to end | `017fd5a`, 2026-11-19 | | fmt, clippy (rustup stable) | `cargo fmt --check`; `cargo clippy --release --all-targets -- -D warnings` | clean (in the ladder) | `017fd5a` | | 2. Die traces, natively | `a2600-gates die` | 39 of 39, as at the fork point | `017fd5a`, 2026-11-19 | | 3. Timer ROMs (console results: TEST ROM) | `a2600-gates timers`; `timers --every-row` | 14 of 14 on NTSC; 140 of 140 on all ten rows | `017fd5a` | | #699 serial tables (six consoles: TEST ROM) | `a2600-gates serial CONSOLE` | 116,730 of 116,730 cells (in the ladder) | `017fd5a` | | Frame hashes (the reference's tests/frame_hashes.tsv) | `a2600-gates hashes` | 10 of 10 | `017fd5a` | | Frame hashes per row (tests/frame_hashes_rows.tsv: Pitfall II with music on NTSC, PAL, SECAM) | `a2600-gates hashes-rows` | 3 of 3 | `017fd5a` | | 4. Per-slice lockstep against the reference's traces (which a2600-rust matches) | `scripts/lockstep.py --reference-cache external/refcache` | 232 of 232 cases identical | `017fd5a`, 2026-11-19 | | 5. Save states in the gate | `... --save-at-half` | 232 of 232 identical | `017fd5a`, 2026-11-19 | | 6. The window, headless | `SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy a2600-play ROM --frames 120 --screenshot F` | runs; Pitfall!'s 120-frame screenshot is byte-identical to a2600-rust's | `017fd5a` | | 7. Seeded faults | `scripts/seeded_faults.py` | 63 of 64 on the merged tree: all 13 `fast-*` (one or more per shortcut) caught, `fast-quiet-ignores-resmp` by tests/fast.rs, the die gate and the lockstep (as in the 8c59acb run; the lockstep missed it only when the shortcut was first kept, below); of the 51 inherited, 50 caught, as upstream (the 7 new ones of `f9af024` by their tests, `hashes-rows` and the `music` and `handover` cases; `api-name-gone` by the API test), and `state-forgets-data-bus` missed as it is upstream (a likely equivalent mutant). At `8c59acb`, before the merge: 56 of 57 | `017fd5a`, 2026-11-19 | | WebAssembly | `cargo build --release --target wasm32-unknown-unknown --example wasm_bench`; `node scripts/wasm-bench.mjs` | builds; Pitfall!, River Raid and Combat give the native checksums over 600 frames (`8c59acb`); after the merge it builds (rustup stable, which has the target) and Pitfall! gives the native checksum `070A8D58` over 600 frames | `017fd5a`, 2026-11-19 | `scripts/quickgate.sh` runs rungs 2-5 (die, timers, hashes, lockstep plain and saved) in about two minutes; every kept change passed it before its A/B, and the whole ladder passed at the end. ## The lockstep and its case table One line per slice of 19,912 CPU cycles (262 lines): the CPU's registers, board cycles, halted cycles, instructions, the TIA's line, step and frame, the RIOT's timer, flags and port A registers, a CRC-32 of every bus cycle (kind, address, value, cycle), a CRC-32 of every line the TIA finished (all 228 clocks, blank included) and a CRC-32 of the audio samples (doubles). Both sides read MAME's software list from the same `MAME_HASHPATH`; each trace's first line names the scheme the load chose. Both sides hand the row's CPU clock to the cartridge (as `System::from_rom` does). `scripts/cases.tsv` (232 cases, about 23,800 slices, a2600-rust's table unchanged): | Group | Cases | What | | --- | --- | --- | | smoke | 93 | the reference's tests/smoke_dumps.txt, every name, 60 slices, NTSC as its sweep runs them | | scheme | 26 | 2K, 4K, F8, F6, F4, F8SC, F6SC, F4SC, FA, E0 (2), 3F (2), FE (2), E7 (16K, 12K, 8K), CV (2), UA, F0, 32IN1, DPC (300 slices), AR, and an explicit `--scheme F8SC` | | input | 12 | joysticks (River Raid, Pitfall!, Combat with both), paddles (Kaboom!, Breakout, four in Warlords), Driving (Indy 500), Booster Grip (Omega Race), keypads (Codebreaker, BASIC Programming, Star Raiders), SaveKey (Go Fish!), with Reset, Select, B/W and difficulty switches | | row | 12 | PAL (5), SECAM (2), the #699 rows SECAM woody, PAL 7800, light sixer, Jr. '91, and the NTSC 7800 row (hosted) | | timer | 80 | Stella #108 (2) and #606 (6) ROMs on NTSC and on the nine other rows | | serial | 2 | #699 early_HMOVE on the PAL 7800 row, HMOVE_RESPx_M1 on the Vader row, Reset held as `gates.serial_record` holds it | | music | 4 | Pitfall II with its DPC music on, 400 slices, on NTSC, PAL, SECAM and the PAL 7800 row | | handover | 3 | a running CPU handed mid-run to a new board (`--hand-over SLICE`): River Raid, Pitfall! on the NTSC 7800 row, Pitfall II's music on PAL | The reference side runs on `external/venv` (PyPy 3.11 with `external/a2600-python` at `4ad24f2` and `external/6502-python` at `828b619`, the revision the reference's pyproject pins; until 2026-11-22 `28fb095` and `741419a`, the same code); its traces are cached by case in `external/refcache`, a copy of a2600-rust's (move it aside, never delete it, when the reference pin moves: the `9475aa1` traces are in `external/refcache-9475aa1`). ## Speed `scripts/ab.sh a9fc6e0` (the fork point with the bench, against `8c59acb`): five games, best of six alternating 300-frame runs on CPU 31, one E-core of this machine's i9-13900K (4.3 GHz), under a load average of about 15: | Layout | Pitfall! | River Raid | Pitfall II (DPC) | Space Invaders (PAL) | Combat | Overall | | --- | --- | --- | --- | --- | --- | --- | | default | x1.884 | x1.865 | x1.835 | x1.939 | x1.896 | **x1.883** | | nf5 (32-byte blocks) | x1.926 | x1.943 | x1.943 | x2.024 | x2.106 | **x1.987** | | nf6 (64-byte blocks) | x1.965 | x1.964 | x1.961 | x1.932 | x1.970 | **x1.958** | The merge of a2600-rust `f9af024` costs nothing measurable: `scripts/ab.sh 523f1dc` (the last commit before it, against `017fd5a`, load about 14-15): | Layout | Pitfall! | River Raid | Pitfall II (DPC) | Space Invaders (PAL) | Combat | Overall | | --- | --- | --- | --- | --- | --- | --- | | default | x1.011 | x0.978 | x0.993 | x1.014 | x0.989 | **x0.997** | | nf5 | x1.020 | x1.005 | x0.982 | x0.974 | x1.010 | **x0.998** | | nf6 | x0.992 | x0.973 | x0.993 | x0.979 | x0.987 | **x0.985**; rerun **x1.011** | All inside the 3-5 % A/A noise. The only new work on the hot path is `Audio::tick_b` testing `on_sample` (twice a line), and the DPC's `ticks_per_cycle` now computed from the row's clock at load (the same value on NTSC). After the merge the E-core runs these games at 4.2-4.9x real time. In multiples of real time (best of three 600-frame runs, all pinned to CPU 4, a P-core, with the machine loaded; checksums identical in every column): | Game | a2600-rust (fork point) | a2600-rust-fast native | a2600-rust-fast wasm (Node 22, V8) | | --- | --- | --- | --- | | Pitfall! | 3.42x | 6.57x | 5.20x | | River Raid | 3.62x | 5.68x | 4.98x | | Combat | 3.74x | 6.73x | 5.37x | On the E-core: about 2.0x at the fork point, 3.7-4.2x now. The wasm build runs at about 80-90 % of native here; a phone's browser is several times slower than this desktop, so the phone itself has to be measured (play-2600). A save state is about 5 KB (11 KB with DPC), 0.005-0.01 ms to save and 0.01-0.02 ms to load (`a2600-bench --snapshots`, at the fork point). ### Kept, one at a time (each: gate identical, a win on every layout, faults caught) | Commit | Change | default / nf5 / nf6 | Seeded faults (all caught) | | --- | --- | --- | --- | | `64a682d` | `TIA::step` dispatches to one body compiled per edge and per write (`edge::`) | x1.130 / x1.164 / x1.157 | fast-edge-misdispatch, fast-edge-drops-a-write | | `1e0d540` | a quiet step (no object clocked, struck or held, NUSIZ settled) skips the object sections | x1.290 / x1.266 / x1.263 | fast-quiet-ignores-{deferred, strobe, resmp, nusiz} | | `69a3f30` | object outputs all off at once while no player scans and no missile or ball is in its START count | x1.025 / x1.032 / x1.031 | fast-pixels-forget-{ball-second, m1} | | `0d6fe15` | `hm_late` shifted only while HMxx settles (`hm_settle`, not in a state) | x1.024 / x1.050 / x1.044 | fast-hm-settle-short, fast-hm-settle-kept-on-hmclr | | `643943f` | the object sections' plain form (`objects::`) when nothing is held | x1.186 / x1.204 / x1.198 | fast-idle-always, fast-idle-skips-a-strobe | | `3b95a1b` | idle counters remembered between steps (`counters_known_idle`, not in a state) | x1.038 / x1.037 / x1.049 | fast-known-idle-kept | Not kept, with numbers: [not-kept.md](not-kept.md) (fat LTO, `step_none`). `fast-quiet-ignores-resmp` was a lockstep blind spot when it was kept (a RESMPx lock that starts and ends inside one HBLANK with no object clock between is in no case); `tests/fast.rs` catches it on its own. On the later code (the full runs at `8c59acb` and `017fd5a`) the same mutation also fails the die gate and the lockstep. Profile at `3b95a1b` (River Raid): `TIA::edge` 46 % self, `objects` 22 %, `object_pixels` 10 %, the step dispatch 9 %, the 6502 core and the board under 4 %, flat over the edge's lines: the next gains are structural (a turbo tier's whole-line paths, if play-2600 ever needs them). ## Rust-forced differences Each module's header lists its own. In short: callbacks (`on_line`, `pad_source`, `on_vsync`, the RIOT's port A listener, bus observers) are boxed closures handed the chip they hang on; the RIOT is shared (`Rc>`) so a keypad can read its port when the TIA is read; controllers take the TIA and RIOT as arguments instead of holding them; the CPU owns the board as its bus (`system.board()`); keyword options are `Options`; dictionaries are arrays with lookup functions; the softlist is read by a small element reader keeping ElementTree's rules; Python's `round` is `round_half_even`; SaveKey saves live under `a2600-rust/` in the user's data directory (the reference uses its own name); `Audio.on_sample` is a boxed closure given the sample only; `System(..., cpu=)` is `System::with_cpu` (a2600-rust's docs/api.md). Additions the reference lacks: save states (`state.rs`), the trace tool, the native gates binary. ## Domains and channels The reference's: one domain (the colour clock drives the TIA, the 6507 at OSC/3 and the RIOT); channels the CPU bus, RDY, the RIOT ports, the TIA's pads and the audio and video pins. Transcribed in the same serial order (per CPU cycle, the TIA's six half clocks with the access on the sixth). No threads. ## Capabilities - Save states: yes (`state::save_state` / `load_state`), proven by rung 5; the fork's caches (`hm_settle`, `counters_known_idle`) are not in a state and start conservative after a load. The cartridge's ROM image travels in the state; the host's `on_sample` is kept across a load, as the TIA's callbacks are. A hand-over (`System::with_cpu`) keeps the running TIA, so its caches go with it (the three `handover` cases). - Threads: none (one domain, and nothing beside it that would pay yet). Concessions: none. ## Licences and provenance MIT; every source file carries an SPDX header; NOTICE carries the reference's notices. Forked from a2600-rust (MIT); the bench, A/B and profiler scripts are gameboy-rust-fast's (MIT, same author), adapted. No GPL, LGPL or unlicensed source was opened, and the archived a2600-rust-fast and its parents were not read in any form (docs/handoff-brief.md). gameboy-rust-fast's profiler notes that it was itself adapted from the archived a2600-rust-fast's; it is generic sampling-profiler tooling with no emulation in it, taken from gameboy-rust-fast as the brief directed.