A reimplementation of a console game has one judge: the original, on its hardware or a faithful emulator. This page describes how this project turns that judge into a measurement that runs on every change, in terms that do not depend on the game, the console or the engine. Each step links to the page where this repository does it, as a worked example.
Capture moments of the original as emulator save states. For each one, read what the original was doing out of the state's own memory, put the reimplementation into the same situation, and score what it does against what the original did, channel by channel. Commit the scores as a baseline that may only rise. Around that loop sit the practices that keep it honest: an evidence grade on every claim, a register of disproved readings, a coverage denominator taken from the original's data, and runs that replay bit for bit.
The parts that read emulator states and disc images are reusable code: reusing for other PS1 games says which crates carry, and runs them on a made-up game.
A save state is the unit of evidence: the whole machine at one instant, main RAM, video memory and display registers, sound RAM, scratchpad. Every channel is read out of it offline, so no emulator runs during a measurement and one capture serves every later change.
A capture is an oracle only if the reimplementation can be put into the same situation. Read the scene, position, party, story flags, camera and fight state from the original's memory; enter that situation through the engine's own code; tick until it settles.
A channel is one observable read from both sides and scored in 0..1, with a stated tolerance and falloff so a near miss counts and noise does not move the number (channels).
Read the worst states first. For each, decide whether the divergence is the instrument's (a seeding gap) or the engine's, and catalogue the shapes that recur (divergence shapes).
Commit per-state, per-channel scores. A check fails when a score falls, when a measured channel goes unmeasured, or when a seedable state stops seeding; a rise is folded in by a reviewed bless (the ratchet). The baseline holds scores, never pixels or memory.
Two ways a ratchet is defeated without tripping
The baseline is edited in the same commit: a second gate compares every baseline with the base revision and fails on any value that moved the wrong way unless a ledger records that exact step with a reason. The measurement never runs: a test that skips for want of data reports as a pass, so count skips by reason on the machine that has the data (ratchet integrity).
A save state answers for the inputs it happened to hold. A rule the original computes - a damage roll, a status tick, a sort, a camera matrix - also has inputs no capture reached, and a reimplementation can be wrong only there. Close that gap by running the original's routine itself: load the executable and its overlay off the user's disc into a user-mode interpreter of the console's CPU and coprocessors, seed memory with generated inputs in the shapes the game reaches, call the routine, and compare every byte of the regions it wrote with what the port's kernel produces from the same inputs. Hook the random-number call so both sides draw one stream, and assert the run reached the arms it claims to test (retail kernel differential).
Three rules make it a gate rather than a test suite:
A differential is also the strongest provenance evidence there is: a tag claiming a routine is checked by running that routine. What it cannot see is when and with what the engine calls the kernel, which the state corpus and the films measure. Where it sits among the other checks is the verification ladder.
Every answered question carries the grade of its weakest load-bearing evidence: disassembly (instructions at stated addresses), capture (a state, probe log or measured oracle), decompiled-C (a decompiler's rendering, an inferred signature, a typed-in label) or inference (reasoning from surrounding facts or absence). The third marks a claim nobody has checked against instructions, which makes it a re-audit worklist (the evidence column).
Decompilers fail in repeatable ways: arguments left in registers vanish from calls, stores are reordered or dropped, labels inside a large function print as calls, a module imported at the wrong base prints every address shifted (decompiler artifacts). Port from the instructions, and hold a "no writers found" claim to the bar of a positive one (address reference scan).
An undocumented format invites the same wrong readings from every newcomer. Keep each disproved one in three parts: the tempting reading and why it tempts, the decisive instruction, capture or count, and what is true instead. Entries are terminal; new evidence moves a row back to the open questions rather than rewriting its verdict (do not re-walk).
Progress counted over work already done always flatters. Count against what the original contains:
Negative results take the same discipline: a search over raw bytes, in every encoding an address can take, is what turns "no caller found" into "no reference exists".
Make the engine deterministic under a recorded input stream: a text file of per-frame pad transitions plus the seed replays to a bit-identical state trace. A test that runs one stream twice, with companions showing that another stream and another seed each change the trace, keeps determinism from regressing without any data from the original (determinism gate). Then every bug report is a replay file and every fuzzing finding reduces to the inputs that matter (soak harness).