From 6733d992c8c229756a2f71fe1ad773e77fb6bab6 Mon Sep 17 00:00:00 2001 From: ahoy-cmyk <65035690+ahoy-cmyk@users.noreply.github.com> Date: Tue, 13 Oct 2026 13:09:40 -0400 Subject: [PATCH 1/2] Add opt-in exact disjoint-tensor frame union propagation --- research/disjoint-frame-unions/BENCHMARK.json | 143 +++++++++++++ research/disjoint-frame-unions/CLAIM.md | 51 +++++ research/disjoint-frame-unions/NOTICE.md | 25 +++ research/disjoint-frame-unions/README.md | 131 ++++++++++++ .../disjoint-frame-unions/RELOCATION.json | 10 + research/disjoint-frame-unions/SOURCES.json | 54 +++++ research/disjoint-frame-unions/VALIDATION.md | 48 +++++ research/disjoint-frame-unions/accelerator.py | 39 ++++ research/disjoint-frame-unions/benchmark.py | 60 ++++++ research/disjoint-frame-unions/test_replay.py | 90 ++++++++ research/disjoint-frame-unions/test_unions.py | 200 ++++++++++++++++++ research/disjoint-frame-unions/verify.py | 84 ++++++++ 12 files changed, 935 insertions(+) create mode 100644 research/disjoint-frame-unions/BENCHMARK.json create mode 100644 research/disjoint-frame-unions/CLAIM.md create mode 100644 research/disjoint-frame-unions/NOTICE.md create mode 100644 research/disjoint-frame-unions/README.md create mode 100644 research/disjoint-frame-unions/RELOCATION.json create mode 100644 research/disjoint-frame-unions/SOURCES.json create mode 100644 research/disjoint-frame-unions/VALIDATION.md create mode 100644 research/disjoint-frame-unions/accelerator.py create mode 100644 research/disjoint-frame-unions/benchmark.py create mode 100644 research/disjoint-frame-unions/test_replay.py create mode 100644 research/disjoint-frame-unions/test_unions.py create mode 100644 research/disjoint-frame-unions/verify.py diff --git a/research/disjoint-frame-unions/BENCHMARK.json b/research/disjoint-frame-unions/BENCHMARK.json new file mode 100644 index 0000000000..e695aa3a7d --- /dev/null +++ b/research/disjoint-frame-unions/BENCHMARK.json @@ -0,0 +1,143 @@ +{ + "assignment_seed": 88, + "clock": "time.perf_counter", + "fresh_processes": true, + "implementation_sha256": { + "accelerator.py": "4b90cdf10e864d6a477c43ded3b3025c38cdf82f6c819b0a055795c31ddd9a02", + "benchmark.py": "1d16e3aaacb572fa8fab4185450e6c7d3280713b9c76d0937b173a26c2fb259a", + "verify.py": "b46d9c15f5583af2ef0b57f838a332ea841370483a503db730a588db94c1a02b" + }, + "machine": "arm64", + "median_wall_seconds": { + "baseline": 5.014369041193277, + "propagated": 3.492928333580494 + }, + "note": "Local descriptive timings, not a speed threshold. Each complete audit includes source admission and byte-identical certificate comparison.", + "pairs": 5, + "platform": "macOS-27.0-arm64-arm-64bit-Mach-O", + "python": "3.14.4 (main, Apr 7 2026, 13:13:20) [Clang 21.0.0 (clang-2100.0.123.102)]", + "samples": [ + { + "base_commit": "2921874911956718fcaaaf9396fe8267b3cfa9f0", + "engine": "baseline", + "pair": 0, + "receipt_sha256": "3f2b37542f9581f9d3238cccfce19fd3e2964c89ec4af4ff047fb8041f5c3cd1", + "scope": "complete_historical_audit", + "seconds": 5.00602824985981, + "source_files": 40, + "source_manifest_sha256": "c413bf530a588b406b2f29e4ca0b82ca6f9612c0562a706609d0034c0d864ec4", + "status": "PASS_DISJOINT_FRAME_UNIONS", + "wall_seconds": 5.052189417183399 + }, + { + "base_commit": "2921874911956718fcaaaf9396fe8267b3cfa9f0", + "engine": "propagated", + "pair": 0, + "receipt_sha256": "3f2b37542f9581f9d3238cccfce19fd3e2964c89ec4af4ff047fb8041f5c3cd1", + "scope": "complete_historical_audit", + "seconds": 3.446310624945909, + "source_files": 40, + "source_manifest_sha256": "c413bf530a588b406b2f29e4ca0b82ca6f9612c0562a706609d0034c0d864ec4", + "status": "PASS_DISJOINT_FRAME_UNIONS", + "wall_seconds": 3.4948033336549997 + }, + { + "base_commit": "2921874911956718fcaaaf9396fe8267b3cfa9f0", + "engine": "propagated", + "pair": 1, + "receipt_sha256": "3f2b37542f9581f9d3238cccfce19fd3e2964c89ec4af4ff047fb8041f5c3cd1", + "scope": "complete_historical_audit", + "seconds": 3.4012637501582503, + "source_files": 40, + "source_manifest_sha256": "c413bf530a588b406b2f29e4ca0b82ca6f9612c0562a706609d0034c0d864ec4", + "status": "PASS_DISJOINT_FRAME_UNIONS", + "wall_seconds": 3.4544588746502995 + }, + { + "base_commit": "2921874911956718fcaaaf9396fe8267b3cfa9f0", + "engine": "baseline", + "pair": 1, + "receipt_sha256": "3f2b37542f9581f9d3238cccfce19fd3e2964c89ec4af4ff047fb8041f5c3cd1", + "scope": "complete_historical_audit", + "seconds": 4.777637083083391, + "source_files": 40, + "source_manifest_sha256": "c413bf530a588b406b2f29e4ca0b82ca6f9612c0562a706609d0034c0d864ec4", + "status": "PASS_DISJOINT_FRAME_UNIONS", + "wall_seconds": 4.826718332711607 + }, + { + "base_commit": "2921874911956718fcaaaf9396fe8267b3cfa9f0", + "engine": "baseline", + "pair": 2, + "receipt_sha256": "3f2b37542f9581f9d3238cccfce19fd3e2964c89ec4af4ff047fb8041f5c3cd1", + "scope": "complete_historical_audit", + "seconds": 4.923342291731387, + "source_files": 40, + "source_manifest_sha256": "c413bf530a588b406b2f29e4ca0b82ca6f9612c0562a706609d0034c0d864ec4", + "status": "PASS_DISJOINT_FRAME_UNIONS", + "wall_seconds": 4.979373416397721 + }, + { + "base_commit": "2921874911956718fcaaaf9396fe8267b3cfa9f0", + "engine": "propagated", + "pair": 2, + "receipt_sha256": "3f2b37542f9581f9d3238cccfce19fd3e2964c89ec4af4ff047fb8041f5c3cd1", + "scope": "complete_historical_audit", + "seconds": 3.4429724160581827, + "source_files": 40, + "source_manifest_sha256": "c413bf530a588b406b2f29e4ca0b82ca6f9612c0562a706609d0034c0d864ec4", + "status": "PASS_DISJOINT_FRAME_UNIONS", + "wall_seconds": 3.492928333580494 + }, + { + "base_commit": "2921874911956718fcaaaf9396fe8267b3cfa9f0", + "engine": "propagated", + "pair": 3, + "receipt_sha256": "3f2b37542f9581f9d3238cccfce19fd3e2964c89ec4af4ff047fb8041f5c3cd1", + "scope": "complete_historical_audit", + "seconds": 3.608594875317067, + "source_files": 40, + "source_manifest_sha256": "c413bf530a588b406b2f29e4ca0b82ca6f9612c0562a706609d0034c0d864ec4", + "status": "PASS_DISJOINT_FRAME_UNIONS", + "wall_seconds": 3.6696084160357714 + }, + { + "base_commit": "2921874911956718fcaaaf9396fe8267b3cfa9f0", + "engine": "baseline", + "pair": 3, + "receipt_sha256": "3f2b37542f9581f9d3238cccfce19fd3e2964c89ec4af4ff047fb8041f5c3cd1", + "scope": "complete_historical_audit", + "seconds": 4.974850708153099, + "source_files": 40, + "source_manifest_sha256": "c413bf530a588b406b2f29e4ca0b82ca6f9612c0562a706609d0034c0d864ec4", + "status": "PASS_DISJOINT_FRAME_UNIONS", + "wall_seconds": 5.029562917072326 + }, + { + "base_commit": "2921874911956718fcaaaf9396fe8267b3cfa9f0", + "engine": "baseline", + "pair": 4, + "receipt_sha256": "3f2b37542f9581f9d3238cccfce19fd3e2964c89ec4af4ff047fb8041f5c3cd1", + "scope": "complete_historical_audit", + "seconds": 4.961562791839242, + "source_files": 40, + "source_manifest_sha256": "c413bf530a588b406b2f29e4ca0b82ca6f9612c0562a706609d0034c0d864ec4", + "status": "PASS_DISJOINT_FRAME_UNIONS", + "wall_seconds": 5.014369041193277 + }, + { + "base_commit": "2921874911956718fcaaaf9396fe8267b3cfa9f0", + "engine": "propagated", + "pair": 4, + "receipt_sha256": "3f2b37542f9581f9d3238cccfce19fd3e2964c89ec4af4ff047fb8041f5c3cd1", + "scope": "complete_historical_audit", + "seconds": 3.373905540909618, + "source_files": 40, + "source_manifest_sha256": "c413bf530a588b406b2f29e4ca0b82ca6f9612c0562a706609d0034c0d864ec4", + "status": "PASS_DISJOINT_FRAME_UNIONS", + "wall_seconds": 3.427934500388801 + } + ], + "speedup": 1.4355774188052695, + "status": "PASS_IDENTICAL_COMPLETE_CERTIFICATES" +} diff --git a/research/disjoint-frame-unions/CLAIM.md b/research/disjoint-frame-unions/CLAIM.md new file mode 100644 index 0000000000..6c1fa55629 --- /dev/null +++ b/research/disjoint-frame-unions/CLAIM.md @@ -0,0 +1,51 @@ +# Verification engineering, seed 88 + +- OS assignment: `secrets.randbelow(100)` returned **88** on 2026-10-13. +- Base: `2921874911956718fcaaaf9396fe8267b3cfa9f0` (freshly fetched main). +- Claim: 2026-10-13 16:44 UTC. Expected finish: 17:20 UTC (13:20 Eastern), + reserving the final quarter for verification and handoff. +- Object: the historical `DisjointTensor.frame_data` target-coordinate unions. +- Method: propagate exact unions along the same reverse DAG traversal as the + unchanged reachable-target bitsets. Compare all three returned maps with + the original, run both frame orientations, and compare complete certificates. +- Deliverable: additive opt-in adapter, differential/negative controls, pinned + sources, paired fresh-process timings, and one focused tooling PR; no new kappa. +- No pinned issues existed; the two open issues were unrelated. Claim is local. + +Initial narrow candidates were Fano-completion reachability, subset-core ledger +replay, and point-cancellation neighbor checks. Their complete certificates all +finished below 0.25 seconds, so none justified optimization. One evidence-driven +pivot selected the disjoint-tensor frame traversal: profiling the actual complete +historical h=26 audit spent 2.34 of 8.53 instrumented seconds in `frame_data`. +These exploratory instrumented timings are not the benchmark result. + +Seed 88 also fixes randomized topological-DAG cases, output permutations and +mutation positions. The object and mechanism distinguish this contribution from +existing optimizations; the seed is not itself a novelty claim. + +Overlap review read the 714-open-PR snapshot through #1019, the review ledger, +selected #942 certificate/review/construction, local claims and relevant negative +results. #950 considered and declined this traversal, choosing central-factor +packing instead. #863 and #981 change historical root contraction/traversal +choices; neither changes `frame_data`. #756 changes balanced-Fano enumeration, +#778 changes single-intersection Gram construction, #976 changes historical +rational rank, and #1006 changes T37 occupancy. None supplies this code. +No closed mathematical search is reopened. + +Current selected conditional kappa at this base is 0.001661960547713947 from +#942, with #890/#869/#870/#858 ancestry and unchanged #589 on #555. This tooling +contribution concerns an older finite supplier and does not alter that frontier +or its inherited all-size/compiler, realization, hosting, precision/tape, +analytic or bit-interface assumptions. + +## Result + +Completed: the complete historical audit is 1.435577x faster in five alternating +fresh-process pairs, with byte-identical complete receipts in all ten runs. +All map entries/order, two physical orientations, independent BFS graph cases, +and failure controls pass. `make verify-tests` passes 661 tests in 96 modules +plus 20 patch checks. See README.md, BENCHMARK.json and VALIDATION.md. +Final review found no competing frame-union implementation among 737 open PRs +through #1042; #1029/#1041 are distinct U8 phase-recipe tools. No coordination +issue was pinned. Source exploration ended before the final verification and +handoff phase. The only additions are this optional package. diff --git a/research/disjoint-frame-unions/NOTICE.md b/research/disjoint-frame-unions/NOTICE.md new file mode 100644 index 0000000000..167a280218 --- /dev/null +++ b/research/disjoint-frame-unions/NOTICE.md @@ -0,0 +1,25 @@ +# Attribution and license + +This contribution is by Stephan Arrington (@steph4n-gh), with substantial +OpenAI Codex assistance in implementation, experiment design, testing, +mathematical explanation and packaging. A separately tasked Codex worker wrote +the breadth-first graph oracle and reviewed the adapter. This is not independent +human peer review. New material is under the repository's Apache-2.0 license. + +The unchanged disjoint-tensor construction, original frame-data verifier, +phase checks, complete historical audit, and dirty-restoration tests are Douglas +R. Colkitt's work, preserved at source commit +`1a74950ce5074b848243ba89d8022fbadba66105`. Their precise base-source hashes are +in SOURCES.json. The adapter retains the original descendant and source-union +calculations and rectangle guard, replacing only target-union computation. + +The opt-in source-admission, complete-certificate comparison and alternating +fresh-process benchmark follow Ross Richardson's incorporated PR950 package, +`research/central-factor-packed/`, credited for that reproducibility pattern. +No packed coefficient kernel is used here. Existing source notices and upstream +Apache-2.0 material are unmodified. + +Concurrent PR863 by Curtis Dransfield and PR981 by @ToikY change root +contraction/traversal recipes for this historical supplier. They are related +construction research, not dependencies or this verifier optimization. Their +source pins are not imported or represented as reviewed by this contribution. diff --git a/research/disjoint-frame-unions/README.md b/research/disjoint-frame-unions/README.md new file mode 100644 index 0000000000..cb725277ab --- /dev/null +++ b/research/disjoint-frame-unions/README.md @@ -0,0 +1,131 @@ +# Exact target unions for the historical disjoint-tensor audit + +This opt-in adapter replaces repeated reachable-target enumeration with exact +union propagation in `DisjointTensor.frame_data`. At h=26 it preserves all three +maps on **60,372 active nodes**, including **9,206,600 reachable-target +memberships**, and reproduces the **entire original historical certificate byte +for byte**. The complete audit still checks integer coefficients, reversible +embedding, both physical frame orientations, exact small residual bases, +operation invoices, rational inequalities, guard slack and its original finite +parameter screens. + +This is verification tooling: no new construction, kappa, search result, or +multiplication runtime claim. The selected conditional result at the pinned base +is PR942's **0.001661960547713947**. Historical bound strings in the reproduced +certificate describe an earlier supplier. + +Five sequential alternating fresh-process pairs on macOS arm64 / Python 3.14.4 +measured median complete-audit wall time **5.014369 s → 3.492928 s (1.435577×)**. +Every one of the ten runs reproduced the same full certificate. The measurement +includes source admission, construction, scalar/frame checks, accounting and +receipt comparison. BENCHMARK.json retains all samples, environment and code +hashes. Timings describe this historical audit, not the selected frontier replay; +there is no performance pass threshold. No other task-local tests or benchmarks +were running during the measurement. + +## Reproduce + +Python 3.11+ and the standard library suffice. From the repository root: + +```sh +python3 -I -B research/disjoint-frame-unions/verify.py +``` + +Expected status: `PASS_DISJOINT_FRAME_UNIONS`, with +`scope: complete_historical_audit` and receipt SHA256 +`3f2b37542f9581f9d3238cccfce19fd3e2964c89ec4af4ff047fb8041f5c3cd1`. +This compares the complete original certificate, including every source hash, +against the committed fixture; no fields are removed or normalized away. + +Additional reproducible checks: + +```sh +python3 -I -B research/disjoint-frame-unions/test_unions.py +python3 -I -O -B research/disjoint-frame-unions/test_unions.py +python3 -I -B research/disjoint-frame-unions/test_replay.py +python3 -I -B research/disjoint-frame-unions/verify.py --engine baseline +python3 -I -B research/disjoint-frame-unions/benchmark.py --pairs 5 --output /tmp/disjoint-frame-unions.json +``` + +Use a new benchmark output path. Full inherited audit replay rejects `-O` to +preserve inherited assertions. The new graph kernel and its independent tests +also pass with assertions disabled; this is a distinct, narrower claim. + +## Equivalence argument + +For a node v let D(v) be its set of reachable output indices. If output i has +ground-coordinate mask T_i, the old loop computes + +``` +U(v) = OR_{i in D(v)} T_i. +``` + +Define F(A) as the OR of T_i over indices in A. Then F(empty)=0 and +F(A union B)=F(A) OR F(B). The original reverse topological pass initializes +D at output nodes, then unions each child's D into each parent. The adapter +initializes U at those same output nodes and propagates it alongside D. +Induction in the identical reverse topological order gives U(v)=F(D(v)) at +every node. Multiple outputs on one node and multiple paths to one output are +handled by OR's idempotence. Target masks are actual output keys, not the +positions of those keys in the sorted output list. + +The reachable-target bitsets are retained in full: later `bit_count` calls +still see exactly the same D. Source unions and the nonempty/disjoint rectangle +checks are unchanged. All three dictionaries preserve the original insertion +order. The adapter assumes exactly the original graph contract: active nodes +are closed under parents and topologically numbered. It is not a new DAG +validator; the original full audit's acyclicity, support, coefficient and +embedding checks remain in place. + +The old loop performs one target-mask lookup for every reachable-target +membership (9,206,600 at h26). The replacement does one ground-mask OR per +active parent edge. Python integers are unbounded; no hash, floating estimate, +truncated bitmap or probabilistic acceptance is substituted for the exact sets. +The full descendant bitset propagation and all later frame checks remain. + +This is a written equivalence argument plus finite independent controls, not a +formal proof of the full multiplication theorem. + +## Coverage and failures + +`test_unions.py` contains eight tests, including five original historical tests +run under a scoped adapter installation. It compares ordered contents of all +three maps at h26, both full physical orientations, and exact small residual +bases. A separately implemented breadth-first graph oracle checks 88 seeded +arbitrary DAGs plus explicit small controls. Cases include aliased outputs, +multiple-coordinate target masks, output insertion permutations, repeated +children, an empty graph, and a 300-input graph with gaps in its active set. +The BFS oracle is intentionally confined to small graphs; the h26 comparison +uses the unmodified original implementation over every map entry. + +Four graph corruptions must retain the original explicit failure: source/target +overlap, zero target union, an active node without an output path, and an alias +that introduces overlap. The historical tests additionally cover corrupted +coefficients/supports and all independent dirty inputs under both signed +invocation directions. + +`test_replay.py` checks altered/missing source files, changed adapter bytes, +changed or incomplete result fields, restoration after an audit exception, +rejection of optimized full replay, and preservation of an existing output. +The finite test domain and seed are fixed; no search or impossibility claim is +made. The stopping rule is those tests plus five alternating benchmark pairs. + +## Pins and scope + +Exact base: `2921874911956718fcaaaf9396fe8267b3cfa9f0`. +`SOURCES.json` binds 40 inherited files, including the original construction, +all imported audit modules, fixture, tests, proof references and upstream files. +Each inherited file hash was compared to its Git blob at that base. It also +binds the new executable adapter, replay, tests and benchmark. Source admission +precedes repository imports; unexpected imported repository scripts are rejected. + +The wrapper temporarily changes only `DisjointTensor.frame_data` and restores +it even if the audit fails. No original source, certificate, source manifest, +`upstream/` file or selected record is edited. This avoids invalidating existing +consumers' immutable source pins, including the related PR950 package. Running +the default repository commands does not automatically opt into this adapter. + +All inherited all-size/compiler, common-label/mutable-source, hosting, +precision/tape, analytic and bit-interface assumptions remain. See NOTICE.md +for predecessor attribution and AI disclosure, CLAIM.md for scope selection, +and VALIDATION.md for the exact completed checks and remaining limitations. diff --git a/research/disjoint-frame-unions/RELOCATION.json b/research/disjoint-frame-unions/RELOCATION.json new file mode 100644 index 0000000000..83108b613f --- /dev/null +++ b/research/disjoint-frame-unions/RELOCATION.json @@ -0,0 +1,10 @@ +{ + "base_commit": "2921874911956718fcaaaf9396fe8267b3cfa9f0", + "engine": "propagated", + "receipt_sha256": "3f2b37542f9581f9d3238cccfce19fd3e2964c89ec4af4ff047fb8041f5c3cd1", + "scope": "complete_historical_audit", + "seconds": 3.3845524583011866, + "source_files": 40, + "source_manifest_sha256": "c413bf530a588b406b2f29e4ca0b82ca6f9612c0562a706609d0034c0d864ec4", + "status": "PASS_DISJOINT_FRAME_UNIONS" +} diff --git a/research/disjoint-frame-unions/SOURCES.json b/research/disjoint-frame-unions/SOURCES.json new file mode 100644 index 0000000000..79cf57a5c9 --- /dev/null +++ b/research/disjoint-frame-unions/SOURCES.json @@ -0,0 +1,54 @@ +{ + "adapter_files": { + "accelerator.py": "4b90cdf10e864d6a477c43ded3b3025c38cdf82f6c819b0a055795c31ddd9a02", + "benchmark.py": "1d16e3aaacb572fa8fab4185450e6c7d3280713b9c76d0937b173a26c2fb259a", + "test_replay.py": "a34323b46557a35921b82bcb5ad01762d02ab6a55441bb6752e9b03828d200f7", + "test_unions.py": "187b5bc52bce5effebc86b8cdaee5ccbb30bdf24208cb2bba3d4450e1c673954", + "verify.py": "b46d9c15f5583af2ef0b57f838a332ea841370483a503db730a588db94c1a02b" + }, + "base_commit": "2921874911956718fcaaaf9396fe8267b3cfa9f0", + "files": { + "LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "certificates/disjoint-tensor-compression.json": "3f2b37542f9581f9d3238cccfce19fd3e2964c89ec4af4ff047fb8041f5c3cd1", + "docs/research/disjoint-tensor-compression.md": "d7d59f70653b8fbb3cb31fbe6466f73ae48a6b79852f2fe649a9d38e1b9763d1", + "notes/disjoint-tensor-compression.tex": "528cba56872313b8cd63ff11f523a399dfb3c85cae1a764110ae9d26ac9151ac", + "scripts/audit_disjoint_tensor.py": "477db540e972b82751fac6a3a6d6e38fb4141e967261b1f9c260e2c686479a78", + "scripts/binary_phase_frames.py": "4148cfa313cf050ed25296e8db36d35871520b8318fd086c7d1facf0c6af67d7", + "scripts/certify.py": "2348d95008276c5d5764f7e028c3918e484582cd589bd4d9b82919161745e53e", + "scripts/complex_compression.py": "9b6f758a5985ba5d9fdd726fe6556b3d3b4bd9d98aaf8ba06a7bb58093c4c504", + "scripts/exclusion_circuit.py": "b253f9d7318becda1c1f3b24e2287ed44a9c27fcea00cf9d531afb950d0457a0", + "scripts/experiments/disjoint_tensor.py": "102dd59bf96033f96ba0dab4c2aba77b3a7a73b67b0f96929ff8b20a98b91cd8", + "scripts/general_network_guard.py": "790a2064449afdbffd6dbd4adbcf4a28eaf41931ce7134e4a4e8766f3764270c", + "scripts/incidence_rectangles.py": "5240fd33dcc3096f5685d10ca360186cad36b355a00d55686a4ea4449417d00e", + "scripts/paired_exclusion_circuit.py": "8f05f04cf06217befd6d0ee0f2d7d0c5c5eb32cfab8c9a8ca7917fd6d620b7d2", + "scripts/paired_network.py": "991223dc3c1374284c361ed017e42bf732dd971fa0bea2be2282cfb18257b3f7", + "scripts/prepare_layers.py": "a6e2adc612f264b1c0e51d18ce6315de9ae5e2ae2420aa22e99a22d8bf304947", + "scripts/search_network.py": "3a4faa5037d9b8e7ca5828afac193a96b6966a8b114f14937921795b24ec4f6a", + "scripts/shared_point_circuit.py": "c9bb7a5df92d260a4e3ad532b53e26936730d7c93f7facfb0784957c1e81c8ba", + "scripts/shared_point_network.py": "a85e7f0d8c42d6a27e3846308571ca324a1824ac5c2d59e4daa5c7673c33c697", + "tests/test_complex_compression.py": "e22e0a339fad8ce2f73312eb7e47a762360f8c1c78122cdd8e0dc85c5fbce99f", + "tests/test_disjoint_tensor.py": "f5dff94104c6f2a127567e0457c77968e7558333af09b50330e575da3fef4a3c", + "upstream/LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "upstream/README.md": "8d1ceff898a4e0e681679f91c4def485820be9e99f04e4861f2ce601a364723e", + "upstream/build/figures/multiplication-flow.tex": "3654d2728b0c98919d61760e1802804ed616546a747f9167a93e17bb8697f320", + "upstream/build/figures/proof-map.tex": "76d4deacf07bea355412abcfd798c7cbe6dcccef29a4a420a9e2a7b158f23848", + "upstream/build/main.tex": "42f0f506976bc2084374a71e97edc1549689a7accf35dda4db2a18af4f13c1aa", + "upstream/build/references.bib": "33cc2df13ccf85330849e8fb34d4ac7613b23f625787457a5b7b9aa6d7369476", + "upstream/build/sections/00-introduction.tex": "98721f03682ccf1cc7d0850b07adabaa2d8f3afe552e3861753eba9d284d0da0", + "upstream/build/sections/01-history.tex": "798956c8150c31e3e2f5f29c47110d25ce619faad1374f4d3a0f15fa3ee33ead", + "upstream/build/sections/02-streams.tex": "606c80db61cad13aa0c3b6060dc4b88dbbe7ac60cdd831aa93f28d908fd09dab", + "upstream/build/sections/03-motifs.tex": "ed76761194988a01af77ead0ea6469cb5dcd29690ab985a0b5a4006b0f2b69bb", + "upstream/build/sections/04-swap.tex": "412b170ccaab38dba96e95e3cbfae09f4876a9818f8d278776a746b0f8044906", + "upstream/build/sections/05-layers.tex": "20cfc8d12099d4e4ed9e3e7eeb6162edd9b6e0e076f24693364cd24377252594", + "upstream/build/sections/06-transforms.tex": "924316e4bc905066281d8f9e8746a49d8829aeb393688608deb1e61c3c87853c", + "upstream/build/sections/07-resampling.tex": "8a6b91670f9163afb54892489fa2210c77fe1b058f0325ec7d18b44b94be6e2c", + "upstream/build/sections/08-assembly.tex": "763d7945b1e1ec4ebae9b799bcefcc45fa9bae6e2ffad799868a9c3d513dbd4a", + "upstream/build/sections/09-exact-arithmetic.tex": "5714e5d0656c78c6a1fde8d01fd11f1ba856a7ea94149b283bd9a50fdbf516c3", + "upstream/build/sections/10-transposition.tex": "c14ad8d56112f6578678a58211bc8d63c3a4b60e55078ac73bc38f7348e713cb", + "upstream/build/sections/11-grouped-rectangles.tex": "6525cd0a01980e56accfeaf06e9d875bc699197ba42c6e22b69435e352275174", + "upstream/formalization.yaml": "2dcbd0d6e6a22475f53d49bfdfcac9b6d2b470653c332a9f56522f5be166edb9", + "upstream/manifest.json": "16ab13971694cabab09440c47ebf2fc0496a9d35fc3af33950fda3498f8e2392" + }, + "historical_source_commit": "1a74950ce5074b848243ba89d8022fbadba66105", + "upstream_commit": "adc7f1241b42e322a6451854ab7e4b4c146bf78a" +} diff --git a/research/disjoint-frame-unions/VALIDATION.md b/research/disjoint-frame-unions/VALIDATION.md new file mode 100644 index 0000000000..da8904f92e --- /dev/null +++ b/research/disjoint-frame-unions/VALIDATION.md @@ -0,0 +1,48 @@ +# Validation receipt + +Completed 2026-10-13 on macOS 27 arm64, CPython 3.14.4. Exact base and refreshed +main: `2921874911956718fcaaaf9396fe8267b3cfa9f0`. + +- `python3 -I -B research/disjoint-frame-unions/test_unions.py`: **8 tests pass**, + including five original historical tests inside the scoped adapter test. + All three maps compare entry-for-entry and in iteration order at h26; all + small generated and 88 seeded graph cases also match a separate BFS oracle. +- The same eight tests pass under `python3 -I -O -B`. This checks the new graph + kernel and finite controls; it does not certify inherited assertion coverage. +- `python3 -I -B research/disjoint-frame-unions/test_replay.py`: **5 tests pass**. + Under `-O`, four pass and the full-receipt test is explicitly skipped because + full audit replay correctly refuses optimized Python. The refusal itself is + tested in both modes. +- Five alternating fresh-process baseline/adapter pairs reproduce the complete + certificate in all **10 runs**. Median wall times are **5.014369041 s** and + **3.492928334 s**, a **1.435577419x** speedup. All samples and code/source + manifest hashes are in BENCHMARK.json; none is excluded. No task-local test + or other experiment ran concurrently with those benchmark processes. +- `PYTHONDONTWRITEBYTECODE=1 make verify-tests`: **661 tests in 96 isolated + modules and 20 patch-application checks pass**, exit code zero. These tests + use the default sources; the new optional package is tested separately above. +- `make selected-record-check`: passes, retaining + `1661960547713947/1000000000000000000`. +- Minimal relocation: copied only the 40 pinned inherited files and this + package into a temporary path containing spaces, then invoked the isolated + adapter from `/tmp`. Full certificate comparison passes without Git or + unrelated repository artifacts. RELOCATION.json preserves the result. +- Every inherited hash matches its base Git blob and the refreshed main blob. + The benchmark's adapter and manifest hashes match the final executable files. +- A separate Codex worker reviewed the final implementation, wrapper, proof and + tests read-only and found no actionable issues. This is AI review, not human + peer review. +- `git diff --check` passes. Only `research/disjoint-frame-unions/` is added; + all pre-existing source and certificate bytes remain unchanged. + +The final PR overlap snapshot contained 737 open PRs through #1042. Newly +arrived #1029 (`ff4d7b9ac97a584275fe0653f226f4ce2ffc6086`) and #1041 +(`9576c644a4cafd2cfac309689a19342451702f81`) concern U8 phase recipes; their +changed-file lists do not overlap this historical frame-union adapter. +No pinned coordination issue exists. Related #863/#981 change constructions, +and #950's central-factor verifier is credited separately in NOTICE.md. + +Not run: full `make verify`, selected-supplier cold replay, Lean, or hosted Linux +CI. Those are not claimed by this additive historical-verifier contribution. +No new bound, all-size implementation, global optimality, or unconditional +multiplication theorem follows from these finite checks. diff --git a/research/disjoint-frame-unions/accelerator.py b/research/disjoint-frame-unions/accelerator.py new file mode 100644 index 0000000000..e4bdd7e3ae --- /dev/null +++ b/research/disjoint-frame-unions/accelerator.py @@ -0,0 +1,39 @@ +"""Exact target-coordinate unions without enumerating descendant bits. + +Douglas R. Colkitt's historical frame_data supplies the unchanged descendant +and source-union calculations. Adaptation by Stephan Arrington with substantial +OpenAI Codex assistance; Apache-2.0. See NOTICE.md and README.md. +""" +from certify import require + + +def frame_data(self): + """Return the same three maps as DisjointTensor.frame_data. + + Union commutes with union: propagating the ground-coordinate mask of each + output alongside its descendant bit gives the union over exactly the same + reachable outputs. No target bitset, source union or rectangle check is + omitted. As in the original, active nodes are topologically numbered. + """ + descendants = {node: 0 for node in self.active} + target_union = {node: 0 for node in sorted(self.active)} + for i, target in enumerate(sorted(self.outputs)): + node = self.outputs[target] + descendants[node] |= 1 << i + target_union[node] |= target + for node in sorted(self.active, reverse=True): + if self.args[node]: + for parent in self.args[node]: + descendants[parent] |= descendants[node] + target_union[parent] |= target_union[node] + source_union = {} + for node in sorted(self.active): + if self.args[node]: + a, b = self.args[node] + source_union[node] = source_union[a] | source_union[b] + else: + source_union[node] = self.inputs[node - 1] + union = target_union[node] + require(union and not union & source_union[node], + 'Node is not a disjoint rectangle') + return descendants, source_union, target_union diff --git a/research/disjoint-frame-unions/benchmark.py b/research/disjoint-frame-unions/benchmark.py new file mode 100644 index 0000000000..557a168ad9 --- /dev/null +++ b/research/disjoint-frame-unions/benchmark.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python3 +"""Alternate complete original and adapted audits in fresh processes.""" +import argparse +import hashlib +import json +from pathlib import Path +import platform +import statistics +import subprocess +import sys +import time + +HERE = Path(__file__).resolve().parent + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--pairs', type=int, default=5) + parser.add_argument('--output', type=Path, required=True) + args = parser.parse_args() + if args.pairs < 1 or args.output.exists(): + parser.error('Require positive pairs and a new output path') + samples = [] + receipts = set() + manifests = set() + for pair in range(args.pairs): + order = ('baseline', 'propagated') if pair % 2 == 0 else ('propagated', 'baseline') + for engine in order: + command = [sys.executable, '-I', '-B', str(HERE / 'verify.py'), '--engine', engine] + start = time.perf_counter() + proc = subprocess.run(command, capture_output=True, text=True, check=True) + elapsed = time.perf_counter() - start + result = json.loads(proc.stdout) + if (result['status'] != 'PASS_DISJOINT_FRAME_UNIONS' or + result['scope'] != 'complete_historical_audit' or result['engine'] != engine): + raise ValueError('Unexpected benchmark receipt') + receipts.add(result['receipt_sha256']) + manifests.add(result['source_manifest_sha256']) + samples.append(dict(pair=pair, wall_seconds=elapsed, **result)) + print(pair, engine, f'{elapsed:.6f}s', flush=True) + if len(receipts) != 1 or len(manifests) != 1: + raise ValueError('Benchmark receipts or sources differ') + medians = {engine: statistics.median(x['wall_seconds'] for x in samples if x['engine'] == engine) + for engine in ('baseline', 'propagated')} + result = dict(status='PASS_IDENTICAL_COMPLETE_CERTIFICATES', assignment_seed=88, + pairs=args.pairs, fresh_processes=True, python=sys.version, + platform=platform.platform(), machine=platform.machine(), + clock='time.perf_counter', median_wall_seconds=medians, + speedup=medians['baseline']/medians['propagated'], samples=samples, + implementation_sha256={p.name: hashlib.sha256(p.read_bytes()).hexdigest() + for p in (HERE/'accelerator.py', HERE/'verify.py', HERE/'benchmark.py')}, + note='Local descriptive timings, not a speed threshold. Each complete audit ' + 'includes source admission and byte-identical certificate comparison.') + with args.output.open('x') as stream: + stream.write(json.dumps(result, indent=2, sort_keys=True) + '\n') + print(result['status'], medians, 'speedup', result['speedup']) + + +if __name__ == '__main__': + main() diff --git a/research/disjoint-frame-unions/test_replay.py b/research/disjoint-frame-unions/test_replay.py new file mode 100644 index 0000000000..8cddc71905 --- /dev/null +++ b/research/disjoint-frame-unions/test_replay.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python3 +"""Failure-detection controls for the source-bound optional replay.""" +import copy +import json +from pathlib import Path +import shutil +import subprocess +import sys +import tempfile +import unittest +from unittest.mock import patch + +HERE = Path(__file__).resolve().parent +sys.path[:0] = [str(HERE), str(HERE.parents[1] / 'scripts')] +import verify +import audit_disjoint_tensor as audit +from experiments.disjoint_tensor import DisjointTensor + + +class ReplayControls(unittest.TestCase): + def test_source_and_missing_file_are_rejected(self): + pins = verify.admit_sources() + with tempfile.TemporaryDirectory() as tmp: + root = Path(tmp) + for name in pins['files']: + dest = root / name + dest.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(verify.ROOT / name, dest) + self.assertEqual(verify.admit_sources(root), pins) + target = root / 'scripts/experiments/disjoint_tensor.py' + original = target.read_bytes() + target.write_bytes(original + b'\n# changed source\n') + with self.assertRaisesRegex(ValueError, 'Source pin mismatch'): + verify.admit_sources(root) + target.write_bytes(original) + (root / verify.FIXTURE).unlink() + with self.assertRaisesRegex(ValueError, 'Source pin mismatch'): + verify.admit_sources(root) + + def test_adapter_source_is_admitted(self): + with tempfile.TemporaryDirectory() as tmp: + here = Path(tmp) + shutil.copyfile(HERE / 'SOURCES.json', here / 'SOURCES.json') + pins = json.loads((here / 'SOURCES.json').read_text()) + for name in pins['adapter_files']: + shutil.copyfile(HERE / name, here / name) + (here / 'accelerator.py').write_text('# not the admitted adapter\n') + with patch.object(verify, 'HERE', here): + with self.assertRaisesRegex(ValueError, 'Adapter pin mismatch'): + verify.admit_sources() + + @unittest.skipIf(sys.flags.optimize, 'Full inherited replay deliberately rejects -O') + def test_complete_receipt_comparison_and_patch_restoration(self): + receipt = json.loads((verify.ROOT / verify.FIXTURE).read_text()) + changed = copy.deepcopy(receipt) + changed['expanded_disjoint_circuit']['roles'] += 1 + missing = copy.deepcopy(receipt) + del missing['phase_frames'] + previous = DisjointTensor.frame_data + for mutated in (changed, missing): + with self.subTest(kind='changed' if mutated is changed else 'missing'): + with patch.object(audit, 'certificate', return_value=mutated): + with self.assertRaisesRegex(ValueError, 'Complete historical certificate mismatch'): + verify.replay() + self.assertIs(DisjointTensor.frame_data, previous) + with patch.object(audit, 'certificate', side_effect=ValueError('deliberate audit failure')): + with self.assertRaisesRegex(ValueError, 'deliberate audit failure'): + verify.replay() + self.assertIs(DisjointTensor.frame_data, previous) + + def test_optimized_full_replay_is_rejected(self): + result = subprocess.run([sys.executable, '-I', '-O', '-B', str(HERE / 'verify.py')], + capture_output=True, text=True) + self.assertNotEqual(result.returncode, 0) + self.assertIn('requires assertions; omit -O', result.stderr) + self.assertNotIn('PASS_DISJOINT_FRAME_UNIONS', result.stdout) + + def test_existing_output_is_preserved(self): + with tempfile.TemporaryDirectory() as tmp: + output = Path(tmp) / 'keep.json' + output.write_bytes(b'unchanged') + result = subprocess.run([sys.executable, '-I', '-B', str(HERE / 'verify.py'), + '--output', str(output)], capture_output=True, text=True) + self.assertNotEqual(result.returncode, 0) + self.assertIn('Output already exists', result.stderr) + self.assertEqual(output.read_bytes(), b'unchanged') + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/research/disjoint-frame-unions/test_unions.py b/research/disjoint-frame-unions/test_unions.py new file mode 100644 index 0000000000..d475810715 --- /dev/null +++ b/research/disjoint-frame-unions/test_unions.py @@ -0,0 +1,200 @@ +#!/usr/bin/env python3 +"""Differential and independent graph checks for the opt-in frame adapter. + +Run directly, including under ``python3 -O``. Arbitrary-DAG cases exercise +``frame_data``'s graph contract, not the stronger cancellation-free circuit +contract checked by ``DisjointTensor.verify``. +""" +from collections import deque +from pathlib import Path +import random +import sys +from types import SimpleNamespace +import unittest +from unittest.mock import patch + +ROOT = Path(__file__).resolve().parents[2] +sys.path.insert(0, str(Path(__file__).resolve().parent)) +sys.path.insert(0, str(ROOT / 'scripts')) +sys.path.insert(0, str(ROOT / 'tests')) + +from accelerator import frame_data +from experiments.disjoint_tensor import DisjointTensor +import test_disjoint_tensor + +ORIGINAL = DisjointTensor.frame_data +SEED = 88 + + +def explicit_graph_oracle(circuit): + """Use separate per-node breadth-first searches, with no union recurrence.""" + users = {node: [] for node in circuit.active} + for node in circuit.active: + for parent in circuit.args[node] or (): + users[parent].append(node) + targets = sorted(circuit.outputs) + descendants, source_union, target_union = {}, {}, {} + for start in sorted(circuit.active): + pending = deque([start]) + reachable = set() + while pending: + node = pending.popleft() + if node in reachable: + continue + reachable.add(node) + pending.extend(users[node]) + target_bits = 0 + target_mask = 0 + for i, target in enumerate(targets): + if circuit.outputs[target] in reachable: + target_bits |= 1 << i + target_mask |= target + descendants[start] = target_bits + target_union[start] = target_mask + + pending = deque([start]) + ancestors = set() + source_mask = 0 + while pending: + node = pending.popleft() + if node in ancestors: + continue + ancestors.add(node) + if circuit.args[node]: + pending.extend(circuit.args[node]) + else: + source_mask |= circuit.inputs[node - 1] + source_union[start] = source_mask + return descendants, source_union, target_union + + +def graph(inputs, additions, outputs, extra_active=()): + """Create just the state consumed by frame_data; node zero is unused.""" + args = [None] * (len(inputs) + 1) + list(additions) + active = set(extra_active) + pending = list(outputs.values()) + while pending: + node = pending.pop() + if node in active: + continue + active.add(node) + pending.extend(args[node] or ()) + return SimpleNamespace(inputs=list(inputs), args=args, + outputs=dict(outputs), active=active) + + +class FrameUnionChecks(unittest.TestCase): + def compare_maps(self, circuit): + original = ORIGINAL(circuit) + optimized = frame_data(circuit) + self.assertEqual(optimized, original) + self.assertEqual([list(result.items()) for result in optimized], + [list(result.items()) for result in original]) + self.assertEqual(optimized, explicit_graph_oracle(circuit)) + self.assertEqual(len(optimized), 3) + for result in optimized: + self.assertEqual(set(result), circuit.active) + + def test_seeded_arbitrary_topological_dags(self): + rng = random.Random(SEED) + for case in range(88): + count = rng.randint(1, 8) + inputs = [1 << i for i in range(count)] + additions = [] + for _ in range(rng.randint(0, 24)): + last = count + len(additions) + additions.append((rng.randint(1, last), rng.randint(1, last))) + # An actual repeated child tests OR idempotence explicitly. + last = count + len(additions) + additions.append((last, last)) + last += 1 + outputs = {1 << count: last, 1 << (count + 1): last} + for target in range(2, rng.randint(3, 7)): + # Include multi-coordinate targets without conflating labels + # with their positions in the sorted reachable-target bitset. + mask = (1 << (count + target)) | (1 << count) + outputs[mask] = rng.randint(1, last) + with self.subTest(case=case): + circuit = graph(inputs, additions, outputs) + self.compare_maps(circuit) + expected = frame_data(circuit) + items = list(outputs.items()) + rng.shuffle(items) + circuit.outputs = dict(items) + self.assertEqual(frame_data(circuit), expected) + self.compare_maps(circuit) + + def test_explicit_aliased_outputs_and_target_masks(self): + circuit = graph([1, 2], [(1, 2), (3, 3)], + {0b1100: 4, 0b10100: 4, 0b100000: 1}) + self.compare_maps(circuit) + descendants, sources, targets = frame_data(circuit) + self.assertEqual(descendants[1], 0b111) + self.assertEqual(descendants[4], 0b011) + self.assertEqual(sources[4], 0b11) + self.assertEqual(targets[4], 0b11100) + self.assertEqual(targets[1], 0b111100) + + def test_empty_graph(self): + self.compare_maps(graph([], [], {})) + + def test_gapped_active_nodes_preserve_map_item_order(self): + inputs = [1 << i for i in range(300)] + circuit = graph(inputs, [(1, 256), (2, 301), (257, 302)], + {1 << 300: 303, 1 << 301: 299}) + self.compare_maps(circuit) + + def test_overlap_and_unreachable_guards_are_preserved(self): + cases = { + 'source_target_overlap': graph([1, 2], [(1, 2)], {1: 3}), + 'zero_target_union': graph([1], [], {0: 1}), + 'active_without_output_path': graph([1, 2], [], {4: 1}, (2,)), + 'alias_introduces_overlap': graph([1, 2], [(1, 2)], {4: 3, 1: 3}), + } + for name, circuit in cases.items(): + for method in (ORIGINAL, frame_data): + with self.subTest(case=name, method=method.__module__): + with self.assertRaisesRegex(ValueError, 'not a disjoint rectangle'): + method(circuit) + + def test_generated_small_circuits_and_both_frame_orientations(self): + for h, k in ((4, 1), (6, 2), (8, 3), (10, 3)): + with self.subTest(h=h, k=k): + circuit = DisjointTensor(h, k) + self.compare_maps(circuit) + if k == 3: + expected = circuit.verify_frames(exact_bases=True) + with patch.object(DisjointTensor, 'frame_data', frame_data): + self.assertEqual(circuit.verify_frames(exact_bases=True), expected) + self.assertIs(DisjointTensor.frame_data, ORIGINAL) + + def test_h26_all_maps_and_both_frame_orientations(self): + circuit = DisjointTensor(26) + # The separate BFS oracle is deliberately confined to small graphs; + # h=26 compares every entry of every map against the historical scan. + optimized, original = frame_data(circuit), ORIGINAL(circuit) + self.assertEqual(optimized, original) + self.assertEqual([list(result.items()) for result in optimized], + [list(result.items()) for result in original]) + expected = circuit.verify_frames() + self.assertEqual(expected['orientations'], 2) + with patch.object(DisjointTensor, 'frame_data', frame_data): + self.assertEqual(circuit.verify_frames(), expected) + self.assertIs(DisjointTensor.frame_data, ORIGINAL) + + def test_five_historical_tests_with_scoped_adapter(self): + suite = unittest.defaultTestLoader.loadTestsFromTestCase( + test_disjoint_tensor.TensorDisjointness) + self.assertEqual(suite.countTestCases(), 5) + result = unittest.TestResult() + with patch.object(DisjointTensor, 'frame_data', frame_data): + suite.run(result) + self.assertIs(DisjointTensor.frame_data, ORIGINAL) + self.assertEqual(result.testsRun, 5) + self.assertEqual(result.errors, []) + self.assertEqual(result.failures, []) + self.assertEqual(result.skipped, []) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/research/disjoint-frame-unions/verify.py b/research/disjoint-frame-unions/verify.py new file mode 100644 index 0000000000..4cf27ccddc --- /dev/null +++ b/research/disjoint-frame-unions/verify.py @@ -0,0 +1,84 @@ +#!/usr/bin/env python3 +"""Opt-in exact union propagation for the complete historical tensor audit.""" +import argparse +import hashlib +import json +from pathlib import Path +import sys +import time + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +BASE = '2921874911956718fcaaaf9396fe8267b3cfa9f0' +FIXTURE = 'certificates/disjoint-tensor-compression.json' + + +def sha(data): + return hashlib.sha256(data).hexdigest() + + +def admit_sources(root=ROOT): + pins = json.loads((HERE / 'SOURCES.json').read_text()) + if pins['base_commit'] != BASE: + raise ValueError('Wrong base commit') + for name, expected in pins['files'].items(): + path = root / name + if not path.is_file() or sha(path.read_bytes()) != expected: + raise ValueError('Source pin mismatch: ' + name) + for name, expected in pins['adapter_files'].items(): + if sha((HERE / name).read_bytes()) != expected: + raise ValueError('Adapter pin mismatch: ' + name) + return pins + + +def replay(engine='propagated'): + if sys.flags.optimize: + raise ValueError('Inherited full audit requires assertions; omit -O') + if engine not in ('baseline', 'propagated'): + raise ValueError('Unknown engine') + start = time.perf_counter() + pins = admit_sources() + sys.path[:0] = [str(ROOT / 'scripts'), str(HERE)] + import audit_disjoint_tensor as audit + from experiments.disjoint_tensor import DisjointTensor + from accelerator import frame_data + previous = DisjointTensor.frame_data + try: + if engine == 'propagated': + DisjointTensor.frame_data = frame_data + receipt = audit.serializable(audit.certificate()) + finally: + DisjointTensor.frame_data = previous + raw = (json.dumps(receipt, indent=2, sort_keys=True) + '\n').encode() + if raw != (ROOT / FIXTURE).read_bytes(): + raise ValueError('Complete historical certificate mismatch') + for module in list(sys.modules.values()): + path = getattr(module, '__file__', None) + if path is not None and Path(path).resolve().is_relative_to(ROOT / 'scripts'): + name = Path(path).resolve().relative_to(ROOT).as_posix() + if name not in pins['files']: + raise ValueError('Unpinned imported module: ' + name) + return dict(status='PASS_DISJOINT_FRAME_UNIONS', engine=engine, + scope='complete_historical_audit', base_commit=BASE, + receipt_sha256=sha(raw), source_files=len(pins['files']), + source_manifest_sha256=sha((HERE / 'SOURCES.json').read_bytes()), + seconds=time.perf_counter() - start) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--engine', choices=('baseline', 'propagated'), default='propagated') + parser.add_argument('--output', type=Path, help='New file; existing output is never replaced') + args = parser.parse_args() + if args.output is not None and args.output.exists(): + parser.error('Output already exists') + result = replay(args.engine) + encoded = json.dumps(result, indent=2, sort_keys=True) + '\n' + if args.output is not None: + with args.output.open('x') as stream: + stream.write(encoded) + print(encoded, end='') + + +if __name__ == '__main__': + main() From 8c5dfb29368481f6bb7bb210ba08d8f58d9f4ef8 Mon Sep 17 00:00:00 2001 From: ahoy-cmyk <65035690+ahoy-cmyk@users.noreply.github.com> Date: Tue, 13 Oct 2026 13:09:59 -0400 Subject: [PATCH 2/2] Link completed seed 88 contribution in local sprint claim --- research/disjoint-frame-unions/CLAIM.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/research/disjoint-frame-unions/CLAIM.md b/research/disjoint-frame-unions/CLAIM.md index 6c1fa55629..8bb883adae 100644 --- a/research/disjoint-frame-unions/CLAIM.md +++ b/research/disjoint-frame-unions/CLAIM.md @@ -49,3 +49,5 @@ Final review found no competing frame-union implementation among 737 open PRs through #1042; #1029/#1041 are distinct U8 phase-recipe tools. No coordination issue was pinned. Source exploration ended before the final verification and handoff phase. The only additions are this optional package. + +Submitted contribution: [PR #1044](https://github.com/CrocSwap/integer-mult-bounds/pull/1044).