Results and validation
Every gpu-sim measurement, check and open question.
26 min read
Stages B1 (ball + arena) and C1 (car free flight), measured 2026-10-15. gpu-sim/
steps many independent Rocket League arenas in parallel on the GPU with NVIDIA Warp: the
ball with full arena contact, and cars in free flight (no car contacts yet). It reproduces
RocketSim 0.2.11 plus vendor patch P1 and is checked with the project's own scenarios,
trace format and physlab compare.
Headlines#
C1 headline (car free flight)#
Details: Stage C1: car free flight and C1 car free flight validation.
Fidelity. Inside the window where no car contact is possible (a conservative predicate, Stage C1: car free flight), every car sample is bit-identical to RocketSim: 29 car scenarios, 3,871 of 3,871 car-ticks (position, velocity, ω, quaternion, boost and the jump/flip flags), with sample lines byte-identical to
physlab run. That covers 21 scenarios with no contact at all (14 newgpu-sim/scenarios/gpu-car-*, the sixcar-air-*and thevoid-car-controlsfixture), plus the contact-free prefix ofcar-fall-*anda02-flip-reset-setup.Random states. 16,384 of 16,384 random cars with random inputs changing every 8 ticks end bit-identical to RocketSim after 1,200 ticks. So do 65,536 of 65,536 after 2,400 ticks, and 4,096 of 4,096 with inputs changing every tick.
Speed. About 0.95–0.98 G car-ticks/s at ≥ 65k cars. RocketSim manages 53 M on 28 threads with 16k one-car TheVoid arenas, so the GPU is ~18× faster for this workload (C1: car free flight). The GPU was shared with a running Rocket League client.
Not modelled. Car contacts are not modelled: arena, ball, other cars, wheels and boost pads. Car samples after the predicate fires are reported, never judged.
B1 headline (ball + arena)#
Fidelity. On this machine the GPU traces are bit-identical to RocketSim for all 41 B1 scenarios of the first validation: 20,100 of 20,100 ticks, every
ball_hit_worldevent payload included. The sample lines of every trace are byte-identical tophyslab runoutput.Edge cases. The 10 GPU-owned edge-case scenarios in
gpu-sim/scenarios/(a ball at 6,000 uu/s into a goal post, a ball settling in the goal net, spin above the clamp across seams, and the trace writer's warmup and sampling paths) are also bit-identical: 9,765 of 9,765 samples, events included. They were added in a follow-up review (All 41 shared ball scenarios). So the B1 suite is now 51 scenarios, 29,865 of 29,865 samples bit-identical, events included.Random states. Random arenas also end bit-identical after 1,200 ticks: 16,384 of 16,384 for each of three workloads.
Speed. Ball-only throughput is about the same as RocketSim on 28 CPU threads for workloads with contacts (74 vs 74 M env-ticks/s; the CPU reaches 75–82 with better load balancing), and 8.6× faster for free flight. See Benchmarks for the conditions; the GPU was shared with a running Rocket League client.
Latest batch. Re-run on 2026-10-15T12:23Z (08:23 local) with kernel hash
67bea482779b3f1f: 80 scenarios, 327,680 envs, 2,400 ticks in 0.72 s; 0 FAIL and 1 REPORT (car-fall-wheels-100starts below the C1 box). Results unchanged.
Design and plan: Roadmap and Design spec. Usage: Using gpu-sim. As-built design and every simplification: As-built design. This page covers the measurements.
Benchmarks#
Conditions, 2026-10-15:
RTX 4070 12 GB, driver 617.42, Warp 1.18.0 (NVRTC 13.4), i7-14700K (28 threads).
--trig crt, K = 8, MAX_CAND = 306.The GPU was shared with a running Rocket League client: 44–55 % utilisation and 4.6 GB in use before each run; nothing could be stopped. GPU numbers are therefore lower bounds.
CPU load was 7–17 % before the runs.
Timing is
wp.synchronize-bracketedstep(1200)after a warm-up, median of 5, each repeat reset to the same states.The CPU baseline is the oracle's
cpu-bench: RocketSim ball-only arenas,Balancedgrid, the first 16,384 states of the same.npy, split over threads.
Raw data: gpu-sim/out/gpu/bench.json. Its source hash, c51a9551f658ce25, is older than
the validation run's. A follow-up review re-measured with the validated kernel (Warp module
gpusim.tick da9b949) and got the same numbers (see the re-measurement below). Command:
just gpu-bench --workload ball-random --envs 1,1024,16384,65536,262144,1048576 --readback --torch --cpu-baselineball-random: positions uniform in the Soccar box with a 200 uu margin, |v| ≤ 3000 uu/s, |ω| ≤ 6, 1,200 ticks. Contact on 26 % of env-ticks, a mesh on 1.8 %.
| N envs | step only (M env-ticks/s) | step(8) + .numpy() | step(8) + obs kernel into a torch tensor (same stream) | step(1) + .numpy() every tick | GPU memory for the sim |
|---|---|---|---|---|---|
| 1 | 0.08 | 0.03 | 0.03 | 0.004 | — |
| 1,024 | 6.1 | 3.3 | 3.4 | 2.2 | <1 MiB |
| 16,384 | 49.4 | 23.3 | 23.4 | 19.6 | 32 MiB |
| 65,536 | 67.9 | 41.8 | 42.2 | 37.1 | 128 MiB |
| 262,144 | 73.4 | 52.0 | 53.1 | 46.8 | 544 MiB |
| 1,048,576 | 74.2 | 55.1 | 55.4 | 46.8 | 2,208 MiB |
| CPU RocketSim, 1 thread | 5.30 | ||||
| CPU RocketSim, 28 threads | 73.9 |
Other workloads (step only):
| Workload | GPU, 16k envs | GPU, 262k | GPU, 1M | CPU, 1 thread | CPU, 28 threads |
|---|---|---|---|---|---|
| ball-floor: resting or rolling ball, contact on 94 % of env-ticks | 29.8 | 44.7 | 54.6 | 3.40 | 46.8 |
| ball-flight: the_void, no statics | 934 | 1,294 | 1,288 | 10.6 | 149.8 |
What the numbers show:
Integration alone is cheap on the GPU. It reaches 1.29 G env-ticks/s, 8.6× the 28-thread CPU.
The contact path dominates the B1 megakernel. With contacts, the GPU is on par with 28 CPU threads (74 vs 74 M/s random; 55 vs 47 M/s floor).
Trig mode is not the cost. At 262k envs,
f32ran at 90.6 M/s,f64at 90.0 andcrtat 83.6, measured in an earlier run under the same contention.The likely cause is the kernel itself. PTX shows a 348-byte local stack (the active list and solver row arrays) and a very large register footprint, so occupancy is low.
Short launches cost about 30 %.
step(8)launches lose throughput against one long launch even with negligible readback, because each launch waits for its slowest env (contact work varies per env).Under 64k envs, launch latency dominates.
Splitting the kernel and compacting contacting envs is B2 work (Staged milestones).
Follow-up review: methodology checks and re-measurement. Same conditions: Rocket League running, GPU at 38 % utilisation and 4.6 GB in use before the run.
What was checked:
GPU timing is bracketed by
wp.synchronize_deviceand excludes warm-up.Rate. The env-ticks/s figure is
N·ticks/median.CPU timing covers the stepping loop only (arena setup is excluded) and computes
arenas·ticks/seconds.Same work on both sides: both run ball only, the same states file and 1,200 ticks. The CPU uses the first 16,384 states, from the same distribution as the GPU's.
JIT time is now recorded separately, as
tick_module_load_or_compile_s. Before this review it was only hidden inside the first point'swarmup_s.Cold compile, measured with an empty
wp.config.kernel_cache_dir: 0.49 s for CUDA and 1.96 s for Warp's CPU device.A warm cache load takes 1–3 ms.
Two caveats on the CPU figure:
cpu-benchsplits the arenas into one static contiguous chunk per thread. On the 14700K's mix of 8 P-cores and 12 E-cores, the slowest chunk sets the time.The 28-thread run lasts only 0.27 s and is not repeated.
uv run --project gpu-sim gpu-sim bench --workload ball-random --envs 16384,262144,1048576 \
--cpu-baseline --cpu-threads 1,20,28,56,112 --out <scratch>/bench-random.json
gpusim-oracle cpu-bench --states .cache/bench/states-ball-random-1-1048576.npy --arenas 131072 \
--threads 28,112,28,224 --ticks 1200 --mem balanced --mode soccar # run twice| ball-random | First validation | Follow-up review |
|---|---|---|
| GPU, 16k / 262k / 1M envs | 49.4 / 73.4 / 74.2 | 49.4 / 73.7 / 75.4 |
| CPU, 1 thread (16k arenas) | 5.30 | 5.24 |
| CPU, 28 threads (16k arenas, 0.27 s) | 73.9 | 74.2 (20 threads: 63.5) |
| CPU, 112 chunks on 28 threads (16k arenas) | — | 81.9 |
| CPU, 28 threads (131k arenas, about 2.2 s) | — | 69.4, 70.4, 73.7, 75.5 |
| CPU, 112–224 chunks (131k arenas) | — | 75.0, 78.2, 78.3, 79.4 |
So the honest summary for contact-heavy ball workloads is GPU ≈ 74–75 M against CPU 70–82 M env-ticks/s, depending on how the CPU work is scheduled. The GPU does not beat a well-scheduled 28-thread CPU at B1. Both sides were contended by the running game client.
C1: car free flight#
Conditions as above. Rocket League was running: 43–44 % GPU utilisation and 4.3 GB in use before each run; CPU load 7–10 %.
GPU: one car per env,
car_step_kernelonly (no ball unless--with-ball), random initial states (|v| ≤ 2,600, |ω| ≤ 7, so the clamps are hit) and random inputs.step(1200)is bracketed bywp.synchronize_device, median of 5 after a warm-up, each repeat reset to the same states. The input table isticks/every × Nrows read every tick.CPU:
gpusim-car-oracle car-runon the first N states and inputs of the same files. Each arena is RocketSim TheVoid with 1 car, plus the ball RocketSim always simulates. Arenas are split into one contiguous chunk per thread, setup is excluded, and the run is not repeated.JIT:
carsimcold compile 1.2 s; cached load 2 ms (carsim_module_load_or_compile_s0.06–0.07 s including the first CUDA context use). Warp modulegpusim.carsim b74ba5d.
uv run --project gpu-sim gpu-sim car-bench --envs 1024,4096,16384,65536,262144,1048576 --ticks 1200 \
--cpu-baseline --cpu-threads 1,8,28 --out <scratch>/car-bench.json # every=150, chunk=8
uv run --project gpu-sim gpu-sim car-bench --envs 16384,262144,1048576 --ticks 1200 --with-ball ... --append
uv run --project gpu-sim gpu-sim car-bench --envs 16384,262144 --ticks 1200 --every 8 --chunk 0 ... --append| N cars (1 per env) | step(1200), M car-ticks/s | step(8) launches | with a void ball per env (separate kernel) |
|---|---|---|---|
| 1,024 | 99 | 74 | |
| 4,096 | 354 | 285 | |
| 16,384 | 733 (735 with inputs every 8 ticks) | 596 | 472 (392 with step(8)) |
| 65,536 | 934 | 775 | |
| 262,144 | 955 (970 with inputs every 8 ticks) | 844 | 649 (543) |
| 1,048,576 | 976 | 869 | 655 (560) |
| CPU RocketSim, 1 thread (16,384 arenas) | 3.90 | ||
| CPU RocketSim, 8 threads | 17.6 | ||
| CPU RocketSim, 28 threads | 53.0 (0.37 s run) |
CPU scaling check (same files, run separately, gpusim-car-oracle car-run --threads 1,28,28):
4,096 arenas: 1 thread 4.07, 28 threads 50.5 and 48.7 M car-ticks/s;
16,384 arenas: 1 thread 4.02, 28 threads 49.2, 50.1 and 48.2.
CPU memory limits arena count. A RocketSim TheVoid one-car arena takes about 815 KB
(12.7 GB peak private memory for 16,384 arenas). So the 65,536-arena CPU benchmark was
aborted while it paged (91 GB committed for two passes). The single-pass 65,536-car
crosscheck (C1 car free flight validation) finished, but at 19 M car-ticks/s on 28 threads. The GPU keeps about
160 B per car, plus rows × 24 B of inputs.
What the numbers show:
Car free flight is cheap on the GPU, like ball flight. It reaches about 0.95 G car-ticks/s from 65k cars up: ~18× the 28-thread CPU and ~250× one CPU thread.
C1 is not the hard part. The comparison flatters the GPU: the work is contact-free, and the CPU baseline arenas also carry a ball. The real throughput question is C2/C3, where wheel rays and arena contacts enter (Staged milestones go/no-go).
Launch overhead is visible but small.
step(8)launches cost 10–20 % at ≥ 16k cars.The second kernel costs a third. Running the ball kernel too (void, no contacts) costs about a third, so fusing car and ball into one per-arena kernel is a C4 design question.
Validation#
Commands and environment#
The batch places replica r of scenario i at env r·S + i, where S is the number of
scenarios; all other envs are the_void padding.
The first validation used the 41 shared scenarios: a batch of 167,936 envs, and 1,800 ticks took 0.34 s.
Since the follow-up review the batch also includes the 10
gpu-sim/scenarios(S = 51): a batch of 208,896 envs, and 2,400 ticks took 0.60 s.
just gpu-cache
just gpu-batch # -> gpu-sim/out/gpu/summary.{md,json}, <id>.gpu-warp.jsonl, <id>.cmp.json
uv run --project gpu-sim gpu-sim batch "scenarios/ball/*.json" "scenarios/advanced/a01-*.json" scenarios/void/void-ball-drop.json --out-dir gpu-sim/out/gpu/real --real-dir recordings
uv run --project gpu-sim gpu-sim batch ... --out-dir gpu-sim/out/gpu/index-order --candidate-order index
uv run --project gpu-sim gpu-sim batch ... --out-dir gpu-sim/out/gpu/trig-f64 --trig f64 # and trig-f32
uv run --project gpu-sim gpu-sim crosscheck --envs 16384
just gpu-test # 146 passed today (100 in this run; 89 before the follow-up review)Environment:
2026-10-15; Warp 1.18.0; RTX 4070 (sm_89), driver 617.42; Windows 11.
RocketSim reference traces:
physlab run,rocketsim 0.2.11 + P1.Mesh fingerprint
aa25f1f6fc230c7f.Source hash
da49d0758043364a(finaljust gpu-validaterun; the variant runs used49adbfa5dbbbb278, which differs only by two removed unused imports).Follow-up review run: source hash
1d8a6ee06a244bd0, the same Warp modulegpusim.tick da9b949(the review changed only CLI, runner and bench code), and physlab sha256465b832790b4d40f, the 06:52 build, now frozen asgpu-sim/.cache/bin/physlab.exe.
The single ball-drop example:
gpu-sim run scenarios/ball/ball-drop-center-500.json -o drop/ball-drop-center-500.gpu-warp.jsonl
physlab run scenarios/ball/ball-drop-center-500.json -o drop/ball-drop-center-500.rocketsim.jsonl --meshes collision_meshes
physlab compare drop/ball-drop-center-500.rocketsim.jsonl drop/ball-drop-center-500.gpu-warp.jsonlResult: position, velocity and angular velocity error 0.0000 at ticks 1, 8, 30, 60, 120 and 240. World contacts were reference [136], candidate [136] (match). The 241 sample lines are byte-identical.
All 41 shared ball scenarios#
Columns:
Class comes from the run's gate flags:
mesh= a mesh manifold was active;planes*= a mesh gate opened, but no mesh contact was made.Contact onsets is
physlab compare'sworld_contactslist (number of onsets, and whether the lists match).Bit-exact and events identical are counted per tick against the RocketSim trace, with the default
--trig crt.trig f64 and index order columns are the S5 and S3 measurements.
vs real game: GPU-vs-real error equals RocketSim-vs-real at every horizon. There are no captures for the a01 scenarios or the void scenario.
| Scenario | Class | Ticks | Contact onsets | Bit-exact ticks (crt) | Events identical | Replicas 0/1/4095 identical | Overflow | Status | trig f64 | index order: bit-exact / max dp uu (h≤240) | vs real game |
|---|---|---|---|---|---|---|---|---|---|---|---|
| ball-ceiling | planes | 900 | 4 (match) | 900/900 | 900/900 | yes | 0 | PASS | 900/900 | 900/900 / 0 | = RocketSim |
| ball-corner | mesh | 600 | 239 (match) | 600/600 | 600/600 | yes | 0 | PASS | 600/600 | 38/600 / 42.6 FAIL | = RocketSim |
| ball-drop-center-500 | planes | 240 | 1 (match) | 240/240 | 240/240 | yes | 0 | PASS | 240/240 | 240/240 / 0 | = RocketSim |
| ball-drop-high-1800 | planes | 1200 | 156 (match) | 1200/1200 | 1200/1200 | yes | 0 | PASS | 1200/1200 | 1200/1200 / 0 | = RocketSim |
| ball-lob-side-wall | mesh | 1200 | 299 (match) | 1200/1200 | 1200/1200 | yes | 0 | PASS | 1200/1200 | 1200/1200 / 0 | = RocketSim |
| ball-long-chaotic | mesh | 1800 | 578 (match) | 1800/1800 | 1800/1800 | yes | 0 | PASS | 1800/1800 | 1377/1800 / 0 | = RocketSim |
| ball-ramp-drop-3850 | mesh | 360 | 5 (match) | 360/360 | 360/360 | yes | 0 | PASS | 360/360 | 360/360 / 0 | = RocketSim |
| ball-ramp-drop-3920 | mesh | 360 | 74 (match) | 360/360 | 360/360 | yes | 0 | PASS | 360/360 | 360/360 / 0 | = RocketSim |
| ball-ramp-drop-3980 | mesh | 360 | 172 (match) | 360/360 | 360/360 | yes | 0 | PASS | 360/360 | 360/360 / 0 | = RocketSim |
| ball-ramp-roll-1000 | mesh | 360 | 246 (match) | 360/360 | 360/360 | yes | 0 | PASS | 360/360 | 216/360 / 0.167 FAIL | = RocketSim |
| ball-ramp-roll-2000 | mesh | 360 | 189 (match) | 360/360 | 360/360 | yes | 0 | PASS | 360/360 | 349/360 / 0 | = RocketSim |
| ball-ramp-roll-500 | mesh | 360 | 235 (match) | 360/360 | 360/360 | yes | 0 | PASS | 360/360 | 354/360 / 0 | = RocketSim |
| ball-ramp-roll-angled-1500 | mesh | 360 | 228 (match) | 360/360 | 360/360 | yes | 0 | PASS | 360/360 | 221/360 / 0.112 FAIL | = RocketSim |
| ball-ramp-sweep-1100 | mesh | 300 | 200 (match) | 300/300 | 300/300 | yes | 0 | PASS | 300/300 | 294/300 / 0 | = RocketSim |
| ball-ramp-sweep-1200 | mesh | 300 | 259 (match) | 300/300 | 300/300 | yes | 0 | PASS | 300/300 | 182/300 / 3.8 FAIL | = RocketSim |
| ball-ramp-sweep-1300 | mesh | 300 | 192 (match) | 300/300 | 300/300 | yes | 0 | PASS | 300/300 | 289/300 / 0 | = RocketSim |
| ball-ramp-sweep-1400 | mesh | 300 | 205 (match) | 300/300 | 300/300 | yes | 0 | PASS | 300/300 | 179/300 / 0.507 FAIL | = RocketSim |
| ball-ramp-sweep-300 | mesh | 300 | 300 (match) | 300/300 | 300/300 | yes | 0 | PASS | 300/300 | 187/300 / 0.0386 | = RocketSim |
| ball-ramp-sweep-400 | mesh | 300 | 299 (match) | 300/300 | 300/300 | yes | 0 | PASS | 300/300 | 194/300 / 1.46 FAIL | = RocketSim |
| ball-ramp-sweep-600 | mesh | 300 | 194 (match) | 300/300 | 300/300 | yes | 0 | PASS | 300/300 | 294/300 / 0 | = RocketSim |
| ball-ramp-sweep-700 | mesh | 300 | 216 (match) | 300/300 | 300/300 | yes | 0 | PASS | 300/300 | 194/300 / 1.77 FAIL | = RocketSim |
| ball-ramp-sweep-800 | mesh | 300 | 228 (match) | 300/300 | 300/300 | yes | 0 | PASS | 300/300 | 202/300 / 0.584 FAIL | = RocketSim |
| ball-ramp-sweep-900 | mesh | 300 | 234 (match) | 300/300 | 300/300 | yes | 0 | PASS | 300/300 | 285/300 / 0 | = RocketSim |
| ball-ramp-sweep-off-1100 | mesh | 300 | 201 (match) | 300/300 | 300/300 | yes | 0 | PASS | 300/300 | 268/300 / 0 | = RocketSim |
| ball-ramp-sweep-off-500 | mesh | 300 | 180 (match) | 300/300 | 300/300 | yes | 0 | PASS | 300/300 | 295/300 / 0 | = RocketSim |
| ball-ramp-sweep-off-800 | mesh | 300 | 283 (match) | 300/300 | 300/300 | yes | 0 | PASS | 300/300 | 203/300 / 0.441 FAIL | = RocketSim |
| ball-roll-diag-1000 | mesh | 240 | 240 (match) | 240/240 | 240/240 | yes | 0 | PASS | 240/240 | 240/240 / 0 | = RocketSim |
| ball-roll-diag-2000 | mesh | 240 | 240 (match) | 240/240 | 240/240 | yes | 0 | PASS | 240/240 | 240/240 / 0 | = RocketSim |
| ball-roll-diag-500 | planes* | 240 | 240 (match) | 240/240 | 240/240 | yes | 0 | PASS | 240/240 | 240/240 / 0 | = RocketSim |
| ball-roll-diag-slow-long | planes | 1200 | 1200 (match) | 1200/1200 | 1200/1200 | yes | 0 | PASS | 1190/1200 | 1200/1200 / 0 | = RocketSim |
| ball-roll-x-1000 | mesh | 240 | 240 (match) | 240/240 | 240/240 | yes | 0 | PASS | 240/240 | 240/240 / 0 | = RocketSim |
| ball-roll-x-2000 | mesh | 240 | 240 (match) | 240/240 | 240/240 | yes | 0 | PASS | 240/240 | 240/240 / 0 | = RocketSim |
| ball-roll-x-500 | mesh | 240 | 240 (match) | 240/240 | 240/240 | yes | 0 | PASS | 240/240 | 240/240 / 0 | = RocketSim |
| ball-roll-x-slow-long | planes | 1200 | 1200 (match) | 1200/1200 | 1200/1200 | yes | 0 | PASS | 1179/1200 | 1200/1200 / 0 | = RocketSim |
| ball-spin-floor | planes | 600 | 239 (match) | 600/600 | 600/600 | yes | 0 | PASS | 600/600 | 600/600 / 0 | = RocketSim |
| ball-spin-top | planes | 1200 | 1200 (match) | 1200/1200 | 1200/1200 | yes | 0 | PASS | 1200/1200 | 1200/1200 / 0 | = RocketSim |
| ball-wall-glance | mesh | 900 | 3 (match) | 900/900 | 900/900 | yes | 0 | PASS | 900/900 | 900/900 / 0 | = RocketSim |
| a01-ball-backboard-corner | mesh | 360 | 2 (match) | 360/360 | 360/360 | yes | 0 | PASS | 360/360 | 360/360 / 0 | - |
| a01-ball-backboard | mesh | 360 | 2 (match) | 360/360 | 360/360 | yes | 0 | PASS | 360/360 | 358/360 / 0 | - |
| a01-ball-crossbar | mesh | 360 | 2 (match) | 360/360 | 360/360 | yes | 0 | PASS | 360/360 | 94/360 / 129 FAIL | - |
| void-ball-drop | void | 120 | 0 (match) | 120/120 | 120/120 | yes | 0 | PASS | 120/120 | 120/120 / 0 | - |
Acceptance against Metrics and tolerances: every row passes.
Void and planes: max error 0 in every component.
Meshes: onsets identical and 0 uu at every horizon.
Chaotic (
ball-long-chaotic): no divergence at all over 1,800 ticks, so the CPU-perturbation baseline is moot.Real game: GPU-vs-real = RocketSim-vs-real exactly, for all 37 scenarios with captures.
Determinism and batch invariance: bit-identical.
Bounds: 0 overflows.
Per-horizon position error (1, 8, 30, 60, 120, 240, 480, 960, 1800 ticks) is 0.0 uu
for every scenario and horizon, so it is not tabulated. Per-scenario values are in
gpu-sim/out/gpu/<id>.cmp.json.
GPU-owned edge-case scenarios#
Added in the follow-up review.
These live in gpu-sim/scenarios/. They are part of just gpu-batch and tests/test_gpu_scenarios.py. All were run in the same
51-scenario batch with replicas 0/1/4095, with the default --trig crt and E = 32.
Samples counts sample lines after tick 0.
| Scenario | What it stresses | Class | Ticks / samples | Contact onsets | Events (total / max per sample) | Bit-exact samples | Events identical | Replicas identical | Overflow | Status |
|---|---|---|---|---|---|---|---|---|---|---|
| gpu-ball-post-6000 | 6,000 uu/s into the orange right post (hit at tick 63) | mesh | 600 / 600 | 7 (match) | 12 / 4 | 600/600 | 600/600 | yes | 0 | PASS |
| gpu-ball-post-6000-spin | Same, into the blue post, with 5.6 rad/s | mesh | 600 / 600 | 4 (match) | 12 / 5 | 600/600 | 600/600 | yes | 0 | PASS |
| gpu-ball-net-settle | Scores at tick 82, then settles in the net for 20 s | mesh | 2400 / 2400 | 2036 (match) | 2040 / 5 | 2400/2400 | 2400/2400 | yes | 0 | PASS |
| gpu-ball-spin-seam | Rolling with |ω| > 6 (clamped) towards the side-wall seam | mesh | 1200 / 1200 | 836 (match) | 871 / 6 | 1200/1200 | 1200/1200 | yes | 0 | PASS |
| gpu-ball-ceiling-corner | Upper corner: ceiling, wall and back-wall seams | mesh | 900 / 900 | 3 (match) | 5 / 3 | 900/900 | 900/900 | yes | 0 | PASS |
| gpu-ball-warmup-every | warmup 37, every_n_ticks 7, truncated tail, aggregated events | mesh | 600 / 85 | 44 (match) | 270 / 7 | 85/85 | 85/85 | yes | 0 | PASS |
| gpu-ball-overspeed | Initial |v| 7,077 uu/s and |ω| 7 rad/s (both clamped) | mesh | 900 / 900 | 65 (match) | 69 / 4 | 900/900 | 900/900 | yes | 0 | PASS |
| gpu-ball-void-overspeed | the_void, |v| 7,000, |ω| 9, warmup 5, every_n_ticks 3 | void | 240 / 80 | 0 (match) | 0 / 0 | 80/80 | 80/80 | yes | 0 | PASS |
| gpu-ball-wall-run | Placed rolling beside the side wall; 16 events at tick 1 | mesh | 1200 / 1200 | 1020 (match) | 1334 / 16 | 1200/1200 | 1200/1200 | yes | 0 | PASS (FAIL with E = 8: 8 events dropped) |
| gpu-ball-midfield-high | High lob with spin, warmup 120, 15 s | mesh | 1800 / 1800 | 743 (match) | 753 / 3 | 1800/1800 | 1800/1800 | yes | 0 | PASS |
51-scenario total:
29,865 of 29,865 samples bit-exact, with event payloads identical;
every meta
initial_state_actualand every warning line (goal entered, the_void, truncated interval) is identical to physlab's;sample lines are byte-identical.
Each scenario was also run separately with gpu-sim run and physlab compare, with the
same result.
Measured mismatches and their mechanisms#
--trig f64 (31 of 20,100 ticks differ; still PASS):
ball-roll-x-slow-long: 21 ticks, first at tick 785; max 3.05e-5 uu/s and 6e-7 rad/s (0.003 / 0.006 quanta).ball-roll-diag-slow-long: 10 ticks, first at tick 1042.The mechanism is UCRT
cosf/sinfnot being correctly rounded (Floating point and the CPU libm);crtfixes it.
--trig f32: 33 differing ticks. The same two scenarios, plus ball-ramp-sweep-900
from tick 250 with |Δω| = 3.7e-20 rad/s, a ±0 versus tiny-value difference.
--candidate-order index (S3): 17,713 of 20,100 ticks bit-exact and 10 FAILs.
a01-ball-crossbar: 129 uu at tick 240.ball-corner: 42.6 uu.Ramp sweeps and rolls: 0.11–3.8 uu.
Onsets differ in all 10.
The mechanism: the triangle order decides which manifold slot each point lands in and which
point sort_cached_points evicts, and the averaged synthetic row then differs. Bullet's
BVH leaf order is therefore required, not cosmetic.
Before the broadphase replay (Broadphase: RocketSim's grid, replayed exactly): not measured separately; the replay was in place from the first mesh run.
Random arenas#
Run with gpu-sim crosscheck.
Final pos/vel/ω after 1,200 ticks, GPU against oracle cpu-bench on the same .npy states
with the Heavy grid (as sim-runner uses):
| Workload, 16,384 envs | Bit-identical envs |
|---|---|
| ball-random | 16,384 / 16,384 |
| ball-floor | 16,384 / 16,384 |
| ball-flight | 16,384 / 16,384 |
Also measured with 4,096 envs:
Against the
Balancedgrid on the CPU: also 4,096 / 4,096. The grid mode did not change any result.With
--trig f64, ball-random: 4,044 / 4,096 identical, max 0.041 uu.
Tests#
just gpu-test: 146 passed.
| Test file | What it checks |
|---|---|
test_consts | Bit patterns |
test_cmf | Sizes, the 16 hashes, the fingerprint equals a RocketSim trace's, goal pieces are mesh_4..7, 8,020 triangles, body order equals the oracle's |
test_scenario_hash | All 41 hashes equal the reference traces'; unsupported settings and overlapping controls are refused; float formatting |
test_trace_io | f32 round trip, meta keys, physlab compare of a gpu trace against itself is 0, compare against RocketSim runs |
test_wpmath_bitexact | dot, cross, normalize, quantize (±0, sub-quantum, .5 ties), quaternion multiply/normalize, from_quat, from_mat3a (all branches), integrate (both s branches and the π/4 cap), all against tests/refmodel/ball_ref.py on cuda:0 and cpu |
test_void | Void scenario bit-exact on CUDA and on Warp's CPU device |
test_planes | 8 scenarios bit-exact; f64 trig reproduces the tick-785 transient |
test_meshes | Lob-side-wall's 3 events at tick 424; corner, ramp-drop-3920, ramp-sweep-800 and a01-crossbar bit-exact; index order breaks the crossbar |
test_determinism | 4,096 random envs twice give an identical history |
test_batch_invariance | lob-side-wall and crossbar at envs 0, 1, 4095 and 65535 of a 65,536-env random batch, and as a batch of one |
test_crosscheck | 1,024 random and floor envs bit-identical to RocketSim |
test_gpu_scenarios | All 24 gpu-sim/scenarios (10 ball, 14 car) bit-exact, events and initial_state_actual included, with no overflow; gpu-ball-wall-run really needs more than 8 event slots |
test_car_c1 | 24 C1 scenarios (10 repo, 14 gpu-sim) bit-exact inside the C1 window, meta initial states included; the predicate fires before RocketSim's first divergence; RocketSim confirms the gpu-car scenarios flip, double jump and run out of boost; car scenario hashes; 8-bit axis quantisation against the Rust formula; the C1 box clears all arena triangles, planes and boost pads; 2,048 random cars on CUDA and 256 on Warp's CPU device bit-identical to gpusim-car-oracle |
Warp's CPU device also reproduced ball-lob-side-wall, ball-roll-x-slow-long,
a01-ball-crossbar and ball-corner bit for bit (gpu-sim/out/gpu/cpu-device/).
C1 car free flight validation#
Commands (physlab 465b832790b4d40f, the frozen gpu-sim/.cache/bin/physlab.exe; source hash
180fcca275fd231e, Warp modules gpusim.carsim b74ba5d and gpusim.tick 68e3140):
just gpu-batch # 80 scenarios, 327,680 envs, 90 cars, 2,400 ticks: 0.75 s
uv run --project gpu-sim gpu-sim car-crosscheck --envs 16384 --ticks 1200
uv run --project gpu-sim gpu-sim car-crosscheck --envs 4096 --ticks 2400 --every 1 --seed 7
gpu-sim run gpu-sim/scenarios/gpu-car-flip-cancel.json -o flip-cancel.gpu-warp.jsonl
physlab run gpu-sim/scenarios/gpu-car-flip-cancel.json -o flip-cancel.rocketsim.jsonl --meshes collision_meshes
physlab compare flip-cancel.rocketsim.jsonl flip-cancel.gpu-warp.jsonl # car 0: 0.0000 at every horizon, rot 0.0000 radAt the time, the 23 car scenarios then in the suite also passed against the newest target/release/physlab.exe
(07:48 build, sha256 759558b2f89581f) and against the scratch physlab.exe (05:04)
the tests fell back to. The current target/release build (12:19, sha256 bb5d684d0ffa05c0) has not been checked.
Batch result: 80 scenarios, 0 FAIL, 1 REPORT.
The 51 B1 ball scenarios are still bit-exact in every tick, events included. The
quat_mulsign-of-zero change (Stage C1: car free flight) altered nothing.All 29 car scenarios are bit-identical inside the C1 window.
72 of 80 traces have every sample line byte-identical to physlab's. The 8 that do not are the 7
car-fall-*scenarios anda02-flip-reset-setup, after their car touches something.Replicas 0/1/4095 are identical, cars included.
Errors inside the C1-valid window. The car diff covers position, velocity, ω, the
orientation angle, boost, on_ground, has_jumped, has_double_jumped and
has_flipped. physlab compare gives 0.0000 for car position, velocity, ω and
orientation at every horizon inside the window. Columns:
valid until: the first tick at which a contact is possible (
-= the whole trace);first divergence: the first tick with > 1 uu or > 0.05 rad over the whole trace (contacts included).
| Scenario | Mode | Ticks | Valid until (reason) | Bit-exact car-ticks in window | Max error (pos / vel / ω / rot / boost) | First divergence | Status |
|---|---|---|---|---|---|---|---|
| void-car-controls (fixture) | void | 120 | - | 120/120 | 0 / 0 / 0 / 0 / 0 | - | PASS |
| car-air-none | soccar | 120 | - | 120/120 | 0 | - | PASS |
| car-air-pitch | soccar | 120 | - | 120/120 | 0 | - | PASS |
| car-air-pitch-half | soccar | 120 | - | 120/120 | 0 | - | PASS |
| car-air-yaw | soccar | 120 | - | 120/120 | 0 | - | PASS |
| car-air-roll | soccar | 120 | - | 120/120 | 0 | - | PASS |
| car-air-pitch-yaw-roll | soccar | 120 | - | 120/120 | 0 | - | PASS |
| car-fall-wheels-1000 | soccar | 360 | 192 (arena/pads) | 191/191 | 0 | 210 | PASS |
| car-fall-wheels-300 | soccar | 240 | 75 (arena/pads) | 74/74 | 0 | 115 | PASS |
| car-fall-nose-300 | soccar | 360 | 75 | 74/74 | 0 | 104 | PASS |
| car-fall-roof-300 | soccar | 360 | 75 | 74/74 | 0 | 111 | PASS |
| car-fall-side-300 | soccar | 360 | 75 | 74/74 | 0 | 111 | PASS |
| car-fall-tilted-300 | soccar | 360 | 75 | 74/74 | 0 | 112 | PASS |
| car-fall-wheels-100 | soccar | 240 | 1 (starts below the box) | 0/0 | - | 65 | REPORT (car not judged; ball PASS) |
| a02-flip-reset-setup | soccar | 120 | 39 (ball within 205 uu) | 38/38 | 0 | 90 | PASS (ball REPORT: car wheels land on it at tick 81, body hits it from tick 85) |
| gpu-car-flip-forward | void | 180 | - | 180/180 | 0 | - | PASS |
| gpu-car-flip-backward-fast | void | 180 | - | 180/180 | 0 | - | PASS |
| gpu-car-flip-side-fast | void | 180 | - | 180/180 | 0 | - | PASS |
| gpu-car-flip-diagonal-slow | void | 160 | - | 160/160 | 0 | - | PASS |
| gpu-car-flip-cancel | void | 160 | - | 160/160 | 0 | - | PASS |
| gpu-car-flip-nodir | void | 160 | - | 160/160 | 0 | - | PASS |
| gpu-car-flip-moving-backward | void | 140 | - | 140/140 | 0 | - | PASS |
| gpu-car-boost-latch | void | 140 | - | 140/140 | 0 | - | PASS |
| gpu-car-tumble-overspeed | void | 200 | - | 200/200 | 0 | - | PASS |
| gpu-car-spawn-rotated-late-dj | void | 260 | - | 260/260 | 0 | - | PASS |
| gpu-car-two-cars (2 cars) | void | 150 | - | 300/300 | 0 | - | PASS |
| gpu-car-soccar-flip | soccar | 120 | - | 120/120 | 0 | - | PASS |
| gpu-car-hold-jump-no-ball | soccar | 90 | - | 90/90 | 0 | - | PASS |
| gpu-car-warmup-every (warmup 17, every 5) | void | 123 / 24 samples | - | 24/24 | 0 | - | PASS |
In every scenario where no car touches the ball, the ball itself was also bit-identical over the whole trace, in the void and in Soccar (S10).
What the GPU-owned scenarios exercise. They are in gpu-sim/scenarios/gpu-car-*.json,
and RocketSim's own end-of-trace flags confirm each one does what it says:
dodges forward, backward at 1,200 uu/s (2.5× and 16/15 scales) and sideways at 1,500 uu/s (1.9× scale);
a slow diagonal dodge on the |forward speed| < 100 branch;
a forward dodge while moving backward (the Rust
signumbranch);a flip cancel after the 0.041 s gate, with boost;
a dodge whose direction falls in the deadzone (no impulse or torque, but z-damp and pitch lock);
a 1-tick boost tap (the 0.1 s latch) and boost running out (
boostends at 0);air throttle at −1 and +0.5;
initial |v| and |ω| above both clamps, with fractional 8-bit inputs;
an arbitrary spawn orientation and a double jump 1.6 s after spawn (allowed), then a refused second dodge;
two cars of different presets and teams;
Soccar with the ball resting, and Soccar without a ball (the default ball);
warmup_ticksandevery_n_tickswith cars.
Random cars (gpu-sim car-crosscheck): RocketSim's final state (pos, vel, ω, matrix,
boost, 11 flag bits, jump_ticks), compared bit for bit:
| Cars | Ticks | Inputs change every | Seed | Device | Bit-identical | Cars that flipped / double-jumped (RocketSim) |
|---|---|---|---|---|---|---|
| 16,384 | 1,200 | 8 ticks | 1 | cuda:0 | 16,384 / 16,384 | 14,603 / 1,781 |
| 65,536 | 2,400 | 8 ticks | 2 | cuda:0 | 65,536 / 65,536 | 58,392 / 7,144 |
| 4,096 | 2,400 | 1 tick | 7 | cuda:0 | 4,096 / 4,096 | 3,643 / 453 |
| 4,096 | 600 | 8 ticks | 1 | cuda:0 | 4,096 / 4,096 | 3,611 / 485 |
| 1,024 | 600 | 8 ticks | 1 | cpu (Warp LLVM) | 1,024 / 1,024 | 895 / 129 |
Inputs are uniform in [−1.2, 1.2]: 30 % exact zeros, 10 % exact ±1/±0.5 and some out-of-range values that the clamp catches. Each tick has a 30 % chance of jump, 30 % of boost and 10 % of handbrake. One limitation: with no ground contact, a car can use its single dodge or double jump only once, so most cars spend most of the run in post-flip air control. The flip mechanics are covered more densely by the scenarios above.
Open questions and next steps#
Throughput is the open item: B1 matches, but does not beat, 28 CPU threads when there is contact. B2 candidates:
split integrate and contact kernels, with compaction of contacting envs;
fewer registers and local arrays;
per-warp candidate sharing.
Re-measure on an idle GPU first; these numbers were taken next to a running game client.
atan2 has no libm table. It is used only by the internal-edge correction, and no suite tick has shown an effect. A 2-D exhaustive table is not feasible; a targeted check would compare UCRT
atan2fwith f64 rounding on the arguments that actually occur.Machine-specific exactness. The libm table is per ucrtbase.dll, and mesh order depends on the filesystem. Another machine needs
gpu-sim cache build, which rebuilds and re-verifies both automatically.Event bound E. Traces use E = 32. The API and benchmark default of E = 8 drops events in reachable states: 16 in one tick in
gpu-ball-wall-run, up to 93 in random states. This never affects physics. An RL environment that rewards ball touches needs either E ≥ 32, plus monitoring of the overflow counter, or a per-tick "touched world" flag instead of an event list.C2 (car on flat ground) is next. It adds wheel raycasts against the floor plane, suspension, tire friction, the sticky force, ground jumps and jump-hold, landings, and the jump re-arm. The C1 kernel is the base. Open design question: one thread per car, or per arena once cars can touch the ball (C4).
C1 coverage gaps. Code that is ported but unreachable without contact is unexercised:
is_jumping, auto-flip continuation,on_groundbranches. Only default mutators are covered (unlimited_flips/unlimited_double_jumpsare hard-coded false).Warp scalar unary minus (Stage C1: car free flight). The remaining scalar negations in the B1 contact and solver code could be switched to
neg()for safety. They have never produced a difference, so they were left alone to keep B1's validated code unchanged.