# Build progress Read [restart.md](restart.md) first, then this file. Updated after every commit. Environment: `.venv` (CPython) and `.venv-pypy` (PyPy 3.11), both `pip install -e`, plus the `acid` extra (6502-python 741419a, from its public repository) for the AcidSAP harness; without it those tests skip. The closed box: `python -I scripts/fetch_references.py`, then `OSS_CAD_SUITE=DIR` (an unpacked oss-cad-suite with `bin/ghdl`) for `scripts/run_vhdl.py`, `scripts/referee.py`, `scripts/streams.py`. The box runs about 25,000 cycles/s here: every long run under `timeout` and `nice -n 19`. ## Done 1. Scrub of the Phase 0 documents (rule 10): [provenance.md](provenance.md). 2. References fetched afresh; the closed box built; `scripts/referee.py`. 3. Rung 1: registers. SPDX headers (`scripts/spdx_headers.py --check`), NOTICE, lineage line, status.md. 4. Rung 2: clocks, timers, joins, STIMER, polys, RANDOM (B2.x in [behaviour.md](behaviour.md)); hardware-number tests; closed-box streams with 0 differences over 10 M cycles after the fixed alignment; closed-box differences D1-D5 in [validation.md](validation.md); `scripts/seeded_faults.py` (24/24). 5. Rung 3: the output stage (B3.x). The 5-bit gate is a per-channel flip-flop loaded at each of the channel's fires and at STIMER's T+2, held open while ungated (B3.2, OBSERVED; the patterns are the real chip's [Plogue]); the STIMER set holds two ticks (B3.7). Judge: 0 differences over 200 streams, 10,010,986 cycles. New differences D7 (later STIMERs load no gates on the box) and D8 (AUDF >= 128 changes whether STIMER's load sees a same-cycle AUDC write). `scripts/speed.py`. Faults 38/38 (4 first missed by 3 streams, made into tests). `docs/adoption.md` written (interface at this commit; pots, keyboard and serial pins marked "not yet"). 6. Rung 4: interrupts (B4.x). Settled which cycle AHRM 5.7's IRQEN deadlines count from: the IRQ handler's first cycle on a 2-cycle machine (A = latch tick + 3); with that reading the core's B0.2 timing gives both the manual's "four" and "two" and `pokey_irqtiming.s`'s IRQEN-path counts, so no IRQEN delay line was added (B4.1); the line now settles once per tick (B4.2). The AcidSAP harness (`tests/acidsap.py`, 6502-python 741419a via the `acid` extra): 8/10 pass on 2- and 3-cycle machines; asyncrecv and twotone are rung 7 (xfail strict). Its `pokey_inittiming.s` found the derived clocks one tick later than the manual's sentence: B2.1b, C10, alignment D2 now 0/1. /IRQ and IRQST against the box: 0 differences over 200 streams, 10 M cycles, after D9 (late acknowledge) and D10 (late bit-3 pin term), both contradicted by documents/tests. Faults: 44 (6 new). Commit 0b1b452. 7. Rung 5: the pot scan (B5.x) from AHRM 5.9's numbers; `rc.py` (B5.8). The closed box cannot judge pots (counter undefined through the pins). Faults +7. Commit a562228. 8. Rung 6: the keyboard (B6.x) from AHRM 5.8; box judge on K pins, /IRQ, IRQST and SKSTAT with D11-D14 recorded (D12: the box swaps the Shift and Break codes against the manual). Faults +8. Rung 7's behaviour (B7.x) is written in behaviour.md ahead of its code. Commit fec011c. 9. Rung 7: two-tone resync and force break, async hold of timers 3+4, clock pins, SOD (B7.x). AcidSAP 9/10 (asyncrecv passes; twotone needs the output shifter, decision 2). Faults +6 (64 in all). Commit 52b84e7. 10. Rungs 9 and 10: `scripts/conformance.py` and `validation/conformance.txt` (11 cases, per-cycle digests, identical on CPython and PyPy); seeded faults 64/64 against the unit tests and the kit; README and status with measured numbers; adoption.md complete. Last commit of record: 6ed1ffa (rungs 9-10), **the commit boards should pin**. ## Left - Rung 8 (music excerpts against the box): needs register logs from a5200-python / a7800-python once they adopt the core. - The serial shift registers (decision 2): AcidSAP `pokey_twotone` needs the output one; the 8-bit computer board will need both. - Stream judges re-run over all 64 faults (`--streams 3`, about 30 min). - The two open questions with hardware experiments that would settle them: the IRQEN deadline sweep (B4.1) and the slow pot step placement (B5.2). - Lint: `ruff check` style findings, nearly all in scripts older than rung 3 (pairwise, noqa, shebangs); not addressed. - The Rust transcription `pokey-rust` (next tier), and adoption by the two boards at the pinned commit.