Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

90 Commits

Repository files navigation

WGPU Cube Simulator

This is a high-precision diagnostic tool for identifying how different compositors manage frame scheduling and presentation under load. Built with Rust and WGPU, it uses a heavy raymarched shader to stress-test your display stack, exposing which environments maintain a smooth, responsive pipeline and which ones collapse into stutter and lag, even when the hardware is still fast enough to keep up.


Core Capabilities

  • Pacing Detection: Captures micro-stutters invisible to raw FPS counters by measuring the precise gap between every hardware-level frame presentation.
  • Compositor Benchmarking: Automatically identifies the "saturation threshold", the exact limit where the compositor fails to maintain perfect V-Blank alignment. The benchmark captures the moment a single hardware frame-slot is missed and report it.
  • V-Sync Profiling: Catches "Back-Pressure", a glitch where missing one frame causes a pile-up that spikes input lag and makes the system feel sluggish.

For a detailed breakdown of the metrics and internal mechanics, see the Project Wiki:

Installation and Usage

To get accurate metrics, you must compile with the release profile to minimize CPU-side scheduling interference and driver overhead:

cargo build --release
target/release/frame-test --connector DP-1 --bench-secs 3 --mode fifo

CLI Parameters

ArgumentDescriptionDefault
-c, --cubesNumber of hollow cubes to march.6
-z, --sizeRadius/Scale of the objects.0.5
-s, --speedMultiplier for rotation and oscillation.1.0
--redRed color component (0.0 to 1.0).0.18
--greenGreen color component (0.0 to 1.0).0.18
--blueBlue color component (0.0 to 1.0).0.18
-t, --thresholdFrame-time delta limit (ms) for MSD (Missed Frames).25.0
-f, --formatForce a specific wgpu::TextureFormat. Prints available options if invalid.None
-m, --modeForce a specific wgpu::PresentMode (mailbox, immediate, fifo).mailbox (auto)
--stepsMaximum raymarching steps per fragment. Higher values increase GPU load.80
--connectorDRM connector name (e.g. DP-1). Auto-selects if only one is active.Auto
--frame-logPath to write high-res per-frame hardware telemetry (NDJSON).None
--csvPath to write rolling window metrics as CSV.None
--jsonPath to write rolling window metrics as NDJSON.None
--bench-secsSeconds per step. Enables benchmark mode when set.None
--bench-warmupSeconds to skip at start of each benchmark step (compositor warmup).2
--bench-maxMaximum cube count to probe in benchmark mode.64
--shaderOverride shader selection (high for SDF, low for analytic).Auto
--pllEnable PI controller to sync frame submission with hardware vblank.s.false

License

This project is licensed under the GNU General Public License v3.0. See the LICENSE file for the full text.

About

An advanced compositor benchmark and frame-pacing analyzer built with Rust and WGPU. Features a custom Software PLL for sub-millisecond sync tracking, real-time DRM/KMS flip monitoring, and deep diagnostic metrics for detecting stutter, jitter, and display-pipeline latency.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages