# Validation: every oracle, its tier, and what it can decide ## Tiers The family's rule: rank an oracle by where its values came from. A lower tier **detects** a difference; it never **judges** who is right. | Tier | Meaning here | | --- | --- | | 1 hardware | measured on a real DSP16A or QSound board, or a die-level model of one | | 2 manufacturer | AT&T's Information Manual (January 1989), the DSP16A advance data sheet (1988) and its May 1989 addendum, three AT&T application notes | | 3 hardware-traced community | Loïc Petit's CPS-2 board schematics (traced from real boards); superctr's register description (from his disassembly of the real program) | | 4 HDL | jotego's jtdsp16 (Verilog) and its QSound glue in jtcores | | 5 emulators | MAME 0.285 `dsp16` + `qsound` (LLE) and `qsound_hle`; libvgm `qsound_ctr`; FinalBurn Neo `qs_c` | ## What does not exist (searched 2026-11-11 and 2026-11-12) - **No hardware-tier oracle for the instruction set.** No per-instruction corpus from a real DSP16 or DSP16A, no die-level netlist or transistor model, no AT&T assembler, simulator or development system in any archive found (a 2016 cctalk request by Jonathan Gevaryahu for the DOS assembler and devkit is the only trace of a search; no copy surfaced). - **Hardware-tier material for QSound is two things**: the ROM image itself (silicon contents: a program, not a record of behaviour) and jotego's two logic-analyser screenshots (`jtdsp16/doc/measurements/qsound1.png`, `qsound2.png`: PSEL, OCK, DO, SADD of a real chip; they fix the 5 MHz bit clock, MSB-first words and SADD low for 8 bit times; they do not show a sample period or any data). - **No recording of a real board's DAC input** (a capture of the I2S stream from a CPS-2 would be the tier-1 judge of the whole program on this core). The user has no CPS hardware. - **No record of how `dl-1425.bin` was read**: only MAME commit `08d07f5917` (2017-04-26) crediting "Lord Nightmare, Siliconpr0n, superctr, Quench" for a decap. The die-photo map (`siliconpr0n.org/map/capcom/dl-1425/`) refuses scripted clients. One bounded web search on 2026-11-12 found nothing more. - **No second program corpus in MAME**: no other driver uses a DSP16 or DSP16A. ## The oracles ### AT&T WE DSP16/DSP16A Information Manual, January 1989 (tier 2) - Pin: `reference/docs/WE_DSP-16_DSP_Information_Manual_Jan89.pdf`, SHA-256 `ce916d17...` (in `scripts/pinned_files.json`); bitsavers via the mirrorservice.org mirror. AT&T copyright; read and cite. - Decides: encodings (appendix A), semantics (chapter 3), cycles (table 3-3, 3.8.1, the 4-6 example), interrupts (2-15 to 2-17, 4.2), the PIO (chapter 6) and SIO (chapter 5), reset (7-14). - Cannot decide: everything in [undocumented-behavior.md](undocumented-behavior.md) marked U; its own ambiguities (C3, C9). ### DSP16A advance data sheet (1988) and addendum (May 1989) (tier 2) - Pins: in `pinned_files.json`; OCR text by `scripts/ocr_reference.py`. - Decides: the DSP16A's memory sizes (4,096-word ROM, 2,048-word RAM, external space to 64K: C6, C8), the instruction and cycle summary (agrees with the manual), electrical timing (25 ns parts from the addendum). No timer, no power down, as in the manual. ### AT&T application notes AP88-07, AN88-18, AP89-009 (tier 2) - ADPCM transcoder, noise generation, echo canceller: complete program listings in source form (OCR under `reference/docs/text/`). AN88-18 builds its generators in software and never uses `heads`/`tails` (U3 stays open). - Can supply **manufacturer-written test programs** for rung 1 (assembled by hand or by our assembler), with the expected behaviour described in prose. Their listings do not carry object code, so they cannot check an encoder. ### CPS-2 board schematics, Loïc Petit, 2019 (tier 3) - Pin: `jtdsp16` at `71fa564`, `doc/93646A.pdf` (A-board: sheet 16 the DSP, 17 volume, 18 DAC, 19 the host latches and sample address latches), `doc/93646B.pdf` (B-board: sheet 9 the QSound ROMs). Licence CC-BY. - Decides (for CPS-2): the 60 MHz clock, EXM low, which pins are used, WS from PSEL latched by SADD (C4, C5), the host latch structure, RB7-0 grounded (U15). - Cannot decide: anything inside the DSP; CPS-1.5 and ZN wiring. ### superctr's register description (tier 3) - Pin: gist `fa2491fc...` revision `dd64f6d`, SHA-256 `06a79e4c...`. No licence; cite only. - Decides nothing alone: it describes what the program does with each RAM register. The program on the core is the judge; the gist names what to test. ### jtdsp16 (tier 4) and jtcores CPS-1.5 glue (tier 4) - Pins: https://github.com/jotego/jtdsp16 @ `71fa564` (GPL-3.0; since 2026-11-24 only its `doc/` and test programs are fetched, not the HDL), https://github.com/jotego/jtcores @ `ea0ef4e` (GPL-3.0; not fetched since 2026-11-24, Aubrey). Read under the old rule until 2026-11-19; **closed box only** from then. The account below is a record of what was read (HYPOTHESIS); no default rests on it alone. - Built by its author against MAME traces and a C model, then run with the real program on FPGA boards (its `ver/fw` benches compare the RTL with MAME traces and with a C model, `jtutil`'s `model/dsp16/dsp16_model.c`, which was not located). So **not independent of MAME** for the instruction set; independent for the QSound glue (written from logic-analyser captures). - `ver/top/tests/`: 34 small assembly programs (`alu1-7`, `do1-7`, `doloop`, `mod`, `int`, `pio`, `goto`, `call`, `condgoto`, `aT=R`, ...) and 33 `.out` files. `go.sh` builds the HDL with Icarus Verilog, runs a program and diffs the final register dump against its `.out`, and writes a new `.out` when none exists: so the expected values are **the HDL's own output** (regression snapshots, tier 4), useful as a detector and as ready-made test programs, never as a judge. `cc/dsp16as.cc` is jotego's own assembler. `ver/fw/xmvsf.qs`, `spf2t_b1.qs`: recorded host-write lists from real games (X-Men vs Street Fighter, Super Puzzle Fighter II Turbo): **stimulus for rung 4**, not judges. - The README lists unsupported instructions (`Z : aT`, `Z : R`, `ifc`, most of `Z : y`, `icall`) and two document ambiguities (U8, C7). - As a second referee: running the HDL (the `ver/fw` bench uses Verilator, `ver/top` uses Icarus Verilog; **neither is installed here**) would give a tier-4 detector independent of MAME's code but not of MAME's behaviour. Estimate only: Verilator plus the bench is a few hours to build; one second of QSound is 60 M clocks, minutes of simulation. Not run in Phase 0 (the build is not small, and the machine is shared). ### MAME 0.285 `dsp16` + `qsound` (the LLE) (tier 5) - Pin: `mamedev/mame` `f379cd06` (tag `mame0285`), BSD-3-Clause, Vas Crabb. Runs as the installed `/usr/games/mame`; recipe in [mame-oracle.md](mame-oracle.md). - A machine-cycle interpreter of the whole instruction set except `heads`/ `tails` (stops), PSW overflow bits (TODO), serial input and multiprocessor mode, S/C mode; the low-level QSound device recovers the serial words into a stream. - **Checked against the manual's timing for every executed instruction** (timing.md): 0 differences in 805,331 executions. Its per-instruction register trace is the main **detector** for rungs 2-4. - Cannot decide: anything in the U list; it implements its own guesses (FIXMEs in U2, U4, U5, C3) and does not model `srta`/SADD (C4) or the PIDS shadow (U7). ### MAME 0.285 `qsound_hle` (tier 5) - superctr and Valley Bell, BSD-3-Clause; a C++ re-expression of the program's algorithm with the program's own tables read from `dl-1425.bin`, in MAME since 0.201 (2018; release notes: "Replaced implementation with back-ported DSP program"). **Every game driver in MAME uses this**, not the LLE. - A second detector for rung 4 at the level of output samples. Not independent of the program (it was written from its disassembly) but independent of any DSP16 core. Its stream runs at 1,248 cycles per sample (C1), so a comparison aligns by sample index, not by time. ### libvgm `qsound_ctr` and FinalBurn Neo (tier 5) - libvgm `c5c03a2` (BSD-3-Clause, readable with notice), FBNeo https://github.com/finalburnneo/FBNeo @ `c3e8c4d` (FBNeo licence, non-commercial: closed box only from 2026-11-19; not fetched since 2026-11-24, Aubrey; what follows of it is HYPOTHESIS, read under the old rule). **Both are superctr's HLE** (same structure, same comments, same 1,248 divider): the same detector as `qsound_hle`, not new evidence. libvgm's `qsound_mame.c` is the pre-2018 MAME HLE, for contrast only. ## The plan, in short The rungs and their exit tests are in [handoff-brief.md](handoff-brief.md). In one line each: 0. Manual to tables (encodings, cycles, registers) with a script that checks them against the text and against MAME's decoder. 1. Directed tests per instruction from the manual (tier 2 by construction), plus the reachable jtdsp16 test programs (tier 4) and the application notes' routines. 2. Disassembler checked against MAME's over the whole program (3,810 lines). 3. Cycle counts: the program's trace charged by the core equals the manual's charge and MAME's `totalcycles` (already equal to each other). 4. The real program with recorded host writes, **sample for sample** against MAME's LLE (and per instruction where they part), then against the HLE; differences named. 5. A second referee (jtdsp16 under Verilator or Icarus), if built. ## What no judge decides With no tier-1 oracle for the instruction set, these stay decisions, each a named class attribute in the code and a U entry here: U1 (overflow bits), U2 (`rnd`), U4, U5, U6, U8, U9, U10, U11, U13, U20, and the 1,245-cycle period itself (C1, by the manual's rules only). The program on the core reaching sample equality with MAME's LLE proves agreement with MAME's guesses where the program exercises them, not correctness.