# Domains and speed Where the Channel F's domains and channels fall (charter, "Domains and channels"), how many instructions a second it needs, and whether the board reaches real time without recompilation (charter, capabilities `recompile: native | wasm | none`; emulator-lineage `docs/proposals/2026-11-jit.md`, accepted 2026-11-25). Phase 0: nothing here is measured on this board, because it does not exist. Every speed figure is an **estimate** with its arithmetic shown; the measured inputs are named. ## Part 1: domains and channels | Domain | Time base | Parts | Why | | --- | --- | --- | --- | | **CPU and bus** | phi clocks | f8-python: the F3850, both BIOS F3851s, the cartridge's chips (and their RAM); the port latches (ports 0, 1, 4, 5, cartridge ports); the controller and button inputs | everything the CPU can observe is here: memory, ports, inputs. The CPU reads nothing else | | **Video scan-out** (pure producer) | dots and lines of the video counters | the VRAM contents as written, the scan counters, the colour decode, the picture | **the CPU cannot read VRAM, a counter, a blanking flag or an interrupt from it** (SCH: no path back; INT REQ comes only from the cartridge connector). It consumes the log of VRAM writes and produces pictures | | **Tone generator** (pure producer) | line counter taps and the RC envelope | port 5 bits 6-7 as written, the selected counter tap, the decay network, the speaker | nothing returns to the CPU | Both producers are driven by the same crystal as the CPU, so their time is a fixed ratio of phi; they are separate domains because nothing flows back, not because of a clock. ### Channels and sync points | Channel | Between | Sync point | | --- | --- | --- | | VRAM write (port 0 bit 5 pulse, with ports 1, 4, 5 latched) | CPU -> scan-out | **none for the CPU**: a record (phi stamp, column, row, two bits) appended to a log the scan-out drains | | port 5 bits 6-7 | CPU -> tone generator | none for the CPU: (phi stamp, value) to a log | | controller and button reads (ports 0, 1, 4) | host input -> CPU | the read's phi stamp (input is sampled when the instruction reads, inside the CPU domain) | | cartridge INT REQ | cartridge chip -> CPU | inside the CPU domain (the chips are f8-python devices) | **Order of record** (x-python, serial): the CPU domain runs; the producers run after it to the same phi stamp at each frame boundary (or whenever the host asks for a picture or samples), consuming the logs. Because no channel returns to the CPU, any later point is equally exact: the picture of a frame is a function of the writes stamped before each pixel's scan time. ### Memory kinds (who may write each region) | Region | Written by | Notes | | --- | --- | --- | | BIOS PSUs, cartridge ROM | nobody | code never invalidated | | scratchpad (64 bytes, in the CPU) | CPU | not executable | | cartridge RAM (Schach layout, 2800h-2FFFh) | CPU through DC0 | executable in principle (homebrew could) | | port RAM (Maze, Hangman) | CPU through ports | not executable | | VRAM | CPU through ports only | read only by the scan-out | ## Part 2: how many instructions a second the CPU needs - phi = **1,789,772 Hz** NTSC, **2,000,000 Hz** PAL (MAME `-listxml`, OBSERVED; NTSC is the 3.58 MHz crystal / 2 on SCH, DOC). - The fastest F8 instruction is one short cycle of 4 phi (DOC, `../f8-python/docs/table3.tsv`), so the **ceiling is 1,789,772 / 4 = 447,443 instructions/s** (500,000 PAL). - MAME runs the BIOS's polling loop at **211,186 instructions/s** (OBSERVED, `../f8-python/docs/mame-oracle.md`). - Planning figure: **0.45 M instructions/s**, plus the ROMC fan-out to 3-5 memory chips per machine cycle in the specification (`../f8-python` brief: up to ~4.5 M chip calls/s). The producers: a dot-level scan-out is 256 x 264 x 60.53 = **4.09 M dots/s** (MAME's raster; C1 in video.md), of which 102 x 58 x 60.53 = 0.36 M are visible pixels; the tone generator is one counter tap and one RC step per output sample (44,100/s). ## Part 3: is an interpreter enough without recompilation? Measured inputs (this machine, one core): m6800-python 3-4.5 M instructions/s on CPython and 45-80 M on PyPy (its README); z80-rust ~50 M/s and sh2-rust 30-47 M/s native, sh2-rust 0.55-0.65x of that as wasm (their docs, as quoted in psx-python docs/domains.md). Assumed ratios (HYPOTHESIS): a recent phone at ~0.8x this desktop core, a low-cost ARM handheld at ~0.2x. | Target | CPU domain (estimate) | Need | Scan-out | Verdict | | --- | --- | --- | --- | --- | | channelf-python, CPython | 0.3-1 M instructions/s with the ROMC fan-out | 0.21-0.45 M | a dot-level scan in Python (~4 M dots/s) is the slow part: roughly 1-3 s per emulated second | **below real time on CPython**; fine for a reference board ("correct, not fast") | | channelf-python, PyPy | 5-20 M | 0.45 M | ~10x faster than CPython | about real time or better | | channelf-rust (transcription), desktop native | tens of M | 0.45 M | trivial | 50x real time or more | | channelf-rust, browser wasm on a phone | ~0.45x desktop native | 0.45 M | trivial | tens of times real time | | low-cost ARM handheld, native | several M | 0.45 M | trivial | real time with room for 1-2 frames of run-ahead | So **`recompile: none` on every target**; no cached interpreter, no JIT; threads are possible (both producers can move off the CPU's thread with no sync point at all) but not needed. By the charter's rule ("tiers exist only where a target needs them") a `channelf-rust-fast` is not planned; `channelf-rust` plus a site (`play-chf`, Aubrey's call) would play everywhere. The one place where the specification's form matters for speed is the ROMC fan-out (f8-python's brief, Domains and speed).