Repository navigation
feat(quantum): native prepare/sample bridge through prepared artifact and opt-in local service - #98
Merged
Merged
Conversation
Add stdlib-only records for the native prepare_bits/sample bridge: a local_ideal-only target, a pinned compile profile, the ordered PUB map with register/bit offsets and recipient/chunk/slot, declared resources, the request descriptor and a frozen capability matrix. Unknown versions fail with UNSUPPORTED_VERSION; optimize_qubo, hardware targets, wrong compiler or SDK pins are refused with stable codes. Structural JSON Schemas, fixtures and digest goldens freeze the contract before any adapter work. Part of #61. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Admit a checked native plan and build its pinned Qiskit 2.3.1 circuits directly (X per declared bit, measure q[i] into register[i]) with no QUBO or QAOA fields. The artifact binds plan, PUB map, profile, target, layout, per-PUB QPY digests and resources; circuit metadata binds the same identity. Parsing is stdlib only and refuses substituted, missing, duplicate or reordered PUBs. Loading needs the pinned SDK, re-checks each circuit and requires byte equality with a fresh rebuild (DRIFT), with stable UNAVAILABLE_DEPENDENCY / UNSUPPORTED_SDK diagnostics. A preparation-only artifact carries no PUB, sample or execution claim. The native request descriptor must equal its artifact. Part of #61. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add POST /qsearch/native/v1/submit, GET .../requests/<digest> and POST .../<digest>/cancel. They answer only when ServiceConfig.native_policy is set (NANO_QSEARCH_NATIVE=1 plus an explicit policy file) and are otherwise 404 NOT_ENABLED before authentication. Admission checks declared resources and the host-admitted profile/target digests from the signed descriptor before parsing the artifact, then the artifact against the descriptor and an optional evidence-bank registry, then a pinned QPY preflight. The routes reuse the existing request MAC and nonce store, durable request rows, single attempt claim, cancellation fence and the unchanged job-state projection. Only local runtimes are accepted. Startup recovery never starts execution; a lost local outcome stays held. Local results are sealed with a separate native-local domain, report dry_run backend and not_applicable accounting, and never carry a hardware seal. v1/v2 routes, schemas and defaults are unchanged; v2 routes do not serve native rows. Part of #61. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add retain_identity/verify_native_result: the caller binds its own plan to the request before submission and checks every returned identity field against that retained copy, then decodes the observations with its own plan and evidence catalog. Execution, decoded delivery and accounting stay separate; hardware qualification is always none. Tests drive builder -> plan -> prepared artifact -> authenticated local service -> pinned Qiskit ideal samples -> verified records for known-bit, one-record and packed-record plans, and the 400-recipient/1,200-PUB fixture over HTTP through actual QPY load. That fixture needs explicit test caps (max_pubs=1200, max_body_bytes=8 MiB); tests show the defaults refuse it. Negative controls cover forged manifests, hardware/accounting claims, stale evidence, partial, missing and reordered PUBs, and a no-Qiskit subprocess for core checking and caller verification. Part of #61. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Address independent review findings: verify_native_result now requires the receipt key and checks effect/reason consistency; seal errors of any type map to SEAL. Native preflight holds a concurrency slot (SERVICE_BUSY when none frees) so parallel QPY loads stay bounded. Corrupt durable state in the single-flight path returns 503 STATE_UNAVAILABLE instead of escaping; a claimed attempt stays held. Row-kind checks skip JSON parsing for non-native rows. Tests seed unclaimed rows directly and reseal forged records as a compromised key holder would. Part of #61. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nistically Tests that spawn the local runtime now use non-golden copies of the fixture plans, built with the same builders and a 60 s wall bound (the default policy deadline), because child startup counts against the declared bound. Frozen goldens keep their 5 s bound and stay covered by the contract and artifact tests. Deadline enforcement is proven independently of machine load: a 1 s bound kills a child that sleeps 60 s and the request is sealed FAILED; a fake runtime's DEADLINE error is sealed the same way. The local runtime's worker command is injectable for that test; the default and the deadline semantics are unchanged. docs/status.md now describes the native bridge as implemented: opt-in, disabled by default, local simulator or test fake runtime only, no hardware, provider submission or provider accounting. Part of #61. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The README still said prepare/sample artifact and service-wire support was unfinished. State what now exists (pinned-Qiskit artifact, opt-in local-only routes, disabled by default) and what does not (hardware or provider adapters). Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Completes the gap left open in #61: known-bit preparation and sampling now travel through a real prepared artifact and the q-search service path, without being disguised as a QUBO/QAOA job.
nano.quantum.native-*v1 schemas (request, profile, target, artifact, result, capabilities), PUB map, capability matrix and canonical goldens. Contract parsing is stdlib-only./qsearch/native/v1/...routes, disabled by default (ServiceConfig.native_policy=None), local ideal simulator or injected fake runtime only. Reuses existing MAC/nonce auth, durable request rows, single-attempt claim, cancellation fence and the unchanged job-state projection. No hardware target, provider call or new ledger; local results never carry a hardware seal or provider-final accounting, and unknown usage stays held.max_pubs=1200,max_body_bytes=8 MiB); production defaults unchanged and shown to refuse it.to_legacy_joband optimize goldens. The q-search lifecycle wire contract v1 is untouched (status-only).docs/quantum-native-bridge.md, status page and README now describe exactly what exists; no hardware qualification or quantum-advantage claim.Evidence: quantum + q-search suites 1080 passed / 0 failed locally; full local suite on the integrated tree 3144 passed / 0 failed; release-conformance harness
qiskit.native_bridge81/81 (all 17 required IDs) andwheel.native_fixturePASS on two byte-identical runs. Linux matrix: this PR's CI.Closes #61. Part of #67.
🤖 Generated with Claude Code