# 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 `07dfaf0`** (a2600-python `9475aa1` on 6502-rust `129e742`). 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". ## Rungs | Rung | Command | Count | Commit, date | | --- | --- | --- | --- | | 1. Tests (the reference's behaviour tests, transcribed, and the fork's own) | `cargo test --release` | 91 pass (a2600-rust's 90 and tests/fast.rs's 1) | `8c59acb`, 2026-11-14 | | Whole ladder, rungs 1-6 | `scripts/ladder.sh` | passed end to end | `8c59acb`, 2026-11-14 | | fmt, clippy (rustup stable) | `cargo fmt --check`; `cargo clippy --release --all-targets -- -D warnings` | clean (in the ladder) | `8c59acb` | | 2. Die traces, natively | `a2600-gates die` | 39 of 39, as at the fork point | `8c59acb`, 2026-11-14 | | 3. Timer ROMs (console results: TEST ROM) | `a2600-gates timers` | 14 of 14 | `8c59acb` | | #699 serial tables (six consoles: TEST ROM) | `a2600-gates serial CONSOLE` | 116,730 of 116,730 cells (in the ladder) | `8c59acb` | | Frame hashes (the reference's tests/frame_hashes.tsv) | `a2600-gates hashes` | 10 of 10 | `8c59acb` | | 4. Per-slice lockstep against the reference's traces (which a2600-rust matches) | `scripts/lockstep.py --reference-cache external/refcache` | 153 of 153 cases identical | `8c59acb`, 2026-11-14 | | 5. Save states in the gate | `... --save-at-half` | 153 of 153 identical | `8c59acb`, 2026-11-14 | | 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 | `8c59acb` | | 7. Seeded faults | `scripts/seeded_faults.py` | 56 of 57: all 13 `fast-*` (one or more per shortcut) caught, `fast-quiet-ignores-resmp` by tests/fast.rs only; of the 44 inherited, 43 caught, and `state-forgets-data-bus` missed as it is upstream (a likely equivalent mutant) | `8c59acb`, 2026-11-14 | | 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` | `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. `scripts/cases.tsv` (153 cases, about 21,000 slices): | 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 | 8 | Stella #108 (2) and #606 (6) ROMs | | 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 | The reference side runs on `external/venv` (PyPy 3.11 with `external/a2600-python` at `9475aa1` and `external/6502-python` at `1ae3610`, the revision the reference's pyproject pins); its traces are cached by case in `external/refcache` (move it aside, never delete it, when the reference pin moves). ## 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** | 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` is a lockstep blind spot (a RESMPx lock that starts and ends inside one HBLANK with no object clock between is in no case); it is caught by `tests/fast.rs`. 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). 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. - 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.