Parallax
An AI pit wall that races its own strategy against the real Formula 1 race, lap by lap, with no hindsight.

The problem
Race coverage shows you the strategy a team chose. It never shows what a different call would have done in the same race. Hindsight analysis exists, but it knows how the race ended, so it is not a fair test of a decision made on lap 20.
I wanted a tool that makes the strategy call live, using only what it has seen so far, and then races that call against reality.
How it works
Pick a Grand Prix and a driver. Parallax replays the race lap by lap and runs a shadow car next to the real one. Every lap, the engine refits its tyre model, re-plans the whole strategy and moves the shadow car on by one lap.
Key decisions
Measure the decision, not the driver
Each shadow lap starts from the driver's real lap time, which already carries traffic, form and safety-car pace. Only the tyre effect of the new strategy and its pit loss are swapped in. The gap between the two cars then shows the strategy call itself.
shadow lap = real clean lap + [model(shadow tyre) − model(real tyre)] + pit lossA tyre model that works from lap 3
Early in a race there is almost no data. I fitted degradation with ridge regression that shrinks towards physical priors, so the model starts sensible and lets real data take over by mid-race.
Fast enough to re-plan every lap
The optimiser checks every legal 0, 1 and 2-stop plan, respecting the two-compound rule and stint limits. Closed-form stint costs and vectorised NumPy bring a full re-plan down to a few milliseconds.
Designed like a broadcast, not a spreadsheet
Strategy is told through moments: a "BOX BOX" sweep when the AI stops, radio calls with a predicted rejoin position, and timing-tower rows that slide past each other on overtakes. The title card's layers move at different speeds, which is where the name comes from.


Results
The tests run on a synthetic race where the true tyre physics are known, so the engine can be checked against the right answer.
Trade-offs and next
- The shadow car does not get stuck in traffic. Rejoin positions are estimated from gaps.
- Dry strategy only. On intermediates and wets, the model pauses and says so.
- Next: Monte Carlo evaluation with safety-car probability per lap, a traffic model, and live sessions from the F1 timing feed.


