Skip to content

Latest commit

 

History

History
293 lines (212 loc) · 11 KB

data-sources.md

File metadata and controls

293 lines (212 loc) · 11 KB

Data sources and provenance

Where every input comes from, and what each provenance label means.

The platform's central claim is that its numbers are traceable. This document is the audit trail for that claim.


1. Provenance labels

Every API response carries one of four labels, and the interface displays it.

Label Meaning
PUBLIC Sourced from publicly published reference material
MODEL_OUTPUT Computed by the deterministic physical models in this repository
SIMULATED Produced by the stochastic simulation
ESTIMATED Hand-authored parameter that was not measured

The distinction that matters most is ESTIMATED versus everything else. An estimated parameter is a choice someone made; a model output is a consequence of those choices. Conflating them is how a simulation starts being mistaken for a measurement.


2. What is PUBLIC

Taken from publicly available circuit and calendar information.

Per circuit

Field Notes
Lap distance Matched exactly by straight-length normalisation
Corner count Published figure
Race laps Published figure
Direction Clockwise / anticlockwise
Altitude Approximate, used for air density
Sector split Approximate fractions of lap distance
DRS zone count Zone positions are approximate
Lap record + holder + year Used only for validation
Pit lane length and loss Approximate
Safety car base rate Historical frequency, approximate

The five circuits

Length Corners Laps Lap record
Silverstone 5,891 m 18 52 1:27.097 (2020)
Monza 5,793 m 11 53 1:20.329 (2004)
Spa-Francorchamps 7,004 m 19 44 1:46.286 (2018)
Suzuka 5,807 m 18 53 1:30.983 (2019)
Monaco 3,337 m 19 78 1:12.909 (2021)

Lap records are used only as a validation target, never as a model input.


3. What is ESTIMATED

Circuit geometry — the biggest approximation

The shape of every circuit is authored, not surveyed.

Each circuit is a curvature spine: an ordered sequence of straights and constant-radius arcs, hand-authored to reproduce the recognisable outline, the corner sequence, and the relative character of the track. Radii and arc angles are approximations.

What is exact:

  • Lap distance — straights are scaled so the integrated lap matches the published figure exactly. Corner radii and angles are held fixed, because they are the physically meaningful part.
  • Turning number — every circuit's arcs sum to the turning number of its topology: −360° for a clockwise loop, and 0° for Suzuka, whose figure-of-eight crossover makes it the one circuit on the calendar with zero net rotation.

What is not:

  • Individual corner radii
  • Exact corner positions along the lap
  • Track width, camber, kerbs, run-off
  • Pit lane geometry (drawn as an indicative offset spur)
  • Elevation — authored per segment as a plausible profile. It is displayed and carried through the geometry, but only weakly coupled to the vehicle model.

Corner speeds computed from this geometry are model output against approximate geometry — not measured data, and not a claim about the real corner.

Vehicle parameters

Chosen so the resulting lap times, corner speeds and top speeds land in a plausible range for a modern high-downforce open-wheel car. None derive from any team's data.

Parameter Value Basis
Chassis mass 798 kg Regulation minimum, public
Fuel capacity 110 kg Regulation maximum, public
Peak power 760 kW (~1020 hp) Order-of-magnitude estimate
Drag area C_d·A 1.08–1.70 m² Fitted to plausible top speeds
Downforce area C_l·A 3.95–6.35 m² Fitted to plausible cornering
Lateral friction 1.78 Estimate
Longitudinal friction 1.72 Estimate
Friction ellipse exponent 1.70 Measured tyre data sits at 1.6–1.8
Transient time constant 0.34 s Estimate
Grip calibration 1.000 Fitted against lap records — see §5

Tyre parameters

Fully estimated. See tyre-model.md for the table and the calibration history.

These do not represent any tyre manufacturer's product. The compound names are generic (Soft / Medium / Hard / Intermediate / Wet) and the coefficients are authored to have correct relative behaviour, not correct absolute values.

Drivers and teams — fictional

The ten drivers and five constructors are invented. They are not pseudonyms for real competitors and any resemblance is coincidental.

Each driver is described by coefficients the simulation actually consumes:

Coefficient Enters the model at
pace_scale Grip multiplier in the lap-time solver
consistency_sigma_s Standard deviation of lap-to-lap noise
tyre_management Multiplier on the tyre wear rate
qualifying_delta_s One-lap offset vs race pace
wet_skill Grip multiplier, wet conditions only
racecraft Logistic slope in the overtaking model
start_delta_s Mean time gained on lap one

There is deliberately no composite driver rating. Any such number would be a weighted sum whose weights are arbitrary; each coefficient above is individually meaningful and is what the simulation consumes. The API exposes them directly.

Operational parameters

Pit stop times, dirty air loss, DRS benefit, safety car pace multiplier, DNF rates, track evolution — all estimated. Listed in full at GET /api/model-info and displayed on the Settings page.


4. What is MODEL_OUTPUT

Computed deterministically. Reproducible from the inputs above.

  • Corner speeds (entry, apex, exit) and corner classification
  • Lap times, sector times, speed profiles
  • Throttle, brake, gear, RPM, steering channels
  • Circuit characteristic indices
  • grip_sensitivity_s_per_grip, fuel_effect_s_per_kg
  • Strategy costs, optimal stint splits, risk indices
  • Tyre projections

5. What is SIMULATED

Produced by stochastic simulation. Reproducible for a fixed seed.

  • Race results, finishing order, gaps
  • Lap-by-lap records for replay
  • Race events (overtakes, pit stops, safety cars, retirements)
  • Win/podium/points probabilities and position distributions
  • Synthetic telemetry (driver line variation is seeded)

Telemetry deserves a specific note. It is derived from one solved speed profile, so speed, throttle, brake, gear and RPM are mutually consistent by construction rather than drawn independently from plausible-looking distributions. Driver-to-driver variation is applied to the racing line — the input the solver consumes — so an alternative line moves every channel together the way a real one does.

No real car produced these numbers.


6. Validation

The only place public data meets model output.

Method — modelled qualifying lap (low fuel, DRS enabled, fresh soft tyre) against the published lap record, with one global grip calibration fitted across the whole library by golden-section search.

Circuit Modelled Record Error
Silverstone 1:25.266 1:27.097 −2.10%
Monza 1:23.310 1:20.329 +3.71%
Spa 1:43.033 1:46.286 −3.06%
Suzuka 1:28.879 1:30.983 −2.31%
Monaco 1:13.576 1:12.909 +0.91%

RMS 2.60% · mean bias −0.57% · calibration 1.000

Reading the residuals

A qualifying lap should sit a few percent inside a race lap record, so the negative residuals are the expected direction and magnitude.

Monza is the outlier at +3.71%. That record dates from 2004, under a different technical regulation — it is not a like-for-like comparison, and the API's validation endpoint says so in the row's note field.

Why one scalar, not per-circuit

A per-circuit correction would guarantee a good-looking table while hiding the fact that one circuit's authored geometry is worse than another's. One scalar for five circuits means the residuals that remain are informative: they tell you which geometry is least faithful.

The model needed no fudge factor in the end. The calibration converged to 1.000 once the friction exponent and transient window were physically correct.

The report is served live at GET /api/circuits/validation, shown on the landing page, and regenerable with python -m scripts.calibrate.


7. Known fidelity gaps

Recorded rather than tuned away.

Monza's full-throttle share. Should be the highest in the library (~78% in reality); the model puts it at ~68%, behind Spa at ~72%. The authored chicane radii are tighter than the real ones relative to their entry speeds, so the model spends longer accelerating out of them.

Rather than loosening a test until it passed, the test asserts what the geometry genuinely supports — that Monza spends the least lap distance cornering — and the gap is documented here and in the test's own docstring.

Aero-unlimited corners at modest radii. Above roughly 130 m radius the model reports the straight-line speed ceiling, because downforce outgrows the corner's demand. This is correct physics for the car as parameterised, but the threshold is optimistic; in practice the solver rarely reaches those speeds because drag and the preceding corner bind first, which is why lap times still validate.


8. Integrating real data

The seam is DataProvider in backend/app/data/provider.py.

  1. Implement the interface. Return plain dictionaries.
  2. Map the source's circuit and driver identifiers onto the platform's.
  3. Resample telemetry onto the platform's uniform distance grid.
  4. Set provenance = "PUBLIC" on everything served.
  5. Register it in get_provider().

Nothing else changes — not the simulation engines, not the API routes, not a line of frontend code.

PublicDataProvider exists as a placeholder and raises DataNotAvailable on every method. That is deliberate:

A silent fallback to synthetic data is precisely how fabricated data ends up presented as real.


9. The AI Race Engineer

Constrained by the same rule as everything else: it must never invent a number.

Every quantity is computed by the models first and assembled into a structured EngineerContext. That context is the security boundary of the feature — if a number is not in it, no answer can contain it.

Deterministic mode (default, no API key) composes answers from the computed context via intent-specific templates.

Assisted mode (with RI_ANTHROPIC_API_KEY) passes the same context to a language model with instructions to use only the supplied figures. The model is never asked what the degradation rate is, because it does not know and would guess. If the call fails for any reason it falls back to the deterministic answer rather than erroring.

Both modes return citations listing the model outputs the answer rests on, and the UI exposes the complete computed context for inspection. A test asserts that a cited figure actually appears in both the answer text and the context.