Sim Racing Telemetry Analysis Platform — Project Plan

# Sim Racing Telemetry Analysis Platform — Project Plan

*(Sections 1–7 unchanged from previous update)*

---

## 8. Repositories & Deployment

### Repo: `rusty-telemetry` (Main Rust Backend)

| Field | Value |
|---|---|
| **Language** | Rust |
| **IDE** | RustRover |
| **Local path** | `~/RustroverProjects/rusty-telemetry` |
| **Remote** | `ssh://jan@192.168.1.2/home/jan/Development/Repositories/rusty-telemetry.git` |
| **Codeberg** | `ssh://git@codeberg.org/jhunnius/rusty-telemetry` |
| **Status** | **v0.6.0 — Run Deletion, Session Reopen, Feed Merging** |
| **API Reference** | [rusty-telemetry — REST API Reference](joplin://0c837f4e6b7e462a997cbc19e47c864a) |

### Repo: `racecraft` (Vue.js Web Client)

| Field | Value |
|---|---|
| **Language** | TypeScript, Vue 3 |
| **IDE** | WebStorm |
| **Local path** | `~/WebstormProjects/racecraft` |
| **Remote** | `ssh://jan@192.168.1.2/home/jan/Development/Repositories/racecraft.git` |
| **Codeberg** | `ssh://git@codeberg.org/jhunnius/racecraft` |
| **Status** | **v0.1.3 — Run Management, Feed Merging, Shifting Charts** |
| **Client Notes** | [racecraft — Vue.js Web Client Notes](joplin://50a09627d5d347009197b94bcee90411) |

### Related Notes

| Note | ID |
|------|----|
| [Architecture & Infrastructure](joplin://c1c3a7b2055642268ab230b95551f470) | Client vs. Server, Desktop Packaging, Pre-Calculated Data |
| [AC — UDP Protocol Spec](joplin://aed9f3be040943048273a16e05a8100f) | Assetto Corsa telemetry binary protocol |
| [ACC — UDP Protocol Spec](joplin://6ae7005d9810437093d63470cff98b59) | ACC telemetry protocol (registration + broadcast) |
| [AC EVO — Telemetry Research](joplin://2171d34ab9c1431ea3a979d30d206e23) | AC EVO status — no known telemetry output yet |
| [AC Rally — Telemetry Research](joplin://b7b331aa87544b6ebe5db5b8d7bcd2a0) | AC Rally status — UE5, no known telemetry output yet |
| [PCARS — UDP Protocol Spec](joplin://c6bd2c45938246fa9d61776deae9874b) | Project CARS 1 & 2 telemetry binary protocol |
| [DiRT Rally — UDP Protocol Spec](joplin://877a753ad06a40e08059834d8c8fb438) | DiRT Rally 1 & 2.0 telemetry (Codemasters format) |

---

## 9. Implementation Phases

### Phase 1: Core Infrastructure

- **1.0 Rewrite KSUDP to proper 3-phase handshake protocol** — IMPLEMENTED IN v0.3.0
  - [x] Multi-port UDP binding (9996, 10101, 5606)
  - [x] Per-feed status reporting with health indicators
  - [x] Data dump to per-feed files
  - [x] 3-phase handshake for KSUDP
  - [x] Remove port 5005 (Lua plugin) — abandoned
  - [x] Make port 10101 (Telemetry Tool) optional
  - [x] Configurable via env vars: `GAME_HOST`, `LISTEN`, `BIND` (v0.4.1)
  - [x] Remote operation support — game and listener can run on different machines (v0.4.1)
  - [ ] Verify KSUDP streaming works with live AC session
  - [ ] Verify PCARS works with live game session

- **1.1 Binary parsers — IMPLEMENTED IN v0.3.0 + v0.4.0**
  - [x] `parser-ksudp` for port 9996 (RTCarInfo struct, 6 unit tests)
  - [x] `parser-telemetry-tool` for port 10101 (357-byte driver struct, 7 unit tests)
  - [x] `binary_utils` shared module for safe packet reading
  - [x] `parser-pcars` for port 5606 (auto-detect V1/V2, 5 unit tests)
  - [x] Map all parsers to generic `TelemetryFrame` model
  - [x] `parse_first_driver()` optimization for Telemetry Tool

- **1.2 REMOVED** (was Lua plugin — abandoned, see Section 4)

- **1.3 Telemetry Tool — WORKING, OPTIONAL**
  - [x] Verified — 6.3 MB of valid binary data captured on port 10101
  - [x] Binary parser implemented with validation checks
  - [x] `parse_first_driver()` avoids unnecessary Vec allocation
  - [x] Made optional in rusty-telemetry (shows as "not available" if bind fails)

- **1.4 PCARS Support — IMPLEMENTED IN v0.4.0**
  - [x] Auto-detect PCARS 1 (1367-byte packets) vs PCARS 2 (559-byte packets)
  - [x] Parse V1 telemetry (speed, RPM, gear, inputs, tyres, engine, weather)
  - [x] Parse V2 car physics (speed, RPM, gear, inputs, tyres, 3D position)
  - [x] PCARS-specific fields in TelemetryFrame (oil/water temp, damage, weather)
  - [x] Port 5606 as optional bind-listen feed (like Telemetry Tool)
  - [x] 5 unit tests for parser

- **1.5 Code Quality — IMPLEMENTED IN v0.3.0 + v0.4.0**
  - [x] Mutex not held during TUI rendering (clone FeedState before draw)
  - [x] Parsing moved outside mutex lock (minimizes contention)
  - [x] `expect()` replaced with graceful error handling on env vars
  - [x] Shared `binary_utils` module eliminates parser duplication
  - [x] Dead code removed (unused variants, methods)
  - [x] `data_rate_kbps` renamed to `data_rate_kb_s` (correct unit)
  - [x] 32 unit tests total (14 feed_state + 6 ksudp + 7 telemetry_tool + 5 pcars)

- **1.6 REST API + Recording Manager — IMPLEMENTED IN v0.5.0**
  - [x] `recording.rs` — RecordingManager with UUID-based session directories
  - [x] `manifest.json` per recording with metadata (game, track, car, use_case, status, timestamps, feed stats)
  - [x] Auto-start recording on launch
  - [x] CRUD operations: create, list, get, stop, delete recordings
  - [x] `api.rs` — REST API server using axum on configurable port (default 8080)
  - [x] Live telemetry endpoint (`GET /api/live`) with feed snapshots
  - [x] Recording management endpoints (list, create, stop, get, delete)
  - [x] Raw feed binary download (`GET /api/recordings/{id}/data/{feed_name}`)
  - [x] CORS enabled (permissive) for frontend integration
  - [x] New dependencies: axum 0.8, axum-extra 0.10, serde 1, serde_json 1, uuid 1, tower-http 0.6
  - [x] Updated README.md with REST API docs, recording docs, updated architecture
  - [ ] Add API integration tests
  - [ ] Add recording manager unit tests

- **1.7 Workspace refactor** (deferred)
  - [ ] Split into Cargo workspace with `core`, `receiver`, parsers
  - [ ] SQLite database with migrations
  - [ ] Basic REST API endpoints

- **1.8 Session Management + Analysis — IMPLEMENTED IN v0.5.0**
  - [x] `session.rs` — SessionManager with use-case sessions, runs, frame extraction from ring buffers
  - [x] `analysis.rs` — Shift point analysis (gear RPM ranges, upshift detection, recommended shift RPM)
  - [x] `analysis.rs` — Track map analysis (spline-aligned interpolation for center line)
  - [x] `session.rs` — `data_truncated` flag for ring buffer wrap detection
  - [x] `api.rs` — 9 new session endpoints (CRUD, run management, analysis triggers)
  - [x] `recording.rs` — Ring buffer mutex held only during frame clone, not JSON serialization
  - [x] `recording.rs` — Flush failure propagation (errors prevent Stopped status)
  - [x] `recording.rs` — `stop_recording` holds active lock across flush (prevents race)
  - [x] Mutex poisoning recovery on session API handlers
  - [x] `gear_display` deduplicated into shared free function
  - [ ] Add session/analysis unit tests
  - [ ] Add ring buffer unit tests

- **1.9 Run Management Enhancements — IMPLEMENTED IN v0.6.0 (both repos)**
  - [x] **Feed merging for runs** — Allow merging two feeds into a single run for more accurate data
    - `POST /api/sessions/{id}/runs` — extended with optional `merge_feeds: string[]`
    - `session.rs` — `start_run` accepts merge feeds, `extract_run_frames` combines frames from multiple feeds
    - racecraft: merge feeds toggle with feed checkboxes when starting a run
  - [x] **Run deletion** — Delete individual runs, with session reopen option
    - `DELETE /api/sessions/{id}/runs/{run_id}` — delete a run from a session (returns 204)
    - `POST /api/sessions/{id}/reopen` — re-open completed session (status → active)
    - racecraft: delete button per run with confirmation; reopen button on completed sessions

- **1.10 Shifting Analysis Charts — IMPLEMENTED IN v0.1.2 (racecraft)**
  - [x] RPM vs. Force scatter chart (x: RPM, y: acceleration_g)
  - [x] Speed vs. Force scatter chart (x: speed_kmh, y: acceleration_g) — renamed from "Gear Acceleration Curves"
  - [x] Speed vs. RPM scatter chart (x: speed_kmh, y: rpm) — gear ratio visualization

---

## 10–12. [Unchanged — Rally, References, Metrics]

*(See note history for sections on Rally games, additional references, metrics definitions, and game priority rankings)*

---

## 13. Operations & Debugging Reference

> **Full API documentation moved to:** [rusty-telemetry — REST API Reference](joplin://0c837f4e6b7e462a997cbc19e47c864a)
> That note contains all endpoints, request/response formats, environment variables, and UDP port configuration.

### Environment Variables (quick reference)

| Variable | Purpose | Default |
|----------|---------|---------|
| `RUSTY_TELEMETRY_GAME_HOST` | IP of the sim machine | `127.0.0.1` |
| `RUSTY_TELEMETRY_LISTEN` | Local bind for incoming feeds | `0.0.0.0` |
| `RUSTY_TELEMETRY_API_PORT` | REST API port | `8080` |
| `RUSTY_TELEMETRY_API_HOST` | REST API bind address | `127.0.0.1` |

---

## 14. Session Diagnostics

### Session 2026-06-03 ~09:45 — Initial Capture
*(See note history for details)*

### Session 2026-06-03 19:32 — Investigation Results
*(See note history for details)*

### Startup Order for Next Session

**Same machine:**
1. Start game → let it initialize
2. Start rusty-telemetry → auto-handshake, auto-start recording

**Remote:**
1. Start game on game machine
2. Configure game to send to analysis machine's IP
3. Start rusty-telemetry with `RUSTY_TELEMETRY_GAME_HOST=<game-IP>`

---

## 15. Change Log

> **Per-repo change logs moved to:**
> - [rusty-telemetry — REST API Reference](joplin://0c837f4e6b7e462a997cbc19e47c864a) (backend version history)
> - [racecraft — Vue.js Web Client Notes](joplin://50a09627d5d347009197b94bcee90411) (frontend version history)

### Recent Changes (summary)

| Version | Date | Highlights |
|---------|------|------------|
| rusty-telemetry v0.6.0 | 2026-06-06 | Run deletion, session reopen, feed merging |
| racecraft v0.1.3 | 2026-06-06 | Run management UI, feed merging toggle, session reopen button |
| racecraft v0.1.2 | 2026-06-06 | RPM vs. Force, Speed vs. RPM charts, chart renames |
| racecraft v0.1.1 | 2026-06-05 | Dashboard status card layout (3-column grid) |
| rusty-telemetry v0.5.0 | 2026-06-05 | REST API, recording manager, session analysis |
| rusty-telemetry v0.4.1 | 2026-06-04 | Remote operation support (GAME_HOST/LISTEN split) |
| rusty-telemetry v0.4.0 | 2026-06-04 | PCARS 1 & 2 support, binary_utils refactor |
| rusty-telemetry v0.3.0 | 2026-06-04 | TUI, KSUDP handshake fix, binary parsers |

---

## 16. Product Roadmap — From Tool to Product

> **Analysis date: 2026-06-06**
> **Context: What it would take to turn rusty-telemetry + racecraft into a sellable product or service, for sim racing and potentially real racing.**

---

### 16.1 Current State Assessment

**What we have (v0.6.0):**
- A robust Rust backend that captures 60 Hz telemetry from Assetto Corsa (via Telemetry Tool on port 10101), with parsers for KSUDP and PCARS 1/2
- A unified `TelemetryFrame` data model across all game protocols
- A REST API with recording management, session management, run management (delete, merge feeds, reopen), and basic analysis (shift points, track maps)
- A Vue 3 web frontend (racecraft) with dashboard, live feeds, session management, run management, and shifting analysis charts
- Ring buffer architecture with JSONL persistence
- Remote operation support (game and analysis machine can be separate)
- Multi-game protocol support (AC, PCARS 1/2), though only AC verified with live sessions

**What we DON'T have yet:**
- No user authentication or multi-user support
- No cloud deployment — runs locally only
- No real-time WebSocket streaming to the frontend (polling `/api/live` only)
- No AI-driven coaching or automated insights
- No reference lap comparison (the "Track Titan killer" feature)
- No community features (leaderboards, lap sharing, setup sharing)
- No rally game support despite rally being mentioned in the training roadmap
- No mobile companion app
- No real-world telemetry integration (CAN bus, OBD-II, GPS data)

---

### 16.2 Competitive Landscape Analysis

#### Tier 1: Direct Sim Racing Telemetry Competitors

| Product | Games | Pricing | Key Features | Users | Backing |
|---|---|---|---|---|---|
| **Track Titan** | AC, ACC, F1, iRacing, AMS2, LMU, Forza | Freemium (free + paid tiers) | AI Coaching Flows, auto-setup download, F1 real lap analysis, community news | 285K+ members, 100M+ laps | Porsche Ventures, Axel Springer, Antler, former F1/WRC execs |
| **SimRacingSetup** | F1 25/26 only (more planned) | Free + £4.99/mo telemetry + £99.99/yr Pro | Pro lap comparison, ERS/tyre maps, career tracking, leaderboards, web-based | 15K+ customers | Bootstrapped |
| **VRS (Virtual Racing School)** | iRacing | Subscription | Telemetry analysis, coaching, data packs, setup optimization | ~50K iRacing-focused | Bootstrapped, iRacing-ecosystem |

#### Tier 2: General Data Analysis Tools Used in Sim Racing

| Product | Type | Pricing | Notes |
|---|---|---|---|
| **MoTeC i2** | Professional data analysis software | License-based (expensive) | Industry standard for real motorsport. Sim racers use it via exported data. |
| **ATLAS (McLaren Applied)** | F1-grade telemetry system | Enterprise / F1-only | Multi-million dollar per season. |
| **Cosworth Toolbox** | Real racing data analysis | License-based | WEC, IndyCar, Touring Cars |

#### Tier 3: Community & Content Platforms

| Product | Role | Rally Coverage | Notes |
|---|---|---|---|
| **OverTake.gg** (formerly RaceDepartment) | Sim racing community hub | Has WRC, AC Rally categories; partnered with Track Titan | The Track Titan × OverTake collaboration is the distribution model to study |

---

### 16.3 The Track Titan × OverTake Model

Track Titan's collaboration with OverTake.gg (2M+ registered users) is the case study for how to build a product in this space:

1. **Track Titan** builds the telemetry + coaching technology (SaaS product)
2. **OverTake.gg** provides the community, content, and distribution channel
3. OverTake integrates Track Titan as a "Community Benefit"
4. Both parties monetize: Track Titan through subscriptions, OverTake through premium memberships

**Key lesson:** Distribution and community matter as much as technology. The sim racing market is fragmented across many games — a platform approach works better than a single-game tool. Freemium model lowers barrier to entry.

---

### 16.4 Rally Telemetry — The Underserved Market

**No competitor serves rally telemetry.** This is a genuine differentiator.

| Aspect | Circuit Racing | Rally |
|---|---|---|
| Track | Static, memorizable | Dynamic, pacenote-dependent |
| Surface | Uniform | Mixed (gravel, tarmac, snow, ice, mud) |
| Analysis unit | Lap time | Stage time |
| Key metric | Consistency across laps | Commitment to pacenotes, surface adaptation |
| Coaching focus | Braking points, racing line | Pacenote accuracy, weight transfer on loose surfaces |

**AC Rally** (UE5, Early Access) is the key long-term opportunity. If KUNOS ports their telemetry infrastructure, we get rally-specific data with circuit-quality depth.

**DiRT Rally 2.0** is the fastest path to rally coaching NOW. It uses the proven Codemasters UDP protocol (port 20777), includes **per-wheel surface type** (the single most important rally coaching field), and is a released, working game. See [DiRT Rally 1 & 2.0 — UDP Telemetry Protocol Specification](joplin://877a753ad06a40e08059834d8c8fb438).

| Rally Game | Protocol Status | Surface Data | Availability | Our Priority |
|---|---|---|---|---|
| **DiRT Rally 2.0** | ✅ Proven (Codemasters UDP) | ✅ Per-wheel | Available now | HIGH — fastest path |
| **DiRT Rally 1** | ✅ Proven (Codemasters UDP) | ❌ | Available now | MEDIUM |
| **AC Rally** | ❌ Unknown (EA) | Unknown | Early Access | HIGH — long-term |
| **EA Sports WRC** | ✅ Codemasters format | Likely | Available | LOW — not planned |

See [AC Rally — Telemetry Status & Research](joplin://b7b331aa87544b6ebe5db5b8d7bcd2a0) for full investigation plan.

---

### 16.5 Real-World Racing Telemetry

Real racing teams already have expensive, purpose-built systems (MoTeC, ATLAS). The market gap is democratizing professional-grade analysis for:
1. **Sim racers** wanting to improve (Track Titan's 285K users prove this market)
2. **Club/amateur real racers** who can't afford MoTeC-level systems
3. **Rally drivers at national level** who have NO accessible telemetry platform
4. **Sim-to-real pipeline** — consistent analysis across both

---

### 16.6 Product Roadmap — From v0.6.0 to Sellable Product

#### Phase A: Complete the Core (Months 1–3)

| Milestone | Tasks | Success Metric |
|---|---|---|
| **A1: Verify with live sessions** | Test KSUDP + PCARS with real game sessions | All 3 feeds working reliably |
| **A2: ~~§1.9~~ ✅ DONE** | Feed merging, run deletion, session reopen | Shipped in v0.6.0 / v0.1.3 |
| **A3: WebSocket streaming** | Replace REST polling with real-time WS | <50ms latency game → browser |
| **A4: Lap detection** | Auto-detect laps from spline position crossing | Automatic lap segmentation |
| **A5: Reference lap overlay** | Load reference lap, overlay current against it | Visual overlay with delta trace |
| **A6: Tyre analysis** | Tyre temperature heat maps, wear projection | Degradation curve graphs |
| **A7: Brake analysis** | Brake pressure traces, consistency scoring | Per-corner braking analysis |

#### Phase B: Multi-Game & Rally Support (Months 4–6)

| Milestone | Tasks | Success Metric |
|---|---|---|
| **B1: ACC support** | ACC UDP parser (registration + broadcast) | ACC sessions captured and analyzed |
| **B2: iRacing support** | YAML file or memory-mapped file telemetry | iRacing sessions captured |
| **B3: DiRT Rally support** | DiRT Rally 1 & 2.0 parser (port 20777, Codemasters format) | Rally stages captured with surface data |
| **B4: Rally-specific analysis** | Stage-based analysis, surface detection, pacenote timing | Unique rally coaching insights |
| **B5: F1 game support** | F1 2025/26 UDP telemetry (same Codemasters family as DiRT Rally) | F1 sessions — largest casual audience |

#### Phase C: AI Coaching & Automation (Months 7–10)

| Milestone | Tasks |
|---|---|
| **C1: Anomaly detection** | ML model to detect unusual inputs |
| **C2: Coaching Flows** | Step-by-step guided analysis ("Here's your biggest time loss") |
| **C3: Setup recommendations** | Correlate telemetry with setup changes |
| **C4: LLM coaching chat** | Natural language questions about telemetry |
| **C5: Rally pacenote analysis** | Correlate pacenotes with driver inputs |

#### Phase D: Platform & Monetization (Months 11–18)

| Milestone | Tasks |
|---|---|
| **D1: User accounts & cloud sync** | Auth, cloud storage, cross-device access |
| **D2: Community features** | Leaderboards, lap sharing, setup sharing |
| **D3: Freemium model** | Free basic + Pro tier |
| **D4: Partnership** | OverTake-style distribution partnership |
| **D5: Mobile companion** | Post-session review, coaching alerts |
| **D6: Real-world telemetry** | OBD-II / CAN bus bridge for sim-to-real |

---

### 16.7 Revenue Model Options

| Model | Pricing | Feasibility |
|---|---|---|
| **SaaS Subscription** (Track Titan model) | Free basic + £5–10/mo Pro + £15/mo Teams | High — proven model |
| **One-time License** (MoTeC model) | $99–299 perpetual | Medium |
| **Self-hosted** | £50–100/mo Docker image | Medium — esports teams, academies |

**Recommended:** Start with SaaS Freemium, evolve toward real racing telemetry as premium tier.

---

### 16.8 Unique Differentiators

1. **Circuit + Rally in one platform** — Nobody does this
2. **Open-source core** — Builds trust and community
3. **Rust performance** — 60 Hz with <50ms latency. Most competitors use Python/Electron
4. **Self-hostable** — Privacy-conscious users, esports teams
5. **Sim-to-real bridge** — Same tools for sim AND real track days
6. **Local LLM coaching** — Privacy-preserving AI that runs locally

---

### 16.9 Key Risks & Mitigation

| Risk | Probability | Impact | Mitigation |
|---|---|---|---|
| Track Titan expands to rally | Medium | High | Move fast on DiRT Rally support — proven protocol, ship before they do |
| Game devs restrict telemetry | Low | Critical | Support many games |
| AI coaching needs massive data | High | Medium | Start with rule-based coaching |
| Real racing needs hardware | High | High | Defer, validate with sim first |
| User acquisition cost too high | Medium | High | Partner with community platforms |

---

### 16.10 Recommended First Steps (Next 30 Days)

1. ~~Ship §1.9~~ ✅ DONE (v0.6.0 / v0.1.3)
2. **Verify with live AC session** — prove the whole stack works end-to-end
3. **Add lap detection** — auto-segment laps from spline data
4. **Build reference lap overlay** — the "Track Titan killer" feature
5. **Purchase DiRT Rally 2.0** — cheapest path to rally telemetry (~€15 on sale)
6. **Implement DiRT Rally parser** — proven protocol, 7 days estimated effort
7. **Research AC Rally telemetry output** — determine if existing parsers work
8. **Draft rally coaching model** — coaching for a stage vs. a lap

---

## 17. Analysis Use Cases — Track Mapping, Corner Analysis & Ideal Lap

> **Analysis date: 2026-06-06**
> **Goal: Define the next analysis use cases beyond shift points, with track mapping as the foundation for everything that follows.**

---

### 17.1 Why Track Mapping Must Come First — The Deliberate Boundary Recording Method

**The core insight:** Every subsequent analysis feature (corner detection, grip mapping, theoretical best lap, optimal racing line) depends on an accurate model of the track geometry.

**Deliberate boundary recording** (2 slow laps per track) gives ±0.5m accuracy vs. ±2–4m from auto-estimation from normal laps. The track model is persisted and keyed by `(game, track_name)`.

**The track mapping workflow:**
1. Load track, select car
2. Start a `track_mapping` session
3. **Run 1:** Left boundary (hug left edge)
4. **Run 2:** Right boundary (hug right edge)
5. System builds `TrackModel` automatically
6. TrackModel persisted — all future sessions load it

---

### 17.2 The Analysis Pipeline

```
60 Hz Telemetry → 1. Lap Detection → 2. Track Mapping → 
  3. Corner Analysis | 4. Grip Envelope | 5. Theoretical Best Lap →
  6. Time Loss Attribution → 7. Coaching Output
```

---

### 17.3 Lap Detection

Data source: `spline_position` (0.0–1.0). Lap crossing = spline wraps from ~1.0 to ~0.0. Edge cases: invalid laps (off-track), out laps, pit lane, slow crossings.

Estimated effort: 1–2 days. Foundational — everything depends on it.

---

### 17.4 Track Mapping — Building the TrackModel

New use case: `track_mapping`. Persistent `TrackModel` stored at `data/tracks/<game>/<track_name>.json`.

Key data: center_line, left/right boundaries, track_width, heading, curvature κ(s), auto-detected corners and sectors.

API additions: `GET /api/tracks`, `GET /api/tracks/{game}/{track_name}`, `POST /api/tracks/build`, `DELETE /api/tracks/{game}/{track_name}`.

---

### 17.5 Corner Analysis

Per-corner breakdown: entry/mid/exit speed trace, G-forces, slip angles, input profile. Requires TrackModel for corner detection.

---

### 17.6 Grip Envelope

From all laps: max lateral G, max accel G, max brake G, binned by speed. Produces the "grip circle" boundary. Used for coaching: "car can do 1.4g, you used only 1.1g".

---

### 17.7 Theoretical Best Lap

Stitch best sectors across multiple laps into one ideal lap. Produces optimal speed trace.

---

### 17.8 Time Loss Attribution

Per corner per lap: delta vs. theoretical best, root cause (braking too early, not enough throttle, wrong line), where in corner time was lost.

---

### 17.9 Coaching Output

Final output: "Turn 3: -0.4s. Braked 12m too early. Car can do 1.4g, you used only 1.1g. → Brake 12m later, carry 7 km/h more speed."

---

### 17.10 Implementation Priority

| Use Case | Depends On | Estimated Effort | Priority |
|----------|-----------|-----------------|----------|
| Lap detection | Spline data in TT feed | 1–2 days | P0 — blocks everything |
| Track mapping | Lap detection | 3–5 days | P0 — blocks corner/grip analysis |
| Corner analysis | Track model | 3–5 days | P1 |
| Grip envelope | Track model | 2–3 days | P1 |
| Theoretical best lap | Lap detection + sectors | 2–3 days | P1 |
| Time loss attribution | Corner + grip + theoretical | 3–5 days | P2 |
| Coaching output | All of the above | 5–10 days | P2 |

---

*Last updated: 2026-06-06 — Added DiRT Rally 1 & 2.0 protocol spec; updated §16.4 rally strategy, §16.6 Phase B, §16.10 next steps; 7 protocol notes now cross-linked*
*Next: verify with live AC session, add lap detection, track mapping, purchase DiRT Rally 2.0*

id: 6c0dcb2a567348fd9796f50c790082e4
parent_id: 0e8e00b432a840628faa4df5bc2068bc
created_time: 2026-05-31T16:57:08.879Z
updated_time: 2026-06-06T08:25:12.852Z
is_conflict: 0
latitude: 0.00000000
longitude: 0.00000000
altitude: 0.0000
author: 
source_url: 
is_todo: 0
todo_due: 0
todo_completed: 0
source: joplin-desktop
source_application: net.cozic.joplin-desktop
application_data: 
order: 1780246628879
user_created_time: 2026-05-31T16:57:08.879Z
user_updated_time: 2026-06-06T08:25:12.852Z
encryption_cipher_text: 
encryption_applied: 0
markup_language: 1
is_shared: 0
share_id: 
conflict_original_id: 
master_key_id: 
user_data: 
deleted_time: 0
type_: 1