Skip to content

feat(qsearch): packed v2 requests, live ibm_fez context, device compile, provider limits (HW0 N1-N4) - #49

Merged
AetherAI3 merged 3 commits into
mainfrom
claude/qcomms-hw0-nano
Nov 1, 2026
Merged

AetherAI3 merged 3 commits into
mainfrom
claude/qcomms-hw0-nano

Conversation

@AetherAI3

@AetherAI3 AetherAI3 commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Prepares Nano's part of the HW0 route (contract PREDATOR_QCOMMS_HW0_PACKED_PILOT_V1 §3) so one packed IBM request can later be submitted, verified and recovered end to end. Everything new is off by default, and no QPU run happened.

What changed and why

  • N1, live context (gap 1). On a PredatorCampaignV2 ledger, atlas_campaign_submit and the request path get their ibm_fez context from ATLAS resolve_qsearch_context (service, instance, live backend) instead of SimpleNamespace(backend_name=...). The context is resolved once, before compiling. A V1 ledger behaves as before: the declared context, then BLOCKED.
  • N2, device compile (gap 3). compile_program(job, backend=...) transpiles ibm_fez against the live backend's Target, not FakeFez. It then checks every ISA instruction against that target and binds the backend name plus a target digest into the ISA metadata (and so the QPY bytes) and into compiled_plan_digest. A plan bound to any other target is refused before submission. fake_fez and heron are untouched: their plan digests are byte-identical to d740bb5.
  • N3, provider limit. A child's max_execution_time is the job's limits.max_qpu_s. That sets both the provider limit and the ledger reservation.
  • N4, POST /qsearch/v2/submit_request (S2).
    • Answers only when NANO_QSEARCH_V2=1. Otherwise it returns 404 NOT_ENABLED before auth, so no nonce is burned.
    • Uses the v1 request auth.
    • Cross-checks the descriptor against every job, compiles each job, and makes one ATLAS request call (run_qsearch_request_dry for fake_fez, submit_qsearch_request for ibm_fez).
    • Seals a predator.qsearch.receipt.v2: per-block raw msb_first counts and a v1-style audit, plus hardware and usage.
    • A request is recorded before submission and submitted at most once. A repeated digest returns the stored receipt. On restart the request is re-attached through recover_qsearch_submission.
    • Anything short of every block is NOT_RUN with blocks: [].
  • runtime_ibm.prepare_request_identity computes the request_sha256 that the operator's plan-scoped authority must name. That value is only known after compiling against the live target.

Test evidence (laptop, py -3.12, ATLAS-hw0 at d4b2b57 on NANO_QSEARCH_ATLAS_PATH)

  • 87 new tests (86 run by default plus the opt-in FakeFez run) across test_qsearch_v2_{request,runtime,service}.py (fake ATLAS module), test_qsearch_compile_device.py, test_qsearch_hw0_atlas.py (real ATLAS with a fake service and sampler) and test_qsearch_v2_predator.py. They include:
    • restart recovery after submission, and after a crash before attach_job (by tag); the sampler ran once;
    • effective max_execution_time 5 and 10 plus job_tags reaching the sampler, with the reservation equal to the limit;
    • zero usage held as pending, never treated as free;
    • a tripwire test (real SamplerV2 and QiskitRuntimeService patched to raise) proving that a missing GO, LIVE, PACKED or NANO_QSEARCH_V2 each blocks.
  • Seal parity: Nano receipts (OK, NOT_RUN, fake_fez and ibm_fez) verify under Predator's production verify_qsearch_receipt (PR AetherAI3/AETHER-PREDATOR-M#450). Predator's own NanoRuntimeQSearchBackend.submit_request round-trips over loopback. Tampered, reordered, dropped, duplicated and v1/v2-confused receipts are refused.
  • One real packed FakeFez dry run on Aer (3 PUBs × 16 shots) passed when run alone. It is opt-in via NANO_QSEARCH_FAKEFEZ_DRY_RUN=1; inside the loaded full suite Aer hit MemoryError and the receipt was, correctly, NOT_RUN.
  • Full suite: 1572 passed, 8 failed, 4 skipped.
    • 7 of the failures are test_provenance.py (the sibling aether_protocol_c rejects float canonicalisation). They fail identically on base d740bb5.
    • The 8th was the FakeFez run above, now opt-in.
    • Existing v1 tests are unchanged and pass.

Amendment R3 (pre-flight review), commit 64203b2

  • H1: once ATLAS has handed a request or job to the provider (QSearchSubmittedPending, or a ledger row with a job id or an ambiguous submission), Nano never seals NOT_RUN. It answers 503, keeps the row accepted, and finishes through recover_qsearch_submission.
  • FAILED status: a provider ERROR, CANCELLED or max-time outcome, or a submitted result that does not audit, is sealed as v2 FAILED (no blocks, reason, provider job id, usage, hardware seal).
  • v1 singletons: a submitted job answers 503 until recovery. On a repeat or restart, recover_job re-attaches it through ATLAS (L1).
  • M3: GO, LIVE and (for packed requests) PACKED are checked in Nano before any live context is resolved.
  • client_request_digest is now passed to ATLAS, and hardware.job_tags carries ATLAS's effective tags.
  • Tests: 20 new (15 against a fake ATLAS module; 3 against real ATLAS 1fc4200: provider ERROR becomes FAILED, an ambiguous submission stays pending until released, a definite refusal is NOT_RUN). The 8 Predator parity tests pass against 4fe16725, including FAILED and Predator's client seeing QSEARCH_PENDING then FAILED. Full suite: 1590 passed, 5 skipped, and 7 failures, all the test_provenance.py failures that also fail on d740bb5.

No QPU run happened; NANO_QSEARCH_V2 default off.

🤖 Generated with Claude Code

Verified integration disposition

This exact source head 64203b2724bc1f514d3831e7338f1a71782b5af7 is an ancestor of actual integration commit cb6ea884d63dcaa8cc0e7c0b952bb88784e8219f, delivered by #82 to main. The source is included; no duplicate patch or separate source-PR merge is needed.

The human explicitly authorized the three integration PRs Nano82/ATLAS188/Predator460 to use reviewed passing LOCAL evidence in place of the earlier self-hosted gate. The waiver is recorded verbatim in those merged integration PR bodies; it is not a passing CI claim or a separate waiver-based admin merge of this source PR. Cloud41322926091 remains FAILED STARTUP with zero jobs/check runs. Local source pins, commands, counts, skips, review limitations, merged trees and actual target branches are recorded there and in the captain evidence bundle.

This source PR is retired as included/superseded by that actual integration. Issue #61 remains open for incomplete service-wire acceptance; other issue closure requires its own acceptance audit. Branches are preserved. No formal GitHub approval, production activation, runner/security/credential change or provider execution occurred.

AetherAI3 and others added 3 commits October 31, 2026 07:45
…rget (HW0 N2)

compile_program(job, backend=...) transpiles an ibm_fez job against the live
backend's Target (coupling map and supported instructions) instead of FakeFez,
checks every ISA instruction against that target, and freezes it: the backend
name and a structural target digest ride in the ISA metadata (so the QPY bytes
bind them), in compile_record and in compiled_plan_digest. The device ISA gets
a fixed name so an identical recompile yields the same ATLAS child identity.
fake_fez and heron_heavy_hex compile exactly as before (plan digests verified
byte-identical to d740bb5); one compile path, target source chosen by target.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ext and provider limits (HW0 N1, N3, N4)

N1: on a PredatorCampaignV2 ledger the ibm_fez context is ATLAS
resolve_qsearch_context (service, instance, backend), resolved once per run
before compiling, and the compiled plan must be bound to that backend's target;
a V1 ledger keeps the declared-identity context and stops BLOCKED as before.
N3: the child's max_execution_time is the job's limits.max_qpu_s, so the
provider limit and the ledger reservation are the job's ceiling.
N4: POST /qsearch/v2/submit_request answers only with NANO_QSEARCH_V2=1 (404
NOT_ENABLED before auth otherwise), uses the v1 request auth, cross-checks the
descriptor against every job, compiles each job, prepares one ATLAS request and
runs it once (run_qsearch_request_dry / submit_qsearch_request). The receipt is
predator.qsearch.receipt.v2: per-block raw msb_first counts plus the v1-style
audit, hardware and usage blocks, sealed under the v2 hardware domain; anything
short of every block is NOT_RUN with no blocks. Requests are recorded before
submission, submitted at most once, and re-attached on restart through ATLAS
recover_qsearch_submission. Seal parity is tested against Predator's production
verifier and client when importable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tatus, flags before live context

H1: once ATLAS has handed a request or job to the provider (QSearchSubmittedPending,
or a ledger row with a job id or an ambiguous submission) Nano never seals NOT_RUN:
the runtime returns None, the service answers 503 and keeps the row ACCEPTED, and
the request finishes through recover_qsearch_submission. A provider-terminal failure
(ERROR / CANCELLED / max time) or a submitted result that does not audit is sealed as
v2 FAILED (blocks [], block_count 0, reason, hardware with the provider job id, usage;
hardware seal), matching Predator's build_failed_v2. A reservation ATLAS released is
NOT_RUN. v1 singletons: a submitted job answers 503 until recovery (L1: recover_job
re-attaches through ATLAS on repeat or restart, recompiling against the live target
and requiring the child's compiled plan digest); a provider failure is REFUSED.
M3: GO, LIVE and (N > 1) PACKED are checked in Nano before any live context is
resolved, so no QiskitRuntimeService is built when one is missing.
Also: prepare_qsearch_request gets client_request_digest; hardware.job_tags carry
ATLAS's effective tags (recovery tag first, ledger tag second); a FAILED reason names
the provider status only, never provider free text.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

1 participant