# Domains and speed The charter's "Domains and channels" and capabilities (`recompile: native | wasm | none`), and emulator-lineage `docs/proposals/2026-11-jit.md` (accepted 2026-11-25: the no-JIT path first). Phase 0: no board exists, so every speed figure is an estimate with its arithmetic shown and its measured inputs named. ## Part 1: domains and channels | Domain | Time base | Parts | | --- | --- | --- | | **system** | 4.9152 MHz CPU clock (stops when idle) | 80C88 (i8086-python), ASIC (decode, keyboard, interrupts, contrast, ROM B / card select), RAM, ROMs, card slot, expansion port | | **tick** | 32,768 Hz crystal | the ASIC's timer: one interrupt per 1 s or 128 s (TRG 2.4.2) | | **LCD controller** | its own clock (U8) | HD61830: display RAM, scan, cursor blink | | **tone** | 3.58 MHz crystal | PCD3311 oscillators and filter | Channels: the tick reaches the system only as an interrupt request (a timestamped event); the LCD controller only through ports 8010/8011 (writes, and reads of the busy flag and display data); the tone chip only through its data latch (U13). The system domain never reads the tone chip, and reads the LCD controller rarely (busy flag, pixel reads). Order of record (x-python): one serial loop on CPU clocks; the tick is an event at its computed CPU-clock time (both crystals are fixed, so the mapping is exact while the CPU clock runs; while the clock is stopped the tick is what restarts it); the LCD controller's state advances lazily at each port access (busy flag) and per frame for the picture; the tone chip is a pure producer from its latch writes. None needs a thread at this size. ## Part 2: instructions per second needed - **Ceiling:** the 8088 fetches one byte per 4-clock bus cycle: 4,915,200 / 4 = **1.23 M bus cycles/s**, so at most ~1.23 M one-byte instructions a second and fewer for longer ones. - **Observed** (MAME 0.285, a model; mame-oracle.md): 835,695 instructions in 4 s (**0.21 M/s**, 23.6 clocks each) and 2,576,782 in 10 s (**0.26 M/s**, 19.1), almost all `LOOP`. ibmpc-python's planning range for a 4.77 MHz 8088 is 0.3-0.6 M/s of real code. - **Planning figure: 0.6 M instructions/s** busy; far less on average, because the Portfolio's firmware stops the clock while it waits for a key (TRG 3.8), and a stopped clock costs the emulator nothing. - Per-instruction board work is small: no DMA, no refresh, no CRTC; the LCD is a command-driven controller whose picture is rendered once per host frame from its RAM. ## Part 3: does the no-JIT path reach real time? No x86 core in the family runs yet (i8086-python is Phase 0), so the anchors are the Z80 siblings: colecovision-python (3.58 MHz Z80 board, ~0.5-0.9 M instructions/s needed) runs at 0.6-2.9 x real time on PyPy; z80-rust runs ~50 M instructions/s (both as recorded in ibmpc-python `docs/domains-and-speed.md`). An 8086 instruction decodes more (ModRM, segments, prefixes): assume half the Z80's rate per host second (HYPOTHESIS). | Target (`recompile: none`) | Estimate | Need (busy) | Verdict | | --- | ---: | ---: | --- | | portfolio-python, PyPy | ~0.3-1 M/s | 0.6 M/s | **about 0.5-1.5 x real time** while busy; real time or better at the prompt (clock stopped) | | portfolio-python, CPython | ~0.05-0.1 M/s | 0.6 M/s | ~0.1-0.2 x: tests use short windows | | portfolio-rust, desktop | ~25 M/s (half of z80-rust) | 0.6 M/s | ~40 x | | phone native (~0.8 x desktop) | ~20 M/s | 0.6 M/s | ~30 x | | browser wasm (~0.6 x) | ~15 M/s | 0.6 M/s | ~25 x | | iPhone Safari wasm (~0.5 x) | ~12 M/s | 0.6 M/s | ~20 x, run-ahead 2 affordable | | ARM handheld, A55 class (~0.2 x) | ~5 M/s | 0.6 M/s | ~8 x | **The plain transcription (`portfolio-rust`) is enough everywhere**: no `-fast`, no turbo, no threads, no recompilation. Capabilities to declare: `recompile: none`; threads: none; deterministic save states (state = 128 KB RAM, the LCD controller's RAM (U11), card RAM if a RAM card is inserted, registers); run-ahead and rewind cheap. Speed: trivial. The numbers that would replace these: i8086-python's instructions per second on the SingleStepTests corpus (its rung 2) and portfolio-python's emulated-to-wall ratio over the boot to the banner (about 2.6 M instructions in the first 10 s).