Skip to main content
NM-RFC-0014 · Compiler artifact

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.

Proposed experimental

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.

Artifact fingerprint
sha256:4d4af3a67e5d5675176d25a4cbe7b515530c7162e7ae82818a16b6b0017a928c

Encounter-ordered const Int declarations

DeclarationSource expressionFolded valueReferencesLine
BASE33None3
NBASE3BASE4

Structural use and owning budget

PositionSource expressionRequestedEffectiveBudgetPolicyOutcomeReferencesLine
QReg<E> typeN331..14StrictAcceptedN6
qreg[E] allocationN331..14StrictAcceptedN6

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.

0 carrier nodes

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.