-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix classical bit mapping in HLS pass #14597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
Co-authored-by: Alexander Ivrii <alexi@il.ibm.com>
One or more of the following people are relevant to this code:
|
Pull Request Test Coverage Report for Build 15686757882Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
mtreinish
reviewed
Jun 16, 2025
Previously the cargs were being written to a Vec<usize> as an intermediate storage, however we are just returning them directly and don't need to allocate or change the types. This commit just works with the slice returned from the interner directly which both simplifies the code and should also be faster.
mtreinish
approved these changes
Jun 16, 2025
@Mergifyio backport stable/2.0 |
✅ Backports have been created
|
mergify bot
pushed a commit
that referenced
this pull request
Jun 16, 2025
* Map classical bits from block to outer circuit Co-authored-by: Alexander Ivrii <alexi@il.ibm.com> * Add regression test * Add reno * Avoid allocating cargs Previously the cargs were being written to a Vec<usize> as an intermediate storage, however we are just returning them directly and don't need to allocate or change the types. This commit just works with the slice returned from the interner directly which both simplifies the code and should also be faster. --------- Co-authored-by: Alexander Ivrii <alexi@il.ibm.com> Co-authored-by: Matthew Treinish <mtreinish@kortar.org> (cherry picked from commit 9ec464a)
mergify bot
pushed a commit
that referenced
this pull request
Jun 16, 2025
* Map classical bits from block to outer circuit Co-authored-by: Alexander Ivrii <alexi@il.ibm.com> * Add regression test * Add reno * Avoid allocating cargs Previously the cargs were being written to a Vec<usize> as an intermediate storage, however we are just returning them directly and don't need to allocate or change the types. This commit just works with the slice returned from the interner directly which both simplifies the code and should also be faster. --------- Co-authored-by: Alexander Ivrii <alexi@il.ibm.com> Co-authored-by: Matthew Treinish <mtreinish@kortar.org> (cherry picked from commit 9ec464a)
This was referenced Jun 16, 2025
github-merge-queue bot
pushed a commit
that referenced
this pull request
Jun 16, 2025
* Map classical bits from block to outer circuit * Add regression test * Add reno * Avoid allocating cargs Previously the cargs were being written to a Vec<usize> as an intermediate storage, however we are just returning them directly and don't need to allocate or change the types. This commit just works with the slice returned from the interner directly which both simplifies the code and should also be faster. --------- (cherry picked from commit 9ec464a) Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com> Co-authored-by: Alexander Ivrii <alexi@il.ibm.com> Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
github-merge-queue bot
pushed a commit
that referenced
this pull request
Jun 16, 2025
* Map classical bits from block to outer circuit * Add regression test * Add reno * Avoid allocating cargs Previously the cargs were being written to a Vec<usize> as an intermediate storage, however we are just returning them directly and don't need to allocate or change the types. This commit just works with the slice returned from the interner directly which both simplifies the code and should also be faster. --------- (cherry picked from commit 9ec464a) Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com> Co-authored-by: Alexander Ivrii <alexi@il.ibm.com> Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Changelog: Bugfix
Include in the "Fixed" section of the changelog
stable backport potential
The bug might be minimal and/or import enough to be port to stable
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.
Summary
This PR fixes a bug in HLS where classical registers were mapped to the indices in within the high level object they were defined on, instead of the corresponding index in the global circuit.
Fixes #14569 .
Details and comments
The bug was introduced in 2.0, so the fix should be backported to the
stable/2.0
branch, but notstable/1.4
.