# Domains, channels, speed, and the late-era method Read with the N64 Phase 0's `../n64-python/docs/execution-architecture.md` (host assumptions, the sync cost model, the sh2-rust-fast yardstick) and emulator-lineage's `docs/proposals/2026-11-late-era-method.md` (slices, x-rust as the first runnable tier, state transplant, GPU backends as turbo). Tags as there: DOC, OBSERVED (MAME), MEASURED (a run named here), HYPOTHESIS (arithmetic shown). ## Domains and channels | Domain | Parts | Channels to others | | --- | --- | --- | | A main | i960KB @ 25 MHz, work RAM, backup RAM, the four timers, the interrupt controller | everything below | | B copro | MB86234 / SHARC / TGPx4 with its RAM | A: input FIFO (writes to 0x00880000), output FIFO, FIFO status (0x00980004) | | C geometrizer | a DSP running an uploaded program (2B, 2C) or a functional model (2O, 2A) | A: geo port (0x00800000), upload control; D: polygon RAM ping/pong | | D renderer | Z-sort/clip front end; pixel back end | A: render mode/status (0x10000000-), polygon count (0x10400000), frame buffers A/B (0x11600000-); E: the frame to scan out | | E video | System 24 tilemaps, palette, colour translation, scan-out, vblank | A: tile/char RAM, sync registers, vblank interrupt | | F sound | 68000 + SCSP (2A-2C) or 68000 + YM3438 + 2 MultiPCM (2O) | A: a USART at MIDI-class rate (31.25 kbaud: about 3,125 bytes/s) | | G sub-boards | drive board Z80, I/O board Z80 (2O), billboard Z80, comm board | A: dual-port RAM (I/O), serial or parallel ports, comm shared RAM | Channel density decides the threading (cost model in the N64 document): - **A-F is the loosest channel in any board the family has specified**: a serial byte every ~320 µs at most. The sound domain runs on its own thread with a conservative handshake per byte (500-1,500 host cycles each, at most 3,125 a second: negligible). A `-fast` technique: per-cycle trace identical. - **A-G** likewise (serial, a dual-port RAM polled at frame rate; HYPOTHESIS until a trace counts the accesses). - **A-B** is FIFO traffic. MAME syncs the i960 and the SHARC at 18 kHz (`set_maximum_quantum`), a hint that the game code does not poll the FIFOs at instruction density (OBSERVED; the exact density is the first measurement to take). FIFO depth gives slack: B may run ahead until its output FIFO fills or its input empties. - **A-C-D** is display-list traffic: the i960 writes a list and kicks the geometrizer; C feeds D; A reads status and counts. Producers between joins: the late-era front/back split applies. ## Instructions per second needed | Domain | Rate (basis) | Desktop | Phone app | Phone browser | | --- | --- | ---: | ---: | ---: | | i960 | 10 M/s (Intel average, DOC) to 25 M/s (one per clock) | 200-500 | 160-400 | 96-240 | | TGP copro (2O/2A) | 13-17 M/s if the MB86234 issues one instruction per three clocks as the MB86232's 75 ns cycle at 40 MHz MCLK suggests (HYPOTHESIS, U5); up to 50 M/s if one per clock | 100-385 | 80-308 | 48-185 | | SHARC x2 (2B) | 32 M/s each at one instruction per clock (DOC: the ADSP-21020 manual, ch. 1, "executes instructions in a single cycle"; 32 MHz from MAME) | 156 each | 125 | 75 | | TGPx4 x2 (2C) | unknown (U5) | - | - | - | | 68000 | 1.4-2.8 M/s (11.29 MHz / 4-8 clocks) | > 1,700 | > 1,400 | > 850 | | SCSP | 1.41 M slot-samples/s + 5.64 M DSP steps/s (DOC: SCSP manual, 32 slots, 128 steps x 44.1 kHz) | 709 per operation (7.05 M/s together) | 567 | 340 | | Renderer back end | 10.95 M visible pixels/s (rasteriser.md) | 457 per pixel | 365 | 219 | Budgets are desktop-equivalent host cycles per guest operation on one core (5.0e9 / R, 4.0e9 / R, 2.4e9 / R: the N64 document's host assumptions). ## Does the no-JIT path reach real time? Against the yardstick (an exact interpreter at 89-145 cycles per instruction with an SH-2-style scheduler, 25-60 with cheap time-keeping: N64 document): - **i960** (domain A): fits everywhere at 25-60 cycles; fits desktop and phone app even at the yardstick's 145. One thread. - **Copro and geometrizer** (B, C): each on its own thread if their channel densities allow (first measurement). A TGP at 17 M/s fits everywhere; at 50 M/s it fits desktop and phone app with cheap time-keeping and is at the edge in a browser. Two SHARCs at 32 M/s each fit desktop and phone app on two cores; in a browser each needs below ~75 cycles per instruction, which a VLIW-style SHARC instruction (a multifunction compute plus two memory moves) may not reach without `recompile: wasm` (HYPOTHESIS). - **Sound** (F): a thread of its own, light. - **Renderer** (D): one or two worker threads at 200-400 cycles per pixel (rasteriser.md). Verdict (HYPOTHESIS until measured): **`recompile: none` reaches real time on desktop and on a phone app for every revision**, with domains A, B, C, D, F on four to six threads. In a phone's browser the original and 2A boards fit (TGP rates, one renderer worker); 2B and 2C are at the edge and may need `recompile: wasm` for the DSPs. MAME's single-threaded interpreter runs `vf2` (2A, with the geometrizer as high-level code) at 193 % of real time on one core of this machine (MEASURED, docs/mame-oracle.md), which bounds the 2A problem from above. ## The late-era method, placed honestly - **What the Python specification can be.** At 0.2-1 M i960 instructions/s on PyPy (HYPOTHESIS, from sh2-python's measured 1.33-2.38 M/s on a minimal harness) plus the DSPs, `model2-python` runs at roughly 1/50 to 1/500 of real time. Model 2 has **no test-ROM ecosystem** (no homebrew, no hardware test suites found), so the specification's gate cases are **slices**: start states transplanted from `model2-rust`, a few seconds of game, and the boot of each game from reset (a boot is the one case Python reaches by itself: MAME's `vf2` reaches its attract mode within 20 emulated seconds; Python's minutes-scale budget covers the first one to ten emulated seconds). - **x-rust is the first runnable tier** (late-era L2): it plays games and writes the states the slices start from. - **State transplant** (L3): Model 2's state is a few megabytes: work RAM 1 MB, buffer RAM 128 KB, two 512 x 400 x 16-bit frame buffers (800 KB), polygon and fill RAM ping/pong, tilemap and palette RAM, the DSPs' RAMs and FIFOs, sound RAM and the SCSP, the sub-board Z80s. All of it fits the proposal's chunk format. - **GPU backends** (L6): optional turbo for the renderer, never required (rasteriser.md). - **Named concessions likely:** the 2O/2A geometrizer (a functional model in place of an undumped ROM: not a speed concession but an evidence one; it is still the specification, tagged); a high-level SHARC/TGPx4 geometrizer for weak browsers, if 2B/2C miss there. - **Evidence is thin.** Below the CPUs' and DSPs' instruction sets (tier 2 for the i960 and the SHARC, partial for the TGP, none for the TGPx4), the board's behaviour rests on one emulator's model (MAME, tier 5) and a Sega manual nobody here has seen. The board's README must say "identical to MAME on N slices" where that is all that is known, never "accurate". ## First measurements 1. FIFO and status accesses per emulated second between the i960 and its copro, in a 2A and a 2B game (a MAME trace with watchpoints: short). 2. i960-rust's instructions/s on a slice (and the profile split). 3. The TGP's instruction rate per clock (from the MB86232 data sheet's timing chapter and a 2A copro trace). 4. Renderer: polygons and pixels per frame in a busy Daytona USA or Sega Rally scene.