# emulator-lineage ## Start here - [docs/charter.md](docs/charter.md): what the family is for and its shape: three axes (hardware confidence, modelling level, execution fidelity), the tiers (`x-python` spec, `x-rust` transcription, `x-rust-fast`, `x-rust-turbo`), proof obligations, concessions, domains and multiple cores, capabilities and the adaptive host, how change flows, provenance. - [docs/families.md](docs/families.md): every core, board and site placed in that shape, with what each still owes it. - [docs/sources.md](docs/sources.md): every outside source and what we may do with it (code with notice, facts only, closed box only, excluded); check it before using one. - [docs/provenance-audit-2026-11.md](docs/provenance-audit-2026-11.md): the family-wide provenance audit toward MIT-licensable everything: findings, live sites, histories, decisions, the fix plan. - [docs/methodology.md](docs/methodology.md): evidence tags, gates, measuring speed, documents, provenance practice, house rules. - [docs/agents.md](docs/agents.md): briefing and reviewing agents; `docs/CLAUDE.md` is the file that makes every session under /data/emu start aligned. ## The map The family tree of the emulator cores and boards: what each project descends from, at which pin, and on what evidence; which fixes and features have not yet reached which projects. Each core is certified against its oracles once, and each board is built on cores and on pieces of its siblings. When a core gains a fix, or a board improves a piece it took from a sibling, the change reaches the rest of the family only if someone carries it there. This repository is where the paths are written down, so a report can say what has not travelled yet. ## The projects Fifty-four, one manifest each in `projects/`. Python is the reference; a `rust` project is a transcription held to the reference's conformance kit; a `-fast` project is a speed fork held in lockstep with what it forks; a site is a page people play. | family | reference | port | fast | boards and sites on it | | --- | --- | --- | --- | --- | | Z80 | z80-python | z80-rust | z80-python-fast, z80-rust-fast | sms-python, megadrive-*, galemu, z80-wasm, emu-galaga, galaga-remix | | 68000 | m68000-python | m68000-rust | m68000-rust-fast | megadrive-* | | YM2612 | ym2612-python | ym2612-rust | ym2612-rust-fast | megadrive-* | | SN76489 | sn76489-python | sn76489-rust | sn76489-rust-fast | megadrive-*, sms-python | | Mega Drive | megadrive-python | megadrive-rust | megadrive-rust-fast | play-md (play-md.supertux.com) | | Galaxian / Galaga | galemu | z80-wasm (galaxian.supertux.com) | | emu-galaga (emu.supertux.com), galaga-remix (neongalaga.supertux.com) | | 6502 | 6502-python | 6502-rust | | famicom-python, a2600-python, a2600-rust, a2600-rust-fast, huc6280-* | | SM83 | sm83-python | | | gameboy-python | | HuC6280 | huc6280-python | huc6280-rust | huc6280-rust-fast | pcengine-* | | PC Engine | pcengine-python, supergrafx-python, pcenginecd-python | pcengine-rust, supergrafx-rust, pcenginecd-rust | pcengine-rust-fast | play-pce (play-pce.supertux.com) | | others built | i8080-python, m6800-python | | | | | planned (docs only) | m6809-python, i8086-python, mb88xx-python, mcs48-python, tms34010-python | | | | The Sega stack, from the chips to the page: `python3 lineage.py --for play-md`. ## Three kinds of edge - **Equivalence** (`[[evidence]]`): what a project is certified against, such as SingleStepTests, ZEXALL, hardware captures or a die-derived model, and where the record is kept. A detector is never a judge: the record says which is which. - **Dependency** (`[[depends]]`): a project built on another at a pin. The pin itself is not copied here; the manifest names the file that declares it (`declared_in`), so it cannot drift. A pin goes stale: the report lists the upstream commits it lacks. pyproject.toml (`@ git+...@REV`, `>=X`, `==X`) and Cargo.toml (`git = ".../name"`, `rev` or `tag`) are read as they are; any other file (a fetch script's `COMMIT=`, a README table) takes a `pattern`, a regex whose one group is the revision. `relation` says what the pin is: `pins` (the default), `transcribes` (a port, from the reference at that commit) or `forks` (a speed fork or a remix). A fork that shares upstream's history and merges from it needs no `declared_in`: what it lacks is upstream's commits outside its own history. An upstream commit that is not owed -- carried by hand in the fork's own form, or not applicable -- goes in the edge's `settled` table with the reason, and is counted instead of listed. - **Design** (`[[copied]]`): a file copied or adapted from a sibling (`how`: `copied`, `adapted`, `design`). The source's movement is measured from the date the copy first appeared, unless the edge names the adopting commit as `since` -- which it must when a project took a shape into a file it already had, since that file is older than the thing it adopted. A copy can go stale when its source moves on. It can also **diverge** (`diverged`): an improvement that may belong back in the source. Or it can still **share** a problem with its source (`shared`), which should then be settled in both. A difference that follows from the chip, such as Intel versus Zilog mnemonics, is neither: it belongs in a comment, because a report that offered it as a candidate to flow back would be wrong. ## Chips are not copied A chip that a second project needs is extracted into its own core, with its history, and both projects pin it. It is not copied. The SN76489 PSG is the example: `psg.py` was copied from sms-python into megadrive-python and the two diverged, so both had to be reconciled when the core was extracted (sn76489-python, 2026-10-11). Until a second consumer appears, a chip stays inside its board behind a pin-shaped interface, with a test that forbids imports from the rest of the board, so that extraction is a move and not a rewrite (famicom-python's APU and PPU, gameboy-python's APU). A `[[copied]]` edge whose source is a whole chip is therefore a debt to be paid by extraction, not a lineage to be tracked. ## The report python3 lineage.py # to stdout python3 lineage.py --out reports/latest.md python3 lineage.py --for play-md # one project and everything it is built on Standard library only (Python 3.11+), and it runs the same on Windows (it writes UTF-8 whatever the console's code page). It reads the manifests and the projects' local clones (`local`, relative to this repository), and never fetches: `git fetch` the clones first. It lists commits; whether a commit is a fix that matters to a dependent is for a reader to judge. ## Outside references: is the state of the art moving? The edges above say what has not travelled inside the family. A `[[reference]]` edge says what the project is judged against or reads from outside it -- MAME, the Nuked die models, SingleStepTests, other emulators -- at the revision the project pins. The pin is read from the file that holds it, never copied: a `pinned_repos.json` list (the boards keep one) is read whole; a fetch script takes a `pattern`, either one group for the revision with `url` on the edge, or named groups `url` and `rev` for a file that lists several. `rev_format` turns a captured version into a tag (`"mame0{}"` turns `"mame_version": "0.285"` into `mame0285`). Offline, the report lists every reference by repository and flags two projects on different revisions of one. With `--online` it asks GitHub's API how many commits each reference's default branch has gained since the pin, its newest release (marked when it follows commits made after the pin), the date of its last commit, and whether it is archived; a tag and a commit that are one revision become one row. That is the only part of the report that leaves the machine. It wants a token for its few hundred requests: `GITHUB_TOKEN` or `GH_TOKEN`, or `gh auth token` when the GitHub CLI is signed in; without one, GitHub allows 60 an hour and the rest of the rows say so. python3 lineage.py --online python3 lineage.py --for play-md --online # the Sega stack's references only A count is not a verdict: 3,896 MAME commits since 0.285 may touch nothing a board uses. The report says where to look; reading the commits is still the job. ## The wider community [docs/community.md](docs/community.md) is who outside the family will hear from us, how much, and in what form: AI policies, how responsive each project is, and the findings we have not reported. [docs/contributions.md](docs/contributions.md) is what we have sent and what came of it. Read the first before anything goes out, and add to the second the day it does. ## Adding a project Write `projects/.toml` with `name`, `kind` (`core`, `board` or `site`), `role` (`reference`, `port`, `fast`, `frontend` or `remix`), `language`, `repo` (none for a local-only project), `local`, `visibility` (`public`, `private` or `local`), `branch`, `released` (its newest release tag, if it has one), and `status = "planned"` for a project with documents and no code yet. Then add its edges. A `-fast` fork is a `[[depends]]` edge in spirit, but its record is a lockstep gate against the reference, so it goes as `[[evidence]]` too.