Skip to content

✨ Add support for opening existing jobs - #485

Open
burgholzer wants to merge 12 commits into
developfrom
agent/qdmi-01-open-job
Open

✨ Add support for opening existing jobs#485
burgholzer wants to merge 12 commits into
developfrom
agent/qdmi-01-open-job

Conversation

@burgholzer

@burgholzer burgholzer commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖

Description

Adds job reopening for the next patch release (1.3.3). Clients can obtain a fresh local handle for a previously submitted job from its opaque QDMI job ID. Opening uses the current session credentials and does not clone, submit, or modify the remote job.

The device interface and generated prefix definitions expose the corresponding provider symbol. The example device and generated device template export it and return QDMI_ERROR_NOTSUPPORTED by default. Drivers remain ABI-compatible with provider libraries built against older QDMI releases: an absent symbol is treated as unsupported.

Validation

  • Debug build and all 103 CTest tests passed, with the expected read-only skips.
  • Generated-device symbol checks and template builds passed.
  • uvx prek run --all-files passed.
  • git diff --check passed.

Assisted-by: GPT-5.6 via Codex
Assisted-by: GPT-5.6 via Codex
Assisted-by: GPT-5.6 via Codex
Assisted-by: GPT-5.6 via Codex
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://Munich-Quantum-Software-Stack.github.io/QDMI/pr-preview/pr-485/

Built to branch gh-pages at 2026-08-06 09:38 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@            Coverage Diff            @@
##           develop    #485     +/-   ##
=========================================
+ Coverage     90.3%   90.5%   +0.1%     
=========================================
  Files            6       6             
  Lines          734     749     +15     
  Branches       142     146      +4     
=========================================
+ Hits           663     678     +15     
  Misses          71      71             
Flag Coverage Δ
cpp 90.5% <100.0%> (+0.1%) ⬆️
Files with missing lines Coverage Δ
examples/device/src/cxx_device.cpp 94.0% <100.0%> (+<0.1%) ⬆️
examples/driver/qdmi_example_driver.cpp 93.4% <100.0%> (+0.4%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Assisted-by: GPT-5.6 via Codex
Assisted-by: GPT-5.6 via Codex
Assisted-by: GPT-5.6 via Codex
Assisted-by: GPT-5.6 via Codex
@burgholzer burgholzer added this to the v1.3.3 milestone Aug 5, 2026
@burgholzer burgholzer self-assigned this Aug 5, 2026
@burgholzer burgholzer added the feature New feature or feature request label Aug 5, 2026
Keep the source-level provider contract explicit while preserving runtime
compatibility with older provider binaries.

Assisted-by: GPT-5.6 via Codex
Name the default provider parameters and exclude only compatibility and
positive-provider paths that deliberately have no in-tree fixture.

Assisted-by: GPT-5.6 via Codex

@burgholzer burgholzer left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Two small corrections.

Comment thread include/qdmi/device.h Outdated
Comment thread templates/device/src/my_device.cpp Outdated
Co-authored-by: Lukas Burgholzer <burgholzer@me.com>
Signed-off-by: Lukas Burgholzer <burgholzer@me.com>
@burgholzer
burgholzer requested a review from ystade August 6, 2026 09:37
@burgholzer
burgholzer marked this pull request as ready for review August 6, 2026 09:37

@ystade ystade left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@burgholzer Definitely a functionailty that is needed (and also implemented in QDMIv2). Overall, the modifications look good to me. I just have a comment on naming, see the comments.

Comment thread include/qdmi/client.h Outdated
Comment thread include/qdmi/client.h
Comment thread include/qdmi/device.h Outdated
Comment thread include/qdmi/device.h
Comment thread include/qdmi/client.h
* @return @ref QDMI_ERROR_FATAL if opening the job failed due to a fatal
* error.
*/
int QDMI_device_open_job(QDMI_Device device, const char *job_id, QDMI_Job *job);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This kind of function also exists in V2 but under another name, see

typedef int QDMI_session_retrieve_job_by_id(QDMI_Session session,

I actually like the other name more because it is more specific, and the user knows immediately what the function is doing and which parameters it needs. If changed, these changes must also be reflected in the docstrings.

Suggested change
int QDMI_device_open_job(QDMI_Device device, const char *job_id, QDMI_Job *job);
int QDMI_session_retrieve_job_by_id(QDMI_Device device, const char *job_id, QDMI_Job *job);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I like the other name. Will incorporate that consistently in the next revision!
Thanks for the suggestion!

Comment thread include/qdmi/device.h
* @param[out] job A pointer to a handle that will store the opened job. Must
* not be @c NULL. The handle must be freed by calling @ref
* QDMI_device_job_free when it is no longer used. Freeing the handle does not
* cancel or delete the remote job.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Very minor: Not sure whether I would mention this here so explicitly. Some device implementations may indeed delete a job when it is freed. These device implementations obviously do not support retrieving the job by id again.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hm. I see the point, which is fairly nuanced.
Devices that want to support retrieval (and implement the new function) must not delete jobs upon freeing from QDMI.
Devices that do not support persistent jobs can do what they want.
Any idea for how to make the wording better here? I can also ask Codex on this.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What about

Suggested change
* cancel or delete the remote job.
* necessarily cancel or delete the remote job.

?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah. That would work, but now that I think about it a little more deeply, this sentence (no matter how it is worded) does not even really belong here. If at all, it belongs to the QDMI_device_job_free method to describe its semantics. I'll revisit this in my revision.

Co-authored-by: Yannick Stade <100073938+ystade@users.noreply.github.com>
Signed-off-by: Lukas Burgholzer <burgholzer@me.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants