# Validation: the oracles found, ranked, and pinned Gathered 2026-11-11; re-fetched afresh 2026-11-14 after the restart. 28 files pinned by SHA-256 in `scripts/pinned_files.json`, 10 repositories at full commits in `scripts/pinned_repos.json` (narrowed so nothing the restart rules forbid is fetched: [provenance.md](provenance.md)); `python scripts/fetch_references.py` reported "all pins satisfied" on 2026-11-14 (the four RetroSix wiki pages had changed since their 2026-11-11 snapshot: live pages, kept with a warning). All 35 logic-analyser capture files are fetched (about 170 MB). Not fetched on purpose: any emulator's source except Holani's (built as a closed box, never opened), the two largest handy-docs scans (Git LFS, 141 MB), any boot ROM or cartridge. ## The tier rule (1) real-hardware measurement and die-level simulation > (2) manufacturer documents and schematics > (3) community hardware research with shown measurements > (4) FPGA cores written from the die or schematics > (5) other emulators. A lower tier is a **detector**: it finds differences. It never decides who is right. **There is no die-level judge for this machine.** No decap, die photograph or netlist of Mikey or Suzy was found (U13). There is no Lynx here and none will be bought, so no new hardware measurement is possible. The judges are tier 1 captures made by others, the manufacturer's specification, and test ROMs whose expected values were taken on consoles. ## Tier 1: hardware captures | What | Where | Licence | | --- | --- | --- | | **Lynx II logic-analyser captures** (DSLogic, 100 MHz, DSView `.dsl`): `lynx2-mikey-page_mode` (RAS, CAS, A0-A7, clocks, a software trigger); `lynx2-lcd-*` and `lynx2-mikey-*` for Batman Returns (75 Hz), Crystal Mines II (60), Krazy Ace (52), Lemmings (50), laoo's slope test (60, 78; with and without page mode); 22 `refresh_rate-T0_PBKUP_T2` settings | `reference/src/gearlynx/tests/logic-analyzer/` (repo `drhelius/Gearlynx` `94068da`); one `.dsl` and one `.vcd` fetched | repository is GPL-3.0; the captures are data | Limits: one console (a Lynx II), one author; `.dsl` is DSView's zip-based format (DSView is GPL-3; `sigrok-cli` reads it); no capture of Suzy's bus grant or of a sprite draw is named in the file list. They judge the display line (Timer 0 borrow to P4/H, CLK1-3, the 192-tick groups), the DMA burst position, and page mode. ## Tier 2: manufacturer documents | What | Pin | Notes | | --- | --- | --- | | **Epyx "Lynx-Documentation"** (the Handy hardware specification), HTML by M. Domin and B. Schick 1996-98 | `reference/docs/epyx-html/*.html` (16 pages, monlynx.de) | the transcription everyone cites; chapters 1-10, bus-interplay appendix, address appendix | | **Atari Lynx Specification (Handy) Rev P, 1989-08-09**, scan | `reference/docs/handy-specification-rev-p-1989-08-09.pdf` (25 MB, archive.org) + OCR text | the page-numbered original; AtariAge posts cite it by page ("page 34" for timers) | | **Handy development kit binder 1.6** (HandyROM specification, cartridge boot, Howard board, problems list, block diagram, bus interplay) | `reference/src/handy-docs` `ad4e4c8` (Alex Thissen's scans + Markdown) | cart layout rule, boot screen/loader contract | | **Lynx II schematic** ("Hayato", 1992) | `reference/schematics/lynx2-hayato-1992.pdf` | one sheet, low resolution; board-level only | | RetroSix Wiki pages (Lynx I rev C schematic, Lynx II schematic and pinouts, Mikey pinout, Hayato/Mikey/Suzy variations) | `reference/schematics/retrosix-*.html` (live pages) | tier 3 redraws of tier 2 sheets | Not found: the VTI CPU cell specification, the specification's appendix 7 (bus state machine), any Mikey/Suzy internal schematic, a Lynx I schematic as a manufacturer PDF. ## Tier 3: community research with measurements | What | Pin | Licence | Use | | --- | --- | --- | --- | | **drhelius "Lynx Hardware Tests" 1.4.9**: 19 prebuilt ROMs, 19 suites, 127 cases; each prints pass/fail against values "made by analyzing actual hardware", raw bytes shown | `tests/test_roms/lynx-tests-1.4.9.zip`; sources `reference/src/lynx-tests` `a920f01` | MIT | **the board's main judge**: cpu, page-mode, memio, timers, timers2, audio, audio2, math, sdoneack, sprites1-5, uart 1-3 (uart4 needs two consoles: out of scope) | | The four guides (page mode, timers, video timing, sprite performance) | same repo | MIT | the measured rules in prose | | laoo **SuzyTiming** | `c95e0ff`, no longer fetched | none stated | unlicensed source: not read (restart rule 1); no console result published (U6) | | AtariAge threads: which CPU (283383), one-shot timer behaviour found on hardware (347170), Mikey revisions and NMI (218756), Felix thread (326441) | `reference/atariage-forum/*.html` + `.txt`, Wayback snapshots | forum posts | prose findings by 42Bastian, laoo, sage, LX.NET | | 42Bastian `lynx_hacking`, `new_bll` | `3cda282`, `e2dded9` | Apache-2.0 | BLL format, micro loader, small experiments | | `HAMLET` (laoo) | `584d17e` | MIT | the loader frame and its arithmetic (`lynx-encryption-tools`, unlicensed, is no longer fetched) | How the test ROMs judge without a console: each has a table of expected result bytes in `/main.c` (`k_expected_results`), with alternatives where Lynx I and II differ. The board runs the ROM to its result screen and compares its own result bytes in RAM (`g_results`) with that table. The expected values are the author's record of hardware; we cannot re-measure them, so a test whose expectation changes between releases is a contradiction to log, not a regression. ## Tier 4 **MiSTer `AtariLynx_MiSTer`** (Robert Peip; GPL-2.0). Its README names no source material. Under the restart rules it is **not read and not used** (there is no FPGA here to run it as a closed box), and it is no longer fetched. (A list of its RTL files was struck.) ## Tier 5: emulators (detectors) | Emulator | Pin | Licence | Runs here | Boot ROM | | --- | --- | --- | --- | --- | | **MAME 0.285** `lynx` | system `/usr/games/mame` (tag `mame0285`); only `hash/lynx.xml` (CC0-1.0) is fetched | GPL-2.0+ | yes, closed box: `scripts/mame_trace.py` | BYO, required | | **Holani 1.0.0** (LLeny; Rust) | `holani` `7871f5c`, `holani-retro` `d0d79b4`, fetched only to build | GPL-3.0 | yes, closed box: built, driven by `scripts/libretro_run.py` | runs without a ROM (a free replacement, licence U9); uses `lynxboot.img` if present | | **Gearlynx** (drhelius) | `94068da`; only its LICENSE, README and logic-analyser captures are fetched | GPL-3.0 | not built | BYO | | **Felix** (laoo) | `f5a9cda`, README and CHANGELOG only | MIT | no: Windows/DirectX 11 only | BYO, or "bootrom HLE" | | **Handy 0.95** lineage: libretro-handy, Mednafen, Beetle Lynx | not fetched | zlib / GPL | not built | | Handy, Mednafen's Lynx core and Beetle Lynx descend from the same K. Wilkins code (their READMEs say so); they count as one voice. Felix, Holani and Gearlynx are independent rewrites whose authors say they test on consoles. (A note on the provenance of MAME's driver, from its source, was struck.) ### Detector runs (2026-11-11, load average about 40) - **MAME**: `python3 scripts/mame_trace.py ".../Atari - Atari Lynx (LNX)/Zaku (World) (Unl).zip" --seconds 2`: 2,290,284 instructions, 120 screen frames, 55 s wall. Frame period 66,780 CPU cycles of 250 ns = 16.695 ms. [mame-oracle.md](mame-oracle.md). - **Holani**: built with `cargo build --release` in 1 min 16 s after one fix (bindgen needed `BINDGEN_EXTRA_CLANG_ARGS=-I/usr/lib/gcc/x86_64-linux-gnu/12/include` to find `stddef.h`). `python3 -I scripts/libretro_run.py reference/build-holani/release/libholani.so "...Zaku (World) (Unl).zip" --frames 300 --digest-every 100`: 300 frames in 3.9 s, 160 x 102, reports 75 fps before the game sets its timers; frame 300 shows the "LYNX / just a moment / starting up" screen with the real ROM (`--system` pointing at a directory holding `lynxboot.img`), a different digest with the free ROM. Traps (observed by running): the core wants the image in memory, not a path; it panics unless the host accepts environment call 1 (`SET_ROTATION`); it takes `.lnx` (and `.o`), so a `.lyx` must be given a header first. - **Gearlynx**: the build command (`make` in `platforms/libretro`) was refused by this session's permission system, twice. Not attempted further. It is the emulator the test ROMs' author maintains and "passes all tests" by its own README, so it is the best third detector; building it is a five-minute job for the build session. ## Free boot ROM replacements | Shipped by | What | Licence | | --- | --- | --- | | Holani (embedded) | Björn Spruck's free Lynx boot ROM | Holani is GPL-3.0; the ROM's own licence not found (U9) | | Felix | no ROM: the host decrypts and starts at `$0200` | MIT | | MAME | none: `-listroms lynx` lists the ROM as required | | (Notes on which file holds Holani's ROM and on other emulators' no-ROM paths came from their sources and were struck.) For this board: the real ROM by hash is the reference path; host decryption (arithmetic written from the published description of the scheme, not from an emulator) is the no-ROM path. No replacement ROM is shipped. ## Licences in one line each Ours: MIT. Closed box only, source never opened (restart rules): MAME (GPL-2.0+), Holani and Gearlynx (GPL-3.0). Not used: the MiSTer core (GPL-2.0), Handy and its descendants. Permissive and usable with notice: lynx-tests (MIT, the judge), HAMLET (MIT), 42Bastian's repos (Apache-2.0), cc65 (zlib), Felix (MIT; only its README and changelog are fetched). Data used to seed the cart table: MAME `hash/lynx.xml` (CC0-1.0), the No-Intro DAT (names and hashes), our own files' headers. No GPL table is used. ## Milestone records ### M0: the loader front door (passed 2026-11-12) Judge: the data sources themselves (tier 5 data: the No-Intro DAT 20241112, MAME 0.285 `hash/lynx.xml` CC0-1.0, our own LNX headers; tier 2 for the size rule, HandyROM). Run: `.venv-pypy/bin/python -I scripts/m0_formats.py` (nice 19, 1 min 48 s wall, mostly `7z` processes), every image read in place, in memory. | Exit as written | Measured | | --- | --- | | all 840 local images load without error, read in place | 843 images (840 cart images + 3 BLL): 838 carts and 3 BLL programs load, **0 errors**; the 2 boot ROM images (No-Intro `[BIOS]` and its retrobat copy) are refused as carts and recognised as the boot ROM by hash, as cartridge.md requires. By kind and container: lnx in zip 22, raw in zip 499, raw in 7z 317, BLL in zip 3 | | every `.lnx` and its `.lyx` resolve to the same SHA-1 and description (22 of 22) | **22 of 22** same SHA-1, **22 of 22** same description (SHA-1, both block sizes, AUDIN, rotation, EEPROM, boot, name) | | census reproduces: 129 fully tabled, 290 size rule only, 2 neither | **129 / 290 / 2** over 421 distinct headerless payloads (the census counted the boot ROM among them; the other "neither" is Xump, 224,433 bytes, given a labelled default block of 1024) | | the two block-size conflicts (C14) reported, not hidden | the table records Zaku (Beta) block size (softlist 1024, header 2048) and Raiden (Beta) rotation (softlist LEFT, header none); on load, warnings for Zaku (Beta), Raiden (Beta) and Mines 2 (header 2048 against a 256 KiB payload: 128 pages); Zaku (Beta) carries `bank0_alternatives = (2048, header)` for the boot to try (decision 3) | | round trip LNX → LYX → LNX byte-identical for the 20 headers that agree with the table | **20 of 20** byte-identical (the two that disagree: Zaku (Beta), Raiden (Beta)) | Formats not present locally in every container (no loose file, no `.lnx` or BLL in `.7z`) are covered by `tests/test_cart.py` on synthetic images made in the test (loose, `.zip`, `.7z` for each of LNX, raw, BLL). The table is regenerated and checked by `scripts/build_cart_table.py --check` (396 entries: 392 No-Intro, 119 softlist, 22 local headers). Seeded fault (M0; the gate must be able to fail): with the size rule changed to `256 * b + 1` (no payload matches), the census line reads 129 / 0 / 292 and the round trip still passes; with `to_lnx` writing version 0, the round trip reads 0 of 20. Both reverted. ### M1: the CPU on the bus through the boot ROM (2026-11-14) Board on `w65c02-python` `9ca4a2f`, Lynx I row (MAME's only CPU is a G65SC02, `-listdevices`). Boot ROM `e4ed47fa...` from `$MAME_ROMPATH/lynx.zip` (MAME `-bios a`, the same image). Judge for flow: MAME 0.285 run as a closed box (tier 5); for the port: Spec §9 (tier 2). | Exit as written | Measured | | --- | --- | | lockstep PC, A, X, Y, P (mask `$CF`), S from `$FF80` through the decrypt into the stage-2 loader on five titles, N stated, first divergence explained | `scripts/m1_lockstep.py` over a 4-second MAME trace each: Zaku (World) (Unl) 4,660,137 of 4,660,137; California Games 4,528,355 of 4,528,355; Chip's Challenge 4,535,246 of 4,535,246; Blue Lightning 4,533,431 of 4,533,431; Shanghai 4,605,429 of 4,605,429. MAME reaches `$0200` at instruction 1.41-2.30 M, so 2.2-3.2 M instructions of each loader agree too. No time-dependent divergence appears within 4 s: these loaders do not branch on a timer or the display that early. | | first divergence explained | **D1** (instruction 3, `$FF85` `PLA`): the CPU's reset. `w65c02-python`'s `G65SC02` row writes PCH, PCL, P to page one during reset (captured on a G65SC12, the core's tier-1 evidence; the Lynx II cell is the core's U2); MAME's reset leaves page one alone, and the boot ROM's first four `PLA`s read those bytes. Recorded, not fixed (restart rule 6); the gate clears page one and continues. Also aligned, not compared: MAME's power-on registers (X=`$80`, P=`$36`), undefined on hardware (U15). | | host decryption reaches the same RAM at `$0200` as the real ROM for all 128 distinct frames | `scripts/m1_frames.py`: **52 of 128** run, all 52 identical (decrypted bytes = RAM from `$0200` when the real ROM jumps there). The other 76 were not run: listing the frames scans the whole library, which this session's limits exclude; owed at a commit point. | | seed a fault (wrong counter increment edge) and show the gate fails | the cart counter advanced on the leading edge (`--fault counter-edge`): Zaku diverges at instruction 198,295 (`$FE4A`, the first `RCART0` read of the frame: A = `$C1`, MAME `$FD`). Caught. | Not judged here: time. MAME counts uniform 250 ns cycles, so agreement says nothing about the 4/5-tick costs. The boot ROM copies its 256-byte bignum routine to `$5000` and runs it from RAM (read from the ROM's own code, which both sides execute identically). ### M2: tick costs, timers, interrupts, sleep, math (2026-11-14) Judge: lynx-tests 1.4.9 (`a920f01`, built from source; tier 3, console-derived expectations), run by `lynx_python.testrom` through the real boot ROM until `run_tests` returns, judged with each suite's own table from its `main.c`. The display DMA (M3's module) is in, because the cc65 start-up turns the display on before the tests run (DISPCTL `$0D`, standard timers). | Suite | Lynx II | Lynx I | Misses (result bytes / wanted) | | --- | --- | --- | --- | | cpu | 8/8 | 8/8 | test 7 prints LYNX 2 / LYNX 1 by row | | page-mode | 0/6 | 0/6 | all 1-3 µs short: II `34 40 66 7E 72 7F`, I `34 40 67 7F 73 7E` / `35 41 69 81 74-75 81` | | memio | 3/3 | 3/3 | | | timers | 7/7 | 7/7 | | | timers2 | 7/10 | 7/10 | 7 timer reads, 8 timer writes, 9 Mikey access (U20); 10 passes | | math | 8/8 | 8/8 | | | sdoneack | 9/10 | 9/10 | 6 IRQ RESLEEP `00 00` / `01 01`: needs the real sprite's draw time (Suzy stub holds the bus 2,000 ticks; M4/M5) | | **total** | **42/52** | **42/52** | | C5 is demonstrated by `timers` 4 (RESET-DONE) and 6 (ONESHOT+LINK: 13 interrupts from a one-shot at zero with RESET_DONE held). Behaviours established here (evidence in the code beside each): - Software borrow-in (CTLB bit 1) counts with the timer stopped (TEST ROM timers 1). - Green palette entries keep the low nibble only (TEST ROM memio 1). - `$FC40-$FC7F` mirrors Suzy's 64-byte register file, so the math ports are the SCB registers (TEST ROM memio 3; Appx 2's group labels say the same). - Math accesses set the unsafe bit (DOC bug list + TEST ROM math 1-7). - SPRSYS "last carry", **FITTED** to math 1-7: 1 after a negated product or an accumulate carry, after a divide with remainder or by zero; 0 otherwise. Rejected: always 0 (fails 2, 3), always 1 (fails 1, 4). No hold-out exists. - The display DMA burst, **MEASURED** from `lynx2-mikey-page_mode.dsl` (`scripts/la_bus.py`): two 4-CAS page-mode RAS pulses 14 ticks apart, each followed after 2 ticks by a 1-CAS pulse, about 28 ticks of bus per 8-byte fetch. Adding it took timers 6 from `0B` to the wanted `0D`. Fits tried and **not kept** (superseded by the measurements below): - DRAM refresh (U21), a steal of R ticks every P ticks, fitted on page-mode 1-4 over P in {128, 192, 256, 384, 512} x R in {2, 3, 4, 5, 6, 8}: three candidates fit 1-4 exactly ((192, 3), (256, 5), (384, 8)); they tie on the other suites, and every one breaks math 8 (the multiply then measures 4 µs, under its 5 µs floor). Held-out page-mode 5-6 was not used to choose. Not kept: refresh is off until a capture identifies it. - A constant DPRAM access cost, 14 to 21 ticks, on timers2 7-9: no value passes (U20). Kept at the documented minimum, 5. Seeded faults (`scripts/m2_faults.py`): see status.md. ### M2 (bus costs from the captures), 2026-11-14 The three gaps closed by decoding the captures' DRAM cycles with this repository's own scripts (tier 1, MEASURED), not by fitting to the tests: - `scripts/la_trace.py`: every CAS fall with its tick and its row and column (the multiplexed A0-A7 at the RAS fall and just after the CAS fall). Row = address high byte, column = low byte. CAS falls 1 tick into a 5-tick read that opens a row, at the start of a 4-tick page-mode read, 2 ticks into a write. - `scripts/la_compare.py`: runs the page-mode ROM on this board to the same trigger (the first `TriggerPulse`) and walks both cycle lists together. Decided by it, in `lynx2-mikey-page_mode`: the byte a one-byte instruction drops, an RTS's second cycle and a taken branch's extra cycle are 4-tick page-mode reads (they are at the next stream address); JSR, RTS and branch targets are 5 (a new row each time, also when the stream was open); the read at the pulled address that ends an RTS is a data cycle (the opcode after it opens a new row). - `scripts/la_registers.py`: the length of every hardware-register access of a known routine (the refresh_rate ROM's interrupt routine, built from source and identical in layout to the captured one) in three refresh_rate captures (879-1,387 accesses per register per capture), and the tick it ends on mod 16. Timer 0 backup reads take 5 to 20 ticks (all 16 lengths seen) and always end on the same phase; audio 0 ends 8 ticks after timer 0 in every capture; in the page-mode capture timer 2 ends 2 and timer 6 ends 6 ticks after the refresh phase that equals timer 0's elsewhere. So: one slot per timer (audio c = timer 8 + c), 1 tick apart, recurring every 16 ticks; an access is 5 ticks plus the wait for its slot. Suzy reads: `$FC00` 10 ticks, `$FC92` and `$FCB0` 9 (constant over 2,400 reads each). `SERCTL`, `INTRST`, palette and `MAPCTL` accesses: 5. - `scripts/la_refresh.py`, `scripts/la_dma.py`: refresh is a 4-tick read whose row and column both hold a counter that steps by one. In lines with display DMA each 4-byte half of a fetch (four CAS 2 ticks apart) is followed by one refresh, so the measured 28-tick burst already holds two; in lines without DMA a lone refresh comes every 256 ticks (spacings 250-260) at the next CPU cycle boundary, and the CPU's next read opens a new row. The 10 fetches per line are 192 ticks apart on average (jitter 188-194: the grant waits for the CPU cycle in progress). - `scripts/la_trace.py` on the refresh_rate interrupt routine: while the interrupt is pending, page-mode reads never follow each other (new-row, page, new-row, page ... throughout the routine). Cause unknown (U22). Two phases are not visible on the bus: the slots' phase against the timer prescaler and the refresh phase within its 256 ticks. `scripts/la_phase.py` runs the page-mode window for each candidate and counts the gaps that differ from the capture: the slot phase changes nothing measurable there (the program synchronises to the timer 2 slot) and is left at 0 (**FITTED**, no evidence either way; every one of the 16 values gives the same hardware-test scores); the refresh phase is 140 ticks after it (**FITTED** to the capture, best of 21 tried at 1-tick steps; scores the same 51/52 for 9 of 16 phases tried in 16-tick steps, page-mode 5/6 for the other 7). | Suite | Lynx II | Lynx I | Before | | --- | --- | --- | --- | | cpu | 8/8 | 8/8 | 8/8 | | page-mode | **6/6** | **6/6** | 0/6 | | memio | 3/3 | 3/3 | 3/3 | | timers | 7/7 | 7/7 | 7/7 | | timers2 | **10/10** | **10/10** | 7/10 | | math | 8/8 | 8/8 | 8/8 | | sdoneack | 9/10 | 9/10 | 9/10 (test 6 waits for the sprite engine, M4/M5) | | **total** | **51/52** | **51/52** | 42/52 | No test result was used to choose a rule above; the only values chosen to match anything are the two phases, chosen against the capture. Math 8 (which broke under the old refresh fits) passes. Remaining comparison differences over the first 3,000 captured cycles: 162 gaps, nearly all one cycle's shift of where a lone refresh lands, and the timer 6 slot waits in the first `PrepareTimer6` call (whose wait depends on the slot phase against the prescaler, the unmeasured phase). ### M3: the display (2026-11-14, partial) Judge: the Lynx II logic-analyser captures (tier 1), decoded by our own reader (`scripts/dsl.py`; `sigrok-cli` is not installed), with LT video-timing's stated numbers (tier 3) where a capture cannot be separated. `scripts/m3_display.py` runs the board at each capture's Timer 0 / PBKUP / Timer 2 setting (display DMA on, CPU in a loop) and compares. | Exit as written | Measured | | --- | --- | | line and frame structure match for the captured `T0_PBKUP_T2` settings | **21** captures exist (the brief said 22). In **15**, line period (HSYNC fall to fall) and frame period (VSYNC fall to fall) equal this board's Timer 0 and Timer 2 periods **to the tick** (lines of 1,936, 2,032, 2,544, 2,896, 3,040 ticks; frames of 103 to 107 lines). In the other **6** (120_032, 126_033, 158_042, 158_050, 180_048, 189_050: the highest PBKUP of each group) the capture holds no HSYNC or VSYNC at all: PBKUP outside the LCD's window, as LT says the glass then loses sync. This board does not model the P4/H output (PBKUP is stored only), so those six are not comparable. | | ticks from Timer 0 borrow to first group, group spacing | not separable from these captures yet: the left driver clock (`CLK 1`) runs for 632 ticks per line (one third of the 1,920-tick transfer, as LT describes three drivers), but HSYNC is the PBKUP-placed P4/H pulse, not the Timer 0 borrow. The board uses LT's numbers (624 + 1,920 ticks at the standard rate, ten groups of 192). | | DMA fetches | LT: ten 8-byte fetches per visible line (1,020 per frame at 102 lines); the board makes 1,020. The captures' 4-CAS pulse pairs number 1,040-1,082 per frame because the CPU's own page-mode runs also make 4-CAS pulses; separating them needs the address lines decoded. Not judged. | | frame period for Lemmings, Batman Returns, Krazy Ace, Crystal Mines II = the captured rate | captures: 319,200 / 213,360 / 304,080 / 267,120 ticks (50.1 / 75.0 / 52.6 / 59.9 Hz). This board, 1 to 8 emulated seconds after reset: 267,120 for all four, i.e. still the boot ROM's standard setting. The three non-60 Hz titles had not set their own timers within 8 s (Lemmings at 6 s sits in a long checksum loop in its loader at `$03B5`; the M4 sprite engine is still a stub). **Not met**; Crystal Mines II's agreement is the default, not evidence. | | seeded fault | `LYNX_FAULT=reload-plus-one` (a reloading timer reloads BKUP + 1): line and frame agreement 0 of 2 measurable. Caught. | The picture itself (rows rendered from RAM through the palette at DMA time, flip) exists in `mikey/display.py` but is unjudged: the test ROMs draw their result screens with Suzy, which is milestone 4. ### M4: the sprite engine, function (2026-11-14) `src/lynx_python/suzy/engine.py`, written from the Epyx chapter 6, appendix 2 and appendix 4 and the LT sprite-performance guide (MIT); no emulator source read. Judge: the video and collision CRCs that sprites1-5 compute on the console and store beside their Timer 1/3 durations (tier 3); the durations are milestone 5's. `python -I scripts/hwtests.py m4`: | Suite | CRCs Lynx II | CRCs Lynx I | Covers | | --- | --- | --- | --- | | sprites1 | 8/8 | 8/8 | totally literal 1-4 bpp, width 20, expansion | | sprites2 | 8/8 | 8/8 | alignment, clipping right/left/super, vertical clip, the Alpine Games protection SCB | | sprites3 | 8/8 | 8/8 | the eight types: video and collision buffers, depository | | sprites4 | 8/8 | 8/8 | packed RLE and literal packets, pen E, XOR pen F, linked SCBs, DMA on | | sprites5 | 8/8 | 8/8 | zoom, stretch +/-, tilt +/-, both | | **total** | **40/40** | **40/40** | | One rule came from a test rather than a document: the size accumulator's starting offset is chosen by the quadrant's direction **before** the flip (sprites2 8: the Alpine SCB is H-flipped, drawn leftwards, and needs HSIZOFF `$7F` for its third pen to reach x = 159; the specification says "left direction offset is forced to zero"). Recorded as TEST ROM. Rules still unexercised by any test: the starting position of a quadrant drawn the other way from the first one (HYPOTHESIS: one pixel beyond the reference), EVERON for non-colliding types (U16), the stop-at-end-of-sprite request. With the engine's real drawing time in place of the stub, sdoneack 6 (IRQ RESLEEP) passes: **M2 is 52/52 on both rows** (`scripts/hwtests.py m2`). Smoke list (`python -I scripts/smoke.py`, frames 600 and 1,200 at the titles' own rates, about 10 and 20 emulated seconds; pictures in `tests/runs/smoke/`, looked at by the agent on 2026-11-14 as two montages): - **Title screen reached (22 of 29):** QIX (at 20 s; the smoke list's name is now "QIX"), Batman Returns, Block Out (menu), Blue Lightning, California Games, Checkered Flag, Chip's Challenge, Crystal Mines II, Electrocop, Fat Bobby, Gauntlet - The Third Encounter (rotated), Hard Drivin', Joust, Klax (rotated wave menu), Krazy Ace - Miniature Golf, Ms. Pac-Man, Robotron 2084, S.T.U.N. Runner, Scrapyard Dog, Shanghai, Steel Talons, Todd's Adventures in Slime World. - **A coherent picture, title not certain (5):** Awesome Golf (a course view), Dirty Larry (an intro picture, then "STEELBURG, U.S.A."), Lemmings (the Psygnosis logo, then a balloon scene), Rampart (scenery), Warbirds (clouds over ground). - **Not reached (2):** NFL Football (black with one small logo), Xenophobe (a figure and a white arc on black). Not compared with a detector yet (Holani/MAME pictures owed); the sprite timing is still the M4 placeholder, which can change what a game shows. The smoke run found a board bug outside the engine: the CPU's interrupt line followed Mikey's pending bits only on register accesses, so a program waiting in RAM for its handler's flag never got the interrupt (California Games went black after its title). `_advance` now updates the line whenever the pending bits change; M2 and M4 counts unchanged. Seeded faults (`scripts/m4_faults.py`, judged on the CRCs): the shadow error "repaired", the line's last bit decoded, no depository write, tilt reversed, XOR written as opaque: **5/5 caught**. ### M5: Suzy's time (2026-11-14, partial) Judge: the Timer 1/3 durations sprites1-5 measure on consoles (minimum of three, windows of 32 µs; tier 3). No capture shows a sprite draw (validation "Tier 1": none named), so nothing here is MEASURED by us. The engine charges per destination row the maximum of three paths plus fixed work (LT's measured rule), with LT's stage costs (offset read 2, reject 18, read/write merge 2 a byte, XOR 2 a byte, collision groups 10/18, stretch 8, tilt 18) and four constants **FITTED** by `scripts/m5_fit.py` on sprites1 (row 68, 2 a pen, 2 an output, 2.5 a bus byte; started from LT's 72-76, 2, 2, 2.5). | Suite | Lynx II | Lynx I | Role | | --- | --- | --- | --- | | sprites1 | 3/8 | 3/8 | fitting set (only 3 of 8 inside after the fit) | | sprites2 | 3/8 | 3/8 | held out | | sprites3 | 0/8 | 0/8 | held out (collision types: all slow or fast by 3-10 %) | | sprites4 | 2/8 | 2/8 | held out | | sprites5 | 8/8 | 8/8 | held out | | **total** | **16/40** | **16/40** | (6/40 under the M4 flat-cost placeholder) | The structure is short of the hardware's: 1 bpp and 2 bpp full rows take different times on the console and the same here, and the collision types miss by up to 10 %. What would settle it: a logic-analyser capture of Suzy's RAM cycles during a draw (the bus decoder here already reads them). Seeded faults: the fixed row work doubled is caught (sprites5 8 -> 0); the tilt stage made free is **not** (a blind spot: sprites5's tilt cases stay inside their windows either way). ### M6: audio and UART (2026-11-14, partial) The four channels' polynomial counters (`Mikey._audio_clock`, from Spec §7 and Appx 2 FD20-FD27: 12-bit shift register, taps from FEEDBACK and CTLA B7, the inverted XOR shifted in, ±VOLUME or the clipped running total in integrate mode). No mixer, PWM or sample output yet; no UART (`Mikey.uart` is `None`). | Suite | Lynx II | Lynx I | Misses | | --- | --- | --- | --- | | audio | **6/6** | **6/6** | | | audio2 | 4/7 | 4/7 | 1-3, the linked timers' CTLB read: `0B`/`01`/`AB` where the console shows `08`/`04`/`A8` (borrow-in/out flags read as pulses, last-clock set: owed in `timers.py`) | | uart, uart2, uart3 | 0/17 | 0/17 | no UART | Harness fix: a suite whose `run_tests` never returned was judged on untouched RAM, so uart2 (all expectations zero) "passed" 5/5 with no UART at all. Such a run now fails every test. No earlier count changes (every M2/M4 run returned). Seeded fault: the audio timer's borrow unhooked from the counter (`m2_faults.py lfsr-unclocked`): caught. ### M3 title frame periods, and the loaders (2026-11-14, after the M2 bus costs) `scripts/m3_display.py --titles` (now runs up to 16 emulated seconds and stops at the first second the period equals the capture's): | Title | Capture (ticks) | This board | First second | | --- | ---: | ---: | ---: | | Lemmings | 319,200 | 319,200 | 8 | | Batman Returns | 213,360 | 213,360 | 9 | | Krazy Ace - Miniature Golf | 304,080 | 304,080 | 8 | | Crystal Mines II | 267,120 | 267,120 | (the boot setting; not evidence) | **Met**, to the tick, for the three non-60 Hz titles. They had stayed in their loaders for 8 s under the earlier bus costs; with the costs measured from the captures (commit "M2: bus costs measured ...") they leave them. The mechanism in the old model was not isolated (it is gone). Detector run, MAME 0.285 as a closed box, `scripts/m1_lockstep.py "Lemmings (USA, Europe)" "Batman Returns (USA, Europe)" --seconds 8` (Lynx I row): - Lemmings: 7,108,143 of 9,382,207 MAME instructions agree; **D2**: at `$04D7` MAME enters an interrupt (PC `$1002`, S down 3) where this board has not yet. - Batman Returns: 7,241,728 of 8,736,908 agree; **D3**: at `$1687` the same kind (MAME takes an interrupt one instruction stream position earlier than this board). Both are time-dependent by construction (MAME counts flat 250 ns CPU cycles, so its timer interrupts land at other instructions): recorded, not fixed (restart rule 6). Both titles reach their captured frame period afterwards on this board, which the capture (tier 1) decides. ### Smoke list after the M5 structure change (2026-11-14) `python -I scripts/smoke.py --frames 1200` (measured timeline, the default), looked at by the agent as one montage. Title screen or the title's attract screen: **25 of 29** (Awesome Golf, Batman Returns, Block Out, Blue Lightning, California Games, Checkered Flag, Chip's Challenge, Crystal Mines II, Electrocop, Fat Bobby, Gauntlet (rotated scene), Hard Drivin' (high-score table), Joust, Klax (wave menu, upright), Krazy Ace, Ms. Pac-Man, NFL Football (full title, upright: not reached before), QIX, Robotron 2084, S.T.U.N. Runner (publisher text), Scrapyard Dog, Shanghai, Steel Talons, Slime World, Xenophobe (title: not reached before)). Intros at 20 s: Dirty Larry (story text), Lemmings (balloon scene), Rampart (castle scenery), Warbirds (credits); run to 1,800 frames, then A, A, B 300 frames apart (looked at): Dirty Larry reaches its title ("again"), the chief's office scene and play in the street; Lemmings its title menu, then level 1 and play; Rampart its title, the map and "Red player select home castle"; Warbirds its credits, the airplane and mission menus and the cockpit. So **29 of 29** reach a title screen with time and input (none diagnosed as failing; no detector needed to decide). The change of sprite timeline is what moved NFL Football and Xenophobe (both were blank-ish under the paths model at the same frame count): sprite time decides how far a game gets in 20 s. Detector comparison (Holani, MAME) of these pictures was **not run** in this pass (context ran short); owed. ### M5 structure: Suzy's row timeline from a game capture (2026-11-14) `scripts/la_sprite.py` (our decoder, on `la_trace.Bus`). The game captures carry RAS, CAS and A0-A7, no write strobe. What they show (MEASURED): - Lemmings' capture (167 ms) holds no sprite painting: the CPU runs a loop in page `$11` and display DMA covers the buffer; 0 painted runs. - Batman Returns' capture holds sprite lines plainly (`la_sprite.py --look` and a stretch printed by RAS group): display DMA at `$C8xx` (4 CAS 2 ticks apart, each followed by a refresh cycle with row = column), sprite data reads at `$7Axx-$7Bxx`, and the drawing buffer at `$E0xx` stepping `$50` (80 bytes) per line. **Suzy's accesses are 2-tick page-mode CAS cycles in RAS groups aligned to 4 bytes**; a byte the sprite covers only partly is read and written in the same group (the address appears twice, 2 ticks apart); a line is: its offset byte, a wait, the data in RAS groups, the destination groups with gaps between them, a wait at the end. Modes of the gaps over the first 80 ms (`--dest E000-FFE0`; the "data" class still mixes in CPU cycles): RAS group start 4 ticks after the previous group; offset byte to first data group 32; destination group to destination group 4 (bus-bound) / 10 / 14 (start to start 10 or 16: 16 = 8 pixels at 2 ticks); last destination group to the next line 22 (48 occasionally); destination groups mostly 4 CAS, 1,909 of 10,730 with one byte read back. The measured timeline (`Suzy._measured_row`, constants `MEASURED` in `suzy/engine.py`): offset 4 + wait 32 + the source bytes in RAS groups (4 + 2 per further CAS) + per destination group max(4 + 2 per further CAS, 2 per pixel) + collision groups as bus groups (HYPOTHESIS: no collision runs were identified in the capture) + XOR 2 per byte (LT) + line end 22. **No value was chosen against a test window**, so all 40 windows are held out for it. | Suite | measured timeline | max-of-paths (FITTED on sprites1) | | --- | --- | --- | | sprites1 | 0/8 (all slow, about 20 % on the literal full rows) | 3/8 (its fitting set) | | sprites2 | 5/8 | 3/8 | | sprites3 | 0/8 | 0/8 | | sprites4 | 2/8 | 2/8 | | sprites5 | 8/8 | 8/8 | | held out for both (sprites2-5) | **15/32** | 13/32 | | all 40 | 15/40 | 16/40 | So the **measured timeline is the default**; the max-of-paths model stays behind the named switch `LYNX_SUZY_TIMELINE=paths` (`engine.TIMELINE`). The exit (40/40) is **not met**. The measured line runs slow on wide literal rows: on the console some of the source reads must overlap the destination work, which a capture holding a literal sprite and Suzy's collision traffic would show. Seeded faults (`scripts/m4_faults.py`): the five function faults as before; row-doubled (paths, windows) caught; **tilt-free** now caught by a durations gate (any change of a measured duration; a regression check, not a hardware judge), the windows' blind spot; **pixel-halved** (measured) is missed by the windows of both sprites2 and sprites5 (a second blind spot of the windows) and caught by the durations gate; line-end-free (measured) caught by sprites5's windows: 9/9 with the two durations-gate cases named as such. ### M8: the front end, `lynx-play` (2026-11-14) `src/lynx_python/play.py` (entry point `lynx-play`), pygame-ce 2.5.8 (SDL 2.32.10) in `.venv-pypy` (`pip install pygame-ce`; the `frontend` extra). A host: picture turned for the cart's rotation (and half a turn with `--flip`, which also swaps the direction keys), paced at the period the board measures (`Display.frame_period`), 32 kHz stereo sound queued as Mikey makes it, keys to JOYSTICK/SWITCHES, the cart's EEPROM saved under the user's data directory. **No human has looked at or listened to this window.** Judge, headless with SDL's dummy video and audio drivers, `scripts/m8_frontend.py` (PyPy): | Run | Window frames equal to the board's | Pace = measured period | Queued sound = board's samples | | --- | --- | --- | --- | | Klax (right), Ms. Pac-Man, 600 frames | 600/600, 600/600 | yes (74.99 Hz, 59.90 Hz) | equal (Ms. Pac-Man 152,476 non-zero samples; Klax silent) | | Klax, NFL Football (left), `--flip --presses 7`, 600 frames | 600/600, 600/600 | yes; keys reach the board swapped | equal | The reference for the picture is `picture.rotate` (pure Python) and a nearest-neighbour scale; the host uses `pygame.transform`, so the comparison checks two implementations against each other. Seeded host faults (Klax, `--flip --presses 7`): rotation reversed (480/600 frames equal: caught; at 120 frames all frames are blank and the fault is invisible), the previous frame shown (590/600: caught), one sound buffer a second dropped (caught), a fixed 60 Hz pace (caught), the flip's key swap lost (caught): **5/5**. ### M7: the cart EEPROM (2026-11-14) `cart/eeprom.py`: a 93C46/56/66/76/86 (16- or 8-bit organisation) on the cart port, wired as the BLL kit's `includes/eeprom.inc` (42Bastian Schick, Apache-2.0) and cc65's `libsrc/lynx/eeprom.s` (zlib, the same routine) say: CS = cart address A7, CLK = A1 (counter bits stepped by RCART accesses, cleared by the strobe), DI/DO = AUDIN. Protocol from those drivers and the 93Cxx data sheets (DOC); programming time zero (HYPOTHESIS). Saves go to `$XDG_DATA_HOME/lynx-python/eeprom/..eep` (default `~/.local/share/...`), written when a write or erase completes; never beside a ROM. Finding the titles: the cart table has **no** EEPROM rows (the MAME list does not record it; our 22 LNX headers say none), so a chip is given by override (`--eeprom 93C46:16`). Candidates were found by looking for the cc65 routine's instruction patterns in 52 named aftermarket titles' payloads (`lda #$0A / sta $FD8A`, `ldx #$1A / stx $FD8A`, paired `stz $FCB2`): Circuit Dude, Klondike, Timeloop, Lynxopoly, Nutmeg, Growing Ties carry them. Judge, `scripts/m7_eeprom.py` (two fresh consoles sharing one save directory; run 1 from an erased chip, run 2 from what run 1 left), Lynx II row, 900 frames: | Title | Run 1 | Run 2 | Verdict | | --- | --- | --- | --- | | Nutmeg | 8 writes, 16 reads | 0 writes, 8 reads, chip unchanged | saves and loads | | Growing Ties | 54 writes, 128 reads | 0 writes, 64 reads, chip unchanged | saves and loads | | Circuit Dude (scripted: start, solve level 1: `--script 'W700 A1 W90 A1 W90 A1 W120 L8 U3 R7 W300'`) | 1 write (word 0 = `0002`) | 0 writes, 1 read; the title shows a PLAY/EDIT/ABOUT/SOUND menu instead of "LEVEL 01" (looked at) | saves and loads | | Klondike, Timeloop, Lynxopoly | no write in 900 frames without input (Klondike reads once) | | not shown | The first two fill an erased chip with their defaults and accept them on the next run (no rewrite): a program checking its own save. Seeded faults, same command with `--fault`: the save never written to disk (`no-persist`): Nutmeg and Growing Ties rewrite in run 2, **0/2**; the chip's DO read inverted (`do-inverted`): **0/2**. Both caught. `tests/test_eeprom.py` drives the port the way the BLL routine does (write, read back, a new console, write without EWEN refused). Not done here (handoff M7 items outside this pass's scope): AUDIN banking, bank 1 carts, the Alpine Games boot, the detector sweep. ### M6 UART, CTLB levels, the mix and WAV (2026-11-14) **UART** (`mikey/uart.py`), from Spec ch. 11 and Appx 2 SERCTL/SERDAT (DOC) and the uart suites' sources and README (TEST ROM). Frame-internal timing has no document; five constants are **FITTED** with `scripts/m6_uart_fit.py`: - `IDLE_START` 1, `TAKE` 8, `EMPTY` 8: first guess, kept. From an idle line the start bit goes out at the next bit boundary, the holding register is taken a bit later (TXRDY, 2 bits after a write that follows TXEMPTY), TXEMPTY rises a bit after the stop bit (13 bits). Equivalent for transmit timing: `IDLE_START` 2, `TAKE` 0, `EMPTY` 0. Read off the uart suite's expected counts before any run. - The receiver: a finished frame waits in the shift register while the data register is full, and is lost (OVERRUN) when the next start bit arrives. Tried first and **rejected**: "the newest replaces the last of two held" (uart3 3 fails at every echo time: it needs the reader one byte behind at 62,500 baud, which uart2 4 at 9,600 baud forbids for any echo time proportional to the bit length). - `RECEIVED` 84 (the middle of the stop bit, HYPOTHESIS) plus `ECHO_DELAY` 600 ticks (37.5 µs) for both the start bit and the finished frame (a delay in time, not bits; HYPOTHESIS for its cause: the open-collector wire's rise). Scan at `RECEIVED` 84: 0, 192, 320, 480 and 720, 800, 960 ticks fail uart3 3; 560, 600, 640 pass every uart2/uart3 test. At 80: 720-800 pass. A **narrow window**: weak evidence. RECEIVED > 88 (the echo finishing after the next frame's start bit) was tried and dropped as physically impossible. Contradiction kept on record: the uart3 README says the echo lands "one bit ahead of TXEMPTY"; this model's echo at 62,500 baud lands after TXEMPTY (the raw latency byte is not judged). - uart3 5's README says one byte survives a slow reader; this model leaves two (the data register's oldest and the shift register's newest). Not judged (raw). No test was held out of the UART fit (all 17 were used to choose); the uart suite's two misses are each one 64 µs count at one baud rate, in opposite directions (uart 1 at 2,400 one long, uart 4 at 9,600 one short): no sub-bit offset fixes both, and the count depends on the Timer 6 prescaler phase (U15). Not fitted further. **Timer CTLB** (`timers.py` `Timer.ctlb`): B0 borrow out and B1 borrow in read as the pulses they are (0 by the time the CPU reads), B2 the source clock's level (DOC Appx 2 FD27 text, "last clock state (0->1 causes count)"); a linked input and a stopped timer read 0 (TEST ROM audio2 1-3, timers 1); HYPOTHESIS: 50 % duty for a prescaled source. audio2 4/7 -> 7/7; timers 7/7 unchanged. **The mix** (`Mikey.mix`, `--wav`): Spec §7 (mono, digitally mixed), MSTEREO (DOC Appx 2); ATTEN/MPAN register layout from cc65 `asminc/lynx.inc` (zlib), the meaning of an MPAN bit (attenuation applies, n/15) a HYPOTHESIS from a comment in 42Bastian's lniccc2000 player (Apache-2.0); the low-nibble PWM defect an option, off. No test ROM covers it; judged by `tests/test_audio_uart.py`. Samples: 32,000 Hz (every 500 ticks, point samples on the tick line). WAVs looked at as levels only: Chip's Challenge and Ms. Pac-Man make sound in 15 s; California Games and Klax are silent in 10-15 s (Klax writes its audio registers about 850 times). The detector comparison (Holani) is owed. | Suite | Lynx II | Lynx I | Before | | --- | --- | --- | --- | | audio | 6/6 | 6/6 | 6/6 | | audio2 | **7/7** | **7/7** | 4/7 | | uart | **4/6** | **4/6** | 0/6 | | uart2 | **5/5** | **5/5** | 0/5 | | uart3 | **6/6** | **6/6** | 0/6 | | all suites | **96/122** | **96/122** | 78/122 | Seeded faults (`scripts/m6_faults.py`): no echo, receiver one deep, parity inverted, UART interrupt lost, holding taken at the start bit, CTLB clock level stuck low, MSTEREO inverted, attenuation ignored: **8/8 caught**. ### Saved pictures follow the cart's rotation (2026-11-14) `lynx_python.picture.save` turns the saved frame by the cart description's rotation field (LNX header byte 58 or the cart table; user override `--rotation`); `python -m lynx_python --png` and `scripts/smoke.py` use it. The board itself never rotates (start-here.md "Output"). No document defines which way "left" and "right" turn, so the direction was decided by looking: Klax (World) (Beta) (table: right) and Centipede (USA) (Proto) (table: left) at 1,200 frames, each saved in all three orientations. Klax's wave menu reads upright after a quarter turn **clockwise** (upside down after anticlockwise); Centipede's high-score and copyright screen reads upright after a quarter turn **anticlockwise**. After the change the smoke pictures of Klax (wave menu) and NFL Football (left; the NFL shield) are upright. Evidence: looked at by the agent (no detector needed; Holani's SET_ROTATION value was not consulted). `tests/test_picture.py` pins both directions (a reversed turn fails it).