feat: Record simulated delays in event hooks#154
Merged
jake-arkinstall merged 2 commits intomainfrom Apr 13, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds explicit logging of simulated (classical) delays to the instruction/event hook stream so downstream consumers (e.g., CircuitExtractor) can observe and analyze delays directly rather than inferring them from timing.
Changes:
- Introduces a new event hook operation variant for simulated delays (
ClassicalDelay). - Extends instruction log serialization/deserialization (Rust encoder + Python parser) to support the new operation.
- Updates the QIS Python test to assert the delay is present in the extracted instruction stream.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| selene-sim/rust/event_hooks.rs | Adds Operation::ClassicalDelay(u64) to the shared event-hook operation enum. |
| selene-sim/rust/event_hooks/instruction_log.rs | Serializes ClassicalDelay into the instruction log with a new operation index. |
| selene-sim/rust/emulator.rs | Emits a ClassicalDelay user-call hook during simulate_delay. |
| selene-sim/python/selene_sim/event_hooks/instruction_log.py | Adds Python-side ClassicalDelay operation and parses the new operation index. |
| selene-sim/python/tests/test_qis.py | Extends test_simulate_delay to assert the delay appears explicitly in CircuitExtractor output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
jake-arkinstall
pushed a commit
that referenced
this pull request
Apr 21, 2026
🤖 I have created a release *beep* *boop* --- ## [0.2.14](selene-sim-v0.2.13...selene-sim-v0.2.14) (2026-04-21) ### Features * add timing to builtin runtimes and batching options to softrz runtime ([#158](#158)) ([049e123](049e123)) * Record simulated delays in event hooks ([#154](#154)) ([608884a](608884a)) * Traces for analytics ([#160](#160)) ([24b9978](24b9978)) ### Bug Fixes * classify lowered qir-qis bitcode as helios ([#157](#157)) ([67fca60](67fca60)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Although simulated delays' impacts can be seen indirectly through timing information, we should record them explicitly in event hooks so that users can use the information however they see fit, e.g. statistical analyses of simulated delays in a program run.
closes #153