# Provenance The provenance audit of 2026-11-13 (wave 1, Claude Opus 5.5), branch `pin-2-od2` at `0f9b724`. This board is a transcription of megadrive-rust (and through it megadrive-python): it inherits every verdict in megadrive-python's `docs/provenance.md` for the code it transcribes, and this file covers only what is its own. The standard is the charter's "Licences and provenance". ## Inherited verdicts that land in this repository's files The transcription carries the same sources into the same places, so the reference's **rewrite** and **unclear** items exist here too and are fixed here when they are fixed there: - `src/render.rs`: Genesis Plus GX's plane-size tables (module doc and `PLANE_ROW_*`; **rewrite** in the reference), the interlace-mode-2 HScroll index after `render_bg_m5_im2` (**unclear**), the CRAM dot colour after BlastEm `write_cram` with `vdp.c` line numbers (**unclear**), `FETCH_AT` (**unclear**). - `src/vdp.rs`, `src/board.rs`, `src/system.rs`, `src/arbiter.rs`: the constants fitted on Nuked-MD, with the reference's split (pin level: relabel as closed-box measurement; internal nodes or rules read from the source: unclear; the refresh tie: rewrite), and Exodus (MIT) as the source of the VDP's port logic (notice owed). - `src/svp.rs`, `src/mappers.rs`: transcriptions (through the reference) of MAME's BSD-3-Clause `svp.cpp` and `bus/megadrive` cartridge files (**cite**). ## Its own additions | Part | Source | Licence | Verdict | | --- | --- | --- | --- | | The Rust structure of the transcription (ownership, traits, the trace format, `md-trace`, `md-run`) | own | -- | **clean** | | `src/play.rs`, `src/bin/md-play.rs`, `src/frontend.rs`: the SDL2 window | megadrive-python's `frontend.py`; the `sdl2` crate | MIT (crate), zlib (SDL2), linked | **clean** | | `scripts/lockstep.py`, `md_trace.py`, `seeded_faults.py`, `make_board_vectors.py`, `make_eeprom_vectors.py`, `fetch_megadrivepython.sh`, `cases.tsv` | own gate tooling | -- | **clean** | | `scripts/make_examples.py` and `tests/examples/*.bin`/`*.trace` | cartridges assembled word by word here; traces written by the reference | -- | **clean** | | `tests/*.rs` | own | -- | **clean** | | `README.md` "License" | says the cited emulators were "never read into this repository" | -- | **cite**: true of this transcription; add that the reference's own use is audited in its `docs/provenance.md` | | Crate dependencies (`Cargo.lock`) | flate2, miniz_oxide, zlib-rs, serde, serde_json, sha1_smol, sdl2 and their dependencies | MIT / Apache-2.0 / zlib (their own) | **clean** | | `src/bin/md-bench.rs`, `src/bin/md-profile.rs`, `scripts/ab.sh`, `bench.sh`, `ladder.sh`, `pgo.sh`, `profile.py`, `lines.py` | own measurement tools | -- | **clean** | | The speed work in `src/` (memo caches, lookup tables over line offsets, `frame_rgb_into`) | own; the lockstep gate keeps it equal to the reference | -- | **clean** | | `tests/frame_rgb_into.rs` | own | -- | **clean** | | Cores: m68000-rust-fast, z80-rust-fast (pinned by commit) and, by path, the restarted ym2612-rust and sn76489-rust; ssp1601-rust by path | the family's cores; audited in their own repositories | per core | out of scope here | ## Fixes made in this audit (citation only) - `src/svp.rs`, `src/mappers.rs`: a line naming the MAME files' licence (BSD-3-Clause) and copyright holders, as in the reference. ## Git history No file was ever deleted from this repository's history and nothing third-party was committed. Earlier `Cargo.toml` revisions pinned the archived ym2612-rust and sn76489-rust-fast crates by git commit: references only, no code of theirs is in this history. ## Not done here **There is no LICENSE file.** `Cargo.toml` says `license = "MIT"` and the README says MIT; the charter requires a LICENSE file. Left for after the audit's outcome, as instructed. The compiled board is served by play-md.supertux.com; when it ships, the BSD-3-Clause and MIT notices of what it contains go with it. ## Wave 2 (2026-11-19) Carried down from megadrive-python's wave 2 (its `docs/provenance.md`, "Wave 2", commits `5ad77f6`..`227de45`), which re-established the flagged items from closed-box runs read at the pins, documents and MAME's BSD-3 files: - `src/render.rs`: the plane addressing rewritten (`PLANE_ROW_BYTES` for the shifts), from CMD and the reference's pin-level measurement of all 16 sizes; same values. The BlastEm and Genesis Plus GX citations (CRAM dots, `render_map`, the IM2 HScroll index) replaced by the reference's pin-level results or marked HYPOTHESIS. - `src/board.rs`, `src/system.rs`, `src/vdp.rs`: the refresh tie (`RAM_REFRESH_TIE_MCLK`, `RAM_REFRESH_TIE_AFTER_SELF_RUNS`, `ram_refresh`'s `tie`) and the dot-clock edge tables removed (behaviour change on `nuked-md` only); the full-screen vertical scroll latch refitted on the picture (plane B $13F in H40, $102 in H32; plane A $104 in H32): behaviour change. "Die-derived" relabelled OBSERVED (Nuked-MD @ 594ca2a, closed box); `reg_addr` citations replaced by Kabuto. - `src/mappers.rs`: 777 Casino's protection values dropped, as in the reference. - `NOTICE`: MAME's BSD-3 holders and Exodus's MIT notice. Still no LICENSE file (wave 4). - `tests/examples/`: traces regenerated from the reference at `227de45`; `boards.txt` regenerated (777 Casino's row moved every later board's random stream). - **Found in wave 2, not in wave 1: `src/render.rs` `serial_line` and `SerialPort`** (commit `fe43425`, 2026-11-04): a border line with plane A forced on shows the VRAM serial port; its comment says it was worked out from "Nuked-MD `vdp.c`'s plane pipeline and `vram.c`'s serial port, traced on Overdrive 2's arcade", i.e. from the model's source. Verdict **rewrite** (or remove): it is this board's own, the reference does not have it, and no lockstep case reaches it. Not changed here (it is served by play-md); left for the owner, with the rest of `fe43425` to be checked the same way. ### `serial_line` / `SerialPort` removed (2026-11-19, wave 2 follow-up) Removed unread (rule 2): `serial_line`, `SerialPort`, `serial_phase`, the helper `fetch_address` that only `serial_line` called, and their fields and plumbing in `src/render.rs`, located by name and line range and moved aside to the git-ignored `trash/` without their bodies being displayed (the agent saw the doc comments, the commit message and three plumbing lines a `grep` printed, nothing of the algorithm). What it did, from the repository's own records: in the **raster export only** (`Renderer::enable_raster`, `frame_raster`, used by `md-run`'s whole-raster output for comparing Overdrive 2 against Nuked-MD's RGB pins), a border line with plane A forced on by the debug register drew a dot pattern instead of black. `frame_rgb_into`, which play-md and md-play draw, never read it, so the picture players see is unchanged. No lockstep case reaches it: after the removal `cargo test` passes and `scripts/lockstep.py --reference` megadrive-rust `3b0cdf8` is **80 of 80 identical**. Behaviour change: Overdrive 2's arcade end (frames about 12,913-13,021, debug $140) draws black border lines again in the raster export, where Nuked-MD shows a pattern; the commit `fe43425` had counted 694,539 wrong border pixels over the demo before the feature and 122,499 after (not re-measured here). It was **behaviour, not a speed path**, so it cannot be re-derived from the reference tier: megadrive-python has nothing like it. If it is wanted, it starts in megadrive-python from permitted sources (the VRAM's serial-port behaviour from the DRAM maker's datasheet, Kabuto's debug-register notes, Nuked-MD run closed-box at its RGB and VRAM pins, md-probe-cart hardware frames), written by an agent that has not read the removed code's description, and is carried down through megadrive-rust. **Not yet carried upstream either, found while doing this** (also this tier's own, raster export only, not from any GPL source by their commit messages, but outside the rule that this tier changes no behaviour of its reference): border lines as the VDP reaches them (`0d0f5cf`: `borders`, `border_line`), CRAM dots in the borders (`46ede2f`: `edge_dots`), side borders black under a forced plane (`SIDE_BLACK`), and PAL vertical-sync blanking (`raster_row`, `fe43425`). Line `$1FF` scanning the first line's sprites (`2a186e2`) touched the renderer as well. Each should either move up to megadrive-python or come out of this tier; left for the owner.