# Domains, channels, speed and execution architecture Phase 0, 2026-11-26, written after `../n64-python/docs/execution-architecture.md` and the late-era method proposal (`../emulator-lineage/docs/proposals/2026-11-late-era- method.md`), which this board follows. Nothing here was measured on an Xbox or an Xbox core: none exists in the family. Tags: MEASURED (a sibling's recorded number, file named), DOC, OBSERVED (another emulator's behaviour or this Phase 0's MAME runs), HYPOTHESIS (arithmetic shown so a measurement can replace it). ## The answer in one page **The Xbox is in reach of the family's method as a specification, and out of reach of its no-JIT path as something to play.** Three numbers decide it: 1. The CPU executes **400-730 M x86 instructions per emulated second** (733 MHz, IPC 0.55-1.0, HYPOTHESIS; MAME's boot window runs 614 M/s under its own cost model, OBSERVED). A desktop core has **6.8-12.5 host cycles per guest instruction** for it; an exact interpreter needs **25-60** (x86-p3-python handoff-brief.md). No interpreter technique closes a 2-9x gap on the fastest target. 2. The NV2A's pixel work is **tens of millions of textured, combined pixels per second** (640x480 at 30-60 frames with overdraw 2-4: 18-74 M pixels/s, HYPOTHESIS), at hundreds of host cycles each in software: **1-20 desktop cores**. A GPU backend (turbo) is required to play. 3. The APU's two DSPs at about 160 MHz (`APU` r7415: "seems to run at 160 MHz") are up to **320 M DSP instructions per second** together when busy: a core each, but they are frame-synchronous producers and thread well. So the forms that are in reach: - **x-python**: the readable specification, judged on test programs (abaire's suites, our own nxdk programs) through the test-program loader, and on **slices** from states transplanted from a Rust tier (late-era method, L1-L3). It will run at roughly 1/1,000-1/7,000 of real time for the CPU alone (HYPOTHESIS). No library sweep, ever. - **x-rust**: the transcription, the first tier that boots the player's firmware and runs titles, slowly: the CPU interpreter gives perhaps 1/2-1/9 of real time on a desktop before the GPU and DSPs are counted (HYPOTHESIS). - **x-rust-fast**: exact optimisations, threads at the channels (DSPs, VP, GPU back end), SIMD for the vertex shader and the VP mixer. Still not real time, because of the CPU. - **x-rust-turbo**: the only playable tier: **native recompilation of the x86 guest** (`recompile: native`; on an x86 host close to an identity translation) or **hardware virtualisation** (decision X1), plus a **GPU backend** for the NV2A held to the software rasteriser's pictures (late-era method, L6). Desktop only. - **Phones and browsers**: an iPhone app may not create executable memory, so it has no recompiler and no hypervisor: **out of reach**. An Android app may JIT; translating 400-730 M x86 instructions per second to ARM plus a GPU backend is at the very edge of a flagship phone (HYPOTHESIS, unmeasured). A browser would need x86-to-wasm translation at that rate beside WebGPU: **out of reach**. ## Time base and the order of record - **Clocks** (memory-map-pci.md; all tier 3 or HYPOTHESIS): front-side bus f = 133.33 MHz; CPU 5.5 f = 733.33 MHz; NV2A 1.75 f = 233.33 MHz; RAM 1.5 f = 200 MHz (if run at its rating); PCI and LPC f/4 = 33.33 MHz; APU DSPs 1.2 f = 160 MHz (if the wiki's figure is exact). If all of these are rational multiples of f, **one integer time base** carries them all: a tick of 1/(462 f) = 1/61.6 GHz, in which a CPU cycle is 84 ticks, an NV2A cycle 264, a RAM clock 308, a DSP cycle 385 and a PCI clock 1,848 (lcm of 110, 35, 30, 24 and 5 in units of f/20 is 9,240). HYPOTHESIS until the clock tree is confirmed (U3); the AC'97 bit clock (12.288 MHz) and the video encoder's pixel clocks come from their own crystals and enter as timed events. - **Order of record** (x-python, serial): the CPU domain steps; at each channel access it first runs the other domain up to the CPU's time ("catch up at the channel", as in sega32x-python and psx-python and n64-python). Producers run at joins and at audio and video frame ends. - **Event queue**: PCRTC vblank and line compare, PTIMER alarm, PFIFO/PGRAPH completion and notify, APU frame (1,500 Hz), DSP interrupts, USB frames (1 kHz), IDE command completion, PIT ticks, SMBus cycle complete, RTC. The queue's head is the deadline. ## Domains and channels | Domain | What it holds | Channels to the CPU domain | Sync character | | --- | --- | --- | --- | | **CPU** (x86-p3-python core + bus) | CPU, caches, the NV2A host bridge and memory controller's arbitration, PCI config, the 8259s, PIT, RTC, SMBus controller and its devices, the flash and MCPX ROM overlay | (itself) | the lead domain | | **GPU front end** | PFIFO (DMA pusher, CACHE1, puller), PGRAPH state, vertex fetch, the vertex shader, primitive setup, semaphores, notifiers, PTIMER, PCRTC timing | UC MMIO to NV2A registers; push buffer and vertex data in RAM (read by the GPU); semaphores and notifiers (written by the GPU); interrupts | dense: drivers poll GET and semaphores; stays inline on the CPU thread (as n64-python's RSP channel) or runs ahead with rollback | | **GPU back end** | rasterisation, texture shader, combiners, blending, depth, surface writes | joins: a CPU or DMA read of a render target, a surface reused as a texture, a CPU write into a buffer the back end has yet to read, scan-out of a line | producer; threads or the GPU | | **APU VP** | voice processing into MIXBUF | voice lists, SGEs and buffers in RAM; APU registers; frame interrupt | frame-synchronous producer (1,500 Hz) | | **GP DSP**, **EP DSP** | each a DSP with its memories and DMA | MIXBUF (from the VP), FIFOs and scratch in RAM, interrupts, APU registers | frame-synchronous; can run one frame ahead | | **ACI** | AC'97 DMA from RAM to the codec | buffer descriptors in RAM; interrupts | producer at 48 kHz | | **USB** (two OHCI) | schedules, transfer descriptors, devices | descriptors in RAM; interrupts | 1 kHz frames; inline | | **IDE** (HDD, DVD) | ATA/ATAPI state, DMA | I/O ports, PRD tables in RAM, interrupts | rare; inline | | **NIC** | stub | | | Tightly coupled pairs stay one domain (charter): the GPU front end polls and is polled within a few hundred cycles; so it is inline or speculatively ahead, never behind a cross-thread handshake (n64-python's cost model: 500-1,500 host cycles per conservative handshake, HYPOTHESIS). ## Memory kinds, and the hazards (as n64-python's RDP) RAM is unified and every master writes it. The rules: - **WB memory** the CPU caches; DMA coherence unknown (x86-p3-python U8): the CPU domain's snoop hook covers it if the board finds snooping. - **WC memory** for push buffers and vertex buffers (HYPOTHESIS): the GPU sees CPU writes only after a WC drain, which is a CPU bus transaction with a time. - **The GPU's reads** of push buffer, vertices and textures, **and writes** of surfaces, semaphores and notifiers: a hazard map over RAM pages ("pending back-end writes", "pending back-end reads") forces joins on RAW, WAR and WAW, exactly as the N64's RDP design (n64-python execution-architecture.md, "The CPU/RDP sync problem"). The map is consulted only on RAM transactions: CPU line fills, write-backs, UC/WC accesses, DMA. ## Backends per component, with tiers | Component | x-python / x-rust | x-rust-fast (every bus cycle identical) | x-rust-turbo (observables identical, fallback kept) | Concessions (named, off by default) | | --- | --- | --- | --- | --- | | CPU | interpreter, timing as data | packed decode records, decoded-block cache keyed by physical page and invalidated by writes to the page (the P6 snoops stores against its own code: x86-p3-python system.md), one deadline compare, deferred cycle accounting flushed at transactions | block compiler to native code; or hardware virtualisation where the host is x86 (X1) | idle-loop skipping (inexact), coarser interrupt delivery | | GPU front end | interpreter of methods, timing FITTED | same, threaded only if ahead-with-rollback holds | | | | Vertex shader | per-vertex interpreter | SIMD (4 lanes = one 128-bit register), exact | compiled shaders (native or GPU) held to the interpreter's outputs including the measured corner values | | | GPU back end | software rasteriser (the judge) | banded on threads where no state crosses pixels | GPU compute or graphics backend, proven per device (L6) | upscaling, texture replacement | | APU VP | per-voice, per-sample | SIMD mixing; on its own thread, frame-synchronous | | | | DSPs | interpreter (new core, X6) | own threads, one frame ahead with rollback on a CPU write to their memories | cached interpreter or block compiler | DSP HLE (AC-3 encoder replaced by silence or by a host encoder) | | Kernel | runs as itself (LLE) | | | an HLE kernel (kernel-hle-lle.md) | | Disc authentication | the drive model with the player's SS | | | "authenticated" without SS (X3) | ## Numbers Host assumptions as n64-python's (HYPOTHESIS): desktop 5.0e9, phone app 4.0e9, phone browser 2.4e9 desktop-equivalent host cycles per second on one core. | Component | Guest rate `R` (basis) | Desktop budget per op | Phone app | Browser | Likely cost per op | Verdict | | --- | --- | ---: | ---: | ---: | --- | --- | | CPU, typical | 400 M instr/s (IPC 0.55, HYPOTHESIS) | 12.5 | 10.0 | 6.0 | interpreter 25-60 (HYPOTHESIS) | no target fits without recompilation | | CPU, high | 730 M instr/s (IPC 1.0) | 6.8 | 5.5 | 3.3 | as above | as above | | CPU, MAME's model | 614 M instr/s (OBSERVED, boot window) | 8.1 | 6.5 | 3.9 | | | | Vertex shader | 2-10 M vertices/s x 20-60 instructions (HYPOTHESIS) = 40-600 M vec4 instr/s | 8-125 | 7-100 | 4-60 | SIMD 4-10 (HYPOTHESIS) | 0.1-1.5 cores desktop | | Pixels | 18-74 M/s (640x480, 30-60 frames, overdraw 2-4, HYPOTHESIS) | 68-280 per pixel | 54-220 | 32-130 | 300-1,500 in software (up to 4 filtered texture fetches and up to 8 combiner stages, HYPOTHESIS) | 1-20 cores desktop: **GPU backend needed** | | APU VP | 256 voices x 48 kHz = 12.3 M voice-samples/s (the wiki's maximum) | 406 | 325 | 195 | 50-200 with resampling, filters, HRTF (HYPOTHESIS) | under 0.5 core | | GP + EP DSPs | 2 x 160 M instr/s peak, 30-80 % busy (HYPOTHESIS) = 100-260 M/s | 19-50 | 15-40 | 9-24 | 20-40 per DSP instruction (HYPOTHESIS, simpler than x86) | 1-2 cores; threads | | USB, IDE, SMBus, timers | < 0.1 M events/s | large | | | negligible | inline | | Python specification | CPU 0.1-0.5 M instr/s on PyPy (HYPOTHESIS) | | | | | 1/800-1/7,000 of real time: slices only | **Where that leaves the targets, without recompilation:** the CPU alone misses real time on every target by 2-18x; the GPU's pixels need a GPU; the DSPs and VP fit on threads. With turbo: desktop native recompilation (or virtualisation) plus a GPU backend plus DSP threads is the configuration other projects use to play (xemu: QEMU's TCG or KVM/HVF/WHPX plus OpenGL/Vulkan; OBSERVED from xboxdevwiki `Emulators` r7319 and `Xemu`), and it is the only one this board can claim. The capability record will say `recompile: none` reaches **no** target for commercial titles. ## Measure first (in this order) 1. x86-p3-rust's instructions per second on a CPU-only test (abaire's fpu_test loop, or a dependent-chain microbenchmark) with the profile split (decode, segment/paging checks, flags, time-keeping), against the SH-2 yardstick. 2. The board's channel rates in a title slice: UC MMIO accesses per emulated second, PFIFO GET polls, semaphore polls, WC drains. 3. The software rasteriser's ns per pixel on a captured push-buffer frame, by combiner stage count. 4. DSP busy fraction in a title's audio frames. 5. Joins per frame, for the GPU backend decision.