# Consumer migration: what each MIT repository should change later Written 2026-11-23, at the first wave of the harness refactor, for a separate MIT-side brief; brought up to date on 2026-11-24 (the second wave: GPL-2.0-only tools moved to `emu-tools-gpl2`, and one variable per tool repository). It holds no code: only what each consumer runs today, what to run instead, and what to check. The wall applies (`emu-tools/docs/wall.md`): the MIT side reads this file and the tools' READMEs, never the code here or in `emu-tools-gpl2`. ## What changed, and what did not The family's GPL tools were gathered here on 2026-11-22 as one folder per consuming emulator repository. The first wave (2026-11-23) regrouped them by upstream: - **Mesen2**: one tool, `tools/mesen2` (mesen2-runner 0.1.0), with NES, SNES, Cx4 and PC Engine adapters, a contract command line (`run.py`), the Mesen2 patch under `tools/mesen2/patches/`, and a pinned fetch-and-build script (Mesen2 `b9fa69d`). - **Nuked**: one harness family, `tools/nuked`, for Nuked-OPN2, -OPLL, -PSG and -OPM, with a pinned fetch-and-build script; the old harness files are include shims (below). Nothing a consumer runs had to change. Every old file under `tools//` keeps its name, its command line and its outputs; the Mesen2 ones are now thin shims over the new tool. Each was gated before and after with the consumer's own commands (the comparison is in the report of 2026-11-23 and summarised per consumer below). The shims stay until each consumer has moved; then they can be retired, one at a time, by a GPL-side brief. **Second wave (2026-11-24).** By Aubrey's rule of that day (a file with no "or later" grant, in a repository whose LICENSE is the GPL-2.0 text, is GPL-2.0-only), the tools of four upstreams (YM2608-LLE, sim68xx, Atari800, Mednafen 1.32.1) could not stay in this GPL-3.0-or-later repository and moved to the new GPL-2.0-only repository `emu-tools-gpl2`: ym2610-python's YM2608-LLE probe, megadrive-python's YM2608-LLE referee, m6800-python's sim68xx harness, a5200-python's Atari800 driver and huc6280-python's Mednafen trace patch (`docs/upstreams.md` has each verdict and its evidence). Again nothing a consumer runs had to change: each old file name a consumer uses in `tools//` is now a relative link to the moved file, so every old variable keeps working while `emu-tools-gpl` and `emu-tools-gpl2` are checked out side by side (as they are on the family's machine, both under one parent folder). Each was gated before and after with the consumer's own commands (below, per consumer). **Third wave (2026-11-24): each tool fetches its own upstream.** Aubrey's general rule of that day: no MIT emulator repository downloads or keeps closed-box source. Four MIT gates still built GPL referees from source trees they fetched themselves (ym2610-python's YM2608-LLE, ay8910-python's lvd2 AY model and YM2203-LLE, megadrive-python's Nuked-MD). Each of those upstreams is now fetched at the same pin, patched where the old build changed a copy, and built by its tool in its GPL repository: `emu-tools-gpl2/tools/ym2608-lle/build.sh`, `tools/ay-die-model/build.sh`, `tools/ym2203-lle/build.sh` here, and `megadrive-nuked-md-harness/build_nuked_md.sh` (when `NUKED_MD_SRC` is unset). The built programs sit at fixed paths under each tool's `build/` folder. Nothing a consumer runs had to change: the old file names stay (as links where a file moved), and the consumers' builds still work as they are. What each consumer changes later, to stop fetching and compiling GPL source: run the GPL repository's build once, point its scripts at the built program, and drop its own pin and fetch of that upstream (per consumer below: ym2610-python, ay8910-python, megadrive-python). **Fourth wave (2026-11-24): the stand-alone tool repositories fold in.** The three GPL tools that left their emulator repositories on 2026-11-19 as repositories of their own were folded in with their history and the stand-alone directories archived (renamed `zzz-`, each with an `ARCHIVED.md`): `megadrive-nuked-md-harness` became `emu-tools-gpl2/tools/nuked-md`, `m68000-winuae-referee` became `emu-tools-gpl2/tools/winuae` (WinUAE's tree at its pin has a GPL-2.0-only file the tool compiles, `docs/upstreams.md`), and `hg51b-mesen-harness`'s history joined this repository, whose `tools/mesen2` has held its code since the first wave. What megadrive-python and m68000-python change is one environment variable each, no code (their sections below); hg51b-python had already moved to `$EMU_TOOLS_GPL` (its section). **Fifth wave (2026-11-24): mesen2-runner 0.2.0, nothing owed for the Mesen2 consumers.** The features that kept famicom-, snes-, pcengine- and hg51b-python on the old in-process drivers are in `run.py` now (its README documents every option; `CHANGELOG.md` lists them): the whole script log, however long (`script-log.txt`, ending with the last frame); the Famicom Disk System BIOS as a player-supplied input (`--fds-bios PATH`, else the variable `FDS_BIOS`); several runs in one process (`--batch FILE`, one JSON object of options a line, each with its own `out`); `--no-sprites` for `pce`; `--reset-at N` for `nes`, `snes` and `snes-cx4`, which now lands at the same emulated moment every run; `--power-on-ram zeros|ones|random`, zeros by default and recorded in the manifest; every SNES frame drawn, so SNES pictures repeat run for run; and `--input` and `--lua` for `snes-cx4`. The README also says that pictures need Pillow. Nothing a consumer runs had to change: the shims keep their command lines and outputs (gated before and after with the consumers' commands, below per consumer), and the consumers that already run `run.py` get the same outputs, except that a `--lua` run's `script-log.txt` now holds every line its script logged up to the last frame (it used to hold Mesen2's last 500, including Mesen2's own two loading lines, which now go to the manifest's `script_messages`). Each consumer section below says which scripts can now move and the command lines they become. **Sixth wave (2026-11-24, later): mesen2-runner 0.3.0, snes-spc 0.1.0, three shims retired.** What the consumers reported after moving to `run.py` (`tools/mesen2/CHANGELOG.md`): - `emu.stop(code)` in a `--lua` script now ends the run cleanly at the end of that frame and is reported in the manifest, `end` = `{"by": "script-stop", "frame": F, "stop_code": C}`; the exit status stays 0. famicom-python's blargg runs (`scripts/mesen_blargg.lua` calls `emu.stop(code)` after logging the result) can read the result code from `end.stop_code` instead of parsing the text, and no longer need `check=False` or a long `--frames` margin. - `--until log:TEXT` ends a run at the end of the frame in which the script logs a line starting with TEXT: famicom-python's `mesen_accuracycoin.py` can pass `--until log:DONE` (its script logs `DONE`) and keep `--frames 20000` as the upper bound; `end.reached` says whether it came. Probe suites can instead call `emu.stop(0)` when done. - `--frames-at F,F,...` works on `snes` as on `nes`: snes-python's `mesen_frames.py`, `detectors_compare.py` and the Mesen2 half of `sweep.py` can take several checkpoints from one run (`frame-NNNNNN.png` each) instead of one run per checkpoint. - `--audio-out` ends at `--frames` and repeats run for run (a prefix of what 0.2.0 wrote, 0.08 frame short of the nominal length); famicom-python's `mesen_audio.py` comparison, once it reads a `run.py` WAV, no longer sees run-to-run differences in length. - `snes-cx4`'s printed "host stream" line is truthful (`R of F frames, complete`). - famicom-python's `mesen_audio.py` (the shim it runs by path) finds the library without `MESEN_CORE`: `MESEN_LIB`, `MESEN_CORE`, its checkout's hand build, then the tool's own build; exit 3 naming them without one. - Retired to `attic/` (no code in any repository used them): `tools/snes-python/mesen_run.py`, `tools/pcengine-python/mesen_run.py`, `tools/hg51b-python/mesen_cx4_trace.py`. - snes_spc: `tools/snes-spc` builds the referee itself (its section below). Nothing a consumer runs had to change: the outputs of the existing cases are identical before and after (the CHANGELOG's gate), except that `audio.wav` no longer varies. Two old files did not run as parked, and run now: pcengine-python's Mesen2 runner (it looked for its press helper beside itself) and huc6280-python's vanish probe (it looked for the huc6280-python checkout beside itself). Where they now look is said below. ## The target, for every consumer 1. **Run the tool as a separate program and read only its outputs** (the contract's process boundary). Today famicom-, snes- and gsu-python import the Mesen2 driver into their own Python process; that is what the migration removes. 2. **Find the tool through one variable per tool repository** (Aubrey, 2026-11-24): `EMU_TOOLS_GPL` names a checkout of `emu-tools-gpl`, `EMU_TOOLS_GPL2` a checkout of `emu-tools-gpl2` (and `EMU_TOOLS` the MIT `emu-tools`). Each tool sits at a fixed path under its repository, listed in that repository's `tools/README.md`, for example `$EMU_TOOLS_GPL/tools/mesen2/run.py`. So every consumer's later step starts the same way: set `EMU_TOOLS_GPL` (or `EMU_TOOLS_GPL2`) and call the tool at its documented path. A tool's README may offer an optional per-tool override (Mesen2's `MESEN_CORE` names a library, for instance), nothing more. The per-consumer `_GPL_TOOLS` variables keep working until each consumer has moved. 3. **Read the manifest** (`manifest.json` in the output directory) and tag what is taken from a run as the contract says: OBSERVED (Mesen2 at the manifest's commit, via mesen2-runner and its version). 4. **Re-run the consumer's own gate** (the commands listed per consumer below) before and after, as this wave did. ## famicom-python Today: `FAMICOM_GPL_TOOLS` names `tools/famicom-python`. `scripts/gpl_tools.py` puts it on the module path, and `mesen_frames.py`, `mesen_lockstep.py`, `mesen_accuracycoin.py`, `compat_sweep.py`, `provenance_probes.py` and `vs_judge.py` import the driver in process (its run function, its frame decoder, its Lua frame script, its region table, its root). `mesen_audio.py` is run by path from the checkout with its venv. The patch is applied by hand to a Mesen2 checkout under `reference/build-mesen2` (docs/validation.md). Later: set `EMU_TOOLS_GPL` and call the tool at its documented path, `python3 -I "$EMU_TOOLS_GPL/tools/mesen2/run.py" --machine nes ...`, as a separate program: - Build Mesen2 with `"$EMU_TOOLS_GPL/tools/mesen2/build.sh"` (it applies the patch) instead of by hand, or keep the hand build and pass it with `MESEN_CORE` or `--lib`; the manifest says which. - MesenCE (done 2026-11-25, mesen2-runner 0.4.0): `mesen_accuracycoin.py --core mesence` runs the tool's own pinned MesenCE build (`build.sh --core mesence`); famicom-python's own MesenCE build left the repository. Its hand-built Mesen2 under `reference/build-mesen2` is still there. - Frames: run the tool with machine `nes`, the number of frames, and `--frames-at` with the frames wanted; read `frame-NNNNNN.png` (16-bit grey: palette index, emphasis bits above it). This replaces the in-process run with the Lua frame script and the decoder. - The two NES switches the scripts pass today map to `--nes-ppu-reset-at-power on|off` and `--nes-oam-row-corruption on|off`; the region to `--region`. - Lockstep: `--trace insn` gives the contract's instruction records (registers, CPU cycle, PPU line and dot, frame); `mesen_lockstep.py`'s parser of Mesen2's trace text is no longer needed. The trace now ends exactly at the last frame. - Sound: `--audio-out` (with `--nes-apu off` for a cartridge's sound alone) writes `audio.wav`; the comparison (high-pass, alignment, fitted gain) is famicom-python's own MIT code and can move back into famicom-python as a script reading that WAV. The comparison now inside `tools/mesen2/mesen2_runner/compat/famicom_audio.py` carries the MIT notice it had, but by the wall it must not be copied back: the consumer keeps or rewrites its own copy. - Probe scripts that read memory through a Lua script (AccuracyCoin's results, the provenance probes, the Vs. System probe): `--lua FILE` with the consumer's own script, whose log lines arrive in `script-log.txt`. Nothing is owed by the tool any more (mesen2-runner 0.2.0, 2026-11-24). The four scripts that still import the old driver through `scripts/gpl_tools.py` can move, and with them `gpl_tools.py` itself and the use of `tools/famicom-python/`: - `mesen_accuracycoin.py`: write its Lua script to a file and run `python3 -I "$EMU_TOOLS_GPL/tools/mesen2/run.py" --machine nes --rom tests/test_roms/AccuracyCoin/AccuracyCoin.nes --out DIR --frames 20000 --lua FILE --timeout 900`; read its sixteen result lines from `DIR/script-log.txt`. The Start press can stay in the script or become an input script (`--input`, a record at frame 60 with start and one at 66 with none). - `vs_judge.py`: its script (the Vs. mainboard's inputs and its own frame lines) goes in `--lua`, with `--nes-oam-row-corruption off` and `--nes-ppu-reset-at-power on` or `off` as the machine says, `--frames` the last frame wanted; every line arrives in `script-log.txt`, including its own `L`/`E` frame lines and `DONE` (the tool keeps the player's lines whatever their format), and its own decoder reads them there. - `provenance_probes.py`: each probe's script in `--lua`, its answer lines in `script-log.txt`. The `--fds-ready` probe passes the BIOS as an input, `--fds-bios PATH` (the file `FAMICOM_FDS_BIOS` or No-Intro's zip names; a zip with one 8 KiB file is read as it is), or sets `FDS_BIOS` for the tool, instead of writing it into Mesen2's home; the disk image must be a loose `.fds` (the loader refuses a zip). The probes can now run in one process with `--batch` (the old driver crashed on the second). - `compat_sweep.py`: write one batch line per dump, each a JSON object with machine `nes`, the loose ROM, its own `out`, `frames` (the last frame), `frames-at`, `region`, the two NES switches, `lua` for the PlayChoice-10 and Vs. scripts, and `fds-bios` for disks, and run `python3 -I "$EMU_TOOLS_GPL/tools/mesen2/run.py" --batch FILE [--lib PATH]`; read each run's `frame-NNNNNN.png` (16-bit grey) or, for the Vs. levels, its `script-log.txt`. Each run gets a fresh Mesen2 home of its own, as the sweep makes today; one summary line per run comes on standard output. Parallel jobs become several batch processes. A crash of the library ends its batch: the dumps whose `out` has no manifest are the ones to run again, which fits the sweep's resume. - MesenCE: pass its library with `--lib` (or `MESEN_CORE`). `run.py --machine nes` runs it as it is (checked 2026-11-24 with famicom-python's MesenCE build: 300 frames, a picture and a 30,000-line script log); the manifest names it MesenCE with its commit unknown, since the tool does not build or pin MesenCE (`docs/upstreams.md` has no row for it). A batch takes one library, so a sweep over both is two batches. - Sound: `mesen_audio.py`'s run is `--audio-out` (above); the comparison stays famicom-python's. The NES settings are the ones the old driver's comparison mode set, and power-on RAM is zeros as before (`--power-on-ram`, recorded in the manifest). Gate (as run on 2026-11-23): the documented `mesen_run.py` command on `instr_test-v5/official_only.nes` and `ppu_vbl_nmi.nes` with `scripts/mesen_blargg.lua` (with and without `--trace`), `mesen_frames.py` (frame 120), `mesen_accuracycoin.py`, `mesen_audio.py` on `apu_mixer/square.nes` (300 frames), `mesen_lockstep.py` (120 frames), and `provenance_probes.py` one probe at a time (`185-power-on`, `mmc5-exram-blanking`, `fcg-test-then-decrement`; several in one process crash the library, before and after alike). ## snes-python Today: `SNES_GPL_TOOLS` names `tools/snes-python`. `mesen_frames.py`, `detectors_compare.py` and `smoke.py` run `mesen_run.py` by path (ROM, frames, PNG, home, optionally region and reset); `suite_run.py` imports it in process (its library list, its done marker and its run function with the suite's own Lua script and pads). Later: set `EMU_TOOLS_GPL` and run `"$EMU_TOOLS_GPL/tools/mesen2/run.py"` as a separate program: - Frames: machine `snes`, `--frames`, `--frames-out`; the PNG is the same picture (256x239 or 512x478, overscan included; row 7 is the first visible line). Note that `run.py` always plugs a pad into each port and sets NTSC unless `--region` says otherwise, where the old runner left Mesen2's defaults (no pads, region auto) unless asked; for gilyon's CPU test the picture is the same either way (checked 2026-11-23), but a game that reads the region may differ. Use `--region auto` to keep the old region. - The probe suite: machine `snes` with `--lua` and the suite's script; its log lines (the save RAM it reports) arrive in `script-log.txt`, every one, however many (0.2.0). - `--reset-at N` (0.2.0): the same option on `run.py`, which now gives the same picture every run. The old runner's varying pictures (three in three runs, 2026-11-23) came from Mesen2's frame skipping at maximum speed, not from the reset: the SNES drew a frame only when enough wall-clock time had passed, so a picture could be one drawn two or three frames earlier. `run.py` turns the skipping off for `snes` and `snes-cx4` (krom's WaveHDMA: one picture in five runs, against three in six before); the shim keeps Mesen2's default, so its pictures still vary. Power-on RAM is zeros by default (`--power-on-ram`, in the manifest's `power_on`); the shim without `--region` leaves Mesen2's random default. - So `mesen_frames.py`, `detectors_compare.py` and `smoke.py` can move: run `python3 -I "$EMU_TOOLS_GPL/tools/mesen2/run.py" --machine snes --rom ROM --out DIR --frames N --frames-out [--region auto|ntsc|pal] [--reset-at N]` and read `DIR/frame-NNNNNN.png`; `suite_run.py` runs `--lua` with its script; the Mesen2 half of `sweep.py` can be one `--batch` of runs (one JSON line per game and checkpoint) per job. Expect pictures that differed between runs of the shim to settle on one (no frame skipping), and recompare them once. Gate: the documented `mesen_run.py` command on gilyon's `cputest-full.sfc` (300 frames; and 200 frames with `--region ntsc --reset-at 100`), `mesen_frames.py` over krom's PPU folder (60 frames), `suite_run.py` on the probe suite (`--on mesen`). ## gsu-python Today: `scripts/mesen_krom.py` loads snes-python's `mesen_run.py` from `SNES_GPL_TOOLS` by file path and calls its run function in process with its own Lua script. Done on the MIT side: `scripts/mesen_krom.py` runs `"$EMU_TOOLS_GPL/tools/mesen2/run.py"` with machine `snes`, `--lua` with the script that counts the krom PASS and FAIL tokens, `--frames 900`, and reads `script-log.txt`. From 0.2.0 that file holds every line the script logged up to the last frame instead of Mesen2's last 500, without Mesen2's two loading lines (now in the manifest's `script_messages`); the token counts are taken over the whole run. The 31 ROMs could also be one `--batch`. Gate: `mesen_krom.py` over krom's GSU tests (31 of 31 pass before and after). ## pcengine-python Today: `PCE_GPL_TOOLS` names `tools/pcengine-python`. `m2_refs.py` and `detectors_compare.py` run `mesen_run.py` by path (card, frames, PNG, home, optionally no sprites and presses). As parked on 2026-11-22 that file stopped at import (it looked for `presses.py` beside itself), so these Mesen2 runs produced no picture until this wave. Later: set `EMU_TOOLS_GPL` and run `"$EMU_TOOLS_GPL/tools/mesen2/run.py"` with machine `pce`, `--frames`, `--frames-out`; presses become a contract input script (`--input`: frame, port, buttons i, ii, select, run and the directions; a press held from F for H frames is a record at F with the buttons and one at F+H with none). Mesen2's sprite switch is `--no-sprites` on `run.py` too (0.2.0), so `m2_refs.py` and `detectors_compare.py` can move: `python3 -I "$EMU_TOOLS_GPL/tools/mesen2/run.py" --machine pce --rom CARD --out DIR --frames N --frames-out [--no-sprites] [--input FILE]`, reading `DIR/frame-NNNNNN.png` (RGB; the width the VCE gives). `--reset-at` is refused for `pce` (Mesen2's Lua reset stalled the emulator there, OBSERVED 2026-11-24). The default home of the old runner, when `--home` is not given, now lies under `PCENGINE_PYTHON_ROOT`, else the working directory. Gate: the command lines `m2_refs.py` builds (CPU_Test_10.pce, 300 frames; with `--no-sprites`; 200 frames with two presses) and `m2_refs.py` itself around frame 120. The "before" side ran the parked file with pcengine-python's `scripts/presses.py` placed beside it in a scratch copy, since as parked it could not run. ## huc6280-python Today: `HUC6280_GPL_TOOLS` names `tools/huc6280-python`; the C16 and C18 probe is run as `vanish_probe.py` there (with `--out`, `--mesen-core`, `--skip`, `--only`). As parked it stopped at import (it looked for huc6280-python's `validation/vanish_rom.py` beside itself). Now it finds the checkout through `HUC6280_PYTHON_ROOT`, else the working directory: set the variable or run it from the checkout. It still runs Mednafen and MAME through huc6280-python's own scripts. One defect found at the regrouping is kept so the recorded numbers reproduce: it hands Mesen2 its PC Engine settings as a pointer where the library takes them by value. `--by-value` passes them as intended; on 2026-11-23 all five cards gave the same Mesen2 answers either way, so the results recorded in huc6280-python stand. Later: set `EMU_TOOLS_GPL`; the Mesen2 half can become `"$EMU_TOOLS_GPL/tools/mesen2/run.py"` with machine `pce` and `--lua` (the probe's script reads work RAM after 30 frames) and the card huc6280-python builds; the Mednafen and MAME halves of this probe are huc6280-python's own and stay there. **The Mednafen trace patch (moved 2026-11-24).** Today `scripts/build_mednafen.py` applies `mednafen-trace.patch` from the folder `HUC6280_GPL_TOOLS` names; that file is now a relative link to `emu-tools-gpl2/tools/mednafen/patches/mednafen-trace.patch` (GPL-2.0-only: one of the Mednafen files it patches, `src/pce/huc6280.h`, carries no grant). The same folder still holds the HUC6280 testbenches and the vanish probe, which stay in `emu-tools-gpl`, so the one variable reaches both repositories only through the link, that is, only while the two are checked out side by side. Later: set `EMU_TOOLS_GPL2` and apply the patch at its documented path, `$EMU_TOOLS_GPL2/tools/mednafen/patches/mednafen-trace.patch`; set `EMU_TOOLS_GPL` for the testbenches at `$EMU_TOOLS_GPL/tools/huc6280-python/huc6280_vhdl/` and the probe at `$EMU_TOOLS_GPL/tools/huc6280-python/vanish_probe.py`. That needs a change in huc6280-python (two roots where it reads one folder today), which this wave did not make. One caution: `build_mednafen.py` rebuilds when the patch file is newer than its binary; the patch's licence preamble was corrected on 2026-11-24 (its hunks are unchanged), so a checkout whose binary is older rebuilds once, about eight minutes here, and gets the same program. Gate for the patch (2026-11-24): `build_mednafen.py` run in two scratch copies of huc6280-python's scripts with the pinned tarball, one before the move and one after through the old variable and the link; the three patched sources were identical, and the two built Mednafens wrote identical traces with `mednafen_trace.py` on `CPU_Test_10.pce` (`--count 200000`). Gate: the probe with every emulator, run before from a scratch copy of the huc6280-python checkout (where the parked file could run) and after through the shim from the real checkout: the same output, line for line. ## hg51b-python Today: `cx4_probe.py` and `record_mesen_windows.py` run `$EMU_TOOLS_GPL/tools/hg51b-python/mesen_cx4_trace.py` as a separate program (hg51b-python's own change, made on the MIT side, replaced `MESEN_CX4_TRACE`, which named the separate repository's copy). The first step below is therefore done. On 2026-11-24 the separate repository `hg51b-mesen-harness` had its one commit merged into this repository's history and was archived as `zzz-hg51b-mesen-harness`; nothing hg51b-python runs pointed at it any more. Later, first step (done): point the harness at `$EMU_TOOLS_GPL/tools/hg51b-python/mesen_cx4_trace.py`; the command line and outputs are the same as the separate repository's. Second step: set `EMU_TOOLS_GPL` and run `"$EMU_TOOLS_GPL/tools/mesen2/run.py"` with machine `snes-cx4`, `--hold-test`, `--trace cx4-text,host` and `--trace-window START:END`; the outputs keep their formats (`cx4.trace.gz`, `host.txt.gz`). Controller presses are `--input` there from 0.2.0 (port 1; a harness press `FRAME:BUTTON`, held six frames, is a record at FRAME with the button and one at FRAME+6 with none; the harness counted the PPU's frames and the input script counts completed frames, so check the first press against today's output once). From 0.2.0 the host stream from `run.py` holds exactly frames 1 to `--frames`, every one, and its pictures repeat run for run (no frame skipping). So `cx4_probe.py` and `record_mesen_windows.py` can take this second step now. Gate: the harness's command line as `cx4_probe.py` builds it, on seven probe cartridges that `cx4_probe.py` builds (shift twice, stack, far and three host probes), and three runs on Mega Man X2 (USA) from `NO_INTRO_DIR` (the test screen at frame 300, a two-frame trace window from frame 120 with the host stream, and two presses with a picture). Cx4 traces and pictures identical; the host stream identical up to the last requested frame (rows past it vary from run to run, before and after alike). ## Known run-to-run variation (not a regression) Measured 2026-11-23 on the old drivers and the new tool alike. The drivers poll Mesen2's script log, so the emulator may run a little past the point a script asks to stop: a blargg run's instruction trace and the WAV recording come out longer or shorter between runs, with the shorter one an exact prefix of the longer; the Cx4 host stream may hold rows past the last requested frame. A console reset asked for from Lua (snes-python's `--reset-at`) gave three different pictures in three runs of the old runner. The new `run.py` holds the emulator at the end of the last frame for its NES instruction trace, so that trace is exact. From mesen2-runner 0.2.0 (2026-11-24) `run.py`'s outputs repeat: the script log and the Cx4 host stream are taken complete from a file and end with the last frame, and the SNES draws every frame. The SNES pictures' variation, including the reset's, was Mesen2's frame skipping at maximum speed (a wall-clock timer), found on krom's WaveHDMA: the CPU's state at every frame was identical across runs while the picture was one drawn up to three frames earlier. The shims keep the old behaviour on purpose, so their gate outputs stay comparable; `audio.wav` still runs a few frames past `--frames`. ## Nuked (ym2612-, ym2413-, sn76489-, ym2151-python) What changed: the five Nuked harnesses are one family, `tools/nuked` (nuked-harness 0.1.0), with the four models fetched at their pins by its `build.sh` and one command line, `run.py` (write script in, the model's records and the contract's manifest out). Each old file is now a one-line C shim that includes the family's source, so each consumer's own compile command builds the same program: the stripped binaries compiled before and after are identical, byte for byte, for the four consumers' files and megadrive-python's old PSG harness (megadrive-python's old OPN2 harness now reads the status through the model's public call: the same output, checked on a script that sets every status bit), and the consumers' own runs below gave the same output. Today: ym2612-, ym2413- and sn76489-python's `validation/closed_box.py` compile `nuked_harness.c` from their `_GPL_TOOLS` folder, with the model they fetched into their own `reference/`, into their git-ignored `validation/build/`, and run it with commands on standard input. ym2151-python's `validation/build_referee.sh` compiles `opm_ref.c` from `YM2151_GPL_TOOLS` with its fetched Nuked-OPM, and its referee scripts run the binary on event files. One caution while the shims stand: these consumers rebuild when the file they compile is newer than their binary. The shim's date does not change when the family's source does, so after a change to `tools/nuked/src/` the shim should be touched (or the consumer's built harness moved aside) so the consumer picks it up. Nothing has changed in those sources' behaviour so far. Later: 1. Set `EMU_TOOLS_GPL` and stop compiling GPL-linked code in the consumer: build with `"$EMU_TOOLS_GPL/tools/nuked/build.sh"` and run the family's binaries at their documented paths (`$EMU_TOOLS_GPL/tools/nuked/build/opn2-stream`, `opll-stream`, `psg-stream`, `opm-events`), which keep the command lines and record formats the consumers use now. The consumer then no longer fetches the Nuked models itself, and drops the compile step. 2. Or move to `"$EMU_TOOLS_GPL/tools/nuked/run.py"` (machine, write script as JSON Lines, number of clock calls, stride), which writes the same records plus `manifest.json`; the stream harnesses' read command (status and IRQ pin on standard error, used by ym2612-python) has no `run.py` form yet: the event form records the status byte with every clock instead. 3. Tag what is taken from them OBSERVED with the manifest's model, commit and tool version. Owed by the tool before every consumer can move to `run.py`: WAV and `trace/pins` outputs, the OPN2 read command and IRQ pin in the event form, the OPLL and PSG streams with a stride in the harness itself (today `run.py` thins the OPLL stream after the run), and the PSG's test register and mute mask. Gate (as run on 2026-11-23): `closed_box.py` with no arguments (every stream) in ym2612-, ym2413- and sn76489-python, plus `--probes` in ym2612-python; ym2151-python's `build_referee.sh`, `scripts/referee_probe.py` and `scripts/referee_measure.py`. The harness was rebuilt for both sides. megadrive-python: its old OPN2 and PSG harnesses have no user. Its `nuked_md` work goes through the Nuked-MD harness (`NUKED_MD_HARNESS`), which by the rule of 2026-11-24 is GPL-2.0-only (several Nuked-MD files it links carry no grant), so it cannot fold into `emu-tools-gpl`; on 2026-11-24 it was folded into `emu-tools-gpl2` as `tools/nuked-md`. Its change is in the megadrive-python section below. ## ym2610-python (moved to emu-tools-gpl2, 2026-11-24) Today: `YM2610_GPL_TOOLS` names `tools/ym2610-python`. `validation/build_referees.sh` compiles `lle2610_probe.c` from that folder against ym2610-python's own YM2608-LLE checkout (YM2610 build, two lines the compiler names dropped from an ignored copy) into `reference/build-referees/lle2610_probe`; `validation/fit_adpcma.py` and the documents run that binary. The file in the folder is now a relative link to `emu-tools-gpl2/tools/ym2608-lle/lle2610_probe.c`. Later: set `EMU_TOOLS_GPL2` and compile the probe at its documented path, `$EMU_TOOLS_GPL2/tools/ym2608-lle/lle2610_probe.c`. No MIT change is needed to keep working meanwhile, even where the two repositories are not side by side: pointing the old variable straight at the new folder, `YM2610_GPL_TOOLS=$EMU_TOOLS_GPL2/tools/ym2608-lle`, works with the consumer's script as it stands (checked 2026-11-24: the same binary). Renaming the variable in the script and its documents is the consumer's change. Tag the probe's values OBSERVED (YM2608-LLE 7a2aca7), as now. Gate (as run on 2026-11-24): `sh validation/build_referees.sh`, then `reference/build-referees/lle2610_probe` with no arguments, and `python3 -I validation/fit_adpcma.py`, before the move and after it through the old variable and the link (and the build once more with the variable pointing straight at the new folder). The binary built was byte-identical each time (and identical to the one already in the checkout); the probe's full output and the fit's output were identical, and the probe's output matches the recorded `validation/results/lle2610_probe-2026-11-19.txt` apart from that file's three header lines. **Third wave (2026-11-24): the tool builds the probe itself.** ym2610-python's `validation/build_referees.sh` now finds the probe's source through `EMU_TOOLS_GPL2` (its own change, made on the MIT side) but still compiles it against its own fetched YM2608-LLE, with the two-line compile fix made in an ignored copy. The tool now does all of that itself: "$EMU_TOOLS_GPL2/tools/ym2608-lle/build.sh" fetches YM2608-LLE at `7a2aca7` into the tool's own git-ignored `upstream/`, applies the same two-line fix as a patch file to a copy used for the YM2610 build only, and writes the built probe to `$EMU_TOOLS_GPL2/tools/ym2608-lle/build/lle2610_probe` (and the YM2612 referee to `build/lle2612_ref`), with `build/build-info.json` recording the compiler, flags, commit and patch. The probe's command line and output are unchanged. Optionally, `python3 -I "$EMU_TOOLS_GPL2/tools/ym2608-lle/run.py" --machine ym2610 --out DIR [--measure NAME ARG ...]` runs it and writes its text as `probe.txt` with the contract's `manifest.json`. Later (ym2610-python's change): run `build.sh` once (or have the build script call it), point `validation/fit_adpcma.py`, the documents' commands and anything else that runs `reference/build-referees/lle2610_probe` at `$EMU_TOOLS_GPL2/tools/ym2608-lle/build/lle2610_probe` instead, stop compiling the probe (the compile, the error-driven line dropping and the count check all move to the tool), and drop YM2608-LLE from its fetched references and its pins. A missing binary under the variable is a missing input (status 3), as the contract says. Tag the values OBSERVED (YM2608-LLE 7a2aca7, via ym2608-lle 0.1.0). Gate (as run on 2026-11-24): `sh validation/build_referees.sh` in ym2610-python (with `EMU_TOOLS_GPL2` set), then the tool's `build.sh`: the two `lle2610_probe` binaries are byte-identical, the patched copy of the model is byte-identical to the consumer's dropped-lines copy, and the probe's full run (no arguments) prints byte-identical output. The YM2612 referee built by `build.sh` is byte-identical to the one `build_lle2612_ref.sh` builds from ym2610-python's YM2608-LLE checkout. After the change, the consumer's gate is the same: the probe's full run and `python3 -I validation/fit_adpcma.py`, compared with today's output. ## m6800-python (sim68xx harness moved to emu-tools-gpl2, 2026-11-24) Today: `M6800_GPL_TOOLS` names `tools/m6800-python`, which holds both rung 5 harnesses. `scripts/crosscheck/sim68xx.py` compiles `sim68xx_harness.c` from it, linked with the MC6800 objects of the sim68xx checkout in `third_party/`, and runs it; `n6800.py` and `functional_test_n6800.py` run `n6800_harness.py` from it. `sim68xx_harness.c` is now a relative link to `emu-tools-gpl2/tools/sim68xx/sim68xx_harness.c` (the sim68xx files it links are GPL-2.0-only by the rule); `n6800_harness.py` stays (n6800 is GPL-3.0). Later: set `EMU_TOOLS_GPL2` and compile the sim68xx harness at `$EMU_TOOLS_GPL2/tools/sim68xx/sim68xx_harness.c`; set `EMU_TOOLS_GPL` and run the n6800 harness at `$EMU_TOOLS_GPL/tools/m6800-python/n6800_harness.py`. Because the one old variable names one folder for files now in two repositories, it works only through the link, that is, only while `emu-tools-gpl` and `emu-tools-gpl2` are checked out side by side. Where they are not, m6800-python needs a change: its scripts would read the two roots instead of one folder. This wave did not make that change (it is an MIT repository). Gate (as run on 2026-11-24): `scripts/crosscheck/sim68xx.py` (every case) with the checkout's venv, before and after: the harness it built was byte-identical, and its report identical. `scripts/crosscheck/n6800.py --limit 5` was run before and after as a check that the folder still serves the n6800 harness; its report varied by one case (866 or 865 agreeing, one NOP case) between runs with nothing changed, so it is not a byte-for-byte gate. ## a5200-python (moved to emu-tools-gpl2, 2026-11-24) Today: `A5200_GPL_TOOLS` names `tools/a5200-python`; `scripts/compare_atari800.py` and `scripts/sweep_atari800.py` run `atari800_run.py` from it as a separate program, with the checkout as `A5200_PYTHON_ROOT`, and the documents run it by hand from the checkout. The file is now a relative link to `emu-tools-gpl2/tools/atari800/atari800_run.py` (parts of libatari800 as built are GPL-2.0-only by the rule, and the driver loads the library into its own process). Later: set `EMU_TOOLS_GPL2` and run the driver at its documented path, `python "$EMU_TOOLS_GPL2/tools/atari800/atari800_run.py" CART ...`, from the checkout (or with `A5200_PYTHON_ROOT`), as today. No MIT change is needed to keep working where the repositories are not side by side: `A5200_GPL_TOOLS=$EMU_TOOLS_GPL2/tools/atari800` works with the scripts as they stand, since the folder holds only this file. Renaming the variable is the consumer's change. The driver still imports the checkout's own census helpers, as before. Gate (as run on 2026-11-24): the documented run on `Pac-Man (USA).zip` from `NO_INTRO_DIR` (`--frames 600 --every 60`; the BIOS from `MAME_ROMPATH`) and `scripts/compare_atari800.py` on the same cartridge with `--frame 600 --png-dir DIR`, before and after. Identical standard output and standard error, identical comparison report (0 differing pixels) and identical PNGs. The run's output matches the recorded `tests/detectors/atari800-pacman-2026-11-11.txt` except four log lines the library prints itself (its cartridge and BIOS lookups), before and after alike. ## megadrive-python (YM2608-LLE referee moved to emu-tools-gpl2, 2026-11-24) No current user. `tools/megadrive-python/validation/lle2612_ref.c` moved to `$EMU_TOOLS_GPL2/tools/ym2608-lle/lle2612_ref.c`, and its build step from that folder's `build_referees.sh` to `$EMU_TOOLS_GPL2/tools/ym2608-lle/build_lle2612_ref.sh` (run with `YM2608_LLE_SRC` naming a YM2608-LLE checkout at 7a2aca7). The old `build_referees.sh` now builds the two Nuked shims only. Nothing is left at the old path. Checked 2026-11-24 in a scratch copy laid out like megadrive-python's checkout: the new script builds a byte-identical `lle2612_ref`, and the edited old script still builds identical (stripped) Nuked referees. **Nuked-MD (third wave, 2026-11-24).** megadrive-python's `scripts/nuked_md.py` runs `$NUKED_MD_HARNESS/build_nuked_md.sh` with `NUKED_MD_SRC` naming its own fetched `reference/src/Nuked-MD` (pinned at `594ca2a` in its `scripts/pinned_repos.json`), and runs the binary the harness builds in its own `build/`. The harness now fetches Nuked-MD itself when `NUKED_MD_SRC` is unset (into its git-ignored `upstream/Nuked-MD`, at the same pin), and `NUKED_MD_SRC` keeps working as an override, so nothing has to change today. The harness also answers `--version` (`megadrive-nuked-md-harness 0.1.0 (Nuked-MD 594ca2a)`), exits 3 when it has no tree or cannot fetch one, and writes `build/build-info.json` (compiler, flags, the Nuked-MD commit, and whether the tree was fetched or given). Later (megadrive-python's change): build with the variable alone, sh "$NUKED_MD_HARNESS/build_nuked_md.sh" without setting `NUKED_MD_SRC`; keep running `$NUKED_MD_HARNESS/build/nukedmd-headless` as now; then drop Nuked-MD from `scripts/pinned_repos.json` and its fetched references, and remove the test's and the scripts' checks for `reference/src/Nuked-MD` (the harness's own build and its binary are what the tests need). Its rebuild-when-newer check can stay as it is: it compares the binary with the harness's own files. The harness is still found through `NUKED_MD_HARNESS`, which since the fourth wave names `$EMU_TOOLS_GPL2/tools/nuked-md` (below). Tag values OBSERVED (Nuked-MD 594ca2a, via nuked-md 0.2.0; megadrive-nuked-md-harness 0.1.0 was the same program). Gate (as run on 2026-11-24): the harness built from megadrive-python's tree (old script and new script with `NUKED_MD_SRC`) and from the fetched tree (new script, no `NUKED_MD_SRC`) gives three byte-identical binaries; the fetched tree is file-for-file identical to megadrive-python's; with the fetched build in place, megadrive-python's `tests/test_milestone6.py` passes (4 tests, nothing rebuilt), and every probe in its `scripts/run_nuked_md.py` run through its `scripts/nuked_md.py` gives identical traces (68000 and Z80 bus cycles, signal changes, memory selects and VRAM strobes: trace mask 0x1f) and work-RAM, Z80-RAM and VRAM dumps on both binaries. **Nuked-MD (fourth wave, 2026-11-24): the harness is `emu-tools-gpl2/tools/nuked-md`.** The stand-alone repository was folded, with its three commits, into `emu-tools-gpl2` as `tools/nuked-md` (nuked-md 0.2.0: the same driver and build, renamed; an unknown argument to the build script now exits 2) and archived as `zzz-megadrive-nuked-md-harness`. megadrive-python changes no code: it finds the folder through `NUKED_MD_HARNESS` and calls the same two files in it, so the one change is the variable's value, export NUKED_MD_HARNESS="$EMU_TOOLS_GPL2/tools/nuked-md" The build script, the binary and the build record keep their names under that folder (`build_nuked_md.sh`, `build/nukedmd-headless`, `build/build-info.json`), and `NUKED_MD_SRC` keeps working as an override. The first build in the new folder fetches Nuked-MD at `594ca2a` into the folder's git-ignored `upstream/` (about three and a half minutes with the compile). Later, if megadrive-python wants to follow the contract's one-variable-per-repository rule literally, it can join `EMU_TOOLS_GPL2` and `tools/nuked-md` itself instead of reading `NUKED_MD_HARNESS`; that is its own change, and nothing here needs it. Documents that name `megadrive-nuked-md-harness` should name `emu-tools-gpl2`'s `tools/nuked-md` instead, and values are tagged OBSERVED (Nuked-MD 594ca2a, via nuked-md 0.2.0). Gate (as run on 2026-11-24, from megadrive-python's checkout as it stood on branch `pin-2-od2`, with its uncommitted changes, which already build without `NUKED_MD_SRC`; those files were checked unchanged across both sides). The binary built in the new folder through the consumer's own `ensure_built` (fetching Nuked-MD there) is byte-identical to the stand-alone repository's (fetched build, and a fresh build from megadrive-python's former `reference/src/Nuked-MD` tree alike). With `NUKED_MD_HARNESS` naming the old directory and then the new folder: `tests/test_milestone6.py` passes (4 tests) both times; every probe of `scripts/run_nuked_md.py`, run through `scripts/nuked_md.py` with trace mask 0x1f and all three memory dumps, gives identical traces, dumps and standard output; and `scripts/run_nuked_md.py probes` prints the same report apart from wall times (3155 of 3546 68000 bus cycles agree). ## m68000-python (WinUAE referee folded into emu-tools-gpl2, 2026-11-24) Today: `validation/referees/referee.py` runs the binary `WINUAE_REFEREE` names (default: a build inside its own `validation/referees/build/`, which it no longer makes); `calibrate.py`, `questions.py`, `bus_errors.py`, `rerun_680x0.py` and `tests/test_referee_evidence.py` go through it. `docs/referees.md` tells the reader to build the stand-alone repository `m68000-winuae-referee` with its `build_winuae.py` and export `WINUAE_REFEREE` as that repository's `build/winuae/winuae_referee`. What changed: the stand-alone repository was folded, with its two commits, into `emu-tools-gpl2` as `tools/winuae` (winuae-referee 0.1.0) and archived as `zzz-m68000-winuae-referee`. It is in the GPL-2.0-only repository because WinUAE's tree at the pin has a file the tool compiles almost everywhere that grants GPL version 2 only, and no licence file at all (`docs/upstreams.md`). The driver and the build steps are unchanged; the build now fetches into `upstream/` and writes the binary one level up, at `build/winuae_referee`, with `build/build-info.json`; the build script answers `--version` and exits 2 on a usage error and 3 on a failed fetch. The consumer's change is the variable's value and the build line in its documents: python3 -I "$EMU_TOOLS_GPL2/tools/winuae/build_winuae.py" export WINUAE_REFEREE="$EMU_TOOLS_GPL2/tools/winuae/build/winuae_referee" No code change is needed (the variable names the binary, as now). `docs/referees.md`, `docs/validation.md`, `docs/provenance.md` and the comments in `referee.py` and `build_referees.py` that name `m68000-winuae-referee` and call the tool GPL-2.0-or-later should name `emu-tools-gpl2`'s `tools/winuae` and call it GPL-2.0-only as built. Later, to follow the contract's one-variable-per-repository rule literally, `referee.py` can join `EMU_TOOLS_GPL2` and `tools/winuae/build/winuae_referee` itself and stop with exit status 3 when it is absent; that is its own change. Tag values OBSERVED (WinUAE 1977af5, via winuae-referee 0.1.0). Gate (as run on 2026-11-24, with the checkout's PyPy venv): the binary built in the new folder (fetching WinUAE there) is byte-identical to the stand-alone repository's, both its existing build and a fresh one, and the fetched trees are identical. With `WINUAE_REFEREE` naming the old binary and then the new one: `validation/referees/calibrate.py winuae` prints the same report apart from wall time (`TOTAL winuae vs m68000: 308416/314988 judged cases agree`, as recorded on 2026-11-19), `validation/referees/bus_errors.py` the same table, and `tests/test_referee_evidence.py` passes (33 tests) both times. The WinUAE pin moved, also on 2026-11-24 (Aubrey's decision): winuae-referee 0.2.0 builds WinUAE at `6e0d5ae`, the commit that adds upstream's `COPYING` with the GPL-2.0 text, where 0.1.0 built `1977af5`, whose tree had no licence file. The command line and the output format are unchanged, and so are the numbers. With `WINUAE_REFEREE` naming a 0.1.0 build and then the 0.2.0 one, m68000-python's `validation/referees/calibrate.py winuae` reports the same 308416 of 314988 judged cases agreeing (317500 cases, 2512 not judged) and the same per-file rows, and its list of disagreements is byte for byte the same; `validation/referees/bus_errors.py` gives the same table (read 87930 of 97354, write 23327 of 70378 and program 76792 of 232309 agreeing, with the same not-judged and clock-difference counts) and the same list of disagreements; and `tests/test_referee_evidence.py` passes its 33 tests both times. So no figure in m68000-python changes value. What the consumer re-records is the provenance attached to the figures: wherever `docs/referees.md`, `docs/validation.md` and `docs/provenance.md` tag the calibration (308,416 / 314,988), the bus-error table or the referee's other outputs as OBSERVED with WinUAE `1977af50` and the stand-alone tool, the tag becomes WinUAE `6e0d5ae` via winuae-referee 0.2.0, and the pin the documents name becomes `6e0d5ae`. The other two scripts that run the referee were checked the same way and need only the same new tag: `validation/referees/questions.py` prints an identical report, and `validation/referees/rerun_680x0.py` an identical 680x0 disagreement table (its first row, 787,660 cases where the core and the CLK corpus agree, of which WinUAE agrees on 779,253) and an identical `--json` file, apart from wall time. To get the new build, run the build script once more (it fetches the new pin beside the old tree, which it leaves alone, and rebuilds `build/` in place), then point the variable at the binary as before: python3 -I "$EMU_TOOLS_GPL2/tools/winuae/build_winuae.py" export WINUAE_REFEREE="$EMU_TOOLS_GPL2/tools/winuae/build/winuae_referee" `python3 -I "$EMU_TOOLS_GPL2/tools/winuae/build_winuae.py" --version` answers `winuae-referee 0.2.0 (WinUAE 6e0d5ae)`, and the tool's smoke test fails on a build left from the old pin. ## ay8910-python (regrouped by upstream, 2026-11-24) Today: `validation/build_referees.sh` finds `ay_tb.v` and `ssg_ref.c` under `$EMU_TOOLS_GPL/tools/ay8910-python/` and builds them against its own fetched copies of the two models in `reference/src/` (lvd2/ay-3-8910_reverse_engineered at `cf8d14d`, YM2203-LLE at `817387f`): `validation/icarus_port.py` gives the AY model's trireg nets keepers in an ignored copy, Icarus compiles `ay_ref`, gcc compiles `ssg_ref`, both into `reference/build-referees/`. `scripts/referee.py`, `scripts/probe_die.py`, `scripts/ssg_referee.py` and `tests/test_referee.py` run those two programs. The two files in the folder are now relative links into the two new tools, so all of that works unchanged. The tools now (READMEs: `tools/ay-die-model/`, `tools/ym2203-lle/`): OSS_CAD_SUITE=DIR "$EMU_TOOLS_GPL/tools/ay-die-model/build.sh" "$EMU_TOOLS_GPL/tools/ym2203-lle/build.sh" The first fetches the AY model at `cf8d14d` (rtl/ only), applies the same keeper change as a patch file to a copy, and compiles the testbench to `$EMU_TOOLS_GPL/tools/ay-die-model/build/ay_ref` (run with `vvp`, as now). The second fetches YM2203-LLE at `817387f` and builds `$EMU_TOOLS_GPL/tools/ym2203-lle/build/ssg_ref`. The command lines and output files of both programs are unchanged. Each tool also has a contract `run.py` (`--version`, exit codes, `manifest.json`): `ay-die-model/run.py --input EVENTS.jsonl --cycles N --out DIR` and `ym2203-lle/run.py --input WRITES.jsonl --cycles N --out DIR [--phase P]`, with the event and write formats in their READMEs. Later (ay8910-python's change): run the two `build.sh` scripts (or have the build script call them); point `scripts/referee.py`'s and `scripts/ssg_referee.py`'s referee paths (and anything else naming `reference/build-referees/ay_ref` or `ssg_ref`) at `$EMU_TOOLS_GPL/tools/ay-die-model/build/ay_ref` and `$EMU_TOOLS_GPL/tools/ym2203-lle/build/ssg_ref`; stop compiling either; retire `validation/icarus_port.py`'s step (the keeper change is now the tool's patch); and drop both models from the fetched references and their pins. The comments that name `$EMU_TOOLS_GPL/tools/ay8910-python/` for the event kinds and the keeper module should name the tools' READMEs instead. A missing binary under the variable is a missing input (status 3). Tag values OBSERVED (ay-3-8910_reverse_engineered cf8d14d via ay-die-model 0.1.0; YM2203-LLE 817387f via ym2203-lle 0.1.0). Gate (as run on 2026-11-24): `sh validation/build_referees.sh` before the move, then the tools' `build.sh`, then the consumer's script again through the links. - `ssg_ref`: byte-identical in all three builds (also after the SPDX line was added to `ssg_ref.c`). All 208 cases of `scripts/ssg_referee.py` give byte-identical raw outputs on the consumer's binary and the tool's (run through the consumer's own `die()`), and the consumer's `python3 -I scripts/ssg_referee.py` prints the same verdicts through the tool's binary (0 cases differ, as before). - `ay_ref`: the keeper-patched model is byte-identical to `icarus_port.py`'s copy. The compiled testbench cannot be byte-identical across builds: Icarus writes run-to-run pointer values and the absolute source file names into it. With those set aside it is identical, and after the SPDX line was added to `ay_tb.v` it differs in source line numbers only. Every synthetic stream of `scripts/streams.py` (24) and every board stream in `validation/streams/` (7), run through the consumer's own `die()`, gives byte-identical pin samples and reads on the consumer's binary and the tool's: 16 streams at full length, the 15 longer ones capped at 400,000 clocks (the full set is 291 million clocks, about a day and a half of Icarus on this machine); after the SPDX line, the same again capped at 100,000 clocks. `tests/test_referee.py` passes (11 tests) on the consumer's build made through the links. After the change, the consumer's gate is the same commands, compared with today's verdicts. ## snes-python and s-dsp-python: snes_spc (regrouped 2026-11-24) What changed: the two identical copies of `spc_dump.cpp` are one tool, `tools/snes-spc` (snes-spc 0.1.0), whose `build.sh` fetches snes_spc 0.9.0 (the archive pinned by SHA-256 `dbad8273...83aed`) and builds `$EMU_TOOLS_GPL/tools/snes-spc/build/spc_dump` with the consumers' own flags. The old paths, `tools/snes-python/spc_dump.cpp` and `tools/s-dsp-python/spc_dump.cpp`, are relative links to `tools/snes-spc/spc_dump.cpp`, so nothing a consumer runs had to change. Today: each consumer's `scripts/dsp_build_referees.py` compiles the driver from its old path under `EMU_TOOLS_GPL` with the archive its own fetch script keeps under `reference/dsp/archives/`, into `reference/dsp/build/spc_dump`, which `dsp_run_referee.py`, `dsp_compare.py` and the referee tests run. Later, so the consumer no longer keeps the archive: run `"$EMU_TOOLS_GPL/tools/snes-spc/build.sh"` once, point the scripts that run the referee at `$EMU_TOOLS_GPL/tools/snes-spc/build/spc_dump` (exit status 3, naming `EMU_TOOLS_GPL`, when it is absent), drop the compile step and the archive from the pinned-files list and the fetch script. Command line and outputs are the same (`tools/snes-spc/README.md`); tag values OBSERVED (snes_spc 0.9.0, via snes-spc 0.1.0). Gate (2026-11-24): the tool's binary and snes-python's own build gave byte-identical raw, register and final-state outputs for 32,000 samples on all 1,028 .spc files of snes-python's DSP set. The same driver file reaches both consumers through the links (byte-identical to the copies they replaced). ## Consumers whose tools are not regrouped yet 65816-python (`W65C816_GPL_TOOLS`), arm7tdmi-python (`ARM7TDMI_GPL_TOOLS`), gba-python (`GBA_GPL_TOOLS`), pcengine-python's Mednafen PSG referee (`PCE_GPL_TOOLS`) and sh2-python (`SH2_GPL_TOOLS`): nothing changed for them in either wave. Their later step is the same as everyone's: set `EMU_TOOLS_GPL` and call the tool at its documented path, `$EMU_TOOLS_GPL/tools//` as `tools/README.md` lists it, until a later wave regroups it (then the path changes once, and this file says so). Their upstreams were re-checked against the rule of 2026-11-24 where it applies (mednafenPceDev, the MiSTer cores) and stay here (`docs/upstreams.md`). ay8910-python's tools were regrouped on 2026-11-24 (its own section, above this one). ## If keeping an old variable working needs an MIT change None is needed while `emu-tools-gpl` and `emu-tools-gpl2` are checked out side by side. On a machine where they are not, ym2610-python and a5200-python can point their old variable at the new folder in `emu-tools-gpl2` with no change; m6800-python and huc6280-python cannot, because their one folder now spans both repositories, and need their scripts to read two roots (`EMU_TOOLS_GPL` and `EMU_TOOLS_GPL2`), as their sections above say. That change is for an MIT-side brief.