Branch: * main
commit f2f93a16fab1cb6263cbded96a74b7387be32831
Author: João Boechat <joaoboechat@microsoft.com>
Date: Tue Jul 14 16:16:59 2026 -0700
Update prepare/select scoping rules in stim (#3454)
This PR implements the following scoping rules for the PREPARE blocks in
stim:
1- An outer scope is allowed to reach into an inner one
2- An inner scope isn't allowed to reach into an outer one
3- The only blocks that have scoping rules are the prepare blocks
So, for example:
This should work:
```
PREPARE {
M 0
}
REQUIRE rec[-1]
```
But this should not:
```
M 0
PREPARE {
REQUIRE rec[-1]
}
```
Nor this:
```
M 0
PREPARE {
CX rec[-1] 1
}
```
On top of that, it also renames the PREPARE block to SELECT.
The fuzz-testing workflow has detected a bug.
Auto-Minimized Fuzzing Input That Triggers the Bug: Click this line.
Note: If the input is multi-line then the end-of-line characters ' ' (0x0A) and ' ' (0x0D) may affect the reproducibility of the bug. If you fail to repro the bug with the input shown below then you may want to go to the workflow that reported this GitHub bug, download the artifact, and extract the file with the exact minimized input.The branch/commit the bug has been found in: Click.
If the developers fail to repro the bug in the latestmainthen the branch/commit info below can help them to make sure that they are using the correct way to repro. If the bug is reproducible in the branch/commit below, but not in latestmain, then the bug is likely fixed already or is not in themainbranch.Other Info
ubuntu-latest: Linux runnervm5mmn9 6.17.0-1018-azure #18~24.04.1-Ubuntu SMP Thu May 28 16:39:11 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux.