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 new gpu-sim/scenarios/gpu-car-*, the six car-air-* and the void-car-controls fixture), plus the contact-free prefix of car-fall-* and a02-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_world event payload included. The sample lines of every trace are byte-identical to physlab run output.

  • 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-100 starts 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-bracketed step(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, Balanced grid, 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:

text
just gpu-bench --workload ball-random --envs 1,1024,16384,65536,262144,1048576 --readback --torch --cpu-baseline

ball-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 envsstep only (M env-ticks/s)step(8) + .numpy()step(8) + obs kernel into a torch tensor (same stream)step(1) + .numpy() every tickGPU memory for the sim
10.080.030.030.004—
1,0246.13.33.42.2<1 MiB
16,38449.423.323.419.632 MiB
65,53667.941.842.237.1128 MiB
262,14473.452.053.146.8544 MiB
1,048,57674.255.155.446.82,208 MiB
CPU RocketSim, 1 thread5.30
CPU RocketSim, 28 threads73.9

Other workloads (step only):

WorkloadGPU, 16k envsGPU, 262kGPU, 1MCPU, 1 threadCPU, 28 threads
ball-floor: resting or rolling ball, contact on 94 % of env-ticks29.844.754.63.4046.8
ball-flight: the_void, no statics9341,2941,28810.6149.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, f32 ran at 90.6 M/s, f64 at 90.0 and crt at 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_device and 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's warmup_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-bench splits 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.

text
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-randomFirst validationFollow-up review
GPU, 16k / 262k / 1M envs49.4 / 73.4 / 74.249.4 / 73.7 / 75.4
CPU, 1 thread (16k arenas)5.305.24
CPU, 28 threads (16k arenas, 0.27 s)73.974.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_kernel only (no ball unless --with-ball), random initial states (|v| ≤ 2,600, |ω| ≤ 7, so the clamps are hit) and random inputs. step(1200) is bracketed by wp.synchronize_device, median of 5 after a warm-up, each repeat reset to the same states. The input table is ticks/every × N rows read every tick.

  • CPU: gpusim-car-oracle car-run on 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: carsim cold compile 1.2 s; cached load 2 ms (carsim_module_load_or_compile_s 0.06–0.07 s including the first CUDA context use). Warp module gpusim.carsim b74ba5d.

text
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/sstep(8) launcheswith a void ball per env (separate kernel)
1,0249974
4,096354285
16,384733 (735 with inputs every 8 ticks)596472 (392 with step(8))
65,536934775
262,144955 (970 with inputs every 8 ticks)844649 (543)
1,048,576976869655 (560)
CPU RocketSim, 1 thread (16,384 arenas)3.90
CPU RocketSim, 8 threads17.6
CPU RocketSim, 28 threads53.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.

text
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 (final just gpu-validate run; the variant runs used 49adbfa5dbbbb278, which differs only by two removed unused imports).

  • Follow-up review run: source hash 1d8a6ee06a244bd0, the same Warp module gpusim.tick da9b949 (the review changed only CLI, runner and bench code), and physlab sha256 465b832790b4d40f, the 06:52 build, now frozen as gpu-sim/.cache/bin/physlab.exe.

The single ball-drop example:

text
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.jsonl

Result: 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's world_contacts list (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.

ScenarioClassTicksContact onsetsBit-exact ticks (crt)Events identicalReplicas 0/1/4095 identicalOverflowStatustrig f64index order: bit-exact / max dp uu (h≤240)vs real game
ball-ceilingplanes9004 (match)900/900900/900yes0PASS900/900900/900 / 0= RocketSim
ball-cornermesh600239 (match)600/600600/600yes0PASS600/60038/600 / 42.6 FAIL= RocketSim
ball-drop-center-500planes2401 (match)240/240240/240yes0PASS240/240240/240 / 0= RocketSim
ball-drop-high-1800planes1200156 (match)1200/12001200/1200yes0PASS1200/12001200/1200 / 0= RocketSim
ball-lob-side-wallmesh1200299 (match)1200/12001200/1200yes0PASS1200/12001200/1200 / 0= RocketSim
ball-long-chaoticmesh1800578 (match)1800/18001800/1800yes0PASS1800/18001377/1800 / 0= RocketSim
ball-ramp-drop-3850mesh3605 (match)360/360360/360yes0PASS360/360360/360 / 0= RocketSim
ball-ramp-drop-3920mesh36074 (match)360/360360/360yes0PASS360/360360/360 / 0= RocketSim
ball-ramp-drop-3980mesh360172 (match)360/360360/360yes0PASS360/360360/360 / 0= RocketSim
ball-ramp-roll-1000mesh360246 (match)360/360360/360yes0PASS360/360216/360 / 0.167 FAIL= RocketSim
ball-ramp-roll-2000mesh360189 (match)360/360360/360yes0PASS360/360349/360 / 0= RocketSim
ball-ramp-roll-500mesh360235 (match)360/360360/360yes0PASS360/360354/360 / 0= RocketSim
ball-ramp-roll-angled-1500mesh360228 (match)360/360360/360yes0PASS360/360221/360 / 0.112 FAIL= RocketSim
ball-ramp-sweep-1100mesh300200 (match)300/300300/300yes0PASS300/300294/300 / 0= RocketSim
ball-ramp-sweep-1200mesh300259 (match)300/300300/300yes0PASS300/300182/300 / 3.8 FAIL= RocketSim
ball-ramp-sweep-1300mesh300192 (match)300/300300/300yes0PASS300/300289/300 / 0= RocketSim
ball-ramp-sweep-1400mesh300205 (match)300/300300/300yes0PASS300/300179/300 / 0.507 FAIL= RocketSim
ball-ramp-sweep-300mesh300300 (match)300/300300/300yes0PASS300/300187/300 / 0.0386= RocketSim
ball-ramp-sweep-400mesh300299 (match)300/300300/300yes0PASS300/300194/300 / 1.46 FAIL= RocketSim
ball-ramp-sweep-600mesh300194 (match)300/300300/300yes0PASS300/300294/300 / 0= RocketSim
ball-ramp-sweep-700mesh300216 (match)300/300300/300yes0PASS300/300194/300 / 1.77 FAIL= RocketSim
ball-ramp-sweep-800mesh300228 (match)300/300300/300yes0PASS300/300202/300 / 0.584 FAIL= RocketSim
ball-ramp-sweep-900mesh300234 (match)300/300300/300yes0PASS300/300285/300 / 0= RocketSim
ball-ramp-sweep-off-1100mesh300201 (match)300/300300/300yes0PASS300/300268/300 / 0= RocketSim
ball-ramp-sweep-off-500mesh300180 (match)300/300300/300yes0PASS300/300295/300 / 0= RocketSim
ball-ramp-sweep-off-800mesh300283 (match)300/300300/300yes0PASS300/300203/300 / 0.441 FAIL= RocketSim
ball-roll-diag-1000mesh240240 (match)240/240240/240yes0PASS240/240240/240 / 0= RocketSim
ball-roll-diag-2000mesh240240 (match)240/240240/240yes0PASS240/240240/240 / 0= RocketSim
ball-roll-diag-500planes*240240 (match)240/240240/240yes0PASS240/240240/240 / 0= RocketSim
ball-roll-diag-slow-longplanes12001200 (match)1200/12001200/1200yes0PASS1190/12001200/1200 / 0= RocketSim
ball-roll-x-1000mesh240240 (match)240/240240/240yes0PASS240/240240/240 / 0= RocketSim
ball-roll-x-2000mesh240240 (match)240/240240/240yes0PASS240/240240/240 / 0= RocketSim
ball-roll-x-500mesh240240 (match)240/240240/240yes0PASS240/240240/240 / 0= RocketSim
ball-roll-x-slow-longplanes12001200 (match)1200/12001200/1200yes0PASS1179/12001200/1200 / 0= RocketSim
ball-spin-floorplanes600239 (match)600/600600/600yes0PASS600/600600/600 / 0= RocketSim
ball-spin-topplanes12001200 (match)1200/12001200/1200yes0PASS1200/12001200/1200 / 0= RocketSim
ball-wall-glancemesh9003 (match)900/900900/900yes0PASS900/900900/900 / 0= RocketSim
a01-ball-backboard-cornermesh3602 (match)360/360360/360yes0PASS360/360360/360 / 0-
a01-ball-backboardmesh3602 (match)360/360360/360yes0PASS360/360358/360 / 0-
a01-ball-crossbarmesh3602 (match)360/360360/360yes0PASS360/36094/360 / 129 FAIL-
void-ball-dropvoid1200 (match)120/120120/120yes0PASS120/120120/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.

ScenarioWhat it stressesClassTicks / samplesContact onsetsEvents (total / max per sample)Bit-exact samplesEvents identicalReplicas identicalOverflowStatus
gpu-ball-post-60006,000 uu/s into the orange right post (hit at tick 63)mesh600 / 6007 (match)12 / 4600/600600/600yes0PASS
gpu-ball-post-6000-spinSame, into the blue post, with 5.6 rad/smesh600 / 6004 (match)12 / 5600/600600/600yes0PASS
gpu-ball-net-settleScores at tick 82, then settles in the net for 20 smesh2400 / 24002036 (match)2040 / 52400/24002400/2400yes0PASS
gpu-ball-spin-seamRolling with |ω| > 6 (clamped) towards the side-wall seammesh1200 / 1200836 (match)871 / 61200/12001200/1200yes0PASS
gpu-ball-ceiling-cornerUpper corner: ceiling, wall and back-wall seamsmesh900 / 9003 (match)5 / 3900/900900/900yes0PASS
gpu-ball-warmup-everywarmup 37, every_n_ticks 7, truncated tail, aggregated eventsmesh600 / 8544 (match)270 / 785/8585/85yes0PASS
gpu-ball-overspeedInitial |v| 7,077 uu/s and |ω| 7 rad/s (both clamped)mesh900 / 90065 (match)69 / 4900/900900/900yes0PASS
gpu-ball-void-overspeedthe_void, |v| 7,000, |ω| 9, warmup 5, every_n_ticks 3void240 / 800 (match)0 / 080/8080/80yes0PASS
gpu-ball-wall-runPlaced rolling beside the side wall; 16 events at tick 1mesh1200 / 12001020 (match)1334 / 161200/12001200/1200yes0PASS (FAIL with E = 8: 8 events dropped)
gpu-ball-midfield-highHigh lob with spin, warmup 120, 15 smesh1800 / 1800743 (match)753 / 31800/18001800/1800yes0PASS

51-scenario total:

  • 29,865 of 29,865 samples bit-exact, with event payloads identical;

  • every meta initial_state_actual and 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/sinf not being correctly rounded (Floating point and the CPU libm); crt fixes 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 envsBit-identical envs
ball-random16,384 / 16,384
ball-floor16,384 / 16,384
ball-flight16,384 / 16,384

Also measured with 4,096 envs:

  • Against the Balanced grid 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 fileWhat it checks
test_constsBit patterns
test_cmfSizes, 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_hashAll 41 hashes equal the reference traces'; unsupported settings and overlapping controls are refused; float formatting
test_trace_iof32 round trip, meta keys, physlab compare of a gpu trace against itself is 0, compare against RocketSim runs
test_wpmath_bitexactdot, 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_voidVoid scenario bit-exact on CUDA and on Warp's CPU device
test_planes8 scenarios bit-exact; f64 trig reproduces the tick-785 transient
test_meshesLob-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_determinism4,096 random envs twice give an identical history
test_batch_invariancelob-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_crosscheck1,024 random and floor envs bit-identical to RocketSim
test_gpu_scenariosAll 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_c124 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):

text
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 rad

At 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_mul sign-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 and a02-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).

ScenarioModeTicksValid until (reason)Bit-exact car-ticks in windowMax error (pos / vel / ω / rot / boost)First divergenceStatus
void-car-controls (fixture)void120-120/1200 / 0 / 0 / 0 / 0-PASS
car-air-nonesoccar120-120/1200-PASS
car-air-pitchsoccar120-120/1200-PASS
car-air-pitch-halfsoccar120-120/1200-PASS
car-air-yawsoccar120-120/1200-PASS
car-air-rollsoccar120-120/1200-PASS
car-air-pitch-yaw-rollsoccar120-120/1200-PASS
car-fall-wheels-1000soccar360192 (arena/pads)191/1910210PASS
car-fall-wheels-300soccar24075 (arena/pads)74/740115PASS
car-fall-nose-300soccar3607574/740104PASS
car-fall-roof-300soccar3607574/740111PASS
car-fall-side-300soccar3607574/740111PASS
car-fall-tilted-300soccar3607574/740112PASS
car-fall-wheels-100soccar2401 (starts below the box)0/0-65REPORT (car not judged; ball PASS)
a02-flip-reset-setupsoccar12039 (ball within 205 uu)38/38090PASS (ball REPORT: car wheels land on it at tick 81, body hits it from tick 85)
gpu-car-flip-forwardvoid180-180/1800-PASS
gpu-car-flip-backward-fastvoid180-180/1800-PASS
gpu-car-flip-side-fastvoid180-180/1800-PASS
gpu-car-flip-diagonal-slowvoid160-160/1600-PASS
gpu-car-flip-cancelvoid160-160/1600-PASS
gpu-car-flip-nodirvoid160-160/1600-PASS
gpu-car-flip-moving-backwardvoid140-140/1400-PASS
gpu-car-boost-latchvoid140-140/1400-PASS
gpu-car-tumble-overspeedvoid200-200/2000-PASS
gpu-car-spawn-rotated-late-djvoid260-260/2600-PASS
gpu-car-two-cars (2 cars)void150-300/3000-PASS
gpu-car-soccar-flipsoccar120-120/1200-PASS
gpu-car-hold-jump-no-ballsoccar90-90/900-PASS
gpu-car-warmup-every (warmup 17, every 5)void123 / 24 samples-24/240-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 signum branch);

  • 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 (boost ends 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_ticks and every_n_ticks with cars.

Random cars (gpu-sim car-crosscheck): RocketSim's final state (pos, vel, ω, matrix, boost, 11 flag bits, jump_ticks), compared bit for bit:

CarsTicksInputs change everySeedDeviceBit-identicalCars that flipped / double-jumped (RocketSim)
16,3841,2008 ticks1cuda:016,384 / 16,38414,603 / 1,781
65,5362,4008 ticks2cuda:065,536 / 65,53658,392 / 7,144
4,0962,4001 tick7cuda:04,096 / 4,0963,643 / 453
4,0966008 ticks1cuda:04,096 / 4,0963,611 / 485
1,0246008 ticks1cpu (Warp LLVM)1,024 / 1,024895 / 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#

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

  2. 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 atan2f with f64 rounding on the arguments that actually occur.

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

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

  5. 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).

  6. C1 coverage gaps. Code that is ported but unreachable without contact is unexercised: is_jumping, auto-flip continuation, on_ground branches. Only default mutators are covered (unlimited_flips / unlimited_double_jumps are hard-coded false).

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