Skip to content

✨ Refactor VM tracing into trait-based system#124

Merged
timfennis merged 3 commits intomasterfrom
feature/trace-refactor
Mar 22, 2026
Merged

✨ Refactor VM tracing into trait-based system#124
timfennis merged 3 commits intomasterfrom
feature/trace-refactor

Conversation

@timfennis
Copy link
Copy Markdown
Owner

Summary

  • Rename vm-trace feature flag to trace and refactor inline tracing into a composable VmTracer trait
  • Add four tracer implementations: PrintTracer (instruction log), HistogramTracer (dispatch counts), TimingTracer (cumulative time per opcode), and SpanTracer (source code heat map)
  • Enable tracers via CLI flags: --trace-print, --trace-histogram, --trace-time, --trace-span

Test plan

  • cargo build compiles without trace feature (zero cost)
  • cargo build --features trace compiles with trace feature
  • All 316 tests pass
  • cargo clippy and cargo clippy --features trace produce no warnings
  • Verified all four tracers produce correct output
  • Multiple trace flags can be combined

🤖 Generated with Claude Code

timfennis and others added 3 commits March 22, 2026 14:21
Replace ad-hoc #[cfg(feature = "vm-trace")] blocks with a composable
VmTracer trait behind a renamed `trace` feature flag. Add four tracer
implementations: PrintTracer, HistogramTracer, TimingTracer, and
SpanTracer (source heat map). Tracers are enabled via CLI flags
--trace-print, --trace-histogram, --trace-time, and --trace-span.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@timfennis timfennis enabled auto-merge (squash) March 22, 2026 13:58
@timfennis timfennis merged commit e1fe2e2 into master Mar 22, 2026
1 check passed
@timfennis timfennis deleted the feature/trace-refactor branch March 22, 2026 13:59
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.

1 participant