# Status **Lineage:** a5200-python → **a5200-rust** · fixes start in a5200-python and flow down by merges · [family charter](https://github.com/alewman/emulator-lineage/blob/main/docs/charter.md) Charter tier `x-rust`: a transcription of a5200-python at `844355d` (the board on the restarted POKEY), proven identical to it per frame. Every claim here is about fidelity to the reference ("the Rust board matches the Python"), not about the hardware; the hardware account is the reference's (its docs/status.md, docs/claims.md). Measured 2026-11-14. Pins: reference a5200-python `844355d` (clone at `external/a5200-python`, run by `/data/emu/a5200-python/.venv-pypy`, PyPy 3.11 with 6502-python `741419a` and pokey-python `6ed1ffa`); CPU 6502-rust `71747eb` (git); POKEY pokey-rust `b37263d` (git, `serde`). ## The gate (`scripts/ladder.sh`) Each case runs on both boards; one line per frame holds the CPU registers, board time and frame count, ANTIC's position, the board's halted/stalled/lost-NMI counters, the data-bus latch, the /IRQ line, a CRC-32 of every bus cycle of the frame (CPU reads and writes, ANTIC DMA, refresh, WSYNC-repeated reads, each with its machine cycle, address and value) and a CRC-32 of the frame buffer; with `--audio` also a CRC-32 of the AudioTap's samples. Reference traces are cached in `external/refcache` by case. | Rung | Command | Result | | --- | --- | --- | | unit tests | `cargo test --release` | 30 pass (the reference's tests where they test behaviour; the PyPy attribute guard has no counterpart) | | Acid5200 natively | `a5200-acid` | 46 of 48: ANTIC 20/20, CPU 7/7, GTIA 10/11 (`gtia_vdelay`), POKEY 9/10 (`pokey_twotone`), every frame count and message as the reference records them; `--switch gtia_at_d000=1 gtia_vdelay` passes; `--full`: 46 passed, 1 failed, 1,260 frames | | the reference's seeded faults, natively | `a5200-acid --fault drop_dummy_read cpu_bugs cpu_timing`; `--fault steal_one_short antic_dmapattern` | each caught, with the reference's messages ("BRK handler should not have executed", "Incorrect DEX/BNE cycle count: 4", "Incorrect timing for mode 02-a") | | lockstep, main table | `lockstep.py --cases scripts/cases.tsv` | **29 of 29 identical** (24,160 frames): 4-port row: 4K, 8K x2, 16K two-chip (table, measured), 16K one-chip (table x2, measured x2), 32K x2, 40K Bounty Bob, a caller mapping; 2-port row (BIOS CO19156A): Pac-Man, Mountain King, Super Breakout, Bounty Bob, PAM v2.3, two Acid5200 tests; trak-ball x5 (port 1 and 2); keypads x4 (every key, upper button, pause, reset, four ports) | | lockstep, Acid5200 | `--cases scripts/cases-acid.tsv` | **49 of 49 identical** (the 48 standalone tests, 380 frames each, and the suite ROM, 1,300 frames) | | lockstep, smoke list | `--cases scripts/cases-smoke.tsv` | **38 of 38 identical** (the reference's 36-image smoke list plus its two next-smoke additions, 900 frames each, one play script) | | save states | the same three tables with `--save-at-half` (save half way, load into a fresh console, go on) | **116 of 116 identical** | | audio | `--cases scripts/cases.tsv --extra=--audio` (CRC of the AudioTap's 44.1 kHz samples per frame), plain and `--save-at-half` | **29 of 29** and **29 of 29 identical** | Total under the gate: 116 cases, 77,900 frames, every one identical; 116 more with the save-state round trip; 29 with audio. | seeded faults | `scripts/seeded_faults.py` (over cases.tsv and cases-acid.tsv; save-state faults with `--save-at-half`, audio ones with `--audio`) | **24 of 31 caught**, 4 of the 7 misses equivalent mutants, 3 recorded blind spots (below) | Seeded faults, at `e964cfd` plus the two last state faults: caught: the reference's two (`drop_dummy_read`, `steal_one_short`, switched on in the source: 78 cases each); ANTIC refresh slots, VCOUNT timing, VBI NMI cycle, character display delay, wide playfield stop; GTIA luma bit 0, player-player collisions, priority multicolour term, hires luminance; board RDY delay, refresh bus, NMI lost on the P push, $F000 mirror; 16K two-chip layout, Bounty Bob first window; pot scan step, keypad code, trak-ball lag; save-state pot charge and GTIA's CONSOL pin; audio speaker weight and sample step. Equivalent (not counted as blind spots): the line buffer's period 63 -> 64 (the counter is reset at cycle 8 and steps at most 48 times a line, so it never wraps); the frame-row bookkeeping `hcount < 100` -> `< 50` (GTIA's line edge never falls at cycles 50-99); the saved last-read address (read only under the `drop_dummy_read` fault); the saved floating-bus latch (the save is at a frame boundary, where the next cycle's read sets it before anything reads it). Blind spots: COLPM0's write delay 1 -> 2 colour clocks (no case writes it inside a visible colour clock); the 2-port row's port mask `& 1` -> `& 3` (no case's program selects ports 3-4 on that row); the saved /IRQ level for the next cycle (no case has a POKEY interrupt pending at the save's frame boundary). The round trip saves at frame boundaries only; a mid-frame save is not under the gate. ## Speed Native, release build, this shared machine, `a5200 ROM --frames 1800`, user CPU time, best of three: Pac-Man 6.3x real time (375 frames/s), Rescue on Fractalus! 8.4x, Star Raiders 6.1x. The reference on PyPy runs Pac-Man at 0.28x (16.9 frames/s, its README). Real time is 59.92 frames/s. ## The window `a5200-play` (feature `frontend`, SDL2) is judged headless only (dummy video and audio drivers): a scripted START and lower button on Pac-Man give, at frame 600, the same frame-buffer CRC as `a5200-trace` with the same presses, and the PNG it writes shows the maze. **No human has looked at it or played it.** ## Findings about the reference **A save state taken while a trak-ball rolls does not continue identically** (a5200-python `state.py` at 844355d). `snapshot` does not hold the CX53 model's lag output (`Controllers._balls[n].out`), and `restore` calls `Controllers.apply()`, which steps that lag once more. Repro on the reference alone: `scripts/trak_state_repro.py` on Missile Command (the lag reads 164.0 at the save and 139.0 after restore; POT0's target ten frames on is 18696 uninterrupted, 18693 restored). The Rust board transcribes it faithfully and so inherits it: `scripts/cases-upstream.tsv` is identical plain and differs with `--save-at-half` at the first frame after the load. No case of the main tables saves while a ball rolls, so they pass. A possible fix upstream: save `_balls[n].out` in the state and restore pads, balls and pot targets without stepping the lag (for example, re-derive the targets from the restored `pad.x/pad.y` instead of calling `apply()`). Not fixed here. Nothing else in the reference looked wrong. Unused there and here: `Machine.trig3_wired_to_trig1` (a row field nothing reads) and `antic.K_EXTRA`. ## What is left 1. The trak-ball save-state finding goes to a5200-python; when it is fixed there, merge it down and move `cases-upstream.tsv` into the main table. 2. A human session with `a5200-play` at a screen. 3. No Super Cart dump exists locally, so that class is under the unit test only, not the gate. 4. The next tiers: a5200-rust-fast, then a play site.