Skip to content

Conversation

@lance0
Copy link
Owner

@lance0 lance0 commented Jan 27, 2026

Summary

  • Add --animate flag for replay mode that shows probe-by-probe discovery as it happened
  • Add --speed flag to control replay speed (default 10x, use 1.0 for real-time)
  • Press Space to pause/resume during animated replay
  • Progress indicator shows replay position in status bar

Technical Changes

  • ProbeEvent recording: Events now include seq, flow_id for full probe correlation
  • Monotonic timing: Use std::time::Instant instead of wall clock for event offsets (prevents clock jump issues)
  • Late reply tracking: Responses arriving after timeout are recorded as late_reply events
  • Pause/resume fix: Correctly resets clock on resume to prevent time jumps

Usage

ttl --replay trace.json --animate               # 10x speed (default)
ttl --replay trace.json --animate --speed 1.0   # Real-time
ttl --replay trace.json --animate --speed 50    # Fast forward

Closes #9

Test plan

  • cargo test passes
  • cargo clippy clean
  • Manual test: save a session with --json, replay with --animate
  • Manual test: pause/resume with Space key
  • Manual test: verify --speed affects playback rate

- Record probe events during trace (offset_ms, ttl, response/timeout)
- Add ProbeEvent/ProbeOutcome structs to session.rs
- Session JSON now includes events array (backward compatible)
- Add --animate flag for replay mode
- Animated replay shows hop-by-hop discovery in TUI
- Space to pause/resume replay
- Increase TUI refresh to 60fps for responsive updates (#17)
- Graceful fallback for old sessions without events
- Add hop.record_sent() so hops appear in TUI (was filtering h.sent > 0)
- Set dest_ttl when destination reached during replay
- Add #[allow(clippy::too_many_arguments)] to run_tui
- Add --speed flag for replay speed control (default 10x)
- Use monotonic clock (Instant) for event offsets to prevent clock jumps
- Fix pause/resume to reset start time correctly
- Add seq and flow_id to ProbeEvent for full probe correlation
- Add LateReply event type for responses arriving after timeout
- Fix borrow checker issues with offset_ms calculation
- Update docs: README, FEATURES.md, SCRIPTING.md, CHANGELOG, ROADMAP
Consistent with the TUI status bar legend which shows 'p pause'.
- Fix unreachable 'p' pattern: route to replay or live pause based on mode
- Fix LateReply double-counting sent probes and total_sent
- Fix resume timing: track elapsed at pause instead of using next event offset
- Fix multi-flow replay: use correct response recording based on flow count
- Sort events by offset_ms in ReplayState::new to prevent stalled replay
- Uncheck progress indicator in ROADMAP (not implemented)
@lance0 lance0 merged commit 0d5454a into master Jan 27, 2026
4 checks passed
@lance0 lance0 deleted the feature/animate-replay branch January 27, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Enhanced replay mode: Animate probe sequence discovery instead of showing final state only

2 participants