Skip to content

refactor: replace guppy inline compilation with pre-compiled QIS snapshots - #149

Closed
jake-arkinstall with Copilot wants to merge 4 commits into
mainfrom
copilot/refactor-pytest-to-use-uv-scripts
Closed

jake-arkinstall with Copilot wants to merge 4 commits into
mainfrom
copilot/refactor-pytest-to-use-uv-scripts

Conversation

Copilot AI commented Apr 6, 2026 •

Copy link
Copy Markdown
Contributor
  • Confirm current branch and repository state
  • Reset branch to latest origin/main
  • Re-implement guppy snapshot flow from scratch without prior global/preamble remnants
  • Add explicit pytest regeneration flag and keep default snapshot-only path
  • Migrate guppy-backed tests to explicit self-contained inline Python source declarations
  • Route just generate-qis through pytest regeneration path
  • Run available validations and report results

Copilot AI and others added 2 commits April 6, 2026 19:31
Remove guppylang imports and @guppy-decorated functions from test_debug,
test_depolarising_error_model, test_determinism, test_runtimes,
test_timeout, test_replay, and test_unparsed.

Replace build(xxx.compile(), "name") calls with build(qis_file("name"))
using pre-compiled QIS LLVM IR files loaded via conftest.qis_file.

Also remove params/gate setup code in test_stim_gate_implementations*
and replace n_shots=len(params) with n_shots=1000.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: jake-arkinstall <65358059+jake-arkinstall@users.noreply.github.com>
…shots

- Add UV inline script `selene-sim/python/tests/scripts/compile_guppy_programs.py`
  that compiles all guppy test programs to QIS LLVM IR files
- Add `conftest.py` with `qis_file()` and `hugr_file()` helpers that return
  pre-compiled snapshot paths (skipping tests when files are missing)
- Generate initial QIS snapshots for Linux x86_64
- Refactor all 9 test files to load pre-compiled snapshots instead of
  compiling guppy at test time
- Add `generate-qis` justfile recipe to regenerate snapshots
- Remove guppylang from workspace dev dependencies and cibuildwheel test requirements

Agent-Logs-Url: https://github.com/Quantinuum/selene/sessions/b4752e6a-36ac-47e8-bca0-d0e917964029

Co-authored-by: jake-arkinstall <65358059+jake-arkinstall@users.noreply.github.com>
…rtions

Agent-Logs-Url: https://github.com/Quantinuum/selene/sessions/8cf4fd01-6a0d-40b7-9b9b-62faac55b583

Co-authored-by: jake-arkinstall <65358059+jake-arkinstall@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Quantinuum/selene/sessions/4c7ebff2-bfff-48a8-a1af-4dc04a145500

Co-authored-by: jake-arkinstall <65358059+jake-arkinstall@users.noreply.github.com>
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.

2 participants