wai-quantum: no anonymous request ends the job service or holds it without limit #676

Closed
dcharlot wants to merge 27 commits from wai/quantum-parse-depth into main

2026-11-09

Transaction Science
wai-quantum: the change's entry acknowledges Request::smells_bytes and the two reader constants of main's it replaces
Some checks failed
wai-pack / wai-pack · linux-arm64 (pull_request) Successful in 4m9s
wai-quantum views in agent hosts / views · a scripted host (pull_request) Successful in 4m59s
wai-quantum views in agent hosts / views · the page and its engine (pull_request) Successful in 5m27s
wai-quantum studio and desktop / desktop app · linux (pull_request) Successful in 8m31s
wai-pack / wai-pack · the floor through a media prober (pull_request) Successful in 32s
wai-quantum tensor-engine member / member · tensor engine, the kernel toolchain's simulator (linux) (pull_request) Successful in 8m49s
wai-quantum signal processor / processor and member · signal processor, emulated (pull_request) Successful in 16m40s
wai-web reach builds / wai-web reach builds · this tree's wai-web, every rung on its engine line (pull_request) Successful in 5m21s
wai-pack / wai-pack · dependency licences (pull_request) Successful in 1m50s
wai-quantum HIP member / member · HIP absent (linux-arm64) (pull_request) Successful in 1m27s
wai-quantum CUDA member / member · CUDA (jetson-hub) (pull_request) Successful in 1m37s
wai-quantum npu-cores member / member · npu-cores absent (linux-arm64) (pull_request) Successful in 38s
wai-quantum docs, course and locales / every command and snippet in the docs · linux (pull_request) Successful in 18m26s
wai-quantum OpenCL member / member · OpenCL GPU and CPU (jetson-hub) (pull_request) Successful in 38s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Failing after 8m40s
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Successful in 11m12s
wai-quantum service / service energy · linux packages (pull_request) Successful in 1m52s
wai-quantum pulse and dynamics / the same bits · linux-arm64 (pull_request) Successful in 2m5s
wai-pack / wai-pack · independent verifier (Python) (pull_request) Successful in 9m37s
wai-quantum portable tensor program / tensor program · GPUs (jetson-hub) (pull_request) Successful in 28s
wai-quantum tensor-engine member / member · tensor engine absent (linux-arm64) (pull_request) Successful in 33s
wai-quantum variational and algorithm library / parameters, gradients, optimisers, VQE, QAOA and builders · linux-arm64, release (pull_request) Failing after 2m4s
wai-quantum extension points / the registry and the example · linux-arm64 (pull_request) Successful in 3m51s
WAI conformance / each feature of the independent verifiers' steps compiles alone (pull_request) Successful in 20m48s
wai-sink-android native sink library / the JNI layer and the platform-free half on the host JVM · linux-arm64 (pull_request) Successful in 4m38s
WAI Studio / Studio in WebKit · linux (pull_request) Successful in 21m51s
wai-quantum command line / command line · linux (pull_request) Successful in 38m14s
wai-quantum WebGPU member / member · GPU, Vulkan (thor) (pull_request) Successful in 23m2s
wai-quantum WebGPU member / member · GPU, Vulkan (jetson-hub) (pull_request) Successful in 28m2s
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Failing after 2h5m15s
`wai breaking --against 1929b8436` named three changes: the public field
a verdict's critique bound is carried in, and main's `qasm::MAX_NESTING`
and `qasm::MAX_ELSE_IF` (15ae7d457, in no release), which this branch's
reader replaces with `qasm::parse::MAX_NESTING` and flat `else if`
ladders. Each is intended, and the entry says what a user does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 14:08:25 -05:00
Transaction Science
wai: the compose fixture is 'a test pattern of 320 × 180', which the vanity check does not read as a count of tests
5df961d52 wrote 'a 320 × 180 test pattern' in browser-sink.md §14.6 and
compose/README.md; scripts/check-no-vanity-metrics.sh reads '180 test' as a
test count, which turned repository checks red on main (run 26220 at
1929b8436). Same words, reordered.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 4c5b54a272)
2026-11-09 14:06:17 -05:00
Transaction Science
wai-quantum-service: a result's bound holds for every job, a dry run says what its run takes, a client's quick calls pass its own long checks, and an MCP id comes back as it was sent
Sixth review of #676:

- The bound on a result is a true upper bound, part by part
  (catalog::Bound: counts, verdict, notes, requests, rest). A sampled
  intent's fit names at most 64 of the outcomes it rules out and says how
  many (impossible_outcomes), and its reason says them once; the bound
  counts each intent's lists and the statement's reasons. A trajectories
  run's counts are bounded by its trajectories. A verdict counts the
  reader's notes and the repair again. Every number is counted at the
  length RFC 8785 writes it (receipt::canonical_len), so a set's items'
  requests and the provenance's shots and seed are counted as served.
- Where the method knows better, the bound is close: at most 2^b outcomes
  for the b bits measured, and on the noiseless stabilizer method 2^d, d
  its measured qubits and its branching gates (a GHZ state's two). A
  verdict's critique is bounded by the smells its program's gates can draw
  (critique::smells_bound, the critique's own walk), not 512 bytes a gate:
  100 GHZ24 at 30,000 shots, and a 124,700-gate loop with its verdict, are
  taken. A refusal names the largest part and what makes it smaller.
- A dry run applies the run's checks: over MCP it plans the job as the run
  tools run it, with its verdict, and its reading is held to what the
  submission's would take back (refused as accepted: false).
- A set's worker writes each item's result as text as it ends, so the
  README's 100 points of 30,000 shots run to the end within their memory.
- A turn lent to a client goes back once one of its own requests has
  waited 7 s, as once another client's waits, so two long checks never
  hold its quick calls past their wait. A client's eleventh request at
  once is refused, of readings as of checks, and no turn is lent while
  one of its own is free or held by a request waiting for the pool.
- Every MCP answer echoes the JSON-RPC id as the text it was sent as.
- A long poll past its client's holds is answered 429 (503 past
  everyone's) with Retry-After and the job's status; the command line's
  follow waits and polls again.
- Every job queued or running counts against the service-wide unread cap
  at its bound, checked again under the queue's lock.
- README, OpenAPI, the tool schema and the changelog say what holds; the
  MCP tool snapshot and the command line's docs are regenerated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 14:06:17 -05:00
Transaction Science
Merge main (1929b8436) into wai/quantum-parse-depth
Main took a nesting bound of its own for the OpenQASM reader in 15ae7d457
(Q130 at 128 levels, a chain of at most 127 operators, at most 1024
`else if` arms). This branch's reader bounds nesting and memory already
(Q006 at 64 levels in the text and 256 through calls, operator runs and
`else if` ladders flat at any length; Q130 the reader's memory), so the
reader's sources, its diagnostics table and its docs are this branch's.
Main's tests of that bound now hold this reader to it: lang_tests reads
each shape inside the bound and refuses it past; tests/reader_stack.rs
reads every program at the bounds on 1 MiB and 2 MiB threads and refuses
the same shapes nested 5000 deep on them; the service's tests/verify.rs
reads the 2000-term sum and refuses the brackets and blocks on seven
routes. Main's changelog entry says what holds.

Main also brings the RUSTSEC-2026-0459 fix (rusqlite 0.41 in jouleclaw)
and the corpus-licence self-test fix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 14:06:16 -05:00
Transaction Science
wai-quantum-service tests: a just-written binary started again while busy, the README's burst sent again when its threshold could not be measured, and a QEC refusal's time held to the host's
Some checks failed
wai-quantum views in agent hosts / views · the page and its engine (pull_request) Has been cancelled
wai-quantum views in agent hosts / views · a scripted host (pull_request) Has been cancelled
wai-quantum WebGPU member / does this change touch it (pull_request) Has been cancelled
wai-quantum WebGPU member / shader checks · browser build · wasip2 inertness (pull_request) Has been cancelled
wai-quantum WebGPU member / member · software Vulkan (linux) (pull_request) Has been cancelled
wai-quantum WebGPU member / member · Metal (macos) (pull_request) Has been cancelled
wai-quantum WebGPU member / member · GPU, Vulkan (jetson-hub) (pull_request) Has been cancelled
wai-quantum WebGPU member / member · GPU, Vulkan (thor) (pull_request) Has been cancelled
wai-quantum WebGPU member / member · integrated GPU, Vulkan (framework-128gb) (pull_request) Has been cancelled
wai-quantum WebGPU member / member · browser WebGPU (macos) (pull_request) Has been cancelled
wai-sink-android native sink library / does this change touch it (pull_request) Has been cancelled
wai-sink-android native sink library / the JNI layer and the platform-free half on the host JVM · linux-arm64 (pull_request) Has been cancelled
wai-sink-android native sink library / every ABI, the AAR, and the instrumented tests in a headless emulator · macos (pull_request) Has been cancelled
wai-sink-swift native sink package / does this change touch it (pull_request) Has been cancelled
wai-sink-swift native sink package / libwai slices, desktop tests, simulator tests · macos (pull_request) Has been cancelled
WAI mbt2018_mean integer decode (regenerated vectors) / does this change touch it (pull_request) Has been cancelled
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Has been cancelled
WAI Studio / does this change touch it (pull_request) Has been cancelled
WAI Studio / the catalogue's actions, the unit tests and the core · linux (pull_request) Has been cancelled
WAI Studio / Studio in Chromium and Firefox · macos (pull_request) Has been cancelled
WAI Studio / Studio in WebKit · linux (pull_request) Has been cancelled
wai-web reach builds / wai-web reach · does this change touch it (pull_request) Has been cancelled
wai-web reach builds / wai-web reach builds · the package of record, every output as recorded (pull_request) Has been cancelled
wai-web reach builds / wai-web reach builds · this tree's wai-web, every rung on its engine line (pull_request) Has been cancelled
wai-web wasm32 / does this change touch it (pull_request) Has been cancelled
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Has been cancelled
wai-int-module WAISM module of record / does this change touch it (pull_request) Successful in 16s
wai-int-module WAISM module of record / linux · both checkers, wasmtime (Cranelift, Winch), Wasmi and Node (pull_request) Has been skipped
wai-int-module WAISM module of record / linux-arm64 · both checkers, wasmtime (Cranelift, Winch), Wasmi and Node (pull_request) Has been skipped
wai-int-module WAISM module of record / the module of record in Chromium (pull_request) Has been skipped
Two depth tests failed on the Framework in the whole suite under
`ulimit -n 256`, at load 43, beside the other tests:

- the_binary_can_be_replaced_before_the_restart: the copy it had just
  written could not be started, "Text file busy" (ETXTBSY). A child that
  another test forked between the copy's open and its close holds the file
  open for writing until it execs, close-on-exec or not. launch() now
  starts it again, every 50 ms for up to 10 s, on that error alone.
- the_readme_s_burst_from_one_client_is_answered: its threshold, 18.8 s
  alone on the loaded host, was measured beside the burst at 58 s and
  refused at once (J031, past the 25 s an error-correction call may
  take), so the burst tested nothing. On that refusal alone the threshold
  is measured again and the burst sent again, three times at most; every
  other answer is asserted as before. On a0804db72 the threshold is
  answered and the critiques refused (J032), so this changes nothing
  there.

And one library test, in the same run's --features full --lib (1,418
passed, 1 failed), at load 77 and 302 s where the M3 Ultra took 167 s:
a_time_is_measured_apart_from_setup_and_holds_every_threshold asked a
colour-code threshold to be refused within 5 s and it was refused after
8.2 s, on its pilot (the call refused, J031). The code-capacity pilot is
unchanged this round. The test's first half already measures its own
decode with no time set, because a time here is a build's and a host's;
the refusal is now asked within 5 s or twice that decode's time,
whichever is longer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 08:22:34 -05:00
Transaction Science
2026-11-09 07:58:45 -05:00
Transaction Science
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

2026-11-08

Transaction Science
2026-11-08 16:42:37 -05:00
Transaction Science
wai-quantum-service: a result held to its cap before it runs, and the round-5 probes as tests
A job's or a set's result is bounded before it runs, from the request as
read (catalog::plan_bounded and sets::plan_bounded, new in the engine): each
item's counts at most its shots, 2^bits and 65,536 outcomes, each its bit
string, quotes, a colon, a comma and its count's digits; expectation values,
amplitudes, diagnostics, outputs, a repair, a compile, a target, a
mitigation and a verdict by what each may hold or at their size as read; a
set's every item request and frame beside. A request whose bound passes
WAI_QSVC_RESULT_MIB (64) is refused at once, 422 and J031, with the bound
and the cap in the reason, on every route that takes a job; a dry run gives
the bound as result_bytes, and GET /v1, the dry run's bounds, the MCP
description and the OpenAPI document publish the cap beside the set limits.
At 64 MiB, 100 points of 65,536 outcomes (about 150 MB) are refused and
100 points of 16 bits at 30,000 shots are taken. A client's running jobs
are counted against its unread allowance at their own bounds, not the cap.
The check as a result ends is kept only as a backstop.

The round-5 verifier's probes are the tests for its first two findings:
210 long polls on a running job from 210 addresses, 3 ms apart, under a
hard limit of 256 (health 0 of 25 on a0804db72), and the README's decode,
a threshold made long enough to outlast a waiting call's 10 s, and six
critiques at the service's own limits (refused J032 at 10.07 s on
a0804db72). Both pass here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 16:42:29 -05:00
Transaction Science
wai-quantum-service: health checks held past the connection cap, long polls and streams capped, a moved lent turn given back, read and unread results counted apart, and MCP ids echoed exactly
Some checks failed
wai-quantum docs, course and locales / every command and snippet in the docs · linux (pull_request) Successful in 30m58s
wai-quantum command line / command line · linux (pull_request) Successful in 32m43s
wai-quantum WebGPU member / member · GPU, Vulkan (thor) (pull_request) Successful in 23m33s
wai-quantum CUDA member / member · CUDA (jetson-hub) (pull_request) Successful in 1m52s
wai-quantum OpenCL member / member · OpenCL GPU and CPU (jetson-hub) (pull_request) Successful in 48s
wai-quantum service / service energy · linux packages (pull_request) Successful in 2m20s
wai-quantum portable tensor program / tensor program · GPUs (jetson-hub) (pull_request) Successful in 20s
joule-code conformance gate / joule-moq-relay, every target (pull_request) Successful in 3m52s
wai-quantum WebGPU member / member · GPU, Vulkan (jetson-hub) (pull_request) Successful in 17m3s
joule-code conformance gate / joule-moq-ingest, every target (pull_request) Successful in 6m11s
repository checks / lockfiles, advisories, tests in CI, workflow hygiene, spec and section references, public text (pull_request) Failing after 6m8s
joule-moq-room room service / joule-moq-room, every target (pull_request) Successful in 11m22s
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Successful in 54s
standards workspaces build + test / joule-code-rs (joule-code/joule-code-rs, joule-code-rs, linux-arm64, true) (pull_request) Successful in 12m50s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Failing after 3m39s
WAI conformance / delivery telemetry · CMCD and CMSD against an independent library (pull_request) Successful in 16s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Successful in 46s
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Successful in 2m57s
WAI conformance / each feature of the independent verifiers' steps compiles alone (pull_request) Successful in 20m40s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Failing after 15m50s
wai-quantum HIP member / member · HIP absent (linux-arm64) (pull_request) Successful in 1m22s
wai-quantum npu-cores member / member · npu-cores absent (linux-arm64) (pull_request) Successful in 37s
wai-quantum pulse and dynamics / the same bits · linux-arm64 (pull_request) Successful in 2m10s
wai-quantum tensor-engine member / member · tensor engine absent (linux-arm64) (pull_request) Successful in 29s
wai-quantum variational and algorithm library / parameters, gradients, optimisers, VQE, QAOA and builders · linux-arm64, release (pull_request) Successful in 2m50s
wai-quantum extension points / the registry and the example · linux-arm64 (pull_request) Successful in 4m14s
wai-sink-android native sink library / the JNI layer and the platform-free half on the host JVM · linux-arm64 (pull_request) Successful in 3m20s
WAI examples / WAI examples · android-app · linux-arm64 (pull_request) Successful in 8m36s
wai-quantum energy-landscape jobs / the same bits · linux-arm64 (pull_request) Successful in 7m39s
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Successful in 2h12m2s
Fifth review of #676:

- Four connections past the cap are held for health checks alone, one
  request each for 2 s; long polls and event streams are held to
  WAI_QSVC_CLIENT_STREAMS (4) a client and WAI_QSVC_STREAMS (512, a
  quarter of the connections at most) in all; past them a long poll is
  answered at once with the job as it is and a stream is refused 503.
- A reading that moves from a lent turn onto its client's own gives the
  lent one back, and is stopped past 5 s only when other clients wait.
- Read and unread results are counted apart: only read ones are dropped
  before their time, the largest holder's first; a client's next job
  waits while its unread results, with WAI_QSVC_RESULT_MIB (64) for each
  running job and the new one, would pass WAI_QSVC_CLIENT_UNREAD_MIB
  (256), and every next job while all unread hold WAI_QSVC_UNREAD_MIB
  (8192); a result past 64 MiB fails its job, saying so; KEPT_MIB 4096.
- A task's state is read from the lean report; MCP answers are written
  by serde with RFC 8785's numbers, so ids are echoed exactly and a job
  keeps its report's bytes.
- self-host.md: the 192 cap holds only at a hard limit of 256.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 15:52:37 -05:00
Transaction Science
2026-11-08 15:17:22 -05:00
Transaction Science
wai-quantum-service: no more accepted than the descriptors let go, a lent deadline moved ahead of its watcher, and a job trimmed before its waiters read it
Some checks failed
wai-sink-android native sink library / every ABI, the AAR, and the instrumented tests in a headless emulator · macos (pull_request) Successful in 5m50s
wai-sink-swift native sink package / libwai slices, desktop tests, simulator tests · macos (pull_request) Successful in 11m47s
wai-quantum WebGPU member / member · GPU, Vulkan (thor) (pull_request) Successful in 23m19s
wai-quantum CUDA member / member · CUDA (jetson-hub) (pull_request) Successful in 2m27s
wai-quantum OpenCL member / member · OpenCL GPU and CPU (jetson-hub) (pull_request) Successful in 1m12s
wai-quantum service / service energy · linux packages (pull_request) Successful in 2m54s
wai-quantum portable tensor program / tensor program · GPUs (jetson-hub) (pull_request) Successful in 38s
joule-code conformance gate / joule-moq-relay, every target (pull_request) Successful in 6m15s
joule-code conformance gate / joule-moq-ingest, every target (pull_request) Successful in 8m59s
WAI examples / WAI examples · android-app · linux-arm64 (pull_request) Failing after 8m21s
joule-moq-room room service / joule-moq-room, every target (pull_request) Successful in 7m40s
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Successful in 2m0s
repository checks / lockfiles, advisories, tests in CI, workflow hygiene, spec and section references, public text (pull_request) Failing after 12m5s
wai-quantum energy-landscape jobs / the same bits · linux-arm64 (pull_request) Successful in 10m15s
WAI conformance / delivery telemetry · CMCD and CMSD against an independent library (pull_request) Successful in 2m0s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Successful in 2m4s
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Successful in 3m23s
wai-quantum WebGPU member / member · GPU, Vulkan (jetson-hub) (pull_request) Successful in 31m43s
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Failing after 15m46s
standards workspaces build + test / joule-code-rs (joule-code/joule-code-rs, joule-code-rs, linux-arm64, true) (pull_request) Failing after 12m57s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Failing after 23m35s
wai-quantum HIP member / member · HIP absent (linux-arm64) (pull_request) Successful in 6m45s
wai-quantum npu-cores member / member · npu-cores absent (linux-arm64) (pull_request) Successful in 3m24s
wai-quantum tensor-engine member / member · tensor engine absent (linux-arm64) (pull_request) Successful in 1m17s
wai-quantum pulse and dynamics / the same bits · linux-arm64 (pull_request) Successful in 3m12s
WAI conformance / each feature of the independent verifiers' steps compiles alone (pull_request) Successful in 24m54s
wai-quantum variational and algorithm library / parameters, gradients, optimisers, VQE, QAOA and builders · linux-arm64, release (pull_request) Successful in 3m40s
wai-quantum extension points / the registry and the example · linux-arm64 (pull_request) Successful in 4m59s
wai-sink-android native sink library / the JNI layer and the platform-free half on the host JVM · linux-arm64 (pull_request) Successful in 4m38s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Successful in 33m6s
- Past the connection cap, a few connections at a time are answered 503
  and the rest closed at once, and nothing more is accepted until those
  closed for room have let their descriptors go: under a limit of 256,
  400 connections at once never ran the service out of them.
- A lent reading's deadline is moved a second at a time, half a second
  before it is due, so the watcher never stops it at a time about to move.
- A finished job is trimmed before its waiters are woken, so a run's or
  a tool's own read of it does not leave it to be dropped as read.
- The report's placeholders are named outside the registry's name space;
  the receipt corpus test has a window for its receipts; the OpenAPI
  test reads operations, not path parameters; the lent-turn test gives a
  slow host the time its decode takes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 11:50:54 -05:00
Transaction Science
2026-11-08 11:05:57 -05:00
Transaction Science
wai-quantum-service: connections held under the open-file limit, results kept until read, a lent turn moves onto the client's own, and one RFC 8785 report on every route
Fourth review of #676, 11 findings:

- The service raises its open-file limit to its hard one as it starts
  (on macOS to kern.maxfilesperproc and 10240 at most) and logs it. It
  holds at most WAI_QSVC_CONNECTIONS (4096) connections, fewer under that
  limit; past them the connection idle longest, or the one whose body
  has been arriving longest, is closed for the new one, so a health check
  is always answered, and with none to close the new one gets 503 at
  once. A client may have WAI_QSVC_CLIENT_REQUESTS (32) requests open,
  refused 503 past them before a body is read.
- A job keeps its result as RFC 8785 text, counted at its length. An
  ended job not yet read is kept for WAI_QSVC_KEPT_MIN_SECS (600)
  whatever it weighs; while a client's unread results hold its cap its
  next job is refused (429), and while everyone's hold the service's,
  503. Past the service's cap the client keeping the most loses its
  results first, the newest between equals. An MCP run whose job is no
  longer known is an error, never a success without a result.
- A reading on a lent turn moves onto the client's own turn when one
  comes free, and runs past 5 s while no other request waits.
- Every route writes a job as one RFC 8785 text, its request and result
  spliced in as kept, the receipt's keys sorted, the same after a
  restart; MCP answers are written as RFC 8785 too.
- A large MCP message past the window is read only for its id, method,
  tool and key, and answered under its own id; a keyed resend of a job
  the client holds and a receipt check are read whole.
- A body is read before its window only for a resend under a key the
  client holds a job under; receipt checks have their own window,
  WAI_QSVC_CLIENT_VERIFIES (120), asked before the body is read.
- tasks/result holds its answer within what is left of the answer's
  time; the OpenAPI document lists 408, 413 and the pre-handler 503 on
  every route.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 11:05:51 -05:00
Transaction Science
wai-quantum qec: a code-capacity threshold's pilot is held to half a second, and the timing test is held to its own build
Some checks failed
wai-quantum docs, course and locales / every command and snippet in the docs · linux (pull_request) Failing after 19m42s
wai-quantum OpenCL member / member · OpenCL GPU and CPU (thor) (pull_request) Successful in 1m54s
WAI Studio / Studio in WebKit · linux (pull_request) Successful in 13m22s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Failing after 14m32s
WAI energy receipts / energy receipts · linux (pull_request) Successful in 32m15s
wai-web reach builds / wai-web reach builds · this tree's wai-web, every rung on its engine line (pull_request) Successful in 20m5s
wai-quantum CUDA member / member · CUDA (jetson-hub) (pull_request) Successful in 4m42s
wai-quantum OpenCL member / member · OpenCL GPU and CPU (jetson-hub) (pull_request) Successful in 1m2s
wai-quantum command line / command line · linux (pull_request) Successful in 38m54s
wai-quantum service / service energy · linux packages (pull_request) Successful in 3m7s
wai-quantum portable tensor program / tensor program · GPUs (jetson-hub) (pull_request) Successful in 53s
joule-moq-room room service / joule-moq-room, every target (pull_request) Successful in 5m47s
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Successful in 25s
wai-quantum WebGPU member / member · GPU, Vulkan (thor) (pull_request) Successful in 23m50s
standards workspaces build + test / joule-code-rs (joule-code/joule-code-rs, joule-code-rs, linux-arm64, true) (pull_request) Successful in 9m51s
WAI conformance / delivery telemetry · CMCD and CMSD against an independent library (pull_request) Successful in 1m31s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Successful in 1m40s
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Successful in 3m36s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Successful in 28m40s
wai-quantum HIP member / member · HIP absent (linux-arm64) (pull_request) Successful in 1m35s
WAI conformance / each feature of the independent verifiers' steps compiles alone (pull_request) Successful in 26m46s
wai-quantum npu-cores member / member · npu-cores absent (linux-arm64) (pull_request) Successful in 46s
wai-quantum pulse and dynamics / the same bits · linux-arm64 (pull_request) Successful in 2m14s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Failing after 16m38s
wai-quantum tensor-engine member / member · tensor engine absent (linux-arm64) (pull_request) Successful in 36s
wai-quantum variational and algorithm library / parameters, gradients, optimisers, VQE, QAOA and builders · linux-arm64, release (pull_request) Successful in 2m46s
wai-quantum extension points / the registry and the example · linux-arm64 (pull_request) Successful in 4m9s
wai-sink-android native sink library / the JNI layer and the platform-free half on the host JVM · linux-arm64 (pull_request) Successful in 4m31s
wai-quantum WebGPU member / member · GPU, Vulkan (jetson-hub) (pull_request) Successful in 49m48s
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Has been cancelled
A code-capacity point runs whole, so its pilot was one in a hundred of
its trials, run whole: 2,000 trials of colour:15 took 11 to 14 s in a
debug build beside the library's other tests (the macOS energy-receipts
leg at 7586335a7, and the Studio twice), before the call could be
refused for its 3 s. The pilot now runs in batches, each twice the one
before, while piloting() holds it, as a circuit's is: at least 8 trials,
then up to half a second. A trial has no setup of its own, so a batch's
time over its trials is the point's rate. The test's refusal bound is
5 s, from 10.

The setup-heavy decode in the same test is timed first with no time
set, then given twice that and a second: a fixed 15 s was a release
build's figure and refused it in a debug build under load.

Before, on the Studio, the whole library in debug: the test failed in
two runs of two (at the decode, and at the colour call after 14.5 s).
After: 1,411 passed, 0 failed, twice; Thor release 1,416 passed, and its
seven QEC tests in debug.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 08:43:42 -05:00

2026-11-07

Transaction Science
Merge main (e54f28102, wai-quantum 0.9.0) into wai/quantum-parse-depth
Some checks failed
wai-quantum views in agent hosts / views · the page and its engine (pull_request) Successful in 4m11s
wai-quantum studio and desktop / desktop app · linux (pull_request) Successful in 7m27s
wai-quantum WebGPU member / shader checks · browser build · wasip2 inertness (pull_request) Successful in 4m51s
wai-quantum WebGPU member / member · integrated GPU, Vulkan (framework-128gb) (pull_request) Successful in 9m19s
wai-quantum views in agent hosts / views · a scripted host (pull_request) Successful in 5m8s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Has been cancelled
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Has been cancelled
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Has been cancelled
wai-quantum command line / command line · linux (pull_request) Has been cancelled
wai-quantum signal processor / processor and member · signal processor, emulated (pull_request) Has been cancelled
WAI conformance / each feature of the independent verifiers' steps compiles alone (pull_request) Has been cancelled
wai-quantum HIP member / member · HIP absent (linux-arm64) (pull_request) Has been cancelled
wai-quantum npu-cores member / member · npu-cores absent (linux-arm64) (pull_request) Has been cancelled
wai-quantum docs, course and locales / every command and snippet in the docs · linux (pull_request) Has been cancelled
wai-quantum pulse and dynamics / the same bits · linux-arm64 (pull_request) Has been cancelled
wai-quantum extension points / the registry and the example · linux-arm64 (pull_request) Has been cancelled
wai-quantum studio and desktop / desktop app · windows (pull_request) Has been cancelled
wai-quantum tensor-engine member / member · tensor engine absent (linux-arm64) (pull_request) Has been cancelled
wai-quantum tensor-engine member / member · tensor engine, the kernel toolchain's simulator (linux) (pull_request) Has been cancelled
wai-quantum variational and algorithm library / parameters, gradients, optimisers, VQE, QAOA and builders · linux-arm64, release (pull_request) Has been cancelled
wai-quantum WebGPU member / member · GPU, Vulkan (thor) (pull_request) Has been cancelled
wai-sink-android native sink library / the JNI layer and the platform-free half on the host JVM · linux-arm64 (pull_request) Has been cancelled
wai-sink-swift native sink package / libwai slices, desktop tests, simulator tests · macos (pull_request) Has been cancelled
WAI Studio / Studio in WebKit · linux (pull_request) Has been cancelled
WAI Studio / Studio in Chromium and Firefox · macos (pull_request) Has been cancelled
wai-web reach builds / wai-web reach builds · this tree's wai-web, every rung on its engine line (pull_request) Has been cancelled
wai-web reach builds / wai-web reach builds · the package of record, every output as recorded (pull_request) Has been cancelled
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Has been cancelled
wai-quantum WebGPU member / member · GPU, Vulkan (jetson-hub) (pull_request) Has been cancelled
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Has been cancelled
elab.rs: main made a for loop's values lazily (LoopValues), as this branch
did (Values); main's type is kept, with its bits read one at a time, and
this branch's own type is dropped.

tests/reader_memory.rs nested 100 loops, past the reader's 64 levels on
this branch (Q006); it now nests as deep as the reader nests loops,
parse::MAX_NESTING - 8, as qasm::depth_tests does, and holds the same
memory bound at each depth.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 12:45:58 -05:00
Transaction Science
jouleclaw public-surface audit: the report goes to a file and the log keeps the verdict
The scan writes an 800 KB report at once. On 2026-11-07 three runs of it
(main at 208ffd374, #659 and #676), on three runners, kept a log that
stopped at 256 KiB mid-report, and each job was failed twelve minutes
later, though the scan's summary read "public surface only: 0". The
summary stays in the log, and on a failure so does the report's list of
what is missing; a pass logs 393 bytes. The error lines are single-quoted,
so their backticks are no longer run as commands.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 11:02:35 -05:00
Transaction Science
wai-quantum-service: ended jobs keep their request as text within caps, every answer comes within 55 s, a client's quick calls pass its own slow one, and a QEC call is timed apart from its setup
Third review of #676, 14 findings:

- A job keeps its request's canonical text, never its parse; a set lets
  go of its items when it ends; what ended jobs keep is capped per client
  (WAI_QSVC_CLIENT_KEPT_MIB, 128) and in all (WAI_QSVC_KEPT_MIB, 2048),
  oldest first. Bodies are parsed after the window check, reports are
  spliced from the text, memory is given back after large requests, and
  on macOS the service starts with the allocator's large cache off.
- One deadline from arrival, WAI_QSVC_ANSWER_SECS (55): turns, readings,
  run waits and MCP verdicts end by it; self-host.md gives each route's
  arithmetic under the proxy's 60 s.
- Past its share a client is lent one turn while two stay free, for 5 s;
  eight of its requests may wait; the refusal says whether its own
  requests or the pool held it up.
- QEC calls time each point's setup apart from a pilot of its shots,
  every threshold kind included, so a call is refused at once or run.
- Children are stopped by libc::kill on their process group, again
  every 100 ms until they end.
- The Breaking lines for E::Chain and S::If; OpenAPI statuses on every
  check route; the poll's empty critique in the changelog.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 11:02:35 -05:00
Transaction Science
wai-quantum-qec workflow: name the test that holds a call's shots to its time
Some checks failed
wai-quantum command line / command line · linux (pull_request) Successful in 38m12s
wai-quantum studio and desktop / desktop app · linux (pull_request) Successful in 10m22s
wai-quantum verdicts and repairs / verdicts, repairs and the intent set · linux (pull_request) Successful in 4m30s
wai-quantum verdicts and repairs / the intent set and the verdict under wasm32-wasip2 (wasmtime) (pull_request) Successful in 4m21s
wai-quantum views in agent hosts / views · the page and its engine (pull_request) Successful in 6m25s
wai-quantum views in agent hosts / views · a scripted host (pull_request) Successful in 6m37s
wai-quantum energy-landscape jobs / the same bits · linux-arm64 (pull_request) Successful in 9m13s
wai-quantum WebGPU member / shader checks · browser build · wasip2 inertness (pull_request) Successful in 4m24s
wai-quantum tensor-engine member / member · tensor engine, the kernel toolchain's simulator (linux) (pull_request) Successful in 9m10s
WAI Studio / the catalogue's actions, the unit tests and the core · linux (pull_request) Successful in 1m29s
wai-sink-android native sink library / every ABI, the AAR, and the instrumented tests in a headless emulator · macos (pull_request) Successful in 8m15s
wai-quantum WebGPU member / member · software Vulkan (linux) (pull_request) Successful in 8m5s
wai-sink-swift native sink package / libwai slices, desktop tests, simulator tests · macos (pull_request) Successful in 11m8s
wai-quantum studio and desktop / desktop app · windows (pull_request) Successful in 9m26s
wai-web reach builds / wai-web reach builds · the package of record, every output as recorded (pull_request) Successful in 4m45s
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Successful in 9m37s
wai-quantum WebGPU member / member · integrated GPU, Vulkan (framework-128gb) (pull_request) Successful in 14m29s
WAI Studio / Studio in Chromium and Firefox · macos (pull_request) Successful in 13m33s
wai-quantum HIP member / member · HIP absent (linux-arm64) (pull_request) Successful in 1m36s
wai-web reach builds / wai-web reach builds · this tree's wai-web, every rung on its engine line (pull_request) Successful in 9m27s
wai-quantum npu-cores member / member · npu-cores absent (linux-arm64) (pull_request) Successful in 43s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Successful in 34m20s
wai-quantum WebGPU member / member · GPU, Vulkan (thor) (pull_request) Successful in 24m0s
wai-quantum pulse and dynamics / the same bits · linux-arm64 (pull_request) Successful in 2m34s
wai-quantum tensor-engine member / member · tensor engine absent (linux-arm64) (pull_request) Successful in 32s
wai-quantum variational and algorithm library / parameters, gradients, optimisers, VQE, QAOA and builders · linux-arm64, release (pull_request) Successful in 2m37s
WAI Studio / Studio in WebKit · linux (pull_request) Successful in 20m49s
wai-quantum extension points / the registry and the example · linux-arm64 (pull_request) Successful in 4m28s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Failing after 18m25s
wai-sink-android native sink library / the JNI layer and the platform-free half on the host JVM · linux-arm64 (pull_request) Successful in 10m15s
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 08:10:24 -05:00
Transaction Science
Merge main into wai/quantum-parse-depth
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	.github/workflows/wai-quantum-lang.yml
#	.github/workflows/wai-quantum-qec.yml
#	wai/wai-quantum/docs/qec.md
#	wai/wai-quantum/src/qasm/elab.rs
#	wai/wai-quantum/src/quantum_frame.rs
2026-11-07 07:33:25 -05:00
Transaction Science
wai-quantum-service: a reading cut off for its answer is refused however its child ends
Some checks failed
wai-quantum OpenCL member / member · OpenCL GPU and CPU (thor) (pull_request) Successful in 1m14s
wai-quantum views in agent hosts / views · a scripted host (pull_request) Successful in 6m17s
WAI examples / WAI examples · portable · linux (pull_request) Successful in 12m2s
wai-web reach builds / wai-web reach builds · this tree's wai-web, every rung on its engine line (pull_request) Successful in 8m44s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Failing after 10m8s
wai-quantum WebGPU member / member · GPU, Vulkan (jetson-hub) (pull_request) Successful in 23m40s
WAI Studio / Studio in WebKit · linux (pull_request) Successful in 23m30s
wai-quantum WebGPU member / member · GPU, Vulkan (thor) (pull_request) Successful in 27m44s
joule-code conformance gate / joule-moq-relay, every target (pull_request) Successful in 3m32s
joule-moq-room room service / joule-moq-room, every target (pull_request) Successful in 4m52s
joule-code conformance gate / joule-moq-ingest, every target (pull_request) Successful in 8m14s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Failing after 3m20s
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Successful in 3m22s
repository checks / lockfiles, advisories, tests in CI, workflow hygiene, spec and section references, public text (pull_request) Successful in 11m19s
standards workspaces build + test / joule-code-rs (joule-code/joule-code-rs, joule-code-rs, linux-arm64, true) (pull_request) Successful in 12m47s
WAI conformance / delivery telemetry · CMCD and CMSD against an independent library (pull_request) Successful in 3m15s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Successful in 2m51s
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Successful in 4m29s
wai-quantum HIP member / member · HIP absent (linux-arm64) (pull_request) Successful in 3m6s
wai-quantum npu-cores member / member · npu-cores absent (linux-arm64) (pull_request) Successful in 1m1s
wai-quantum pulse and dynamics / the same bits · linux-arm64 (pull_request) Successful in 3m17s
wai-quantum tensor-engine member / member · tensor engine absent (linux-arm64) (pull_request) Successful in 26s
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Failing after 16m51s
wai-quantum extension points / the registry and the example · linux-arm64 (pull_request) Successful in 3m58s
WAI conformance / each feature of the independent verifiers' steps compiles alone (pull_request) Successful in 19m55s
wai-quantum variational and algorithm library / parameters, gradients, optimisers, VQE, QAOA and builders · linux-arm64, release (pull_request) Successful in 2m37s
wai-sink-android native sink library / the JNI layer and the platform-free half on the host JVM · linux-arm64 (pull_request) Successful in 4m52s
WAI examples / WAI examples · android-app · linux-arm64 (pull_request) Successful in 8m56s
wai-quantum energy-landscape jobs / the same bits · linux-arm64 (pull_request) Successful in 7m44s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Successful in 31m23s
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 02:51:37 -05:00
Transaction Science
Merge main into wai/quantum-parse-depth
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 02:35:30 -05:00
Transaction Science
wai-quantum: no anonymous request ends the job service or holds it without limit
The 33 findings of #676's review, each with a test that failed first.

- QEC texts: a detector or qubit index past 2^24 is refused on its line,
  offsets counted, where 79 bytes asked for 2.4 PB.
- Reading: a flat run of operators, an else-if chain and a switch's case values
  are held flat and walked in loops, at any length, left to right, so they read
  on 1 MiB and the generator's writer agrees; an array has at most 7 dimensions.
- Every read of a client's program is counted first and runs in a child capped
  in memory, time and answer: admission, dry runs, each check's bounds and answer
  in one budget, the engine calls, a set's receipt, and MCP verdicts.
- Turns: a client's share, a bound on those waiting, and no refund. A resend
  under its key is matched as received, reading nothing, and comes back past the
  window and with no turn to be had. A budget spent is a refusal whatever a check
  made of it. Retry-After is the pace that would not spend the window.
- MCP: a tool that says nothing of a program takes no turn; a poll reads nothing;
  a call not counted states why, so every answer keeps its verdict and its schema.
- Connections are held to a time for headers and for a body. A restart reads no
  program: a job keeps its plan and a set its items.
- Answers: the chain limit refuses the same statements in any order. A decode
  is held to 1,024 fired detectors. Two tests that could only hang now fail by name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 02:35:17 -05:00

2026-11-06

Transaction Science
Merge main into wai/quantum-parse-depth
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 23:40:57 -05:00
Transaction Science
wai-quantum: the reader holds its nesting (Q006), and the job service reads each request once, within one budget, off its request threads
Some checks failed
WAI Studio / Studio in WebKit · linux (pull_request) Successful in 10m36s
wai-web reach builds / wai-web reach builds · this tree's wai-web, every rung on its engine line (pull_request) Successful in 13m24s
wai-quantum studio and desktop / desktop app · linux (pull_request) Failing after 30m32s
wai-quantum studio and desktop / studio · browser (pull_request) Failing after 30m59s
wai-sink-swift native sink package / libwai slices, desktop tests, simulator tests · macos (pull_request) Successful in 18m50s
WAI Studio / Studio in Chromium and Firefox · macos (pull_request) Successful in 17m7s
repository checks / lockfiles, advisories, tests in CI, workflow hygiene, spec and section references, public text (pull_request) Successful in 4m4s
wai-quantum CUDA member / member · CUDA (jetson-hub) (pull_request) Successful in 1m43s
wai-quantum OpenCL member / member · OpenCL GPU and CPU (jetson-hub) (pull_request) Successful in 34s
wai-quantum service / service energy · linux packages (pull_request) Successful in 1m39s
wai-quantum portable tensor program / tensor program · GPUs (jetson-hub) (pull_request) Successful in 34s
wai-quantum WebGPU member / member · GPU, Vulkan (jetson-hub) (pull_request) Successful in 20m46s
joule-moq-room room service / joule-moq-room, every target (pull_request) Successful in 4m23s
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Successful in 40s
standards workspaces build + test / joule-code-rs (joule-code/joule-code-rs, joule-code-rs, linux-arm64, true) (pull_request) Successful in 14m36s
WAI conformance / delivery telemetry · CMCD and CMSD against an independent library (pull_request) Successful in 32s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Successful in 48s
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Successful in 2m38s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Successful in 23m37s
WAI examples / WAI examples · android-app · linux-arm64 (pull_request) Successful in 7m56s
wai-quantum npu-cores member / member · npu-cores absent (linux-arm64) (pull_request) Successful in 53s
wai-quantum HIP member / member · HIP absent (linux-arm64) (pull_request) Successful in 1m32s
wai-quantum pulse and dynamics / the same bits · linux-arm64 (pull_request) Successful in 2m2s
wai-quantum tensor-engine member / member · tensor engine absent (linux-arm64) (pull_request) Successful in 32s
WAI conformance / each feature of the independent verifiers' steps compiles alone (pull_request) Successful in 19m22s
wai-quantum variational and algorithm library / parameters, gradients, optimisers, VQE, QAOA and builders · linux-arm64, release (pull_request) Successful in 2m35s
wai-quantum extension points / the registry and the example · linux-arm64 (pull_request) Successful in 3m48s
wai-sink-android native sink library / the JNI layer and the platform-free half on the host JVM · linux-arm64 (pull_request) Successful in 4m12s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Successful in 21m56s
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Successful in 1h38m5s
A POST of about 1.3 KB with some 600 nested parentheses in `qasm`, or in an
intent's reference, ran the reader's recursion out of a tokio worker's 2 MiB
stack and aborted the whole service. And a job's references were read three or
four times each before any count, size or rate check, so a few small requests
with heavy references held every worker for minutes, uncounted.

- The reader's nesting. The parser refuses past 64 levels in a program's text
  (qasm::parse::MAX_NESTING: statements, parentheses, operators, brackets,
  calls, casts and types together, each expression tree as deep as its
  statement leaves room for, so a chain built in a loop is bounded too), the
  elaborator past 256 in all through the gates and subroutines it calls; both
  with the new code Q006. Binary operators are read by precedence climbing and
  each statement, expression and elaboration form by a function of its own, so
  a level stacks a few small frames.
- Every other reader of a client's text: instantiate's integer expressions,
  loops and conditions (an else-if chain now followed in a loop), the pulse
  reader through the parser, the error-correction texts' REPEAT blocks (at most
  32 deep; every pass counts toward the unroll bound; unrun blocks checked once
  on one copy), the editor's index (passed over past the limit), the answer
  layer's statement chains (32), and the dynamic expectation walk (a list, not
  a recursion, in the same order).
- A budget of reading: qasm::within_steps (as branch #648 introduced it, read
  once per program, one budget of steps), extended to count gates and a
  generator's loop passes, and qasm::steps_left to tell its refusal.
- The service admits by cost: a key's resend; the count (every later refusal
  counts); what reads nothing (at most 16 intents, 100 set items, exact
  numbers); then every program read once within 20 000 000 steps for the whole
  request (422, J031, past it); then the queue. Checks are counted before their
  bounds read anything. Admission, the checks and the MCP tools' verdicts run on
  threads of their own with 64 MiB stacks, four at a time, a panic failing only
  its request.
- Tests: every construct nested thousands deep on a 2 MiB thread, refused;
  inside the limit, read; a seeded property test; the service binary started
  in a test and sent such programs through every door, answering /v1/health
  after each; heavy references refused in bounded time and counted; the wasm
  engine, the CLI and the Python package refusing cleanly.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 09:44:36 -05:00