feat!: added shots arg to run_async - #99
Draft
jasonhan3 wants to merge 4 commits into
Draft
Conversation
Contributor
|
Contributor
☂️ Code Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
jasonhan3
marked this pull request as draft
August 11, 2026 15:32
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.
closes https://github.com/QuEraComputing/bloqade-internal/issues/398
Nonbreaking change to pass in "shots" argument to "run_async".
BREAKING CHANGES
Summary
Move shot-count configuration from task creation to execution. Tasks no longer
store shot counts;
run_async()supplies them when it builds the QLAM taskdefinition.
TaskABC.run_async()now defaults to a one-shot dry run.shots: int | list[int] = 1controls the QLAM subtask counts.subtask.
num_shotsvalue.Breaking changes
Task factories no longer accept
num_shotsRemove
num_shotsfrom all task factories:Device.task(...)Device.batch_task(...)Device.parameter_scan(...)Before:
After:
For per-subtask counts, pass a list when running:
Task objects no longer store shot counts
SingleKernelTask,KernelBatchTask, andParameterScanTaskno longer havea
num_shotsfield, andTaskABC.get_num_shots()has been removed. Code thatreads or mutates those fields must instead provide
shotstorun_async()ornum_shotstocreate_task_definition().run_async()now defaults to a dry run and one shotThe new signature is:
Consequences:
task.run_async()now prints a one-shot dry-run summary and returnsNone.dry_run=False.task.run_async(dry_run=False)submits one shot per subtask unlessshotsis explicitly supplied.
shots=Noneis no longer supported.create_task_definition()requiresnum_shotsThe new signature is:
Custom
TaskABCsubclasses that override this method must update theiroverride to accept and use that keyword argument.
Implementation details
Subtaskis created with a concrete shot count.and raise a clear
ValueErrorwhen lengths differ.the default of one shot.
Testing
uv run pytest— 262 passeduv run ruff check .uv run pyrightuv run just coverage— 95% total coverage