feat: first draft at kirin kernel debugger that generates HTML - #715
Draft
jasonhan3 wants to merge 2 commits into
Draft
feat: first draft at kirin kernel debugger that generates HTML#715jasonhan3 wants to merge 2 commits into
jasonhan3 wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
☂️ Code Coverage
Overall Coverage
New Files
Modified Files
|
Contributor
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #714
Example:

PR: Add an Interactive Kirin IR Inspector
Summary
Adds a self-contained HTML inspector for Kirin IR. The HTML view makes IR easier
to explore without changing
Method.print()or the textual printer.What Changed
kirin.visualize.to_htmlandkirin.visualize.write_html.kirin.ir_to_htmlandkirin.write_ir_htmlas public aliases.Method.visualize(path, *, analysis=None, title=None).hints, and optional analysis result.
operation, operands, results, attributes, traits, regions, and source
location/source snippet when available.
Usage
Generate a file from a compiled kernel:
Open
add_one.ir.htmlin a browser, or with the VS Code commandKirin: Open IR Inspector.In a Jupyter notebook, display the inspector in the output cell:
Pass an analysis frame or mapping to include a fact for each SSA value:
Validation
uv run pytestuv run ruff check src/kirin/visualize.py src/kirin/ir/method.py src/kirin/__init__.py test/visualize/test_html.pyuv run pyright src/kirin/visualize.py src/kirin/ir/method.pyScope
This does not alter
kirin.print()and does not provide step-through orbreakpoint debugging. It establishes a reusable HTML visualization surface
that can be embedded in notebooks, opened in a browser, or hosted by an IDE.