Skip to content

Session Analysis Pipeline

The analysis pipeline runs entirely client-side. No telemetry data leaves the desktop. When the user selects a reference lap and a current lap, the pipeline automatically fires.

Session Analysis

User selects reference lap + current lap
  → AnalysisPipeline detects selection change
  → AnalysisEngine.Analyze(session, refLap, currentLap)
      → TrackSegmentation.BuildSegments(refLap)
      → LapResampler.Resample(refLap, currentLap)
      → Corner-by-corner insight detection
  → AnalysisState.SetResult(result)
  → Compare tab: ranked insights list
  → Telemetry tab: ScottPlot (Speed, Throttle, Brake, Delta)
  → Segments tab: per-corner speed/brake/throttle table

SimCopilot.Core

The analysis engine. Zero external dependencies — no UI, no disk, no network.

Key types:

  • TelemetryPoint — immutable data unit, keyed by track distance. Fields: Distance (m), Time (s), Speed (km/h), Throttle/Brake (0–1), Steering (°), Gear, X/Y world position, optional game-specific extras.

  • Lap — ordered sequence of TelemetryPoint objects plus metadata (lap time, validity flag, penalty count, lap time source). LapLengthMeters is taken from the last point's distance.

  • SessionData — container holding all laps for a session plus TelemetrySessionMetadata (track, vehicle, weather, recorded timestamp). BestValidLap returns the fastest valid, timing-eligible lap.

  • AnalysisEngine — static Analyze(session, refLap, currentLap, options). Compares two laps corner-by-corner after resampling and detects: brake too early, slow corner exit, late throttle application, sector delta loss/gain, lap time variance, throttle input stability. Returns an AnalysisResult with ranked AnalysisInsight[], TrackSegment[], and the full ResampledLapComparison for plotting.

  • LapResampler — static Resample(refLap, currentLap, options). Interpolates both laps to N distance points (default 512), computes cumulative time along distance, produces point-wise Δ (current − reference). The ResampledLapComparison feeds all four ScottPlot curves (Speed, Throttle, Brake, Delta).

  • TrackSegmentation — static BuildSegments(lap, options). Two-threshold hysteresis on smoothed steering angle to detect corners. Output: TrackSegment[] with kind (Corner/Straight), ordinal, and distance bounds. Used by AnalysisEngine and the Segments tab.

  • AnalysisOptions — tunable parameters: sample count, steering thresholds, brake timing tolerance, minimum speed for delta accumulation.