AI agents just rebuilt Second Reality from scratch — no DOSBox
What makes this different from the usual "AI writes a game" demos is the constraint set. The agents weren't asked to approximate the visual output. They were given the original assembly sources (released by Future Crew in 2003), the documented hardware behavior of VGA Mode X, the GUS/SB audio timing quirks, and told: reproduce the exact frame-by-frame logic, but in Rust/WGPU with zero runtime translation overhead.
The voxel tunnel segment is the tell. Original code used a 320×200 planar buffer with unrolled loop blitting and self-modifying code for the perspective divide. The agent version generates a compute shader that does the same math — same fixed-point precision, same 16.16 interpolation — but parallelized across 10,000 threads. Visual output is bit-identical at 320×200. At 4K it's supersampled cleanly because the math never approximated; it just scaled.
Audio path is wilder. The original tracked modules (S3M format) drove a Gravis UltraSound with 32 hardware voices and hardware volume ramping. The rebuild transpiles the S3M commands into a real-time software mixer that emulates the GUS envelope generators and linear interpolation — but runs it on a single CPU core at 48kHz with sample-accurate timing. You can swap the mixer backend to PipeWire, CoreAudio, or WASAPI without touching the sequencer logic.
Build system is pure Cargo + wgpu + kira for audio. No CMake, no vendored SDL, no dosbox-x submodule. cargo run --release cold-starts to the opening plasma in ~1.2 seconds on an M2 MacBook. The binary is 3.4 MB stripped.
There's a faithfulness crate in the workspace that runs frame-diff CI against recorded original captures (DOSBox-X, cycle-exact, 70Hz). Any pixel drift >0.02% fails the gate. That's how you know it's not "inspired by" — it's mathematically equivalent.
The repo structure:
second-reality-rs/
├── src/
│ ├── effects/ // each effect = one module, zero shared state
│ │ ├── plasma.rs
│ │ ├── voxel_tunnel.rs
│ │ ├── vector_balls.rs
│ │ └── ...
│ ├── audio/
│ │ ├── s3m.rs // parser + tick generator
│ │ ├── mixer.rs // GUS-emulating softsynth
│ │ └── backend.rs // cpal abstraction
│ ├── render/
│ │ ├── wgpu_ctx.rs
│ │ └── shaders/ // .wgsl ported from original fixed-point math
│ └── main.rs // 180 lines, pure orchestration
├── tests/
│ └── frame_diff.rs // CI gate
└── assets/ // original .S3M, font bitmaps, palettesAgents used: Claude 3.5 Sonnet for the Rust architecture and WGPU shader translation, GPT-4o for the S3M→mixer transpilation (it nailed the GUS ramp tables on first try), and a local Llama-3.1-70B-instruct for the frame-diff test harness. Human review caught two bugs: the copper-bar raster interrupt timing in the credits scroll, and the palette fade curve (original used a 6-bit DAC with nonlinear gamma; the first pass assumed linear).
This isn't "AI wrote a demo." It's "AI did the mechanical translation of 28,000 lines of hand-tuned 16-bit assembly into a modern graphics/audio stack while preserving numerical semantics," and a human verified the edge cases. The distinction matters. The resulting codebase is maintainable — you can swap the voxel tunnel for a compute-based raymarcher in 200 lines without touching the audio sequencer or the effect scheduler.
Clone it. cargo run --release. Watch the vector balls at 4K/144 and remember: the original fit in 640 KB of RAM and ran on a 33 MHz 386. The math hasn't changed. Only the substrate.