Skip to content

feat: Record simulated delays in event hooks#154

Merged
jake-arkinstall merged 2 commits intomainfrom
feat/add-delay-item-to-circuit-extractor
Apr 13, 2026
Merged

feat: Record simulated delays in event hooks#154
jake-arkinstall merged 2 commits intomainfrom
feat/add-delay-item-to-circuit-extractor

Conversation

@jake-arkinstall
Copy link
Copy Markdown
Collaborator

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

Copilot AI review requested due to automatic review settings April 13, 2026 11:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread selene-sim/rust/emulator.rs Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jake-arkinstall jake-arkinstall merged commit 608884a into main Apr 13, 2026
10 checks passed
@jake-arkinstall jake-arkinstall deleted the feat/add-delay-item-to-circuit-extractor branch April 13, 2026 13:32
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).
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 explicit "simulated delay" blocks in user program output in CircuitExtractor

2 participants