Repository navigation
Commit 3c3dc2d
authored
[STIM] Add tests to semantic pass (#3731)
This PR moves semantic behavior coverage out of QIR generation tests and
into semantic pass tests. QIR tests retain coverage for emitted QIR and
backend-specific behavior.
## Coverage
- **Moved to the semantic pass:** argument and target validation,
broadcasting, aliases, measurement-record bounds and scoping, block
validation, repeated-qubit checks, and Pauli-product canonicalization.
- **Kept in QIR:** generated QIR, gate decompositions, control flow, and
unsupported backend behavior.
- **Added:** direct coverage of successful instruction and block
lowering in `instruction_lowering` and `block_lowering`, plus broad
error-case coverage across instruction families and invalid argument,
target, and scoping combinations.
## Test Design
- Broadcasting tests programmatically inspect every lowered target
across instruction families, because missed broadcasts can otherwise
fail silently.
- Alias tests programmatically compare the lowered canonical and alias
forms to ensure they're lowered the same.
- Semantic AST snapshots cover successful lowering, while diagnostic
snapshots cover error cases.1 parent 08f6936 commit 3c3dc2d
33 files changed
Lines changed: 9275 additions & 6632 deletions
File tree
- source/compiler/stim_compiler/src
- qir
- tests
- semantic
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
102 | 112 | | |
103 | 113 | | |
104 | 114 | | |
| |||
169 | 179 | | |
170 | 180 | | |
171 | 181 | | |
172 | | - | |
| 182 | + | |
173 | 183 | | |
174 | 184 | | |
175 | 185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | | - | |
9 | 7 | | |
10 | 8 | | |
11 | | - | |
12 | 9 | | |
13 | 10 | | |
14 | | - | |
15 | 11 | | |
16 | 12 | | |
17 | 13 | | |
18 | 14 | | |
19 | | - | |
20 | 15 | | |
21 | | - | |
22 | 16 | | |
23 | 17 | | |
24 | 18 | | |
| |||
0 commit comments