# Domains, channels, and the instructions-per-second need Phase 0, 2026-11-26. Every figure is tagged: DOC (a document), MEASURED (a sibling repository's recorded measurement, named), OBSERVED (another emulator's recorded behaviour), HYPOTHESIS (an estimate with its arithmetic shown, to be replaced by a measurement). Nothing has been measured on a GameCube workload: no GameCube core exists in the family yet. ## One time base The Gekko's core cycle at 486 MHz is the unit (one **tick**). Every other clock in the machine divides it exactly (DOC: Gekko UM 2.1.1 for bus/4; YAGCD 2.5, 4.2, 5.6 for the rest): | Clock | Rate | Ticks per cycle | | --- | --- | --- | | Gekko core | 486 MHz | 1 | | 60x bus, Flipper (GX, PI, MI, VI logic) | 162 MHz | 3 | | DSP, ARAM bus | 81 MHz | 6 | | time base and decrementer | 40.5 MHz (bus/4) | 12 | | VI pixel clock | 13.5 MHz (HYPOTHESIS: the usual SD rate; YAGCD 5.3 to confirm) | 36 | | AI sample clocks | "48 kHz" and "32 kHz" (YAGCD 5.10) | 10,125 at exactly 48 kHz; 32 kHz is not an integer number of ticks, and whether either is exactly that rate is unknown (U20); the specification keeps a fractional accumulator for any clock that does not divide | ## Domains and channels (charter, "Domains and channels") | Domain | Parts | Channels to the others | | --- | --- | --- | | **CPU** (lead, order of record) | Gekko with its caches, its DMA and write-gather pipe; PI; MI and main memory; EXI and SI devices (low-rate, stepped inside this domain); the interrupt controller | everything below | | **GX** | CP (FIFO reader), XF, SU/RAS, TX/TMEM, TEV, PE, the EFB | the FIFO ring in RAM (CPU writes through the WGP, CP reads; watermark and breakpoint interrupts); GX register reads by the CPU (CP status and pointers, PE tokens, FINISH, bounding box); EFB peek/poke at 0x08000000; RAM reads by the GPU (vertex arrays, display lists, textures, TLUTs); RAM writes by the GPU (EFB copies to XFB and textures) | | **VI** | scan-out counters and the XFB fetch | its registers (CPU), its four display interrupts, its RAM reads of the XFB at scan-out times | | **DSP** | the DSP core, its IRAM/DRAM/ROMs, its accelerator and its DMA | the two mailboxes and DSP control (CPU); its DMA to and from RAM; ARAM, shared with the CPU-driven ARAM DMA; the AID sample stream | | **Audio out** | AI: AID DMA from RAM, AIS stream, mixing, the sample counter | AI registers and interrupts (CPU); RAM reads (AID); the stream from the drive | | **Drive** | the DVD drive model | DI's command registers, its DMA into RAM, its three interrupts and the cover interrupt; the audio stream to AI | **The order of record** (x-python, serial): the CPU steps; at each channel access it first runs the touched domain up to the CPU's tick ("catch up at the channel", as sega32x-python, psx-python and n64-python do); the GX consumes FIFO data in order of arrival, and runs up to the CPU's tick at every GX register access and at every RAM access that could see GX output. The DSP runs up to the CPU's tick at each mailbox or DSP-control access. Producers (the GX's pixel back end, the AI mixer) run at joins and frame ends. **Sync points** (JIT proposal: where a block must end): every uncached access to a 0x0C00xxxx register; every EFB access; every write-gather burst when the GX is not ahead (the FIFO's arrival time is a channel event); every `mtspr` to HID2, DMAL and WPAR (they change what later instructions do or start a master); interrupts sampled at instruction boundaries; DMA and copy completions as timed events. **Memory kinds** (for invalidation): main RAM is written by the CPU, the locked-cache DMA, the GX's EFB copies, the DSP's DMA, the ARAM DMA, DI's DMA and SI/EXI DMA. All of them can overwrite code the CPU runs (DVD loads and ARAM transfers routinely do: HYPOTHESIS by the SDK's design). ARAM is written by the ARAM DMA and read by the DSP's accelerator. IRAM is written by the DSP's DMA (each ucode upload). ## The instructions-per-second need, with the arithmetic **Host assumptions** (the same as n64-python's execution-architecture.md, HYPOTHESIS): a desktop core 5.0 GHz; a phone app's core 0.8x a desktop core's throughput; the phone's browser 0.6x of that. Budgets are desktop-equivalent host cycles per guest operation on one core: desktop `5.0e9 / R`, phone app `4.0e9 / R`, phone browser `2.4e9 / R`. **Measured yardstick:** the family's one profiled era-3 interpreter, sh2-rust-fast, costs about 145 host cycles per SH-2 instruction on a 4.3 GHz E-core (4.3e9 / 29.69e6), about 89 on an idle P-core (MEASURED: sh2-rust-fast docs/status.md, as cited by n64-python's execution-architecture.md). n64-python estimates 25-60 cycles for an exact interpreter with cheap time-keeping (HYPOTHESIS there; adopted here as the same kind of estimate). **The Gekko's rate R.** 486 MHz; up to 2 instructions retired a clock (UM 1.2.1), so a peak of 972 M/s. Typical game code on a 750-class core: IPC 0.4-0.8 (HYPOTHESIS: no measurement exists; the performance monitor could take one on hardware, gekko-python timing.md), so **R = 194-389 M instructions/s**, 300 M/s as the working figure. Games idle while waiting for the VI, so the rate an emulator must sustain is the busy frames' rate. | Component | Guest rate R (basis) | Desktop | Phone app | Phone browser | Exact interpreter's likely cost | Verdict | | --- | --- | ---: | ---: | ---: | --- | --- | | Gekko, typical | 300 M instr/s (IPC 0.62) | 16.7 | 13.3 | 8.0 | 25-60 with cheap time-keeping (HYPOTHESIS); 89-145 with an SH-2-style scheduler (MEASURED yardstick) | **no target reaches real time without recompilation**: desktop at 0.28-0.67x, phone 0.22-0.53x, browser 0.13-0.32x | | Gekko, light | 194 M instr/s (IPC 0.4) | 25.8 | 20.6 | 12.4 | as above | desktop 0.43-1.0x, phone 0.34-0.82x, browser 0.21-0.50x | | Gekko, peak | 972 M instr/s (DOC) | 5.1 | 4.1 | 2.5 | as above | below even a JIT's usual cost on phones (HYPOTHESIS) | | DSP, busy | 81 M instr/s (one a cycle: HYPOTHESIS) | 62 | 49 | 30 | 20-50 for a 16-bit DSP with parallel moves (HYPOTHESIS) | one core everywhere on its own thread; on the CPU's thread it costs 0.3-0.8 of a desktop core | | GX pixels, typical | 640 x 480 x overdraw 2-4 x 60 = 37-74 M pixels/s (HYPOTHESIS) | 68-135 per pixel | 54-108 | 32-65 | 200-1,000 per pixel with 1-16 TEV stages and 0-8 texture reads (HYPOTHESIS: 50-100 operations a bilinear fetch, 20-40 a TEV stage, IPC ~2) | **a software rasteriser needs 1.5-15 desktop cores**; on phones and in browsers it cannot carry typical 3D games | | GX pixels, peak | 162 MHz x 4 pixel pipes = 648 M pixels/s (HYPOTHESIS from Copetti's four pixel units) | 7.7 | 6.2 | 3.7 | as above | GPU only | | XF vertices | 5-20 M vertices/s (HYPOTHESIS) | 250-1,000 | 200-800 | 120-480 | 100-400 (matrix, lighting, texgen; HYPOTHESIS) | a fraction of a core; fits the GX thread | | EFB joins (copies, peeks, bounding box reads) | 2-20 copies and 0-1,000 peeks a frame (HYPOTHESIS) | | | | a GPU join 0.5-5 M host cycles (0.1-1 ms; n64-python's cost model) | peeks are the GPU backend's worst case: 100 peeks at 0.1 ms is 10 ms of a 16.7 ms frame | | Python specification (for scale) | Gekko 0.3-1.5 M instr/s on PyPy (HYPOTHESIS: below sh2-python's 1.33-2.38 M/s on its minimal harness, MEASURED in saturn-python domains-and-speed.md, because the 750's state and the cache model are larger) | | | | | 1/200 to 1/1,000 of real time for the CPU alone (300e6 / 1.5e6 = 200; 300e6 / 0.3e6 = 1,000) | **What pureikyubu shows (OBSERVED, its wiki, idleskip.md at 69572aa):** with its basic block recompiler on x64 and its GPU path, one title's loading phase ran at 0.59-0.73x real time without idle-loop skipping and 1.1-2.9x with it; its Gekko retired about 35 M instructions per emulated second (280 M in 8.06 s), far fewer than a 750 at 486 MHz would, and 51 % of them were a Dolphin OS wait loop. Two lessons, both for the turbo tier: a large share of a GameCube's instructions are idle waiting, and an emulator that times the CPU loosely does less work than an exact one must. ## Whether the no-JIT path reaches real time The charter's order (JIT proposal, accepted): `-fast`, then a cached interpreter, then threads at domain channels, and only then a code generator where the target allows one. | Target | Gekko (`-fast` + cached interpreter: 20-50 cycles, the cached interpreter's x1.15-1.4 included) | DSP (own thread) | GX (software / GPU) | Verdict without recompilation | | --- | --- | --- | --- | --- | | desktop | 16.7 budget at 300 M/s: **0.33-0.84x** | fits | software only for light scenes; GPU needed for typical 3D | **not real time for typical games**; light titles and 2D/menus perhaps; exact idle-loop fast-forward (late-era method L8) is the lever that may close the gap in the many frames that wait | | phone app (iOS: no JIT allowed) | 13.3 budget: **0.27-0.67x** | fits on a performance core | GPU (Metal) required | **not real time**; with exact idle fast-forward still short in busy frames; named concessions needed (below) | | phone browser (`recompile: wasm` allowed) | 8.0 budget: **0.16-0.40x** | worker thread at the edge | WebGPU required | **not real time** without wasm recompilation; with it, an open question to measure | **Frankly:** the GameCube is the first family board for which `recompile: none` does not reach real time on any target for typical games, by these estimates, even on desktop. The charter allows this if said plainly ("every board meets its stated target with `none`, or says plainly on which targets it cannot"). The board's stated target with `none` should be **exactness at reduced speed** (test programs, slices, homebrew, light titles), with real time on desktop and phones coming from turbo's recompilation (native on desktop and Android, wasm in browsers) plus a GPU backend, and on iOS native apps only from named concessions. ## Concessions that would be unavoidable on weak targets (all off by default, each named) | Concession | What it changes | Why it may be needed | | --- | --- | --- | | `dsp_hle` (ucode-level DSP) | mailbox and DMA timing, mixing arithmetic | saves the DSP's core on phones and browsers | | `cpu_cache_off` (no L1/L2 model; memory accesses direct) | programs that depend on missing flushes behave differently; timing changes | the cache model's cost per access in the CPU's hot path | | `inexact_idle_skip` (the JIT proposal's inexact idle-loop skipping, beyond exact fast-forward) | instruction counts and the moment interrupts are taken | busy-wait loops are half of the instructions (pureikyubu's observation) | | `efb_peek_coarse` (EFB reads answered from a stale GPU copy, or at frame granularity) | values the CPU reads from the EFB | GPU joins cost 0.1-1 ms each | | `bbox_coarse` | bounding-box values | the same | | `gx_float_host` (XF in host float, not the specification's FITTED format) | vertex positions at the last bits | GPU backends compute in host floats | | `cpu_timing_cpi` (constant CPI instead of the table) | when every channel access happens | the timing model's cost per instruction | Each needs its record (what changes, why, which targets, measured cost, the fallback) before it ships: none can be measured until the board runs. ## Snapshot size (capabilities) 24 MB main RAM + 16 MB ARAM + 2 MB EFB + 1 MB TMEM + 32 KB DSP memories + 0.3 MB of CPU caches and tags + registers: **about 43 MB raw** (DOC sizes; compression unmeasured). A board with a 43 MB snapshot "reports its costs and the host decides" (charter): rewind will switch itself on where memory allows.