# Validation: every oracle, its tier, and the plan ## Oracle tiers The family's rule: rank an oracle by **where its expected values came from**; a lower tier detects, the highest tier that covers a claim decides it. | Tier | Meaning here | | --- | --- | | **1 hardware-captured** | values recorded from a real console, or a simulation of the real chip's netlist. **No console capture exists for either processor.** A simulation of the Flare netlists (below) is the nearest thing, with stated caveats | | **2 manufacturer** | Atari's *Technical Reference Manual* rev. 8 and *Hardware Bugs & Warnings* (1995); the Flare netlist text and the GPU microcode ROM read as documents | | **3 hardware-corrected community** | documents or tests whose authors ran them on consoles and say so: none with published results (jagdox is written from consoles but warns about its own pipeline section; TomNJerry's probes record no results) | | **4 HDL** | the MiSTer core (behavioural rework of the netlist, FPGA edits, **six reconstructed DSP microcode words**) | | **5 emulator** | MAME 0.285, Virtual Jaguar (classic and libretro), BigPEmu (closed), rmac/vasm/jrisc_tools as encoders. Detectors only | We have no Jaguar hardware; no rung needs one. ### What does not exist (searched 2026-11-11) - **No hardware-captured per-instruction data** and no logic-analyser capture of either processor; no SingleStepTests-style corpus; no hardware-verified JRISC test ROM with recorded results. - **No DSP microcode ROM** ([netlists.md](netlists.md)): the words for the six DSP-only opcodes are known only through MiSTer's reconstruction. - **No published simulation results from the netlist** that can be rerun: the libretro project's Verilator rig (`vsim/`) is described but not published. - No earlier revision of the manual and no separate "Software Reference" in text form were found (the board's Phase 0 found an image-only scan of the 1995 Software Reference in `cubanismo/jaguar-sdk`; not OCRed by either Phase 0). ## The oracles ### Flare netlists of Tom and Jerry (`Torlus/JagNetlists` @ `e13d5120`): tier 2 read, tier 1 simulated, with caveats - Pin: `scripts/pinned_repos.json`, sparse checkout `README.txt`, `netlists_org/`, `netlists/`, `src/`, `verilog/base/`, `verilog/tom/`, `verilog/jerry/`, `soft/`. **No licence** ("All rights reserved (until I sort out the licensing stuff)"); the design is Flare II / Atari's. Cite file and line; never copy ([netlists.md](netlists.md)). - Contents: every processor block of both chips, with designers' comments and dated fixes; the GPU microcode ROM (`soft/Mcode.rom`, regenerated exactly from `soft/mcodegen.c`: 64 of 64 words). - Caveats, each checked: 17 Tom files carry 2012 edits by the archive's author (declarations, comment layout, one block commented out); `netlists/` is a further-corrected copy differing in 14 Tom files including `SBOARD.NET` and `DIVIDE.NET`; the silicon revision is implied (version code 2) not stated; the files' first provenance is unknown (U8). - **Decides** (by reading now, by simulating later): encoding, the microword of every GPU instruction, flag sources (C4), the latch logic (C7), the entry sequence, the prefetch and scoreboard structure, DIV_OFFSET's bit (C2), PACK's flags (C3). **Cannot decide**: the DSP-only microwords (absent), anything analog or asynchronous (Tom bug 6, one-tick grants of bug 12), the memory chips' behaviour, and which of the "intermittent" bugs (GO clear, DSP external write) a real chip shows on a given day. ### The netlist as a referee: what each piece is worth | Piece | Tier as a judge | Why | | --- | --- | --- | | Torlus's gate-for-gate Verilog of the GPU island (`verilog/tom`, `graphics`) | **1 (netlist simulation)**, caveated | mechanical translation, one module per block, line references back to the `.NET` files; but the Toshiba cell models in `verilog/base/` are hand-written by Estrade (a cell-model error is a translation error), and it inherits the 2012 edits | | The same for the DSP (`verilog/jerry`) on the **58 shared opcodes** | 1, caveated, plus one assumption | same blocks as the GPU; assumes the DSP ROM words for shared opcodes equal the GPU's (very likely: same decodes in `DSP_EXEC.NET`, not proven) | | Torlus's DSP on the **6 DSP-only opcodes** | **none** | it loads the GPU ROM: SUBQMOD would execute as SAT8 | | MiSTer `rtl/jaguar_common` (GPU) | 4, high | behavioural rework mapping 1:1 onto the netlist blocks; a second translation, so agreement with Torlus's version is evidence that both translated correctly | | MiSTer with `JERRY=1` on the 6 DSP-only opcodes | **4 (reconstruction)** | the six words are the core authors' guesses ([netlists.md](netlists.md)); they agree with the manual's descriptions, nothing ties them to silicon | | MiSTer's memory controller timing | 5-ish | edited for SDRAM; not the console's (libretro §13 says the same) | | Mcode.rom / mcodegen.c | 2 | the generator named in `INS_EXEC.NET` | **Simulability, measured**: `python -I scripts/lint_referee.py --oss ../sm83-python/reference/build/oss-cad-suite` elaborates `mister-dsp` (`_j_dsp`, 30 files), `mister-gpu` (`_graphics`, 79 files) and `torlus-gpu` (`graphics`, 191 files) under Verilator 5.053 with **0 errors** (2026-11-11; `--lint-only`, nothing built). The libretro project reports driving the `graphics` island under Verilator 5.050 and lists the traps (bit-reversed bus vectors in their wrapper; `ack` a level; one tick = one system clock; `gpu-timing-verilator-results.md` §0): **second-hand**, their rig is not published. **Not built in Phase 0** (the brief said not to). Effort estimate for a single-instruction harness: **2-4 days**: a C++ testbench that drives the slave port (`GPU_CPU`: load local RAM, write PC, set GO), clocks the island, answers the coprocessor bus with a scripted memory (fixed latency, so external cases are deterministic), and reads RAM back; per-tick sampling of named nets (instruction retire `exe`, `sbwait`, `progreq`/`progack`, `datreq`/`datack`) for timing. ### Plan for a generated per-instruction corpus (rung 2) 1. **Case shape** (SingleStepTests-like, JSON lines): initial registers (both banks), FLAGS, the control registers that matter (MTXC, MTXA, MOD, DIV control), a few RAM words; the instruction (and, for hazard cases, the next one or two); final registers, FLAGS, RAM words written, HIDATA, accumulator (DSP top 8), and **the tick at which each instruction retired**. 2. **How a case runs on the referee**: a preamble in local RAM sets the registers (MOVEI per register; MOVETA for the other bank; a FLAGS store and two NOPs), then the instruction under test, then an epilogue that stores every register and FLAGS to RAM and clears GO; the testbench reads RAM over the slave port. Ticks come from the sampled `exe` net, not from the epilogue. The preamble and epilogue are the same for every case, so their own timing cancels. 3. **What to generate, per processor**: every opcode x every flag state x random operands (edge values over-weighted: 0, 1, `7FFFFFFF`, `80000000`, `FFFFFFFF`, shift counts -33..33), N cases per opcode (start with 1,000); then **pairs** for the scoreboard and write-back rules (every producer/consumer combination at distance 0-3), the bug-list sequences B1, B2, B5, B7, B13 ([pipeline-and-bugs.md](pipeline-and-bugs.md)), the illegal sequences of TRM p.40 (U5), DIV at distances 0-18, MMULT for widths 3-15 and both MADDW values, and interrupt entry with a pulse at each tick of a window. 4. **Tiering the output**: each case records which referee produced it. GPU cases from Torlus's translation are tier 1 (netlist simulation), and the same cases run on MiSTer's GPU must agree (a disagreement is a translation bug in one of them, settled by reading the `.NET` line). DSP cases for shared opcodes: tier 1 with the shared-ROM assumption; for the six DSP-only opcodes, **tier 4** and labelled so. 5. **Licence**: the corpus is behaviour data generated by our harness, not netlist text. Keep it out of git until Aubrey decides (open decision 6 in the brief); pin its generator script and its referee pins instead, as the family pins SingleStepTests by commit. ### Atari, *Technical Reference Manual, Tom & Jerry, Revision 8*: tier 2 - Pin: `reference/docs/jaguar-technical-reference-manual-rev8.pdf`, SHA-256 `63aacc7f...` (`pinned_files.json`), copy of `Jaguar_MiSTer/resources/Jaguar Programming Manual.PDF`; the same bytes at hillsoftware.com. 141 pages, real text (`pdftotext -layout` into `reference/text/`). (c) 1992-93 Atari, "SECRET CONFIDENTIAL", circulated since 1999. - Read for this Phase 0: GPU p.29-63, DSP p.97-111, prototype differences p.131-133, bug list p.133-141. - **Decides**: the programmer's model, flags as documented, register maps, the bug list. Known wrong or inconsistent in places: C1, C2, C3, C8, C10, C12; silent on ticks beyond the stall list, on divide by zero, on unaligned accesses, on DSP opcode 62. ### Atari, *Hardware Bugs & Warnings*, 26 April 1995: tier 2 - Pin: `reference/docs/hardware-bugs-and-warnings-1995-04-26.pdf`, SHA-256 `ed27cfac...`, copy of `Jaguar_MiSTer/resources/HWBugs.pdf`; six scanned pages, OCR in `reference/text/hwbugs/p-N.txt` (tesseract; read against the PNGs where the OCR garbled register names). (c) 1994 Atari. - Eleven GPU/DSP items with worked examples, later than rev. 8. **Decides** where it is more specific than the manual (B2's full class of write-only instructions; B11 DSP DMAEN hang; two NOPs after a FLAGS write, C1). ### Community documents: tier 3 at best - jagdox `risc_doc.html` r1.35 (KKP & Nat!, 1997; `pinned_files.json` `458b4005...`): written without Atari's documents by console owners; its authors warn about "the high bullshit content" of its pipeline section. An independent reading of the registers; no measurements. - AtariAge thread 326379 (2021, archived 2024-12-15; `db20cfbb...`): developers on the DSP external-write bug (B8). Discussion, no capture. ### Test programs - `laoo/TomNJerry` @ `16f32b6d` (public domain): 20 DSP probes of exactly the corners no document settles (jump in a delay slot, MOVEI after a jump, MOVE PC after a jump, prefetch alignment, divide timing, `imultn`). **No results recorded.** If their author has console results, they are the only hardware-tier data for U5 (open decision 9). - `virtualjaguar-libretro` `test/acid/tests/{gpu,dsp}` (40 programs) and its C unit tests: emulator-authored, tier 5. ### MAME 0.285: tier 5 (detector) - Pin: `mamedev/mame` @ `f379cd06` (sparse: `src/devices/cpu/jaguar/`, `src/mame/atari/jaguar.*`), BSD-3-Clause. Binary `/usr/games/mame` 0.285. - Recipe and runs in [mame-oracle.md](mame-oracle.md). Good for order-of-execution replay of real programs (rung 3); its comments name games for several corners (latch gating, ABS, unaligned access, R30 at entry, bank-switch hack). No pipeline, so it cannot judge timing, stalls or the bugs. ### Virtual Jaguar: tier 5 (detector) - Classic: `mirror/virtualjaguar` @ `8d86cf72`, GPL-3 (cite, never copy): `gpu.cpp`, `dsp.cpp`, `jagdasm.cpp`. Hand-tuned cycle tables (Flip Out, Rayman notes). - libretro: `libretro/virtualjaguar-libretro` @ `8543bbff`, GPL-3: its `docs/gpu-timing-spec.md` (netlist reading with evidence tags), `gpu-timing-verilator-results.md` (second-hand Verilator figures), `jtrm-gpu-dsp.md` (a manual digest; not read in full). Useful as leads. ### Encoders (tier 5, encoding checks only) rmac 2.4.6 (`42Bastian/rmac` @ `279a3130`, from Atari's MADMAC), vasm `jagrisc` (`a13e7e72`, non-commercial licence), `cubanismo/jrisc_tools` (`132af92f`, CC0 decoder tables), `42Bastian/gpudbug` (`99fe1e3e`, GPL-2). `opcode_tables.py` compares them with the manual, the microcode and MAME: one disagreement, DSP 62 (C6). ### Not fetched BigPEmu (closed: "private contractual obligations"); `ElectronAsh/jag_sim` @ `4010826e` (the checkout the libretro notes cite; JagNetlists has the same netlists); AtariAge thread 296040 on Tom revisions (403, no archive copy found); earlier manual revisions. ## The rung plan (summary; exit tests in [handoff-brief.md](handoff-brief.md)) | Rung | Judge | Tier | | --- | --- | --- | | 0 tables | manual, `opcode_tables.py` (manual, jrisc_tools, MAME); the microcode column is owed (2026-11-25, provenance.md) | 2 | | 1 directed tests | the manual's statements and the bug lists, one test per instruction and per bug item | 2 | | 2 generated corpus | the netlist-derived Verilog (built then) | 1 (GPU, DSP shared), 4 (DSP-only) | | 3 program replay | MAME traces of the boot ROM GPU program, a game's DSP loop, a CoJag program | 5 (order only) | | 4 second referee | MiSTer vs Torlus on the same corpus; Virtual Jaguar | 4-5 | **2026-11-25 (decisions L4, L5):** JagNetlists (no licence) is no longer kept here and the MiSTer RTL (GPL-2.0) has not been fetched since 2026-11-24, so rungs 0 (microcode), 2 and 4 as written need run-only tools in emu-tools-gpl whose output this repository reads, or a plan rebuilt from documentation. Owed; see provenance.md. | 5 tooling | | | ## What no judge decides - The **six DSP-only microwords** and DSP opcode 62 (U1, C6): only a console (or the lost ROM) can. Default: MiSTer's words, labelled tier 4; opcode 62 as NOP with a log line. - **External bus timing as a game sees it**: the processor side is in the netlist; the other side is Tom's memory controller and the DRAM chips (the board's subject). The core's gateway timing can be simulated; whole-game pace cannot be judged by anything we have (one camcorder observation of Doom, reported by libretro: board's concern). - **The intermittent bugs** (B6 external GO clear, B8 DSP write data) depend on asynchronous timing a synchronous simulation does not have. Default: model the clean behaviour, log every occurrence. - **Silicon revisions**: the netlists say version 2; whether any console shipped with later Tom or Jerry steppings, and whether they differ, is unknown (U8).