# Validation: the judges, the board's scores and the detectors' own scores This document lists every judge the board is held to, how its verdict is read, how strongly it is calibrated against hardware, the board's own scores (section "The board"), and what the two closed-box detectors score on the same judges, so a board result can be read against them. All detector numbers are `OBSERVED`: measured on 2026-11-19 at gba-python `2440c53` (the judge scripts as committed), on this machine, with: | Name here | What | | --- | --- | | mGBA | mGBA `fd9dc5c` (2026-10-18), libmgba through our `mgba_driver` (kept and built outside the repository since 2026-11-25: `$EMU_TOOLS_GPL/tools/mgba/build/gba/mgba_driver`; it was `scripts/mgba_driver.c`), idle-loop skipping off | | NBA | NanoBoyAdvance 1.8.3 (`8c3b159`) through our `nba_driver` (a GPL tool kept and built outside the repository: `$EMU_TOOLS_GPL/tools/nanoboyadvance/build/gba/nba_driver`, since 2026-11-25) | | free BIOS | Cult-of-GBA BIOS `a30e9a9`, its prebuilt `bios.bin` (MIT) | | retail BIOS | the player's dump, No-Intro "[BIOS] Nintendo Game Boy Advance Boot ROM (World)", read in place from `$NO_INTRO_DIR` | Both detectors are GPL/MPL programs run as closed boxes (restart.md rule 5): they say what an emulator does, never what the hardware does. A detector failing a hardware test is information about the detector. ## Calibration classes | Class | Meaning | Members | | --- | --- | --- | | **H** hardware-calibrated | expected values or pictures come from a GBA, said so in the suite's readme, README or the picture itself | hw-test (README: "GBA hardware tests"; vram-mirror: "passes on GBA and GBA SP"; ppu photographs); alyosha-tas `gba-tests` (readmes: "tested on GBP", hardware-timed per the pin note; a Game Boy Player is a GBA in a box); destoer `lyc_midline` (a photograph, of a DS-family console in GBA mode) | | **H?** calibration not stated | a test suite whose expectations are its author's, with no statement in the repository of where they came from | jsmolka `gba-tests` (its unsafe/README implies hardware runs: "failures on hardware are probably caused by the flash card"); endrift's mGBA `suite` (no provenance statement in the repository); destoer `line_timing.sav` (a value, origin not stated); hw-test `sprite-hmosaic` (its expected.png is an NBA 1.8.2 screenshot, so **detector**) | | **R** run only | no licence or a copyleft licence: run, never read; verdicts read from the screen | ARMWrestler, krom (PeterLemon) BIOS tests, FuzzARM, Hades-Tests (GPL-2.0: its LICENSE file was checked, nothing else), AGBEEG aging cartridge (zaydlang, "see repository"), Nintendo's AGS/AGB aging cartridges and Backup LIB sample (commercial, run in place) | | **D** detector | another emulator | mGBA, NBA, MAME 0.285 (`scripts/mame_run.py`) | The handoff brief treats the mGBA suite as a judge; its calibration is not stated in its repository. **Owner's ruling, 2026-11-20:** it is not treated as hardware-calibrated. It is an excellent emulator author's suite, not a hardware oracle, so it stays a judge for the rungs but a fit resting only on its timing rows is FITTED and provisional. Where a hardware-calibrated suite (class H) disagrees, the H suite wins. ## Reading the library ROMs (jsmolka, alyosha-tas): the screen, not r12 Both suites share a library whose `m_test_eval reg` saves r0-r12, prints "All tests passed" or "Failed test NNN" from `reg`, and **restores r0-r12** (reference/src/gba-tests/lib/macros.inc). So r12 after the evaluation is not the verdict: - jsmolka `thumb.gba` evaluates r7: r12 reads 0 while the screen says "Failed test 230" (mGBA, free BIOS, frame 300). - alyosha-tas's `LDM/*` keep r12 = 0: the screen says "Failed test 2" on both detectors. - A ROM that hangs before evaluating leaves r12 = 0 (alyosha-tas `irq/IRQ_sub_2`, `thumb/blx` on mGBA with the free BIOS: blank screen, PC in the BIOS). Reading r12 made mGBA (free BIOS) score 59 of 143 and NBA (retail BIOS) 95 of 143; the screens say 40 of 137 and 79 of 137. The archived board's "114/127 (r12 protocol)" target in handoff-brief.md was taken with the r12 reading and is therefore not comparable (restart.md: targets say how far a board got; this one may overstate it). **The judge**: `scripts/judge_text.py` runs each ROM for 600 frames (enough for the retail BIOS's boot plus every test; checked at 3,000 frames for the silent ones), decodes the last frame, and reads the 8-pixel band at y = 76 cell by cell against the library's 8x8 font, which it reads at run time from the fetched `lib/glyphs.asm`. Verdicts: `pass`, `fail N`, `no verdict`. It covers 137 ROMs: every ROM whose own source calls `m_test_eval`, plus `prefetcher/bounday_test_1.gba` (no source of its own). Excluded as picture tests: the `ppu/hello`, `shades`, `stripes`, `stripes_x_offset` ROMs, and alyosha-tas `ppu/Sprite_Disable_Midline` and `Sprite_Disable_on_VRAM_Access`, which loop for ever drawing (`b t001`). Judges by eye, no stored expectation. ```sh python scripts/judge_text.py --emu nba --bios "$NO_INTRO_DIR/Nintendo - Game Boy Advance/[BIOS] Nintendo Game Boy Advance Boot ROM (World).zip" python scripts/judge_text.py --emu mgba # free BIOS python scripts/judge_text.py ROM.gba ... # some ROMs ``` The board will need the same reading of its own frame (a `--png` output, or the frame buffer handed to `read_band`). ## Detector scores ### jsmolka and alyosha-tas (screen verdicts, 137 ROMs) | Group | ROMs | mGBA free | mGBA retail | NBA free | NBA retail | | --- | --- | --- | --- | --- | --- | | jsmolka arm, bios, memory, nes, save (4), thumb | 9 | 4 | 5 | 8 | 9 | | jsmolka unsafe | 1 | 0 | 0 | 0 | 0 | | alyosha-tas Bus | 6 | 1 | 1 | 3 | 3 | | alyosha-tas DMA | 9 | 4 | 1 | 4 | 7 | | alyosha-tas Interactions | 16 | 6 | 2 | 5 | 7 | | alyosha-tas LDM, STM_ALU_IMM | 9 | 1 | 1 | 1 | 1 | | alyosha-tas Serial | 9 | 8 | 2 | 1 | 1 | | alyosha-tas arm, thumb, psr | 8 | 1 | 1 | 7 | 7 | | alyosha-tas bios | 1 | 0 | 1 | 0 | 1 | | alyosha-tas fifo_dma | 9 | 3 | 3 | 3 | 3 | | alyosha-tas irq | 16 | 1 | 1 | 8 | 13 | | alyosha-tas memory, nes, save | 8 | 6 | 6 | 8 | 8 | | alyosha-tas ppu (text verdicts) | 6 | 0 | 2 | 0 | 3 | | alyosha-tas prefetcher | 18 | 2 | 2 | 10 | 10 | | alyosha-tas timer | 3 | 0 | 0 | 1 | 1 | | alyosha-tas timing | 5 | 1 | 1 | 1 | 3 | | alyosha-tas unsafe | 4 | 2 | 2 | 2 | 2 | | **all** | **137** | **40** | **31** | **62** | **79** | Without a verdict on screen at 600 frames: mGBA free 4 (`Interactions/Internal_Cycle_DMA_IRQ_Br_pre`, `irq/IRQ_sub_2`, `irq/IRQ_sub_2_slow`, `thumb/blx`), mGBA retail 2, NBA free 3, NBA retail 2 (`arm/Coprocessor_14`, `irq/IRQ_sub_2_slow`; still silent at 3,000 frames). The per-ROM table is the appendix. Notes: NBA fails 8 of the 18 prefetcher ROMs, as the brief's "known detector facts" say. Both detectors with either BIOS fail all eight `LDM/*` ROMs (the LDM^ glitch, "hardware dependent ... tested on GBP"). mGBA fails jsmolka `thumb` (test 230) and `arm` (test 522). The retail BIOS changes results: the BIOS ROMs pass only with it on both detectors; on NBA, 17 more ROMs pass with it (irq 8 to 13, DMA 4 to 7, timing 1 to 3, ...), consistent with expectations taken after Nintendo's boot. The `unsafe/` ROMs crash consoles (alyosha-tas unsafe/README) and are not judges. ### endrift's mGBA suite (END lines, `scripts/referee_run.py suite`) | Sub-suite | Cases | mGBA free | mGBA retail | NBA free | NBA retail | | --- | --- | --- | --- | --- | --- | | Memory | 1,552 | 1,506 | 1,552 | 1,468 | 1,514 | | I/O read | 130 | 130 | 130 | 130 | 130 | | Timing | 2,020 | 1,648 | 1,768 | 1,900 | 2,020 | | Timer count-up | 936 | 692 | 744 | 847 | 936 | | Timer IRQ | 90 | 70 | 70 | 90 | 90 | | Shifter | 140 | 140 | 140 | 140 | 140 | | Carry | 93 | 93 | 93 | 93 | 93 | | Multiply long | 72 | 52 | 52 | 72 | 72 | | BIOS math | 615 | 603 | 615 | 603 | 615 | | DMA | 1,244 | 1,244 | 1,244 | 1,244 | 1,244 | | SIO register R/W | 90 | 61 | 61 | 18 | 18 | | SIO timing | 8 | 0 | 0 | 0 | 0 | | Misc. edge cases | 12 | 3 | 6 | 5 | 6 | | Video | - | no END line (interactive) | | | | NBA retail's 38 memory failures are all "ROM out-of-bounds load" cases (U-MEM-3); both detectors' edge-case failures include the "H-blank bit start" cases (U-VID-1); mGBA's include "DMA Prefetch Break". ### hw-test (screens read by eye, retail BIOS, 600 frames) Text ROMs (pass = every line PASS): | ROM | mGBA | NBA | | --- | --- | --- | | bus/128kb-boundary | fail (at least 7 of 18 lines fail) | fail (at least 5: DMA decrement cases) | | dma/burst-into-tears | fail (1/3) | fail (0/3) | | dma/force-nseq-access | fail (0/2) | pass | | dma/latch | pass (4/4) | pass | | dma/start-delay | fail (21, expected 20) | pass | | haltcnt | fail (2/6) | fail (5/6: CPUSET DMA 4151, expected 4154) | | irq/irq-delay | fail (1/3) | pass | | timer/reload | fail (4/7) | pass | | timer/start-stop | fail (1/2) | pass | | timer/tick-before-reload | fail (0/2) | pass | | ppu/vram-mirror | pass (10/10) | pass | | **11 text ROMs** | **2** | **8** | `bus/128kb-boundary` prints 18 results without room for the "expected" lines of failures, so its first lines scroll away; the counts are lower bounds. `ppu/status-irq-dma` and `ppu/ram-access-timing` are interactive menus (not scored). Picture ROMs against the hardware photograph: | ROM | mGBA | NBA | | --- | --- | --- | | ppu/bgpd | differs (three bands, the photograph two) | matches | | ppu/bgx | differs (no vertical line) | matches | | ppu/dispcnt-latch | matches | matches | | ppu/greenswap | undecided by eye | undecided by eye | | ppu/sprite-hmosaic | differs from NBA 1.8.2's screenshot | matches (the "expected" is NBA's own screenshot) | ### Other judges (screens, retail BIOS, 900 frames) | Judge | mGBA | NBA | Reading | | --- | --- | --- | --- | | Hades-Tests (R): dma-start-delay, dma-latch, bios-openbus, timer-basic | 0/8, 2/4, 10/12, 2/10: 0 of 4 ROMs | 4/8, 4/4, 10/12, 10/10: 2 of 4 ROMs | totals on screen; both fail bios-openbus cases 05 and 11 identically | | krom BIOS tests (R), 25 ROMs | 24 (RegisterRamReset "OTHER" timer fails) | 25 | PASS/FAIL per line, with timer counts of each BIOS call: these need Nintendo's BIOS | | GBA-Test-Collection `retAddr` (H?) | pass | pass | "IRQ (ARM) - OK!", "IRQ (Thumb) - OK!" | | destoer `lyc_midline` (H, DS photo) | differs | matches | numbers against the photograph | | destoer `line_timing` (H?) | 1,012 | 1,004 | against the `.sav`'s 1,006 | | destoer `cond_invalid`, `dma_priority`, `hello_world`, `if_ack`, `isr`, `window_midframe` | prints | prints | no expectation stored: detector comparison only. `isr` differs (mGBA timer A6, arm lr 30, thumb lr 6; NBA A1, 2C, 8); `window_midframe` differs in the top band | | FuzzARM (R), 5 ROMs | counting, no failure shown at 900 frames | same | protocol not readable without its source; a longer run is needed | | AGBEEG aging (R) | cartridge, CPU, DMA: FAIL | cartridge, CPU: PASS, DMA in progress | at 900 frames | Not run here: ARMWrestler (interactive menus), Nintendo's AGS/AGB aging cartridges and Backup LIB sample (present in `$NO_INTRO_DIR/Nintendo - Game Boy Advance`; they need key scripts), mGBA `gbatests/keyirq` and DUST (source only, no licence: they could be built without being read, but need devkitPro, which is not installed), the games lists (rung 7). MAME 0.285 was not run. ## The board (rungs 0-1) Measured 2026-11-19 on this machine with PyPy 7.3.23 (Python 3.11), every count at the board's code `2504e88` (the later commits change only documents). Retail BIOS = the player's No-Intro dump read in place; free = Cult-of-GBA `a30e9a9`. Every verdict is read from the board's own picture or video memory, never from r12: ```sh python scripts/judge_text.py --emu board --jobs 12 --bios "$BIOS" # jsmolka, alyosha-tas python scripts/board_suite.py --bios "$BIOS" --jobs 13 # the mGBA suite's screen score python scripts/board_screens.py --bios "$BIOS" --jobs 11 # hw-test's text ROMs python scripts/board_screens.py --bios "$BIOS" --frames 900 ROM... # krom, retAddr, Hades (by eye) ``` ### Rung 0 judges | Judge | Retail BIOS | Free BIOS | Target (archived board) | Detectors (NBA / mGBA, retail) | | --- | --- | --- | --- | --- | | jsmolka `gba-tests` (screen), 10 ROMs incl. `unsafe` | **10/10** | 9/10 (`bios` needs Nintendo's BIOS) | 10/10 | 9/10, 5/10 | | mGBA suite: memory | **1,552/1,552** | 1,506 (Nintendo-BIOS values; mGBA free also 1,506) | 1,552 | 1,514, 1,552 | | mGBA suite: I/O read | **130/130** | 130 | 130 | 130, 130 | | mGBA suite: DMA | **1,244/1,244** | 1,244 | 1,244 | 1,244, 1,244 | | mGBA suite: BIOS math | **615/615** | 603 (as both detectors free) | 615 | 615, 615 | | mGBA suite: shifter / carry / multiply long | **140/140, 93/93, 72/72** | the same | 140, 93, 72 | full, full; mGBA 52/72 multiply | | krom BIOS tests (run only, by eye, 900 frames) | **25/25** (every line PASS, the timer lines included) | not run | 25/25 | 25, 24 | | ARMWrestler (run only) | not run (interactive menus, as for the detectors) | | 8/8 | not run | ### Rung 1 judges | Judge | Retail BIOS | Free BIOS | Target | Detectors (NBA / mGBA, retail) | | --- | --- | --- | --- | --- | | mGBA suite: timing | **2,020/2,020** | 1,900 (BIOS-division rows; NBA free also 1,900) | 2,020 | 2,020, 1,768 | | mGBA suite: timer count-up | **936/936** | 847 (NBA free also 847) | 936 | 936, 744 | | mGBA suite: timer IRQ | **90/90** | 90 | 90 | 90, 70 | | mGBA suite: SIO register R/W, SIO timing, misc. edge | 25/90, 0/8, 8/12 | 25, 0, 7 | 31/90, 0/8, 6/12 | 18, 0, 6; 61, 0, 6 | | hw-test text ROMs (bus, dma, haltcnt, irq, timer; + ppu/vram-mirror) | **10/11** ROMs; lines 56/57 | 10/11; haltcnt 1/6 (CpuSet timings and POSTFLG are the BIOS's) | 13/14 (archive counted 14 ROMs) | 8/11, 2/11 | | alyosha-tas Bus | 5/6 | 5/6 | | 3, 1 | | alyosha-tas DMA | 2/9 | 4/9 | | 7, 1 | | alyosha-tas Interactions | 3/16 | 5/16 | | 7, 2 | | alyosha-tas irq | 11/16 | 7/16 | | 13, 1 | | alyosha-tas prefetcher | 12/18 | 12/18 | archive failed 2 | 10, 2 | | alyosha-tas timer | 1/3 | 1/3 | archive failed 2 (timer, timer_reset) | 1, 0 | | alyosha-tas timing | **5/5** | 3/5 | archive failed dma_long | 3, 1 | | alyosha-tas psr | 1/1 | 1/1 | | 1, 1 | | GBA-Test-Collection `retAddr` | **pass** ("IRQ (ARM) - OK!", "IRQ (Thumb) - OK!") | not run | 1/1 | pass, pass | | Hades-Tests (run only, by eye) | dma-start-delay 4/8, dma-latch 3/4, bios-openbus 10/12 (05 and 11 fail, as on both detectors), timer-basic 10/10: 1 of 4 ROMs | not run | 2/4 | 2 of 4, 0 of 4 | All 137 screen-verdict ROMs (the appendix's list): **77/137** with the retail BIOS (NBA 79, mGBA 31), **74/137** free (NBA 62, mGBA 40). Outside rungs 0-1 these include alyosha-tas LDM 4/8 (both detectors 0/8), thumb 5/5, arm 1/2 (`Coprocessor_14` fails: a core matter, below), Serial 2/9, fifo_dma 2/9 (rung 5), ppu 0/6 (rungs 3-4), memory/nes/save/bios all pass, and `unsafe` 3/4. **hw-test, line by line (retail):** bus/128kb-boundary 18/18, dma/burst-into-tears 3/3, force-nseq-access 2/2, latch 4/4, start-delay 1/1, irq/irq-delay 3/3, timer/reload 7/7, start-stop 2/2, tick-before-reload 2/2, ppu/vram-mirror 10/10, haltcnt 5/6 ("HALTCNT CPUSET DMA" reads 4153, expected 4154: not fitted further). The board reads all 18 lines of 128kb-boundary (it prints no summary). **Against the targets (handoff-brief.md):** jsmolka, the mGBA suite's ten graded groups, krom and retAddr reach the archived board's scores; the suite's SIO R/W is 6 below and misc. edge 2 above; hw-test is one line short (haltcnt); Hades-Tests 1 of 4 against 2 of 4. The archived alyosha-tas "114/127" was read from r12 and is not comparable (above); its recorded failures (8 serial, timer, timer_reset, dma_long, two prefetcher) show the archive passed DMA, Interactions and irq groups that this board does not yet: the DMA pause-timing ROMs depend on the H-blank DMA's exact cycle in the line (U-VID-1, rung 3-4), the Interactions ROMs on DMA against IRQ dispatch and HALT, irq's IRQ_sub/BL_IRQ/halt_pc on IRQ entry at chosen pipeline points. These are reported, not chased. ### What still fails in rungs 0-1, and why (as far as known) | Judge | Fails | What is known | | --- | --- | --- | | alyosha-tas `DMA/DMA_pause_timing_*` (6), `ROM_to_IWRAM` | values off by a few cycles | an H-blank DMA preempts an immediate one: needs the H-blank request's exact cycle (U-VID-1, video.md) | | alyosha-tas `Interactions/*` (13) | | DMA beside IRQ dispatch, HALT and multiplies: the "IRQ pipeline stalls when the CPU waits on the bus" rule (Interactions/ReadMe.txt) is not modelled beyond the CPU's own stall | | alyosha-tas `irq/IRQ_sub*`, `BL_IRQ`, `halt_pc*`, `IF` (case 6) | | IRQs taken at chosen pipeline points; `IRQ_sub_2*` show no verdict (they hang) | | alyosha-tas `prefetcher/*` (6) | full_arm/_2, branch_thumb_3/4, bounday_test_1, prefetcher_dma | U-TIM-3: full-buffer ARM fetches, DMA beside the buffer | | alyosha-tas `timer/timer`, `timer_reset` | | the prescaler's phase at power-on (U-TIM-4) is not fitted: PHASE = 0; the archive also failed them (Game Boy Player boot) | | hw-test haltcnt "CPUSET DMA" | 4153 vs 4154 | a DMA writing HALTCNT: one cycle unaccounted | | mGBA suite SIO groups | | U-SIO-1: multi-player and internal-clock transfer timing without a partner | ### Seeded faults `scripts/seeded_faults.py` changes one line in a copy of `src/` (fresh timestamps) and runs the rule's judge (retail BIOS, at `2504e88`): **51 of 51 caught**. Each fault's judge passes on the unchanged board (the baseline the script measures first). By rule: - memory map, open bus and I/O (13): EWRAM mirror, palette byte writes, OAM byte writes, the bitmap-mode VRAM hole, SRAM wide reads, BIOS protection, I/O open-bus rule, the 16-bit bus latch, BG0CNT and NR50 read masks, no-backup FF, Flash bank switch, KEYINPUT: the mGBA suite (memory, I/O read, DMA), jsmolka memory/bios/save, alyosha-tas PAL_8_bit_writes, hw-test vram-mirror and dma/latch; - bus timing and the cartridge (10): EWRAM waits, the ROM word's second half S, writes landing in their first cycle, events before the access, the cartridge counter, the 128 KB wrap and block-start rules, a DMA's first cartridge access N, the CPU's N after DMA: suite timing, hw-test 128kb-boundary, burst-into-tears, force-nseq-access, start-stop, reload; - DMA (7): run-before-the-CPU, start delay, internal cycles, the 16-bit latch, BIOS reads skipped, the copy to the CPU's open bus, and the CPU's internal cycles beside a DMA; - timers (6), the IRQ line and HALT (8), the prefetch buffer (9): hw-test timer and haltcnt ROMs, irq-delay, the suite's timer IRQ and timing groups, alyosha-tas irq/IE and the prefetcher ROMs. Three faults (an event due exactly now left waiting; a DMA due exactly now left waiting; IF never acknowledged) hang the board or keep the suite from drawing its score: their judges were stopped after 20-50 minutes against a normal 2 and counted as caught (no verdict). **Blind spots** (a rule no passing hardware judge exercises): - the CPU's internal cycles running beside a DMA (alyosha-tas Interactions/ReadMe.txt): its fault is caught only by a model unit test (`test_cpu_internal_cycles_overlap_dma`), which guards the model, not the hardware; the ROMs that exercise it (Internal_Cycle_DMA_*) fail for other reasons; - `irq.IME_DELAY` is bounded only from above: 2, 3 and 4 all pass hw-test irq-delay (5 and 6 fail); - equivalent mutants found and removed: the ROM windows' n32/s32 entries (never read), the prefetch unit's restart delay, abort penalty and in-flight extra (no judge changed with any value once the buffer empties on data access). ### Unit tests `python -m pytest tests` (PyPy): 70 tests in about 3 s: the mGBA suite's timing frame run as hand-assembled programs (its Calibration row in all 16 WAITCNT/state modes, and its nop, LDR-from-stack, LDR-from-ROM and LDM rows), the memory map and open-bus rules, the timers' cycle rules, the IRQ line's delays, HALTCNT's gate and the halt wake-up, DMA latches, save detection, Flash commands and the EEPROM protocol, and one model regression guard (the CPU's internal cycles beside a DMA, which no passing hardware judge exercises). ## The board, rung 2 (saves and the clock) Measured 2026-11-21 on this machine with PyPy 7.3.23, at `7fcb7a6` unless stated. Both commercial judges are read in place from `$NO_INTRO_DIR` (class R: run only): ```sh python scripts/board_saves.py --bios "$BIOS" --jobs 8 # Backup LIB sample, Emerald python scripts/judge_text.py --emu board reference/src/gba-tests/save/*.gba --bios "$BIOS" ``` | Judge | Retail BIOS | Free BIOS | Target (archived board) | Detectors (retail, OBSERVED) | | --- | --- | --- | --- | --- | | jsmolka `save/` (none, sram, flash64, flash128) | 4/4 (rung 0-1 re-run, below) | 4/4 | 4/4 | NBA 4/4, mGBA 2/4 | | Backup LIB sample: SRAM, six patterns | 6/6 | 6/6 | 12/12 for the whole sample (its case split not recorded) | mGBA and NBA fit a Flash chip for this ROM and fail the SRAM test ("VERIFY ERROR. 0E000000") | | Backup LIB sample: Flash, five chips x six patterns | 30/30 | 30/30 | | mGBA fits Panasonic (MN63F805MNP), NBA Macronix 128K (MX29L010): both pass pattern 0000 | | Backup LIB sample: Flash, 0000 then 55AA in one session (erase before program), five chips | 5/5 | 5/5 | | | | Backup LIB sample: EEPROM (512 B), six patterns | 6/6 | 6/6 | | both fail ("WRITE ERROR. C001"): neither fits the EEPROM for this ROM | | Pokémon Emerald accepts the clock (main menu, no battery message) | pass | pass | (accepted) | mGBA: menu; NBA's driver (no clock): "The internal battery has run dry" | | Emerald with the clock removed shows the battery message (the judge's own failure case) | pass | pass | | | The retail single-pattern cases (44) were measured at the working tree just before `7fcb7a6`, which differs only in the judge now also requiring the device name the sample prints; the names it printed then were the ones now required (MN63F805MNP, LE39FW512, MX29L512, LE26FV10N1TS_10, MX29L010). The two-pattern cases and the whole free-BIOS table ran at `7fcb7a6`. The detectors cannot be told which chip to fit (their drivers have no option), so their sample results say which chip each emulator picks for a ROM naming all four libraries, not how well it emulates the others. What rung 2 found and fixed: - **EEPROM requests and /CS** (docs/cartridge.md "EEPROM"): the sample's library makes four single CPU accesses to the EEPROM before its first DMA request; the board kept their bits and never parsed a request ("VERIFY ERROR. 8000" on all patterns). A write with a fresh /CS now starts a new request (HYPOTHESIS consistent with GBATEK's hedged reason, U-CART-3). - The board crashed when the sample read the backup bus of an EEPROM cartridge (no `read8`): it now reads FF there (HYPOTHESIS). - Built new: Flash chip selection and Atmel pages, EEPROM busy time, the GPIO port and S-3511, battery files. **Rungs 0-1 re-run at `a9924ca`** (rung 2 touched `bus.py`'s cartridge access): screen verdicts 77/137 retail, 74/137 free; the mGBA suite's thirteen groups identical to `2504e88` with both BIOSes (retail: all graded groups full, SIO R/W 25/90, SIO timing 0/8, misc. edge 8/12; free: memory 1,506, timing 1,900, count-up 847, BIOS math 603, misc. edge 7/12); hw-test 10/11 ROMs with both (haltcnt 5/6 retail, 1/6 free). The script counted 57/58 result lines retail where status.md had 56/57 at `2504e88`: the same ten ROMs pass and haltcnt fails the same one line, so the difference is one more PASS line counted on a passing ROM (not investigated). The krom BIOS tests and Hades-Tests (judged by eye) were not re-run. **Seeded faults (rung 2)**, retail BIOS, at the commit before `a9924ca` (the two re-run faults at `a9924ca`): **14 of 14 caught**, 13 by `board_saves.py` cases. The EEPROM's fresh-/CS rule, ready bit, four ignored bits and 6-bit address mask (lib-eeprom); Flash ID mode (the sample prints "DEVICE: UNKNOWN"), sector erase (the 0000-then-55AA case), programming that only clears bits (lib-flash); RTC detection, the command's bit order, LSB-first data, BCD, the port's SIO input and the control register's read (emerald-rtc). `rtc-pm-flag-24h` (no PM flag in 24-hour mode) passes Emerald: a blind spot, caught only by the model test `test_rtc_reads_date_and_time_in_bcd`. The first run missed `rtc-detected` because the Emerald case forced the clock on; the case now fits it by detection, as a player's run does, and catches it. **Blind spots and limits**: the RTC's PM flag (above); the Atmel chip (the sample's library does not know `3D1F`; model test only); the 8 KB EEPROM (the sample tests 512 B only; model test only); EEPROM busy length and Flash durations (the sample polls, so any length passes); the RTC's 12-hour mode, time-only register, force reset and power flag (Emerald reads the clock in 24-hour mode at power-on; model tests only); RTC IRQs (not modelled). Persistence across a power cycle is checked by a model test (`test_battery_round_trip`); the aging cartridges' EEPROM settings test (rung 6) is the planned hardware-side judge. ## Rung 3: the picture, a line at a time (2026-11-21) Measured on branch `rung-3` (renderer as of `4b80ff4`), PyPy 7.3.23, on a shared machine. Commands: ```sh python scripts/hw_pictures.py [--bios "$BIOS"] # hw-test pictures against their expected images python scripts/board_pictures.py --jobs 8 # picture test ROMs against NBA (detector) python scripts/build_scenes.py && python scripts/board_pictures.py --scenes --frames 120 python scripts/board_pictures.py --bios "$BIOS" --frames 900 GAME.zip ... # game title screens ``` ### hw-test pictures (class H) | ROM | Expected picture | Board | NBA (`OBSERVED`) | | --- | --- | --- | --- | | ppu/bgx | a clean 4.5x capture (origin not stated): white column at dot 129, dot 0 on line 0 | **match**: 129 on lines 1-159, dot 0 on line 0 | column at 130 (one dot off) | | ppu/bgpd | camera photograph of a console: two bands, edges at line 75.0-75.8 and about 146 | **match in kind**: two bands, edges at 75 and 149 | 76 and 151 | | ppu/dispcnt-latch | a clean 2.5x capture: per-line classes of lines 0-81 | **82/82 lines** (after the two-line enable latch; 76/82 before it) | 82/82 | | ppu/greenswap | camera photograph: the swap stops about a third into each line (the DMA writes 0 mid-line) | whole lines swapped: **mid-line, rung 4** | swaps the left part only, like the photograph | | ppu/sprite-hmosaic | an NBA 1.8.2 screenshot (detector, U-VID-10) | 680 dots differ, at the mosaicked OBJs | (its own picture) | The second bgpd edge: the photograph reads 145.7-145.9 whether its scale is taken as linear or corrected for perspective from the screen's width; the board's 149 and NBA's 151 are both off by more than the first edge's agreement. With a constant PD per line both emulators put the second edge at twice the first; the photograph does not. Left open (the photograph's geometry, or a per-line variation the line model lacks). ### Picture test ROMs against NBA (detector), free BIOS, 300 frames Identical: destoer `hello_world`, `if_ack`, `isr`, `cond_invalid`; jsmolka `ppu/hello`, `shades`, `stripes`; alyosha-tas `ppu/hello`, `shades`, `stripes`; hw-test `dispcnt-latch` (11 of 22). Differences, all leads and none fixed toward NBA: | ROM | Dots | What differs | | --- | --- | --- | | hw-test bgx, bgpd | 318, 12,480 | as above (the board matches the expected pictures at least as well) | | hw-test greenswap | 16,218 | the mid-line switch-off (rung 4) | | hw-test sprite-hmosaic | 680 | OBJ mosaic block edges (U-VID-10) | | alyosha-tas stripes_x_offset | 205 | two lines whose scroll is written mid-line (rung 4) | | alyosha-tas Sprite_Disable_Midline, _on_VRAM_Access | 893 | mid-line OBJ disable and the budget's edge (rung 4; U-VID-14) | | destoer window_midframe | 5,999 | the window's vertical flag across a mid-frame write (U-VID-8, rung 4); destoer's 240x160 expected.png agrees with NBA | | destoer lyc_midline, line_timing, dma_priority | 83, 6,810, 18 | printed numbers and frame phase (timing, rung 1/4), not drawing | ### Scenes against NBA (detector), free BIOS, 120 frames Our own programs (`tests/scenes/`); 22 scenes. Identical: `text`, `affine1`, `affine2`, `bitmap3`, `bitmap4`, `bitmap5`, `objaffine`, `textoverflow`, `mode6`, `greenswap` (10). Identical but for colour-effect rounding (no channel off by more than one step): `blendalpha`, `blendbright`, `blenddark`, `windows` (U-VID-9: NBA is a step brighter in alpha and brighten, a step darker in darken). Differences (dots off by more than a step): | Scene | Dots | Lead | | --- | --- | --- | | objorder | 1,156 | OBJ-to-OBJ priority: the board follows GBATEK and Tonc, NBA orders by priority first (U-VID-12) | | objs1d, objs2d | 390, 454 | the same priority rule where a Y-wrapped OBJ overlaps; a shape-3 OBJ NBA draws (U-VID-5); 2D mapping past tile column 31 (U-VID-15, objs2d only) | | objbudget, objbudgetfree | 1,000, 512 | NBA draws one OBJ more than GBATEK's cycle count allows (U-VID-14) | | wingarbage | 13,038 | X1>X2 and Y1>Y2: the board follows GBATEK (X2=240, Y2=160), NBA wraps (U-VID-8) | | blendalpha2 | 208 | NBA blends a backdrop-only dot with the backdrop (U-VID-13) | | mosaic | 90 | edges of a mosaicked affine OBJ (U-VID-10) | ### Game title screens against NBA (detector), retail BIOS, 900 frames Minish Cap, Metroid Fusion, Mario Kart Super Circuit, Golden Sun, Castlevania Aria of Sorrow, F-Zero Maximum Velocity, Pokémon Emerald, Advance Wars: all eight draw their screens correctly by eye. Identical: Castlevania, Golden Sun, Advance Wars; rounding only: Mario Kart, F-Zero; the rest differ where an animation is at another phase (Minish Cap's light beams, Emerald's ripples, Metroid's stars), the two emulators' frames not being in step. ### Rungs 0-1 re-run on `rung-3` Retail and free BIOS, the commands of "The board (rungs 0-1)": the 137 screen-verdict ROMs 77/137 and 74/137, **identical ROM by ROM** to the appendix; the mGBA suite groups and hw-test's text ROMs unchanged (10/11 both, haltcnt 5/6 retail, 1/6 free); unit tests 70 passed. hw-test pictures 3/3 with either BIOS. (Verdicts are now read from the line renderer's frame instead of the rung-0 viewer.) ### Seeded faults (rung 3) `scripts/seeded_faults.py` (the rung-3 entries, judges `hwpic` and `pic`): **41 of 42 caught**. Each rule's fault goes to a hw-test picture (affine advance and copy, display latch, forced blank, frame hand-over: 8) or a scene against the detector (34); a scene fault is caught when more dots differ from NBA than on the unchanged board. Missed: `obj-budget-affine-cost` (affine OBJs costing n instead of 10+2n), because drawing more OBJs moves the board toward NBA, which already draws one more: a blind spot of a detector judge, recorded. `obj-budget-total` (1,210 → 2,420) is caught. ## Rung 4: the picture dot by dot, and video-memory waits (2026-11-21) Measured on branch `rung-4` (PyPy 7.3.23, a heavily shared machine). What was built: docs/video.md "The dot model as built". Commands: ```sh python scripts/hw_menus.py status [--bios "$BIOS"] # hw-test ppu/status-irq-dma (menu driven) python scripts/hw_menus.py pram # ram-access-timing's PRAM patterns python scripts/hw_menus.py map 6,1 # print one stall map (Sprite, VRAM), by eye python scripts/hw_menus.py lyc --bios "$BIOS" # destoer lyc_midline's numbers python scripts/hw_pictures.py # + greenswap, mode3, mode4, window_midframe python scripts/lockstep_pictures.py # dot model against rung 3's line renderer python scripts/judge_text.py --emu board --bios "$BIOS" reference/src/gba-tests-alyosha/ppu/*.gba ``` ### The judges (before = master `79d9f7f`, after = `rung-4`) | Judge (class) | Before | After | Notes | | --- | --- | --- | --- | | hw-test `ppu/status-irq-dma` (H), 12 lines (DISPSTAT 5, VCOUNT 1, IF 3, DMA 3) | 2/12 (IF H-blank, IF V-count) | **12/12** | the line's edges, docs/video.md; with the free BIOS (the lines are differences from an H-blank IRQ, so the BIOS does not enter) | | hw-test `ppu/ram-access-timing` PRAM options against the author's comments (H, prose) | 1/11 (no waits at all: only "Mode 3" 0000) | **11/11** | the Mode 0/2/3/4/5 and Sprite stall maps have no stated expectation: printed, read by eye (`map`) | | hw-test `ppu/greenswap` photograph (H) | fail (whole lines swapped) | **pass** (swap ends at dot 80; photograph 78-81) | | | hw-test archive `mode3`, `mode4` photographs (H, DS-family, archived "unfit") | fail (no pattern: no mid-line VRAM) | **pass, pass** | edges 121/181, mode3's lines alternating 121 and 123 as the photograph's alternate | | hw-test `bgx`, `bgpd`, `dispcnt-latch` (rung 3's) | 3/3 | **3/3** | bgpd's edges 75 and 149 | | destoer `window_midframe` against its expected.png (H?: origin not stated) | 5,999 dots differ from NBA, the same from expected.png | **identical, 38,400/38,400** | NBA identical too | | destoer `lyc_midline` photograph (H, DS), retail BIOS: vcount, lyc count, rapid-toggle length, first part | 2/4 (vcount, first part) | **4/4** | the rapid toggle's absolute start and end read DC22, E0C1 against DC0B, E0AA: the printing in between is 23 cycles slower (text-BG waits, U-VID-11) | | alyosha-tas `ppu/*` text verdicts (H), 6 ROMs | 0/6 retail, 0/6 free | **0/6 retail, 1/6 free** (`Sprite_Last_VRAM_Access_Free`) | the rest wait on the boot's length (U-VID-16): `start_up*` read the line at the cartridge's start; `Sprite_Last_VRAM_Access` (175 vs 0x8E) and, with Nintendo's BIOS, `_Free` (119 vs 0x78: its load lands 9 cycles past the OBJ fetch) sit at VCOUNT-poll phases the boot sets | | alyosha-tas `stripes_x_offset` against NBA (D) | 205 dots | **4 dots** (1 on line 45, 3 on line 90) | no stored expectation | | alyosha-tas `Sprite_Disable_Midline`, `_on_VRAM_Access` against NBA (D) | 893, 893 | 842, 842 | NBA draws 12 dots of one more OBJ beyond the 1,210-cycle budget (U-VID-14, NBA's) | | hw-test `greenswap` against NBA (D) | 16,218 | 956 | NBA ends the swap elsewhere; the board follows the photograph | | picture ROMs identical to NBA (D) | 11/22 | **12/22** | + window_midframe | ### Lockstep against rung 3's line renderer `scripts/lockstep_pictures.py` (free BIOS; the 22 picture ROMs at 300 frames, the 22 scenes at 120): **1,241,673 of 1,241,673 quiet lines identical** in 44 runs; lines that were not quiet (a picture write from the previous line's origin to the line's end) are counted, not compared; 16,755 quiet lines in `window_midframe`, `windows` and `wingarbage` were set apart because the window's vertical flag and rung 3's per-line compare differ there by design (U-VID-8). The OBJ budget's edge (U-VID-14) was changed in both renderers, so it does not show here. ### Scenes against NBA (detector), free BIOS, 120 frames Identical as at rung 3 (10/22, and the four rounding-only scenes); closer to NBA: `objbudget` 824 dots (rung 3: 1,000) and `objbudgetfree` 336 (512), from the partly fitting OBJ's dots (U-VID-14); `wingarbage` 1,692 (13,038), from the window's vertical flag (U-VID-8: what is left is X1>X2, which the board still reads as GBATEK says). The rest unchanged (`objorder`, `objs1d`, `objs2d`, `blendalpha2`, `mosaic`). ### Seeded faults (rung 4) `scripts/seeded_faults.py` (the 32 rung-4 entries; free BIOS except `lyc`, which uses Nintendo's BIOS): **23 of 32 caught**, run on the working tree just before `93f21e5` (which differs from it only in formatting and one equivalent rewrite of a `min`). By judge: status-irq-dma catches the eight line-edge and capture faults; `lyc` the LYC write's match; hw-test pictures the reference latch (bgx), the fetch start and the VRAM write's catch-up (mode3), green swap's delay and its write log (greenswap), the window flags' set and clear (window_midframe); `Sprite_Last_VRAM_Access_Free` the OBJ fetch's start, the partly fitting OBJ, the OBJ VRAM reads and the one-cycle wait (waiting until free gives 121); the PRAM patterns the top and second palette reads; NBA's pictures the one-line-ahead fetch (objaffine) and the register write's catch-up (stripes_x_offset); the lockstep the line renderer's partial OBJ. - Equivalent mutant (not counted against): `pram-read-cycles` swaps the two palette read cycles; the comments give the pattern on an unstated phase, so the judge reads every option on option 0's phase and the swap rotates all of them alike. - **Blind spots** (rules no passing judge exercises): the BG enable and forced blank tested at the dot (hw-test `dispcnt-latch` writes DISPCNT before the line's first fetch; ram-access-timing's "DISPCNT latch" sub-tests print DMA times with no expectation); the OBJ fetch's current-enable rule (in `Sprite_Disable_*` the cut fetch feeds a line the display latch hides anyway); the text, affine and bitmap BG VRAM reads and the affine OBJs' OAM reads (U-VID-11: no hardware stall map is stored; `lyc_midline` bounds the text rule's total but its start value is not judged because no rule fits it). **Rung 3's picture faults since the dot model** (the same script): the board now draws with `ppu/dots.py`, so a fault in a rule only `ppu/line.py` holds is judged by the lockstep on the same ROM, and the rule's copy in `dots.py` gets a mirrored fault with rung 3's picture judge (`RUNG3_MIRRORS`; constants and helpers both use keep their picture judge): **72 of 74 caught**. Missed: `obj-budget-total` and `obj-budget-affine-cost-dots`, because drawing more OBJs moves the board toward NBA, which draws past the budget: the detector blind spot rung 3 recorded, now covering the total budget too (no passing hardware judge reads the 1,210-cycle budget: `Sprite_Last_VRAM_Access` fails for U-VID-16's reason). ### Rungs 0-3 re-run on `rung-4` (`93f21e5`) | Judge | Rung 3 / merge | Rung 4 | What changed | | --- | --- | --- | --- | | 137 screen-verdict ROMs, retail | 77 | **76** | `Interactions/Internal_Cycle_DMA_IRQ_Br_pre` pass → no verdict. The ROM never syncs to the picture: its H-blank DMA lands where Nintendo's boot leaves the line phase. It passes with `POWER_ON` 0 or 4 and hangs with 3; the boot's length is itself wrong (U-VID-16), so the phase is not fitted to it. Changed numbers on failing ROMs: `DMA_pause_timing_end_1`, `_end_3`, `_mid_1` 246 → 248, `Internal_Cycle_DMA_IRQ_Br_pre_tim` and `_TIM_Br_pre` 255 → 19, `Sprite_Last_VRAM_Access` 173 → 175, `start_up_vbl_irq_halt` 26 → 27 | | 137 screen-verdict ROMs, free | 74 | **76** | gained `DMA/DMA_Mode_Change` and `ppu/Sprite_Last_VRAM_Access_Free`; changed numbers on failing ROMs: `Internal_Cycle_DMA_Mul` 43 → 37, `Sprite_Last_VRAM_Access` 157 → 175, `start_up_vbl`, `_irq`, `_irq_halt` 72/41/28 → 216/193/187, `timer/timer` 1 → 9 | | `board_saves.py`, retail | 49/49 | **49/49** | | | hw-test text ROMs, retail | 10/11 (haltcnt 5/6) | **10/11** (haltcnt 5/6) | | | hw-test pictures, both BIOSes | 3/3 | **7/7** | the four rung-4 judges added | | mGBA suite, retail | graded groups full; SIO R/W 25/90, SIO timing 0/8, misc. edge 8/12 | graded groups full; 25/90, 0/8, **misc. edge 6/12** | the "H-blank bit start" Flip cases: the board's polling loop now sees the H-blank flag's edges where hw-test status-irq-dma (class H) puts them (Flip 1 reads 0x80, was 0x88, the suite expects 0x87); not caused by the video-memory waits (the same with them off). The suite is not hardware-calibrated (owner's ruling, 2026-11-20): the H judge stands | | unit tests | 93 | **98** | `tests/test_dots.py` (5 model guards) | ### Speed PyPy 7.3.23, `python -m gba_python GAME --bios --frames 900` (boot and title), user CPU seconds, best of alternating runs on a shared machine (load 11-80): Castlevania - Aria of Sorrow 11.3 (master) → 13.4 (rung 4), 12.5 → 14.9 ms a frame, +19 %; Golden Sun 12.5 → 16.1, 13.9 → 17.9 ms a frame, +29 %. Real time is 16.7 ms a frame. Most of the cost is the dot model's per-span drawing and the catch-up checks on every video-memory write; the CPU core still dominates a profile of Golden Sun's title (text drawing 2 % of the time). ## The Timer count-up drop on the reset core (2026-11-23) On arm7tdmi-python `3382b32` the mGBA suite's "Timer count-up" fell to 712/936 (free BIOS; 801 with Nintendo's) from 847 (936) on `69aceb2`; nothing else moved. MEASURED by running, not by reading the old core: - **Where.** The failures are the 2- and 4-interrupt rows (suite src/timers.c `runTest`: the timer's IRQ handler runs `irqs` times while a loop counts). They cost one loop instruction per interrupt, the sign of an IRQ taken one instruction later after the handler's return. - **Which rule.** The reset core's U14 gated the interrupt lines by the I/F bits in force at the start of the previous instruction, for setting and clearing alike. Three variants were run (a test-only patch of the core's `_step`): both late (the reset core), both at once, and setting late with clearing at once. - **Which side is right** (hardware-captured judges, Nintendo's BIOS): | Judge | both late (`3382b32`) | both at once | setting late, clearing at once (`4f1822c`) | | --- | --- | --- | --- | | alyosha-tas `psr` ("timing of disabling interrupts when disabling via S bit set") | pass | **fail 250** | pass | | alyosha-tas `irq/IRQ_sub` (the handler returns through the BIOS at 0x138 with the next IRQ pending: "return, which should trigger another interrupt") | **fail 251** | pass | pass | | alyosha-tas `irq/IRQ_sub_slow` | **fail 244** | pass | pass | | mGBA suite Timer count-up (not calibrated, owner 2026-11-20; recorded only) | 712 free / 801 retail | | 847 free / 936 retail | | the other 134 screen-verdict ROMs (free BIOS) | | unchanged | unchanged | The free BIOS has other code at 0x138, so IRQ_sub fails there with every variant (237-240). TRM 2.8.4 reads the same way (`DOC`): with F clear the core "checks for a LOW level on the output of the FIQ synchronizer at the end of each instruction". - **The fix** went upstream: arm7tdmi-python `4f1822c` (U14 rewritten, test `test_irq_mask_change`, its gates unchanged: pytest 507, sst_gate 2,192,923/2,192,923), and gba-python repinned (`b7012c2`). The board's timer was not the cause and is unchanged. ## Rung 5: sound (2026-11-23, `7a80624`) Built: the mixer and SOUNDBIAS output, and the FIFOs' sound-off rules ([sound.md](sound.md) "As built"). The FIFOs, their DMA requests and the PSG register map were already there (rungs 0-1). ### Judges | Judge | Class | Before (`289b977`, core `3382b32`) | After (`7a80624`, core `4f1822c`) | | --- | --- | --- | --- | | alyosha-tas `fifo_dma/*`, 9 ROMs, free BIOS and Nintendo's | H | 3/9 (fifo_3, fifo_dma_disable_3, _5) | 3/9, the same three; fifo fail 2, fifo_2 fail 110, fifo_4 111, fifo_5 59, fifo_6 149, fifo_dma_disable_4 101 (either BIOS) | | the 137 screen-verdict ROMs | H | 80/137 free | 80/137 free, 81/137 retail | | unit tests of the rung's rules (`tests/test_sound.py`) | model | | 8/8 | | NanoBoyAdvance output levels (detector) | D | not available | not available: its driver writes pictures and registers only, and mGBA's documented scripting interface (0.10.2) has no audio either | | the aging cartridges' sound tests | R | rung 6 | not run | fifo.gba now behaves as its comments say a console did in test 2 (a DMA at the first overflow, as the FIFO loaded nothing while sound was off), but its timer readings differ: 62 and 8C against 68 and 8B (`TIM1CNT` after the first FIFO DMA, then after the second). The CPU sees the first FIFO DMA six cycles shorter than the console did. A sweep of the delay from the request to the DMA (0-8 cycles, `dma.FIFO_DELAY`, tried and not kept) passed no more ROMs. The FIFO DMA's cycle timing is open (U-SND-6, and rung 1's DMA fits). Recordings (`--wav`, Nintendo's BIOS, 900 frames): the boot jingle and then the games' music for Castlevania: Aria of Sorrow and Golden Sun, and krom's `Sound/PCM/Stereo` (run only). They show the output runs, with no clipping beyond the start, where SOUNDBIAS is still 0. They are no judge of levels (U-SND-9, U-SND-10). ### Seeded faults (rung 5): 9/9 caught | Fault | Judge | | --- | --- | | FIFO timer select inverted | alyosha-tas fifo_3 (fail 116) | | request at < 16 bytes instead of <= 16; peek instead of pop | `test_fifo_pops_and_asks_at_16_bytes` (fifo_3, fifo_dma_disable_3 and _5 miss both: blind spots) | | FIFO writes while sound off; FIFOs kept at sound off | `test_fifo_writes_while_sound_off_load_nothing`, `test_sound_off_empties_the_fifos` (fifo.gba fails earlier for its timing: blind spot) | | PSG scale, FIFO 50 % scale, clip at 7FFh, resolution cut | the level and mixer unit tests (no hardware judge: blind spots) | Not seeded: `mix()`'s sound-off branch, an equivalent mutant: the FIFOs are emptied and the PSG reset at sound off, so removing it changes nothing. ### Speed Recording is off unless a host asks. With it on, 900 frames of Castlevania (free BIOS) took 22.4 s of CPU against 16.8 s without (best of two each, a shared machine), about 6 ms more a frame (PyPy). ### Rungs 0-4 re-run (2026-11-23, `7a80624`, core `4f1822c`) | Judge | Result | Before (rung 4, `93f21e5`, core `69aceb2`) | | --- | --- | --- | | mGBA suite, retail BIOS | memory 1,552, I/O 130, timing 2,020, count-up **936**, timer IRQ 90, shifter 140, carry 93, multiply long 72, BIOS math 615, DMA 1,244 (all full); SIO R/W 25/90, SIO timing 0/8, misc. edge 6/12 | the same | | mGBA suite, free BIOS | memory 1,506, timing 1,900, count-up **847**, BIOS math 603, misc. edge 5/12, the rest as retail | count-up 847 (712 on `3382b32`) | | screen verdicts (137 ROMs) | 80/137 free, 81/137 retail | 76 / 76; the four LDM^ tests pass since the core reset (`3382b32`: 80 free) | | hw-test text ROMs | 10/11 both BIOSes (haltcnt 5/6 retail, 1/6 free) | 10/11 | | `board_saves.py` (retail) | 49/49 | 49/49 | | hw-test pictures + window_midframe (retail) | 7/7 | 7/7 | | hw-test status-irq-dma (retail), PRAM patterns, destoer lyc_midline (retail) | 12/12, 11/11, 4/4 | the same | | lockstep, dot model against the line renderer (free BIOS) | 872,021/872,021 quiet lines, 22 picture ROMs | 1,241,673: the 22 scenes were not run (their folder is not built on this checkout) | | unit tests (PyPy) | 106 passed | 98 (core `3382b32`) | | core gates (arm7tdmi-python `4f1822c`) | pytest 507 passed (3 cases new); sst_gate 2,192,923/2,192,923 | sst_gate unchanged | Not re-run: the full seeded-fault set of rungs 0-4 (only rung 5's), and the scenes and title screens against NBA. ## Rung 6: Nintendo's aging cartridges (2026-11-23, `d493b46`) The judges are the five No-Intro dumps in `$NO_INTRO_DIR` ("AGS Aging Cartridge" v7.0 (Rev 1), v7.1, v9.0 (Rev 3), v10.0, and "AGB Aging Cartridge"), class R: Nintendo's own test programs, run in place and judged by what they print, never disassembled or read. A working console is expected to pass them (that is what they are for); no console was run here, so a pass is a `TEST ROM` verdict of the program on its intended hardware, not a measurement. ```sh python scripts/board_aging.py --bios "$BIOS" --out OUT # all five, PNGs and PASS/FAIL ``` Each AGS cartridge gets three power cycles sharing one battery file (scripts/board_aging.py): (1) a blank EEPROM, where it must print "CHECK SUM ERROR! DEFAULT IS SAVED."; (2) L+R held at power-on opens its menu (CONFIGURATION, TEST PROGRAM, OPTION PROGRAM); in CONFIGURATION the AGING TIME is moved one step (v7.x: 03:00:00 to 03:30:00; v9.0, v10.0: 01:00:00 to 01:30:00) and A saves it; (3) a plain power-on: the automatic tests run at once (no checksum message: the settings were read back), and START begins the aging run, whose clock shows the target time. The AGB cartridge opens on SELECT TARGET; AGING CARTRIDGE (down twice, A) runs its tests from a blank EEPROM. The script reads PASS (green) or FAIL (red) from each result line; the aging clock is read by eye from the saved picture. ### Results | Cartridge | Blank EEPROM message | Setting kept across a power cycle | Automatic tests, before (`1984ad6`) | after (`d493b46`), Nintendo's BIOS | after, free BIOS | | --- | --- | --- | --- | --- | --- | | AGS v7.0 | yes | 03:30:00 | DMA FAIL, INTERRUPT FAIL | all PASS | all PASS | | AGS v7.1 | yes | 03:30:00 | DMA FAIL, INTERRUPT FAIL | all PASS | all PASS | | AGS v9.0 | yes | 01:30:00 | DMA FAIL, INTERRUPT FAIL | all PASS | all PASS | | AGS v10.0 | yes | 01:30:00 | DMA FAIL (tests 7, 9), INTERRUPT FAIL (test 7) | all PASS | all PASS | | AGB | (no checksum screen) | (no CONFIGURATION run) | DMA FAIL, INTERRUPT FAIL | all PASS | all PASS | "All PASS" is MEMORY, LCD, TIMER, DMA, KEY INPUT and INTERRUPT; COM prints only "-" (its tests need a link partner) and so does the AGB's KEY INPUT, on the board and on both detectors. The archived board's target (handoff-brief.md: 5/5 automatic, 5/5 settings) is reached: 5/5 automatic, 4/4 AGS settings (the AGB was not put through a CONFIGURATION cycle). Detectors (closed boxes, Nintendo's BIOS, A pressed past the checksum screen, `OBSERVED`): NanoBoyAdvance 1.8.3 passes all automatic tests on the four AGS and the AGB; mGBA `fd9dc5c` fails MEMORY test 7 on all five and passes the rest. The board's AGB result screen is identical to NBA's by eye. ### The failing tests and the rules they implicated What each failing test does was learned by logging the I/O register writes the board saw while the cartridge ran (an I/O-bus logic analyser's view; the cartridge's code was not read), and locating the test by the moment its result mark was written to the text buffer. | Test | What it does (I/O writes seen) | Rule implicated | Fix and evidence | | --- | --- | --- | --- | | DMA 7 | DMA3 in video capture mode (CNT B300_0001: special timing, repeat, source fixed, 16-bit, 1 unit) copies VCOUNT (04000006) into EWRAM from line 0; the program writes 0 to DMA3CNT_H at line 162 of the *next* frame | does a capture stop at VCOUNT 162? The board kept DMA3 enabled and restarted it at line 2: 320 transfers (lines 2-161 twice) | DMA3's enable clears at VCOUNT 162 (`dma.end_capture`): GBATEK "it gets stopped when VCOUNT=162" and "Capture Enable=AutoCleared ???" (`DOC`, with GBATEK's doubt) and this test (`TEST ROM`). Provisional: the test shows the second frame is not captured; a channel kept enabled but not restarted would also pass (U-DMA-3) | | DMA 9 | three frames, one per pair (0/1, 1/2, 2/3): the higher channel in H-blank timing (CNT A100_0008: source fixed, 8 units) and the lower one immediate (8100_0200: 512 units), both copying TM0CNT_L into EWRAM, so the H-blank DMA preempts the immediate one in line 0 | what a preemption costs. The board spent the preempting channel's two internal cycles (`START_IDLE`, `END_IDLE`): gaps of 5 cycles in the timer values either side of the higher channel's 8, against 4 within a run | a channel that takes the bus from a lower one between two units spends neither internal cycle (`dma.NESTED_IDLE = 0`; `TEST ROM`). Skipping only the first or only the last still fails. Provisional (U-DMA-2): the cartridge's check is not known, only that it passes with gaps of 4 | | INTERRUPT 7 | IE = keypad (1000h), IME = 1, KEYCNT = C000h (IRQ enable, AND, no key selected), then KEYCNT = 0; the same again with IE = 0 | what AND means with no key selected. The board said false | true: every key is "pressed or not selected" (`keypad.Keypad.condition`; `TEST ROM`). GBATEK's "when ALL of the selected buttons are pressed" (`DOC`) does not decide it (U-KEY-2) | Variants tried and not kept (AGS v10.0, Nintendo's BIOS): FIFO DMA request delays 3-6 (`dma.FIFO_DELAY`) and the H-blank DMA at line origin + 1006: no change to the DMA or INTERRUPT verdicts. ### Seeded faults (rung 6): 3/3 caught | Fault | Judge | | --- | --- | | `capture-ends-at-162`: the capture not ended at line 162 | AGS v10.0 (`aging`): DMA FAIL | | `dma-nested-idle`: `NESTED_IDLE = 1` | AGS v10.0: DMA FAIL | | `keycnt-and-none-selected`: AND with no key selected false | AGS v10.0: INTERRUPT FAIL | (`scripts/seeded_faults.py --only capture-ends-at-162 --only dma-nested-idle --only keycnt-and-none-selected`, free BIOS: the cartridge's PASS lines fall from 6 to 5 for each; run by hand first, each fault fails exactly the test named above.) Unit tests `test_keycnt_and_with_no_key_selected_requests_at_once` and `test_video_capture_clears_dma3_at_line_162` guard the two register-level rules. ### Rungs 0-5 re-run on `d493b46` Every count unchanged from rung 5: screen verdicts 81/137 retail, 80/137 free; the mGBA suite (retail all graded groups full, count-up 936; free memory 1,506, timing 1,900, count-up 847, BIOS math 603; SIO R/W 25/90, SIO timing 0/8, misc. edge 6/12 retail, 5/12 free); hw-test text 10/11 (haltcnt 5/6 retail, 1/6 free); `board_saves.py` 49/49; hw-test pictures 7/7; status-irq-dma 12/12 ("VIDEO DMA" still 22069: the capture's start is unchanged); PRAM 11/11; lyc_midline 4/4; lockstep 872,021/872,021 (22 ROMs); pytest 108. alyosha-tas DMA, Interactions and timing groups compared with `NESTED_IDLE` 1 and 0: 9/30 both (only the failing pause-timing ROMs' printed values move by one). ### Speed The five cartridges, three power cycles each (about 1,900 frames an AGS), in five PyPy processes: 78 s on a shared machine. ## The FIFO DMA timing study (2026-11-23): open, constraints recorded Rung 5 left alyosha-tas `fifo_dma` at 3/9 (fifo.gba reads TIM1 62/8C where the console read 68/8B). The readings below were taken from the tests' sources and expected values (MIT, hardware-captured per the suite's readme; `TEST ROM`) and the board's bus traces (`scripts/trace_bus.py`); no rule was found that passes more ROMs without losing one, so the board is unchanged. What the expected values say, as cycle arithmetic on the board's own access costs: - **fifo_2 (eight TIM0 reloads, FFDB down to FFD4; EWRAM source, prefetch on).** The console's reading is 0x51 for an overflow at TIM0 start + 37 to + 43 cycles and 0x33 for + 44: a FIFO DMA overflowing at cycle O takes the bus before a CPU access starting at A only when O + 5 <= A (FFD5: overflow 48, the read at 53, DMA first; FFD4: overflow 49, read first). The board's request delay is 2 (`dma.TRIGGER_DELAY`). A delay of 5 (or, equivalently here, a DMA that cannot start during the CPU's internal cycle before a fetch) gives all of fifo_2's first five readings; the sixth then fails through a restart of TIM0 with its counter at FFFF (the tick-before-reload overflow, hw-test `timer/tick-before-reload`), which the console evidently did not hit: its stop write must land a cycle earlier than the board's, so the second DMA of the fifth reading is a cycle too long or late on the board. - **fifo.gba tests 2 and 4 (ROM source, no prefetch).** Two back-to-back TIM1 reads 35 cycles apart (test 2) and 61 apart with four NOPs between (test 4); without a DMA between they would be 10 and 34 apart, so one FIFO DMA steals 25 cycles from the CPU in both, where the board's DMA (an N and three S reads of 32 bits from ROM, 8 + 6 + 6 + 6, four one-cycle FIFO writes and two internal cycles) steals 32. 25 is less than the four ROM reads alone (26): no ordering of the board's accesses gives it. Either the CPU does part of its work during the DMA, or the DMA's cartridge reads are cheaper than the CPU's. - **fifo_5 and fifo_4 (32 bytes written to FIFO A with sound on, TIM0 FFD5, 10 or 20 NOPs).** fifo_5 reads 0x58, 0x5C (no DMA between the reads) and fifo_4 0x5B, 0x7D (one DMA, 30 cycles, between). Ten extra NOPs cost the console 3 cycles before the first read, which a CPU that stops for the whole DMA cannot do: the CPU must run on from the prefetch buffer while a DMA that does not use the cartridge bus (EWRAM to the FIFO) holds the system bus. And fifo_5's first read sits after a DMA, so a full FIFO (32 bytes, GBATEK) asked for data at the first overflow, against GBATEK's "only 4 x 32bits (16 bytes)" request rule (U-SND-4, U-SND-6). Variants run (free BIOS, `--set` on a scratch copy of the board; best of each): | Variant | fifo_dma passes | | --- | --- | | board (request delay 2, 32-byte FIFO, request at <= 16) | 3/9 (fifo_3, disable_3, disable_5) | | request delay 3-7, with or without the FIFO DMA's two internal cycles | 2-3/9 | | 16-byte FIFO, or request at < 32 bytes, with request delay 5 | 4/9 (fifo_2, fifo_5, disable_3, disable_5; fifo_3 lost) | | 20-byte FIFO, or request at <= 24 or <= 28, delays 2-5 | 2-3/9 | None was kept: each trades a passing hardware test for another. The rule the console follows looks like a combination the board cannot express yet: the CPU running from the prefetch buffer beside a DMA, plus a request delay near 5 and a request condition other than GBATEK's. All of it can be settled from these hardware-captured tests without a console; it needs the CPU/DMA concurrency model first (U-IRQ-1's Interactions note is the nearest documented fact). Recorded as U-SND-6 and U-DMA-4. ## The FIFO DMA timing, continued (2026-11-23): fifo_dma 6/9 Three rules, each read from a hardware-captured test's expected values (alyosha-tas `fifo_dma`, MIT; `TEST ROM`) and each provisional, raise fifo_dma from 3/9 to 6/9 (free BIOS; the commit and the retail count are in the table below). The CPU still stops for the whole of any DMA, as GBATEK says ("The CPU is paused when DMA transfers are active"; DOC). **A correction to the study above.** It read fifo_4 as fifo_5 with ten more NOPs. fifo_4 loads 16 bytes into FIFO A (four words, not eight) and runs 18 NOPs (not 20). Re-read, its readings need no CPU running beside a DMA: with the board's own costs its first TIM1 read (0x5B) is exactly where the board puts it with no DMA before it, and the second (0x7D) is 30 cycles (one EWRAM-to-FIFO DMA) later. fifo_4 therefore says the DMA came after the first read, at the FIFO's second overflow, not its first. | Rule | Where | Evidence | | --- | --- | --- | | A request takes the bus 5 cycles after the overflow (was 2): the DMA goes before a CPU access starting at A when O + 5 <= A | `dma.FIFO_DELAY` | fifo_2's eight cases (TIM0 FFDB down to FFD4, an empty FIFO): DMA before the read up to O = A - 5, after it at A - 4. Delays 3, 4, 6, 7 pass 2, 3, 5 (fifo_2 lost: its FFD5 case reads 0x33), 3 of the nine | | The FIFO asks when it held fewer than 16 bytes before the overflow's move (was: 16 or fewer after it) | `sound.REQUEST_BELOW` | fifo_4 (16 bytes: no DMA at the first overflow, one at the second); fifo_2 (after its first DMA, no second DMA before the read) | | A full FIFO (32 bytes) asks as an empty one | `len(fifo) % FIFO_BYTES` | fifo_5 (eight words loaded; its first read sits 29 cycles late, the DMA landing just after its ROM data read). Mechanism (a count that wraps at 32) HYPOTHESIS | | fifo_dma, free BIOS | before (`f5bdbec`) | after | | --- | --- | --- | | fifo | fail 2 | fail 2 | | fifo_2 | fail 110 | pass | | fifo_3 | pass | pass | | fifo_4 | fail 111 | pass | | fifo_5 | fail 59 | pass | | fifo_6 | fail 149 | fail 124 (expects 123) | | fifo_dma_disable_3, _5 | pass | pass | | fifo_dma_disable_4 | fail 101 | fail 101 | The three rules changed nothing else in alyosha-tas DMA, Interactions and irq (50 ROMs run before and after, free BIOS, 300 frames: only the fifo_dma lines moved). What stays open, with what was tried: - **fifo.gba (ROM-source FIFO DMA, no prefetch).** Its built ROM and its source disagree: the `.gba` expects TIM1 0x68 then **0x98** in test 2, the `.asm` 0x68 then 0x8B (the judge runs the `.gba`). With the three rules the board reads 0x62 then 0x6C in test 2. Making every read of a fixed-source DMA from the cartridge non-sequential (8 cycles each, the DMA 38) gives tests 2 and 3 exactly (0x68, 0x98; 0x68), but test 4 then reads 0xB2 against 0xA5: test 4 needs its second DMA to cost the CPU about 25 cycles, less than four ROM reads alone at the CPU's prices, while test 2's costs 38. No fixed DMA cost gives both; test 4's own comment says "unexpected results on hardware". The rule is also against alyosha-tas DMA/readme.txt's account of fixed mode (sequential except after a 128 KB boundary). Not kept (it passes no more ROMs). - **fifo_6** reads TIM1 one cycle late (0x7C against 0x7B) in a DMA-end IRQ's handler. The DMA's IRQ raised one cycle earlier overshoots (0x7A); the prefetcher paused during the DMA (instead of running beside it) gives 0x9F and loses fifo_3. Not kept; the cycle is in the IRQ entry or the prefetcher's state after it (U-IRQ-1, U-TIM-3). - **fifo_dma_disable_4**: the console's write that disables DMA1 lands before the request's DMA; on the board the DMA (due at O + 5) takes the bus first. Without the DMA the board's read is 0x4C against the console's 0x4A, so the board's CPU is about 2 cycles behind the console's in this stretch (six EWRAM loads with the prefetcher on, whose restart after a full pause is FITTED, U-TIM-3). Not chased. - The CPU running from the prefetch buffer beside a DMA was not built: no test now needs it, and GBATEK says the CPU is paused. Seeded faults: one per rule, each caught by the ROM that fixed it (`fifo-request-threshold` by fifo_4, `fifo-full-counts-as-empty` by fifo_5, `fifo-request-delay` by fifo_2); results in the rung 7 re-run below. ## Rung 7: games and a window (2026-11-24, `65f9ebd`) Built: a skip-BIOS start (`GBA.skip_bios`, U-SYS-2), the games runner (`scripts/board_games.py`) and a Tk window (`python -m gba_python.window ROM [--skip]`). The window is a host: it was written and its picture format unit-tested, but it has not been seen on a screen (this machine has no display; Tk 8.6 imports under PyPy). `scripts/board_games.py` runs `tests/smoke_set.txt` (39 ROMs, carried over) from `$NO_INTRO_DIR`, `skip` starts with the free BIOS for SWIs, `bios` starts with Nintendo's, writes each checkpoint picture and classifies the run. Pictures were read by eye; where a picture was blank or looked wrong, mGBA (and once NanoBoyAdvance) ran the same ROM as a detector, booting the free BIOS (about 63 frames longer than a skip start, so their frame N + 63 is compared with the board's frame N). | Verdict (free BIOS for skip starts, Nintendo's for the two bios starts) | First run (`510fb62` + skip, before the affine fix) | `65f9ebd` | | --- | --- | --- | | picture (read by eye: the expected screen for the point in the game; no garbage seen) | 32 | **35** | | blank (one colour) | 5 | 3: Dragon Ball Z LoG II 720, Robot Wars 900, Drill Dozer 720 | | exception (undefined or abort vector) | 1 | 1: Yoshi Topsy-Turvy, frame 115, jumps to F2CE6D28 | | missing (runner could not find the ROM) | 1 (the GBA Video cartridge, in its own No-Intro folder) | 0 | | error (Python exception in the board) | 0 | 0 | The three blanks are where the game is between screens: mGBA shows the same blank at the matching frame (Dragon Ball Z black between the Webfoot logo and its intro at 723; Robot Wars black at 963; Drill Dozer white at 783), and the board's own frames around them show the logos in the same order as mGBA's (Dragon Ball Z: Atari, FUNimation, Webfoot, black). Yoshi Topsy-Turvy fails on both detectors as on the board (mGBA white throughout; NanoBoyAdvance ends with PC at F2559EF0, a wild jump like the board's): the cartridge carries a motion sensor that none of the three models (HYPOTHESIS for the cause). Pokémon Emerald's 720 picture shows the intro's letters again: its intro loops, and the board's frames every 40 show the whole Game Freak sequence in mGBA's order. The first run (before the affine fix) had Pinball Tycoon and Doom blank: Nintendo's BIOS (and the free BIOS) leave BG2PA/PD and BG3PA/PD at 0100, which these games never write; with the skip start's zeros their affine logos sampled one texel. Found by booting the free BIOS first and then applying the skip state (the logo drew), then dumping the write-only LCD registers after each BIOS's boot. Fixed in `skip_bios` (FITTED from the board's own boot). Speed: the machine was shared with load averages of 110-125 on 32 threads throughout, so the runner's milliseconds per frame (44-350) are not the board's speed; the last unloaded measurement is rung 5's. Not run: `tests/games_set.txt` (57 ROMs; long key scripts, hours on this machine); pictures against NanoBoyAdvance frame by frame (the detector boots a BIOS, the board skips it, so frames do not line up exactly). ### Rungs 0-6 re-run (2026-11-24, on `510fb62` and `65f9ebd`) | Judge | Result | Before (`d493b46`) | | --- | --- | --- | | the 137 screen-verdict ROMs, free BIOS | 83/137: fifo_2, fifo_4, fifo_5 now pass, and the count moved by exactly those three (the earlier run's per-ROM list was not kept, so a swap elsewhere is not excluded) | 80/137 | | fifo_dma and unsafe/fifo* (11 ROMs), Nintendo's BIOS | 8/11 (fifo_dma 6/9, the jams 2/2), as free | 5/11 | | the 137 screen-verdict ROMs, Nintendo's BIOS | not re-run in full (stopped at 18: hours under this load); the three rules act only through a DMA1 or DMA2 in sound FIFO mode, so 84/137 is expected, not measured | 81/137 | | mGBA suite, Nintendo's BIOS | graded groups full (memory 1,552, I/O 130, timing 2,020, count-up 936, timer IRQ 90, shifter 140, carry 93, multiply long 72, BIOS math 615, DMA 1,244); SIO R/W 25/90, SIO timing 0/8, misc. edge 6/12 | the same | | AGS v7.0, v7.1, v9.0, v10.0, AGB aging, Nintendo's BIOS | 5/5 every automatic test PASS; checksum message on a blank EEPROM 4/4 (the setting kept across a power cycle, read by eye, not re-checked) | 5/5, 4/4, 4/4 | | FIFO seeded faults | 5/5 (three new) | 9/9 rung 5 | | unit tests (PyPy) | 110 passed | 108 | Not re-run (no FIFO-mode DMA in them, and `skip_bios` is called only by the games runner and the window): hw-test text and pictures, saves, status-irq-dma, PRAM, lyc, lockstep. ## The full retail run and games_set (2026-11-24, `014166f`) No board change in this section; `014166f`'s board is `510fb62`'s plus `skip_bios` and the window, which the text judge does not call. ### The 137 screen-verdict ROMs, both BIOSes, per ROM ```sh python scripts/judge_text.py --emu board --jobs 7 --bios "$RETAIL_BIOS" --json retail.json python scripts/judge_text.py --emu board --jobs 5 --bios free --json free.json # the older commit: the same, with PYTHONPATH=/src ``` | | Nintendo's BIOS | free BIOS | | --- | --- | --- | | `d493b46` (re-measured) | 81/137 | 80/137 | | `014166f` | **99/137** | 83/137 | Every verdict is in `tests/screen_verdicts.tsv` (four columns: BIOS at commit); diff a new run against it to see swaps. Free BIOS: only fifo_2, fifo_4 and fifo_5 changed (and fifo_6's failing number, 149 to 124), as last night's run said. Nintendo's BIOS: those three and 15 ROMs with no FIFO-mode DMA in them: DMA_pause_timing ROM_to_IWRAM, end_1 to end_4, mid_1, mid_2; Interactions Internal_Cycle_DMA_IRQ_Br_pre, _Br_pre_tim, _MUL_IRQ, _Mul, _TIM_Br_pre; irq IRQ_sub_2; ppu start_up, start_up_vbl. Nine more change only their failing number (Internal_Cycle_DMA_IRQ, _7, _ST 248 to 6; _ldr_IWRAM 20 to 32; Sprite_Last_VRAM_Access 175 to 143; start_up_vbl_irq 41 to 49; _halt 27 to 46; timer_reset 1 to 2; fifo_6). Why the retail column moved: Nintendo's boot plays its start-up sound through FIFO DMA (the board makes 7,338 FIFO requests before the cartridge's first instruction), so the FIFO rules of `510fb62` (the request 5 cycles after the overflow, the new request level) change how long the boot takes. Measured with a scratch script that steps the board from power-on to the first opcode fetch from 08000000 (alyosha-tas `ppu/start_up.gba` inserted): cycle 75,998,010 at `d493b46`, 75,997,991 at `510fb62` and `014166f`, 19 cycles earlier. Every retail-BIOS ROM then starts at another phase of the picture, the timers and the sound sequencer. The free BIOS plays no sound, so its column moved only by the FIFO ROMs. What that says about the hardware: alyosha-tas `ppu/start_up` (hardware-captured; the test reads VCOUNT as the boot leaves it, then counts cycles to the next line) now passes: the board's boot ends on the console's line and, to the test's polling loop (a few cycles), at its position in the line (TEST ROM; `d493b46` failed it with 56, which by the source's two failure paths is a timer of 0x38 against 0x44, the VCOUNT path being implausible at 56; not traced). `start_up_vbl` agrees; `start_up_vbl_irq` and `_halt` still fail. The other gains are what the timing ROMs read at a new start phase, not rules learnt; they may swap again whenever anything in the boot's ~76 million cycles moves (the same caution as the Game Boy boards' skip-boot verdicts). The DMA pause-timing and Interactions ROMs that pass only with Nintendo's BIOS are of that kind: their free-BIOS verdicts did not move. ### tests/games_set.txt (57 ROMs) ```sh python scripts/board_games.py --list tests/games_set.txt --jobs 6 --out OUT --json games.json ``` Skip starts with the free BIOS for SWIs (every entry is `skip`), Python exceptions and exception vectors watched, checkpoint pictures written. The pictures were then compared with mGBA `fd9dc5c` (closed box, a detector: `OBSERVED`) booting the free BIOS, its frame N + 63 against the board's frame N, with the key script shifted by the same 63 frames (a scratch script around `mgba_driver`; its key list was raised to 1,024 changes for the longest scripts, `acbc723`). Every pair at a checkpoint where more than 3% of dots differed was read by eye. Per ROM: `tests/games_set_results.tsv`. | Class | ROMs | | --- | --- | | error (Python exception) | 0 | | exception (undefined or abort vector) | 0 | | hang (no picture change, or PC stuck) | 0 seen | | blank at the last checkpoint | 1: Street Fighter Alpha 3 | | picture, the same screen as mGBA at every checkpoint (under 3% of dots differ) | 28 (with SFA3's blank, the same on mGBA) | | picture, the same game at another moment at one checkpoint or more (drift) | 29 | | picture wrong (garbage, a missing layer, wrong colours) | 0 | The drift is the comparison's own slack: the board starts from `skip_bios` (FITTED) while mGBA runs the free BIOS's boot, 63 frames is a rounded offset, and key presses at fixed frames land on different game states once the two drift by a frame (Breath of Fire's presses reach the options menu on mGBA and the game on the board; Pokémon Mystery Dungeon stays on its naming screen on mGBA at 7200). Stuntman is black at 1800 on the board (between screens), and its 2700 and 3600 pictures are one second of race clock from mGBA's. **Street Fighter Alpha 3** is blank at 1800, 2700 and 3600 on the board and on mGBA with the free BIOS (frames 200-1200 too); with Nintendo's BIOS it plays on both (the board's skip start with `--bios` Nintendo's: a round in progress at all three checkpoints; mGBA with Nintendo's BIOS and with its HLE BIOS: pictures). With the free BIOS the game calls SWI 0B (CpuSet) from 080DF240 and SWI 01 (RegisterRamReset) from 080DF244 and then jumps to A8E1ECD4. A free-BIOS difference, not a board one; which call differs is a HYPOTHESIS (RegisterRamReset clearing what the game's return needs). Not chased: the free BIOS is a separate program. Speed under this load (averages 70-105 on 32 threads): 42-244 ms a frame in the runner, not the board's speed. ## The judges by rung | Rung | Judges (class) | How a verdict is read | | --- | --- | --- | | 0 bus, I/O, BIOS calls, timers, IRQ, DMA (function) | jsmolka arm, thumb, memory, bios, nes, save (H?); mGBA suite memory, I/O read, DMA, BIOS math, shifter, carry, multiply (H?); krom BIOS (R); ARMWrestler (R) | `judge_text.py`; `referee_run.py suite` END lines; krom and ARMWrestler by eye | | 1 cycle timing | alyosha-tas Bus, DMA, Interactions, irq, prefetcher, timer, timing, psr (H); hw-test bus, dma, haltcnt, irq, timer (H); mGBA suite timing, timer count-up, timer IRQ (H?); Hades-Tests (R); retAddr (H?) | `judge_text.py`; hw-test by eye (text); suite END lines | | 2 saves and clock | jsmolka save (H?); Backup LIB sample (R); Pokémon Emerald's clock | `judge_text.py`; the sample's screens; the game's screen | | 3 picture by line | hw-test ppu photographs (H); destoer (H for lyc_midline, else none); NBA pictures (D) | by eye against photographs; pixel comparison against NBA's frame | | 4 picture by dot, video-memory waits | alyosha-tas ppu (H); destoer lyc_midline, window_midframe; hw-test ppu (status-irq-dma, ram-access-timing by eye) | as above | | 5 sound | alyosha-tas fifo_dma (H); aging cartridges' sound tests (R); NBA levels (D) | `judge_text.py`; screens; sample comparison | | 6 aging cartridges | AGS v7.0-v10.0, AGB (R); AGBEEG (R) | `scripts/board_aging.py`: their own PASS/FAIL lines, the checksum message on a blank EEPROM, a CONFIGURATION setting kept in EEPROM across a power cycle (by eye) | | 7 games | tests/smoke_set.txt (39), tests/games_set.txt (57) | checkpoint frames: reached, no crash; NBA pictures (D) | Seeded faults (charter "proof obligations"): each rule the board writes gets a one-line fault that one of these judges catches; a rule no judge catches is a recorded blind spot. ## Appendix: per-ROM screen verdicts (detectors `OBSERVED`, 2026-11-19, `scripts/judge_text.py`, 600 frames; the board's two columns at `2504e88`, `scripts/judge_text.py --emu board`) | ROM | mGBA free | mGBA retail | NBA free | NBA retail | board retail | board free | | --- | --- | --- | --- | --- | --- | --- | | jsmolka arm/arm | fail 522 | fail 522 | pass | pass | pass | pass | | jsmolka bios/bios | fail 1 | pass | fail 1 | pass | pass | fail 1 | | jsmolka memory/memory | pass | pass | pass | pass | pass | pass | | jsmolka nes/nes | pass | pass | pass | pass | pass | pass | | jsmolka save/flash128 | fail 10 | fail 10 | pass | pass | pass | pass | | jsmolka save/flash64 | fail 10 | fail 10 | pass | pass | pass | pass | | jsmolka save/none | pass | pass | pass | pass | pass | pass | | jsmolka save/sram | pass | pass | pass | pass | pass | pass | | jsmolka thumb/thumb | fail 230 | fail 230 | pass | pass | pass | pass | | jsmolka unsafe/unsafe | fail 2 | fail 2 | fail 2 | fail 2 | pass | pass | | alyosha-tas Bus/DMA_CPU_Bus_Interaction | fail 1 | fail 1 | pass | pass | pass | pass | | alyosha-tas Bus/DMA_IWRAM_Bus | fail 1 | fail 1 | fail 1 | fail 1 | fail 1 | fail 1 | | alyosha-tas Bus/DMA_OAM_Bus | fail 1 | fail 1 | fail 1 | fail 1 | pass | pass | | alyosha-tas Bus/DMA_Outside_Bios_Bus | pass | pass | pass | pass | pass | pass | | alyosha-tas Bus/LDRSH_misaligned | fail 1 | fail 1 | fail 1 | fail 1 | pass | pass | | alyosha-tas Bus/Unused_location_update_bus | fail 1 | fail 1 | pass | pass | pass | pass | | alyosha-tas DMA/DMA_Mode_Change | pass | pass | pass | pass | pass | fail 48 | | alyosha-tas DMA/DMA_ROM_Fixed | fail 242 | fail 242 | fail 242 | fail 242 | pass | pass | | alyosha-tas DMA/DMA_pause_timing_ROM_to_IWRAM | fail 111 | fail 112 | fail 111 | pass | fail 117 | fail 111 | | alyosha-tas DMA/DMA_pause_timing_end_1 | pass | fail 6 | pass | pass | fail 246 | pass | | alyosha-tas DMA/DMA_pause_timing_end_2 | fail 1 | fail 5 | fail 1 | pass | fail 247 | fail 1 | | alyosha-tas DMA/DMA_pause_timing_end_3 | pass | fail 6 | pass | pass | fail 246 | pass | | alyosha-tas DMA/DMA_pause_timing_end_4 | fail 1 | fail 5 | fail 1 | fail 14 | fail 247 | fail 1 | | alyosha-tas DMA/DMA_pause_timing_mid_1 | pass | fail 6 | pass | pass | fail 246 | pass | | alyosha-tas DMA/DMA_pause_timing_mid_2 | fail 1 | fail 5 | fail 1 | pass | fail 247 | fail 1 | | alyosha-tas Interactions/Halt_DMA_IRQ | pass | fail 184 | fail 12 | fail 184 | fail 184 | fail 12 | | alyosha-tas Interactions/Halt_DMA_IRQ_Read_OAM | pass | fail 184 | fail 12 | fail 184 | fail 184 | fail 12 | | alyosha-tas Interactions/Halt_IRQ | pass | fail 184 | fail 12 | fail 184 | fail 184 | fail 12 | | alyosha-tas Interactions/Internal_Cycle_DMA_IRQ | pass | fail 4 | fail 12 | fail 6 | fail 248 | fail 12 | | alyosha-tas Interactions/Internal_Cycle_DMA_IRQ_7 | fail 6 | fail 4 | pass | fail 6 | fail 248 | pass | | alyosha-tas Interactions/Internal_Cycle_DMA_IRQ_Br_pre | no verdict | fail 26 | pass | pass | pass | pass | | alyosha-tas Interactions/Internal_Cycle_DMA_IRQ_Br_pre_tim | fail 18 | fail 27 | fail 255 | pass | fail 255 | fail 255 | | alyosha-tas Interactions/Internal_Cycle_DMA_IRQ_ST | pass | fail 4 | fail 12 | fail 8 | fail 248 | fail 12 | | alyosha-tas Interactions/Internal_Cycle_DMA_IRQ_ST_p3 | fail 12 | fail 6 | pass | fail 8 | fail 8 | pass | | alyosha-tas Interactions/Internal_Cycle_DMA_IRQ_br | fail 26 | fail 20 | pass | fail 20 | fail 20 | pass | | alyosha-tas Interactions/Internal_Cycle_DMA_IRQ_br1_IWRAM | fail 90 | pass | fail 90 | pass | pass | fail 90 | | alyosha-tas Interactions/Internal_Cycle_DMA_IRQ_ldr_IWRAM | pass | fail 20 | pass | fail 32 | fail 20 | pass | | alyosha-tas Interactions/Internal_Cycle_DMA_IRQ_nop_IWRAM | fail 94 | pass | fail 94 | pass | pass | fail 94 | | alyosha-tas Interactions/Internal_Cycle_DMA_MUL_IRQ | fail 131 | fail 14 | fail 134 | pass | fail 6 | fail 134 | | alyosha-tas Interactions/Internal_Cycle_DMA_Mul | fail 37 | fail 41 | fail 37 | pass | fail 43 | fail 43 | | alyosha-tas Interactions/Internal_Cycle_DMA_TIM_Br_pre | fail 18 | fail 27 | fail 255 | pass | fail 255 | fail 255 | | alyosha-tas LDM/LDM_ALU | fail 2 | fail 2 | fail 2 | fail 2 | fail 9 | fail 9 | | alyosha-tas LDM/LDM_ALU_IMM | fail 2 | fail 2 | fail 2 | fail 2 | pass | pass | | alyosha-tas LDM/LDM_ALU_Store | fail 6 | fail 6 | fail 6 | fail 6 | fail 3 | fail 3 | | alyosha-tas LDM/LDM_Bx | fail 1 | fail 1 | fail 1 | fail 1 | pass | pass | | alyosha-tas LDM/LDM_LD | fail 2 | fail 2 | fail 2 | fail 2 | pass | pass | | alyosha-tas LDM/LDM_MUL_UL_32 | fail 2 | fail 2 | fail 2 | fail 2 | fail 2 | fail 2 | | alyosha-tas LDM/LDM_MUL_UL_SL | fail 2 | fail 2 | fail 2 | fail 2 | fail 2 | fail 2 | | alyosha-tas LDM/LDM_Swap | fail 2 | fail 2 | fail 2 | fail 2 | pass | pass | | alyosha-tas STM_ALU_IMM | pass | pass | pass | pass | pass | pass | | alyosha-tas Serial/serial_read_data | pass | pass | fail 61 | fail 61 | pass | pass | | alyosha-tas Serial/serial_time | pass | fail 131 | fail 143 | fail 143 | fail 142 | fail 142 | | alyosha-tas Serial/serial_time_2 | pass | fail 133 | fail 144 | fail 144 | fail 143 | fail 143 | | alyosha-tas Serial/serial_time_2M | pass | fail 131 | fail 207 | fail 207 | fail 206 | fail 206 | | alyosha-tas Serial/serial_time_2M_2 | pass | fail 133 | fail 208 | fail 208 | fail 207 | fail 207 | | alyosha-tas Serial/serial_time_2M_3 | pass | fail 135 | fail 209 | fail 209 | fail 208 | fail 208 | | alyosha-tas Serial/serial_time_3 | pass | fail 135 | fail 145 | fail 145 | fail 144 | fail 144 | | alyosha-tas Serial/serial_time_start_bit | pass | pass | fail 1 | fail 1 | fail 1 | fail 1 | | alyosha-tas Serial/serial_time_start_bit_2 | fail 1 | fail 1 | pass | pass | pass | pass | | alyosha-tas arm/Coprocessor_14 | fail 107 | fail 107 | no verdict | no verdict | fail 120 | fail 120 | | alyosha-tas arm/arm | fail 522 | fail 522 | pass | pass | pass | pass | | alyosha-tas bios/bios | fail 1 | pass | fail 1 | pass | pass | fail 1 | | alyosha-tas fifo_dma/fifo | fail 2 | fail 2 | fail 2 | fail 2 | fail 2 | fail 2 | | alyosha-tas fifo_dma/fifo_2 | fail 51 | fail 51 | fail 80 | fail 80 | fail 80 | fail 110 | | alyosha-tas fifo_dma/fifo_3 | fail 111 | fail 111 | fail 174 | fail 174 | fail 145 | pass | | alyosha-tas fifo_dma/fifo_4 | fail 95 | fail 95 | fail 124 | fail 124 | fail 95 | fail 111 | | alyosha-tas fifo_dma/fifo_5 | fail 59 | fail 59 | pass | pass | fail 59 | fail 59 | | alyosha-tas fifo_dma/fifo_6 | pass | pass | fail 118 | fail 118 | fail 120 | fail 149 | | alyosha-tas fifo_dma/fifo_dma_disable_3 | pass | pass | pass | pass | pass | pass | | alyosha-tas fifo_dma/fifo_dma_disable_4 | fail 63 | fail 63 | fail 66 | fail 66 | fail 101 | fail 101 | | alyosha-tas fifo_dma/fifo_dma_disable_5 | pass | pass | pass | pass | pass | pass | | alyosha-tas irq/BL_1 | pass | pass | pass | pass | pass | pass | | alyosha-tas irq/BL_IRQ | fail 242 | fail 242 | pass | pass | pass | pass | | alyosha-tas irq/BL_IRQ_2 | fail 2 | fail 2 | pass | pass | pass | pass | | alyosha-tas irq/BL_IRQ_3 | fail 1 | fail 1 | pass | pass | pass | pass | | alyosha-tas irq/BL_IRQ_R14 | fail 1 | fail 1 | pass | pass | pass | pass | | alyosha-tas irq/IE | fail 3 | fail 3 | pass | pass | pass | pass | | alyosha-tas irq/IF | fail 3 | fail 3 | pass | pass | fail 6 | fail 6 | | alyosha-tas irq/IF_Timer | fail 2 | fail 2 | pass | pass | pass | pass | | alyosha-tas irq/IRQ_sub | fail 245 | fail 247 | fail 240 | pass | pass | fail 240 | | alyosha-tas irq/IRQ_sub_2 | no verdict | fail 218 | no verdict | pass | no verdict | no verdict | | alyosha-tas irq/IRQ_sub_2_slow | no verdict | no verdict | no verdict | no verdict | no verdict | no verdict | | alyosha-tas irq/IRQ_sub_slow | fail 235 | fail 239 | fail 229 | pass | pass | fail 229 | | alyosha-tas irq/halt_pc | fail 1 | fail 1 | fail 1 | fail 1 | fail 1 | fail 1 | | alyosha-tas irq/halt_pc_2 | fail 235 | fail 235 | fail 238 | pass | pass | fail 238 | | alyosha-tas irq/halt_pc_3 | fail 232 | fail 232 | fail 236 | fail 237 | fail 237 | fail 236 | | alyosha-tas irq/halt_pc_4 | fail 238 | fail 236 | fail 240 | pass | pass | fail 240 | | alyosha-tas memory/PAL_8_bit_writes | pass | pass | pass | pass | pass | pass | | alyosha-tas memory/VRAM_8_bit_writes | pass | pass | pass | pass | pass | pass | | alyosha-tas memory/memory | pass | pass | pass | pass | pass | pass | | alyosha-tas nes/nes | pass | pass | pass | pass | pass | pass | | alyosha-tas ppu/Sprite_Last_VRAM_Access | fail 159 | fail 143 | fail 175 | pass | fail 173 | fail 157 | | alyosha-tas ppu/Sprite_Last_VRAM_Access_Free | fail 121 | fail 121 | fail 121 | fail 121 | fail 119 | fail 119 | | alyosha-tas ppu/start_up | fail 221 | pass | fail 121 | pass | fail 56 | fail 121 | | alyosha-tas ppu/start_up_vbl | fail 10 | pass | fail 216 | pass | fail 64 | fail 72 | | alyosha-tas ppu/start_up_vbl_irq | fail 81 | fail 41 | fail 193 | fail 49 | fail 41 | fail 41 | | alyosha-tas ppu/start_up_vbl_irq_halt | fail 1 | fail 41 | fail 186 | fail 46 | fail 26 | fail 28 | | alyosha-tas prefetcher/bounday_test_1 | fail 29 | fail 29 | fail 33 | fail 33 | fail 33 | fail 33 | | alyosha-tas prefetcher/prefetcher_boundary_1 | fail 78 | fail 78 | pass | pass | pass | pass | | alyosha-tas prefetcher/prefetcher_boundary_2 | fail 78 | fail 78 | pass | pass | pass | pass | | alyosha-tas prefetcher/prefetcher_boundary_3 | fail 78 | fail 78 | pass | pass | pass | pass | | alyosha-tas prefetcher/prefetcher_boundary_4 | fail 78 | fail 78 | pass | pass | pass | pass | | alyosha-tas prefetcher/prefetcher_branch_thumb | fail 31 | fail 31 | pass | pass | pass | pass | | alyosha-tas prefetcher/prefetcher_branch_thumb_2 | fail 37 | fail 37 | fail 19 | fail 19 | pass | pass | | alyosha-tas prefetcher/prefetcher_branch_thumb_3 | fail 35 | fail 35 | fail 45 | fail 45 | fail 37 | fail 37 | | alyosha-tas prefetcher/prefetcher_branch_thumb_4 | fail 28 | fail 28 | fail 55 | fail 55 | fail 27 | fail 27 | | alyosha-tas prefetcher/prefetcher_branch_thumb_5 | fail 53 | fail 53 | pass | pass | pass | pass | | alyosha-tas prefetcher/prefetcher_branch_thumb_6 | pass | pass | fail 181 | fail 181 | pass | pass | | alyosha-tas prefetcher/prefetcher_branch_thumb_arm | fail 53 | fail 53 | fail 57 | fail 57 | pass | pass | | alyosha-tas prefetcher/prefetcher_branch_thumb_arm_3 | pass | pass | pass | pass | pass | pass | | alyosha-tas prefetcher/prefetcher_branch_thumb_arm_4 | fail 38 | fail 38 | pass | pass | pass | pass | | alyosha-tas prefetcher/prefetcher_dma | fail 44 | fail 44 | pass | pass | fail 55 | fail 55 | | alyosha-tas prefetcher/prefetcher_full_arm | fail 1 | fail 1 | fail 51 | fail 51 | fail 1 | fail 1 | | alyosha-tas prefetcher/prefetcher_full_arm_2 | fail 93 | fail 93 | fail 104 | fail 104 | fail 105 | fail 105 | | alyosha-tas prefetcher/prefetcher_full_thumb | fail 37 | fail 37 | pass | pass | pass | pass | | alyosha-tas psr/psr | fail 1 | fail 1 | pass | pass | pass | pass | | alyosha-tas save/flash128 | fail 10 | fail 10 | pass | pass | pass | pass | | alyosha-tas save/flash64 | fail 10 | fail 10 | pass | pass | pass | pass | | alyosha-tas save/none | pass | pass | pass | pass | pass | pass | | alyosha-tas save/sram | pass | pass | pass | pass | pass | pass | | alyosha-tas thumb/Pop_no_regs | fail 1 | fail 1 | pass | pass | pass | pass | | alyosha-tas thumb/Push_no_regs | fail 13 | fail 13 | pass | pass | pass | pass | | alyosha-tas thumb/blx | no verdict | no verdict | pass | pass | pass | pass | | alyosha-tas thumb/cpy | pass | pass | pass | pass | pass | pass | | alyosha-tas thumb/thumb | fail 230 | fail 230 | pass | pass | pass | pass | | alyosha-tas timer/timer | fail 3 | fail 1 | fail 2 | fail 1 | fail 1 | fail 1 | | alyosha-tas timer/timer_disable | fail 252 | fail 252 | pass | pass | pass | pass | | alyosha-tas timer/timer_reset | fail 1 | fail 1 | fail 1 | fail 2 | fail 1 | fail 1 | | alyosha-tas timing/cpy_data_bios | fail 160 | fail 158 | fail 167 | pass | pass | fail 167 | | alyosha-tas timing/dma_from_bios | fail 12 | fail 12 | fail 112 | pass | pass | fail 112 | | alyosha-tas timing/dma_long | pass | pass | pass | fail 1 | pass | pass | | alyosha-tas timing/prefetch_enable | fail 196 | fail 196 | fail 188 | fail 187 | pass | pass | | alyosha-tas timing/prefetch_enable_2 | fail 199 | fail 199 | fail 190 | pass | pass | pass | | alyosha-tas unsafe/fifo_dma_disable_jam | pass | pass | pass | pass | pass | pass | | alyosha-tas unsafe/fifo_dma_disable_jam_2 | pass | pass | pass | pass | pass | pass | | alyosha-tas unsafe/prefetcher_branch_thumb_arm_2 | fail 65 | fail 65 | fail 69 | fail 69 | fail 65 | fail 65 | | alyosha-tas unsafe/unsafe | fail 2 | fail 2 | fail 2 | fail 2 | pass | pass |