# Domains and speed The charter's "Domains and channels" and capabilities (`recompile: native | wasm | none`), and emulator-lineage `docs/proposals/2026-11-jit.md` (accepted 2026-11-25: the no-JIT path first). Phase 0: no board exists, so every speed figure is an estimate with its arithmetic shown and its measured inputs named. ## Part 1: one domain Everything runs from one 4 MHz clock inside one ASIC (KH): the CPU, the LCD controller's 6-clock fetch slots, the video DMA's 5-in-6 stealing, the four sound sources' dividers, the timer and the NMI divider. The CPU sees the LCD's slots in its VRAM timing and the DMA in its own stalls, cycle by cycle. | Domain | Time base | Parts | | --- | --- | --- | | **the console** | 4 MHz clocks | w65c02-python core, WRAM, VRAM, LCD controller, video DMA, sound, timer, NMI, pad, link port, cartridge | Era 1 (charter): one clock domain, cycle level everywhere. The only candidates for a split are pure producers, and none is worth a thread at this size: - **sound synthesis** from register writes (a log of writes with cycle stamps); the sample DMA reads ROM, but ROM does not change, so the producer can read it itself; - **picture output** from the LCD's 1-bit fields (the 2-bit pixels are in VRAM at known cycles). **Channels to the outside:** the link port (four lines, a sync point at every 2021/2022 access when two consoles are cabled in one process), the pad (2020, sampled when read) and the cartridge port (the TV-Link socket, the mapper for large carts). **Memory kinds** (for any cached interpreter): cartridge ROM (never written; bank switches at 2026 and, on large carts, a cart latch, U3) holds all code; WRAM can hold code (cc65's `DATA` is copied to RAM, and code could be); VRAM code is untested (U8). A decoded-block cache keyed by (bank, address) for ROM and invalidated on WRAM writes is exact. ## Part 2: instructions per second needed - **Ceiling**: 4,000,000 clocks / 2 clocks (the shortest 65C02 instruction) = **2.0 M instructions/s**. - **Observed** (MAME 0.285, a model; mame-oracle.md): 4,490,045 instructions in 3 s (Alien, 2.687 clocks each), 2,404,679 in 2 s (Super Kong, 3.354), 2,658,888 in 2 s (Galactic Crusader, 3.033): **1.20 to 1.50 M/s**. The games spend most of it in idle loops. - Planning figure: **2.0 M/s** (the ceiling), plus per-cycle work for the LCD (one fetch per 6 clocks: 0.67 M fetches/s), DMA and sound (four dividers at 4 MHz, or event-driven). ## Part 3: does the no-JIT path reach real time? Measured family figures (this machine, i9-13900K class): | Interpreter | Measured | Source | | --- | --- | --- | | w65c02-rust (plain transcription, flat memory) | 12 programs, about 284 M instructions, in 1.5 s: **~190 M instructions/s** | w65c02-rust docs/status.md rung 3 (`cc7481b`) | | lynx-python on PyPy (a 65C02 board, before its display) | **~0.5 M instructions/s** | lynx-python docs/status.md | Arithmetic, `recompile: none` throughout: | Target | Estimate | Need | Verdict | | --- | ---: | ---: | --- | | supervision-python, PyPy | ~0.3-0.5 M/s (lynx-python's figure, less the LCD and sound work) | 2.0 M/s | **about 1/4 to 1/6 of real time**: a specification, not a player (expected for Python) | | supervision-rust, desktop native | the core at ~190 M/s; a board with per-cycle LCD and sound at perhaps 1/5 of that (HYPOTHESIS): ~40 M/s | 2.0 M/s | ~20x real time | | phone, native (no JIT), ~0.8x desktop | ~30 M/s | 2.0 M/s | ~15x | | browser (wasm), desktop ~0.6x | ~24 M/s | 2.0 M/s | ~12x | | browser (wasm), iPhone Safari ~0.5x | ~20 M/s | 2.0 M/s | ~10x, room for run-ahead of 2 frames | | ARM handheld (A55 class) ~0.2x | ~8 M/s | 2.0 M/s | ~4x | So **the plain transcription (`supervision-rust`) is enough on every target**; no `-fast`, no turbo, no threads, no recompilation are needed (charter: tiers exist only where a target needs them). Capabilities to declare: `recompile: none`; threads: none; run-ahead and rewind cheap (state is 16 KB of SRAM plus a few hundred bytes of registers, plus the cartridge's bank and any mapper latch).