Propagate static values through Partial Eval#3491
Merged
Merged
Conversation
This change updates how variables with known static values propagate across callable invocations in Partial Evaluation. By recognizing the static values and setting the corresponding argument `ComputeKind` in the call scope, we can ensure the computed application generator set from RCA is invoked properly and unnecessary dynamism is not propagated.
swernli
commented
Jul 20, 2026
swernli
left a comment
Collaborator
Author
There was a problem hiding this comment.
Of note for reviewers: the only product code changes are in source/compiler/qsc_partial_eval/src in lib.rs and evaluation_context.rs. The rest of the updates are for tests and test snapshots.
idavis
approved these changes
Jul 20, 2026
fedimser
reviewed
Jul 20, 2026
| // to full evaluation without requiring any emission of RIR instructions. | ||
| fn is_static_value(args_value: &Value) -> bool { | ||
| match args_value { | ||
| // Qubit/Result ids and variables values cannot be treated as static. |
fedimser
approved these changes
Jul 20, 2026
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.
This change updates how variables with known static values propagate across callable invocations in Partial Evaluation. By recognizing the static values and setting the corresponding argument
ComputeKindin the call scope, we can ensure the computed application generator set from RCA is invoked properly and unnecessary dynamism is not propagated.