> ## Documentation Index
> Fetch the complete documentation index at: https://offthepace.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Lap waterfall: visualize the seven-term decomposition

> A waterfall chart showing how fuel, compound, rubber, ambient, constructor, dirty air, and driver skill each contribute to a driver's pace delta, with track noise shown as a diagnostic.

The Lap Waterfall chart makes the [seven-term additive identity](/decomposition/seven-term-identity) tangible. For any driver in any race, it shows you exactly how much of their pace delta their deviation from the field-pace baseline came from each of the seven identity terms. Alongside them it surfaces an eighth, non-closing bar **track noise** (`track_unexplained_s`) as a transparency diagnostic. When a driver looks slow, you can see whether the slowness belongs to the car, the tyre strategy, the conditions, or the driver. When a driver looks fast, you can tell whether they are genuinely overdelivering or simply running the lightest fuel and freshest rubber.

## What the chart shows

Each driver gets a waterfall (stacked bar) chart where every segment is one additive component from `fct_lap_residuals`, averaged across all clean laps in the selected race. The segments stack horizontally:

| Component                      | Column                    | Typical sign                                                                            |
| ------------------------------ | ------------------------- | --------------------------------------------------------------------------------------- |
| **Fuel**                       | `fuel_component_s`        | Positive early in race (heavy fuel slows the car)                                       |
| **Compound**                   | `compound_component_s`    | Negative on faster compounds vs season median                                           |
| **Rubber**                     | `rubber_component_s`      | Varies by stint position and track state                                                |
| **Ambient**                    | `ambient_component_s`     | Positive in high-temperature conditions                                                 |
| **Constructor**                | `constructor_component_s` | Negative for front-running cars                                                         |
| **Dirty Air**                  | `dirty_air_tax_s`         | Positive (running in wake always costs time)                                            |
| **Driver Skill**               | `driver_skill_residual_s` | Negative if driver outperforms predicted pace                                           |
| **Track Noise** *(diagnostic)* | `track_unexplained_s`     | Field-level residual not attributable to any modelled term **not part of the identity** |

The six environmental terms sum to `total_explained_s`; add the driver-skill residual and you reconstruct `pace_delta_s` exactly. That is the seven-term identity, enforced in the warehouse by `assert_additive_identity` (see [the Seven-Term Identity](/decomposition/seven-term-identity)). **Track noise** (`track_unexplained_s`) is a separate field-level diagnostic the part of the smoothed field-pace curve the rubber and ambient fits cannot explain. It is shown for transparency but is **not** one of the closing terms; it is excluded from the CI-enforced identity.

## How to read the bars

* **Bars extending right (positive)** are slowing contributions. A large positive fuel bar early in the race is expected the car is heavy. A large positive constructor bar is not a good sign for the team.
* **Bars extending left (negative)** are speeding contributions. A strongly negative driver skill bar means the driver is extracting more pace than their exact set of conditions predicts. A negative compound bar means they are on a faster compound than the season median.
* **The total** of the seven identity bars is `pace_delta_s`, the driver's average deviation from field baseline across the race. The track-noise bar is appended as a diagnostic and is not part of that total.

## How to navigate

1. **Select a season** in the filter bar. The chart defaults to a season average across all races, showing one bar stack per driver.
2. **Select a race** to narrow the view to a single event. Each driver's bar stack now reflects that race's average clean-lap conditions.
3. **Click a driver name** in the selector above the chart to highlight their waterfall and focus the view on their decomposition.
4. If no race is selected, the status label reads *"season average select a race in the filter bar to narrow to one event"* as a reminder.

<Tip>
  To separate car and strategy effects from driver execution, find a lap where two drivers ran nearly identical stints same compound age, similar fuel load, similar track position and compare their waterfalls side by side. If their constructor bars are similar but one driver's skill bar is significantly more negative, the pace difference is attributable to the driver, not the equipment.
</Tip>

## Key use case: decomposing a confusing lap

Pick a driver who looked unusually slow (or fast) in a race. Open the Lap Waterfall for that race and driver. Work through the bars:

1. Is the **constructor component** large and positive? The car was off that weekend.
2. Is the **compound component** large and positive? They were on older or harder tyres than most of the field.
3. Is the **dirty air tax** high? They spent significant time in traffic.
4. Only after accounting for all of the above: what does the **driver skill residual** show? If it is still positive after all the above, there may be a genuine execution story.

The waterfall makes this decomposition explicit and arithmetic, not interpretive.

<Note>
  Neutralised laps (safety car, VSC, red flag) never reach this chart: `fct_lap_residuals` is built from green racing laps only, so the exclusion happens upstream in the warehouse. The filter applied in the query itself is `NOT is_major_outlier_lap AND fuel_component_s IS NOT NULL`. Laps removed by that filter are not shown in the `n_laps` provenance count.

  The mart does carry `is_safety_car_lap`, `is_vsc_lap` and `is_red_flag_lap` columns, and they are `FALSE` on all 137,447 of its rows for the reason above. The table with live caution flags is `int_stint_geometry`, surfaced in the app as the [Race Control Timeline](/app/race-control).
</Note>

## Data source

The chart queries `fct_lap_residuals` (partitioned by season) via DuckDB-Wasm in the browser. The additive identity is enforced in the warehouse by `assert_additive_identity`, which runs against every lap on every pipeline build. The full table reference is at [fct\_lap\_residuals](/reference/models/fct/fct_lap_residuals). The data window covers **2018–2024**.
