Sohaib Kaidali

← All work  ·  Personal research project · finished, code public

When the road suddenly turns to ice, can a learned policy beat adaptive MPC under fair conditions, and in which scenarios can nothing save the car?

Under fair conditions, no. The reinforcement-learning policy did not beat adaptive MPPI, and a big part of its apparent safety came from driving slower. After I found and fixed a bug in how it was trained, it matched adaptive MPPI at the same speed, but did not beat it.

My role
Everything: design, simulator, controllers, statistics, report
When
Oct 13 – Nov 14, 2026
Stack
C++17/CUDA, Python, NVIDIA Warp, PyTorch
Links
Code (MIT) · Technical report (PDF)
Why friction matters. Same controller, same ice patch: the left planner assumes dry road and keeps believing it can turn; the right one knows the current friction. Orange lines are its sampled plans. (Tuning scenario, not a result.)

The problem

A car is in a corner on dry road and the surface turns to wet, snow or ice within a few metres. Two families of controller claim to handle this:

Papers usually report one beating the other. Two things make those comparisons hard to trust. Many test cases are crashes no controller could avoid, which just adds noise. And the method the authors care about usually gets more information or more tuning.

What I built

First, find out what is possible

Every scenario gets a label before any controller is compared: reactive-feasible (you can save it by reacting), preview-required (only if you see the ice coming), certified-infeasible, or undetermined. The "infeasible" label comes from a proof: a friction-circle certificate shows the tyres can't supply the force the corner needs, even used perfectly. The "feasible" labels come from oracle MPPI controllers that are told the true grip. 4,000 held-out test scenarios were labelled this way.

Grid of bar charts for ice, snow and wet surfaces and four patch lengths. Each bar splits arrival speed into possible, undetermined and certified infeasible ranges.
What the proof alone decides. Rows are surfaces, columns are how long the slippery patch is, each bar is a corner radius. Blue: recoverable. Orange: proven impossible. Green: the proof can't say, so the oracle controllers decide.

A simulator and a controller I can trust

The car is a dynamic bicycle model with combined-slip Pacejka tyres and separate friction on each axle, written in NVIDIA Warp so thousands of cars run at once on the GPU. I wrote it test-first against a slow float64 reference model. Then I wrote the MPPI controller a second time in C++17/CUDA (CMake, GoogleTest in CI, Python bindings). It reproduces the Warp version's random number stream bit for bit, so both draw exactly the same samples and can be compared on whole control steps.

Compute (RTX 5090 Laptop GPU)C++/CUDAWarp
One MPPI step, 1 car, 1,024 samples × 150-step horizon (median of 30)15.3 ms15.8 ms
Same, 64 cars at once (median of 30)46.8 ms58.9 ms
Learned policy, one step on one CPU thread (median of 300)0.19 ms

A fair fight, agreed in advance

What I found

The labels change the ranking

Bar chart of lane-departure rate per method for each feasibility class. On reactive-feasible scenarios most methods are below 0.2; on preview-required scenarios reactive controllers nearly always fail; on certified-infeasible scenarios everything fails.
Lane-departure rate by feasibility class (95% CIs). Where only a preview can save the car, reactive controllers nearly always fail, and on certified-infeasible scenarios everything fails. A single pooled failure rate mostly measures the scenario mix.

The learned policy did not beat adaptive MPPI

On 3,009 paired reactive-feasible scenarios × 5 seeds, the RL student did not beat the model-bank MPPI: departure difference −15.6 pp, 95% CI [−42.1, +1.0]. The interval is that wide because the PPO training seeds ranged from excellent to failing. A sanity gate I had pre-registered flagged that instability before the test run.

Much of its safety was caution

The learned policies reach the ice noticeably slower than the reference speed. So I drove the bank MPPI at the student's arrival speed: it departs 0.006 of the time vs 0.190 for the student. Slowing down has a price, too: a 16.0% [15.4, 16.7] loss of pace on dry road.

Left: departure rate against mean arrival speed for every method; the RL policies sit at low speed with wide error bars. Right: departure rates within matched arrival-speed bins.
Adaptation or caution? Left: safety against arrival speed. Right: departure rates compared at matched speed.

Two more results. A student distilled from a teacher that can see the road ahead departs 17.7 pp less [1.2, 44.3] than one distilled from a teacher that only knows the current friction, even though the student itself never sees the road ahead. And model mismatch did not hurt the bank MPPI on any of the three axes I tested, which went against my prediction.

Debugging the seed instability

Two of five PPO teacher seeds collapsed. Training is deterministic per seed, so I could replay a failing run exactly. I ruled out four hypotheses on 10 seeds each (reward normalisation, a bound penalty, the learning rate and the discount factor). The real cause was a mismatch: checkpoints were kept based on success during training, with exploration noise on, but the policy is deployed without noise. Selecting checkpoints on deterministic held-out validation fixed it.

I then re-tested under a second pre-registration (A9) on 2,233 fresh scenarios. All 10 seeds of the repaired policy passed the reliability gate (old recipe: 8/10), and at matched speed it was non-inferior to adaptive MPPI: +0.3 pp [−0.3, +0.9] with a 2 pp margin. Not superior.

Left: departure rate for each training seed; the old recipe has one seed near 0.7, the repaired recipe's seeds are all low. Right: departure rate against dry-road pace tax for the oracle, bank MPPI and RL policies.
Follow-up test. Left: one dot per training seed; the dashed line is the reliability gate. Right: safety against speed. The repaired policy (orange) is as safe as the bank MPPI at the same pace, not safer.

What I learned

Everything is public: the code (MIT), the v1.0.0 release and the technical report. Every number on this page is written by the evaluation harness.

← Underwater robotMore projects →