Waiting for emulator to boot...
Waiting for emulator to boot...
The neural execution core is powered by Mamba SSM layers that maintain a continuous recurrent state across the entire lifetime of the guest CPU:
A single neural forward pass predicts all execution side-effects simultaneously without autoregressive token generation:
Bit-Level Program Counter (PC): The 32-bit guest PC is unpacked into 32 binary features [b0, ..., b31] to eliminate continuous address hallucination.
Log1p Register Normalization: Register values are normalized via ln(1 + R)/22.2, preserving exact representations for small integers, loop counters, and heap pointers.
Ground-Truth Supervised Training: Trained on millions of execution traces captured from native RV32I DOOM execution with full hardware register and memory ground truth.
Rather than relying solely on external JS/ONNX runtime calls, Mamba-Nano's forward pass is implemented as a hand-vectorized C kernel directly inside rv32i.wasm:
DOOM execution contains tight loops and deterministic ALU/load/store sequences:
Decouples the execution loop from the browser UI thread:
MessageChannel macro-tasks for continuous, uninterrupted neural stepping without timer clamping.ctx.putImageData) run directly inside requestAnimationFrame at 60 Hz, preventing compositor starvation and frame drops.Modeled after modern speculative out-of-order CPU architectures:
Step-by-step data flow from guest CPU registers and Program Counter through the Mamba SSM core to DOOM's 320x200 VRAM frame buffer.
Read PC & 32 general-purpose registers from CPU state.
Update continuous Mamba recurrent hidden state vector.
Predict branch decision, target PC, and register bitmask.
Speculatively retire branch and chain up to 128 insts.
Blit DOOM VRAM (0x81000000) to HTML5 canvas at 60 Hz.
By predicting control-flow deltas at the basic block level rather than single characters, the model achieves 100% 4-byte instruction alignment and preserves loop counter termination invariance. Critical loops in DOOM (such as column drawing in the BSP renderer and sector plane rendering) resolve consistently without PC pointer divergence.
Understanding why DOOM runs on RV32I, what the ARM32 hardware barrel shifter is, and how neural predictors handle compound instruction semantics vs. orthogonal RISC.
In classical ARM (ARMv4T / ARM7TDMI), every arithmetic instruction (ADD, SUB, AND, ORR, etc.) passes its second operand (operand 2) through a dedicated 32-bit hardware barrel shifter before reaching the ALU input.
Why ARM did this: In 1985, memory bandwidth was extremely slow. Combining shifts with arithmetic increased code density and kept the single-issue pipeline fed without extra instruction fetches.
ARM dedicates bits [31:28] of every 32-bit instruction to one of 16 condition codes (eq, ne, cs, cc, mi, pl, vs, vc, hi, ls, ge, lt, gt, le, al, nv).
Why RISC-V dropped it: Predication wastes 4 bits in every opcode (25% of encoding space) and makes out-of-order execution, register renaming, and superscalar retirement far more expensive in hardware.
| Processor / System | ISA Type | Physical Transistors | Neural Parameters | Role in this Project |
|---|---|---|---|---|
| Intel 486DX (1989) | x86 (CISC) | ~1,200,000 | — | Original 1993 PC hardware target for DOOM |
| ARM7TDMI (1994) | ARMv4T (Complex RISC) | ~74,000 | — | Bare-metal ARMv4T DOOM port, interpreted in-browser (~115 MIPS WASM) |
| PicoRV32 (2015) | RV32I (Minimal RISC) | ~10,000 – 25,000 | — | Clean orthogonal ISA chosen for bare-metal DOOM compilation |
| DOOM Mamba-Nano (2026) | Selective State Space | — | 35,906 | Neural network that learns the CPU execution manifold at 35 FPS |