# Validation: every oracle, its tier, and the plan > **Sources (wave 2, 2026-11-19).** byuu's model is cited to **ares** (ISC, > `ares/component/processor/gsu` and `ares/sfc/coprocessor/superfx` at `9408cb4`; notice > in [NOTICE](../NOTICE)), its readable form; bsnes is a closed box and is not cited. > MAME is cited from its BSD-3 files (`bus/snes/sfx.cpp`, `sfx_dasm.cpp`) and from runs > (OBSERVED, MAME 0.285: traces, krom's rows, the rung-4 replays); its GSU file > `cpu/superfx/superfx.cpp` is GPL and a closed box. A **†** marks a statement about > Mesen2, snes9x, the sd2snes GSU or MAME's `superfx.cpp` that was **read from source under > the old rule (before 2026-11-19)**: those are closed boxes from now on, and such a > statement is never the basis of a default. Results of running Mesen2 or MAME are > closed-box observations and carry no mark. ## Oracle tiers The family's rule (z80-python, spc700-python, upd7725-python): rank an oracle by **where its expected values came from**; a lower tier detects, the highest tier that covers a claim decides it. Order of authority for a disputed point: **a console result > fullsnes/anomie > two emulators agreeing > MAME**, with Nintendo's manual (BK2) as the manufacturer tier where it is not shown wrong by fullsnes' hardware notes. Count lineages, not emulators: **ares and MAME carry one core** (byuu's; bsnes too; the licence header of MAME's `superfx.cpp` says "copyright-holders: byuu"), so independent opinions come from **Mesen2**, **snes9x** and the **sd2snes FPGA**. | Tier | Meaning here | What exists | | --- | --- | --- | | **hardware-captured** | values recorded from a real MC1/GSU-1/GSU-2 | **none** (below) | | **hardware-designed self-test** | a check written to pass on production hardware, shown to have run on it | **none shown for this chip**: krom's `GSUTest` is designed as one, but see "krom's tests" | | **manufacturer** | Nintendo's documents | **BK2**: *SNES Development Manual Book II*, Section 2 (registers, maps, execution, the R15-after-STOP table, the fixed vectors, prefixes, cache, buffers with six worked cycle examples, bitmap emulation, the multiplier's algorithm, per-instruction cycle tables). Known errors: C2, C3, C4, C5; disputed: C1, C9 | | **program** | what the shipped games need | 55 dumps of 10 games and their betas (`survey_games.py`); traces show which instructions and settings they use (timing.md) | | **test-author** | expected values written into a self-checking test, not shown to have run on the chip | krom's 31 `GSUTest` ROMs, **1,226 PASS/FAIL rows** | | **research** | community documents from hardware study | fullsnes "SNES Cart GSU-n" (its "Mistakes in book2.pdf", mirrors per VCR, oscillators, the STOP hang); the SNESdev wiki stub | | **die** | a netlist or die model | **none known** | | **emulator** | values an emulator produced | MAME 0.285 (runs here: traces, disassembly, krom), Mesen2 2.1.1 (runs here: krom, pictures), ares (read, ISC); bsnes, snes9x, sd2snes `gsu.v` (read under the old rule†; closed boxes now) | ### What does not exist (searched 2026-11-06) - **No SingleStepTests-style corpus** for the GSU (the organisation covers the 65x02, 68000, 8088, Z80, SM83, SPC700, ARM7TDMI and others; not this). - **No hardware capture** of GSU instructions, buffers or plot timing has been published; snes9x issue #533 (Winter Gold) reports a hardware behaviour at frame level, without the data. - **No console route here**: Aubrey's Super EverDrive X5 has no GSU; a real Super FX cartridge runs only its own game; an FXPak Pro runs RedGuyyyy's FPGA GSU, which is an emulator-tier model. A hardware probe needs a GSU board with a rewritable ROM (an EPROM-modified Star Fox / Stunt Race FX / Yoshi's Island board, or a reproduction board on a donor chip): open decision 9 in the brief. - **The superfamicom.org pages** the SNESdev wiki cites ("Super FX cycle times", "flag clobber table", "acronyms") answered 404 on 2026-11-06; the opcode matrix page answers. So the instruction set has a manufacturer tier (BK2) and a research tier (fullsnes) that corrects it in four places; whole-instruction results have krom's rows at test-author tier, which both runnable detectors pass; **timing has BK2 alone** (its tables and six examples), and the emulators disagree with it and with each other (C10, C12-C15). ## The oracles ### BK2: manufacturer - Nintendo, *SNES Development Manual Book II* (archive.org `SNESDevManual` `book2.pdf`, SHA-256 `53435137...`, 413 image-only pages; archive.org's OCR `book2_djvu.txt`, SHA-256 `546f8e38...`). The Super FX section is printed pages 2-1-1 to 2-9-122 (PDF pages ~91-279; 2-5-3 = PDF 121, 2-6-10 = 133, 2-7-2 = 137, 2-9-20 = 177, 2-9-69 = 226, checked by OCR of the page footers). - Use: rung 1's expected values (operation and flags of every instruction, chapter 9; the prefix and pipeline rules, chapter 6), rung 3's timing (the cycle tables and the worked examples, chapters 7 and 9), the register and memory map, the plot address formulas (with C5's misprints corrected), the multiplier's partial-product order (8.2.1), the R15-after-STOP table (C1). - Read numbers from the **page images** (`pdftoppm -f N -l N -r 110`): the OCR drops table cells and digits (the BGE opcode, the cycle columns of chapter 7). ### krom's tests: test-author (designed as hardware self-tests) - `CHIP/GSU/GSUTest/*` (31 ROMs, 32 KiB LoROM, chipset `$14`): each runs a block of GSU code per row (CLSR = 1, CFGR = `$80`: IRQ masked, SCMR = `$38`: RON, RAN, 4 colours, 192 high, measured in MAME's host log), reads R0 or R1 and SFR's low byte after STOP, and prints PASS or FAIL against values in the ROM (`ResultCheck*`, `SFRResultCheck*` in the `.asm` beside it). **1,226 rows**: ADC 64, ADD 64, AND 64, ASR 31, BIC 64, CACHEINJECT 2, CMP 32, DEC 30, DIV2 31, FMULT 32, HIB 31, IBT 30, INC 30, IWT 30, LMULT 32, LOB 31, LSR 31, MERGE 30, MOVE 30, MOVES 30, MULT 64, NOT 31, OR 64, ROL 31, ROR 31, SBC 32, SEX 31, SUB 64, SWAP 31, UMULT 64, XOR 64. - **Provenance** (measured from the GitHub history, 2026-11-06): the tests were written 2017-11-10 to 2017-11-13; krom's README says "I only test with a real SNES using a SD2SNES"; but the sd2snes gained a GSU only in March-April 2018 (RedGuyyyy's first `gsu` commits), and krom's "Fix GSU Wait Thanks To RedGuyyyy" is 2018-04-01. **No record shows them run on a Super FX chip**; the likely platforms were higan (bsnes) and later the sd2snes FPGA. So their values are test-author tier: they decide between emulators only where no higher tier speaks, and a conflict with BK2 goes to BK2 unless fullsnes sides with krom. They test values only (one clock speed, IRQ masked, no timing, SFR high byte not compared). - `2BPP/4BPP/8BPP` `PlotPixel`, `PlotLine`, `FillPoly` at 128/160/192 high (27 demos): pictures only; the `.png` beside each is an emulator screenshot (snes-python validation.md: tier 3). - **Measured here (2026-11-06), PASS/FAIL tokens read from the S-CPU's VRAM write stream**: **MAME 0.285: 31 of 31 tests, 1,226 of 1,226 rows PASS, no FAIL** (`mame_gsu_trace.py --krom --frames 900`, each ROM mirrored to 1 MiB, 9-15 s wall each); **Mesen2 2.1.1: 31 of 31, 1,226 rows PASS** (`mesen_krom.py`, 4-6 s each). The rows therefore do not separate the two lineages; they are a floor for the core, not a discriminator. ### The games: program `scripts/survey_games.py` (No-Intro dumps read in place; MAME's `snes.xml` by SHA-1): 55 GSU dumps, 32 in the list (22 `lorom_gsu1`, 14 `lorom_gsu2` entries in the list overall). By chip: **MC1** Star Fox / Starwing and their competition carts (chipset `$13`, no extended header); **GSU-1** Dirt Racer, Dirt Trax FX, Vortex (`$14`, 512 KiB), Stunt Race FX / Wild Trax (`$15`/`$1A`, 1 MiB, 64 KiB RAM; MAME's slot code calls `$1A` "GSU-1 (21 MHz at start)"); **GSU-1A** Powerslide (prototype); **GSU-2** Doom (2 MiB, 64 KiB), Winter Gold, Star Fox 2 (16 betas and the two 2017 Classic Mini dumps; `$13` or `$15`), Yoshi's Island (GSU-2 and GSU-2-SP1 boards). The header does not name the chip (`$FFD6` `$13-$1A`); the software list's PCB does, where present. ### fullsnes: research `fullsnes.txt` as served 2026-10-21 (snes-python's pin), "SNES Cart GSU-n" lines 7676-8462, "External Oscillators" line 22768, "SNES Pinouts GSU Chips". Use: the corrections to BK2 (C2-C4, the STOP note in C1), the per-chip memory maps and register mirrors (U12, U22), VCR values (U23), the MC1 STOP hang (U24), the oscillators (C8), the caches' behaviour where BK2 is silent. ### MAME 0.285 `superfx1`/`superfx2`: emulator, the value detector - `/usr/games/mame` (0.285), source at `mame0285` (`f379cd06`) in snes-python's tree. MAME's header heuristics load any GSU cart as `lorom_gsu1` (`:snsslot:lorom_gsu1:superfx`, ROM <= 1 MiB) or `lorom_gsu2` (> 1 MiB). - `scripts/mame_gsu_trace.py` records one G/H line pair per GSU instruction (R0-R15, SFR, PBR, ROMBR, RAMBR, CBR, COLR, POR, RAMADDR) and the S-CPU's `$3000-$34FF` and (with `--ram`) Game Pak RAM accesses; recipe and traps in [mame-oracle.md](mame-oracle.md). Its debugger disassembles GSU code (`--dasm`) one byte-instruction per line. - Known differences from BK2, each a C-entry: one debugger cycle per instruction (C17), byte-wide RAM buffer and free RAM reads (C13), whole-line cache fill (C10), no RON/RAN wait, no ROM buffer start on S-CPU R14 writes (U9), FMULT into R4 (C9), R15 + 2 after STOP (C1), byte-at-once register writes (C6). **A detector for values, never for time.** ### Mesen2 2.1.1: emulator, independent, runs here The family's mesen2-runner (a GPL tool in emu-tools-gpl, run as a separate program at `$EMU_TOOLS_GPL/tools/mesen2/run.py` with machine `snes`; until 2026-11-24 snes-python's old `mesen_run.py`, imported in process through `SNES_GPL_TOOLS`) drives a `MesenCore.so` built from the pinned `b9fa69dd` (famicom-python's, or the tool's own build); `scripts/mesen_krom.py` passes it a Lua write callback (`--lua`) for the krom verdicts and reads the tool's `script-log.txt`. Values from it are OBSERVED (Mesen2 at the manifest's commit, via mesen2-runner 0.1.0). Mesen2's debugger has a GSU CPU type (`CpuType::Gsu`, `Gsu.cpp` `ProcessInstruction`), so a per-instruction GSU trace through Lua is possible (rung 5, follow-up). Use: the second lineage for values; its timing model is ares-like with its own multiply rule (C14); the board's picture acceptance (krom's demos, games). ### ares: emulator, read (ISC) Read at the pinned revision, not built; the citable form of byuu's model (bsnes's GSU is the same core with type renames; ares adds BRAMR-gated backup RAM and a 70-71-only RAM decode). ### bsnes, snes9x, sd2snes: closed boxes (read under the old rule) Read before 2026-11-19, never again; nothing here is a default's basis.† snes9x is the oldest separate lineage (per-depth plot tables, a per-line batch run, a 2026 cycle mode with ares-like costs that also charges RAM reads, a POR clear at STOP: C16, whose switch was removed). Its issue #533 (Winter Gold) is a hardware report and is cited as such. The sd2snes `gsu.v` (GPL-2.0, 2,952 lines) is a hardware design with fetch/execute wait counters, a 16-bit RAM write buffer and its own multiply latencies (C13, C14): the only model written as logic, still emulator tier. None of the three is run here. ## Rung plan | Rung | What | Judge (tier) | Runs where | | --- | --- | --- | --- | | 0 | **Decode**: the opcode map with ALT1/ALT2/ALT3/B for all 256 x 4 x 2 combinations against BK2 chapter 9 and fullsnes' tables (C2 and C3 as fullsnes); the disassembler against MAME's `dasm` of every traced PC (mapping MAME's one-line-per-byte prefixes) | BK2, fullsnes (manufacturer, research); MAME (detector) | here, seconds | | 1 | **Directed per-instruction tests**: every instruction's operation and flags from BK2 chapter 9 (with C2-C5 per fullsnes), the prefix rules (U3, U4), the pipeline (U1, U2; BK2 examples 1-4 and 12-14 as programs), STOP and R15 (C1), the buffers' values (U7, U17), the cache window (U14, U15), plot addressing in all 4 heights x 3 depths with transparency, dither, high nibble, freeze (U20, C5), RPIX (U21), MULT/FMULT/LMULT incl. R4 (C9), the S-CPU register interface (U8-U11, C6, C7), the fixed vectors (U16). Each test cites BK2's page or names its U/C entry | BK2 (manufacturer); fullsnes (research) | here | | 2 | **krom's 31 GSUTest in a minimal harness**: the core plus a scripted host that does what each test's 65816 code does (CLSR, CFGR, SCMR, PBR, R15 start, wait for GO = 0, read R0/R1 and SFR), running the GSU code from the ROM file in place and comparing against the `ResultCheck`/`SFRResultCheck` values in the ROM; all 1,226 rows; plus `CACHEINJECT` through the cache window | krom (test-author; MAME and Mesen2 agree on all rows, closed-box runs) | here, BYOR (snes-python's checkout) | | 3 | **Timing vectors from BK2**: the six chapter-7 examples (in the cache, CLSR = 1: 14, 10, 17, 14, 19, 16 cycles) and the per-instruction "Cache RAM execution time" column (and the ROM/RAM columns at CLSR = 0), as cycle-count tests; the multiply extra cycles (C14); where BK2 gives a range, the test pins both ends with the case that produces each | BK2 (manufacturer) | here | | 4 | **MAME replay (values)**: start the core at MAME's power-on state, feed the S-CPU's register, cache and RAM writes at their instruction stamps, compare R0-R15, SFR (bits 1-5, 8-12, 15; not R: C17), PBR, ROMBR, RAMBR, CBR, COLR, POR and RAMADDR before every traced instruction. Windows: Star Fox (MC1, CLSR 0) frames 600-602 (225,133 instructions, 70 forms), then Stunt Race FX (GSU-1, chipset `$1A`), Vortex, Doom and Yoshi's Island (GSU-2, CLSR 1, RAM and cache code), Winter Gold. Divergences classified by C-entry (C1 at a restart, C9 at FMULT R4, U9 at an S-CPU R14 write); any other is a finding | MAME (detector) | here: ~5 s of MAME per traced frame, gzipped traces in `tests/mame_traces/` (gitignored) | | 5 | **Mesen2 replay**, per instruction, values and Mesen2's cycle counts, through its Lua GSU trace | Mesen2 (independent detector) | follow-up | | 6 | **Through snes-python milestone 7**: krom's 31 `GSUTest` PASS on the board (read from VRAM, as milestone 1 does); krom's 27 plot/fill demos vs Mesen2's frames; game frames vs Mesen2 (Star Fox, Stunt Race FX, Yoshi's Island, Doom, Winter Gold's race start, timing.md); the S-CPU's polling of SFR against the GSU's time | games (end judge); Mesen2 (detector) | the board | ### What no judge decides (do not pretend) - C1 (R15 after a plain STOP) beyond the program evidence of a game that restarts at R15; C6 (the write latch) and C7 (access while running) beyond what games do; C9 (FMULT into R4) unless a game does it; C11 (IRQ flag when masked); U6's garbage value; U9 (S-CPU R14 write prefetch); U12's mirrors (research only); U21's RPIX S flag; U23's VCR values for four chips; U24's MC1 hang; U26/U27 (power-on values, IL/IH). - **Timing outside BK2's tables and examples**: the cache fill order's cost (C10), the 21.4 MHz opcode fetch (C12), the plot write-back overlap (C15), the WAIT granularity on RON/RAN. BK2 bounds them ("1-48" cycles for PLOT); the board can only choose a model and show the games run. ## Results (2026-11-07, the build session) | Rung | Result | | --- | --- | | 0 | the 2,048-cell decode table equals an independent transcription of fullsnes' map (C2, U4); MAME's `dasm` agrees at the 3,295 traced Star Fox PCs that lie on its linear sweep | | 1 | 122 directed tests, each citing BK2's section or example or a U/C entry | | 2 | **all 31 ROMs, 1,226 rows** read from the ROMs' own 65C816 code (`harness.krom_script`); **1,225 PASS** with the defaults, the one FAIL being C9 (krom's FMULT row 8 stores the high word in R4, which BK2 and fullsnes say does not happen); **1,226** with C9 at the emulators' choice | | 3 | BK2's six worked examples exact line by line; chapter 9's tables 80 of 111 cells (C20) | | 4 | MAME 0.285 lockstep replays of Star Fox, Stunt Race FX, Vortex, Doom, Yoshi's Island and Winter Gold windows (1,701,962 instructions, 36,625 host reads): **0 findings**, no default-core divergence; no window ran code from Game Pak RAM | | 5, 6 | follow-up (rung 5 a later session, decision 11; rung 6 is snes-python milestone 7) | [claims.md](claims.md) has the per-game table and what each result supports. ## The minimal harness (rungs 2-4) A host that is not a SNES: the core over the ROM bytes (read in place) and a RAM `bytearray` (the core holds both: decision 3), a scripted S-CPU that writes registers and the cache window and polls SFR, and a stop rule (GO = 0, a cycle budget, or a trace's end). The same harness replays a MAME `gsu.log.gz`: it applies each `W` line (register, cache or RAM) before the instruction whose stamp follows it and checks each `R` value the S-CPU read. No S-CPU core, no cartridge decode, no clock ratio: those are the board's.