microsoft / qsharp

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

Show code lenses on Main() even when @EntryPoint() attribute is omitted #1652

Closed minestarks closed 3 days ago

minestarks commented 1 week ago

With #1584 , the @EntryPoint() attribute is no longer required if the entry callable is named Main . But the code lenses are still looking for the attribute.

With this fix, instead of looking for the @EntryPoint() attribute, we parse the entry expression. This expression would have been generated by a prior HIR pass. https://github.com/microsoft/qsharp/blob/54586a6bb9d91f21cbed1cbc5359a7a8ae43db64/compiler/qsc_passes/src/entry_point.rs#L44

github-actions[bot] commented 1 week ago

Benchmark for 8414f04

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | 331.2±2.92µs | **327.3±3.72µs** | **-1.18%** | | Array literal evaluation | 195.3±1.35µs | **180.3±8.60µs** | **-7.68%** | | Array update evaluation | 413.6±1.54µs | **409.1±3.32µs** | **-1.09%** | | Core + Standard library compilation | 21.1±0.76ms | 21.7±0.97ms | +2.84% | | Deutsch-Jozsa evaluation | 5.2±0.08ms | **5.1±0.05ms** | **-1.92%** | | Large file parity evaluation | 34.6±0.42ms | 34.6±0.38ms | 0.00% | | Large input file compilation | 13.1±0.55ms | 13.2±0.79ms | +0.76% | | Large input file compilation (interpreter) | 53.8±2.24ms | 53.0±2.17ms | -1.49% | | Large nested iteration | 32.2±0.27ms | **31.9±0.59ms** | **-0.93%** | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1585.5±161.93µs | 1576.6±55.81µs | -0.56% | | Perform Runtime Capabilities Analysis (RCA) on large file sample | 8.0±0.13ms | 8.0±0.15ms | 0.00% | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1430.6±78.57µs | 1433.3±71.68µs | +0.19% | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | 28.3±0.31ms | 28.4±0.35ms | +0.35% | | Teleport evaluation | 91.3±3.66µs | 90.6±3.72µs | -0.77% |
minestarks commented 1 week ago

Hmmm, broke the integration test since we now won't return code lenses if there are syntax errors elsewhere in the code! I'm going to have to update the integration test to match the new expectation. Putting back to draft.

github-actions[bot] commented 1 week ago

Benchmark for c69b6a7

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | 329.5±3.15µs | 332.5±6.19µs | +0.91% | | Array literal evaluation | **177.9±1.04µs** | 197.4±13.73µs | **+10.96%** | | Array update evaluation | **410.8±1.79µs** | 413.8±2.02µs | **+0.73%** | | Core + Standard library compilation | 19.8±0.13ms | 19.9±0.21ms | +0.51% | | Deutsch-Jozsa evaluation | 5.1±0.04ms | 5.1±0.05ms | 0.00% | | Large file parity evaluation | 34.1±0.22ms | 34.2±0.29ms | +0.29% | | Large input file compilation | 12.1±0.12ms | 12.1±0.13ms | 0.00% | | Large input file compilation (interpreter) | 47.2±1.24ms | 47.6±1.57ms | +0.85% | | Large nested iteration | **31.8±0.18ms** | 32.3±0.61ms | **+1.57%** | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1555.2±27.37µs | 1560.0±45.04µs | +0.31% | | Perform Runtime Capabilities Analysis (RCA) on large file sample | 7.8±0.08ms | 7.8±0.09ms | 0.00% | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1419.1±33.26µs | 1415.1±29.77µs | -0.28% | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | 27.9±0.33ms | 27.9±0.48ms | 0.00% | | Teleport evaluation | 90.5±3.46µs | 90.6±5.48µs | +0.11% |
github-actions[bot] commented 1 week ago

Benchmark for cfaeda5

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | **333.5±6.15µs** | 348.3±3.02µs | **+4.44%** | | Array literal evaluation | 198.6±2.86µs | 201.1±3.18µs | +1.26% | | Array update evaluation | **422.2±16.03µs** | 435.7±2.81µs | **+3.20%** | | Core + Standard library compilation | **21.5±0.77ms** | 22.6±0.99ms | **+5.12%** | | Deutsch-Jozsa evaluation | **5.1±0.06ms** | 5.2±0.11ms | **+1.96%** | | Large file parity evaluation | 34.1±0.33ms | 34.4±0.78ms | +0.88% | | Large input file compilation | 13.3±0.45ms | 13.1±0.46ms | -1.50% | | Large input file compilation (interpreter) | 51.9±2.00ms | 53.1±2.28ms | +2.31% | | Large nested iteration | **32.3±0.36ms** | 34.6±0.92ms | **+7.12%** | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1595.9±101.83µs | 1606.3±148.30µs | +0.65% | | Perform Runtime Capabilities Analysis (RCA) on large file sample | **7.9±0.12ms** | 8.2±0.24ms | **+3.80%** | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1450.4±71.29µs | 1471.5±162.33µs | +1.45% | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | 28.6±0.50ms | 28.5±0.29ms | -0.35% | | Teleport evaluation | 89.7±3.79µs | 91.9±5.65µs | +2.45% |
sezna commented 4 days ago

Oh that's an annoying lint -- it thinks EntryPoint is Rust. https://github.com/microsoft/qsharp/actions/runs/9604910275/job/26491428428?pr=1652#step:5:329

github-actions[bot] commented 3 days ago

Benchmark for 95f887c

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | 331.1±2.22µs | 331.3±1.84µs | +0.06% | | Array literal evaluation | 191.6±10.88µs | **189.6±0.59µs** | **-1.04%** | | Array update evaluation | 412.8±1.60µs | 413.6±3.52µs | +0.19% | | Core + Standard library compilation | 20.6±0.87ms | **20.3±0.28ms** | **-1.46%** | | Deutsch-Jozsa evaluation | 5.2±0.10ms | 5.2±0.37ms | 0.00% | | Large file parity evaluation | 34.2±0.10ms | 34.2±0.13ms | 0.00% | | Large input file compilation | 12.5±0.25ms | 12.5±0.26ms | 0.00% | | Large input file compilation (interpreter) | 49.6±0.98ms | 49.7±0.96ms | +0.20% | | Large nested iteration | 32.1±0.40ms | 32.1±0.19ms | 0.00% | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1567.0±40.21µs | 1564.0±35.02µs | -0.19% | | Perform Runtime Capabilities Analysis (RCA) on large file sample | 7.8±0.10ms | 7.8±0.12ms | 0.00% | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1427.3±62.81µs | 1426.1±40.68µs | -0.08% | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | 28.1±0.48ms | 28.1±0.72ms | 0.00% | | Teleport evaluation | 91.0±3.60µs | 91.8±5.16µs | +0.88% |