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

Support closures in RCA #1498

Closed swernli closed 1 month ago

swernli commented 1 month ago

This change adds full support for analysis of closures for runtime capabilities and calls when the callee expression is known to resolve to a bound closure. This allows analysis to include captured variables as well.

github-actions[bot] commented 1 month ago

Benchmark for 6906242

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | 345.0±5.22µs | **341.2±2.14µs** | **-1.10%** | | Array literal evaluation | 195.1±9.10µs | **170.8±2.32µs** | **-12.46%** | | Array update evaluation | 429.3±2.94µs | 427.1±2.60µs | -0.51% | | Core + Standard library compilation | 17.6±0.59ms | 17.4±0.50ms | -1.14% | | Deutsch-Jozsa evaluation | 5.2±0.05ms | **5.0±0.04ms** | **-3.85%** | | Large file parity evaluation | 33.8±0.62ms | 33.8±0.62ms | 0.00% | | Large input file compilation | 12.4±0.45ms | **11.7±0.21ms** | **-5.65%** | | Large input file compilation (interpreter) | 47.8±1.33ms | 47.1±1.22ms | -1.46% | | Large nested iteration | 33.9±0.54ms | **33.3±0.25ms** | **-1.77%** | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1556.6±78.49µs | 1553.0±51.68µs | -0.23% | | Perform Runtime Capabilities Analysis (RCA) on large file sample | 7.8±0.13ms | 7.8±0.13ms | 0.00% | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1419.0±60.79µs | 1433.2±86.96µs | +1.00% | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | 27.9±0.27ms | 27.7±0.27ms | -0.72% | | Teleport evaluation | 89.9±4.03µs | 87.6±3.60µs | -2.56% |
github-actions[bot] commented 1 month ago

Benchmark for f447e0c

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | **340.9±4.17µs** | 345.3±3.22µs | **+1.29%** | | Array literal evaluation | **170.3±1.17µs** | 189.7±0.95µs | **+11.39%** | | Array update evaluation | **422.0±1.66µs** | 429.4±2.73µs | **+1.75%** | | Core + Standard library compilation | **16.6±0.20ms** | 17.2±0.33ms | **+3.61%** | | Deutsch-Jozsa evaluation | 5.2±0.06ms | **5.1±0.03ms** | **-1.92%** | | Large file parity evaluation | **33.6±0.12ms** | 33.8±0.13ms | **+0.60%** | | Large input file compilation | 11.4±0.16ms | 11.5±0.30ms | +0.88% | | Large input file compilation (interpreter) | 45.3±1.97ms | 46.1±1.35ms | +1.77% | | Large nested iteration | 33.7±1.23ms | 33.7±0.14ms | 0.00% | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1541.8±63.33µs | 1558.5±67.87µs | +1.08% | | Perform Runtime Capabilities Analysis (RCA) on large file sample | 7.7±0.11ms | 7.8±0.11ms | +1.30% | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1416.1±39.53µs | 1415.8±55.71µs | -0.02% | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | 27.4±0.16ms | 27.4±0.44ms | 0.00% | | Teleport evaluation | 89.7±5.86µs | 90.2±5.31µs | +0.56% |