Skip to content

Conversation

@cduck
Copy link
Contributor

@cduck cduck commented Oct 30, 2025

I'm not sure what was causing the error but rearranging the passes with the help of @weinbe58 fixed the problem.

For context, this was the error. I did not find a MWE.

Traceback (most recent call last):
  File "my_script.py", line 49, in compile_to_stim
    PhysicalAndSquinToStim(main.dialects, no_raise=no_raise)(main)
  File "site-packages/kirin/passes/abc.py", line 30, in __call__
    result = self.unsafe_run(mt)
  File "squin_and_to_stim.py", line 99, in unsafe_run
    .unsafe_run(mt)
  File "site-packages/bloqade/rewrite/passes/canonicalize_ilist.py", line 29, in unsafe_run
    ).rewrite(mt.code)
  File "site-packages/kirin/rewrite/fixpoint.py", line 24, in rewrite
    result = self.rule.rewrite(node)
  File "site-packages/kirin/rewrite/walk.py", line 40, in rewrite
    result = self.rule.rewrite(subnode)
  File "site-packages/kirin/rewrite/chain.py", line 29, in rewrite
    result = rule.rewrite(node)
  File "site-packages/kirin/rewrite/abc.py", line 38, in rewrite
    return self.rewrite_Statement(cast(Statement, node))
  File "site-packages/kirin/dialects/ilist/rewrite/flatten_add.py", line 49, in rewrite_Statement
    assert isinstance(rhs_type := rhs.type, types.Generic), "Impossible"
AssertionError: Impossible

@cduck cduck requested a review from weinbe58 October 30, 2025 22:15
@cduck
Copy link
Contributor Author

cduck commented Oct 30, 2025

Probably do not backport. This could cause changes in the output IR although it shouldn't make any functional changes.

@codecov
Copy link

codecov bot commented Oct 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Contributor

github-actions bot commented Oct 30, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
9893 8697 88% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
src/bloqade/rewrite/passes/aggressive_unroll.py 100% 🟢
TOTAL 100% 🟢

updated for commit: 3d2da41 by action🐍

Copy link
Member

@weinbe58 weinbe58 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to investigate your issues later but lets merge this for now.

DeadCodeElimination(),
)
result = Fixpoint(Walk(rule)).rewrite(mt.code).join(result)
result = Walk(rule).rewrite(mt.code).join(result)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I guess CSE doesn't have to be run as a fixed point.

@weinbe58 weinbe58 merged commit 1642980 into main Nov 3, 2025
11 checks passed
@weinbe58 weinbe58 deleted the cduck/unroll-for-qec branch November 3, 2025 15:06
@cduck
Copy link
Contributor Author

cduck commented Nov 3, 2025

I would like to investigate your issues later but lets merge this for now.

@weinbe58 This is the same issue you helped me debug on the 24th.

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.

3 participants