# Provenance Audit of 2026-11-13 (provenance audit wave 1), against the family charter's "Licences and provenance" section and the rules of the November 2026 sound-core restart: GPL/LGPL code is never copied or transcribed; GPL/LGPL programs are used as closed boxes only; facts about the chip are usable with their source recorded; permissive sources keep their notice. ## What changed since the core was written The core and its documents were written (2026-11-05) under the older rule "GPL sources are read and cited, never copied": bsnes (GPL-3), Mesen2 (GPL-3) and snes9x were open while the documents and the core were written, and line numbers into them are cited. That rule is superseded. From now on: **bsnes, Mesen2 and snes9x are closed boxes; their source is not opened.** `docs/handoff-brief.md` still states the old rule and must be updated before the next build session (see "Owed"). What keeps this repository clean despite that history: - **byuu's uPD96050 model is also published under ISC.** ares (`ares/component/processor/ upd96050`, ISC, "Copyright (c) 2004-2025 ares team, Near et al") carries the same core as bsnes (token similarity 0.95 after normalising type names, measured 2026-11-13 by a count-only comparison; ares differs in the SUB/ADD carry, C1). MAME's `cpu/upd7725/upd7725.cpp` is BSD-3-Clause (copyright-holders R. Belmont, byuu; "Original by byuu in the public domain"). Every behaviour this core takes from "bsnes" is therefore available from a permissive source, and is cited to it below. - **Mesen2 is never the only source** of a behaviour in `src/`: every switch and default names the NEC data sheet, fullsnes, ares or MAME as well. - **No copying found.** `pcengine-python/scripts/provenance_check.py` was run against ares' `upd96050` (ISC), MAME's `cpu/upd7725` (BSD-3), and, because reading them was this project's documented practice when it was written, bsnes' `processor/upd96050` and `sfc/coprocessor/necdsp` and Mesen2's `Core/SNES/Coprocessors/DSP`. Only mnemonic lists (`jnca jca jncb ...`, `nop or and xor ...`) and the conditional-jump code table (080h-0AEh) matched: these are the NEC data sheet's instruction set (DS pp.23-24), facts. No code shape, no quoted line. Mesen2 and the bsnes board glue: no hits at all. ## Verdicts | Piece | Behaviour from | Licence of source | Verdict | |---|---|---|---| | `_fields.py` (decode, field names, mnemonics) | NEC uPD77C25 data sheet U12675EJ7V0DS00 pp.23-24; fullsnes "DSP-n" opcode tables | NEC copyright document (facts); fullsnes (facts) | clean | | `_jump.py` (BRCH table, uPD96050 HJMP/HCALL/JMPSO) | DS pp.23-24; fullsnes "JP Instructions" | facts | clean | | `_alu.py` (ALU, flags, C1, C2) | DS (14); C1/C2 emulator rules: ares (ISC) and MAME `upd7725.cpp` (BSD-3) | ISC / BSD-3 | cite: name ares and MAME (not bsnes) for C1/C2, keep notices (below) | | `_op.py` (moves, DP/RP, C3, C4, C16) | DS (5), DB p.9; ares, MAME (C4 bit reversal) | facts / ISC / BSD-3 | cite: as above | | `cpu.py` (step, multiplier, reset, C6, C11) | DS (25); fullsnes "Reset"; ares (C11); MAME (C6) | facts / ISC / BSD-3 | cite: as above | | `model.py` (uPD7725 vs uPD96050 sizes, clocks) | DS; fullsnes "Registers", "External Oscillators"; byuu's uPD96050 (ares) | facts / ISC | cite: ares for the uPD96050 facts fullsnes lacks | | `images.py` (PROM layout, little-endian files) | fullsnes "Oldest/Newer Files"; MAME device-set layout | facts | clean | | `harness.py`, `replay.py`, `trace.py`, `state.py`, `debug.py`, `console.py`, `disasm.py`, `__main__.py` | own tooling; `replay.py` replays MAME 0.285 traces (closed-box run) | own work | clean | | `scripts/mame_dsp_trace.py`, `survey_programs.py`, `fetch_references.py` | MAME run as a closed box; game program images read in place (BYOR) | own work | clean | | `tests/` (constructed words, MAME replays, self-tests) | own; MAME traces generated locally, not committed | own work | clean, except `tests/test_selftests.py` docstring: **cite** (quotes a snes9x code fragment, ``Op0FPass = 0x0000``; replace with prose "DSP-1 command 0Fh returns 0000h") | | `docs/start-here.md`, `timing.md`, `undocumented-behavior.md`, `validation.md`, `claims.md` | DS, DB, fullsnes; emulator-tier entries cite bsnes/Mesen2 line numbers | mixed | cite: re-point bsnes citations to ares (same model, ISC); mark Mesen2 entries "read from source under the old rule; to be re-established closed-box if ever relied on" | | `docs/mame-oracle.md` | MAME run closed-box; quotes one line of MAME `snes.cpp` (BSD-3) | BSD-3 | cite (BSD-3 notice for the quoted line) | | `docs/handoff-brief.md` | policy text | n/a | **rewrite** the line "GPL sources are read and cited, never copied" to the closed-box rule | | `scripts/pinned_repos.json` | reference pins | n/a | cite: change the bsnes/Mesen2/snes9x `license` notes from "read and cite, never copy" to "closed box only" | Counts: clean 9, cite 8 (plus the test docstring), rewrite 1 (a policy sentence), unclear 0. No ROM or program image is committed (game images come from `MAME_ROMPATH`-style BYOR paths). Git history (12 commits, one branch, no remote): no file was ever deleted; nothing in history differs in provenance from the tree. ## Owed 1. `docs/handoff-brief.md` and `scripts/pinned_repos.json`: replace "read and cite, never copy" with "closed box only" for bsnes, Mesen2, snes9x; name ares (ISC) and MAME `upd7725.cpp` (BSD-3) as the citable form of byuu's model. 2. Notices to keep with what was taken from the permissive models (in this file is enough until code carries per-file headers): ares ISC notice ("Copyright (c) 2004-2025 ares team, Near et al", ISC permission text); MAME BSD-3-Clause, copyright-holders R. Belmont, byuu. 3. `tests/test_selftests.py`: replace the snes9x code quote with prose. 4. SPDX headers: no source file has one yet (family-wide pass owed). 5. Not provenance, but a house rule: a mirror's name and machine paths appear in `docs/mame-oracle.md`, `scripts/mame_dsp_trace.py`, `scripts/survey_programs.py`, `src/upd7725_python/replay.py` (a default argument) and `tests/conftest.py`; use `MAME_ROMPATH` instead. ## Wave 2 (2026-11-19) The rewrite of the wave-1 "Owed" list, in place (the flagged pieces were citations and policy text, no code; nothing was marked `rewrite` in `src/`). Rules: the family's wave-2 rewrite rules and `emulator-lineage/docs/sources.md`. bsnes, Mesen2, snes9x and MAME's GPL files were **not opened** during this work; ares (ISC) and MAME's BSD-3 files (`upd7725.cpp/.h`, `bus/snes/upd.cpp/.h`, `snes_slot.cpp`, `nintendo/snes.cpp`, each header checked) were read at the pinned revisions to re-point every citation. | Item | Was | Now | New source | Verdict | |---|---|---|---|---| | Policy text (`handoff-brief.md`, `start-here.md` sources list, `README.md`, `pinned_repos.json`) | "GPL sources are read and cited, never copied"; "read and cite, never copy" | **closed box only** for bsnes, Mesen2, snes9x, MAME's GPL files; ares and MAME `upd7725.cpp` named as the readable, citable form of byuu's model | rules of 2026-11-19 | clean | | `pinned_repos.json` bsnes, Mesen2, snes9x | sparse source pins with `local` copies | `"fetch": false`, no `local`; `fetch_references.py` skips them ("closed box, not fetched") | n/a | clean | | "bsnes" citations in `docs/` (start-here, timing, undocumented-behavior U2-U12, U18, C1-C16, validation, claims, README, handoff-brief, mame-oracle) | bsnes file and line numbers | ares file and line at 9408cb4 (e.g. U8 `instructions.cpp` l.230, U2 l.137/l.146, C11 `upd96050.hpp` l.63, clocks `load.cpp` l.383-387/l.420-424, sync `necdsp/memory.cpp`), or MAME BSD-3 lines | ares (ISC), MAME (BSD-3) | cite | | Quoted code fragments (U2 `if(dst != 4)`, U4 `0x8000 - flags.a.s1`, C1 carry chain, C11 `_drs = drs & !drc`) | quoted from bsnes (C1 from ares) | the identical fragment cited in ares, notice in NOTICE; `exec(); step(1);` and `synchronizeCoprocessors` replaced by ares' own names in prose | ares (ISC) | cite | | C1 (carry) | "bsnes and MAME compute `r < q`" | the comparison rule cited to MAME `upd7725.cpp` l.433, l.437 only; ares is **not** claimed to agree (it computes the carry chain, l.105-109, which is the default) | MAME (BSD-3); DS (14)(a); ares | cite | | Mesen2 statements (docs) | Mesen2 function names and behaviours, read from source | marked † with a legend in start-here, undocumented-behavior and validation ("read from source under the old rule (before 2026-11-19); closed box from now on; never the basis of a default"); Mesen2 identifiers dropped; in `src/` comments Mesen2 dropped wherever ares or MAME carries the claim | ares, MAME, DS | cite | | snes9x / bsnes HLE (validation.md) | file names and quoted comments ("Based on research by ...", "Bit accurate hardware algorithm", "not verified") | paraphrase without quotation, marked †, to be run as closed boxes only | none (closed box) | cite | | `tests/test_selftests.py` docstring | quoted snes9x ``Op0FPass = 0x0000`` | prose: "DSP-1 command 0Fh returns 0000h" | the program (rung 2) | clean | | `src/` comments (`_alu.py`, `cpu.py`, `_op.py`, `images.py`, `replay.py`) and test docstrings (`test_alu.py`, `test_host.py`) | "bsnes", "bsnes/ares", Mesen2 | ares (with file and line where a rule is stated) or MAME | ares, MAME | cite | | Machine paths and mirror names (`mame-oracle.md`, `start-here.md`, `handoff-brief.md`, `mame_dsp_trace.py`, `survey_programs.py`, `replay.py --roms`, `tests/conftest.py`, `pinned_*.json` `local`) | a mirror's folder names and `/data/...` paths; `UPD7725_ROMS`, `SNES_MAME_ROMPATH` | `MAME_ROMPATH` (`;`-separated, as MAME's `-rompath`) via `upd7725_python.rompath`; scripts stop with a message and tests skip when it or a set is missing; `local` pins are paths relative to the repository (`../snes-python/...`); MAME found as `$MAME` or `mame` on the PATH | n/a | clean | | NOTICE | absent | ares ISC notice (copied from ares' LICENSE) and MAME's BSD-3-Clause with the copyright holders of each cited file | ares, MAME | clean | | SPDX | none | `# SPDX-License-Identifier: MIT` on every `src/`, `tests/` and `scripts/` Python file (no file carries ares or MAME code) | n/a | clean | Behaviour: **no change**. No default, switch or test expectation changed; the only code changes are the ROM lookup (`MAME_ROMPATH`) and `replay_run(run_dir, rompath=None)` (was `roms: Path`, a folder). Tests (PyPy, full suite incl. the seven MAME replays): 146 passed before, 146 passed after; CPython quick loop 139 passed; with `MAME_ROMPATH` unset, 117 pass and 29 skip cleanly. The wave-1 "Owed" items 1-5 are done. What remains: - The † entries stay as recorded observations from the old rule. If a future change ever rests on one of them, re-establish it with Mesen2 run as a closed box (validation.md rung 5) and tag it OBSERVED. - The wave-1 statement that ares equals bsnes but for C1 is the audit's count-only comparison (2026-11-13); it was not re-checked (bsnes stays closed). - Downstream: snes-python pins this core; it must set `MAME_ROMPATH` for the replays and uses `replay_run`'s new signature only if it calls it (it does not, as far as this repository knows). ## Closed-box pins removed (2026-11-24) Aubrey's rule of 2026-11-24: an MIT repository does not download or keep the source of anything the family's `sources.md` marks closed box only. Three entries that were already never fetched (`"fetch": false`) but listed source paths left `scripts/pinned_repos.json`; they are cited by URL and commit only: bsnes (https://github.com/bsnes-emu/bsnes @ `78474e5d39f58872dc21aca18cf9eb583b147fe7`, GPL-3.0), Mesen2 (https://github.com/SourMesen/Mesen2 @ `b9fa69ddc6d0a331fb103fdb5eef6904305703c2`, GPL-3.0; its build may be run as a closed box) and snes9x (https://github.com/snes9xgit/snes9x @ `1bcc369e89f08243e0a462882fb1f3e42e51de3a`, non-commercial). handoff-brief.md no longer names Mesen2's class. Nothing was moved: no closed-box tree was in this repository.