Const address
Arch-independent validation: every NewAt address arg must const-fold.
NewAt pins a qubit to a physical address, so its three int arguments
have to be known at compile time. Nothing in verify() says so -- the
statement signature is satisfied by any int SSA value, including a kernel
block argument whose value only ever exists at runtime.
This is the arch-independent half of the check in :mod:.new_at, split out so
it can run at kernel-decoration time. Const-foldability needs only the
const-prop hints the unroll/fold passes have already attached; the in-range
half needs an ArchSpec, which the gemini kernel groups do not have, and so
stays in :mod:.new_at for NativeToPlace.emit to run against a real spec.
Rejecting an entry kernel's own argument loses nothing: a parameter scan compiles one program and binds arguments at runtime, so an entry argument can never become a constant. An address threaded through a callee parameter is unaffected -- it const-folds once the caller is inlined, which happens before this pass runs.
ConstAddressValidation
dataclass
ConstAddressValidation()
Bases: ValidationPass
flowchart TD
bloqade.gemini.common.validation.const_address.ConstAddressValidation[ConstAddressValidation]
click bloqade.gemini.common.validation.const_address.ConstAddressValidation href "" "bloqade.gemini.common.validation.const_address.ConstAddressValidation"
Report every gemini.common.NewAt address argument that is not a
compile-time constant.