# Domains and speed Where the PC's domains and channels fall (charter, "Domains and channels") and whether the board reaches real time without recompilation (charter, capabilities; emulator-lineage `docs/proposals/2026-11-jit.md`, accepted). Phase 0: no board exists, so every speed figure is an **estimate** with its arithmetic shown, anchored on measured siblings. ## Domains and channels One clock drives nearly everything: the 14.31818 MHz crystal gives the CPU (/3), the PIT (/12), the colour burst (/4) and the CGA's dots (/1) (cpu-8088.md, video.md). The MDA has its own crystal (dot clock not stated: U10), the keyboard its own 8048 clock, the FDC its own. | Domain | Time base | Parts | Why one domain | | --- | --- | --- | --- | | **System** (order of record) | 14.31818 MHz ticks (CPU clock = 3 ticks, PIT = 12) | 8088, 8288/bus logic, RAM, ROM, 8237 + refresh, 8253, 8259A, 8255, the speaker level, the CGA (CRTC, buffer arbitration, snow, the composite/RGBI signal generator) | refresh steals the CPU's bus every 72 clocks; the CGA's wait states and snow depend on the CPU's bus phase against the character clock; the PIT drives refresh, IRQ0 and the speaker. All of it is visible to the CPU within a clock, so splitting it would put a sync point on every bus cycle | | MDA (when fitted) | its own dot clock | CRTC, buffer, attribute logic | meets the CPU at its ports and buffer through wait states synchronised to its character clock: a **channel at every MDA access** (the CPU waits for the card) | | Keyboard | its 8048 clock (MCU model) or scan-code time (interface model) | the keyboard | meets the board at two wires (clock, data) and the PB6/PB7 lines: a slow, bit-serial channel (~10 kHz) | | Floppy drive | rotation and bit time (250 kbit/s) | uPD765's data path, the drive, the image | meets the system at the FDC's ports, DRQ2/DACK2/TC and IRQ6 | | Picture output (producer) | frames | the CRT model and composite decode | a **pure producer** from the signal log the CGA writes | | Sound output (producer) | samples | the speaker filter and resampler | a pure producer from the speaker-level log | Channels: MDA ports and buffer (every access, the CPU blocks); keyboard clock/data (each bit edge); FDC ports, DRQ2, IRQ6, TC (each access or byte); CGA signal log and speaker log (no sync, producers drain). The uPD765 *controller* sits in the system domain (its registers are polled in tight loops, 262,430 reads of 3F4h in the MAME boot); only the drive and the bit stream are the floppy domain, with a byte FIFO at 31,250 bytes/s as the channel. **Order of record** (x-python, serial): the system domain advances per bus cycle (the core runs its execution unit to its next bus request, the board resolves the cycle's length from refresh, DMA, wait states and the cards, and steps the PIT, the CGA and the PIC to that clock); the other domains catch up at their channels. ## The need, with arithmetic - **CPU clocks:** 4,772,727 per second. - **Bus cycles:** at most 4,772,727 / 4 = **1.19 M per second** (four-clock cycles; I/O five clocks; waits only lower it). The 8088 is bus-bound: the 8-bit bus fetches at most 1.19 M instruction bytes per second, so real code runs roughly **0.3-0.6 M instructions per second** (HYPOTHESIS: average PC instruction 2-4 bytes plus operands, ~8-16 clocks; no instruction-mix measurement here; MAME's i86 instruction count over a window would give a detector figure). - **Refresh:** 66,288 DMA cycles per second (1.19318 MHz / 18). - **PIT:** 1.19 M ticks per second on three counters (cheap if counted in bulk between events, exact per tick only where an output is observed). - **CGA:** 14.318 M dots per second; 80-column text is 1.79 M character clocks per second (8 dots), 40-column and graphics 0.89 M; one 6845 step per character clock plus the dot-pattern serialisation (a producer if done from a log, except where snow couples it back). - **Speaker:** the PIT ch2 output AND PB1 sampled per PIT tick at most (1.19 MHz), filtered. - **FDC:** 31,250 bytes per second while reading. ## Tier by tier (estimates; `recompile: none` throughout) Anchors: colecovision-python (3.58 MHz Z80 with a TMS9918A and an SN76489) runs at 0.3-0.5 x real time on CPython and 0.6-2.9 x on PyPy (MEASURED on that sibling, recorded by the zxspectrum-python and cpc-python Phase 0s); the CPC Phase 0 sets a 1 MHz CRTC-plus-fetch board at 0.3-1 x on PyPy. z80-rust runs ~50 M instructions per second (its README, quoted in psx-python `docs/domains.md`); z80-wasm runs a 3.072 MHz Z80 board at full speed in the browser (live). | Tier | Work per emulated second | Desktop | Phone (native app, no JIT) | Browser (wasm) | | --- | --- | --- | --- | --- | | x-python, PyPy | 1.19 M bus cycles + 1.79 M CRTC steps + 66 k refreshes | **~0.1-0.4 x real time** (HYPOTHESIS: about 3-5 x the per-second work of the CPC board, which the CPC Phase 0 puts at 0.3-1 x) | - | - | | x-python, CPython | same | ~0.03-0.1 x | - | - | | x-rust (transcription) | same | far above real time: ~3 M host-visible events per second against a family record of tens of millions of instructions per second per core (z80-rust ~50 M) | above real time (estimate ~0.8 x desktop single-thread) | above real time (estimate ~0.6 x native) | | x-rust-fast | same, with bulk PIT/CRTC stepping between events | far above; run-ahead 1-2 and rewind affordable | above, with run-ahead | above | **The no-JIT path reaches real time on every target** (desktop, iPhone app, desktop and phone browsers) from x-rust on. The JIT proposal's era-1 row applies: the CPU is a small share of the work; nothing to gain from recompiling a 4.77 MHz 8088. Threads are not needed; the picture and sound producers may move to threads in x-rust-fast if a weak handheld wants it. **What Python means for testing:** at ~0.1-0.4 x on PyPy, the observed boot to ROM BASIC (50.1 emulated seconds with 640 KB, 39 s of it the memory test; mame-oracle.md) takes **2-8 minutes**; with 64 KB and matching switches the memory test shrinks about tenfold (HYPOTHESIS: the test is linear in RAM size). Python rungs use small RAM, short windows and side-loaded test programs; long runs (demos, games) belong to the Rust tiers' lockstep. The numbers that would replace these estimates: i8086-python's instructions per second on the SingleStepTests corpus (its rung 2), ibmpc-python's emulated-to-wall ratio over the 64 KB boot, and MAME's instruction count over a BIOS window as a detector of the real instruction rate.