# 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; every figure is an estimate with its inputs named. ## Domains and channels **One domain**: the console on one 4,194,304 Hz clock (CPU, PPU, APU, timer, OAM DMA, serial), exactly gameboy-python's DMG order of record. The APU and the picture are pure producers the Rust tiers may run beside it (as gameboy-rust-fast's design allows); nothing on this machine needs a thread. Channels to the outside: the cartridge port (ROM, the MD1/MD2 latch, MD0's RAM), the joypad, and the serial port. On the laptops the serial port is the channel to the keyboard, RTC, speech module and printer (MDI): a peripheral socket at SB/SC, synchronised at each transfer, like a link cable. Memory kinds for a cached interpreter: cartridge ROM (bank switches at `$0001`/`$B000`/ `$1000` writes) holds the code; WRAM and HRAM hold copied routines (the OAM-DMA routine in HRAM; MD0's bank-switch code in WRAM, cartridges.md). A block cache keyed by (bank, address), invalidated on RAM writes, is exact. ## Instructions per second needed - Ceiling: 4,194,304 T-cycles / 4 = 1,048,576 M-cycles a second; the shortest SM83 instruction is one M-cycle, so **1.05 M instructions/s**. - Observed (MAME 0.285, a model; mame-oracle.md): 1,119,253 instructions in 3 s of Armour Force = **0.37 M/s** (2.82 M-cycles each). - Per-dot work: the PPU at 4.19 M dots/s and the APU dominate, as on the DMG. ## Does the no-JIT path reach real time? Measured family figures for the same machine (the Duck row adds one table lookup per I/O access, a small fraction of a frame's work: HYPOTHESIS until the build measures it): | Implementation | Measured | Source | | --- | --- | --- | | gameboy-python on PyPy | "below real time" (no figure published) | gameboy-python README.md | | gameboy-rust-fast as wasm (play-gb) under Node | **5.9x** (Pokemon Crystal) to **8.7x** (Tobu Tobu Girl Deluxe on a Game Boy) real time, rewind snapshots included | play-gb README.md | | the same in headless Chromium | 59.6 frames/s at **3.0 ms a frame** (a frame is 70,224 / 4,194,304 s = 16.74 ms: 5.6x headroom) | play-gb README.md | `recompile: none` throughout: | Target | Estimate | Verdict | | --- | --- | --- | | Python (PyPy) | below real time (as gameboy-python) | a specification, not a player | | desktop native (gameboy-rust-fast) | faster than its wasm (5.6-8.7x): above 6x | real time | | desktop browser (wasm) | 5.6-8.7x (measured) | real time, room for run-ahead 2 | | iPhone Safari (wasm, no JIT tier assumed: ~0.5x desktop, HYPOTHESIS) | ~3-4x | real time; run-ahead 1-2 frames fits | | phone native (no JIT) | ~0.8x desktop native, HYPOTHESIS | real time | | ARM A55-class handheld (~0.2x desktop, HYPOTHESIS) | ~1.1-1.7x | real time, little run-ahead | So **the existing Game Boy tiers are enough on every target**: no Duck-specific `-fast`, turbo, threads or recompilation (and, by decision 1, no Duck Rust repository at all: the row rides gameboy-rust and gameboy-rust-fast). Capabilities: `recompile: none`; threads none; run-ahead and rewind as play-gb's (a Game Boy save state is 110-180 KB, ~0.1 ms each way natively: play-gb README).