WASD or Arrow Keys to move. Shoots with Space / button.
Validates inputs, simulates world, rewinds history on raycast.
Moves autonomously back and forth across the arena.
⚡ Nanosecond Netcode vs. JavaScript Reference (V8)
Comparing pure Rust zero-allocation ring buffers against Gabriel Gambetta's original JavaScript implementation. Read Full BENCHMARKS.md →
| Subsystem Verification | Target Tolerance | Measured Performance | Status |
|---|---|---|---|
| Reconciliation Convergence | Δp < 10−4 m | Δp = 0.00 × 10−4 m (Bit-Exact) | PASS |
| Hermite Spline C¹ Continuity | Δv < 0.001 m/s | Δv < 10−3 m/s | PASS |
| Lag Compensation Rewind Raycast | Δd < 0.1 m | Δd < 0.001 m | PASS |
📖 Gabriel Gambetta's Netcode Architecture in Pure Rust
1. Client-Side Prediction
Local player inputs are applied immediately to the local predicted state without waiting for the server round-trip. Every input is recorded in a circular buffer with a sequence number.
2. Server Reconciliation
The authoritative server simulates inputs in order and sends snapshots with the last processed sequence $S_{srv}$. The client discards inputs $\le S_{srv}$, snaps to server state, and reapplies all inputs $> S_{srv}$.
3. Remote Entity Interpolation
Remote entities cannot be predicted. Instead, snapshots are buffered and rendered 100ms in the past with linear or Hermite cubic spline interpolation, guaranteeing buttery smooth motion even over packet jitter.
4. Lag Compensation / Hitbox Rewind
When a client fires at $T_{shot} = T_{now} - \text{RTT}/2 - \text{render\_delay}$, the server temporarily rewinds all remote player colliders to that exact historical frame, runs raycasts, and restores current state.