See exactly what N/M folds before runtime
Choose a structural position and BASE value, then compare the source expression, compiler-folded integer, effective runtime value, owning budget, diagnostics, and generated Playground program.
Comptime structure inspector
Every scenario is parsed by the real N/M frontend with explicit comptime negotiation. The displayed metadata is the compiler artifact, not a UI-side estimate or simulated result.
Compile-time constants improve structural type safety and reproducibility. They do not add runtime-sized values, raise backend ceilings, or prove hardware scalability.
- Concrete qubits
- 3
- Scalar parameters
- 0
- Expanded gates
- 1
- Structural uses
- 2
- Capped uses
- 0
Compiler-produced structural artifact
Focused rows are highlighted. Requested values remain intact even when the stable runtime applies a documented warning-and-cap policy.
sha256:4d4af3a67e5d5675176d25a4cbe7b515530c7162e7ae82818a16b6b0017a928cEncounter-ordered const Int declarations
| Declaration | Source expression | Folded value | References | Line |
|---|---|---|---|---|
| BASE | 3 | 3 | None | 3 |
| N | BASE | 3 | BASE | 4 |
Structural use and owning budget
| Position | Source expression | Requested | Effective | Budget | Policy | Outcome | References | Line |
|---|---|---|---|---|---|---|---|---|
| QReg<E> type | N | 3 | 3 | 1..14 | Strict | Accepted | N | 6 |
| qreg[E] allocation | N | 3 | 3 | 1..14 | Strict | Accepted | N | 6 |
Typed structure provenance
The Core and token frontends emit these closed nodes before expanded statements reach runtime. Statement spans bind every node to the exact executable expansion checked by the validator.
This scenario uses compile-time metadata but does not expand an Angle vector, repeat body, or for range, so no structure-provenance node is required.
Compiler diagnostics
NM-SEM-003: Allocated qubit q[1] is never used.NM-SEM-003: Allocated qubit q[2] is never used.
Additional negotiation: None
Inspect generated N/M source
module comptime_inspector_register_3;
@seed(17);
const BASE: Int = 3;
const N: Int = BASE;
fn main() {
let q: QReg<N> = qreg[N];
H(q[0]);
return 0;
}What remains outside this artifact
The closed carrier now supports fail-closed Core/token emission, canonical AST printing, and strict sidecar 0.3 round-trips with permanent 0.1 and 0.2 readers. It is not signed evidence and does not reconstruct nested structures, arbitrary circuit-call spelling, comments, or trivia from the AST; unsupported combinations remain unprintable instead of falling back silently.