From d6babec41a3d01928c3dbdb896ea2adf051ba305 Mon Sep 17 00:00:00 2001 From: Ali Romman <226877337+aliromman@users.noreply.github.com> Date: Wed, 18 Nov 2026 18:08:23 -0500 Subject: [PATCH] Construct one reversible arithmetic draw for all runtime residue pairs --- .../.gitattributes | 1 + .../runtime-paired-ddg-arithmetic/CREDITS.md | 51 + .../runtime-paired-ddg-arithmetic/PROOF.md | 155 +++ .../runtime-paired-ddg-arithmetic/README.md | 54 ++ .../runtime-paired-ddg-arithmetic/RESULT.json | 892 ++++++++++++++++++ .../SOURCE-PINS.json | 79 ++ .../SOURCES.json | 18 + .../runtime-paired-ddg-arithmetic/TASK.json | 97 ++ .../runtime-paired-ddg-arithmetic/VERIFY.json | 32 + .../parametric.py | 126 +++ .../paired-ddg-arithmetic-step/PROOF.md | 79 ++ .../paired-ddg-arithmetic-step/README.md | 81 ++ .../paired-ddg-arithmetic-step/SOURCES.json | 30 + .../paired-ddg-arithmetic-step/TASK.json | 97 ++ .../paired-ddg-arithmetic-step/VERIFY.json | 40 + .../paired-ddg-arithmetic-step/circuit.py | 170 ++++ .../paired-ddg-arithmetic-step/verify.py | 96 ++ .../retained/paired-ddg-reversal/PROOF.md | 130 +++ .../retained/paired-ddg-reversal/README.md | 94 ++ .../retained/paired-residue-sampler/README.md | 188 ++++ .../retained/paired-residue-sampler/verify.py | 121 +++ .../runtime-paired-ddg-arithmetic/sources.py | 23 + .../runtime-paired-ddg-arithmetic/verify.py | 164 ++++ 23 files changed, 2818 insertions(+) create mode 100644 research/runtime-paired-ddg-arithmetic/.gitattributes create mode 100644 research/runtime-paired-ddg-arithmetic/CREDITS.md create mode 100644 research/runtime-paired-ddg-arithmetic/PROOF.md create mode 100644 research/runtime-paired-ddg-arithmetic/README.md create mode 100644 research/runtime-paired-ddg-arithmetic/RESULT.json create mode 100644 research/runtime-paired-ddg-arithmetic/SOURCE-PINS.json create mode 100644 research/runtime-paired-ddg-arithmetic/SOURCES.json create mode 100644 research/runtime-paired-ddg-arithmetic/TASK.json create mode 100644 research/runtime-paired-ddg-arithmetic/VERIFY.json create mode 100644 research/runtime-paired-ddg-arithmetic/parametric.py create mode 100644 research/runtime-paired-ddg-arithmetic/retained/paired-ddg-arithmetic-step/PROOF.md create mode 100644 research/runtime-paired-ddg-arithmetic/retained/paired-ddg-arithmetic-step/README.md create mode 100644 research/runtime-paired-ddg-arithmetic/retained/paired-ddg-arithmetic-step/SOURCES.json create mode 100644 research/runtime-paired-ddg-arithmetic/retained/paired-ddg-arithmetic-step/TASK.json create mode 100644 research/runtime-paired-ddg-arithmetic/retained/paired-ddg-arithmetic-step/VERIFY.json create mode 100644 research/runtime-paired-ddg-arithmetic/retained/paired-ddg-arithmetic-step/circuit.py create mode 100644 research/runtime-paired-ddg-arithmetic/retained/paired-ddg-arithmetic-step/verify.py create mode 100644 research/runtime-paired-ddg-arithmetic/retained/paired-ddg-reversal/PROOF.md create mode 100644 research/runtime-paired-ddg-arithmetic/retained/paired-ddg-reversal/README.md create mode 100644 research/runtime-paired-ddg-arithmetic/retained/paired-residue-sampler/README.md create mode 100644 research/runtime-paired-ddg-arithmetic/retained/paired-residue-sampler/verify.py create mode 100644 research/runtime-paired-ddg-arithmetic/sources.py create mode 100644 research/runtime-paired-ddg-arithmetic/verify.py diff --git a/research/runtime-paired-ddg-arithmetic/.gitattributes b/research/runtime-paired-ddg-arithmetic/.gitattributes new file mode 100644 index 0000000000..130a3ecaa2 --- /dev/null +++ b/research/runtime-paired-ddg-arithmetic/.gitattributes @@ -0,0 +1 @@ +retained/** -text whitespace=cr-at-eol diff --git a/research/runtime-paired-ddg-arithmetic/CREDITS.md b/research/runtime-paired-ddg-arithmetic/CREDITS.md new file mode 100644 index 0000000000..a57aedd4da --- /dev/null +++ b/research/runtime-paired-ddg-arithmetic/CREDITS.md @@ -0,0 +1,51 @@ +# Sources and attribution + +Ali Romman supplied the runtime-parameter construction, shared residue +arithmetic, full gate bill and complete checks, with substantial OpenAI +Codex assistance in research, implementation, verification and writing. +New code and prose are Apache-2.0. + +Nick Petalas supplied the fixed-pair arithmetic circuit and explicit +runtime-parameter question in +[PR #7746](https://github.com/CrocSwap/integer-mult-bounds/pull/7746), head +`71fdb2cf1ec973b5402c4d3c2466864014a1ccda`. Its +[circuit](https://github.com/petalas/integer-mult-bounds/blob/71fdb2cf1ec973b5402c4d3c2466864014a1ccda/research/paired-ddg-arithmetic-step/circuit.py) +supplies the unchanged Boolean primitives and modular addition. Its +[proof](https://github.com/petalas/integer-mult-bounds/blob/71fdb2cf1ec973b5402c4d3c2466864014a1ccda/research/paired-ddg-arithmetic-step/PROOF.md) +supplies the shared phase and compute-copy-swap-uncompute method. The new +subclass changes only the wire layout and allocation bound; no source +global or function is replaced. All seven source package files are retained, +and the original fixed-pair verifier runs unchanged. + +zxv, with substantial OpenAI Codex assistance, supplied the complete paired +decision graphs, probability law and expected-bit optimum in +[PR #6072](https://github.com/CrocSwap/integer-mult-bounds/pull/6072), head +`9011bf83e85ecd0443c789cf03259442f750877d`. Its +[constructor](https://github.com/zxv/integer-mult-bounds/blob/9011bf83e85ecd0443c789cf03259442f750877d/research/paired-residue-sampler/verify.py) +and [proof](https://github.com/zxv/integer-mult-bounds/blob/9011bf83e85ecd0443c789cf03259442f750877d/research/paired-residue-sampler/README.md) +are retained. The unchanged constructor runs for all 144 pairs. The original +full probability/mean catalogue entry point was not run. Its classical DDG, +JoyboyBrian inverse and Nick Petalas stochastic-prefix credit remains intact. + +JoyboyBrian, with substantial OpenAI Codex assistance, supplied the inverse +and counter-based lifecycle context in +[PR #6102](https://github.com/CrocSwap/integer-mult-bounds/pull/6102), head +`0422af13625c2e7e8ece28bdd74364a61764c64a`. Its +[proof](https://github.com/JoyboyBrian/integer-mult-bounds/blob/0422af13625c2e7e8ece28bdd74364a61764c64a/research/paired-ddg-reversal/PROOF.md) +and README are retained. Its complete suite was not run and its physical +counter obligations are not discharged by a circuit step. + +Related work, not executable input: Nick Petalas's +[PR #7187](https://github.com/CrocSwap/integer-mult-bounds/pull/7187), head +`5504be187271a90a3a46e497ed2d5b4196c5df8a`, gives the +[resident table bank](https://github.com/petalas/integer-mult-bounds/blob/5504be187271a90a3a46e497ed2d5b4196c5df8a/research/signed-swap-residue-bank/PROOF.md) +under an output-relabelling contract. It was read for overlap. His +[PR #6127](https://github.com/CrocSwap/integer-mult-bounds/pull/6127) supplies +a different owned-delimiter boundary for the fixed pair. This package does +not claim those earlier table or tape results and does not transfer their +tariffs to the new circuit. + +All eleven retained files have Git-blob and SHA-256 pins and keep their +original notices. The base manifest records provenance only; no unmerged +source ancestry is asserted. Separate finite checks do not constitute +independent human or formal-kernel acceptance. diff --git a/research/runtime-paired-ddg-arithmetic/PROOF.md b/research/runtime-paired-ddg-arithmetic/PROOF.md new file mode 100644 index 0000000000..36ae170348 --- /dev/null +++ b/research/runtime-paired-ddg-arithmetic/PROOF.md @@ -0,0 +1,155 @@ +# A reversible draw for runtime residue parameters + +## Contract and result + +The caller supplies read-only parameters a,b with 1 <= a,b <= 12 before +the first coin is read. They remain fixed through the draw. The packet has +an eight-bit phase theta, a two-bit live-node index or output label, and one +stopping flag. A separate resident coin is read-only. On entry, the packet +is a reachable unfinished state of zxv's denominator-13 graph, and all +2,146 work bits are zero. + +One fixed circuit maps this packet to the source graph's next packet, +preserves the two parameters and coin, and returns every work bit to zero. +Its gate list is independent of a,b and the phase. Its reverse maps every +valid result back to the exact input with zero workspace. + +| Resource per draw | Count | +| --- | ---: | +| X gates | 864 | +| CNOT gates | 10,054 | +| Toffoli gates | 3,104 | +| Total gates | 14,022 | +| Temporary Boolean wires | 2,135 | +| Clean packet backing bits | 11 | +| Total clean work bits | 2,146 | +| Live packet bits | 11 | +| Read-only parameter bits | 8 | +| Resident coin bits | 1 | + +The total circuit has 2,166 wires. Parameter arithmetic, packet copying, +swapping and uncomputation are included. Loading the caller's parameters, +physical wire access, random-tape movement and stopping storage are not +included. This is a gate-level construction, not a tape tariff or speedup. +It is larger than the fixed-pair circuit and serves a larger input domain. + +## Shared phase and parameter arithmetic + +The ordered outcome weights are + +```text +(w00, w01, w10, w11) = ((13-a)(13-b), (13-a)b, a(13-b), ab). +``` + +At depth k, keep theta = 2^k mod 169. For any weight w, its next binary +probability digit is one exactly when `(w*theta mod169) >= 85`. This follows +by subtracting twice the floor at depth k from the floor at depth k+1. + +All arithmetic below is modulo 169. Generate theta, 2theta, 4theta and +8theta by modular doubling. The four runtime bits of a select these values; +three modular additions give `a*theta`. Do the same for b, using the same +four phase multiples. Generate four multiples of `a*theta` and `b*theta`. +The bits of b applied to the former give `rho = ab*theta`. Two additions +give each of `alpha = 13a*theta` and `beta = 13b*theta` from coefficients 1,4,8. +The four required residues are + +```text +rho-alpha-beta, beta-rho, alpha-rho, rho. +``` + +Thus all four probability digits come from the shared phase and the two +runtime parameters. No weight, phase-digit or transition table is stored. +Every modular result is reduced before the next operation. The threshold +test is the top bit of the nine-bit sum r+171 for 0 <= r <= 168. + +The source modular adder is retained unchanged. For the new subtraction, +compute delta = left-right modulo 512 in nine bits. Its mathematical +range is [-168,168], so the top bit is set exactly when the difference is +negative. In that case, select delta+169 modulo 512; otherwise select +delta. The resulting low eight bits represent the reduced difference in +[0,168]. The verifier checks all 169 squared operand pairs and reverses +the whole subtraction computation, including its temporary wires. + +## Ordered forward and inverse maps + +Let d0,d1,d2,d3 be the four digits. Set c_i to the sum of the digits before +label i, and D to their total. For node j and coin u, form m = 2j+u. The +source returns label i exactly when d_i=1 and m=c_i. These conditions are +mutually exclusive. If no leaf condition holds, the next live index is +m-D. The next phase is 2theta mod169. The two output bits and stopping +flag are built from the four leaf conditions; no output relabelling occurs. + +For the inverse, recover the old phase from the new one: + +```text +theta = (theta_new + 169*(theta_new mod2))/2. +``` + +Recompute the four digits using the same retained parameters. For a live +output j', recover m=j'+D. For a terminal output i, recover m=c_i. Then +the old node is floor(m/2) and its stopping flag is zero. On the valid +domain, m mod2 is the resident coin. The verifier checks every such edge, +including the closing edge of the 156-phase period. + +Each Boolean computation uses X, CNOT and Toffoli on clean temporary +wires. Compute the next packet, XOR it into the clean backing packet, and +reverse the computation. Swap the two packets with three CNOT gates per +bit. Compute the inverse packet and XOR it out of the backing, then +reverse that computation. Since the forward and inverse formulas agree +on the reachable domain, the backing and temporary wires are zero on exit. +Both computations reuse the same temporary region after clearing it. + +The unchanged source Boolean primitives use a configurable allocation +cursor through an ordinary subclass. The subclass supplies the new wire +layout and a finite compile-time allocation bound. It changes no retained +function or module global. A gate list is emitted once; Python allocation +is part of generation and is not a runtime circuit operation. + +## Complete finite evidence and all-depth consequence + +The reference path calls the unchanged graph constructor for every one of +the 144 parameter pairs. Independently, it computes binary digits from +integer floors at all 156 phases and reconstructs each live-node transition. +The two descriptions agree on all 624 transitions per pair, or 89,856 in +total. The phase does not repeat before the closing edge, and the live count +returns to one. Every claimed input packet and both coin values are covered. + +A bit-lane gate interpreter executes all these inputs together and compares +every wire, including both parameters, the coin and all zero work bits. +It also runs the reverse gate list on every reference output. A separate +scalar bit-state interpreter checks both directions on 288 root and final +phase cases, two per parameter pair. Four controls detect a wrong stopping +flag, changed parameter, dirty work bit and exchanged output order. + +The fixed-pair source verifier runs unchanged. The new arithmetic also +checks all 28,561 modular subtraction inputs and their uncomputation. +The result certificate records the gate hash, exact bill and a complete +transition digest for each pair. The verifier reconstructs these data. + +Start at phase one, node zero and stopping flag zero. Each executed gate +step equals the source transition on its reachable input. Induction therefore +preserves the output and first stopping depth on every ordered coin path, +including paths that pass through any number of phase wraps. The predecessor +product law and expected-bit optimum transfer under its fixed nonadaptive +parameter and independent fair-coin assumptions. They are predecessor results, +not new probability theorems in this package. + +## Resource and conclusion limits + +The circuit removes per-parameter transition data from the runtime service. +The fixed gate description and its physical execution still cost resources. +No total-ROM minimum or byte saving over a compressed circuit description is +claimed. The resident-table bank in PR7187 changes the coin-to-label contract; +its payload count is not a physical runtime baseline for this circuit. + +Stopping time remains unbounded. The caller must provide and retain the two +parameters throughout any later cleanup. This package does not install the +circuit in either the counter protocol of PR6102 or the owned-delimiter +protocol of PR6127. Their tape boundaries are distinct. Random-tape access, +output retention, stopping storage, a reached nonadaptive caller and the full +native invoice remain open for this arithmetic service. Restoring coins does +not make them independent of a retained output. Parameters outside 1..12 and +unreachable packets are outside the clean-workspace contract. + +No new kappa, selected assumption discharge, independent human review or +formal-kernel acceptance is claimed. All five framework assumptions remain. diff --git a/research/runtime-paired-ddg-arithmetic/README.md b/research/runtime-paired-ddg-arithmetic/README.md new file mode 100644 index 0000000000..5b331757c2 --- /dev/null +++ b/research/runtime-paired-ddg-arithmetic/README.md @@ -0,0 +1,54 @@ +# One arithmetic circuit for all runtime residue pairs + +One fixed reversible circuit implements a draw for all **144** nonzero +denominator-13 residue pairs supplied at runtime. It uses **14,022 gates** +and **2,146 clean work bits**, including parameter arithmetic and cleanup. +Both parameters and the coin remain unchanged. The original ordered +coin-to-label function and first stopping depth are preserved. + +Read [the contract and proof](PROOF.md), [the circuit generator](parametric.py), +[the exact bill and pair certificates](RESULT.json), [the checker](verify.py), +[source pins](SOURCE-PINS.json) and [source credit](CREDITS.md). + +The circuit computes four weight residues from one phase and two four-bit +parameters. It replaces transition-data lookup with arithmetic. This is a +larger input domain and a larger circuit than the fixed-pair predecessor; +no physical speedup or total-code-size saving is claimed. + +Python 3.12, standard library only: + +```sh +python3.12 -B scripts/research_package.py --package research/runtime-paired-ddg-arithmetic +``` + +Both registered commands print: + +```text +PASS_RUNTIME_PAIRED_DDG_ARITHMETIC +144 runtime pairs; 89856 complete forward/inverse transitions +864 X; 10054 CNOT; 3104 Toffoli; 14022 gates +2135 temporary bits + 11 clean backing bits = 2146 clean work bits +``` + +All 89,856 reachable edges agree with the unchanged source constructor +and a separate integer-floor description. Every output and work wire is +checked in both directions. A scalar interpreter checks 288 cases in both +directions. All 28,561 subtraction inputs, four fault controls and the +unchanged fixed-pair verifier pass. No historical full catalogue, native, +selected cold, Lean or Docker replay is claimed. + +No new kappa follows. Stopping time remains unbounded. Physical tape +movement, parameter loading, output retention, stopping storage, conditional +freshness and a reached nonadaptive caller remain separate obligations. +The selected frontier and all five framework assumptions remain unchanged. + +## Open next questions + +- Install this fixed circuit in a stated tape layout and charge access to + all wires, parameters and consumed coins for a terminating path. Compare + the counter and owned-delimiter boundaries before selecting one. +- Can a smaller exact circuit retain the same runtime input and ordered + output contract? Start with the complete transition certificate and + count preparation, inverse computation and cleanup together. + +Prepared by Ali Romman with substantial OpenAI Codex assistance. Apache-2.0. diff --git a/research/runtime-paired-ddg-arithmetic/RESULT.json b/research/runtime-paired-ddg-arithmetic/RESULT.json new file mode 100644 index 0000000000..88d5575e1a --- /dev/null +++ b/research/runtime-paired-ddg-arithmetic/RESULT.json @@ -0,0 +1,892 @@ +{ + "schema_version": 1, + "parameter_pairs": 144, + "transitions": 89856, + "gates": 14022, + "x": 864, + "cnot": 10054, + "toffoli": 3104, + "packet_bits": 11, + "parameter_bits": 8, + "resident_coin_bits": 1, + "clean_backing_bits": 11, + "temporary_bits": 2135, + "clean_work_bits": 2146, + "total_wires": 2166, + "gate_sha256": "274747db13049abd7c8ac8b5285c352ca5c7b3d9e721359491fed20cb2a93f5e", + "subtraction_cases": 28561, + "scalar_forward_inverse_cases": 288, + "fault_controls": 4, + "source_receipt": [ + "PASS_PAIRED_DDG_ARITHMETIC_STEP", + "624 complete forward/inverse transitions; two fault controls", + "232 X, 2238 CNOT, 590 Toffoli; 3060 total gates", + "473 temporary Boolean wires plus 11 clean packet backing bits" + ], + "pair_certificates": [ + { + "a": 1, + "b": 1, + "transitions": 624, + "sha256": "f73847f991da7f217ba2999c24c346287d21e36665c91394c3f605a19d4e68a9" + }, + { + "a": 1, + "b": 2, + "transitions": 624, + "sha256": "c78770d725e2338011e1b1d3d361eef539abba8dca64e48ce409cf5b2e27f590" + }, + { + "a": 1, + "b": 3, + "transitions": 624, + "sha256": "82359c8783b965fd4f3d59e910fa0f84e12f2edd3da709d226b544b26e4590fc" + }, + { + "a": 1, + "b": 4, + "transitions": 624, + "sha256": "b67bad566c34f763e41e5aae745b6e928eee1b95d424a08e6a680b6f0ab23d8f" + }, + { + "a": 1, + "b": 5, + "transitions": 624, + "sha256": "8c2ffb835a397cd693dc9d639026c03bbfdc416ad962b6ab9af71c977dfb3fee" + }, + { + "a": 1, + "b": 6, + "transitions": 624, + "sha256": "20f711a5476adeb9172501e2735d3dfd0cf784ea36c1abb64603d840773ccad7" + }, + { + "a": 1, + "b": 7, + "transitions": 624, + "sha256": "45bf08f79314833dd5ae1207e72aa6140fcd404ea9cd7980a98bd0e1535c6731" + }, + { + "a": 1, + "b": 8, + "transitions": 624, + "sha256": "d3437336b065fa1a61c6fe2b4cc54ffcbb0023806135b588b64c9412b715a170" + }, + { + "a": 1, + "b": 9, + "transitions": 624, + "sha256": "50b09efa0eb330364b84c47f1f2b6c868724f46c43463c33adecbbd65731664e" + }, + { + "a": 1, + "b": 10, + "transitions": 624, + "sha256": "a577a20c67339899fa95cfe43247e9734ec80405fa6787e954b348903cea040e" + }, + { + "a": 1, + "b": 11, + "transitions": 624, + "sha256": "8af42451620823ec437ddbaf6f24777c6f05eef7d38e75f07e974aad59b9e6c1" + }, + { + "a": 1, + "b": 12, + "transitions": 624, + "sha256": "42548d595896c72566e0202197328067ea853ea6352dcb734ae15dd3d7811588" + }, + { + "a": 2, + "b": 1, + "transitions": 624, + "sha256": "4767d27bed81e39f37c6399b5e5e3fc55e7a7bebd52414f80b6d6afa8729ae8f" + }, + { + "a": 2, + "b": 2, + "transitions": 624, + "sha256": "fdf4a097225569e0a95924342dddf015add021b80c66a31b4078f3f1a248bec8" + }, + { + "a": 2, + "b": 3, + "transitions": 624, + "sha256": "6076117f7b3d66be0658912366849a885efaed721d89238a7e26c39b326f6f1d" + }, + { + "a": 2, + "b": 4, + "transitions": 624, + "sha256": "66e42bacee7b05c16c10efd08b7c78326baf1f12e9324b6615a51d7f344cf0a5" + }, + { + "a": 2, + "b": 5, + "transitions": 624, + "sha256": "84b973da3bb1f659d14eb830f2af93b44fb9c5006d7a9c6142b1629662362fcd" + }, + { + "a": 2, + "b": 6, + "transitions": 624, + "sha256": "e9974842e712be4a1c5114ecfd0c8051742159438693e27a53baafc435508158" + }, + { + "a": 2, + "b": 7, + "transitions": 624, + "sha256": "29818af8b53d9ade40b73c910bd6a0be6e62a7c7fe47f856fb3c2d57ac4149e5" + }, + { + "a": 2, + "b": 8, + "transitions": 624, + "sha256": "7e6f02255b6a4bf97b9f9c3535addafed7cce647192f8d2c82a6f1d04b310ab1" + }, + { + "a": 2, + "b": 9, + "transitions": 624, + "sha256": "ac1d937d1fa294fbe737623f92f7d7c4f82a3ca6feaabebb877b3d7f940604d7" + }, + { + "a": 2, + "b": 10, + "transitions": 624, + "sha256": "91f2d18442bdce8b21c623abdfc9b8418ffe159604f3505c27ef88deb6e3e6d9" + }, + { + "a": 2, + "b": 11, + "transitions": 624, + "sha256": "304c4843b9662acc4434726cb6aaef041a3c4aedaa5fc5bb4dae4f9b1a9d82b0" + }, + { + "a": 2, + "b": 12, + "transitions": 624, + "sha256": "e2b048357a0378922586239c06e700720b2de99f1434e9fbe9489dc3689a963a" + }, + { + "a": 3, + "b": 1, + "transitions": 624, + "sha256": "fceeed31f7f89f2cf0ff88b06ce34b3abd6a6542e2fd81e102c65dc4e2d60ac8" + }, + { + "a": 3, + "b": 2, + "transitions": 624, + "sha256": "25145024b491b5a2a966068bedc0ff1161c017021bb4c1238306832e34631008" + }, + { + "a": 3, + "b": 3, + "transitions": 624, + "sha256": "310204caaa2ea80d3cd1ab4b66d3c6d1406319a506e819ec08c6155295eb91e5" + }, + { + "a": 3, + "b": 4, + "transitions": 624, + "sha256": "4c282b94defbce3c106f946674134cd890ed9b370d4dc6c3eb2dd050652b68c7" + }, + { + "a": 3, + "b": 5, + "transitions": 624, + "sha256": "b840b4ad466d74f27cd6817ffcf7b2db65f83910683ade3658ecc0c53fdc8bb8" + }, + { + "a": 3, + "b": 6, + "transitions": 624, + "sha256": "db859c3cc727435dd1d916745c0efe8d6c47cd40576c3ab93c2a315af222cba8" + }, + { + "a": 3, + "b": 7, + "transitions": 624, + "sha256": "e7c54c7c0f990ed7400047b8efd6382b23606a4c93bde78ff965ac2732fd7066" + }, + { + "a": 3, + "b": 8, + "transitions": 624, + "sha256": "631f2f581a70840f35e6825df9a899f2559634e4de0e68eb30689748afda4a98" + }, + { + "a": 3, + "b": 9, + "transitions": 624, + "sha256": "7138b3879e26023a0dea9e521ae6ade1fd0cba8b32b65913334d34fbc8c0e7da" + }, + { + "a": 3, + "b": 10, + "transitions": 624, + "sha256": "a0ab3017519894f00554e2f8e9f494a9215ad9588da4b059eb3ffaf8e5bb679e" + }, + { + "a": 3, + "b": 11, + "transitions": 624, + "sha256": "21551f0fbd55789b4ef2884e4bb23e40182acc9de58f339f6b1a7fb2b042b9bb" + }, + { + "a": 3, + "b": 12, + "transitions": 624, + "sha256": "1bdd3f02969e5e8898cbeb2d29c385cae4dc11195601a04d364e4e120b62e4e6" + }, + { + "a": 4, + "b": 1, + "transitions": 624, + "sha256": "91f16cd4e136855eaab2751b73e116fc7e7ab563449fa334fd732ab7347de9c9" + }, + { + "a": 4, + "b": 2, + "transitions": 624, + "sha256": "cff140fe9d807e7529f9376eeb6cd82b765f097a3db5182848155e6d6d446c36" + }, + { + "a": 4, + "b": 3, + "transitions": 624, + "sha256": "0914c18257b33eacff805bb0feb02a077c56caebea311b79517f6a8efc22f32b" + }, + { + "a": 4, + "b": 4, + "transitions": 624, + "sha256": "99f01bb063a6695c943127c4ce55a2a4472cec1f7916deb4b0e35ff24099eb97" + }, + { + "a": 4, + "b": 5, + "transitions": 624, + "sha256": "4c05cc6dcdbc7905cb3cadc3f8398a67a1f6bb1b80af519a7c555a99967a93d3" + }, + { + "a": 4, + "b": 6, + "transitions": 624, + "sha256": "57b20cc9a57955976749dea2c17400c565b301837afd6f5e16776d82f78fb68e" + }, + { + "a": 4, + "b": 7, + "transitions": 624, + "sha256": "81c4bcd1b9685c01e34eb49a47ccc9c3182d642df05c198e1337e8179933f037" + }, + { + "a": 4, + "b": 8, + "transitions": 624, + "sha256": "62cc5f6fac55b2b113edc3db1aba947ecc1ff879591857b0da50f1e1698c43ba" + }, + { + "a": 4, + "b": 9, + "transitions": 624, + "sha256": "4f8ecb65755f1911d938b86e9a9a22f86d8f7c295745fef19d735209a062ca6e" + }, + { + "a": 4, + "b": 10, + "transitions": 624, + "sha256": "3ec495a13a2160cde315e16c087e137fe0d148381a55192a34dff36a39b30513" + }, + { + "a": 4, + "b": 11, + "transitions": 624, + "sha256": "217cb40e29dddff9946c8e2bfa5370f8761ac3571a4dd3b76a980fc38426ff19" + }, + { + "a": 4, + "b": 12, + "transitions": 624, + "sha256": "de6f1e4221a6261bfbdf1c0d710a6e8fa7f4133fccf777acb2cfed519f597d0d" + }, + { + "a": 5, + "b": 1, + "transitions": 624, + "sha256": "5b56def19f9f21ed6db3161008bf064829b99cefe43f8fe5615ec0f6864baaa4" + }, + { + "a": 5, + "b": 2, + "transitions": 624, + "sha256": "b09d685ef4c97957cb52020fa5969bf13d9dd76a974d7f3553f6d4faf44b3f7a" + }, + { + "a": 5, + "b": 3, + "transitions": 624, + "sha256": "0d4832b89f946c1239b832253357580792d9ebdda3e26996895333a2cb2059fb" + }, + { + "a": 5, + "b": 4, + "transitions": 624, + "sha256": "e913d562e76c90fc3f5e480b8757339a01b2e9739b30159b022b2a3630ad8039" + }, + { + "a": 5, + "b": 5, + "transitions": 624, + "sha256": "64f7ccc271284ba4648fce239beed6ca882c777bf5f78665880f6a87f29b29f0" + }, + { + "a": 5, + "b": 6, + "transitions": 624, + "sha256": "567702a9b203cc24b2657edf593c03617df6f0b9230085699da0c8919beadf53" + }, + { + "a": 5, + "b": 7, + "transitions": 624, + "sha256": "cdf90af66950bf2635dce49a8164862edf2d5c7ec869d7974c4d4dbafd615efd" + }, + { + "a": 5, + "b": 8, + "transitions": 624, + "sha256": "79a4875f29fce6d59af95d0189e127fe1877d742750b83a632aeb0f345c16151" + }, + { + "a": 5, + "b": 9, + "transitions": 624, + "sha256": "e7a8090ea929b1243eb8308afae0304d2227140575caaa2ee1d1c6ffeb9796b6" + }, + { + "a": 5, + "b": 10, + "transitions": 624, + "sha256": "498f31746782a10922d47114e6ba1c22a069d3de873d22cd1d2e9fbe59bb4ed8" + }, + { + "a": 5, + "b": 11, + "transitions": 624, + "sha256": "21c0151da692785b2b678c282bc1935df1fd6a0e1332e8591f6451c2ae3080a9" + }, + { + "a": 5, + "b": 12, + "transitions": 624, + "sha256": "bfee78613e8882bd5a167d9fc3d2ce5ff8d923c2bacc1a7f736445076f301ea6" + }, + { + "a": 6, + "b": 1, + "transitions": 624, + "sha256": "b8e600f7583d94da25d0ec74b29794fa4861a4b37e1936fbce6602fff087ede8" + }, + { + "a": 6, + "b": 2, + "transitions": 624, + "sha256": "98bec2bf3abafe7aea021211d4dc0c1a80c4df94f2712eeb6ed10fc48f35c877" + }, + { + "a": 6, + "b": 3, + "transitions": 624, + "sha256": "27d7ce7d7aec3ce36445e639036519ea9e15a32daefc29302adb61a382d96b98" + }, + { + "a": 6, + "b": 4, + "transitions": 624, + "sha256": "702584c50ac97f49feaa4a47cad668ff5f5609836cea69785849dbbed4b533c6" + }, + { + "a": 6, + "b": 5, + "transitions": 624, + "sha256": "a36b0b6d276090e598d1e2ecb6ea617ed4300b4d32d7aa07f1e4e76aad6908e0" + }, + { + "a": 6, + "b": 6, + "transitions": 624, + "sha256": "4d22bc6c628c3e341da85a0adb0ee5da0637e3f5d0cd63266d1a5c446743c65c" + }, + { + "a": 6, + "b": 7, + "transitions": 624, + "sha256": "a5f45d2596f186311a6685f8f14aa52bd66134935036052151a064da9b41a910" + }, + { + "a": 6, + "b": 8, + "transitions": 624, + "sha256": "024c4253c18504e9b3cf98ad3076b3b6f65e0b04382d40a3c051140c80253552" + }, + { + "a": 6, + "b": 9, + "transitions": 624, + "sha256": "21a71a885d6321e976239294c39d183acaae102d581a734f90755a34117d8b25" + }, + { + "a": 6, + "b": 10, + "transitions": 624, + "sha256": "83e1df1331fabfffad7f6f78dd249fef838c6e0f4a2f7c95523dcb40b396304a" + }, + { + "a": 6, + "b": 11, + "transitions": 624, + "sha256": "7313dde2489697ec76c656bb6cbdd3c9dccde009808b65a4162d181cbf9d6b7e" + }, + { + "a": 6, + "b": 12, + "transitions": 624, + "sha256": "cdbe905d0c5305971060572d0018b336e30da113e5867fe26d2be44739ab29aa" + }, + { + "a": 7, + "b": 1, + "transitions": 624, + "sha256": "29cc74644dcc6ee226d0fb63997e72bbaf5bdf4b72c88a1bbc9e55976aecbc4d" + }, + { + "a": 7, + "b": 2, + "transitions": 624, + "sha256": "458f3213a0bf1a8d323491b225ec738399c0112dc598ccdbf2c5cfbe74dd2382" + }, + { + "a": 7, + "b": 3, + "transitions": 624, + "sha256": "cdd8a655a073eb142e98cbefdb2be4ea12087a4e82347ee5da890def67901ec2" + }, + { + "a": 7, + "b": 4, + "transitions": 624, + "sha256": "0385e0ae3a4ae56491887ca9c2ac95e52aadbeb315882d4ac4a1ace079eb8b78" + }, + { + "a": 7, + "b": 5, + "transitions": 624, + "sha256": "71f3f0d4f2947b2f8e4a1784eccf74ada8920becdf2b6ae10158b2082e18f5f1" + }, + { + "a": 7, + "b": 6, + "transitions": 624, + "sha256": "b538fc52746b2c4cdd64433e7e07ce735246fcafbf8b1a4f327362f1c2da68ff" + }, + { + "a": 7, + "b": 7, + "transitions": 624, + "sha256": "c792955444fad825b20dd5d34d67d0138d9a52f8f63224603543e4495d4073cd" + }, + { + "a": 7, + "b": 8, + "transitions": 624, + "sha256": "a12aeaba08da4d310e1fe69774c6c9938375e81f1e72f6c9ef7bc83118c816e2" + }, + { + "a": 7, + "b": 9, + "transitions": 624, + "sha256": "06d082ceae8815c3b7f444808080fb4132fe794a20ef0538619860c389a47518" + }, + { + "a": 7, + "b": 10, + "transitions": 624, + "sha256": "3b4f3f8acb50ea73ac144386f3a79f14bebd1bdb751fe52090dc65f79059cb87" + }, + { + "a": 7, + "b": 11, + "transitions": 624, + "sha256": "af800149287e0cea7d9861a10245496b2650c0a3f3a56887a0d88094309fd0c2" + }, + { + "a": 7, + "b": 12, + "transitions": 624, + "sha256": "dd26524b9d9c34c4ccca881fe29648cd945741f958f56f3c21bc342698909d91" + }, + { + "a": 8, + "b": 1, + "transitions": 624, + "sha256": "7cead84e38af87542966a85c3e7c798c46045eda02799b2bbb2bffa01dcefa8e" + }, + { + "a": 8, + "b": 2, + "transitions": 624, + "sha256": "0e5532e189d5b23640fc2d92b4aef2d4f2f28528ea868748223af37da258735e" + }, + { + "a": 8, + "b": 3, + "transitions": 624, + "sha256": "4e718211471ccf853a176162a9051c6336c30c559117b416b264010cd4fdd563" + }, + { + "a": 8, + "b": 4, + "transitions": 624, + "sha256": "77304fa5ea6b099a53e2d8e442f274db830f82ac0f623907b68233d31e3eac04" + }, + { + "a": 8, + "b": 5, + "transitions": 624, + "sha256": "f335aae65cc7a0e574d48012d1a9cc8c0559f333872d50a0483a8836af392609" + }, + { + "a": 8, + "b": 6, + "transitions": 624, + "sha256": "63947035432d7db648f09875c9d8d8d9c417f8436e41ab59fe4ec27dce734548" + }, + { + "a": 8, + "b": 7, + "transitions": 624, + "sha256": "82fabb69c7056b54d890260200392aef41a6e948a2822ef619eb10736c71787e" + }, + { + "a": 8, + "b": 8, + "transitions": 624, + "sha256": "451b44d76814d9648ba2fc62a1832483ccbc58965378ee3df23416ac894a9c73" + }, + { + "a": 8, + "b": 9, + "transitions": 624, + "sha256": "6325fab9ab20fbc42294835f3f6dbd4f418d4f4f00f93125bbf494fb95dfe0cc" + }, + { + "a": 8, + "b": 10, + "transitions": 624, + "sha256": "13087b4fb4f219d2a56354fa0fe31f3abda800a4c28f6be1d85ed675b86f4689" + }, + { + "a": 8, + "b": 11, + "transitions": 624, + "sha256": "4e4105896ac8b7d904c3fe4a19cccb5097a60917c34913dfaea554f40ad1b1b2" + }, + { + "a": 8, + "b": 12, + "transitions": 624, + "sha256": "009c75744d9c0f94de1abcf19438213ee4c68106a47d8f22f9f3a0e87810c50c" + }, + { + "a": 9, + "b": 1, + "transitions": 624, + "sha256": "f948cd737986d05cf7cc2fdd80dacfd1eec46a98ff465b7e2e8a30c209fa1580" + }, + { + "a": 9, + "b": 2, + "transitions": 624, + "sha256": "54c01a2cabd03a5fd5cfcd6402ca2837360bdcfb4f9eca9d599762e5570998e8" + }, + { + "a": 9, + "b": 3, + "transitions": 624, + "sha256": "9a8ab18ba095b330275de759873214b62bf3cb4b84af889419104bc20ad523c3" + }, + { + "a": 9, + "b": 4, + "transitions": 624, + "sha256": "6a5e7a81ca274365454451b13635c9fc5dc6622ebb7b5c439cecf63487ea145c" + }, + { + "a": 9, + "b": 5, + "transitions": 624, + "sha256": "f3e619117a5e2dd8a49a74cd4aed18fa5adfd3dbb0809ebe69647cd930a4714c" + }, + { + "a": 9, + "b": 6, + "transitions": 624, + "sha256": "3380e75cb5f0acf47e01a9f6dabb58f1578136efae2ed83c63b80e38e39e7538" + }, + { + "a": 9, + "b": 7, + "transitions": 624, + "sha256": "b713d7455c86d222ce5bc49491546f930ec079244dbdfaaced065a7cc098e9ab" + }, + { + "a": 9, + "b": 8, + "transitions": 624, + "sha256": "21b4af7adca27ea1990b21e873123bb94c0aa0b14084181c94917d55c6bd8953" + }, + { + "a": 9, + "b": 9, + "transitions": 624, + "sha256": "6dfa1fbeedde456ad3d38837f3b831f100ac97528d3f34de309edc2067b76892" + }, + { + "a": 9, + "b": 10, + "transitions": 624, + "sha256": "3e0dc441f5dacf6627b4401bd34fb5d35e69dcd75df4cdc20e6b0d4ae8cbb974" + }, + { + "a": 9, + "b": 11, + "transitions": 624, + "sha256": "8fc4ac683ffc3e966953521297963b57a06675cac58aaefbce40d25de5d093c7" + }, + { + "a": 9, + "b": 12, + "transitions": 624, + "sha256": "fc4b288e7be6d378d7359687aa35d28ecbe4a3638308c1f8e60f9f277c8ce48d" + }, + { + "a": 10, + "b": 1, + "transitions": 624, + "sha256": "38e4b27acf320cc915c6e72d1e846b0284516448fb9eb7cfa2563dbcecb35ef2" + }, + { + "a": 10, + "b": 2, + "transitions": 624, + "sha256": "8e5173e37e23c256dc200f7ddbb7b881a034feedd3d43347b4ab699f88f3de4c" + }, + { + "a": 10, + "b": 3, + "transitions": 624, + "sha256": "3f9664c9fe7ade8f3e39b3bc0114275d93aea28ad0059da6a3ad508ca7e3ac40" + }, + { + "a": 10, + "b": 4, + "transitions": 624, + "sha256": "b4fe278a884400dd4574757e844efdf3d07173bacaa5e0b27712852d27fe5fa2" + }, + { + "a": 10, + "b": 5, + "transitions": 624, + "sha256": "f8cb3868f99ce31ab5766b307afae432e66b69829e82495e7b874ed27e566dca" + }, + { + "a": 10, + "b": 6, + "transitions": 624, + "sha256": "fb5a18f05c0d21409ba5ab04202ca43d1195d1b969af562e39eeb8ecb0d06b67" + }, + { + "a": 10, + "b": 7, + "transitions": 624, + "sha256": "bf8204083b7d4b1f11057c296f822f1abc1a7bcdf4021f6d8d6a6caefaab0c6f" + }, + { + "a": 10, + "b": 8, + "transitions": 624, + "sha256": "a7d6a68b6d6ab68e3aa45922325069c8bc45526ab0b5c512852596b514803ebb" + }, + { + "a": 10, + "b": 9, + "transitions": 624, + "sha256": "b0ef840b8cd6278b90f0e4c348d1bb15980e0ed79ed59bdd6bf464727ea97a05" + }, + { + "a": 10, + "b": 10, + "transitions": 624, + "sha256": "11075e029ad4ab5957c9b2839f253547966e1b7f2b437e38c28670a61065051c" + }, + { + "a": 10, + "b": 11, + "transitions": 624, + "sha256": "2f1cc472ffe7266f9a78f34a5d26a171d03ab59ec52c13c61da94ec2db8f6386" + }, + { + "a": 10, + "b": 12, + "transitions": 624, + "sha256": "049a5a1526498930c7f97348e0bd32407f544187234c090932426d2e2167d798" + }, + { + "a": 11, + "b": 1, + "transitions": 624, + "sha256": "23e05c373d6bc0b1d6de8cfff28029d116e2604d45c73da54a2bcf1ea8689dc8" + }, + { + "a": 11, + "b": 2, + "transitions": 624, + "sha256": "17ff4e54340040b52573f19af3cc16f5086caf73c129dbfeb8ab206dafa66df5" + }, + { + "a": 11, + "b": 3, + "transitions": 624, + "sha256": "3fa28698e17efc16044b8b6d06cfbeed7d3b6b1a9cbeff182e6f8ff38fac7b3e" + }, + { + "a": 11, + "b": 4, + "transitions": 624, + "sha256": "5b961575968bce279c76890ab2e4bfe5881c25f34f3978a2c1b76ca46588c64a" + }, + { + "a": 11, + "b": 5, + "transitions": 624, + "sha256": "210eeb149392cc3952129c0fbbd700f15a996ba58221431d1131a3e6849b8492" + }, + { + "a": 11, + "b": 6, + "transitions": 624, + "sha256": "4ca05d5d1a68a698ac3bb236d878f3bb829c8339b114c983efde5be84dbf279f" + }, + { + "a": 11, + "b": 7, + "transitions": 624, + "sha256": "2dd661dbf55db99f3c2a6bd1c1f8c32c5b30525dcd8474355d9d6a2845823ec5" + }, + { + "a": 11, + "b": 8, + "transitions": 624, + "sha256": "54746d5cee9f816ebd3e819019c0e43088d42794249d314c1431a7053377c2a7" + }, + { + "a": 11, + "b": 9, + "transitions": 624, + "sha256": "74bfd668c0b1839fd7c37b502982635abb4aa033e98aa46d838a5d5f56d0712d" + }, + { + "a": 11, + "b": 10, + "transitions": 624, + "sha256": "0293f421478eebaa4f4a2e8c707076db5a0cd0e7fdf022256c79f0f254d1ae05" + }, + { + "a": 11, + "b": 11, + "transitions": 624, + "sha256": "1c1357f4e49ee5d79b98389aac464c7dfd1d50624c4dfa96a0cd5f19aa35b8cb" + }, + { + "a": 11, + "b": 12, + "transitions": 624, + "sha256": "8ff966703ccc75b9b932c523992f5d7e7a28fafe20014a71060105fee48a1a35" + }, + { + "a": 12, + "b": 1, + "transitions": 624, + "sha256": "9df612cb7070005e7038565e089a5c93a18acf70c1367f3e79bfe29c48ff83c2" + }, + { + "a": 12, + "b": 2, + "transitions": 624, + "sha256": "47df92c2229fb768d48ec925774d9a54c8a94bfd09a3533fc1e057301314390e" + }, + { + "a": 12, + "b": 3, + "transitions": 624, + "sha256": "63d7c8cb36e963d4a9c71a1206763ac82e53966892337f3ddf798149d2c09fc8" + }, + { + "a": 12, + "b": 4, + "transitions": 624, + "sha256": "dca1c194939f498bcbb1a181c0690e81979987193985490722119651134b96b4" + }, + { + "a": 12, + "b": 5, + "transitions": 624, + "sha256": "2274c9079ac39cdc90ca0d4896ff8948747acd763417fa6d585c13883011bbfc" + }, + { + "a": 12, + "b": 6, + "transitions": 624, + "sha256": "f79c1a708c25c5f5abdcfbec99bcd70847cb5b638453ffd708ded331c6b25b69" + }, + { + "a": 12, + "b": 7, + "transitions": 624, + "sha256": "bf76c6ed61ef11ccddbf28bacd77a23695d5c7cc5066d19797e6975853ea202a" + }, + { + "a": 12, + "b": 8, + "transitions": 624, + "sha256": "6b099cad7c00ba19d2fa21b3f4c9ea6f7c1b8cf867bfc21e0b2e37245a6a0b5c" + }, + { + "a": 12, + "b": 9, + "transitions": 624, + "sha256": "11145822734d1a91e240932a417f7c3977efa3876d2636e926bb4ab5a554ac4b" + }, + { + "a": 12, + "b": 10, + "transitions": 624, + "sha256": "d4d61706bec411ba3929cee4a2fb984bb9c9bee357202effa83c5df32b78d0a2" + }, + { + "a": 12, + "b": 11, + "transitions": 624, + "sha256": "4ad67fa967c4e3c1991a25db37b7ea4f92fe355a1cf13a689584351b7fdb7f77" + }, + { + "a": 12, + "b": 12, + "transitions": 624, + "sha256": "458962086ad6e3cd2e6d4995e784a7e92e6a81961f0e578e564f09aceeee860c" + } + ] +} diff --git a/research/runtime-paired-ddg-arithmetic/SOURCE-PINS.json b/research/runtime-paired-ddg-arithmetic/SOURCE-PINS.json new file mode 100644 index 0000000000..1177ca1b9e --- /dev/null +++ b/research/runtime-paired-ddg-arithmetic/SOURCE-PINS.json @@ -0,0 +1,79 @@ +[ + { + "commit": "71fdb2cf1ec973b5402c4d3c2466864014a1ccda", + "source_path": "research/paired-ddg-arithmetic-step/README.md", + "retained_path": "retained/paired-ddg-arithmetic-step/README.md", + "git_blob": "39779cde6f7ccdbd387a8e3b9691a015f411cbd2", + "sha256": "50f14b88d99f4713a31257ac1de32f7f9aa06c761efc172f77700bc2d50ab8f0" + }, + { + "commit": "71fdb2cf1ec973b5402c4d3c2466864014a1ccda", + "source_path": "research/paired-ddg-arithmetic-step/PROOF.md", + "retained_path": "retained/paired-ddg-arithmetic-step/PROOF.md", + "git_blob": "0d2fbf29dafe15a6942ec5c225121fc8cc7b6d7c", + "sha256": "621b8aaa482562fbadc28f22ddb4013271905e274d6f85f3ccb624b4ea3194c0" + }, + { + "commit": "71fdb2cf1ec973b5402c4d3c2466864014a1ccda", + "source_path": "research/paired-ddg-arithmetic-step/circuit.py", + "retained_path": "retained/paired-ddg-arithmetic-step/circuit.py", + "git_blob": "ee5d40770ed09414a16d21d2e223679080812a72", + "sha256": "b20301d5cd40343af913c4230ad88015580452d860affccc469de6a896bee00c" + }, + { + "commit": "71fdb2cf1ec973b5402c4d3c2466864014a1ccda", + "source_path": "research/paired-ddg-arithmetic-step/verify.py", + "retained_path": "retained/paired-ddg-arithmetic-step/verify.py", + "git_blob": "d0c879dc61802f53b2d0476f9bc079650b4c22e9", + "sha256": "d0077a15419cebccec2b9b3eebbe3a576ba1d8de8f0174a8e8eee874d45cbae6" + }, + { + "commit": "71fdb2cf1ec973b5402c4d3c2466864014a1ccda", + "source_path": "research/paired-ddg-arithmetic-step/TASK.json", + "retained_path": "retained/paired-ddg-arithmetic-step/TASK.json", + "git_blob": "98de2d573456c43e750f88821748695b169a85c8", + "sha256": "76f58056efc845d2b2392e54d950cbabd06ac23f46a1022d19e4ea270aca256a" + }, + { + "commit": "71fdb2cf1ec973b5402c4d3c2466864014a1ccda", + "source_path": "research/paired-ddg-arithmetic-step/SOURCES.json", + "retained_path": "retained/paired-ddg-arithmetic-step/SOURCES.json", + "git_blob": "7420e4096b78f1945a09c55e4ed4049bfeae8ad7", + "sha256": "0134849040294e6fc080c0f7da2979d37683e3b2d8764a735d0077bcd8518f84" + }, + { + "commit": "71fdb2cf1ec973b5402c4d3c2466864014a1ccda", + "source_path": "research/paired-ddg-arithmetic-step/VERIFY.json", + "retained_path": "retained/paired-ddg-arithmetic-step/VERIFY.json", + "git_blob": "61c1522ab1e5d3ef0dfaec234d5b6d8846af5213", + "sha256": "969c0d482495bfde9889a81e88ac58fa727233303ef6d2226c59a15dca51c110" + }, + { + "commit": "9011bf83e85ecd0443c789cf03259442f750877d", + "source_path": "research/paired-residue-sampler/README.md", + "retained_path": "retained/paired-residue-sampler/README.md", + "git_blob": "615c4890ec797561fd4287445ceb1019905175bc", + "sha256": "4a8d35da8cde11b127b490abdcaf0f085643313603d8b93d5773968a2e81a695" + }, + { + "commit": "9011bf83e85ecd0443c789cf03259442f750877d", + "source_path": "research/paired-residue-sampler/verify.py", + "retained_path": "retained/paired-residue-sampler/verify.py", + "git_blob": "eda448fbda7b6a78f340086fcaac6e7556bf1383", + "sha256": "a3f14b87169b934489fc7d01d82ff36f6a671bc6c38e4761443f5481e36c2f63" + }, + { + "commit": "0422af13625c2e7e8ece28bdd74364a61764c64a", + "source_path": "research/paired-ddg-reversal/PROOF.md", + "retained_path": "retained/paired-ddg-reversal/PROOF.md", + "git_blob": "05c37b0a6e2267aefda26b129c618ca376999f06", + "sha256": "ed1bd5b54af0c1ab7f8208bb474bdb5e5b5ae073d62c2dad840349942caea88e" + }, + { + "commit": "0422af13625c2e7e8ece28bdd74364a61764c64a", + "source_path": "research/paired-ddg-reversal/README.md", + "retained_path": "retained/paired-ddg-reversal/README.md", + "git_blob": "799f80fb0f3d1952d4107d18a1beaf8623d9fe8a", + "sha256": "6ca82d87d1dbaf11199419393c1782ea8ff9ff9efba1648a15c0ce65db79bb4b" + } +] diff --git a/research/runtime-paired-ddg-arithmetic/SOURCES.json b/research/runtime-paired-ddg-arithmetic/SOURCES.json new file mode 100644 index 0000000000..5335fa97d9 --- /dev/null +++ b/research/runtime-paired-ddg-arithmetic/SOURCES.json @@ -0,0 +1,18 @@ +{ + "schema_version": 1, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "75d77b328ea02ded535e7f23aee5b1e55d0bb1a8", + "sha256": "154c3d30455d778fd3343b6b4851f0fa4665f0f7625b0adb3675e2bafbbf6bf1" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81" + } + ] +} diff --git a/research/runtime-paired-ddg-arithmetic/TASK.json b/research/runtime-paired-ddg-arithmetic/TASK.json new file mode 100644 index 0000000000..280b15c69e --- /dev/null +++ b/research/runtime-paired-ddg-arithmetic/TASK.json @@ -0,0 +1,97 @@ +{ + "schema_version": 1, + "task_id": "supplier-boundary-audit", + "priority_revision": 8, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "original_card": { + "id": "supplier-boundary-audit", + "question": "Does one changed supplier have complete source-bound native, caller, ordinary and outer admission coverage?", + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "acceptance_gate": "Pin the current sources and one obligation; the historical owner audit is an example, not evidence of a current bug.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "Choose one latest uncovered candidate and build a delta coverage map against the selected review. For P104, #5717 changes owned-lifetime assumptions and #5719 covers exact #5713 causal premises; neither automatically transfers to #5718. For BIT, #5679/#5708 need component admission and compatible outer use. Check controls and exact source identity before reuse; stop with one resolved gap or explicit remaining obligation. A heavy full replay requires a separate serial resource budget.", + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "overlap_terms": [ + "supplier admission", + "5717", + "5719", + "5708", + "owned lifetime" + ], + "existing_checks": [ + { + "scope": "PR #4088: author-checked local words, native receipts, owner/phase fill and exact moment.", + "evidence": "research/staged544-mixed-fourth-entry/README.md", + "remaining": "Rebind and validate ordinary/outer admission with all four providers; full mixed release not established.", + "status": "author-checked", + "source_commit": "72d7efc181edb21806a878f174847c96dd410ab0", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #3801: successor scatter-boundary decision package.", + "evidence": "research/scatter-boundary-decision/README.md", + "remaining": "Consult its exact acceptance scope before any new exporter audit; not proof of a selected failure.", + "status": "author-checked", + "source_commit": "911f8800ba7a4b03603ef62c5ffc6240e53cb5fd", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + }, + "scope_status": "changed", + "actual_scope": "One fixed reversible arithmetic circuit accepts both nonzero denominator-13 residue parameters at runtime and preserves all 144 literal ordered-coin transition functions", + "scope_change_reason": "Take PR7746 explicit runtime-parameter handoff; count the preparation of all four weight residues and full forward/inverse workspace cleanup.", + "bottleneck_link": "Removes per-parameter transition data from one logical sampler step. Parameter loading, wire/tape movement, stopping storage, a reached nonadaptive caller and the complete native invoice remain unpriced.", + "budget_minutes": 60, + "stop_rule": "Stop at one fixed gate list and an exact bill checked on all 89856 reachable parameter/state/coin inputs. Do not claim wider denominators or physical runtime.", + "outcome": "completed", + "evidence": "PROOF.md, parametric.py, RESULT.json, verify.py and eleven exact retained source files", + "author": "Ali Romman", + "ai_assistance": "Substantial OpenAI Codex assistance in research, implementation, verification and writing", + "open_questions": [ + { + "question": "What is the full physical tariff for this runtime-parameter arithmetic service?", + "why_it_matters": "Logical gates do not price wire access, random-tape movement or stopping storage.", + "first_step": "Choose an owned tape layout and one counter or delimiter boundary, then charge all initialization, execution and restoration for a terminating path.", + "blocked_by": "A reached nonadaptive caller and its ownership and randomness contract are not supplied." + }, + { + "question": "Can a smaller circuit preserve the same runtime parameters and ordered-coin function?", + "why_it_matters": "The runtime circuit is larger than the fixed-pair predecessor.", + "first_step": "Use the complete transition certificate and count parameter preparation, forward/inverse computation and cleanup together.", + "blocked_by": "No gate-count optimum is known." + } + ] +} diff --git a/research/runtime-paired-ddg-arithmetic/VERIFY.json b/research/runtime-paired-ddg-arithmetic/VERIFY.json new file mode 100644 index 0000000000..857508b8b3 --- /dev/null +++ b/research/runtime-paired-ddg-arithmetic/VERIFY.json @@ -0,0 +1,32 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": [ + "{python}", + "-W", + "error", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "All 144 runtime pairs and 89856 forward/inverse edges, literal source graph and floor specification, complete wire preservation/cleanup, scalar interpreter, all modular subtraction inputs and unchanged fixed-pair replay" + }, + { + "argv": [ + "{python}", + "-W", + "error", + "-O", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "All 144 runtime pairs and 89856 forward/inverse edges, literal source graph and floor specification, complete wire preservation/cleanup, scalar interpreter, all modular subtraction inputs and unchanged fixed-pair replay" + } + ] +} diff --git a/research/runtime-paired-ddg-arithmetic/parametric.py b/research/runtime-paired-ddg-arithmetic/parametric.py new file mode 100644 index 0000000000..9291f6d8b1 --- /dev/null +++ b/research/runtime-paired-ddg-arithmetic/parametric.py @@ -0,0 +1,126 @@ +"""A reversible draw with runtime residues. Ali Romman, with Codex. Apache-2.0. + +The Boolean primitives are Nick Petalas's unchanged PR7746 implementation. +""" + +from sources import arithmetic as source + +PACKET = tuple(range(11)) +COIN = 11 +PARAMETER_A = tuple(range(12, 16)) +PARAMETER_B = tuple(range(16, 20)) +BACKING = tuple(range(20, 31)) +FIRST_SCRATCH = 31 +MAX_SCRATCH = 8192 +READ_ONLY = (COIN, *PARAMETER_A, *PARAMETER_B) +bits = source.bits +add_mod = source.add_mod + + +class Circuit(source.Circuit): + """Use the source Boolean primitives with the explicit parameter layout.""" + + def __init__(self): + self.gates = [] + self.next_wire = FIRST_SCRATCH + + def fresh(self): + if self.next_wire == FIRST_SCRATCH + MAX_SCRATCH: + raise ValueError('Boolean scratch capacity exceeded') + wire = self.next_wire + self.next_wire += 1 + return wire + + +def doubles(circuit, word): + result = [word] + for _ in range(3): + result.append(add_mod(circuit, result[-1], result[-1])) + return tuple(result) + + +def scale(circuit, multiples, parameter): + terms = tuple(tuple(circuit.both(flag, bit) for bit in word) + for word, flag in zip(multiples, parameter, strict=True)) + result = terms[0] + for term in terms[1:]: + result = add_mod(circuit, result, term) + return result + + +def subtract_mod(circuit, left, right): + complement = tuple(circuit.xor(bit, True) for bit in (*right, False)) + difference = circuit.add((*left, False), complement, carry=True) + corrected = circuit.add(difference, bits(169, 9)) + return circuit.select(difference[8], difference[:8], corrected[:8]) + + +def phase_digits(circuit, phase): + powers = doubles(circuit, phase) + a_phase = scale(circuit, powers, PARAMETER_A) + b_phase = scale(circuit, powers, PARAMETER_B) + a_powers = doubles(circuit, a_phase) + b_powers = doubles(circuit, b_phase) + product = scale(circuit, a_powers, PARAMETER_B) + alpha = add_mod(circuit, add_mod(circuit, a_powers[0], a_powers[2]), a_powers[3]) + beta = add_mod(circuit, add_mod(circuit, b_powers[0], b_powers[2]), b_powers[3]) + residues = (subtract_mod(circuit, subtract_mod(circuit, product, alpha), beta), + subtract_mod(circuit, beta, product), + subtract_mod(circuit, alpha, product), product) + digits = tuple(circuit.add((*residue, False), bits(171, 9))[8] for residue in residues) + return powers[1], digits + + +def prefixes(circuit, digits): + count = bits(0, 3) + result = [] + for digit in digits: + result.append(count) + count = circuit.add(count, (digit, False, False)) + return tuple(result), count + + +def advance(circuit): + doubled, digits = phase_digits(circuit, PACKET[:8]) + starts, count = prefixes(circuit, digits) + rank = (COIN, *PACKET[8:10]) + leaves = tuple(circuit.both(digit, circuit.equal(rank, start)) + for digit, start in zip(digits, starts, strict=True)) + low = circuit.xor(leaves[1], leaves[3]) + high = circuit.xor(leaves[2], leaves[3]) + done = circuit.xor(circuit.xor(leaves[0], leaves[1]), circuit.xor(leaves[2], leaves[3])) + complement = tuple(circuit.xor(bit, True) for bit in count) + node = circuit.add(rank, complement, carry=True)[:2] + return (*doubled, *circuit.select(done, node, (low, high)), done) + + +def retreat(circuit): + doubled = PACKET[:8] + offset = tuple(circuit.both(doubled[0], bit) for bit in bits(169, 9)) + phase = circuit.add((*doubled, False), offset)[1:] + _, digits = phase_digits(circuit, phase) + starts, count = prefixes(circuit, digits) + low, high, done = PACKET[8:] + lower = circuit.select(low, starts[0], starts[1]) + upper = circuit.select(low, starts[2], starts[3]) + leaf_rank = circuit.select(high, lower, upper) + live_rank = circuit.add((low, high, False), count) + rank = circuit.select(done, live_rank, leaf_rank) + return (*phase, *rank[1:], False) + + +def clean_oracle(circuit, output): + computation = tuple(circuit.gates) + for target, signal in zip(BACKING, output, strict=True): + circuit.toggle(target, signal) + return (*circuit.gates, *reversed(computation)) + + +def reversible_step(): + forward = Circuit() + first = clean_oracle(forward, advance(forward)) + backward = Circuit() + last = clean_oracle(backward, retreat(backward)) + swap = tuple(gate for a, b in zip(PACKET, BACKING, strict=True) + for gate in ((a, (b,)), (b, (a,)), (a, (b,)))) + return (*first, *swap, *last), max(forward.next_wire, backward.next_wire) diff --git a/research/runtime-paired-ddg-arithmetic/retained/paired-ddg-arithmetic-step/PROOF.md b/research/runtime-paired-ddg-arithmetic/retained/paired-ddg-arithmetic-step/PROOF.md new file mode 100644 index 0000000000..0d2fbf29da --- /dev/null +++ b/research/runtime-paired-ddg-arithmetic/retained/paired-ddg-arithmetic-step/PROOF.md @@ -0,0 +1,79 @@ +# One reversible draw from a common phase residue + +The fixed source graph assigns the four ordered outcomes weights +`(144,12,12,1)/169` in order 00, 01, 10, 11. At depth $k$, let $j$ +be the index among unfinished prefixes in the source's order. Reading coin +$u$ gives child index $m=2j+u$. The next binary probability digits mark +one leaf per set digit in outcome order. Those leaves occupy the first child +indices. If there are $s$ leaves, child $m None: + self.gates: list[Gate] = [] + self.next_wire = FIRST_SCRATCH + + def fresh(self) -> int: + if self.next_wire == FIRST_SCRATCH + MAX_SCRATCH: + raise ValueError("Boolean scratch capacity exceeded") + wire = self.next_wire + self.next_wire += 1 + return wire + + def toggle(self, target: int, signal: Signal) -> None: + if signal is True: + self.gates.append((target, ())) + elif signal is not False: + self.gates.append((target, (signal,))) + + def xor(self, left: Signal, right: Signal) -> Signal: + if left is False or right is False: + return right if left is False else left + if type(left) is type(right) and left == right: + return False + target = self.fresh() + self.toggle(target, left) + self.toggle(target, right) + return target + + def both(self, left: Signal, right: Signal) -> Signal: + if left is False or right is False: + return False + if left is True or right is True: + return right if left is True else left + if left == right: + return left + target = self.fresh() + self.gates.append((target, (left, right))) + return target + + def add(self, left: Word, right: Word, carry: Signal = False) -> Word: + if len(left) != len(right) or not 1 <= len(left) <= 9: + raise ValueError("invalid ripple adder widths") + total = [] + for x, y in zip(left[:-1], right[:-1], strict=True): + difference = self.xor(x, y) + total.append(self.xor(difference, carry)) + carry = self.xor(self.both(x, y), self.both(difference, carry)) + total.append(self.xor(self.xor(left[-1], right[-1]), carry)) + return tuple(total) + + def select(self, flag: Signal, low: Word, high: Word) -> Word: + if len(low) != len(high) or not 1 <= len(low) <= 8: + raise ValueError("invalid selector widths") + return tuple( + self.xor(x, self.both(flag, self.xor(x, y))) + for x, y in zip(low, high, strict=True) + ) + + def equal(self, left: Word, right: Word) -> Signal: + if len(left) != len(right) or len(left) != 3: + raise ValueError("invalid index widths") + equal: Signal = True + for x, y in zip(left, right, strict=True): + equal = self.both(equal, self.xor(self.xor(x, y), True)) + return equal + + +def bits(value: int, width: int) -> Word: + if not 1 <= width <= 9 or not 0 <= value < 1 << width: + raise ValueError("constant does not fit its word") + return tuple(bool(value & (1 << index)) for index in range(width)) + + +def add_mod(circuit: Circuit, left: Word, right: Word) -> Word: + total = circuit.add((*left, False), (*right, False)) + reduced = circuit.add(total, bits(512 - MODULUS, 9)) + return circuit.select(reduced[8], reduced[:8], total[:8]) + + +def phase_digits(circuit: Circuit, phase: Word, doubled: Word) -> tuple[Signal, Signal, Signal]: + triple = add_mod(circuit, doubled, phase) + six = add_mod(circuit, triple, triple) + twelve = add_mod(circuit, six, six) + twenty_four = add_mod(circuit, twelve, twelve) + twenty_five = add_mod(circuit, twenty_four, phase) + + threshold = bits(256 - 85, 9) + high_25 = circuit.add((*twenty_five, False), threshold)[8] + high_12 = circuit.add((*twelve, False), threshold)[8] + high_1 = circuit.add((*phase, False), threshold)[8] + return circuit.xor(high_25, True), high_12, high_1 + + +def prefix_indices(circuit: Circuit, first: Signal, middle: Signal) -> tuple[Word, Word, Word]: + return (first, False, False), (circuit.xor(first, True), first, False), (first, middle, False) + + +def advance(circuit: Circuit) -> Word: + phase = PACKET[:8] + doubled = add_mod(circuit, phase, phase) + first, middle, last = phase_digits(circuit, phase, doubled) + rank = (COIN_WIRE, *PACKET[8:10]) + p01, p10, p11 = prefix_indices(circuit, first, middle) + leaf_00 = circuit.both(first, circuit.equal(rank, bits(0, 3))) + leaf_01 = circuit.both(middle, circuit.equal(rank, p01)) + leaf_10 = circuit.both(middle, circuit.equal(rank, p10)) + leaf_11 = circuit.both(last, circuit.equal(rank, p11)) + low = circuit.xor(leaf_01, leaf_11) + high = circuit.xor(leaf_10, leaf_11) + done = circuit.xor(circuit.xor(leaf_00, leaf_01), circuit.xor(leaf_10, leaf_11)) + + count = circuit.add((first, middle, False), (last, False, False)) + complement = tuple(circuit.xor(bit, True) for bit in count) + index = circuit.add(rank, complement, carry=True)[:2] + return (*doubled, *circuit.select(done, index, (low, high)), done) + + +def retreat(circuit: Circuit) -> Word: + doubled = PACKET[:8] + offset = tuple(circuit.both(doubled[0], bit) for bit in bits(MODULUS, 9)) + phase = circuit.add((*doubled, False), offset)[1:] + first, middle, last = phase_digits(circuit, phase, doubled) + low, high, done = PACKET[8:] + p01, p10, p11 = prefix_indices(circuit, first, middle) + lower = circuit.select(low, bits(0, 3), p01) + upper = circuit.select(low, p10, p11) + leaf_rank = circuit.select(high, lower, upper) + + count = circuit.add((first, middle, False), (last, False, False)) + live_rank = circuit.add((low, high, False), count) + rank = circuit.select(done, live_rank, leaf_rank) + return (*phase, *rank[1:], False) + + +def clean_oracle(circuit: Circuit, output: Word) -> tuple[Gate, ...]: + computation = tuple(circuit.gates) + for target, signal in zip(BACKING, output, strict=True): + circuit.toggle(target, signal) + return (*circuit.gates, *reversed(computation)) + + +def reversible_step() -> tuple[tuple[Gate, ...], int]: + forward = Circuit() + forward_oracle = clean_oracle(forward, advance(forward)) + backward = Circuit() + backward_oracle = clean_oracle(backward, retreat(backward)) + swap = tuple( + gate + for a, b in zip(PACKET, BACKING, strict=True) + for gate in ((a, (b,)), (b, (a,)), (a, (b,))) + ) + scratch_end = max(forward.next_wire, backward.next_wire) + return (*forward_oracle, *swap, *backward_oracle), scratch_end diff --git a/research/runtime-paired-ddg-arithmetic/retained/paired-ddg-arithmetic-step/verify.py b/research/runtime-paired-ddg-arithmetic/retained/paired-ddg-arithmetic-step/verify.py new file mode 100644 index 0000000000..d0c879dc61 --- /dev/null +++ b/research/runtime-paired-ddg-arithmetic/retained/paired-ddg-arithmetic-step/verify.py @@ -0,0 +1,96 @@ +"""Check the new gate list against a direct floor-count specification.""" + +from collections import Counter + +from circuit import COIN_WIRE, FIRST_SCRATCH, MODULUS, PACKET_WIDTH, Gate, reversible_step + +WEIGHTS = (144, 12, 12, 1) +PERIOD = 156 +EXPECTED = (232, 2238, 590, 473) + + +def require(condition: bool, message: str) -> None: + if not condition: + raise ValueError(message) + + +def packet(phase: int, node: int, done: bool = False) -> int: + return phase | (node << 8) | (int(done) << 10) + + +def comparisons() -> tuple[tuple[int, int], ...]: + cases = [] + unfinished = 1 + phase = 1 + powers = 1 + phases = set() + for _ in range(PERIOD): + require(phase not in phases, "phase repeated before the closing edge") + phases.add(phase) + next_phase = (2 * powers) % MODULUS + leaves = tuple( + label for label, weight in enumerate(WEIGHTS) + if (2 * powers * weight) // MODULUS - 2 * (powers * weight // MODULUS) + ) + require(1 <= unfinished <= 3, "reference index does not fit two bits") + for rank in range(2 * unfinished): + node, coin = divmod(rank, 2) + output = leaves[rank] if rank < len(leaves) else rank - len(leaves) + before = packet(phase, node) | (coin << COIN_WIRE) + after = packet(next_phase, output, rank < len(leaves)) | (coin << COIN_WIRE) + cases.append((before, after)) + unfinished = 2 * unfinished - len(leaves) + powers *= 2 + phase = next_phase + require((phase, unfinished) == (1, 1), "reference graph did not close") + return tuple(cases) + + +def lanes(records: tuple[int, ...], width: int) -> list[int]: + return [ + sum(((record >> wire) & 1) << index for index, record in enumerate(records)) + for wire in range(width) + ] + + +def run(gates: tuple[Gate, ...], records: tuple[int, ...], width: int) -> list[int]: + state = lanes(records, width) + full = (1 << len(records)) - 1 + for target, controls in gates: + flip = full + for control in controls: + flip &= state[control] + state[target] ^= flip + return state + + +def main() -> None: + gates, width = reversible_step() + for target, controls in gates: + require(0 <= target < width and target != COIN_WIRE, "illegal gate target") + require(len(controls) <= 2 and len(set(controls)) == len(controls), "illegal gate arity") + require(all(0 <= x < width and x != target for x in controls), "illegal gate controls") + counts = Counter(len(controls) for _, controls in gates) + bill = (counts[0], counts[1], counts[2], width - FIRST_SCRATCH) + require(bill == EXPECTED, f"gate or scratch bill changed: {bill}") + + pairs = comparisons() + before, after = zip(*pairs, strict=True) + require(len(set(after)) == len(after), "reference inverse is not unique") + require(run(gates, before, width) == lanes(after, width), "forward or cleanup mismatch") + require(run(tuple(reversed(gates)), after, width) == lanes(before, width), "inverse mismatch") + + # A spurious NOT on an erased bit must change the check, even with correct outputs. + dirty = (*gates, (FIRST_SCRATCH, ())) + require(run(dirty, before, width) != lanes(after, width), "dirty scratch went undetected") + # A spurious NOT on the stopping flag leaves the phase and node intact. + wrong_stop = (*gates, (PACKET_WIDTH - 1, ())) + require(run(wrong_stop, before, width) != lanes(after, width), "wrong stop went undetected") + print("PASS_PAIRED_DDG_ARITHMETIC_STEP") + print(f"{len(pairs)} complete forward/inverse transitions; two fault controls") + print(f"{bill[0]} X, {bill[1]} CNOT, {bill[2]} Toffoli; {len(gates)} total gates") + print(f"{bill[3]} temporary Boolean wires plus {PACKET_WIDTH} clean packet backing bits") + + +if __name__ == "__main__": + main() diff --git a/research/runtime-paired-ddg-arithmetic/retained/paired-ddg-reversal/PROOF.md b/research/runtime-paired-ddg-arithmetic/retained/paired-ddg-reversal/PROOF.md new file mode 100644 index 0000000000..05c37b0a6e --- /dev/null +++ b/research/runtime-paired-ddg-arithmetic/retained/paired-ddg-reversal/PROOF.md @@ -0,0 +1,130 @@ +# A pathwise inverse for the literal paired DDG + +Fix `(a,b)=(1,1)` before reading any fair bits. Use exactly `make(1,1)` in +zxv's retained PR6072 source. It has 312 internal states `(p,j)`, phase +`p in Z/156`, and four tagged leaves. This note proves a logical clean +lifecycle for every **terminating** path. Probability and expected-draw +claims reuse the predecessor's product-law/depth-count argument; no physical +reversible machine or complete multiplier is asserted. + +## 1. The actual transition is locally injective when phase and bit survive + +At phase p let `d_i = floor(2*(w_i*2^p mod169)/169)`, for weights +`w=(144,12,12,1)`. Every digit is 0 or1. Put `D=sum_i d_i` and +`c_i=sum_{h0, read the bit at cursor-1, decrement phase modulo156, and apply +the inverse from section1 to the current target and that predecessor phase. +Move the cursor left and decrement t. The forward relation checks that the +computed predecessor regenerates the target, enabling scratch uncomputation. + +Induction backwards on t recovers the exact preceding controller on each +step. At t=0 it returns `(state,phase,t,cursor)=(0,0,0,s)`, with scratch clean, +tape unchanged and accumulator `A_initial XOR i`. Both the stopping counter +and owned phase register are cleared by this reverse walk. There is no +per-step state history and no retained final T. Storage of the counter during +the call is still necessary in this construction. Never stop reversal merely +on seeing state0: a surviving path can revisit phase0/root after156 steps. +The counter distinguishes that visit from the beginning. Phase wrap does not +invalidate the inverse formula or its induction. + +To realize a single state update reversibly, compute the next state into a +clean nine-bit scratch register using an XOR oracle, swap state and scratch, +and erase the old state with the inverse XOR oracle while phase and coin are +still available. Reverse the two oracles for a backward step. Counter, +phase and cursor updates are invertible increments/decrements. The table +oracles extend to total reversible XOR maps, but cleanup correctness and loop +termination are claimed on the valid-path invariant only. The Python verifier +is an exact reference interpreter, not itself a bit-level reversible circuit. + +## 3. Costs that this construction does and does not pay + +The chosen realization keeps nine state bits, nine scratch bits, eight phase +bits, O(1) bounded lookup/work flags, and `ceil(log2(T+1))` stopping-counter +bits at maximum occupancy. The cursor and known start address belong to the +tape interface; a numerical address implementation must additionally pay its +address storage/arithmetic. The consumed T bits remain resident throughout; +no new per-step state log is stored. There is no finite worst-case T or +worst-case storage bound. Counter allocation itself is a physical obligation; +the space expression describes occupied logical bits, not a free allocator. + +Precisely T forward and T reverse transitions and one two-bit XOR retention +are required, with 2T accesses to the resident transcript. There are T cursor +moves in each direction. From the retained source, + +`E[T]=9960277917013927549978/4649714690825496825793 < 9/4`. + +Thus expected traversed transitions are `2E[T] < 9/2`; cleanup doubles the +logical traversal count but draws **no new randomness**. It does not make the +T used random bits independent of the retained result. + +An explicit conditional implementation can scan every one of the624 edge +records for each oracle, XORing the target or predecessor under equality of +its key. Store source phase alongside each record (or compute it with a paid +fixed decoder). At most two scans implement each reversible state transition, +so forward-plus-reverse uses **2496T record visits**. This is a deliberately +conservative concrete lookup tariff, not a free RAM assumption. It requires +paid reversible equality/XOR/scan movement at the fixed record widths. The +original5616-bit packed target table does not include these phase records, +scan positioning machinery, or controller scratch: storing an eight-bit phase +per edge adds4992 bits in this simple layout, for10548 data bits total, before +any physical routing/control overhead. + +If a record visit costs K and counter update at occupied length ell costs +C(ell), the additional conditional bill is `2496KT + O(T*C(log(T+1)))` +plus tape movement, addressing, phase updates and one output copy. With a paid +ripple-style increment/decrement tariff C(ell)=O(ell), counter work is +O(T log(T+1)); this is not charged as constant time. The source bound +`Pr(T>k)<=3/2^k` ensures finite expectation for that polynomial-logical work, +but a bounded physical tariff is not supplied by the Python experiment. +No runtime speedup follows from expected fair-bit savings alone. + +## 4. Quantifiers and remaining boundaries + +The inverse algebra applies to any binary-digit DDG with this same ordered +leaf allocation, subject to its valid-node recurrence. The source binding, +resource counts, path fixtures and exact mean here cover only `(1,1)`; +all144 denominator13 configurations are deliberately not replayed. + +A fresh call after this cleanup may not treat the restored consumed bits as +fresh conditional randomness once the output is retained or used adaptively. +The proof restores the original tape, not its independence from outputs. +Actual reached residue pairs, nonadaptive batching, overflow, table selection, +physical random-bit/tape service and outer error bounds remain open. No +selected frontier, deterministic inverse, supplier admission or framework +assumption is changed. No formal proof-kernel or independent human review is +claimed. diff --git a/research/runtime-paired-ddg-arithmetic/retained/paired-ddg-reversal/README.md b/research/runtime-paired-ddg-arithmetic/retained/paired-ddg-reversal/README.md new file mode 100644 index 0000000000..799f80fb0f --- /dev/null +++ b/research/runtime-paired-ddg-arithmetic/retained/paired-ddg-reversal/README.md @@ -0,0 +1,94 @@ +# Reverse the literal paired DDG without a visited-state log + +For the fixed `(1,1)` denominator13 pair in [zxv's PR6072](https://github.com/CrocSwap/integer-mult-bounds/pull/6072), +the actual312-state DDG has a unique inverse edge when the consumed coin and +predecessor phase are retained. This package supplies that inverse and a +pathwise output-copy/cleanup protocol: retain the two-bit output in a disjoint +XOR accumulator, restore the original tape cursor, clear the controller and +stopping counter, and leave the resident input tape unchanged. **No per-step +node history is required; the stopping counter and transcript are required.** + +The source-bound result is logical reversibility on every terminating path, +not a physical sampler, fixed worst-case storage, freshness after output +retention, or a speedup. The input pair must be fixed before sampling. The +selected frontier and its five framework assumptions remain unchanged. + +## What changed + +PR6072 proves the exact product law and optimal expected fair-bit count while +leaving reversal and stopping records open. Its source leaf overwrite loses +phase: literal states0 and1 both return leaf0 on coin0. Keeping phase (or +deriving it from the stopping count) resolves that collision. The inverse +formula uses `q=next_node+sum(digits)` for an internal child, or the leaf's +unique digit slot for a leaf, and recovers old node `(q-bit)/2`. +[PROOF.md](PROOF.md) gives the full arbitrary-path induction, counter/phase +wrap, output retention and conditional physical bill. This is a refined +`formal-interface-lemma` task, proved in prose with exact executable source +bindings, without a formal proof assistant. + +The protocol performs T forward and T reverse transitions, using the same T +resident transcript bits. It uses O(log(T+1)) controller/counter storage beyond +fixed table/scratch and the transcript; T remains unbounded. For this source +pair, expected traversed transitions are exactly twice +`9960277917013927549978/4649714690825496825793`. +An explicit scan implementation charges2496T fixed-record visits plus counter, +phase, addressing and tape costs. The source's702-byte table is not claimed +to include that implementation's extra phase records or machinery. + +## Exact retained sources and credit + +`vendor/paired_sampler.py` and `vendor/README.source.md` retain byte-for-byte +PR6072 head`9011bf83e85ecd0443c789cf03259442f750877d`, by zxv with substantial +OpenAI Codex assistance, Apache-2.0. [vendor/ORIGIN.json](vendor/ORIGIN.json) +records their original paths and hashes. Only `make(1,1)` is invoked; its +144-pair `main` is never called. These retained files have their own commit in +this branch and source pins refer to that reachable retention commit, so cold +replay does not depend on an unmerged external Git object. No synthetic history +merge or predecessor modification is used. + +The classical DDG method, predecessor proof and their credits remain in the +retained README. JoyboyBrian, with substantial OpenAI Codex assistance, +prepared this scoped inverse/protocol and verifier. Apache-2.0. Nick Petalas's +stochastic-prefix context and the JoyboyBrian#5069/#5037 inverse lineage retain +credit; their scientific replays are not imported or repeated here. + +## Evidence and reproduction + +```sh +python3 -I -W error -B research/paired-ddg-reversal/verify.py +python3 -I -W error -O -B research/paired-ddg-reversal/verify.py +python3 -B scripts/research_package.py --package research/paired-ddg-reversal +python3 -B scripts/check_research_commit.py --package research/paired-ddg-reversal --check-source-history +``` + +The standard-library verifier checks all624 inverse edges and624 wrong-bit +rejections,1022 terminating literal ten-bit tapes at a nonzero cursor with all +four accumulator values, and315 terminating paths through one/two phase wraps +up to T=314. It also rejects wrong counter, cursor, phase and output labels, +a finite surviving tape, and records the concrete phase-free collision. +The bounded paths validate implementation and failure controls; the arbitrary +terminating-path claim follows from the written edge-inverse induction. +No Monte Carlo or full historical catalogue replay is used. Direct verification +is read-only and Git-free once this package is exported. Registered commands +exercise normal and optimized modes; explicit checks remain active in both. + +Canonical base is`721c03822c421b7f7fcbb2598993b947c4d88419`, priority8. +The [advance claim](https://github.com/CrocSwap/integer-mult-bounds/discussions/6073#discussioncomment-19234412) +sets this exact task. Root coordination searched355 open PRs,5737 Discussions +and8348 local records on2026-10-28 UTC; coverage is not proof of novelty. +The public PR6072 head was rechecked before implementation. Later pair selection +belongs to another task; this package does not search for an actual caller. + +## Open next questions + +Can one physical tape/table service implement the explicit scans, counter +allocation and cursor restoration with a complete uniform tariff? Begin with +one fixed `(1,1)` service and the2496T record-visit bill in the proof, retaining +address movement and unbounded stopping. The physical service is the blocker. + +Can an actual caller supply a nonadaptive pair and independent input tape +conditional on its retained outputs? Bind one stage and its randomness lifetime +before reusing the cleaned transcript. This proof restores bits but does not +restore their independence from the retained sampled decision. +Structured questions are in TASK.json. No new kappa or full multiplication +theorem, independent human approval, Lean or Docker result is claimed. diff --git a/research/runtime-paired-ddg-arithmetic/retained/paired-residue-sampler/README.md b/research/runtime-paired-ddg-arithmetic/retained/paired-residue-sampler/README.md new file mode 100644 index 0000000000..615c4890ec --- /dev/null +++ b/research/runtime-paired-ddg-arithmetic/retained/paired-residue-sampler/README.md @@ -0,0 +1,188 @@ +# Joint denominator-13 decisions use fewer expected fair bits + +For every fixed pair of nonzero residue probabilities $a/13,b/13$, an explicit +finite-state sampler produces **two independent** Bernoulli decisions with +optimal expected fair-bit count strictly below $7/2$. Two separate exact +standalone samplers require expected count at least four. When both probabilities +are $1/13$, the joint expected count is below $9/4$, saving more than 43.75% of +the standalone expected draws. + +Each parameter pair has exactly 312 internal control states and 624 binary +transitions. Including its four output labels, every target fits nine bits; +a packed transition table uses 5,616 bits, or 702 bytes, per parameter pair. +The implementation generates one table at a time rather than storing all 144. + +This is a finite exact sampling construction and an expected-bit optimum, +not a physical inverse, worst-case latency bound, reversible cleanup protocol, +supplier or new κ. It deliberately changes the **standalone-call** hypothesis +of [PR #6068](https://github.com/CrocSwap/integer-mult-bounds/pull/6068). +The underlying dyadic decision-graph method is classical; the contribution is +this small complete denominator-13 catalogue, exact means and resource ledger. + +## Contract and source relevance + +The denominator-13 inverse in +[PR #5069](https://github.com/CrocSwap/integer-mult-bounds/pull/5069) motivates +rounding probabilities with this denominator. Both probabilities must be known +**before** this sampler consumes any bits. Their intended decisions are +independent. A second probability that depends on the first rounded result +cannot be substituted into this batch without a new contract. + +No actual native caller is asserted to provide the required residue pair or +batching window. The retained deterministic inverse is not alleged defective. +The stochastic prefix of +[Nick Petalas](https://github.com/petalas)'s +[PR #6026](https://github.com/CrocSwap/integer-mult-bounds/pull/6026) supplies a +related arithmetic context, but its adaptive updates are not automatically +batchable, and its native/caller error analysis is not extended here. + +## Exact joint decision graph + +In output order 00, 01, 10, 11, set the integer weights + +$$ +(w_0,w_1,w_2,w_3) +=((13-a)(13-b),(13-a)b,a(13-b),ab). +$$ + +Their sum is 169. Dividing by 169 gives exactly the product law, hence the +required independent marginals. Write the binary digits of each probability +as $d_{i,k}$ at depth $k\geq1$. Define + +$$ +n_k=2^k-\sum_{i=0}^3\lfloor2^k w_i/169\rfloor. +$$ + +This is the number of unfinished binary prefixes after depth $k$. At the root, +$n_0=1$. At the next depth, double every unfinished node, label the first +$d_{i,k}$ available children with output $i$, and retain the rest as unfinished. +Each digit is zero or one, and + +$$ +n_k=2n_{k-1}-\sum_i d_{i,k}. +$$ + +Thus this rule never overfills a level. An executable version stores the +unfinished-node index $j$: after drawing one bit $u$, set $j\leftarrow2j+u$, +then subtract the four probability digits in output order. The first subtraction +making $j$ negative returns that output; otherwise the remaining $j$ is the +next unfinished-node index. All four digits come from exact residue doubling +modulo 169. + +By induction, the completed output-$i$ prefixes at depth $k$ number exactly +$\lfloor2^k w_i/169\rfloor$. Since $1\leq n_k\leq3$, unfinished probability +is at most $3/2^k$, tending to zero. The resulting output law is therefore +exactly $w_i/169$, not an approximation from finite samples. + +## Finite periodic controller and exact expected cost + +The order of two modulo 169 is 156; replay checks this with exact integer +powers. Every weight is coprime to 13, so its residue sequence is periodic +with that period. The digits and unfinished-node counts repeat. There are +exactly 312 internal phase/node pairs for every one of the 144 residue pairs; +this finite count is checked exhaustively. Two transitions per state give the +624-entry table. No growing arithmetic precision is needed to represent the +sampler's logical control state, although its random tape and stopping length +have no finite worst-case bound. + +The exact expected draw count is + +$$ +E[T]=\frac{\sum_{k=0}^{155} n_k2^{-k}}{1-2^{-156}}. +$$ + +For $(a,b)=(1,1)$ this is + +$$ +E[T]=\frac{9960277917013927549978}{4649714690825496825793}<\frac94. +$$ + +The exact finite catalogue certifies $2=312:done[target-312]+=n + else:nxt[target]=nxt.get(target,0)+n + active=nxt + need(done==[w*(1<=312:return target-312,used + state=target + return None,len(bits) + + +def rejected(fn): + try:fn() + except ValueError:return + raise ValueError('negative control accepted') + + +def main(): + pins=json.loads((HERE/'SOURCES.json').read_text()) + for row in pins['files']: + if row['usage']=='input': + need(hashlib.sha256((ROOT/row['path']).read_bytes()).hexdigest()==row['sha256'],'source bytes') + need(pow(2,PERIOD,DEN)==1 and all(pow(2,k,DEN)!=1 for k in range(1,PERIOD)),'exact binary period') + maximum=Q(0);minimum=Q(4);cases=literal=0 + for a,b in product(range(1,13),repeat=2): + weights,counts,table,mean=make(a,b) + census(table,weights,2*PERIOD) + need(2=4,'false additivity of standalone lower bounds')) + rejected(lambda:need(mean<=2,'understated joint mean')) + rejected(lambda:need(census(table,weights,PERIOD)[1]==0,'false finite draw cap')) + need(Q(1,13)!=Q(1,169),'reused single flag violates independent joint law') + print(json.dumps(dict(status='PASS_PAIRED_RESIDUE_SAMPLER',residue_pairs=cases, + internal_states=312,transitions_per_pair=624,depths_checked_per_pair=312, + literal_tapes=literal,mean_one_one=str(mean),maximum_mean=str(maximum), + minimum_mean=str(minimum), + scope='optimal expected fair-bit count for a fixed nonadaptive pair; physical costs open; no new kappa'),sort_keys=True)) + + +if __name__=='__main__':main() diff --git a/research/runtime-paired-ddg-arithmetic/sources.py b/research/runtime-paired-ddg-arithmetic/sources.py new file mode 100644 index 0000000000..09731bd593 --- /dev/null +++ b/research/runtime-paired-ddg-arithmetic/sources.py @@ -0,0 +1,23 @@ +"""Load exact retained sources. Ali Romman, with Codex. Apache-2.0.""" + +from hashlib import sha256 +import importlib.util +import json +from pathlib import Path + +ROOT = Path(__file__).resolve().parent +PINS = json.loads((ROOT / 'SOURCE-PINS.json').read_text()) +for pin in PINS: + if sha256((ROOT / pin['retained_path']).read_bytes()).hexdigest() != pin['sha256']: + raise ValueError('retained source digest') + + +def load(name, path): + spec = importlib.util.spec_from_file_location(name, ROOT / path) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +arithmetic = load('source7746_arithmetic', 'retained/paired-ddg-arithmetic-step/circuit.py') +graph = load('source6072_graph', 'retained/paired-residue-sampler/verify.py') diff --git a/research/runtime-paired-ddg-arithmetic/verify.py b/research/runtime-paired-ddg-arithmetic/verify.py new file mode 100644 index 0000000000..f5dbd91fa9 --- /dev/null +++ b/research/runtime-paired-ddg-arithmetic/verify.py @@ -0,0 +1,164 @@ +"""Check every runtime pair and transition. Ali Romman, with Codex. Apache-2.0.""" + +from collections import Counter +from hashlib import sha256 +import json +from pathlib import Path +import subprocess +import sys + +import parametric as circuit +from sources import graph + +ROOT = Path(__file__).resolve().parent + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def packet(phase, node, done=False): + return phase | (node << 8) | (int(done) << 10) + + +def comparisons(): + records = [] + summaries = [] + for a in range(1, 13): + for b in range(1, 13): + weights = ((13 - a) * (13 - b), (13 - a) * b, a * (13 - b), a * b) + source_weights, counts, table, _ = graph.make(a, b) + require(weights == source_weights, 'source weight order') + states = [(k, j) for k, count in enumerate(counts) for j in range(count)] + unfinished = 1 + powers = 1 + source_index = 0 + pair_rows = [] + phases = set() + for depth in range(156): + phase = powers % 169 + require(phase not in phases, 'phase repeated early') + phases.add(phase) + leaves = [i for i, w in enumerate(weights) + if (2 * powers * w) // 169 - 2 * ((powers * w) // 169)] + require(unfinished == counts[depth], 'floor and source live counts') + for node in range(unfinished): + for coin in (0, 1): + child = 2 * node + coin + done = child < len(leaves) + output = leaves[child] if done else child - len(leaves) + target = table[source_index + node][coin] + if target >= 312: + require(done and target - 312 == output, 'source leaf') + else: + require(not done and states[target] == ((depth + 1) % 156, output), + 'source continuation') + resident = (coin << circuit.COIN) | (a << 12) | (b << 16) + pair_rows.append((packet(phase, node) | resident, + packet((2 * powers) % 169, output, done) | resident)) + source_index += unfinished + unfinished = 2 * unfinished - len(leaves) + powers *= 2 + require((powers % 169, unfinished, source_index, len(pair_rows)) == (1, 1, 312, 624), + 'period closure') + digest = sha256(json.dumps(pair_rows, separators=(',', ':')).encode()).hexdigest() + summaries.append(dict(a=a, b=b, transitions=len(pair_rows), sha256=digest)) + records.extend(pair_rows) + return records, summaries + + +def lanes(records, width, input_width=20): + result = [] + for wire in range(input_width): + data = bytearray((len(records) + 7) // 8) + for i, record in enumerate(records): + data[i // 8] |= ((record >> wire) & 1) << (i % 8) + result.append(int.from_bytes(data, 'little')) + return result + [0] * (width - input_width) + + +def run(gates, state, count): + result = state.copy() + full = (1 << count) - 1 + for target, controls in gates: + flip = full + for control in controls: + flip &= result[control] + result[target] ^= flip + return result + + +def scalar(gates, record): + for target, controls in gates: + if all(record & (1 << control) for control in controls): + record ^= 1 << target + return record + + +def subtraction_check(): + builder = circuit.Circuit() + output = circuit.subtract_mod(builder, tuple(range(8)), tuple(range(12, 20))) + cases = [(a, b) for a in range(169) for b in range(169)] + initial = lanes([a | (b << 12) for a, b in cases], builder.next_wire) + actual = run(builder.gates, initial, len(cases)) + expected = lanes([(a - b) % 169 for a, b in cases], builder.next_wire) + full = (1 << len(cases)) - 1 + values = [full if bit is True else 0 if bit is False else actual[bit] for bit in output] + require(values == expected[:8], 'complete modular subtraction domain') + require(run(tuple(reversed(builder.gates)), actual, len(cases)) == initial, + 'subtraction uncomputation') + return len(cases) + + +def collect(): + gates, width = circuit.reversible_step() + for target, controls in gates: + require(0 <= target < width and target not in circuit.READ_ONLY, 'read-only input or gate target') + require(len(controls) <= 2 and len(set(controls)) == len(controls), 'gate arity') + require(all(0 <= wire < width and wire != target for wire in controls), 'gate controls') + pairs, summaries = comparisons() + before, after = zip(*pairs, strict=True) + require(len(pairs) == 89856 and len(set(after)) == len(after), 'complete injective domain') + initial, expected = lanes(before, width), lanes(after, width) + actual = run(gates, initial, len(pairs)) + require(actual == expected, 'forward, parameters, coin or cleanup') + require(run(tuple(reversed(gates)), expected, len(pairs)) == initial, 'full inverse') + for wire in (10, 12, circuit.FIRST_SCRATCH): + wrong = actual.copy() + wrong[wire] ^= (1 << len(pairs)) - 1 + require(wrong != expected, 'fault control') + swapped = run(((8, (9,)), (9, (8,)), (8, (9,))), actual, len(pairs)) + require(swapped != expected, 'output-order control') + scalar_cases = [pairs[624 * i + j] for i in range(144) for j in (0, 623)] + for old, new in scalar_cases: + require(scalar(gates, old) == new, 'separate scalar forward') + require(scalar(tuple(reversed(gates)), new) == old, 'separate scalar inverse') + source_mode = ['-O'] if sys.flags.optimize else [] + source_run = subprocess.run([sys.executable, '-W', 'error', *source_mode, '-B', + str(ROOT / 'retained/paired-ddg-arithmetic-step/verify.py')], + check=True, capture_output=True, text=True, timeout=30) + require('PASS_PAIRED_DDG_ARITHMETIC_STEP' in source_run.stdout, 'unchanged fixed-pair replay') + counts = Counter(len(controls) for _, controls in gates) + return dict(schema_version=1, parameter_pairs=144, transitions=len(pairs), + gates=len(gates), x=counts[0], cnot=counts[1], toffoli=counts[2], + packet_bits=11, parameter_bits=8, resident_coin_bits=1, + clean_backing_bits=11, temporary_bits=width - circuit.FIRST_SCRATCH, + clean_work_bits=width - 20, total_wires=width, + gate_sha256=sha256(json.dumps(gates, separators=(',', ':')).encode()).hexdigest(), + subtraction_cases=subtraction_check(), scalar_forward_inverse_cases=len(scalar_cases), + fault_controls=4, source_receipt=source_run.stdout.strip().splitlines(), + pair_certificates=summaries) + + +def main(): + result = collect() + require(result == json.loads((ROOT / 'RESULT.json').read_text()), 'result certificate') + print('PASS_RUNTIME_PAIRED_DDG_ARITHMETIC') + print(f"144 runtime pairs; {result['transitions']} complete forward/inverse transitions") + print(f"{result['x']} X; {result['cnot']} CNOT; {result['toffoli']} Toffoli; {result['gates']} gates") + print(f"{result['temporary_bits']} temporary bits + 11 clean backing bits = {result['clean_work_bits']} clean work bits") + + +if __name__ == '__main__': + main()