[Feature] Add interactive IR lower-trace comparison viewer - #2148
[Feature] Add interactive IR lower-trace comparison viewer#2148lyfne123 wants to merge 20 commits into
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughAdds ChangesIR Lower Trace workflow
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant CLI as pypto-ir-trace CLI
participant Discovery as discover_snapshots
participant Diff as build_trace
participant HTML as render_html
participant Report as ir_trace.html
CLI->>Discovery: load passes_dump
Discovery-->>CLI: ordered Snapshots
CLI->>Diff: build pass traces with context
Diff-->>CLI: PassTrace sequence
CLI->>HTML: render traces
HTML-->>CLI: deterministic HTML
CLI->>Report: atomically replace output
Poem Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/en/superpowers/specs/2026-07-24-ir-lower-trace-design.md`:
- Around line 230-247: Update the missing snapshot index diagnostic described in
the Error Handling section to include the neighboring snapshot filenames
surrounding the gap, matching the documented “between X and Y” format. Keep the
existing index and directory context, and align the specification with the
behavior implemented by discovery.py.
In `@python/pypto/tools/ir_trace/diff.py`:
- Around line 34-83: Update highlight_python to catch SyntaxError alongside the
existing tokenize.TokenError, IndentationError, and ValueError exceptions when
generating or validating tokens. Preserve the current fallback of returning
escaped_lines so invalid IR dumps render safely as plain text across supported
Python versions.
In `@python/pypto/tools/ir_trace/discovery.py`:
- Around line 85-90: Update the missing-index error handling in the snapshot
validation loop to include the immediately preceding and following snapshot
filenames, matching the documented “between … and …” diagnostic format. Derive
both bordering names from the indexed snapshot data and retain the zero-padded
missing index in the IRTraceError message.
In `@python/pypto/tools/ir_trace/html.py`:
- Around line 529-541: Update the keydown guard in the document
keyboard-navigation listener to exclude only text-entry targets, not BUTTON
elements, so focused .pass-item buttons still allow j/k and arrow navigation
after clicks. Preserve the existing visible-pass selection and navigation
behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: e5f20d69-ade0-4923-8189-dc0f90e53efd
📒 Files selected for processing (14)
docs/en/dev/07-ir-lower-trace.mddocs/en/superpowers/plans/2026-07-27-ir-lower-trace.mddocs/en/superpowers/specs/2026-07-24-ir-lower-trace-design.mddocs/zh-cn/dev/07-ir-lower-trace.mddocs/zh-cn/superpowers/plans/2026-07-27-ir-lower-trace.mddocs/zh-cn/superpowers/specs/2026-07-24-ir-lower-trace-design.mdpyproject.tomlpython/pypto/tools/ir_trace/__init__.pypython/pypto/tools/ir_trace/cli.pypython/pypto/tools/ir_trace/diff.pypython/pypto/tools/ir_trace/discovery.pypython/pypto/tools/ir_trace/html.pypython/pypto/tools/ir_trace/model.pytests/ut/tools/test_ir_trace.py
- fall back safely when tokenization raises SyntaxError - report missing snapshots with neighboring filenames - preserve keyboard navigation from focused pass buttons - document best-effort cleanup error handling
- fall back safely when tokenization raises SyntaxError - report missing snapshots with neighboring filenames - preserve keyboard navigation from focused pass buttons - document best-effort cleanup error handling
45b299b to
ca96f0c
Compare
- fall back safely when tokenization raises SyntaxError - report missing snapshots with neighboring filenames - preserve keyboard navigation from focused pass buttons - document best-effort cleanup error handling
ca96f0c to
f305391
Compare
Summary
pypto-ir-traceCLI for deterministic, self-contained HTML reports from pass dumpsTesting
cmake --build build --parallel 8pre-commit run --all-filesSimpleAddcompile generated 44 pass snapshots; the CLI produced a deterministic 1.31 MB report with 6 changed and 38 no-op passessimplerinstallationFixes #2134