> ## 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.

# int_stint_geometry

> Foundation for all downstream window functions.

<Note>Part of the [Physics](/transform/families/physics) family.</Note>

Foundation for all downstream window functions. One row per race lap (the FULL chronological sequence, including SC/VSC/pit/invalid laps) so physics-layer LAG/EWMA windows decay correctly across those gaps instead of treating the lap before/after a gap as adjacent. Builds stint identifiers (stint\_id), lap positions within stints (lap\_in\_stint = chronological ordinal, valid\_lap\_in\_stint = ordinal among valid laps only, age\_in\_stint = tyre\_life), and compound tracking. Consumers that fit pace/regression models filter to is\_valid\_lap (or key off valid\_lap\_in\_stint) at their own input boundary. All Layer 03 window functions partition on stint\_id.

## Lineage

```mermaid theme={null}
flowchart LR
  stg_laps --> int_stint_geometry
  stg_tyre_allocations --> int_stint_geometry
  int_stint_geometry --> fct_stint_features
  int_stint_geometry --> int_compound_cliff_predicted
  int_stint_geometry --> int_constructor_structural_pace
  int_stint_geometry --> int_corner_skill_residuals
  int_stint_geometry --> int_dirty_air_tax_component
  int_stint_geometry --> int_field_pace_curve
  int_stint_geometry --> int_lap_air_state
  int_stint_geometry --> int_lap_fuel_state
  int_stint_geometry --> int_lap_proximity
  int_stint_geometry --> int_lap_residual_decomposed
  int_stint_geometry --> int_lap_thermal_proxy
  int_stint_geometry --> int_pit_strategy_cost_curve
  int_stint_geometry --> int_pit_strategy_value
  int_stint_geometry --> int_stint_end_regime
  int_stint_geometry --> int_synthetic_teammate
  style int_stint_geometry fill:#e40404,stroke:#e40404,color:#fff
```

## Overview

| Property          | Value                                                                                |
| ----------------- | ------------------------------------------------------------------------------------ |
| Layer             | `intermediate`                                                                       |
| Family            | [Physics](/transform/families/physics)                                               |
| Contract enforced | No                                                                                   |
| Upstream          | [`stg_laps`](../stg/stg_laps), [`stg_tyre_allocations`](../stg/stg_tyre_allocations) |

**16 tests** [guard](/transform/ci/overview) this model  -  11 generic, 5 singular.

## Columns

| Column                | Type | Nullable | Tests                                                                        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| --------------------- | ---- | -------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `stint_id`            |      | Yes      | [`not_null`](/transform/ci/structural)                                       | Surrogate key combining race\_year, race\_id, driver\_id, stint\_number                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `lap_id`              |      | Yes      | [`not_null`](/transform/ci/structural), [`unique`](/transform/ci/structural) | Foreign key to stg\_laps                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `lap_in_stint`        |      | Yes      | [`not_null`](/transform/ci/structural)                                       | Chronological ordinal within the stint (1, 2, 3, ...), counting every lap including SC/VSC/pit/invalid ones.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `valid_lap_in_stint`  |      | Yes      |                                                                              | Ordinal among valid laps only within the stint (NULL on invalid laps). Use for pace-fitting position/length logic instead of lap\_in\_stint.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `stint_length_actual` |      | Yes      | [`not_null`](/transform/ci/structural)                                       | Total lap count in the stint (valid + invalid).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `stint_length_valid`  |      | Yes      |                                                                              | Count of valid laps in the stint.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `is_valid_lap`        |      | Yes      | [`not_null`](/transform/ci/structural)                                       | Carried through from stg\_laps. Timed, on-track, not deleted, accurate, not lap 1, no SC/VSC.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `is_pit_lap`          |      | Yes      | [`not_null`](/transform/ci/structural)                                       | Carried through from stg\_laps. TRUE for the out-lap/in-lap of a pit stop.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `is_safety_car_lap`   |      | Yes      | [`not_null`](/transform/ci/structural)                                       | Carried through from stg\_laps. TRUE when the TrackStatus string contains a 4 (full SC).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `is_vsc_lap`          |      | Yes      | [`not_null`](/transform/ci/structural)                                       | Carried through from stg\_laps. TRUE when the TrackStatus string contains a 6 or 7 (VSC).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `is_red_flag_lap`     |      | Yes      | [`not_null`](/transform/ci/structural)                                       | Carried through from stg\_laps. TRUE when the TrackStatus string contains a 5 (red flag).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `age_in_stint`        |      | Yes      | [`expect_column_values_to_be_between`](/transform/ci/range-and-domain)       | Tyre age in laps at this lap. Directly from FastF1 TyreLife (no imputation, no reconstruction). 343 rows (0.21%) carry NULL: 325 of them (94.8%) sit on lap 1 of a stint, where tyre-life occasionally arrives without a reading. This is a pattern, not random scatter, and occurs at the exact position where starting\_tyre\_age\_laps is derived. For stints opening on lap 1: if age\_in\_stint is NULL at the stint start and you need a starting age, the column is missing; do not assume the tyre is fresh (a used/scrubbed set starting a stint will have age\_in\_stint > 1 or NULL, but never 0). Consumers should carry this column forward or declare how NULLs are handled.                                                                                                                                           |
| `compound_code`       |      | Yes      |                                                                              | Tyre compound code (C1–C5) assigned by Pirelli for this race, joined from stg\_tyre\_allocations on (race\_year, circuit\_key, compound\_label). Absolute identifier, unlike compound\_in\_stint which is relative. Enables cross-circuit compound comparison and physical-parameters lookup in dim\_compounds\_season. PROVISOS: (1) Data starts at 2019-01-20 (first Pirelli 2019 season race). 2018 rows carry NULL by construction — Pirelli's relative naming began in 2019, and 08d's sourcing covers 2019-2024 only. (2) Sourced from user verification (2026-09-17) of a 128-row Pirelli allocation table covering 127 mart races 2019–2024 (100% join coverage). Sourcing caveat: only 47 of 128 source URLs resolve; see \_improvements/work/08-foundations-repair.md (08d) for the full provenance and epistemics ruling. |
| `compound_label`      |      | Yes      |                                                                              | Tyre compound label (hard, medium, soft) assigned by Pirelli for this race. Relative to the circuit - Pirelli picks 3 compounds per weekend and calls them hard/medium/soft, so "soft" at one circuit is not the same rubber as "soft" at another. The compound\_code is the absolute identifier; this label is the relative one.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `race_year`           |      | Yes      |                                                                              | Season year.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `race_id`             |      | Yes      |                                                                              | Race identifier.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `driver_id`           |      | Yes      |                                                                              | FastF1 three-letter driver code (e.g. VER, HAM).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
