# Domains, speed and execution architecture Phase 0, 2026-11-26. Two questions in one file, as psx-python's domains.md and n64-python's execution-architecture.md: where the 3DS's **domains** and **channels** fall (charter, "Domains and channels"), and whether the board can run in real time **without recompilation** (charter, `recompile: native | wasm | none`; the JIT proposal, accepted 2026-11-25: the no-JIT path first). Nothing here was measured on a 3DS core: none exists in the family. Every figure carries its tag; HYPOTHESIS figures show their arithmetic. ## The answer in one page The 3DS is the first family machine whose **CPU rate alone** exceeds what an exact interpreter can do on a phone, and whose **GPU fill rate** exceeds what a software rasteriser can do on one desktop core. - **CPU**: a busy Old 3DS application CPU needs about 160 M ARM11 instructions a second (134-215 M), which leaves 31 desktop host cycles per instruction, 25 in a phone app and 15 in a phone's browser. The family's measured ARM interpreter costs 126-146 (arm7tdmi-rust); the N64's design target with cheap time-keeping is 25-60. **Desktop is at the edge; phones and browsers are not reached by any exact interpreter**; New 3DS titles at 804 MHz (about 480 M/s) are not reached anywhere without a block cache or a compiler. - **GPU**: the PICA200's fragment work is 20-60 M fragments a second in 3D scenes (HYPOTHESIS below). A software rasteriser with six combiner stages, three texture units and per-fragment lighting costs several hundred host cycles a fragment: 2-8 desktop cores. A **GPU backend is not optional on phones** (a turbo fast path under the observable contract, the late-era proposal's section 4). - **DSP**: the Teak runs Nintendo's audio program continuously at up to 134 M instructions a second. LLE costs a core of its own; **HLE of the DSP program** (a functional model) costs almost nothing and is how a phone can afford sound. - **The OS**: under the recommended HLE of Horizon (firmware-and-keys.md), the system CPU's work largely disappears into host code, which is the largest single saving. So the 3DS's capability record will say: `recompile: none` reaches real time on desktop for Old 3DS titles at best, with the GPU on the host's GPU or on threads and the DSP on its own thread or in HLE; on a phone app (no JIT on iOS) and in a browser it does not, and the record says so; a block cache (arm11-rust-turbo) and `recompile: wasm` in browsers are the first speed work to plan. All HYPOTHESIS until the first measurements (end of this file). ## Time base One integer time base for every domain: **1/24 of the 67.027964 MHz base clock period**, i.e. units of 1,608.67 MHz. Then (DOC for the 67.027964 MHz base: GBATEK's ARM9 timers and the CONFIG11 clock modes; the multipliers are HYPOTHESIS until a test measures each): | Clock | MHz | Units per cycle | | --- | ---: | ---: | | ARM11, New 3DS mode 5 | 804.34 | 2 | | ARM11, New 3DS mode 3 | 536.22 | 3 | | ARM11, Old 3DS / mode 0-1 | 268.11 | 6 | | ARM9, Teak DSP (both "134 MHz") | 134.06 | 12 | | the 67 MHz base (ARM9 timers, SDMMC HCLK, many peripherals) | 67.03 | 24 | | GPU (PICA200) | 268.11 (HYPOTHESIS: community figure, not in GBATEK) | 6 | Every domain's time is exact in this unit across all three New 3DS clock modes. ## Domains | Domain | Time base | Parts | Why one domain | | --- | --- | --- | --- | | **ARM11 and its bus** | ARM11 clocks | arm11-python (2 or 4 MP11 CPUs, SCU, distributor, private timers), the AXI interconnect, FCRAM, AXI WRAM, the I/O at 10100000h-10400FFFh as the ARM11 sees it, CDMA, HID, the GPU's **front end** (register file, command-list processor, the interrupt it raises), LCD timing (PDC H/V interrupts) | the MPCore's CPUs meet at memory, the SCU and the monitors at instruction granularity (arm11-python mmu-caches-mpcore.md); the GPU registers and LCD counters are polled | | **ARM9** | ARM9 clocks | arm946es-python (3DS row), ARM9-only I/O (CONFIG9, IRQ, NDMA, timers, CTRCARD, SDMMC, AES/SHA/RSA, XDMA, SPI_CARD, PRNG, OTP), ARM9 internal RAM | its own clock and its own bus; meets the ARM11 at PXI, at shared memory and at the shared I/O | | **DSP** | Teak clocks | teak-python (proposed), DSP code and data memory (1FF00000h-1FF7FFFFh), its MMIO (timers, DMA, ICU, BTDMP audio ports, AHBM) | its own clock; meets the ARM11 at the APBP registers (10203000h) and at shared memory | | **GPU back end** | the order of PICA200 commands | vertex loader and shader units, primitive assembly, rasteriser, texture units, combiners, fragment lighting, the framebuffer and depth/stencil writes, memfill, memcopy/display transfer | a **pure producer** of memory contents; nothing it does is visible until a join | | **Scan-out** | LCD lines | framebuffer read per line for both screens (and the 3D top screen's two eyes) | a producer of pictures | | **CSND** | its sample rate | the legacy-style sound channels and capture (GBATEK "CSND Registers") | registers and DMA only | | **Slow peripherals** | their events | MCU (functional), I2C devices (gyro, cameras, LCD controllers, NFC, IR, C-stick, QTM), SPI (TSC: touchscreen and circle pad), cameras, SD/eMMC, Wi-Fi (late) | each meets a CPU only at its registers and interrupt | In legacy modes (GBA, DS, DSi), the ARM7 and the ARM9 form the legacy machine's domains (gba-python's and nds-python's), and the ARM11 keeps running in 3DS mode, forwarding the picture (GBATEK ARM7_CNT, LGYFB). That is a later row (decision N5). ## Channels and sync points | Channel | Between | Sync point | | --- | --- | --- | | PXI FIFO (send/receive; GBATEK: "The FIFO registers seem to be exactly same as on NDS", whose IPC FIFO holds 16 words each way: the 3DS depth is DOC by analogy, U5) and PXI_SYNC (8-bit on the 3DS) with its interrupts 50h/51h to the ARM11 and IF bit 12 to the ARM9 | ARM11 <-> ARM9 | every access; the FIFO is a channel with a known depth, so the reader may run ahead until it empties | | FCRAM and AXI WRAM (both CPUs can write) | ARM11 <-> ARM9 | **every access by the other side to a page the first side has written since the last sync**: a write map per page (as the N64's hazard map) keeps most accesses local | | Shared I/O at 10100000h-1017FFFFh (both CPUs) | ARM11 <-> ARM9 | every access | | APBP: DSP_PDATA/PADR/PCFG/PSTS/PSEM/PMASK/PCLEAR/SEM, CMD0-2/REP0-2 (10203000h) | ARM11 <-> DSP | every access (semaphores and replies are polled) | | DSP memory (1FF00000h-1FF7FFFFh), which the ARM11 maps too | ARM11 <-> DSP | per-page write map, as above; the DSP's audio buffers here are the hot path | | AHBM DMA (DSP reading or writing FCRAM) | DSP -> ARM11 bus | each transfer | | GPU command lists (in FCRAM or VRAM), GPU register writes | ARM11 -> GPU front end | **none for writes**: the front end logs the command stream | | P3D interrupt (2Dh), PSC0/1 (28h/29h), PPF (2Ch) completion | GPU -> ARM11 | the front end must compute when each completes: the back end's work must be a function of the commands for this to stay exact (unknown U12) | | ARM11 (or DMA) reads of memory the back end writes (colour/depth buffers, the display transfer's output) | GPU back end -> ARM11 | **join**: the back end drains up to the reader's time | | Scan-out reads of the framebuffers | memory -> scan-out | per line; a join if the back end is behind | | Interrupt lines into the distributor | every device -> ARM11 | the device schedules its next event; the ARM11 domain may not pass it | **Order of record** (x-python, serial): the ARM11 domain leads; at each channel access the other domain is first run to the ARM11's time (catch up at the channel, as sega32x-python and psx-python). The ARM9 and DSP domains likewise catch up the ARM11 when they touch a channel. Producers run at joins and at frame ends. ## Memory kinds (who writes what: the cached interpreter's invalidation map) | Region | Size | Written by | Notes | | --- | --- | --- | --- | | ARM11 and ARM9 boot ROMs | 64 KB each | nobody | player-supplied only, or absent (homebrew FIRM payloads start past them) | | FCRAM | 128 MB (256 MB New 3DS) | ARM11, ARM9, CDMA/NDMA/XDMA, DSP's AHBM, GPU (render targets may be here) | **all application code lives here** | | VRAM | 6 MB (two 3 MB banks) | GPU back end, ARM11, DMA | GPU's usual target | | AXI WRAM | 512 KB | ARM11, ARM9, DMA | the kernel's | | DSP code and data memory | 256 KB + 256 KB | DSP, ARM11, DMA | DSP code is loaded by the ARM11 | | ARM9 internal RAM | 1 MB (+512 KB New 3DS) | ARM9, ARM9 DMA | Process9's | | ARM9 ITCM/DTCM | 32 KB / 16 KB | ARM9 only | | | New 3DS extra memory ("QTM") | 4 MB | enabled through CFG11_MPCORE_CNT | | ## Instructions per second, and the budgets Host assumptions as n64-python's (HYPOTHESIS): desktop core 5.0 GHz; a phone app's core 0.8x of that; a phone's browser 0.6x of the app (sh2-rust measured wasm at 0.55-0.65x native). Budgets are desktop-equivalent host cycles per guest operation on one core: desktop `5.0e9 / R`, phone app `4.0e9 / R`, browser `2.4e9 / R`. **Measured yardsticks** (family, MEASURED in the files named): arm7tdmi-rust 39.6 M ARMv4T instructions/s native, fat LTO, CPU time, load 58-65 (arm7tdmi-rust docs/status.md, 2026-11-25): about 126 cycles per instruction at 5.0 GHz; arm7tdmi-python on PyPy 0.83 M/s; sh2-rust-fast about 145 cycles per SH-2 instruction on an E-core (n64-python execution-architecture.md). | Component | Guest rate `R` (basis) | Desktop | Phone app | Browser | Exact interpreter's likely cost | Verdict | | --- | --- | ---: | ---: | ---: | --- | --- | | ARM11 CPU0, Old 3DS, busy | 160 M instr/s (268.11 MHz x 0.5-0.8 IPC = 134-215 M; 0.8 from GBATEK's SUBS+BNE measurement, 2 instructions in 2.5 clocks) | 31 | 25 | 15 | 25-60 with timing as data and a TLB/cache fast path; 126-146 measured for a per-cycle ARMv4T core | desktop at the edge; phone and browser no | | ARM11 CPU1 (system services), Old 3DS | 15-50 M/s (HYPOTHESIS: 10-30 % busy); about 0 under an HLE OS | | | | | adds to CPU0 on the same thread (one domain) | | ARM11, New 3DS title at 804 MHz | 480 M/s per busy CPU (x3) | 10 | 8 | 5 | as above | no target without a block cache or compiler | | ARM9 (Process9) | 5-30 M/s (HYPOTHESIS: mostly idle, busy on storage and crypto); about 0 under an HLE OS | | | | | its own thread if LLE | | Teak DSP, running Nintendo's audio program | 40-100 M instr/s (HYPOTHESIS: 134 MHz, teakra: "most instructions can complete in a single clock cycle"; 30-75 % busy) | 50-125 | 40-100 | 24-60 | 30-80 (HYPOTHESIS: a 16-bit DSP with 40-bit accumulators, two-word instructions, modulo addressing) | its own core on desktop and phone; HLE audio otherwise | | PICA200 vertex shading | 5-50 M shader instructions/s (HYPOTHESIS: 0.5-2 M vertices/s x 10-25 instructions) | 100-1,000 | 80-800 | 48-480 | 40-120 per instruction with float24 done exactly on 4 lanes (HYPOTHESIS) | one thread, SIMD for the four lanes | | PICA200 fragments, 3D scene | 20-60 M fragments/s (HYPOTHESIS: 400x240 x 2 eyes + 320x240 = 268,800 visible pixels a frame, x 1.5-3.5 overdraw, at 30-60 frames/s) | 83-250 | 67-200 | 40-120 | 300-1,000 (HYPOTHESIS: 6 combiner stages, up to 3 filtered texture fetches, LUT lighting, depth/stencil/blend) | desktop 2-8 cores; phone needs the host GPU; browser WebGPU | | Scan-out | 16 M pixels/s (268,800 x 60) | 310 | 250 | 150 | 10-30 | negligible | | Python specification (for scale) | ARM11 0.2-0.8 M instr/s (HYPOTHESIS from arm7tdmi-python's 0.83 M/s) | | | | | 1/200 to 1/1,000 of one busy CPU: test programs and slices only | ## Does the no-JIT path reach real time? (Rust -fast, then a cached interpreter, then threads) - **Desktop**: ARM11 on thread A with the GPU front end (31 cycles needed: the cached interpreter with timing as data must reach the bottom of the N64's design range); ARM9 on thread B only if LLE (idle under HLE); the Teak on thread C, or HLE audio; the rasteriser on 2-8 threads or the host GPU. **Old 3DS titles: at the edge, HYPOTHESIS; New 3DS 804 MHz titles: no.** - **Phone app** (iOS forbids JIT): ARM11 at 25 cycles is below any exact interpreter the family has measured; GPU on Metal compute; DSP in HLE. **Not reached for busy titles**; light 2D titles may fit. The capability record says so. - **Phone browser**: 15 cycles: **not reached** without `recompile: wasm` (allowed: Safari runs the wasm, the page maps no executable memory itself), WebGPU for fragments, HLE audio. - **Threads** pay at the ARM9, DSP and GPU domains, not inside the MPCore. ## How each part is run fast (tiers) | Part | x-rust-fast (per-cycle lockstep with x-rust) | x-rust-turbo (observable contract) | | --- | --- | --- | | ARM11 MPCore | timing as data; cached decode per I-cache line; TLB and cache hit fast paths that keep the round-robin state exact; CPUs interleaved in larger quanta only between shared accesses where the lockstep holds | block cache with the interpreter as fallback (charter: recompilation is a turbo fast path); `recompile: wasm` for browsers | | ARM9 | the same techniques as arm946es-rust-fast; its own thread at PXI and shared-memory channels | idle-loop fast-forward when it waits on PXI (exact, L8 of the late-era proposal) | | Teak | own thread at the APBP and shared-memory channels | HLE of the DSP program as a **named concession** (or a functional model judged against LLE: decision N4) | | GPU front end | on the ARM11 thread | the same | | GPU back end | the software rasteriser on threads, joins at reads | a host-GPU backend under the per-pixel contract, proven per device (`gpu_backend: verified/failed/absent`); float24 arithmetic reproduced in shaders or the differences named as concessions | | Producers (scan-out, CSND mixing) | threads | | ## Measure first (in this order) 1. arm11-python's rung 2 on PyPy: instructions/s on a test stream (replaces the 0.2-0.8 M HYPOTHESIS). 2. arm11-rust and -fast on the same stream: host cycles per instruction, against the 31 / 25 / 15 budgets. 3. The ARM11 instruction rate a real title needs: from a slice run under the Rust tier, instructions retired per emulated second on CPU0 and CPU1 (replaces the IPC guess). 4. Teak busy fraction under Nintendo's audio program (needs a player-supplied DSP program; until then HYPOTHESIS). 5. Fragments per frame in a few titles (from the GPU front end's counts).