# Restart rules This repository is a restart. The first `snes-python` (built 2026-10-23 to 2026-11-13) was written with GPL and LGPL source open as its working model: the S-CPU timeline, the PPU, DMA, the SA-1 and the chip boards followed bsnes v115 (GPL-3.0) and Mesen2 (GPL-3.0), the S-SMP timers followed bsnes `smp/timing.cpp`, and the in-board S-DSP was a statement-by- statement restatement of blargg's snes_spc 0.9.0 `SPC_DSP.cpp` (LGPL-2.1), per a brief that said so. Its own audit (wave 1, 2026-11-13) marked 11 parts **rewrite** and 6 **unclear** across most of the board. Forbidden source was the model for most of the code, so on 2026-11-19 the board was restarted rather than repaired in place. - **Archive:** the first repository, as it stood at `32d51ec` (2026-11-13), is a local copy at `/data/backup/snes-restart/zzz-snes-python`. It is never read again: not its code, its tests, its documents written after the restart point, or its commit messages. Its fetched third-party trees (`reference/`, `tests/test_roms/`, `probe-pack/`) and the PyPy virtual environment were moved out of it into this repository first; they are not our work. - **Restart point:** `bfa810b` (2026-10-22), the last commit before the build began (`54cf705`, "Milestone 1 in progress", 2026-10-23). It holds Phase 0 (the documents, the pins, the detector drivers, the census), Aubrey's decisions of 2026-10-21 and the first five console probes. This repository's history is the first repository's up to that commit and nothing after. - Commit hashes after `bfa810b` quoted in carried documents (for example "probes/suite at 56b9443") name commits of the archive; they are kept as the record of which build wrote a console save. ## The rules 1. **No GPL, LGPL, MPL, non-commercial or unlicensed source is read.** Not to learn an algorithm, check a constant or settle a doubt. For this board that covers bsnes and higan (GPL-3.0), Mesen2 and MesenCE (GPL-3.0), snes9x (non-commercial), blargg's snes_spc and its `SPC_DSP.cpp` (LGPL-2.1), MAME's GPL and LGPL SNES files (`snes_ppu.cpp`, `bus/snes/rom.cpp`, `rom21.cpp`, `spc7110.cpp`, `snescx4.cpp`: GPL-2.0+; `sound/s_dsp.cpp`: LGPL-2.1+), game-music-emu, and anything else sources.md does not mark "code OK". 2. **The archive is not read**, in any form. 3. **Translating a model statement by statement is copying**, in any language. Code is written from a written description of behaviour, never from another program's source. 4. **Permitted sources:** anomie's SNES documents (timing, registers, memory map, S-DSP); fullsnes (Martin Korth: facts only, cite section); the SNESdev wiki (facts only); Nintendo's development manual (facts); **ares** (ISC, the permissive twin of the bsnes cores through their common author: code may be used with its notice, kept in `NOTICE` and beside what is taken; its `sfc/dsp` is "a rewrite of blargg's SPC_DSP", so for the S-DSP only its separate formulas are taken, with the notice, never its code wholesale); MAME's BSD-3-Clause SNES files after a per-file header check (`snes.cpp`, `snes_m.cpp`, `snes.h`, `sa1.cpp`, `sdd1.cpp`, `spc700`, `upd7725`); SingleStepTests (MIT); gilyon's and undisbeliever's test ROMs; krom's test ROMs (run); blargg's `spc_dsp6` and timer test ROMs (run as tests; his `notes.txt` hardware measurements are facts); console probes on Aubrey's Super Famicom (tier 1). 5. **A model may be run, never read.** bsnes, Mesen2, MAME (all files) and snes_spc may be built and driven by a harness written here, as a detector and as a measuring instrument (owner's rulings of 2026-11-13). Their source files are not opened, searched or quoted, including when a comparison fails. A value got that way is tagged `OBSERVED` (model and pinned commit named) and is overruled by any document or hardware number that disagrees. 6. **A difference from a closed box is written down, not fixed**, unless a document or a hardware measurement independently says the board is wrong; then cite that. 7. **The middle rule.** A fact is usable when someone established it on real hardware and says so in prose. A comment inside a GPL or non-commercial program saying it was verified on hardware does not make it a hardware fact (owner's ruling, 2026-11-19). Code fragments in any document stay unread; tables a source says were copied from a GPL program are out unless established independently. 8. **Every rule in the code names its source** with an evidence tag (`MEASURED`, `DIE`, `TEST ROM`, `DOC`, `OBSERVED`, `FITTED`, `HYPOTHESIS`). 9. **Nothing by furrtek**, or by any author who objects to AI use. 10. **The documents inherited from `bfa810b` were written under the older rule** ("GPL source: read, cite, never copy"). Every statement in them that rests on reading bsnes, Mesen2, snes9x or snes_spc source is struck or re-sourced (recorded in `docs/provenance.md`) before code is written from them. ## What came over From the restart point (`bfa810b`): every document (scrubbed, rule 10), the pin lists and fetch scripts, the MAME and Mesen2 detector drivers (closed-box harnesses), the cartridge census, the probe-pack builder, the five console probes and their decoder. From the first build's working tree, because they are this project's own work and rest on no implementation's source (audit verdict **clean**), copied before the archive was made: | What | Why it is clean | | --- | --- | | `probes/` at its final state (the probe suite `probes/suite/`, `photo_bright`, `photo_hires` and the five probes) | own 65816 assembly; each test is a question put to the console | | `tests/console/` (the console's saves of 2026-10-24 and 2026-10-25, and MAME's and Mesen2's saves of the same suite build) | hardware recordings (tier 1) and closed-box detector output | | `docs/probe-suite.md`, `docs/probe-suite/*.md` | the suite's own documentation and the console's answers; scrubbed under rule 10 | | `scripts/suite_results.py`, `suite_run.py`, `mesen_frames.py`, `mesen_run.py`, `build_probe_pack.py`, `pinned_repos.json` | own tools: a save decoder and closed-box drivers | | `scripts/dsp_make_spc.py`, `dsp_fetch_games.py`, `dsp_referee/` | own synthetic `.spc` writer, a fetcher, and the snes_spc referee driver (rewritten, see docs/dsp) | Not carried over: all of `src/`, every test of the first build, its validation and conformance records, `docs/dsp/claims.md` and `conformance.md`, its board saves and frame captures, and the board-coupled scripts (`dsp_compare.py`, `dsp_mutation.py`, `dsp_game_sweep.py`, `dsp_make_examples.py`, `dsp_smp_compare.py`, `ppu_pictures.py`, `probe_three_way.py`, `selftest_run.py`, `smoke_frames.py`), which are rewritten against the new board when needed. Removed at the restart: `scripts/dsp_schedule.py` (parsed `GEN_DSP_TIMING` out of the LGPL `SPC_DSP.cpp` and quoted a fragment of it) and `scripts/dsp_gauss_tables.py` (read the Gaussian tables out of the pinned GPL and LGPL trees at run time). Fixed at the restart: machine paths in `scripts/count_carts.py`, `mame_trace.py` and `mesen_run.py` replaced by `NO_INTRO_DIR`, `MAME_ROMPATH` and `MESEN_CORE`. ## The order of work 1. Scrub the inherited documents (rule 10); rewrite `docs/dsp/handoff-brief.md` so it no longer says to transcribe snes_spc. 2. Rebuild the board milestone by milestone in `docs/handoff-brief.md`'s order, one milestone (or a reviewed part of one) per commit, from the permitted sources. 3. The charter's obligations: SPDX headers, `NOTICE` (ares ISC; MAME BSD-3 where used), the lineage line, `docs/status.md`, evidence tags. Where the rebuild stands is in `docs/status.md` and `docs/build-status.md`.