cd /news/artificial-intelligence/ai-agents-just-rebuilt-second-realit… · home topics artificial-intelligence article
[ARTICLE · art-105441] src=promptcube3.com ↗ pub= topic=artificial-intelligence verified=true sentiment=↑ positive

AI agents just rebuilt Second Reality from scratch — no DOSBox

AI agents using Claude 3.5 Sonnet, GPT-4o, and Llama-3.1-70B-instruct rebuilt Future Crew's 1993 demo Second Reality from its original assembly sources into a Rust/WGPU codebase, producing bit-identical 320×200 output and sample-accurate GUS-emulating audio. The 3.4 MB binary cold-starts in ~1.2 seconds on an M2 MacBook, and a frame-diff CI gate fails on any pixel drift above 0.02% against cycle-exact DOSBox-X captures.

read3 min views11 publishedAug 21, 2026
AI agents just rebuilt Second Reality from scratch — no DOSBox
Image: Promptcube3 (auto-discovered)

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, palettes

Agents 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.

Next ChatGPT iMessage access raises real privacy concerns for Apple →

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @future crew 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/ai-agents-just-rebui…] indexed:0 read:3min 2026-08-21 ·