# The family charter What this family of emulators is for, how it is shaped, and what every project in it promises. Agreed with Aubrey on 2026-11-14. Every project's README links here; every agent working in the family reads it first ([agents.md](agents.md)). ## What we are building > We do not require perfect hardware knowledge or perfect execution fidelity at every > target. We require that our understanding, evidence, assumptions, compromises and the > reasons for those compromises remain explicit. Every implementation must preserve the > ability to improve on its predecessors without losing the knowledge that produced them. The emulators are products. The lasting investment is the readable specifications, the evidence behind them, the methodology, and the ability to make every emulator more accurate and faster as evidence and technology improve. One rule underlies all of it: **never claim more certainty than the evidence supports.** ## Three independent axes Accuracy is not one word. Every claim a project makes says which axis it is about. **A. Hardware confidence: how well we know what the hardware does.** Evidence, strongest first: hardware measurements and captures; die-level analysis and models; hardware test ROMs with verdicts captured on real units; primary documentation; independent, well-established emulators (observed as black boxes, see Provenance); fitted constants; informed hypotheses. Each behaviour in a specification carries its evidence (methodology: evidence tags). We build on the best evidence available and say where it is thin. The order is the default. When two pieces of evidence disagree about one observable, the one that observes it directly on real units outranks one that infers it through a mechanism; in particular a die result that turns on a race within one clock edge or phase yields to real-unit measurements or test-ROM verdicts on that observable. Die models are themselves corrected by evidence (Breaknes' gate-level PPU took fixes from ours). The overruled reading is kept and counted, never deleted (methodology: when real units overrule the die). **B. Modelling level: how deep a component is modelled.** Chosen per component, in the specification, by evidence and need: | Level | Models | Typical use | | --- | --- | --- | | signal | gates and transistors | where die traces exist and matter (2600 TIA, NES PPU corners) | | cycle | every bus cycle, every dot | 8- and 16-bit CPUs, video and sound chips | | transaction | bus transactions with their timing | 32-bit buses, caches, DMA engines (32X, Saturn, PS1) | | instruction | results and instruction-level timing | fast RISC CPUs without cycle-level evidence | | functional | what a program or block does | firmware and BIOS (the Super Game Boy's SNES program), DSP microcode | A system's accuracy is a profile ("SH-2s at instruction level with cycle-accurate bus arbitration; VDP at cycle level"), not an adjective. A functional model is a modelling choice judged against a lower-level run where one exists (gameboy-python's SGB against snes-python running the real SGB program), not a shortcut. **C. Execution fidelity: how exactly an implementation follows its specification.** This is what the tiers are for. The axes stay independent. A perfect transcription of an uncertain model is still an uncertain model; a fast tier does not make the hardware model better or worse. ## The tiers | Tier | Purpose | Allowed | Proven by | | --- | --- | --- | --- | | `x-python` | The specification: readable, evidence-backed, the place where hardware behaviour is defined and fixed | Anything that reads clearly; slow is fine | Axis A evidence: test ROMs, die traces, captures, documents | | `x-rust` | A faithful executable transcription; proves the specification runs in a compiled language unchanged | Only what Rust forces: same names, order, structure and comments | Every bus cycle identical to `x-python` | | `x-rust-fast` | Production speed without giving up the per-cycle proof | Idiomatic Rust, exact tables, caches, specialised layouts, build settings, deterministic threads | Every bus cycle identical to `x-rust`; a speed win on every measured layout | | `x-rust-turbo` | Speed for weak devices and run-ahead | Event-driven scheduling, catch-up, whole-line fast paths, batching; the inherited per-dot code kept as the fallback | Every observable identical to `x-rust-fast`, plus the hardware suites run directly | Sites (`play-x`) and windows (`x-play`) are hosts: they run a tier, they do not define behaviour. Rules that make the tiers work: - **A tier is defined by its proof, not by its technique.** A shortcut that keeps every bus cycle identical belongs in `-fast`, however clever. Only what changes the per-cycle trace while keeping the observable one belongs in `-turbo`. The gate decides, not a debate. - **Tiers exist only where a target needs them.** A `-fast` or a `-turbo` is built for a board whose slowest real target (a phone, a handheld, run-ahead) measurably needs it. The four tiers are a ladder, not an obligation. - **`x-python` is the authority and the longest-lived asset.** It is not a prototype. It must not grow complicated to suit downstream speed. Rust tiers can be rewritten; turbo can be abandoned; the specification and its evidence survive. - **`x-rust` is not a second chance to design.** Cleverness belongs in `-fast`. - **Turbo is not a second specification.** It is `-fast`'s code plus a scheduling and fast-path layer that hands over to the inherited code whenever its conditions are not met, so a fix that lands upstream reaches the fallback unchanged by merge, and a fast path the fix made wrong fails the gate on exactly the cases it affects. - **Recompilation is a turbo fast path.** Block caching, and a code generator only if block caching does not pay, live in `x-rust-turbo`, with the inherited interpreter always present as the fallback and the host able to turn recompilation off. Besides turbo's obligation, a recompiler proves: the CPU state and time equal the interpreter's at every compiled block's exit; every read another domain can see, at the same cycle; seeded faults aimed at what JITs get wrong (lazy flags, stale blocks after self-modifying code, missed interrupts, delay slots, summed cycle counts), each caught; invalidation by self-modifying code, DMA, cache purges and other CPUs' writes. It is held to "prune what does not pay" like any speed claim. ## Proof obligations | Step | Obligation | | --- | --- | | hardware -> `x-python` | Confidence: the evidence of axis A, recorded per behaviour, with what remains unknown | | `x-python` -> `x-rust` | Implementation fidelity: every bus cycle (address, value, direction, time) and every picture, per slice, in lockstep | | `x-rust` -> `x-rust-fast` | Optimisation fidelity: the same per-cycle lockstep, at any thread count | | `x-rust-fast` -> `x-rust-turbo` | Execution-model fidelity on the **observable contract** | **The observable contract** is what software and the player can see, defined per system in the turbo project's docs. At minimum: every value the CPU reads and the CPU cycle it reads it on; every interrupt as the CPU takes it; the video output; the audio output; save states that load into a fresh console and continue identically. Internal activity nobody can see (a PPU's fetches, an APU stepping while unread) is not in it; that is the room turbo uses. Matching frames alone is never enough. Every gate also proves it can fail: seeded one-line faults, each caught (methodology). Differential equivalence is never reported as hardware accuracy: "the Rust board matches the Python" and "the Python matches the hardware" are different sentences. ## Concessions: approximations, named and switched An approximation that changes results (a table that rounds differently from the real curve, idle-loop skipping, ignored bus contention, coarser resampling) is a **concession**. Concessions are not a tier, because they are independent and per target: - Each is a named switch in the turbo project, **off by default**, with a record: what it changes, why it is needed, on which targets, its measured cost (pixels, test-ROM pass list, audio difference), and the fallback that restores exact behaviour. - The gate always runs with every concession off, and that run is exact. Each concession has its own run that checks its recorded cost has not grown. - "Turbo with concessions off" is proven; "turbo with concession X" is "proven except as X's record says". Never one fuzzy "approximate". - An exact table is not a concession. A scheduler is not a concession. Skipping something that could change what software or the player sees is. ## Domains and channels (multiple cores) Python cannot use many cores; Rust can. The specification makes the split possible: - A specification states its machine's **domains** (parts that keep their own time and meet the others only at channels: usually parts on their own clock, such as a CPU and its bus, a sound subsystem, a CD drive; sometimes parts on one locked clock that can still be scheduled apart, such as the 32X's SH-2 pair, VDP and PWM, all driven from the 68000's clock) and the **channels** between them (ports, shared memory, interrupt lines, FIFOs) as first-class structure. A specification may step one domain inside another in its order of record (the Sega CD's drive on the sub CPU's clocks); it says so, and the channels stay the only place they meet. A chip that pokes another domain's state directly instead of through a channel is a specification bug: it hides a dependency. - `x-python` runs the domains serially in one defined interleaving: the order of record. `x-rust` transcribes that serial order. - From `x-rust-fast` on, domains may run on their own threads, synchronised at the declared channels (a domain runs ahead until the next moment another could touch a channel it shares), and pure producers (picture drawing from a register-write log, sound synthesis from register state over time, snapshot compression) may run beside them. - **Determinism is the rule:** identical results at any thread count and any scheduling. Every gate case runs single-threaded and multi-threaded. With conservative synchronisation even the per-cycle trace stays identical, so threads do not weaken a proof. - Tightly coupled processors (the 32X's and Saturn's SH-2 pairs sharing memory) usually stay one domain; the gain comes from the domains around them. ## Capabilities and the adaptive host Every board states what it offers its hosts and what it costs, measured, not guessed: - milliseconds to run a frame; - a snapshot's size, and milliseconds to save and to load one; - what it can do: deterministic save states, run-ahead, rewind, threads; - whether it recompiles: `recompile: native | wasm | none`. Every board meets its stated target with `none`, or says plainly on which targets it cannot; some targets (native iOS apps) forbid creating executable memory, and the host chooses what a device allows. - the concessions it has. Hosts measure on the device they run on, keep measuring (devices throttle when they heat up), and decide: run-ahead depth, rewind interval and memory, thread count, audio buffering, each setting **Auto / On / Off** with Auto saying what it chose and why. Host features that do not change emulation (run-ahead, rewind, buffers) may switch at any time. A concession changes results: if Auto enables one, it is shown to the player, recorded in save states, and switched only at safe points. The host logic is built once (first in play-gb, extracted into a shared crate when a second site adopts it, and the foundation of boardroom), and boards only supply the numbers. A board with a 32 MB snapshot is not "missing rewind"; it reports its costs and the host decides, so features switch on by themselves as devices grow. ## How change flows - **Hardware behaviour is defined and fixed in `x-python`, first.** A bug found downstream (a transcription, a fast fork, a site) is reported upstream with a repro, fixed in the specification, then carried down. Downstream never fixes behaviour on its own. (The Super Game Boy's skip-boot packet loss, found by the gameboy-rust transcription on 2026-11-13, went this way.) - Each tier forks its parent with history and merges from it; ports pin their reference by tag (`gameboy-rust-pin-3`), boards pin cores by commit. emulator-lineage reports what has not travelled yet. - **Cores and boards.** A chip that a second project needs becomes its own core, extracted with history and pinned by both; until then it stays in its board behind a pin-shaped interface. CPUs always get their own core. Boards are where cores' corners are found: raise them on the core. ## Licences and provenance: we honour every licence we touch Everything this family is built from was made by people who chose the terms it is shared under. Honouring those terms exactly is not a formality; it is the contract. 1. **Every project has one licence, stated in its LICENSE file,** and honours the licence of everything it takes. A repository without a LICENSE file is not finished. 2. **Every source file says its own licence** with an SPDX header (`SPDX-License-Identifier: MIT`, `GPL-3.0-or-later`, ...). A file that holds anything taken from elsewhere names the source and its licence beside it, and keeps the source's notice (play-gb's SameBoy colour table carries the Expat notice). 3. **The emulator family (cores, boards, sites) is MIT.** An MIT project takes nothing copied or transcribed from GPL or LGPL code. Those projects may be run and measured as black boxes; their source is not opened while writing the code it would inform. Facts about the hardware (register maps, timings, measured results) are not code; how we learned them is recorded. An MIT project does not fetch or keep such source either: closed boxes are built and run from the GPL tool repositories, and the MIT project reads their outputs. 4. **A project built on GPL or LGPL work is welcome as a GPL (or LGPL) project, honoured in full:** it says so in its README and LICENSE, credits its source, keeps every upstream notice, offers its complete source wherever it is distributed (a compiled build a site serves counts), and everything built on it accepts the same terms. Whether a project becomes GPL is Aubrey's decision. 5. **Code flows one way: from MIT into GPL, never from GPL into MIT.** Before code moves between projects, its headers are checked. 6. **Tools.** Running a program (an oracle, a compiler, a ROM manager) never touches our code's licence. Tools we build may carry any licence we can honour; a tool built on GPL code (igir, retroscraper) stays GPL, credits its source, keeps its notices and offers its source when shared. Our own files inside such a tool may carry a more permissive header so they stay reusable; the tool as a whole is GPL. 7. **Permissive sources** (Expat, MIT, BSD, zlib, CC0, CC BY) may be used with their notice and any required credit kept beside what came from them. 8. **An author's wishes are respected, and tracked apart from the licence.** A licence says what we *may* do; an author may still ask that their work not be used this way. When an author objects to AI use of their work (furrtek), we leave it out, together with its lineage (works derived from it, and tools or simulations built on those), however it is licensed. This is respect, not legal necessity, and the records keep the two apart (sources.md's "set aside (author's wishes)"; each project's docs/provenance.md, "Author respect"). Knowing where each fact came from is what lets us swap a set-aside lineage for our own work or for other research. 9. **Firmware and artwork** made by console makers are never shipped. A player's own copy may be loaded where the player supplies it. 10. **Breaches are fixed, not hidden.** Provenance is checked before a release and after work done with another implementation's source open (`provenance_check.py`; agents report what they wrote with such source open). A breach is fixed by removing or rewriting the code, or by relicensing the project under the terms it owes (Aubrey decides which), and recorded where it happened. ## From the oldest systems to the newest | Era | Examples | What changes | | --- | --- | --- | | 1 | 2600, NES, Game Boy, Master System | One clock domain, cycle level everywhere. Python runs the tests, Rust plays; `-fast` for phones; turbo optional | | 2 | Mega Drive, SNES, PC Engine | Several CPUs, still cycle-lockstep. `-fast` needed; threads optional (sound) | | 3 | 32X, Saturn, PS1, N64 | Tightly coupled 32-bit CPUs. Transaction level appears in specifications; Python too slow for long runs (cases get short and targeted); threaded `-fast` needed; turbo likely | | 4 | PS2, GameCube and later | Thin evidence; instruction and functional levels dominate; turbo with recompilation; concessions likely on weak targets | The specification is the authority in every era; what changes is the level each component is modelled at and which tiers a board needs. ## Naming and the lineage line `x-python`, `x-rust`, `x-rust-fast`, `x-rust-turbo`; a Python repository `x-python` imports as `x_python`. Sites are `play-x`, desktop windows `x-play`. Every project's README opens with its lineage line and a link here, for example: > **Lineage:** gameboy-python → gameboy-rust → **gameboy-rust-fast** → play-gb · > fixes start in gameboy-python and flow down by merges · > [family charter](https://github.com/alewman/emulator-lineage/blob/main/docs/charter.md) Every family placed in this shape, with what each still owes it, is in [families.md](families.md). How the work is done day to day is in [methodology.md](methodology.md); how to brief agents with all of this is in [agents.md](agents.md). ## Changing this charter The charter's authority comes from one rule: **only Aubrey changes it.** That covers this file, [methodology.md](methodology.md), [agents.md](agents.md), [families.md](families.md)'s statements of the shape, and `docs/CLAUDE.md`. Agents may propose a change (in their report, with the reason and what it would affect) but never edit these documents on their own initiative, and never to make their own work fit. Facts that move with the projects (a count, a row in families.md that is out of date) may be updated by whoever finds them, and are reported. Each change to the shape gets an entry below: the date, what changed, and why. When `docs/CLAUDE.md` changes, copy it to `/data/emu/CLAUDE.md` again; `python3 lineage.py` says whether the installed copy matches. ## Change log - **2026-11-26** Licences point 8: author respect is its own track, kept apart from licence, and it covers an objecting author's lineage (derived works, and tools built on them), not only their own works. Why: the wave-2 provenance audit found the Game Boy line's die judge (dmg-sim) built on schematics derived from furrtek's. Aubrey: "The issue with Furrtek isn't that it legally contaminates everything. The license says we can use it if we follow it. It's just that I would like us to be respectful of an author's wishes. Those are two different things, that are worth tracking separately." - **2026-11-25** Accepted by Aubrey from docs/proposals/2026-11-decisions.md (C3, C5, J1, J5) and the JIT proposal (docs/proposals/2026-11-jit.md): - Domains: "parts that keep their own time and meet the others only at channels", own clock or not. Why: the 32X's parts share one PLL-locked clock but are scheduled apart, and the Sega CD's specification steps its drive on the sub CPU's clock; the first three domains.md files (2026-11-25) needed the wider wording. - Licences point 3: MIT projects never fetch or keep closed-box source (Aubrey's rule of 2026-11-24, written where agents read first). Why: the 2026-11-24 sweep found ~40 repositories that had kept such trees. - Recompilation is a turbo fast path with the interpreter as fallback, and its proof steps. Why: era-3 boards (32X, Saturn, PlayStation, N64) will want block caching; saying now where it lives keeps a recompiler from growing beside the specification. - Capabilities gain `recompile: native | wasm | none`, and every board meets its target with `none` or says where it cannot. Why: the family will ship on iPhone, where native apps cannot create executable memory (Aubrey, 2026-11-25). - **2026-11-19** When real units overrule the die (axis A; methodology section of the same name), accepted by Aubrey from docs/proposals/2026-11-die-against-hardware.md: directness first, races within one edge or phase go to real units, the die graded and scoped, the overruled reading kept and counted. Why: the strict order would have chosen wrong on POKEY's first 64 kHz interrupt and the 2600's HMOVE-on-cycle-74 tie; Aubrey added that die models are corrected by evidence too (Breaknes' gate-level PPU rewrote our finding). - **2026-11-14** Licences become a contract (Aubrey: "we NEED to honor their license"): one licence per project with a LICENSE file in every repository, SPDX headers in every file, GPL projects welcome when honoured in full, code flowing only from MIT into GPL, tools under the same rule, breaches fixed and recorded. Why: the first wording ("nothing from GPL code") read as a ban on the GPL rather than respect for it, said nothing about tools, and left open how a GPL-derived core could be put right. - **2026-11-14** First version, agreed with Aubrey after a design discussion (also reviewed against another agent's summary): the three axes; the four tiers and their proof obligations, with turbo named and defined by the observable contract; concessions as named switches rather than a tier; domains and channels for deterministic multiple cores; the capability contract and the adaptive host; how change flows; provenance; the eras. Why: the family had grown to dozens of cores, boards and sites following an unwritten shape, and the 32X showed that "transcribe the Python" would not be enough for newer systems.