Skip to content

fix: ensure pragma extern maps are copied #1819

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

Merged
merged 13 commits into from
Feb 26, 2025

Conversation

erichulburd
Copy link
Contributor

@erichulburd erichulburd commented Feb 19, 2025

Description

This PR essentially ensures that quil's Program.extern_pragma_map is properly handled in pyQuil: https://github.com/rigetti/quil-rs/blob/53ce859d61a86383c4d98dcd4033d9cd375a5937/quil-rs/src/program/mod.rs#L86

Namely, those pragma instructions should be copied when appropriate.


Also, there's quite a bit of CI tire kicking here: I've added pip install --upgrade pip in a few different places, added the condition marks mentioned above, bumped python in the docker image to 3.10, updated poetry to 1.8.5, and used poetry to build the wheel in CI rather than pip.


Checklist

  • The PR targets the master branch
  • The above description motivates these changes.
  • The change is atomic and can be described by a single commit (your PR will be squashed on merge).
  • All changes to code are covered via unit tests.
  • Parameters and return values have type hints with PEP 484 syntax.
  • Functions and classes have useful Sphinx-style docstrings.
  • (New Feature) The docs have been updated accordingly.
  • (Bugfix) The associated issue is referenced above using auto-close keywords.

@erichulburd erichulburd requested a review from a team as a code owner February 19, 2025 00:15
@erichulburd erichulburd force-pushed the support_extern_call_instructions branch from 6513e71 to e44c89e Compare February 19, 2025 00:25
@erichulburd erichulburd force-pushed the support_extern_call_instructions branch from e44c89e to f25dd7d Compare February 19, 2025 17:28
Copy link

github-actions bot commented Feb 19, 2025

🐰 Bencher Report

Branchsupport_extern_call_instructions
Testbedci-runner-linux

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencyseconds (s)
test/benchmarks/test_program.py::test_copy_everything_except_instructions📈 view plot
⚠️ NO THRESHOLD
10.97 s
test/benchmarks/test_program.py::test_instructions📈 view plot
⚠️ NO THRESHOLD
4.06 s
test/benchmarks/test_program.py::test_iteration📈 view plot
⚠️ NO THRESHOLD
4.33 s
🐰 View full continuous benchmarking report in Bencher

Copy link

github-actions bot commented Feb 19, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
7322 6434 88% 87% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
pyquil/quil.py 84% 🟢
pyquil/quilbase.py 94% 🟢
TOTAL 89% 🟢

updated for commit: 3385518 by action🐍

@erichulburd erichulburd force-pushed the support_extern_call_instructions branch from 2daf801 to 5a291ea Compare February 19, 2025 19:05
Copy link

@antalsz antalsz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The quil-rs contentful changes look good to me, but somebody with a better understanding of Python and/or CI needs to review the CI changes.

Copy link
Contributor

@jselig-rigetti jselig-rigetti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far - do you think you could add some tests cases to https://github.com/rigetti/pyquil/blob/master/test/unit/test_quilbase.py to ensure that data roundtripping (from rust) and pickling work as expected?

@erichulburd erichulburd force-pushed the support_extern_call_instructions branch from c11addf to 3385518 Compare February 25, 2025 16:48
@erichulburd
Copy link
Contributor Author

@jselig-rigetti Thanks for the review. I've addressed all of your comments.

@erichulburd erichulburd merged commit 7d6f706 into master Feb 26, 2025
22 checks passed
@erichulburd erichulburd deleted the support_extern_call_instructions branch February 26, 2025 16:50
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.

3 participants