# Domains and speed, and how the model would be executed fast The Wii is the charter's **era 4** ("thin evidence; instruction and functional levels dominate; turbo with recompilation; concessions likely on weak targets"). This page gives the domains and channels, the instructions-per-second arithmetic, the honest answer for the no-JIT path on each target, and the execution architecture in outline. It follows n64-python's execution-architecture.md and the late-era method proposal (emulator-lineage docs/proposals/2026-11-late-era-method.md), and adds what is new here. **Nothing below was measured on a Wii or a Wii core**; none exists in the family. Tags: MEASURED (a sibling's recorded measurement, file named), DOC (WiiBrew), HYPOTHESIS (an estimate with its arithmetic shown). ## Domains | Domain | Clock (Wii mode) | Contents | Notes | | --- | --- | --- | --- | | **A. Broadway** | 729 MHz | the CPU, its L1/L2, locked cache and its DMA, the write-gather pipe | the order of record's lead (gekko-python, broadway row) | | **B. Flipper side** | 243 MHz | MI, PI, VI, AI, EXI, SI, DI (registers), CP/GX front end, the event queue | gamecube-python's blocks; the GX front end gives timing and FIFO state | | **C. GX back end** | 243 MHz | rasteriser, TEV, pixel engine, EFB, copies | a **producer** between joins (CPU EFB peeks/pokes, copies to MEM, PE tokens) | | **D. DSP** | 121.5 MHz | the Macronix DSP and its IRAM/DRAM/ROMs, accelerator, ARAM-in-MEM DMA | its own core (gamecube-python's decision) | | **E. Starlet** | 243 MHz | the ARM926EJ-S and IOS (LLE), or the HLE IOS's service model | absent as instructions under HLE; its service model then runs at IPC events | | **F. Hollywood AHB** | 243 MHz | IPC block, Starlet timer, interrupt controller, GPIOs, NAND, AES, SHA-1, OTP, SEEPROM, EHCI/OHCI, SDHC, SDIO | registers and engines with durations | | **G. Bluetooth controller + remotes** | own | BCM2045 model; each Wii Remote | meets F at OHCI1's USB transfers | | **H. Disc drive** | own | the drive's command processor, seek and read timing | meets B/F at DI | ## Channels and sync points - **A-B**: every uncached access to the legacy registers; the write-gather pipe into the CP FIFO (bursts of 32 bytes); MEM1/MEM2 transactions while another master's DMA is in flight; PI interrupt lines into A at instruction boundaries. - **A-C**: EFB accesses from the CPU (0xC8000000), copies (EFB to MEM), PE finish and token interrupts, CP FIFO watermarks: **joins** for the producer. - **A-D**: DSP mailboxes and control registers; DSP DMA into MEM1/MEM2; AI DMA. - **A-E**: the **IPC registers** and IRQ 30/31; the 0x40-byte request and every buffer it points at, in MEM1/MEM2. Software makes this coherent by flushing and invalidating caches around the handshake (libogc2's `ipc.c` flushes before writing PPCMSG: DOC by usage), but the specification must not assume software is correct: Starlet's reads of MEM are sync points with every Broadway write-back in flight. - **E-F**: Starlet's register accesses and the engines' DMA into SRAM/MEM2. - **F-G**: OHCI1 descriptors and transfers; **F-H** / **B-H**: DI commands and DMA. - HW_AHBPROT, HW_SRNPROT, HW_AIPPROT, HW_COMPAT changes: rare, and each one remaps what A can reach, so each is a full sync point. ## The arithmetic (instructions per second) - **Broadway**: 729 M cycles/s (DOC). A 750-class core issues up to two instructions a cycle plus a folded branch; game code on 750s runs well below that. Planning IPC 0.5-0.8 (HYPOTHESIS, the same range n64-python uses for the VR4300): **365-583 M instructions/s, planning figure 450 M**, peak about 1,460 M. - **GameCube mode**: 486 MHz: 243-389 M/s, planning 300 M. - **DSP**: 121.5 M cycles/s, about one instruction a cycle while running (HYPOTHESIS), busy 30-70 % with an audio microcode: **36-85 M/s**. - **Starlet (LLE only)**: 243 M cycles/s at most; IOS is mostly waiting for requests. If it halts in wait-for-interrupt, its cost is its work: 2-25 M instructions/s (HYPOTHESIS: 1-10 % busy); if it spins, up to 243 M/s (U8 decides which). - **GX**: 4 pixels a clock (HYPOTHESIS for Hollywood: Flipper's four pipelines, at 243 MHz) gives a 972 M pixels/s fill ceiling; a typical game frame of 640 x 480 at 60 Hz with overdraw 2-4 is **37-74 M shaded pixels/s**, each through up to 16 TEV stages. ### Budgets (desktop-equivalent host cycles per guest operation, one core) As n64-python: desktop core 5.0 GHz, a phone app 0.8x, a phone browser 0.48x, so the budget is `5.0e9 / R`, `4.0e9 / R`, `2.4e9 / R`. | Component | `R` | Desktop | Phone app | Phone browser | Exact interpreter's likely cost | | --- | --- | ---: | ---: | ---: | --- | | Broadway, planning | 450 M/s | 11 | 8.9 | 5.3 | 25-60 with table-driven time-keeping; 90-145 with a stage scheduler | | Broadway, GameCube mode | 300 M/s | 17 | 13 | 8 | as above | | DSP | 60 M/s | 83 | 67 | 40 | 25-60 | | Starlet (LLE, halting) | 2-25 M/s | 200+ | 160+ | 96+ | 25-60 | | GX back end, typical | 55 M pixels/s | 91 per pixel | 73 | 44 | 300-1,500 per pixel with 1-16 TEV stages (HYPOTHESIS) | The measured yardsticks behind "exact interpreter's likely cost": sh2-rust-fast, an exact SH-2 with a stage scheduler, about 145 host cycles per instruction on a 4.3 GHz E-core (MEASURED: sh2-rust-fast docs/status.md, via n64-python execution-architecture.md); arm7tdmi-rust 33.9-39.6 M instructions/s native (MEASURED: arm7tdmi-rust docs/status.md, via arm946es-python's handoff brief), about 125-150 host cycles per instruction. ## The honest answer: the no-JIT path, per target **Broadway alone settles it.** At 11 host cycles per instruction on a desktop, the budget is less than half of the best exact interpreter's likely cost (25), and a twelfth of the family's measured era-3 cost. - **An exact `-fast` interpreter** at 25-60 cycles reaches 83-200 M instructions/s on a 5 GHz core: **18-44 % of real time on a desktop**, 15-35 % in a phone app, 9-21 % in a phone's browser (HYPOTHESIS, arithmetic above). A cached interpreter (decode once per block; the 750's caches are 8-way with PLRU replacement (DOC: IBM 750CL user's manual, section 3, in ../gekko-python's references), so a cache hit does change hidden state, unlike the VR4300's: the n64 trick of skipping tag checks needs its own proof) gains perhaps x1.2-1.5 (HYPOTHESIS, the SH-2 lesson: decode is a small share). **No no-JIT path reaches real time for Wii games on any target.** - **Threads do not rescue it**: Broadway is one domain. Threads carry the DSP (1 core), the GX back end (2-6 cores, or the GPU), an LLE Starlet (a fraction of a core), the VI and AI producers. - **`recompile: native`** (turbo): block compilation of PowerPC to the host at 2-5 host cycles per guest instruction (HYPOTHESIS: the range at which full-speed GameCube and Wii emulation is known to run on desktops, OBSERVED of the closed-box emulators, not measured by us). Desktop: real time likely. Android app: the same, slower cores. **A native iPhone app may not create executable memory**, so it gets the interpreter: about a fifth to a third of real time. - **`recompile: wasm`** in the browser (the JIT proposal allows the page to hand wasm to the engine): 2.4e9 / (4-10 cycles of compiled wasm) is 240-600 M/s, so the phone browser is at or below the edge; desktop browsers better. The odd consequence, to say plainly: on an iPhone the **browser** may be the faster host, because Safari compiles wasm and an app may not compile anything. - **GX** needs a GPU back end (turbo) on phones and browsers and probably on desktops; a software back end at 300-1,500 cycles per pixel costs 3-16 desktop cores for 55 M pixels/s. - **The DSP**: an exact interpreter on its own thread fits everywhere (83 cycles of budget on desktop); in a phone browser it needs a worker. DSP microcode HLE is a concession (it changes timing and precision), never the default. The capability record, once measured, will say: `recompile: none` does **not** reach full speed for Wii-mode games on any target; GameCube mode is also below real time; homebrew test programs and slices run at any speed. That is a statement of fact for Aubrey's decision D7 (what the Wii's stated targets are), not a plan to make the interpreter heroic. ## What Python can be PyPy runs the family's minimal SH-2 harness at 1.33-2.38 M instructions/s (MEASURED: saturn-python domains-and-speed.md); a PowerPC with paired singles, two cache levels and a full MMU (BATs and page tables) will be slower, say **0.5-2 M/s** (HYPOTHESIS). At 450 M a second, one emulated second costs 225-900 s of PyPy for Broadway alone; one frame 3.7-15 s, before the GX. So the specification runs **test programs and slices**, never games from power-on, exactly as the late-era proposal describes (L1-L3): start states written by a Rust tier, in a state format the specification declares, with the slice list curated from problem moments. ## Execution architecture in outline (backends per component, their tiers) | Component | x-python / x-rust | x-rust-fast (every bus cycle identical) | turbo (observables identical) | concessions (off by default) | | --- | --- | --- | --- | --- | | Broadway | interpreter, timing as data (gekko-python's model) | packed decode, table-driven cycle costs, one deadline compare; a cached interpreter keyed by real address and the I-cache line, dropped on `icbi`, on DMA into the line and on BAT/page-table changes | block compiler, native or wasm, ending blocks at declared sync points | idle-loop skipping (inexact) | | GX | software pipeline, per pixel, the judge | front end (CP, XF, setup, timing) on A's thread; back end in bands where no state crosses pixels | GPU back end, proven per device against the software EFB and the copies at every join (late-era proposal L6) | upscaling, texture replacement | | DSP | interpreter | threaded, mailbox and DMA as channels, the DSP ahead with rollback (n64's RSP pattern) | microcode-keyed blocks (IRAM content hash, as n64-python's RSP plan) | microcode HLE | | Starlet + IOS | HLE service model (default) or LLE interpreter | LLE on its own thread, ahead with a read log and rollback on Broadway writes to request memory | LLE blocks compiled | none needed | | AHB engines (AES, SHA-1, NAND) | register models with durations | host crypto with the same completion times (the engine's timing is a function of the block count: HYPOTHESIS, U15) | | | | Bluetooth, remotes | HCI/L2CAP/HID models | unchanged; they are cheap | | | **One new sync problem the N64 did not have: two CPUs that share coherent-by-software memory.** Broadway and Starlet each have their own caches and neither snoops the other (HYPOTHESIS: IOS and libogc both flush and invalidate around IPC, which they would not need to do otherwise). The order of record therefore says exactly when a Broadway write-back reaches MEM and when a Starlet line fill reads it; a test that skips the flush must see the stale data. Under HLE this collapses to one rule: the HLE IOS reads request memory **as MEM holds it** at the request's time, never through Broadway's cache. ## Measure first (in this order) 1. gekko-rust's instructions/s and its profile split (scheduler, checks, fetch, handlers, decode) on a CPU-only homebrew test, once gekko-python's rung 1 is in. 2. The number of IPC requests per emulated second in a few games, and the requests' mix (the HLE's priority list), from the Rust tier. 3. The software GX's ns per pixel by TEV stage count, on a captured FIFO. 4. Joins per frame (EFB peeks, copies, PE tokens) for the GPU decision. 5. The DSP's busy fraction under the common audio microcodes.