Skip to content

Propagate static values through Partial Eval#3491

Merged
swernli merged 1 commit into
mainfrom
swernli/propagate-static-values
Jul 20, 2026
Merged

Propagate static values through Partial Eval#3491
swernli merged 1 commit into
mainfrom
swernli/propagate-static-values

Conversation

@swernli

@swernli swernli commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

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.

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 swernli left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

@swernli
swernli added this pull request to the merge queue 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: variables->variable

Merged via the queue into main with commit d0320c6 Jul 20, 2026
13 checks passed
@swernli
swernli deleted the swernli/propagate-static-values branch July 20, 2026 23:13
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