Rust voxel sandbox (wgpu + wasm + axum multiplayer)
Find a file
Maximus Gorog 20bb4f9448 Measurement-driven perf: bench-flag toggles + uncapped frame_dt
You called out vibes-based programming — fair. This adds the actual
measurement substrate so the next change can be data-driven instead
of educated-guess driven.

app.rs:
  - tick's frame_dt was previously clamped to 100ms (for physics
    safety: a 1-second hang shouldn't teleport the player). That
    clamp was poisoning the FPS telemetry: anything slower than
    10 fps reported as exactly 10 fps. Now physics gets the clamped
    dt; the FPS HUD reads the unclamped elapsed_ms so we see the
    real frame time even at 3 fps.

bridges.rs:
  - New BenchFlags { disable_shafts, disable_post }, exposed via
    wasm_api as bench_set_disable_shafts(bool) /
    bench_set_disable_post(bool). Set from JS console or scenario:
        window.voxel_game.bench_set_disable_shafts(true)

render/mod.rs:
  - render() consults the flags. Truly skipped (no clear, no work)
    so the bench measures the pure cost of each pass.

Usage from a player's perspective:
  1. Open the game, watch the FPS HUD (top-right).
  2. F12 → Console
  3. window.voxel_game.bench_set_disable_shafts(true)
     watch HUD — fps should jump if shafts were expensive.
  4. window.voxel_game.bench_set_disable_post(true)
     — measures FXAA + composite + tonemap cost.
  5. Both true — naked terrain only, no post effects.

The Playwright-launched Chromium I have access to is software-
rasterizing at ~3 fps which makes per-pass deltas indistinguishable
from noise. On real hardware the cost differences should be clear.

I won't push more "optimizations" until we have real-hardware data
on which pass is actually costing what.

No features removed. Tests: 63/63 passing. Wasm built clean.
2026-05-24 16:21:19 -06:00
server pre-alpha 0.0.1 — initial multiplayer voxel sandbox 2026-05-22 23:33:47 -06:00
src Measurement-driven perf: bench-flag toggles + uncapped frame_dt 2026-05-24 16:21:19 -06:00
test Tick/toc instrumentation across build + test + mesh phases 2026-05-24 11:49:08 -06:00
web Runtime perf: cheap fog, sky overdraw kill, fewer cloud octaves, in-game FPS HUD 2026-05-24 15:44:14 -06:00
.dockerignore Add Docker + Caddy deploy for voxel.mxvs.art 2026-05-23 18:45:05 -06:00
.gitignore pre-alpha 0.0.1 — initial multiplayer voxel sandbox 2026-05-22 23:33:47 -06:00
ARCHITECTURE.md Add ARCHITECTURE.md mapping the functional-core/imperative-shell split 2026-05-23 23:33:02 -06:00
build-web.sh pre-alpha 0.0.1 — initial multiplayer voxel sandbox 2026-05-22 23:33:47 -06:00
Caddyfile Add Docker + Caddy deploy for voxel.mxvs.art 2026-05-23 18:45:05 -06:00
Cargo.lock pre-alpha 0.0.1 — initial multiplayer voxel sandbox 2026-05-22 23:33:47 -06:00
Cargo.toml pre-alpha 0.0.1 — initial multiplayer voxel sandbox 2026-05-22 23:33:47 -06:00
DEPLOY.md DEPLOY.md: add active-deployment runbook for voxel.mxvs.art 2026-05-23 22:52:43 -06:00
docker-compose.prod.yml Add Docker + Caddy deploy for voxel.mxvs.art 2026-05-23 18:45:05 -06:00
docker-compose.yml Add Docker + Caddy deploy for voxel.mxvs.art 2026-05-23 18:45:05 -06:00
Dockerfile Add Docker + Caddy deploy for voxel.mxvs.art 2026-05-23 18:45:05 -06:00
run.sh Tick/toc instrumentation across build + test + mesh phases 2026-05-24 11:49:08 -06:00