Skip to content

Conversation

@zeinabPourgheisari
Copy link
Collaborator

While iterating over gatesPerBlock inside convertPhiToGamma function, the gamma expansion logic may insert new
entries into the same DenseMap. This can invalidate iterators and lead to
crashes in specific CFG/GSA patterns. The iteration is now performed over a
stable copy so that gatesPerBlock can be safely extended during gamma
expansion.

P.S. This still needs to be tested on all integration tests; once that is
done, the PR will be marked as non-draft.

@AyaElAkhras
Copy link
Member

Thanks for reporting this, I see the issue. Just one thing to double-check: all of the gates added by expandGammaTree are already gamma gates and therefore do not need to go through the convertPhiToGamma logic, right?

@zeinabPourgheisari
Copy link
Collaborator Author

zeinabPourgheisari commented Dec 20, 2025

Just one thing to double-check: all of the gates added by expandGammaTree are already gamma gates and therefore do not need to go through the convertPhiToGamma logic, right?

Yes, exactly.

@zeinabPourgheisari zeinabPourgheisari marked this pull request as ready for review December 23, 2025 14:17
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