open-standards/.github/workflows/wai-quantum-qec.yml
Transaction Science 462ba8b377 wai-quantum-service: a pulse run's result bounded from its schedule, the dry run's result_bytes in the tool schema, and a QEC pilot held to 200 ms
A pulse run reads its own program, so its result was not bounded before
it ran: it was counted at WAI_QSVC_RESULT_MIB and held to it only as it
ended. It is bounded now from its schedule as read (pulse::plan_bounded,
through Method::plan_bounded, a default method on the registry's trait
that gives no bound): the populations by the qubits it simulates, the
distribution by the captures it reads, each keyed as wide as the
program's bits, the counts by its shots (run::counts_bound_among), and
each capture with its frame's and bit's names. A pulse run of 100,000
bits declared and one captured, about 1.4 MB as served, is refused at
once under a 1 MiB cap, where it had been taken and failed as it ended;
100 bits are taken. No built-in method is now unbounded, so the check as
a result ends is only a backstop, for a job kept across a restart that
lowered the cap. engine::pulse::tests::no_pulse_result_passes_the_bound_its_plan_gave
runs one capture, one bit of 3,000 captured, nothing captured and two
qubits captured, each within its bound and within a few times it.

The dry run's result_bytes, an integer or {"bytes": null, "why"}, is
named in schemas/service-tools.v1.json and the CLI's snapshot of the
service's tools; every_tool_s_answer_follows_its_output_schema failed on
it on both hosts at 15a1bc9ed.

A circuit's QEC pilot goes on past its one in a hundred until 200 ms,
its shots allowing (PILOT_FLOOR). Its shots are the call's own, decoded
once and counted in its result, so it costs nothing; 20 ms of a light
decode, read through one pause of a loaded host's scheduler, projected a
decode that took 2.7 s alone at 7 s against a 6 s limit and refused it
(a_time_is_measured_apart_from_setup_and_holds_every_threshold, the M3
Ultra at load 40). The workflows name the new tests, and the pulse
tests are 28, native and wasip2.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 07:58:37 -05:00

169 lines
10 KiB
YAML

name: wai-quantum error correction and mitigation
# Error correction and mitigation (wai/wai-quantum): the colour codes and
# their decoder (quantum_color), distance certificates (quantum_distance),
# the circuit and error-model texts and their conformance vectors
# (quantum_qec_text, quantum-conformance/qec-text/), correlated matching
# (quantum_match), sliding-window decoding (quantum_window), the frame
# simulator's Pauli-target observables and tags (quantum_frame), mitigation
# in a job (engine::mitigate), twirling and decoupling as compile passes
# (engine::compile) and the error-correction call every host makes
# (engine::qec).
#
# Every decoder is held to the exhaustive ground truth: every error below
# half the distance corrected to a trivial residual (at circuit level, every
# edge set below half the graph's distance). A release build runs the larger
# distances (colour codes to d = 9, bivariate-bicycle certificates to 144
# qubits); the crate's suites run the rest in debug elsewhere
# (wai-energy-receipts.yml).
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [main]
paths:
- 'wai/wai-quantum/**'
- 'wai/quantum-conformance/qec-text/**'
- 'rust-toolchain.toml'
- '.github/workflows/wai-quantum-qec.yml'
pull_request:
paths:
- 'wai/wai-quantum/**'
- 'wai/quantum-conformance/qec-text/**'
- 'rust-toolchain.toml'
- '.github/workflows/wai-quantum-qec.yml'
jobs:
relevant:
name: does this change touch it
runs-on: gate
outputs:
run: ${{ steps.gate.outputs.run }}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- id: gate
run: |
set -euo pipefail
r=$(python3 scripts/pr-touches-paths.py .github/workflows/wai-quantum-qec.yml \
"${{ github.event.pull_request.base.sha }}" \
"${{ github.event.pull_request.head.sha }}")
echo "this change touches error correction or mitigation: $r"
echo "run=$r" >> "$GITHUB_OUTPUT"
native:
name: codes, decoders, texts and mitigation · linux, release
needs: relevant
if: needs.relevant.outputs.run == 'true'
runs-on: linux
timeout-minutes: 60
steps:
- uses: actions/checkout@v5
- name: Install Rust 1.99.1
shell: bash
run: |
export PATH="$HOME/.cargo/bin:$PATH"
command -v rustup >/dev/null 2>&1 || \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain 1.99.1
rustup toolchain install 1.99.1 --profile minimal
rustup default 1.99.1
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
# A module filter is satisfied by any one test of the module, so each
# new test is required by name to have run and passed.
- name: Codes, decoders, texts, mitigation and the error-correction call
shell: bash
working-directory: wai/wai-quantum
run: |
set -euo pipefail
cargo test --locked --release --features full --lib -- \
quantum_color:: quantum_distance:: quantum_qec_text:: quantum_window:: quantum_match:: quantum_frame:: \
engine::mitigate:: engine::qec:: \
engine::compile::tests::twirling_and_decoupling_keep_the_program \
engine::compile::tests::every_frame_is_carried_through_its_gate \
quantum_noisy::tests::steps_reproduce_the_evolution 2>&1 | tee "$RUNNER_TEMP/qec.log"
grep -qE '^test result: ok\. [1-9][0-9]+ passed; 0 failed' "$RUNNER_TEMP/qec.log" || { echo "::error::the error-correction tests did not pass"; exit 1; }
for t in quantum_color::tests::every_error_below_half_the_distance_is_corrected \
quantum_color::tests::matching_alone_misses_some_correctable_errors \
quantum_color::tests::the_triangular_codes_are_colour_codes \
quantum_color::tests::decoding_is_deterministic_and_distance_helps \
quantum_color::tests::the_empty_syndrome_needs_no_correction \
quantum_distance::tests::the_search_agrees_with_brute_force \
quantum_distance::tests::the_codes_have_their_distances \
quantum_distance::tests::bivariate_bicycle_codes_have_their_distances \
quantum_distance::tests::the_lightest_explanation_is_never_heavier_than_the_error \
quantum_distance::tests::the_symmetric_search_agrees_with_brute_force_on_a_bivariate_bicycle_code \
quantum_distance::tests::a_tampered_certificate_or_symmetry_is_refused \
quantum_qec_text::tests::every_target_kind_and_a_tag_round_trip \
quantum_qec_text::tests::any_layout_reads_to_its_rewritten_form \
quantum_qec_text::tests::what_does_not_read_is_refused_with_its_line \
quantum_qec_text::tests::a_model_unrolls_with_its_offsets_tags_and_parts \
quantum_qec_text::tests::blocks_nested_past_the_limit_are_refused_on_their_line \
quantum_qec_text::tests::an_empty_block_repeated_without_end_is_refused_not_run \
quantum_qec_text::tests::an_index_past_what_a_text_holds_is_refused_on_its_line \
quantum_window::tests::narrow_windows_correct_every_edge_set_below_half_the_distance \
quantum_window::tests::a_window_over_everything_is_the_batch_decoder \
quantum_window::tests::narrow_windows_track_the_batch_decoder \
quantum_window::tests::a_window_too_short_for_the_model_is_refused \
quantum_match::tests::matching_corrects_every_edge_set_below_half_the_distance \
quantum_match::tests::decomposed_faults_are_counted \
quantum_match::tests::the_matched_edges_explain_the_shot \
quantum_match::tests::correlated_matching_is_not_worse_on_the_same_shots \
quantum_frame::tests::a_pauli_target_is_flipped_by_what_anticommutes_with_it \
quantum_frame::tests::pauli_targets_agree_between_sampler_and_model \
quantum_frame::tests::tags_reach_the_model_and_its_text \
quantum_frame::tests::the_text_round_trips \
quantum_frame::tests::blocks_that_write_nothing_end_and_unrun_ones_are_checked_once \
quantum_frame::tests::a_pauli_channel_s_rates_have_its_law \
quantum_frame::tests::a_pauli_channel_samples_its_law \
quantum_frame::tests::the_cycling_gates_cycle_the_axes \
quantum_frame::tests::a_correlated_error_flips_its_targets_together \
quantum_frame::tests::a_pauli_channel_with_independent_rates_above_one_half_is_taken \
quantum_frame::tests::the_carrier_s_index_is_refused_in_text \
quantum_frame::tests::a_correlated_error_with_no_index_left_for_its_carrier_is_refused \
quantum_frame::tests::the_cycling_gates_take_no_arguments \
quantum_frame::tests::the_qec_page_and_conformance_set_name_these_forms \
quantum_frame::tests::the_reference_colour_code_has_the_reference_s_model \
engine::mitigate::tests::pauli_channels_round_trip_through_rates_and_fidelities \
engine::mitigate::tests::the_twirled_circuit_is_the_job_where_the_noise_is_pauli \
engine::mitigate::tests::the_exact_inverse_undoes_the_noise \
engine::mitigate::tests::each_method_reduces_the_bias_and_states_its_error \
engine::mitigate::tests::the_trace_with_a_pauli_is_the_expectation \
engine::mitigate::tests::readout_inversion_recovers_the_distribution \
engine::mitigate::tests::a_job_carries_its_mitigation_and_its_refusals_name_their_code \
engine::mitigate::tests::refusals_say_why \
engine::qec::tests::every_family_reads_and_certifies_its_distance \
engine::qec::tests::a_time_holds_the_shots_sampled_and_decoded \
engine::qec::tests::a_time_is_measured_apart_from_setup_and_holds_every_threshold \
engine::qec::tests::a_circuit_s_pilot_runs_for_its_floor_within_its_shots \
engine::qec::tests::each_decoder_corrects_every_single_error \
engine::qec::tests::circuit_level_decoding_reads_every_model_form \
engine::qec::tests::a_threshold_is_measured_and_distance_helps_below_it \
engine::qec::tests::an_answer_is_sealed_and_a_changed_one_does_not_verify \
engine::compile::tests::twirling_and_decoupling_keep_the_program \
engine::compile::tests::every_frame_is_carried_through_its_gate \
quantum_noisy::tests::steps_reproduce_the_evolution; do
grep -q "^test $t \.\.\. ok$" "$RUNNER_TEMP/qec.log" || { echo "::error::$t did not run and pass"; exit 1; }
done
- name: The circuit and model texts against their conformance vectors
shell: bash
working-directory: wai/wai-quantum
run: |
set -euo pipefail
cargo test --locked --release --features full --test qec_text_conformance 2>&1 | tee "$RUNNER_TEMP/text.log"
grep -q '^test the_conformance_set_holds \.\.\. ok$' "$RUNNER_TEMP/text.log" || { echo "::error::the conformance vectors did not run and hold"; exit 1; }
# Without warnings: a feature gate that leaves code unreachable or a
# value unused in one feature set shows here.
- name: Each feature set the hosts build still builds, without warnings
shell: bash
working-directory: wai/wai-quantum
env:
RUSTFLAGS: -D warnings
run: |
set -euo pipefail
cargo check --locked --no-default-features --features quantum_engine --lib
cargo check --locked --no-default-features --features quantum_qec --lib
cargo check --locked --no-default-features --features quantum_engine,quantum_receipt,quantum_qec,quantum_noise --lib