Skip to content

Conversation

@doug-q
Copy link
Contributor

@doug-q doug-q commented Oct 2, 2025

Closes #1283

@doug-q doug-q requested a review from jake-arkinstall October 2, 2025 13:27
@doug-q doug-q requested a review from a team as a code owner October 2, 2025 13:27
@doug-q doug-q requested a review from croyzor October 2, 2025 13:27
@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2025

🐰 Bencher Report

Branchdoug/selene-gpy-py
TestbedLinux

🚨 1 Alert

BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Upper Boundary
(Limit %)
tests/benchmarks/test_big_array.py::test_big_array_executableLatency
seconds (s)
📈 plot
🚷 threshold
🚨 alert (🔔)
9.72 s
(+5.30%)Baseline: 9.23 s
9.69 s
(100.29%)

Click to view all benchmark results
BenchmarkLatencyBenchmark Result
microseconds (µs)
(Result Δ%)
Upper Boundary
microseconds (µs)
(Limit %)
tests/benchmarks/test_big_array.py::test_big_array_check📈 view plot
🚷 view threshold
671,442.40 µs
(-11.96%)Baseline: 762,670.38 µs
800,803.90 µs
(83.85%)
tests/benchmarks/test_big_array.py::test_big_array_compile📈 view plot
🚷 view threshold
3,346,958.75 µs
(+3.56%)Baseline: 3,231,990.16 µs
3,393,589.67 µs
(98.63%)
tests/benchmarks/test_big_array.py::test_big_array_executable📈 view plot
🚷 view threshold
🚨 view alert (🔔)
9,716,888.13 µs
(+5.30%)Baseline: 9,227,721.80 µs
9,689,107.89 µs
(100.29%)

tests/benchmarks/test_ctrl_flow.py::test_many_ctrl_flow_check📈 view plot
🚷 view threshold
52,825.63 µs
(-12.48%)Baseline: 60,358.10 µs
63,376.01 µs
(83.35%)
tests/benchmarks/test_ctrl_flow.py::test_many_ctrl_flow_compile📈 view plot
🚷 view threshold
97,035.78 µs
(-3.78%)Baseline: 100,848.42 µs
105,890.84 µs
(91.64%)
tests/benchmarks/test_ctrl_flow.py::test_many_ctrl_flow_executable📈 view plot
🚷 view threshold
701,116.41 µs
(-13.84%)Baseline: 813,756.30 µs
854,444.12 µs
(82.06%)
tests/benchmarks/test_prelude.py::test_import_guppy📈 view plot
🚷 view threshold
24.38 µs
(-8.73%)Baseline: 26.71 µs
28.04 µs
(86.92%)
🐰 View full continuous benchmarking report in Bencher

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 89.28571% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.49%. Comparing base (f830db0) to head (06aa0c1).

Files with missing lines Patch % Lines
guppylang/src/guppylang/selene_plugin.py 89.28% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1284      +/-   ##
==========================================
- Coverage   93.50%   93.49%   -0.02%     
==========================================
  Files         121      122       +1     
  Lines       11220    11248      +28     
==========================================
+ Hits        10491    10516      +25     
- Misses        729      732       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jake-arkinstall
Copy link
Contributor

Two thoughts:

  • Is a .gpy.py file defined as one with the print of the hugr at the end, or just one with a main function? It'd be interesting to try importing main from it and compiling, but it might get interesting with import paths and modules etc.

  • Additionally it would be interesting (IMO) to add a build step for transforminf a GuppyFunctionDefinition to a HUGR such that one could build(main) without the .compile()

@doug-q
Copy link
Contributor Author

doug-q commented Oct 2, 2025

Two thoughts:

  • Is a .gpy.py file defined as one with the print of the hugr at the end, or just one with a main function? It'd be interesting to try importing main from it and compiling, but it might get interesting with import paths and modules etc.

The former. I agree it would be interesting, but "eval"ing a python file and executing it in a subprocess are pretty different. The latter is much more reliable.

  • Additionally it would be interesting (IMO) to add a build step for transforminf a GuppyFunctionDefinition to a HUGR such that one could build(main) without the .compile()

I think this would also require "eval".

This case, of the file being a program that emits a hugr, is of interest to me because we have many test programs that match this.

@ss2165
Copy link
Member

ss2165 commented Oct 2, 2025

Thoughts:

  1. Agree that avoiding the user having to include the sys.stdout line would be nice
  2. The natural interface to this feels like a cli to me:
gpy emulate prog.gpy.py --n-shots=10 --res-file=results.json
gpy compile prog.gpy.py | hugr validate

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.

Add a selene plugin allowing selene to consume *.gpy.py files

5 participants