wai-quantum: methods, passes, noise channels and formats behind traits, every built-in registered through them, a host's own components checked and marked #560
Loading…
Reference in a new issue
No description provided.
Delete branch "wai/quantum-registration"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The engine's simulation methods, compiler passes, noise channels and file formats now sit behind four traits, and every built-in registers through them. A host program can register its own components in-process, and the engine checks what each gives before it reaches a result. A result a registered component took part in names it, marked uncertified, and the receipt seals that. A result of built-ins alone gives the bytes it gave before.
What it adds
Four traits and one registry (
engine::registry)Method: its name, version, accuracy classes, descriptor,models_noise,auto_rank,takes(channel),plan(admits the job or refuses it, and states its memory and work) andrun.Pass: the gates it takes and gives (GateSet) and how it is checked:Check::LadderorCheck::Fidelity { max_distance }, never a hash.Channel: parameters with ranges, arity, Kraus operators, an optional Pauli form, andtaken_by(method).FrontEnd:readto OpenQASM 3, andwrite.Registry::with_builtins()andregister(Component::…)are explicit and stay in the process.Registry::builtins()is the shared static.catalog::plan,read,describeandnoise_of,run::run,run_with_provenance,compile::compileandcall,formats::read,convert,convert_jsonandexpand, and the verdict's functions keep their signatures as thin wrappers.auto's ranks give the order it had.engine::registryre-exportsserde_json'sValueandjson, so a component needs no other dependency.What a registered component can do
compile.passes, after the level's passes and before twirling and dynamical decoupling.noise, as a value or as{param: v}. The density matrix applies it through its Kraus operators.source.What the engine checks
Identity
components(front end, passes, channels, method). Registered entries are marked"origin": "registered", "certified": false, and the receipt seals them. Forging or dropping them breaksverify.component) and conversions carry it too.components, and its bytes are what they were: the eight pinned job digests hold through the built-in registry and through one holding host components.Registry::components_ofderives the list for any result.Refusal codes, in
docs/job-refusals.md:J060: an unknown pass named in a request.J061: a channel the method cannot take. This now covers noise on a method that models none, which wasJ011, and amplitude damping on the stabilizer method.J011's meaning is narrowed to match.J062: a channel that fails the validity check.J063: a registration refused.J064: a registered component breaking the contract.J065: an intent on a job with a registered channel.Two small behaviour changes, in the changelog: an unknown method is always
J010, and a channel value that is not a number is refused withJ003where it used to be read as no noise.Surfaces
wai-quantum components, with--jsonadding each descriptor. Its summary is translated inlocales/zh-CN.json.list_components, its answertools.v1.json#/$defs/components.GET /v1andquantum_service_infolistcomponents.examples/extension_points.rs([[example]] test = true): a methodbasis_table, a passcancel_pairs, a channelbit_flipand a front endgate_list, written against public items only, run end to end, with 3 tests.docs/extension-points.md, with a runnable Rust block that registers a channel and runs it; sections in the engine README (and zh-CN), the CLI README (and zh-CN) and the service README; the changelog.job-result,compile-result,tools.v1.json(components,component) and the service'sinfogain optional members.schema::FILESis unchanged.wai-quantum-registry.yml, a native job on linux and linux-arm64 (the registry tests under full and contract features, 12 required by name; the engine's job, refusal, compile and formats tests; the example tested and run) and a wasip2 job under wasmtime.Checked
--no-default-features --features quantum_engine,quantum_receipt,quantum_qec,quantum_noise --lib): 818 passed. Engine--features full --lib: 1174 passed.engine::registry::: 12 passed under full, 12 under the contract set, and 12 under wasm32-wasip2 with wasmtime 49.0.2. The 8 pinned job digests unchanged. Integration tests under full:formats_conformance2,formats_mutation1,intent_conformance2,answer_conformance2,qasm3_conformance2. The example: 3 passed, and its run printed the three lines the workflow looks for. CLI: every target passed (72 in the main suite); clippy-D warningswith and without default features; smoke, every check held. Service: 37 + 1; clippy; smoke against a local instance, every check held. wai-web nativequantum_engine::: 29 passed; wasm32 under Node: 21 passed; both pins unchanged. Breaking gate: only additions, no unacknowledged break. Repository checks: every line ok.check_docs.py --rustover the 7 touched pages: passed.check_schemas.py: 33 schema files, 51 local and 30 service tools, 48 tool answers includinglist_components.wai/wai-quantum-views/build.shincatthehacker/ubuntu:act-22.04with Rust 1.98.0: the same bytes as the committed page, andbuild-views --checkpassed. Engine--features full --lib --tests: 1174 lib tests passed (engine::registry12,engine::fabric6,engine::fabric_measured4) and every test binary. Engine contract set: 818 passed, the registry's 12 among them. The example: 3 passed, and its walk-through ran to its end, 4 of its lines naming what was registered. CLI: 72 passed (bin) and every integration target; clippy-D warningsclean with and without default features. Service: 37 + 1. wai-web native: 29 passed. CLI and service smoke: every check held. Breaking gate: no unacknowledged break. Repository checks: all 10 lines ok.catthehacker/ubuntu:act-22.04)wai-quantum-py/ci/check.sh: 78 passed, 5 of 5 notebooks ran and matched (36 code cells), smoke passed.d4cdbb7da) under it (macOS build host)cargo checkline of the pulse, error-correction and variational workflows, andquantum_lang,quantum_toolchain,quantum_fabricandfull --lib --tests: clean under-D warnings.engine::registry: 12 passed under full and 12 under the contract set.b1d7a3532d4cdbb7da), and main's tree is that commit's: nothing else has landed. This PR's CI runs every leg.Not done
components. Adding it would change every built-in result's bytes, the pinned digests and the stored notebook outputs; such a result is already identified by its method, passes, channels andengine.version, all sealed.stabilizerandtrajectoriesmethods refuse registered channels (J061): taking them would change the publicFrameStepandNoiseModel. Intents (J065) and mitigation (J008) on jobs with registered channels are refused, because those checks model the built-in channels.Breaking
None. The breaking gate lists only additions.
J011's narrower meaning and the two behaviour changes above are in the changelog.🤖 Generated with Claude Code