quantum-guarded-permutation-audit
Skill4 starsChanged 21 days agoMITView on GitHub
Find wrong-branch swaps and stale stream caches when a chunked reversible-circuit optimizer changes native endpoints. Use for deferred wire permutations, nested classical guards, or two nominally equivalent builds that disagree.
In this repository79 other files it gives its agents.
- AGENTS.mdAGENTS.md
- accepted-proof-exact-retuneSkill
- arxiv-portable-researchSkill
- auto-autoresearch-pipelineSkill
- beachhead-ratchetSkill
- bounded-commuting-foldSkill
- burn-the-house-downSkill
- calibrated-static-cost-proxySkill
- circuit-edit-integration-safetySkill
- colab-laneSkill
- computer-algebra-oraclesSkill
- constraint-construction-searchSkill
- cross-model-review-gateSkill
- deepseek-pressure-testSkill
- ecdsafail-fastevalSkill
- ecdsafail-lowq-playbookSkill
- ecdsafail-oracle-loopSkill
- ecdsafail-pareto-ratchetSkill
- ecdsafail-scratch-dietSkill
- elicit-researchSkill
- evaluator-scoring-surface-auditSkill
- exact-evaluator-replicaSkill
- exact-hold-passSkill
- exact-postpass-stackSkill
- exact-search-engineeringSkill
- fast-lean-proof-loopSkill
- fit-probe-and-spliceSkill
- gpu-affine-table-synthesisSkill
- greedyfrog-methodSkill
- hard-problem-contractSkill
- hold-demand-ledgerSkill
- hosted-carry-lendingSkill
- inert-op-screen-to-structural-ruleSkill
- invariant-chartSkill
- jev-second-perspectiveSkill
- lambda-exchange-deskSkill
- leader-rebase-stackSkill
- lean-arklib-proofsSkill
- lean-finite-certificate-splittingSkill
- lever-switches-and-break-controlsSkill
- mission-commandSkill
- nasqret-playbookSkill
- paged-walk-descentSkill
- peak-lifetime-ledgerSkill
- pinned-table-stackingSkill
- pip-disciplineSkill
- portable-source-assertionsSkill
- proximity-prize-campaignSkill
- proximity-prize-frontier-archaeologySkill
- quantum-affine-lookup-synthesisSkill
- quantum-borrowed-wire-counterexampleSkill
- quantum-dense-qromSkill
- quantum-dirty-borrowingSkill
- quantum-divstep-reconstructionSkill
- quantum-encoded-arithmeticSkill
- quantum-graded-divider-placementSkill
- quantum-mbundo-lifetimesSkill
- quantum-record-miningSkill
- quantum-replay-arithmeticSkill
- quantum-residue-scan-ambiguitySkill
- The first 60 shown.
The file
Files
Hüetlispiler (quantum-guarded-permutation-audit)
Audit deferred swaps across guarded chunks
An eliminated SWAP leaves a permutation of physical wires. Record the guard under which the swap executed. Every subsequent quantum operand must use the correct map, and any physical operation that settles the permutation must execute on exactly those branches that owe it.
Smallest failing program
Start with (q0,q1)=(1,0). Emit CX 0 1; CX 1 0; CX 0 1; PUSH c and end the chunk. Leave the matching POP to the next chunk. The source exchanges the bits for both values of c. A pass that appends three restoring CXs after the PUSH returns (1,0) when c=0. A trial with equal input bits or only c=1 hides the defect.
- Freeze the raw input, actual chunk boundaries, pass order and emitted bytes. Locate the first differing boundary and then the first differing pass. Compare in the same physical wire frame, including the ambient classical stack.
- Reverse-scan the chunk. Count locally available POPs and match each to the nearest preceding PUSH. For a PUSH whose POP is in a later chunk, settle any outstanding outer permutation immediately before entering it. Settle a scope's own permutation before popping it. A locally balanced nested scope may still optimize if the implementation preserves the maps on entry and exit.
- Exercise all four data states and both guard values. Extend to nested true/false guards, chunks starting inside a guard, and a POP closing an incoming scope. Compare the complete live state, classical stack and phase. Couple shared measurement draws by original event identity for diagnosis and reserve distinct draws for new events. Run the ordinary native evaluator with its own prescribed randomness for qualification.
- If a cold evaluation and a warm replay disagree, key the prefix cache on the full stream content, evaluator format/version and the inputs that determine the prefix. Include the header and hash domain where either sets the draw or wire width. Forge a control with different bytes, equal length and equal file timestamp. Both warm results must reproduce their respective cold results.
Report the smallest input, chunk span and branch causing the discrepancy, raw and pass hashes, and the first differing state. Remeasure cost only on the repaired pipeline. A local campaign test found the old pass wrong on 123,196 of 768,000 small circuit/input combinations. The four-row witness explains the failure independently of that sample.
For the underlying register-permutation semantics, see Hietala et al..
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

