microsoft / qsharp

Azure Quantum Development Kit, including the Q# programming language, resource estimator, and Quantum Katas
https://microsoft.github.io/qsharp/
MIT License
369 stars 73 forks source link

Fix for logic based on `CallToUnresolvedCallee` flag #1519

Closed swernli closed 1 month ago

swernli commented 1 month ago

The check for the dynamism of the return from unresolved callees incorrectly ended up applying to calls where the flag had propagated from another call site, including the entry point callable itself. This change introduces new infra to track the call expression that introduced the flag as opposed to all calls the flag had propagated to, which keeps the desired protection but avoids rejecting other call expressions.

swernli commented 1 month ago

FYI: I confirmed the new test case fails on main but passes with the fix, so we know it is testing the specific flag propagation the change is intended to side-step.

github-actions[bot] commented 1 month ago

Benchmark for eeb692d

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | 349.8±41.37µs | 346.7±3.24µs | -0.89% | | Array literal evaluation | **189.1±0.59µs** | 189.9±0.85µs | **+0.42%** | | Array update evaluation | 430.2±4.08µs | 434.2±12.88µs | +0.93% | | Core + Standard library compilation | 16.7±0.20ms | 16.8±0.41ms | +0.60% | | Deutsch-Jozsa evaluation | **5.0±0.05ms** | 5.1±0.04ms | **+2.00%** | | Large file parity evaluation | **33.7±0.11ms** | 34.0±1.07ms | **+0.89%** | | Large input file compilation | 11.4±0.22ms | 11.5±0.22ms | +0.88% | | Large input file compilation (interpreter) | 43.9±1.39ms | 44.3±1.45ms | +0.91% | | Large nested iteration | **33.6±0.35ms** | 33.8±0.17ms | **+0.60%** | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1536.2±27.40µs | 1556.0±58.04µs | +1.29% | | Perform Runtime Capabilities Analysis (RCA) on large file sample | 7.7±0.09ms | 7.7±0.19ms | 0.00% | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1410.8±47.58µs | 1413.4±43.40µs | +0.18% | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | **27.2±0.24ms** | 27.6±0.36ms | **+1.47%** | | Teleport evaluation | 88.0±4.33µs | 87.8±5.57µs | -0.23% |