# sh2-python's jgenesis harness From the emulator family's sh2-python repository: `validation/jgenesis_harness/` and `scripts/build_jgenesis_harness.py`, moved out on 2026-11-22 (wave G) as they stood at sh2-python `15c60ab` (the 2026-11-21 reset; `94c58d8` after the rewrite, without them). ## What it measures Register and memory results of SH-2 instructions on jgenesis' interpreter, case by case, for sh2-python's rung-1 corpus, and its DIVU edge cases. OBSERVED (jgenesis d41e2d9). ## Who uses it sh2-python, which finds this folder through `SH2_GPL_TOOLS`. Run `build_jgenesis_harness.py` from an sh2-python checkout (or with `SH2_PYTHON_ROOT` naming one); the binary lands in that checkout's `reference/build/jgenesis-sh2/target/release/sh2-jgenesis-harness`, where `validation/rung1/` and `validation/divu/probe.py` expect it. ## Contents - `jgenesis_harness/`: A Rust crate that runs rung-1 corpus cases on jgenesis' `sh2-emu`: one case per line on standard input (seed, registers, code and data words, landing addresses), one result per line on standard output (status, registers, every changed byte); a disassembly mode lists the core's disassembler output. Upstream: jgenesis (jsgroth), GPL-3.0, `d41e2d9`. - `build_jgenesis_harness.py`: Assembles a small Cargo workspace of copies of `sh2-emu` and jgenesis' two common crates with this crate, adds a `registers_mut` accessor to the copy of `sh2-emu` (no instruction, bus or timing code touched), and builds it with two unstable library features enabled for that one command. On moving here its root became `SH2_PYTHON_ROOT` or the working directory and the crate is taken from beside it; the patch text is unchanged. Upstream: the same jgenesis tree. ## Licence and notices Our code (alewman), first published under MIT in sh2-python (`../../notices/MIT-emulator-family.txt`; the crate's source says MIT and that the binary is a GPL-3.0 tool). The built harness is GPL-3.0, and the build script patches GPL code. Upstream code is not committed here, except where a file above says it carries upstream lines; each tool fetches and builds its upstream at the pin from the consuming repository. This repository is GPL-3.0-or-later (`../../LICENSE`). ## Outputs Every value these tools give is a closed-box measurement: tag it OBSERVED with the upstream and its pin, and let any document or hardware measurement overrule it (`emu-tools/docs/wall.md`). Nothing here has been refactored onto the shared contract yet (`emu-tools/docs/contract.md`); that is the next job.