Lap delta
Algorithm delta-1.0.0 (pairs) and segments-1.0.0+segment-results-1.0.0 (per segment) · source
engine/src/dtta/engine/delta/align.py, engine/src/dtta/engine/segments/results.py.
Definition
For a comparison lap A and a reference lap R, both placed on the grid :
where is each lap's PCHIP progress interpolant (see Track progress), anchored at and at with the lap time. Positive means the comparison lap is slower (it needed more time to reach that point). The value at the end of the lap is the final delta:
The endpoint invariant
Because both interpolants are anchored at their gate crossings, the delta at must equal the
difference of the lap times. The engine checks
delta_invariant_tol_s (0.001 s) and a continuity bound
. A pair that fails
either check is not written as a result: the worker raises and the pair is missing rather than
wrong. Every served delta therefore carries invariant_ok = true, and the value is shown in the
Provenance tab.
Display smoothing
Projection jitter of ~0.2–0.5 m becomes ≈ 15 ms of local texture in . For display only, the
trace is smoothed with a Savitzky–Golay filter (window delta_display_smooth_m = 10 m → 11 grid points,
polynomial order sg_polyorder = 2) and re-anchored so that it starts at and ends exactly
at . The unsmoothed series is kept, plotted in Engineer view, and is the series used for every
number (segment deltas, invariant). The time-loss rate (shown as s per 100 m) is the
derivative of the display series.
Where the time goes: segment deltas
Segments (corners and straights) are defined on the centerline curvature:
- is smoothed over
segment_curvature_smooth_m(10 m). - Corner where
segment_corner_fraction(0.35) × max . - Cleanup in order: corner runs shorter than
segment_blob_m(30 m) become straight; straight gaps shorter thansegment_min_length_m(45 m) become corner; corners still shorter than 45 m become straight. - Each corner is split into entry / centre / exit, the centre being ±
segment_center_fraction(15 %) of the arc around the curvature peak. On an oval the arcs are named Turn 1–2, Backstretch, Turn 3–4, Frontstretch in the direction of travel from the gate. If fewer than two corners are found the lap is divided into quarters and a note is shown. - Boundaries are stored as fractions of ; user edits are kept separately and re-applied when the centerline is rebuilt.
The delta attributed to a segment is
on the unsmoothed , unwrapped through the gate: a segment that crosses start/finish adds
for the wrap. Segment deltas therefore sum exactly to the final delta. A segment delta of
0.05 s or more is treated as notable (plan §19.2 segment_time_loss trigger).
Per-segment metrics for each lap (entry, minimum and exit speed, brake and acceleration points, sustained Cornering G and Chassis Load, mean line offset) are defined on the Speed, Cornering G and Chassis Load pages.
Low-confidence ranges
A grid point is low-confidence when either lap's projection confidence is below
delta_low_confidence (0.5) or lies inside a GPS gap longer than 0.5 s. Such ranges are shaded on every
lane and marked in the readout; segment summaries report the fraction of low-confidence points.
Reference lap
By default the reference is the fastest racing lap of the session and the comparison is the slowest racing lap. Any racing lap can be chosen for either role. Caution, pit, partial and invalid laps are never used in a delta.
Verified
- Real fixtures: invariant holds for every racing-lap pair (error ≤ 1e-3 s, typically < 1e-6 s);
delta noise on straights < 20 ms per 100 m; Hamilton County lap 4 vs lap 6 = +0.787 s with the largest
loss in Turn 1–2 (+0.483 s), reproduced by the regression goldens (
tests/regression/golden_phase10_segments.json). - Synthetic: two laps with a prescribed time-difference profile recover within 5 ms everywhere; different lines around the same oval give the analytic time difference at every .
- Property test: for random pairs of real laps the invariant and the continuity bound hold.