reset method

void reset()

Capture-mode reset hook. Clears all per-leg state — buffer, ephemeral _issues, warmup anchors, cache-trend counters, the route epoch, the vsync cadence estimate — so back-to-back scenario legs cannot leak frames or counters from prior runs.

Preserves _emissionSeq across reset by design. The audit gate's bracketRequireUniqueDetectedAtMicros: true invariant requires every emitted record across the session to carry a distinct detectedAtMicros; resetting the counter would risk identity collisions when two legs fire emissions at the same wall-clock microsecond. Does NOT call _stopListening — the timings callback stays installed.

Implementation

void reset() {
  _buffer.clear();
  _issues.clear();
  _totalFramesSeen = 0;
  _frameNumber = 0;
  _firstFrameTimestamp = null;
  _firstFrameVsyncUs = null;
  _consecutiveThrashingFrames = 0;
  _consecutiveGrowthFrames = 0;
  _consecutiveZeroCacheFrames = 0;
  _impellerDetected = false;
  _lastTimelineData = null;
  _routeEpochFrameNumber = null;
  _resetCadence();
}