Running a program that involves more than isize::MAX
gates triggers a panic in circuit builder
#2099
Labels
isize::MAX
gates triggers a panic in circuit builder
#2099
Because in compiler/qsc/src/interpret.rs we always create a chained simulator that includes a circuit builder, every intrinsic gate call gets added to a running tally of gates performed. Rust has a limit on the capacity of
Vec
toisize::MAX
so if more than that many gates are used the push of the gate after the max triggers a panic. We can work around this temporarily by having the circuit builder stop tracking when hits a hard coded limit, but we should also consider updates to the interpreter behavior (and the correspondingdump_circuit()
exposed in Python) to avoid tracing gates for a circuit if not in a debug mode, which should have additional performance benefits.Here's a playground repro (screenshot below).
The text was updated successfully, but these errors were encountered: