Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update samples to reflect latest 1.7 changes; Update katas and stdlib to use structs #1797

Merged
merged 35 commits into from
Aug 26, 2024

Conversation

sezna
Copy link
Contributor

@sezna sezna commented Jul 26, 2024

This PR:

  • Updates katas to use structs instead of newtypes
  • Performs some minor katas formatting updates (consistency on spacing; removing trailing whitespace; etc)
  • Checks our samples for lint warnings or errors in the CI
  • updates our samples to use the latest style from Q# 1.7
    • imports instead of opens
    • implicit entrypoint via Main
    • implicit namespaces
  • Adds stricter lint configs to projects within this repo

Closes #1709

Thanks @ScottCarda-MS and @swernli for collaborating on this PR!

@sezna sezna changed the base branch from sccarda/UpdateInternalQs to main July 26, 2024 16:10
Confirms that samples are lint free during compilation by running the linter as part of the samples_test/tests utilities.
@sezna sezna changed the title Update all samples to reflect latest 1.7 changes Update samples to reflect latest 1.7 changes; Update katas and stdlib to use structs Aug 15, 2024
@sezna sezna marked this pull request as ready for review August 15, 2024 22:57
Copy link

Change in memory usage detected by benchmark.

Memory Report for ac7ad28

Test This Branch On Main Difference
compile core + standard lib 18002928 bytes 18000952 bytes 1976 bytes

Copy link

Benchmark for ac7ad28

Click to view benchmark
Test Base PR %
Array append evaluation 339.8±7.75µs 336.2±3.57µs -1.06%
Array literal evaluation 169.6±3.35µs 169.0±2.77µs -0.35%
Array update evaluation 416.1±1.38µs 416.7±3.20µs +0.14%
Core + Standard library compilation 24.9±0.97ms 26.1±1.49ms +4.82%
Deutsch-Jozsa evaluation 4.9±0.07ms 4.9±0.06ms 0.00%
Large file parity evaluation 34.4±0.13ms 34.2±0.16ms -0.58%
Large input file compilation 15.7±0.67ms 14.1±0.25ms -10.19%
Large input file compilation (interpreter) 60.2±3.66ms 54.0±2.28ms -10.30%
Large nested iteration 33.0±0.23ms 32.9±0.51ms -0.30%
Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample 1682.9±187.14µs 1635.0±160.80µs -2.85%
Perform Runtime Capabilities Analysis (RCA) on large file sample 8.4±0.24ms 8.6±0.36ms +2.38%
Perform Runtime Capabilities Analysis (RCA) on teleport sample 1519.5±122.92µs 1487.8±143.36µs -2.09%
Perform Runtime Capabilities Analysis (RCA) on the core and std libraries 29.2±0.45ms 28.8±1.32ms -1.37%
Teleport evaluation 92.9±3.54µs 92.7±5.25µs -0.22%

Copy link

Change in memory usage detected by benchmark.

Memory Report for dcfc407

Test This Branch On Main Difference
compile core + standard lib 18002928 bytes 18000952 bytes 1976 bytes

Copy link

Benchmark for dcfc407

Click to view benchmark
Test Base PR %
Array append evaluation 343.2±9.70µs 347.5±5.22µs +1.25%
Array literal evaluation 172.8±7.62µs 168.7±1.35µs -2.37%
Array update evaluation 415.3±2.08µs 427.5±3.72µs +2.94%
Core + Standard library compilation 21.7±0.17ms 25.4±0.66ms +17.05%
Deutsch-Jozsa evaluation 4.9±0.06ms 4.9±0.06ms 0.00%
Large file parity evaluation 34.2±0.11ms 34.4±0.75ms +0.58%
Large input file compilation 13.5±0.31ms 15.2±0.43ms +12.59%
Large input file compilation (interpreter) 50.3±0.94ms 57.8±1.53ms +14.91%
Large nested iteration 32.7±0.25ms 33.8±1.51ms +3.36%
Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample 1558.5±29.71µs 1587.1±106.71µs +1.84%
Perform Runtime Capabilities Analysis (RCA) on large file sample 8.0±0.22ms 7.9±0.11ms -1.25%
Perform Runtime Capabilities Analysis (RCA) on teleport sample 1419.5±33.72µs 1464.6±91.99µs +3.18%
Perform Runtime Capabilities Analysis (RCA) on the core and std libraries 27.6±0.19ms 28.5±0.73ms +3.26%
Teleport evaluation 93.2±6.64µs 94.2±4.19µs +1.07%

samples/language/CopyAndUpdateOperator.qs Show resolved Hide resolved
samples/language/Unit.qs Outdated Show resolved Hide resolved
samples/language/Variables.qs Outdated Show resolved Hide resolved
sezna and others added 3 commits August 20, 2024 12:35
Co-authored-by: Mariia Mykhailova <mamykhai@microsoft.com>
Co-authored-by: Mariia Mykhailova <mamykhai@microsoft.com>
Co-authored-by: Mariia Mykhailova <mamykhai@microsoft.com>
Copy link

Change in memory usage detected by benchmark.

Memory Report for 0c4fa96

Test This Branch On Main Difference
compile core + standard lib 18002928 bytes 18000952 bytes 1976 bytes

Copy link

Change in memory usage detected by benchmark.

Memory Report for 410022e

Test This Branch On Main Difference
compile core + standard lib 18002928 bytes 18000952 bytes 1976 bytes

Copy link

Change in memory usage detected by benchmark.

Memory Report for f194515

Test This Branch On Main Difference
compile core + standard lib 18002928 bytes 18000952 bytes 1976 bytes

Copy link

Benchmark for 410022e

Click to view benchmark
Test Base PR %
Array append evaluation 337.6±12.91µs 338.8±16.23µs +0.36%
Array literal evaluation 186.1±1.75µs 186.1±2.64µs 0.00%
Array update evaluation 414.2±2.42µs 416.8±1.92µs +0.63%
Core + Standard library compilation 21.9±0.35ms 22.1±0.61ms +0.91%
Deutsch-Jozsa evaluation 5.0±0.09ms 4.9±0.05ms -2.00%
Large file parity evaluation 34.3±0.10ms 34.5±1.28ms +0.58%
Large input file compilation 13.8±0.18ms 13.8±0.28ms 0.00%
Large input file compilation (interpreter) 52.5±1.50ms 51.5±1.28ms -1.90%
Large nested iteration 32.6±0.32ms 33.0±0.22ms +1.23%
Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample 1565.2±31.36µs 1566.9±36.17µs +0.11%
Perform Runtime Capabilities Analysis (RCA) on large file sample 7.9±0.41ms 7.9±0.08ms 0.00%
Perform Runtime Capabilities Analysis (RCA) on teleport sample 1438.6±54.56µs 1427.4±30.23µs -0.78%
Perform Runtime Capabilities Analysis (RCA) on the core and std libraries 28.1±0.23ms 27.7±0.31ms -1.42%
Teleport evaluation 93.2±4.11µs 94.3±6.77µs +1.18%

Copy link

Benchmark for 0c4fa96

Click to view benchmark
Test Base PR %
Array append evaluation 337.9±1.68µs 336.3±1.50µs -0.47%
Array literal evaluation 169.5±0.94µs 168.5±0.91µs -0.59%
Array update evaluation 416.0±3.07µs 415.9±2.22µs -0.02%
Core + Standard library compilation 24.7±1.12ms 24.8±1.24ms +0.40%
Deutsch-Jozsa evaluation 4.9±0.06ms 4.9±0.06ms 0.00%
Large file parity evaluation 34.4±0.10ms 34.4±0.36ms 0.00%
Large input file compilation 15.4±0.60ms 15.2±0.58ms -1.30%
Large input file compilation (interpreter) 57.3±3.05ms 55.6±1.61ms -2.97%
Large nested iteration 32.8±0.26ms 33.0±1.64ms +0.61%
Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample 1610.3±120.68µs 1592.6±156.14µs -1.10%
Perform Runtime Capabilities Analysis (RCA) on large file sample 8.1±0.17ms 8.1±0.18ms 0.00%
Perform Runtime Capabilities Analysis (RCA) on teleport sample 1475.2±181.13µs 1475.8±115.50µs +0.04%
Perform Runtime Capabilities Analysis (RCA) on the core and std libraries 28.7±0.39ms 28.2±0.34ms -1.74%
Teleport evaluation 94.4±4.93µs 95.1±3.78µs +0.74%

Copy link

Benchmark for f194515

Click to view benchmark
Test Base PR %
Array append evaluation 338.3±2.65µs 337.1±2.32µs -0.35%
Array literal evaluation 170.1±6.06µs 169.4±1.12µs -0.41%
Array update evaluation 415.4±2.67µs 416.4±2.37µs +0.24%
Core + Standard library compilation 24.0±0.58ms 25.1±0.87ms +4.58%
Deutsch-Jozsa evaluation 5.0±0.05ms 4.9±0.08ms -2.00%
Large file parity evaluation 34.3±0.12ms 34.3±0.32ms 0.00%
Large input file compilation 15.2±0.39ms 15.7±0.72ms +3.29%
Large input file compilation (interpreter) 57.1±1.95ms 56.9±1.82ms -0.35%
Large nested iteration 32.7±0.25ms 33.3±1.92ms +1.83%
Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample 1631.0±159.52µs 1628.5±165.02µs -0.15%
Perform Runtime Capabilities Analysis (RCA) on large file sample 8.4±0.18ms 8.3±0.12ms -1.19%
Perform Runtime Capabilities Analysis (RCA) on teleport sample 1495.7±161.87µs 1484.5±165.11µs -0.75%
Perform Runtime Capabilities Analysis (RCA) on the core and std libraries 28.8±1.34ms 29.0±1.18ms +0.69%
Teleport evaluation 94.7±8.09µs 94.9±5.99µs +0.21%

Copy link

Change in memory usage detected by benchmark.

Memory Report for 79d76c9

Test This Branch On Main Difference
compile core + standard lib 18002928 bytes 18000952 bytes 1976 bytes

Copy link

Benchmark for 79d76c9

Click to view benchmark
Test Base PR %
Array append evaluation 338.4±10.14µs 336.9±3.12µs -0.44%
Array literal evaluation 185.6±0.63µs 185.7±0.64µs +0.05%
Array update evaluation 417.1±2.68µs 414.5±3.44µs -0.62%
Core + Standard library compilation 22.7±0.82ms 22.6±1.09ms -0.44%
Deutsch-Jozsa evaluation 5.0±0.09ms 4.9±0.06ms -2.00%
Large file parity evaluation 34.6±0.16ms 34.4±0.25ms -0.58%
Large input file compilation 14.3±0.60ms 14.0±0.32ms -2.10%
Large input file compilation (interpreter) 55.3±2.46ms 54.9±3.01ms -0.72%
Large nested iteration 32.8±0.92ms 32.7±0.19ms -0.30%
Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample 1563.4±34.52µs 1577.1±62.22µs +0.88%
Perform Runtime Capabilities Analysis (RCA) on large file sample 8.0±0.13ms 8.0±0.17ms 0.00%
Perform Runtime Capabilities Analysis (RCA) on teleport sample 1436.9±59.90µs 1428.5±36.22µs -0.58%
Perform Runtime Capabilities Analysis (RCA) on the core and std libraries 27.9±0.34ms 28.0±0.94ms +0.36%
Teleport evaluation 93.4±3.38µs 93.2±3.36µs -0.21%

@sezna sezna enabled auto-merge August 26, 2024 21:12
Copy link

Change in memory usage detected by benchmark.

Memory Report for ad53ab2

Test This Branch On Main Difference
compile core + standard lib 18002928 bytes 18000952 bytes 1976 bytes

@sezna sezna added this pull request to the merge queue Aug 26, 2024
Merged via the queue into main with commit ce8303b Aug 26, 2024
18 checks passed
@sezna sezna deleted the alex/update-samples branch August 26, 2024 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Question] Samples CI, location and redundancy
6 participants