You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This causes the generated RIR program to be missing branch and jump terminator instructions at the end of blocks. The empty block (should have one terminating jump) is what triggers the specific panic, but other non-empty blocks also are missing terminators that mean the program is invalid.
Either the early return should be fully handled by refactoring the control flow handling for dynamic branches (which must correctly handling inlining for functions like the example above) or the RuntimeFeatureFlags::ReturnWithinDynamicScope should be updated to require more than just TargetCapabilityFlags::Adaptive so that RCA rejects this pattern at compile time.
The text was updated successfully, but these errors were encountered:
This change avoids the panic in early returns by blocking them in RCA and providing the user with compile-time feedback before failing during QIR generation. It also includes updates to partial evaluation to ensure that the panicking case is now treated as a unimplemented graceful failure, since we don't have proper support for it.
Since QIR generation for programs with early return have never properly been handled, this doesn't take any functionality away but rather ensures earlier indication of the unsupported patterns at compile time. I filed #2387 to cover the additional work needed to fully support dynamic explicit returns.
Fixes#2290
#2388)
This change avoids the panic in early returns by blocking them in RCA
and providing the user with compile-time feedback before failing during
QIR generation. It also includes updates to partial evaluation to ensure
that the panicking case is now treated as a unimplemented graceful
failure, since we don't have proper support for it.
Since QIR generation for programs with early return have never properly
been handled, this doesn't take any functionality away but rather
ensures earlier indication of the unsupported patterns at compile time.
I filed #2387 to cover the additional work needed to fully support
dynamic explicit returns.
Fixes#2290
Uh oh!
There was an error while loading. Please reload this page.
The following code causes a panic in QIR generation:
However, the same code with implicit returns in the function works as expected:
This appears to be because of how the
BranchControlFlow::Return
is used to short circuit the handling of the rest of the block:qsharp/compiler/qsc_partial_eval/src/lib.rs
Lines 1837 to 1839 in cd5c2e3
This causes the generated RIR program to be missing branch and jump terminator instructions at the end of blocks. The empty block (should have one terminating jump) is what triggers the specific panic, but other non-empty blocks also are missing terminators that mean the program is invalid.
Either the early return should be fully handled by refactoring the control flow handling for dynamic branches (which must correctly handling inlining for functions like the example above) or the
RuntimeFeatureFlags::ReturnWithinDynamicScope
should be updated to require more than justTargetCapabilityFlags::Adaptive
so that RCA rejects this pattern at compile time.The text was updated successfully, but these errors were encountered: