# 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.433 MHz crystal inside one ASIC (KH): the CPU at crystal / 2, the AY at crystal / 4, the LCD's 162-clock rows, the IRQ timer at crystal / 32,768. | Domain | Time base | Parts | | --- | --- | --- | | **the console** | crystal clocks (2 per CPU cycle) | CPU core, RAM, BIOS, LCD controller and VRAM, AY block, IRQ timer, link shift registers, pad, cartridge | Era 1 (charter): one clock domain, cycle level everywhere. Pure producers that could run beside it, none worth a thread at this size: **sound** (AY register writes with cycle stamps; the AY never reads anything) and **picture output** (VRAM plus the scroll registers per row). **Channels to the outside:** the link (a sync point at every 4400 write and 4C00-4FFF access when two consoles share a process), the pad (4400 reads), the cartridge port (protection chip, bank latches, audio in). **Memory kinds** (for any cached interpreter): BIOS (never written), cartridge ROM (never written; banks switch by writes to C000-DFFF and on the 4-in-1 8000-9FFF), RAM (1 KB, can hold code). VRAM is reached only through 5006/5007, so it never holds code. A decoded-block cache keyed by (bank, address) for ROM and BIOS, invalidated on RAM writes, is exact. ## Part 2: instructions per second needed - **Ceiling:** 2,216,500 cycles / 2 (the shortest 6502 instruction) = **1.108 M instructions/s**. - **Observed** (MAME 0.285, a model; mame-oracle.md): 2,489,567 in 3 s and 4,965,591 in 6 s, 2.679 cycles each: **0.83 M/s**, mostly an idle loop. - Per frame: 36,450 CPU cycles (72,900 crystal clocks); per second also 2.22 M VRAM-fetch slots for the LCD if modelled per crystal clock pair (a row-at-a-time producer is cheaper and exact if U6 shows no contention), and 1.108 M AY ticks. ## Part 3: does the no-JIT path reach real time? Measured family figures (this machine): | Interpreter | Measured | Source | | --- | --- | --- | | w65c02-rust (plain transcription, flat memory) | 12 programs, ~284 M instructions, in 1.5 s: **~190 M instructions/s** | w65c02-rust docs/status.md rung 3 (`cc7481b`); 6502-rust records no throughput figure, and shares the frame shape | | 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 | | --- | ---: | ---: | --- | | gamate-python, PyPy | ~0.3-0.5 M/s | 0.83-1.11 M/s | **about 1/2 to 1/3 of real time**: a specification, not a player | | gamate-rust, desktop native | the core at ~190 M/s; a board with per-cycle LCD and AY at perhaps 1/5: ~40 M/s (HYPOTHESIS) | 1.11 M/s | ~35x | | phone native (~0.8x desktop) | ~30 M/s | 1.11 M/s | ~27x | | browser wasm, desktop (~0.6x) | ~24 M/s | 1.11 M/s | ~20x | | browser wasm, iPhone Safari (~0.5x) | ~20 M/s | 1.11 M/s | ~18x | | ARM handheld, A55 class (~0.2x) | ~8 M/s | 1.11 M/s | ~7x | So **the plain transcription (`gamate-rust`) reaches real time on every target**; no `-fast`, turbo, threads or recompilation. Capabilities to declare: `recompile: none`; threads: none; run-ahead and rewind cheap (state is 1 KB RAM + 16 KB VRAM + AY and LCD registers + the cartridge's bank latches and protection-chip state, ~17.5 KB).