diff --git a/.github/workflows/cyclic-deferred.yml b/.github/workflows/cyclic-deferred.yml new file mode 100644 index 0000000000..48ef40fb9a --- /dev/null +++ b/.github/workflows/cyclic-deferred.yml @@ -0,0 +1,21 @@ +name: Verify cyclic deferred witness +on: [push, pull_request, workflow_dispatch] +permissions: + contents: read +jobs: + focused: + runs-on: ubuntu-24.04 + timeout-minutes: 25 + strategy: + fail-fast: false + matrix: + python-version: ['3.11', '3.13', '3.14'] + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 + with: + persist-credentials: false + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 + with: + python-version: ${{ matrix.python-version }} + - run: python3 research/cyclic-deferred/verify.py + - run: git diff --exit-code diff --git a/.github/workflows/shrunk-frames.yml b/.github/workflows/shrunk-frames.yml new file mode 100644 index 0000000000..ab53261b13 --- /dev/null +++ b/.github/workflows/shrunk-frames.yml @@ -0,0 +1,21 @@ +name: Verify shrunk-frame deferred witness +on: [push, pull_request, workflow_dispatch] +permissions: + contents: read +jobs: + focused: + runs-on: ubuntu-24.04 + timeout-minutes: 25 + strategy: + fail-fast: false + matrix: + python-version: ['3.11', '3.13', '3.14'] + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 + with: + persist-credentials: false + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 + with: + python-version: ${{ matrix.python-version }} + - run: python3 research/shrunk-frames/verify.py + - run: git diff --exit-code diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index d490b0f3c6..ef24db1475 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -143,3 +143,26 @@ verified posts, profile associations and unresolved account identities. - **Michiel Kosters** ([research repository](https://github.com/michielkosters/mathematics_ai/tree/2e0aa64ca09c87fc94f8575f59493f70cf929d71/problems/integer-multiplication-109); Douglas associates @one_line_proof) developed a parallel weighted-hypergraph/coordinate-frame candidate, compressed centers and aligned bit pairing. Our [review](research/parallel-announcements/README.md) reproduces the finite certificate with its transfer/precision limitations explicit. - **Abe / @abe_asfaw**, via a suggestion supplied by Douglas, identified the redundant complex center and its historical 26.5% numerical gain. We [checked the scalar identity, counts and assembly arithmetic](research/parallel-announcements/README.md), and credit this parallel observation alongside the already preserved rank-h center research. + +## Terminal-elision and shrunk-frame submissions + +**SovereignSteak, PR #122**, submitted the Round 15 terminal-accumulator +elimination candidate and its exact majorization audit. The package redirects +updates at their original gate indices and charges the transformed schedule. +The PR's conditional finite certificate is not an unconditional multiplication +theorem. + +**Joel Pulikkan (GamingPuzzled), PR #125**, submitted shrunk lifted frames with +saturated deferral. The contribution delays selected frame growth while +preserving the stated frame contract and exact downstream checks. + +The current stacked research candidate, prepared by **Sennemmi with substantial +OpenAI Codex assistance**, composes those two ideas: it removes terminal roles +from the #125 shrunk-frame profile and charges all direct redirects in the +scalar bound. This is a distinct composition submitted for review; it does not +claim global optimality, a complete theorem proof, or priority over either +source. It is submitted as [Draft PR #140](https://github.com/CrocSwap/integer-mult-bounds/pull/140) +against upstream `main`, with the construction snapshot at +`9cdf73e8682fb12749482e710e50bc585d282a7c`; independent mathematical review is +pending. Inclusion is an attribution record, not external acceptance. Original +source licenses and each contributor's AI disclosures remain applicable. diff --git a/Makefile b/Makefile index 84fe8290f3..e60b843993 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,7 @@ verify-community: community-audit-check community-followup-check copied-reversed $(MAKE) climbed-48-verify verify-producers: + $(MAKE) stopped-product-verify $(MAKE) copied-centers-verify $(MAKE) structured-bulk-verify $(MAKE) endpoint-gauge-producer endpoint-gauge-certificate @@ -428,3 +429,12 @@ pair-assembly-verify: pair-assembly-producer pair-assembly-check .PHONY: verify-pair verify-pair: pair-assembly-verify python3 scripts/audit_pair_candidate.py --check docs/research/community-pair-arithmetic.json + +.PHONY: stopped-product-producer stopped-product-certificate stopped-product-verify +stopped-product-producer: + python3 scripts/stopped_product_producer.py + +stopped-product-certificate: + python3 scripts/stopped_product_network.py + +stopped-product-verify: stopped-product-producer stopped-product-certificate diff --git a/NOTICE b/NOTICE index b565637758..50c6d1236d 100644 --- a/NOTICE +++ b/NOTICE @@ -302,3 +302,20 @@ inherited PR #48 sources. The stacked witness in research/pair-assembly/frame uses eumemic's PR #57 joint frame compiler unchanged; its driver and verifier are adaptations of PR #57's skip_frame_compiler.py, skip_frame_compose.py and verify_skip_frame.py. Original notices are retained. + +Stopped product-ring extension, 9 October 2026 +Copyright 2026 icekylinx + +The opposite-bank generic projector factorization, componentwise atom-ring +adapters, stopped recurrence and outer ordinary-interchange conversion, +aligned pair-star producer with rational centers, exact denominator-21 +grid and selected (23,23)/(24,24) composition are contributed by icekylinx +with substantial OpenAI GPT-6 Astra and Codex assistance. This extension +builds on merged PR #36, 11817ccacb564bb7f98789c20dc11d3fece207e3, and is +integrated on upstream main 56b66d58297deca1d7dd130247d720e960f77a37. + +The retained ordinary leaf uses the preceding projector, corner and +copied-center proofs. The selected two-stage topology retains Aurel Prosz +(Paureel), Swapnil Jain and Zhihao Chen's credits; the semantic assembly +retains PR #21/#23 and RaD's attribution. Paired producers, carrier matching, +original source notices and each imported license remain unchanged. diff --git a/PATCHING.md b/PATCHING.md index b60f3f101b..a02e230256 100644 --- a/PATCHING.md +++ b/PATCHING.md @@ -1,6 +1,6 @@ # Applying the inherited manuscript patch -This patch is the PR #10 baseline. The current copied-center extension is +This patch is the PR #10 baseline. The PR #36 copied-center extension is presented in `notes/copied-centers-note.tex`; it is not included in this historical combined manuscript patch. @@ -30,3 +30,6 @@ alternatives for the same base. PR7 is pinned at `6725c6a17b17871a35353fd29157f4ed851bc114` for the retained producer sources. The old uniform recurrences keep their original exponents. The active consumers use `lem:batched-chunk-swap` and `prop:batched-simultaneous-layer`. + +The stopped product-ring extension is supplied separately in +`notes/stopped-product-note.tex`; it does not regenerate this historical patch. diff --git a/README.md b/README.md index 035c259b68..31aa46c2e2 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,36 @@ **Community research maintained by Douglas Colkitt — conditional on the original OpenAI #109 framework.** +## Stopped product-ring extension + +The new construction contributed by **icekylinx**, extending merged +[PR #36](https://github.com/CrocSwap/integer-mult-bounds/pull/36), gives + +$$ +T(n)=O\!\left(n(\log n)^{1-\kappa}\right),\qquad +\kappa=\frac{194869}{2500000000}=7.79476\times10^{-5}. +$$ + +It combines a stopped product-ring bit interchange on `(23,23)` with an +all-disjoint rational-center complex network on `(24,24)`. The new generic +opposite-bank factorization pays one reversed child per projector rank; +atom adapters, ordinary leaves, endpoint copies and the exact denominator-21 +grid are included in the proof. The bound retains the original analytic +and fixed-tape hypotheses. + +[Proof source](notes/stopped-product-note.tex) · +[Exact certificate](certificates/stopped-product-network.json) · +[Incremental reproduction](docs/stopped-product.md) + +```sh +make stopped-product-verify +``` + +The maintainer-reviewed community checkpoint below remains its own result +and validation record. + +## Reviewed community checkpoint + The reviewed community witness gives $$ diff --git a/SOURCES.json b/SOURCES.json index 6096d5aff9..380b5425c2 100644 --- a/SOURCES.json +++ b/SOURCES.json @@ -234,5 +234,47 @@ } ], "continuing_analytic_dependencies": "See structured_bulk_extension.adopted and references/semantic-bulk/MANIFEST.json." + }, + "stopped_product_extension": { + "contributor": "icekylinx", + "base_commit": "56b66d58297deca1d7dd130247d720e960f77a37", + "proof_predecessor_PR": "https://github.com/CrocSwap/integer-mult-bounds/pull/36", + "proof_predecessor_commit": "11817ccacb564bb7f98789c20dc11d3fece207e3", + "predecessor_merged": true, + "archive": "integer_mult_round5_kappa_7_79476e-5_complete.zip", + "archive_sha256": "714cbffa0cccba3c18f046a63e62d6981683cb386b5d5cd09761be7b70f0b0be", + "kappa": "194869/2500000000", + "proof": "notes/stopped-product-note.tex", + "certificate": "certificates/stopped-product-network.json", + "producer": "scripts/stopped_product_producer.py", + "assistance": "Substantial OpenAI GPT-6 Astra and Codex assistance.", + "scope": "Conditional on the retained analytic and fixed-tape framework; new product-ring and exact rational-grid arguments supplied as written proofs.", + "continuing_dependencies": [ + "copied_centers_extension", + "structured_bulk_extension" + ], + "icekylinx_lineage": [ + { + "pr": 10, + "commit": "62691e395a0458ce089a1c7b5d89e74291e95e29" + }, + { + "pr": 18, + "commit": "f2ab41aebad47861caf6316282c1793e5513845e" + }, + { + "pr": 24, + "commit": "ed90fd940279c336ebc45968631bdebfb087b505" + }, + { + "pr": 32, + "commit": "0ef3aeb61f55cc0b321ce6a0ef00acee25cefe52" + }, + { + "pr": 36, + "commit": "11817ccacb564bb7f98789c20dc11d3fece207e3" + } + ], + "curation": "Selected h23/h24 inputs, generator, exact certificate and proofs only; excludes raw graphs, research alternatives and recursive predecessor copies." } } diff --git a/certificates/joint-dual-kappa.json b/certificates/joint-dual-kappa.json index d92f653fe4..31628a32dc 100644 --- a/certificates/joint-dual-kappa.json +++ b/certificates/joint-dual-kappa.json @@ -842,7 +842,7 @@ "scripts/experiments/pin_joint_dual_sources.py": "4d31cc0e38b7902709ca5f8f714cba109760d2592346dd7f8dc0b900a2d9fe00", "scripts/experiments/verify_joint_dual.py": "7a31bba1e9c0ded32ae285df2ca9bc91ef20c330f6789fdba361876f3c7a1985" }, - "source_manifest_sha256": "fd1aab7d75753b4b55b2377f26119dae74f367b0b4fab66cba42d944b3042cc9", + "source_manifest_sha256": "db926540bbc818963af5ac78ed8949e6263afffdbbe2f05ee781ef7d3cde48f0", "sources": [ { "files": { diff --git a/certificates/joint-dual-validation.json b/certificates/joint-dual-validation.json index 99adb4cf74..b2624180c2 100644 --- a/certificates/joint-dual-validation.json +++ b/certificates/joint-dual-validation.json @@ -226,7 +226,7 @@ } }, "bit_saving": "2382370177/50000000000000", - "certificate_sha256": "2ed658f05365b28825e24a6e7bac9fc9cc015d5a5d63d9579f4ac6e0640ae559", + "certificate_sha256": "b8263db0d04aabb98a31965a40c198667709bd6a6c7f98df2990baf523bcd075", "kappa": "4764513337/100000000000000", "margins": 7, "producer_words_regenerated_and_matched": true, diff --git a/certificates/stopped-product-bit-axis.json b/certificates/stopped-product-bit-axis.json new file mode 100644 index 0000000000..5824891de9 --- /dev/null +++ b/certificates/stopped-product-bit-axis.json @@ -0,0 +1,38 @@ +{ + "h": 23, + "v": 1771, + "c": 34764, + "q": 5336, + "baseline_R": 40100, + "matching": 1324, + "R": 38776, + "loss": 506, + "histogram": [ + 9840, + 38409, + 32471, + 8898, + 9754, + 2116, + 5737, + 1725, + 4145, + 1547, + 3128, + 1551, + 2893, + 1925, + 2841, + 2450, + 2327, + 3096, + 2344, + 3628, + 9435, + 2110, + 23, + 23 + ], + "label_source": "positive", + "description": "Retained-total aligned triple producer, base-two recursion, original maximum carrier matching, and compatible positive labels." +} diff --git a/certificates/stopped-product-complex-input.json b/certificates/stopped-product-complex-input.json new file mode 100644 index 0000000000..7b1d99c518 --- /dev/null +++ b/certificates/stopped-product-complex-input.json @@ -0,0 +1,41 @@ +{ + "h": 24, + "v": 2024, + "c": 45764, + "q": 8120, + "baseline_R": 53884, + "matched": 8966, + "R": 44918, + "orientation_changes": 7338, + "rank_sum": 1079136, + "loss": 552, + "histogram": [ + 8930, + 49042, + 30844, + 15972, + 11883, + 8272, + 6399, + 4356, + 6682, + 2263, + 5109, + 1808, + 5317, + 1733, + 5391, + 1757, + 4908, + 3290, + 6233, + 4363, + 4056, + 264, + 564, + 24, + 24 + ], + "central_disjoint": 24, + "center_denominator": 21 +} diff --git a/certificates/stopped-product-input.json b/certificates/stopped-product-input.json new file mode 100644 index 0000000000..f0a910a495 --- /dev/null +++ b/certificates/stopped-product-input.json @@ -0,0 +1,253 @@ +{ + "bit": { + "dimensions": [ + 23, + 23 + ], + "m": 529, + "N": 3136441, + "W": 143617474, + "L": 1792252, + "total_rank": 75972299557, + "deficit": 1344189, + "maxchild": 506, + "child_multiplicities": { + "1": 139262585, + "2": 115012282, + "3": 31516716, + "4": 34548668, + "5": 7494872, + "6": 20320454, + "7": 6109950, + "8": 14681590, + "9": 5479474, + "10": 11079376, + "11": 5493642, + "12": 10247006, + "13": 6818350, + "14": 10062822, + "15": 8677900, + "16": 8242234, + "17": 10966032, + "18": 8302448, + "19": 12850376, + "20": 33418770, + "21": 7473620, + "22": 12627230, + "484": 6272882, + "506": 137344592 + } + }, + "complex": { + "dimensions": [ + 24, + 24 + ], + "m": 576, + "N": 4096576, + "B1": 90914032, + "B2": 90914032, + "W": 190021216, + "L": 2234496, + "total_rank": 109450358336, + "deficit": 1862080, + "child_multiplicities": { + "552": 181828064, + "529": 8193152, + "1": 202715744, + "2": 124856512, + "3": 64654656, + "4": 48102384, + "5": 33485056, + "6": 25903152, + "7": 17633088, + "8": 27048736, + "9": 9160624, + "10": 20681232, + "11": 7318784, + "12": 21523216, + "13": 7015184, + "14": 21822768, + "15": 7112336, + "16": 19867584, + "17": 13317920, + "18": 25231184, + "19": 17661424, + "20": 16418688, + "21": 1068672, + "22": 2283072, + "23": 16483456 + }, + "maxchild": 552, + "copied_histogram": [ + 8930, + 49066, + 30844, + 15972, + 11883, + 8272, + 6399, + 4356, + 6682, + 2263, + 5109, + 1808, + 5317, + 1733, + 5391, + 1757, + 4908, + 3290, + 6233, + 4363, + 4056, + 264, + 564, + 24, + 0 + ] + }, + "bit_moment_gap": "5833629405069796335513229037/13595148940731587639987765177686687744", + "complex_moment_gap": "5499421901694541095908997425024101371546537414283732387206104389099738183215366564793192567257041780652609318673168302647523216560182242981533611801155442603608986943408777543208667066118724847925169249370145237707441178592436788856344246441565482324551821454604550454953780270300756671351666361036963486701477553679079126088067165335949185500960812006586245961913848693714754073033035419679174118868763905107326417918471742975833959733450001524553321932789312500612407132407690299/41230077325513267360846956938521502341474073689326505257121676970478810391277326276471865083362032190646188250982499628351612283105589897175543987487125650452330304348151388045812369968133964037865011250349179368669257862504666828211703334554008512518414563221340357395437053315115874615168412042904680012697363239611038021437069048505672439008745508864584512067644825937731293242352557278635159598633861792145775836588122497044363982384099548431927704944786606529202786560000000000000000000", + "finite_bridge": { + "bit_coarse": { + "m": 529, + "W": 143617474, + "maxchild": 506, + "halving_degree": 16, + "wire_bits": 28 + }, + "ordinary_leaf_row_degree": 252, + "complex": { + "m": 576, + "W": 190021216, + "s": 109450358336, + "maxchild": 552, + "halving_degree": 17, + "wire_bits": 28, + "scalar_terms": [ + { + "h": 24, + "v": 2024, + "c": 45764, + "invocations": 2024, + "local_group_upper": 408200, + "copied_center_extra_groups": 48 + }, + { + "h": 24, + "v": 2024, + "c": 45764, + "invocations": 2024, + "local_group_upper": 408200, + "copied_center_extra_groups": 48 + } + ], + "scalar_group_upper": 1656684480 + }, + "semantic": { + "E": 403063477262941121443761178688, + "literal_charge": 119639333593035096270287748, + "strict_literal_gap": 402943837929348086347490890940, + "B": 403063477262941121553211537024, + "C0": 2994465792675104952757349965746759652008778122322142627817848832, + "C1": 1, + "induction_gap": 18943983431358232713000942240128, + "fixed_odd_divisor": 21, + "exact_grid": "One common dyadic grid times the fixed odd divisor to K=G*(D_complex+1); no child rounding" + }, + "rows": { + "coefficient": 1176, + "degree": 4000, + "suffix_slope": 16000, + "degree_gap": "40024/25", + "contract": "W_complex^D_complex * W_coarse^D_coarse * W_old^D_old; one preceding prefix and one padding; sequential reuse" + } + }, + "assembly": { + "parameters": { + "actual_bit_saving": "803380799/10000000000000", + "a_bit": "1948995551/25000000000000", + "a_complex": "1949/25000000", + "tau": "24998051004449/25000000000000", + "sigma": "24998051/25000000", + "eta": "1/100000000", + "beta": "1/1000000", + "q": "97449775601004449/1250000000000000000000", + "c": "9744977657550220501004449/125000000000000000000000000000", + "epsilon": "124999998750000000000000000000/125019489955217650665401004449", + "lambda_": "2499805100446848995551/2500000000000000000000", + "lambda_prime": "1249902550224398995551/1250000000000000000000", + "alpha_squared_power": "14618091340150667350000000/125019489955217650665401004449", + "delta": "1/800000000", + "C0": 2994465792675104952757349965746759652008778122322142627817848832, + "C1": 1, + "kappa": "194869/2500000000" + }, + "strict_constraints": { + "bit_positive": "1948995551/25000000000000", + "complex_above_bit": "4449/25000000000000", + "complex_below_one_over32": "779301/25000000", + "beta_positive": "1/1000000", + "beta_below_one": "999999/1000000", + "leaf_saving_above_bit": "1/10000000000", + "q_positive": "97449775601004449/1250000000000000000000", + "q_below_internal": "1948995551/1250000000000000000000", + "q_below_leaf": "126948995551/1250000000000000000000", + "c_positive": "9744977657550220501004449/125000000000000000000000000000", + "c_below_one": "124990255022342449779498995551/125000000000000000000000000000", + "q_below_reservations": "97449775601004449/125000000000000000000000000000", + "lambda_above_tau": "1948995551/2500000000000000000000", + "lambda_above_sigma": "446848995551/2500000000000000000000", + "lambda_above_internal": "1948995551/2500000000000000000000", + "lambda_prime_above_lambda": "1948995551/2500000000000000000000", + "compact_leaf": "126948995551/1250000000000000000000", + "compact_reservations": "97449775601004449/125000000000000000000000000000", + "lambda_prime_below_one": "97449775601004449/1250000000000000000000", + "epsilon_positive": "124999998750000000000000000000/125019489955217650665401004449", + "epsilon_below_one": "19491205217650665401004449/125019489955217650665401004449", + "guard_width": "19491205217650665401004449/125019489955217650665401004449", + "K_geometry": "974622765755022147550220501004449/12501948995521765066540100444900000000", + "K_dominates_log": "974497756010044392550224398995551/12501948995521765066540100444900000000", + "record_suffix": "19491205217650665401004449/125019489955217650665401004449", + "phase_local": "15592839154630577103152893798995551/100015591964174120532320803559200000000", + "phase_boundary": "11694348052630578662349334598995551/100015591964174120532320803559200000000", + "gamma_sublinear": "4873113877499998051004449/125019489955217650665401004449", + "cell_above_band": "124995125636122500001948995551/250038979910435301330802008898", + "prime_interval_packing": "19491205217650665401004449/125019489955217650665401004449", + "alpha_positive": "14618091340150667350000000/125019489955217650665401004449", + "alpha_below_one": "125004871863877499998051004449/125019489955217650665401004449", + "alpha_below_one_fourth": "124961017589857047996001004449/500077959820870602661604017796", + "delta_positive": "1/800000000", + "delta_below_one_eighth": "99999999/800000000", + "short_record_fallback": "3124756306320288991609616461252697967793601/3125487248880441266635025111225000000000000", + "small_field_exposure": "9746227754999996102008898/125019489955217650665401004449", + "artificial_boundary": "700128635079475474301789581367398995551/100015591964174120532320803559200000000", + "literal_scalar_guard": "402943837929348086347490890940", + "row_product_gap": "40024/25", + "original_prefix_above_kappa": "786538948061330309871047284761/78137181222011031665875627780625000000", + "coordinate_movement_above_kappa": "305551/25000000000000", + "compact_phase_layer_above_kappa": "20668543364879972849164027819/312548724888044126663502511122500000000", + "bulk_exposure_above_kappa": "305551/25000000000000", + "Gaussian_arithmetic_above_kappa": "97459317411097999618605138287111327/2500389799104353013308020088980000000000", + "scalar_work_above_kappa": "194921594961097960638694118287111327/2500389799104353013308020088980000000000", + "dimension_above_kappa": "312475634452011916691632483971664027819/312548724888044126663502511122500000000" + }, + "margins": { + "original_prefix": "974622765755022147550220501004449/12501948995521765066540100444900000000", + "coordinate_movement": "1948995551/25000000000000", + "compact_phase_layer": "9744977462650669298995551/125019489955217650665401004449", + "bulk_exposure": "1948995551/25000000000000", + "Gaussian_arithmetic": "11694348052630578662349334598995551/100015591964174120532320803559200000000", + "scalar_work": "15592839154630577103152893798995551/100015591964174120532320803559200000000", + "dimension": "124999998750000000000000000000/125019489955217650665401004449" + }, + "minimum_margin": "9744977462650669298995551/125019489955217650665401004449", + "absorption_gap": "20668543364879972849164027819/312548724888044126663502511122500000000", + "recurrence": { + "internal": "24998051004449/25000000000000", + "leaf": "24998051001949/25000000000000", + "reservations": "124990255022342449779498995551/125000000000000000000000000000" + } + } +} diff --git a/certificates/stopped-product-network.json b/certificates/stopped-product-network.json new file mode 100644 index 0000000000..998a8a7ea2 --- /dev/null +++ b/certificates/stopped-product-network.json @@ -0,0 +1,482 @@ +{ + "assembly": { + "absorption_gap": "20668543364879972849164027819/312548724888044126663502511122500000000", + "margins": { + "Gaussian_arithmetic": "11694348052630578662349334598995551/100015591964174120532320803559200000000", + "bulk_exposure": "1948995551/25000000000000", + "compact_phase_layer": "9744977462650669298995551/125019489955217650665401004449", + "coordinate_movement": "1948995551/25000000000000", + "dimension": "124999998750000000000000000000/125019489955217650665401004449", + "original_prefix": "974622765755022147550220501004449/12501948995521765066540100444900000000", + "scalar_work": "15592839154630577103152893798995551/100015591964174120532320803559200000000" + }, + "minimum_margin": "9744977462650669298995551/125019489955217650665401004449", + "parameters": { + "C0": 2994465792675104952757349965746759652008778122322142627817848832, + "C1": 1, + "a_bit": "1948995551/25000000000000", + "a_complex": "1949/25000000", + "actual_bit_saving": "803380799/10000000000000", + "alpha_squared_power": "14618091340150667350000000/125019489955217650665401004449", + "beta": "1/1000000", + "c": "9744977657550220501004449/125000000000000000000000000000", + "delta": "1/800000000", + "epsilon": "124999998750000000000000000000/125019489955217650665401004449", + "eta": "1/100000000", + "kappa": "194869/2500000000", + "lambda_": "2499805100446848995551/2500000000000000000000", + "lambda_prime": "1249902550224398995551/1250000000000000000000", + "q": "97449775601004449/1250000000000000000000", + "sigma": "24998051/25000000", + "tau": "24998051004449/25000000000000" + }, + "recurrence": { + "internal": "24998051004449/25000000000000", + "leaf": "24998051001949/25000000000000", + "reservations": "124990255022342449779498995551/125000000000000000000000000000" + }, + "strict_constraints": { + "Gaussian_arithmetic_above_kappa": "97459317411097999618605138287111327/2500389799104353013308020088980000000000", + "K_dominates_log": "974497756010044392550224398995551/12501948995521765066540100444900000000", + "K_geometry": "974622765755022147550220501004449/12501948995521765066540100444900000000", + "alpha_below_one": "125004871863877499998051004449/125019489955217650665401004449", + "alpha_below_one_fourth": "124961017589857047996001004449/500077959820870602661604017796", + "alpha_positive": "14618091340150667350000000/125019489955217650665401004449", + "artificial_boundary": "700128635079475474301789581367398995551/100015591964174120532320803559200000000", + "beta_below_one": "999999/1000000", + "beta_positive": "1/1000000", + "bit_positive": "1948995551/25000000000000", + "bulk_exposure_above_kappa": "305551/25000000000000", + "c_below_one": "124990255022342449779498995551/125000000000000000000000000000", + "c_positive": "9744977657550220501004449/125000000000000000000000000000", + "cell_above_band": "124995125636122500001948995551/250038979910435301330802008898", + "compact_leaf": "126948995551/1250000000000000000000", + "compact_phase_layer_above_kappa": "20668543364879972849164027819/312548724888044126663502511122500000000", + "compact_reservations": "97449775601004449/125000000000000000000000000000", + "complex_above_bit": "4449/25000000000000", + "complex_below_one_over32": "779301/25000000", + "coordinate_movement_above_kappa": "305551/25000000000000", + "delta_below_one_eighth": "99999999/800000000", + "delta_positive": "1/800000000", + "dimension_above_kappa": "312475634452011916691632483971664027819/312548724888044126663502511122500000000", + "epsilon_below_one": "19491205217650665401004449/125019489955217650665401004449", + "epsilon_positive": "124999998750000000000000000000/125019489955217650665401004449", + "gamma_sublinear": "4873113877499998051004449/125019489955217650665401004449", + "guard_width": "19491205217650665401004449/125019489955217650665401004449", + "lambda_above_internal": "1948995551/2500000000000000000000", + "lambda_above_sigma": "446848995551/2500000000000000000000", + "lambda_above_tau": "1948995551/2500000000000000000000", + "lambda_prime_above_lambda": "1948995551/2500000000000000000000", + "lambda_prime_below_one": "97449775601004449/1250000000000000000000", + "leaf_saving_above_bit": "1/10000000000", + "literal_scalar_guard": "402943837929348086347490890940", + "original_prefix_above_kappa": "786538948061330309871047284761/78137181222011031665875627780625000000", + "phase_boundary": "11694348052630578662349334598995551/100015591964174120532320803559200000000", + "phase_local": "15592839154630577103152893798995551/100015591964174120532320803559200000000", + "prime_interval_packing": "19491205217650665401004449/125019489955217650665401004449", + "q_below_internal": "1948995551/1250000000000000000000", + "q_below_leaf": "126948995551/1250000000000000000000", + "q_below_reservations": "97449775601004449/125000000000000000000000000000", + "q_positive": "97449775601004449/1250000000000000000000", + "record_suffix": "19491205217650665401004449/125019489955217650665401004449", + "row_product_gap": "40024/25", + "scalar_work_above_kappa": "194921594961097960638694118287111327/2500389799104353013308020088980000000000", + "short_record_fallback": "3124756306320288991609616461252697967793601/3125487248880441266635025111225000000000000", + "small_field_exposure": "9746227754999996102008898/125019489955217650665401004449" + } + }, + "base_commit": "56b66d58297deca1d7dd130247d720e960f77a37", + "bit": { + "counts": { + "B1": 68672296, + "B2": 68672296, + "L": 1792252, + "N": 3136441, + "W": 143617474, + "child_multiplicities": { + "1": 139262585, + "10": 11079376, + "11": 5493642, + "12": 10247006, + "13": 6818350, + "14": 10062822, + "15": 8677900, + "16": 8242234, + "17": 10966032, + "18": 8302448, + "19": 12850376, + "2": 115012282, + "20": 33418770, + "21": 7473620, + "22": 12627230, + "3": 31516716, + "4": 34548668, + "484": 6272882, + "5": 7494872, + "506": 137344592, + "6": 20320454, + "7": 6109950, + "8": 14681590, + "9": 5479474 + }, + "copied_histogram": [ + 9840, + 38432, + 32471, + 8898, + 9754, + 2116, + 5737, + 1725, + 4145, + 1547, + 3128, + 1551, + 2893, + 1925, + 2841, + 2450, + 2327, + 3096, + 2344, + 3628, + 9435, + 2110, + 23, + 0 + ], + "deficit": 1344189, + "dimensions": [ + 23, + 23 + ], + "m": 529, + "maxchild": 506, + "total_rank": 75972299557 + }, + "exponent": "49995981/50000000", + "logarithm_upper_bounds": { + "1": "1987355562417364065669439618237/316912650057057350374175801344", + "10": "2515274437229490418617839725263/633825300114114700748351602688", + "11": "4909728867822167960512763283247/1267650600228229401496703205376", + "12": "2399714421777289519579293961239/633825300114114700748351602688", + "13": "4697962657128327885574713503543/1267650600228229401496703205376", + "14": "1151004910436491358992364195459/316912650057057350374175801344", + "15": "2258280393397031167285649759463/633825300114114700748351602688", + "16": "2217374245868088984102352158015/633825300114114700748351602688", + "17": "4357897653501964928993364503311/1267650600228229401496703205376", + "18": "4285440755889660536494207989699/1267650600228229401496703205376", + "19": "1054225602598430741931079593279/316912650057057350374175801344", + "2": "3535376905093068344529747466859/633825300114114700748351602688", + "20": "4151880434975661263617415911297/1267650600228229401496703205376", + "21": "4090031554081046933305076849055/1267650600228229401496703205376", + "22": "4031060428338848386894499744017/1267650600228229401496703205376", + "3": "6556765722521218186395115000937/1267650600228229401496703205376", + "4": "6192085370702817115441231394489/1267650600228229401496703205376", + "484": "28174651752060127777810254067/316912650057057350374175801344", + "5": "1477304328485575102713485747439/316912650057057350374175801344", + "506": "28174651752060127777810254067/633825300114114700748351602688", + "6": "1419524320759474653194212865427/316912650057057350374175801344", + "7": "2741344040614642504793860160533/633825300114114700748351602688", + "8": "5313416931219497541822967855259/1267650600228229401496703205376", + "9": "161378412355405628441014735279/39614081257132168796771975168" + }, + "moment_upper": "13595148934897958234917968842173458707/13595148940731587639987765177686687744", + "rank_moment": "1865129/1865162", + "rounding_denominator": 1267650600228229401496703205376, + "saving": "4019/50000000", + "stopped_adapter": { + "atom_exponent": "1/1000", + "base_ordinary_saving": "384599/10000000000", + "coarse_toll_exponent": "999/1000", + "coarse_toll_subordinate_gap": "45981/50000000", + "effective_saving": "803380799/10000000000000" + }, + "strict_gap": "5833629405069796335513229037/13595148940731587639987765177686687744" + }, + "complex": { + "child_width_multiplicities": [ + [ + 1, + 202715744 + ], + [ + 2, + 124856512 + ], + [ + 3, + 64654656 + ], + [ + 4, + 48102384 + ], + [ + 5, + 33485056 + ], + [ + 6, + 25903152 + ], + [ + 7, + 17633088 + ], + [ + 8, + 27048736 + ], + [ + 9, + 9160624 + ], + [ + 10, + 20681232 + ], + [ + 11, + 7318784 + ], + [ + 12, + 21523216 + ], + [ + 13, + 7015184 + ], + [ + 14, + 21822768 + ], + [ + 15, + 7112336 + ], + [ + 16, + 19867584 + ], + [ + 17, + 13317920 + ], + [ + 18, + 25231184 + ], + [ + 19, + 17661424 + ], + [ + 20, + 16418688 + ], + [ + 21, + 1068672 + ], + [ + 22, + 2283072 + ], + [ + 23, + 16483456 + ], + [ + 529, + 8193152 + ], + [ + 552, + 181828064 + ] + ], + "counts": { + "B1": 90914032, + "B2": 90914032, + "L": 2234496, + "N": 4096576, + "W": 190021216, + "child_multiplicities": { + "1": 202715744, + "10": 20681232, + "11": 7318784, + "12": 21523216, + "13": 7015184, + "14": 21822768, + "15": 7112336, + "16": 19867584, + "17": 13317920, + "18": 25231184, + "19": 17661424, + "2": 124856512, + "20": 16418688, + "21": 1068672, + "22": 2283072, + "23": 16483456, + "3": 64654656, + "4": 48102384, + "5": 33485056, + "529": 8193152, + "552": 181828064, + "6": 25903152, + "7": 17633088, + "8": 27048736, + "9": 9160624 + }, + "copied_histogram": [ + 8930, + 49066, + 30844, + 15972, + 11883, + 8272, + 6399, + 4356, + 6682, + 2263, + 5109, + 1808, + 5317, + 1733, + 5391, + 1757, + 4908, + 3290, + 6233, + 4363, + 4056, + 264, + 564, + 24, + 0 + ], + "deficit": 1862080, + "dimensions": [ + 24, + 24 + ], + "m": 576, + "maxchild": 552, + "total_rank": 109450358336 + }, + "enclosure": "1+u+u^2/(2(1-u/3))", + "exponent": "24998051/25000000", + "logarithm_upper_bounds": { + "1": "794513457587/125000000000", + "10": "2026761283851/500000000000", + "11": "1979106193949/500000000000", + "12": "967800252727/250000000000", + "13": "758231660647/200000000000", + "14": "3717050331081/1000000000000", + "15": "1824028729797/500000000000", + "16": "3583518938457/1000000000000", + "17": "22018089479/6250000000", + "18": "8664339757/2500000000", + "19": "341166868153/100000000000", + "2": "707870060017/125000000000", + "20": "1680187693571/500000000000", + "21": "3311585222973/1000000000000", + "22": "1632532603669/500000000000", + "23": "3220613444767/1000000000000", + "3": "1314373843007/250000000000", + "4": "4969813299577/1000000000000", + "5": "2373334874131/500000000000", + "529": "42559614419/500000000000", + "552": "42559614419/1000000000000", + "6": "1141087047867/250000000000", + "7": "4410197511641/1000000000000", + "8": "4276666119017/1000000000000", + "9": "25993019271/6250000000" + }, + "moment_upper": "41230077320013845459152415842612504916449972317779967842837944583272706002177588093256498518568839623389146470329890309678443980458066680615361744505592038651174861744542401102403592424925296971746286402424010119299112624797225649619266545697664266076849080896788535940832502860162094344867655371553013651660399752909560467757989922417605273672796323363623700061058579975817444548637803205602124178954687673277011931480796079125892239408265588698477703420233284596413474059387592867592309701/41230077325513267360846956938521502341474073689326505257121676970478810391277326276471865083362032190646188250982499628351612283105589897175543987487125650452330304348151388045812369968133964037865011250349179368669257862504666828211703334554008512518414563221340357395437053315115874615168412042904680012697363239611038021437069048505672439008745508864584512067644825937731293242352557278635159598633861792145775836588122497044363982384099548431927704944786606529202786560000000000000000000", + "saving": "1949/25000000", + "strict_gap": "5499421901694541095908997425024101371546537414283732387206104389099738183215366564793192567257041780652609318673168302647523216560182242981533611801155442603608986943408777543208667066118724847925169249370145237707441178592436788856344246441565482324551821454604550454953780270300756671351666361036963486701477553679079126088067165335949185500960812006586245961913848693714754073033035419679174118868763905107326417918471742975833959733450001524553321932789312500612407132407690299/41230077325513267360846956938521502341474073689326505257121676970478810391277326276471865083362032190646188250982499628351612283105589897175543987487125650452330304348151388045812369968133964037865011250349179368669257862504666828211703334554008512518414563221340357395437053315115874615168412042904680012697363239611038021437069048505672439008745508864584512067644825937731293242352557278635159598633861792145775836588122497044363982384099548431927704944786606529202786560000000000000000000" + }, + "finite_bridge": { + "bit_coarse": { + "W": 143617474, + "halving_degree": 16, + "m": 529, + "maxchild": 506, + "wire_bits": 28 + }, + "complex": { + "W": 190021216, + "halving_degree": 17, + "m": 576, + "maxchild": 552, + "s": 109450358336, + "scalar_group_upper": 1656684480, + "scalar_terms": [ + { + "c": 45764, + "copied_center_extra_groups": 48, + "h": 24, + "invocations": 2024, + "local_group_upper": 408200, + "v": 2024 + }, + { + "c": 45764, + "copied_center_extra_groups": 48, + "h": 24, + "invocations": 2024, + "local_group_upper": 408200, + "v": 2024 + } + ], + "wire_bits": 28 + }, + "ordinary_leaf_row_degree": 252, + "rows": { + "coefficient": 1176, + "contract": "W_complex^D_complex * W_coarse^D_coarse * W_old^D_old; one preceding prefix and one padding; sequential reuse", + "degree": 4000, + "degree_gap": "40024/25", + "suffix_slope": 16000 + }, + "semantic": { + "B": 403063477262941121553211537024, + "C0": 2994465792675104952757349965746759652008778122322142627817848832, + "C1": 1, + "E": 403063477262941121443761178688, + "exact_grid": "One common dyadic grid times the fixed odd divisor to K=G*(D_complex+1); no child rounding", + "fixed_odd_divisor": 21, + "induction_gap": 18943983431358232713000942240128, + "literal_charge": 119639333593035096270287748, + "strict_literal_gap": 402943837929348086347490890940 + } + }, + "kappa": "194869/2500000000", + "proof_predecessor_commit": "11817ccacb564bb7f98789c20dc11d3fece207e3", + "scope": "Exact finite moments, stopped savings and assembly; the new complex producer is checked separately. Opposite-bank factorization, atom streaming, ordinary conversion, common exact grid and retained analytic/tape interfaces are written proof dependencies.", + "source_sha256": { + "certificates/copied-centers-bit-axes.json": "ed307cef595091b11ba8f8e6ff11302ad8db190227a2fbf34c232fd680206254", + "certificates/copied-centers-network.json": "7dbd675e42e22ac076280360f8750031851564bb7a56079e66236fee5d0a6cdf", + "certificates/stopped-product-bit-axis.json": "52f493a0019b7e4ce69a4c26bd3d35af5d3397461126abc4be44d1430ae8930d", + "certificates/stopped-product-complex-input.json": "5bcf00402bbfb768bd2fc0935f32ad329ee0780a3dfe5827bb010831d7909c4d", + "certificates/stopped-product-input.json": "8185c7bf8c307728f32484c5972af9a1b948ac5d0838e02f85c86cb438060417", + "notes/stopped-product-assembly.tex": "1c3c7147851f30f1ff97679cfcda157b1cbe2655b8766e34f1345f20c630eaec", + "notes/stopped-product-complex.tex": "4738089103a4b263b3b0ef458f5ef35519c696f1ea871ae79e508d3720f5870a", + "notes/stopped-product-factorization.tex": "70d5a4405e1be9c7b6cfb326bb4ffdf88e5585d1fb3d16c7bb5ad62ac421fae3", + "notes/stopped-product-interface.tex": "454a8f3924afc26e575b2a8cec6d0860397cb7f2dc431f3ba63fb8a7142cc96b", + "notes/stopped-product-note.tex": "486d14c599f4c2551c019f3358898f72e6ecafeb04ad590726ea69ed987fe025", + "scripts/copied_centers/physical.py": "837345d1f8753eab0e70f105b1d1bb0db965b993da037b1825ddef3672609d7d", + "scripts/copied_centers_network.py": "409ebfbd8a41c4c4d089aa0949fcf5a949415dc26f57440ffd48b7bd8881e6a9", + "scripts/partial_swap_network.py": "acdd81b4dea2815f8838a0c3ea8ac4968f2bc13fd7c99173473d865779096782", + "scripts/stopped_product/README.md": "6c1805dda45b01ed0ef420c674ec2cd0048fb9d7a1b015ab6cd837067fe66176", + "scripts/stopped_product/__init__.py": "7b794c22bccc00bb6ae8ba4d3379f469570565bbcb1a86090699133b8cf1b7d3", + "scripts/stopped_product/complex.py": "407650d56dceb5cb09d74928658cebed1bb42f4d7e28ca9e3fd36eea075f1ad0", + "scripts/stopped_product_network.py": "a8baaa87dd7679db4f2dd1a18a720397ee6f443262ad04fa26cf51b39909b74c", + "scripts/stopped_product_producer.py": "2c5c71399136ebcfebb8e5277317d5f334eb8df5716ad287391d0996fcc1492c", + "scripts/structured_bulk_assembly.py": "e99467e14211fba699878ed036e1e2362eb8e395dc22f9ecdcecc7fbf2cc736d" + }, + "status": "Conditional stopped product-ring multiplication witness" +} diff --git a/docs/reproducibility.md b/docs/reproducibility.md index e48f4190cd..7b966039e0 100644 --- a/docs/reproducibility.md +++ b/docs/reproducibility.md @@ -1,5 +1,10 @@ # Reproducing the result +For the new stopped product-ring extension, run `make stopped-product-verify`. +Its [incremental reproduction guide](stopped-product.md) covers the h24 +rational-center producer, new moments, stopping parameters and assembly. +The community checkpoint and historical targets below retain their own scope. + The selected release is documented in the [joint-frame community review](research/community-round2-review.md) and [current status](research/current-status.md), with the [selected parameter certificate](../research/matrix-exponent-synthesis/candidate/arithmetic.json). diff --git a/docs/research/contribution-review.md b/docs/research/contribution-review.md index 25602c6a81..ea4f8f9003 100644 --- a/docs/research/contribution-review.md +++ b/docs/research/contribution-review.md @@ -120,3 +120,11 @@ See [CONTRIBUTORS.md](../../CONTRIBUTORS.md) for contributions and parallel work - [#40](https://github.com/CrocSwap/integer-mult-bounds/pull/40), rohanarun: Both fixed bases and copied reversed corners: conditional κ = 3.918734894e-5 > 2^-15. Pinned `43f59ff533598762cbc43a5e14af2bbbc76fabbd`; not imported in the #39 integration pass. + +## Later stacked candidate: terminal elimination on shrunk frames (9 October 2026) + +- **Submission:** [Draft PR #140](https://github.com/CrocSwap/integer-mult-bounds/pull/140), based on upstream `main` with head `sennemmi:research/terminal-elision-shrunk-frames`. +- **Candidate snapshot:** `9cdf73e8682fb12749482e710e50bc585d282a7c`. +- **Pinned sources:** Joel Pulikkan's PR #125 head `dda535bdcfc321a13a1ebd3c2d70e2b5bb72368e`; SovereignSteak's PR #122 head `b1a6f24e57141637b3ff040d6f2ce9d896ffb9bb`. +- **Submitted result:** conditional κ = `110875518403/10^15`, about 0.257% above the fixed #125 parent. The live upstream Draft PR #139 has a higher finite candidate on the separate triple-core lockstep route; this candidate makes no global-frontier claim. +- **Review status:** draft awaiting independent mathematical review. Its finite verifier and controls pass; inherited transfer, analytic, fixed-tape and all-size assembly interfaces remain open proof obligations. diff --git a/docs/stopped-product.md b/docs/stopped-product.md new file mode 100644 index 0000000000..a53cfa9638 --- /dev/null +++ b/docs/stopped-product.md @@ -0,0 +1,46 @@ +# Stopped product-ring reproduction + +The extension gives the conditional saving `194869/2500000000 = 7.79476e-5`. +It starts from merged PR #36 and is submitted on upstream main at +`56b66d58297deca1d7dd130247d720e960f77a37`. + +From the repository root, with Python 3.11+, Make and a C++17 compiler: + +```sh +make stopped-product-verify +``` + +The incremental checks: + +- Match the unchanged positive-label h23 bit producer to its verified + copied-center input, preserving the same matching and histogram. +- Rebuild only the new h24 all-disjoint complex producer with aligned pair + stars, exact rational center decoding, support and binary-frame checks, + then reproduce every matching count and histogram entry. +- Reconstruct both child lists and strict rational moments; derive the + stopped ordinary-bit saving and check that the atom-adapter toll is lower. +- Check the denominator-21 semantic charge, product row stock `p^4000`, + seven assembly margins and all 47 strict constraints. + +Intermediate DAGs and the matcher executable are temporary. To retain them: + +```sh +python3 scripts/stopped_product_producer.py --work-dir /tmp/stopped-product-producers +``` + +For arithmetic alone, use `make stopped-product-certificate`. The inherited +`make verify-producers` also includes this target; the full `make verify` +retains the community and historical checks. Those unchanged suites are +not part of this round's local incremental validation. + +The [proof](../notes/stopped-product-note.tex) is supplied as LaTeX source; +no PDF is generated. Its common-basis factorization, atom streaming and +stopping argument, outer ordinary conversion and shared exact rational +grid are written proofs. Finite checks verify the selected scalar data and +arithmetic, not the complete all-size theorem. + +[SOURCES.json](../SOURCES.json) and [NOTICE](../NOTICE) preserve contribution +credits and source pins. Existing two-stage, ordinary-leaf and semantic +proof dependencies remain in `references/copied-centers/` and +`references/semantic-bulk/`. Research alternatives, raw binary DAGs and +recursive predecessor copies are excluded from this submission. diff --git a/notes/stopped-product-assembly.tex b/notes/stopped-product-assembly.tex new file mode 100644 index 0000000000..3932d3ade5 --- /dev/null +++ b/notes/stopped-product-assembly.tex @@ -0,0 +1,108 @@ +\subsection{Simultaneous row reserves} +Use a conservative global width bound $e$ for every adapter and child. +For each recursive family $j$, the least integer $t_j$ with +$m_j^{t_j}>2r_j^{t_j}$ gives depth at most +$t_j\lceil\log_2\max(2,e)\rceil$ plus a fixed constant. +The new coarse bit family has $(t_j,\operatorname{bitlength}W_j)=(16,28)$, +the ordinary leaf family $(9,28)$, and the complex family $(17,28)$. +The required reserve is the product of all three stocks: +\[ + Q=W_c^{D_c}W_b^{D_b}W_{\rm old}^{D_{\rm old}}. +\] +After the complex and coarse divisions, the old stock remains available +to every peeled-atom or stopped-leaf call. Sequential copies and outer +ordinary wrappers reuse restored rows; they introduce no independent +row factor. The combined coefficient is +\[ + 16\cdot28+9\cdot28+17\cdot28=1176, + \qquad4000-\frac{51}{25}\,1176=\frac{40024}{25}>0. +\] +Thus the retained logarithmic comparison, for eventual $e\le Cp$, +supplies a sufficient $p^{4000}$ stock including the fixed constants. +Use one physically preceding transformed prefix and one complete-row +padding, as in \path{notes/structured-bulk-assembly.tex}. Complete +spectators and parked fields are preserved by every descendant. +The suffix condition +$b_{\rm in}^{1-\epsilon}>16000(\log_2b_{\rm in}+8)$ is eventual +for every fixed $\epsilon<1$. + +\subsection{Analytic transfer and selected parameters} +The retained analytic proof map in +\path{notes/structured-bulk-assembly.tex} supplies the active-masked +arbitrary-source router with paid repair scans, the rounded phase-cell +inverse, persistent bulk halos with original period cuts, sequential +overlap tapes and factor pages, prime packing and exact recovery. +The new ordinary bit primitive has precisely the arbitrary-width, +complete-spectator and restored-row contract consumed by that router. +The new complex primitive supplies the exact completed tensor contract +on one common grid. Its outer grid conversions add only logarithmic +work. The changed finite implementations therefore meet the same +analytic interfaces, including the full bulk bound +\[ + O\!\left(Tp\left[p^\tau\operatorname{polylog}p+ + d\operatorname{polylog}p+dp^\delta+w_G^2p^\delta+ + dw_G^2p^\delta/L\right]\right)+n^{o(1)}, +\] +where $L=2^{\lceil8\log_2p\rceil}$, Gaussian band width +$w_G^2=O(p^{1-r})$, and normalization retains $\epsilon+r<1$. +Here $w_G$ is unrelated to the address atom width. + +Use the proved ordinary bit saving $a_b=803380799/10^{13}$ and complex +saving $b=1949/25000000$. To instantiate the retained assembly, weaken +the bit parameter explicitly to +\[ + \beta=10^{-6},\qquad + a=(1-\beta)b-10^{-10}=\frac{1948995551}{25000000000000}6.6129027953\times10^{-11}>0. +\] +The strict gaps absorb fixed logarithms, including the common-grid +conversions. The stopped atom recurrence supplies the ordinary +interchange interface, the rational-center construction supplies the +exact complex interface, and the product stock supports all nested +recursions. The unchanged analytic transfer then proves the stated +bound, with its constructive setup, descriptor and catalogue domination, +prime-existence and exact-recovery thresholds retained as eventual +conditions. +\end{proof} diff --git a/notes/stopped-product-complex.tex b/notes/stopped-product-complex.tex new file mode 100644 index 0000000000..4a9037137c --- /dev/null +++ b/notes/stopped-product-complex.tex @@ -0,0 +1,137 @@ +\subsection{All-disjoint retained centers} +Use two factors $h=24$. For triple inputs write $G=\sum_TX_T$, +$T_i=\sum_{T\ni i}X_T$, and retain all $A_i=G-T_i$. +Each input triple avoids exactly 21 points, so +\[ + \sum_{i=1}^{24}A_i=21G,\qquad G=\frac1{21}\sum_i A_i. +\] +For a target triple $S$ the central correction is +\[ + G-\frac12\sum_{i\in S}A_i + =\frac{\sum_{i\in S}T_i-G}{2}. +\] +An input triple meeting $S$ in $j$ points has central coefficient +$(j-1)/2$. Adding half the disjoint sum and subtracting half the +intersection-two sum leaves coefficient one exactly when $j=3$. +The scalar source-to-scatter transfer is therefore the identity. +The transparent old-value subtraction and new-value addition use this +identity only on fresh contributions and restore arbitrary old values. + +The base-two paired exclusion and aligned pair-star producer retains +nested binary labels: common-pair supports have their orthonormal triple +span, other ordinary sums have their coordinate cover. Each retained +$A_i$ has the nondegenerate coordinate hyperplane excluding $i$, +of dimension 23. Hence all copied-center arguments and general +nondegenerate binary residuals of the preceding proof apply. The +selected local counts are +\[ + v=2024,\quad c_h=45764,\quad q_h=8120,\quad + |\mathcal M|=8966,\quad R=44918,\quad\ell=552. +\] +The old internal histogram, starting at rank zero, is +\begin{small}\begin{align*} +[&8930,49042,30844,15972,11883,8272,6399,4356,6682,2263,\\ + &5109,1808,5317,1733,5391,1757,4908,3290,6233,4363,\\ + &4056,264,564,24,24]. +\end{align*}\end{small} +It has rank mass $24R+2\ell$. Replace 24 rank-24 original transitions +by 24 rank-one transitions; all rank-23 copied transforms remain. +The new mass is $24R+\ell$. + +\subsection{Physical endpoints and strict complex moment} +The copied-center two-stage complex contract in +\path{notes/copied-centers-complex.tex} is unchanged by the scalar +center decoding. For the tensor triple line $U$, let +$T=C_U$, $F=C_I$, $E=C_{U^\perp}=FT^{-1}$. +The two data outputs are $A=-Fy$ and $B=FT^{-2}x+Ey$. +Add $T^{-1}$ applied to a copy of $A$ into $B$, paying one rank-one +child per data pair. The inherited input/output $Z$ phases and +$i^{9f}$ scalar normalize $FT^{-2}$ to $F$; sign and bank corrections +complete the exact tensor $C$. Auxiliary source/sink operators remain +$C_{D_0}$ and $FC_{D_0}$ in the second stage. Every original role +therefore returns the exact selected-axis tensor operation on arbitrary +inputs. This algebraic statement holds over $\mathbb Q(i)$ as well as +over Gaussian dyadics. + +With $m_c=576$, $N_c=v^2=4096576$, $B_c=vR=90914032$, put +\[ + W_c=2N_c+2B_c=190021216,\quad L_c=2v\ell=2234496, +\] +\[ + s_c=W_cm_c-N_c+L_c=109450358336,\qquad N_c-L_c=1862080. +\] +The complete list is $2B_c$ width-552 auxiliary exteriors, +$2N_c$ width-529 data macros, $2vH'_r$ width-$r$ internal children, +$4N_c$ width-23 data fronts, and $N_c$ width-one endpoint copies. +These disjoint classes include both kinds of paid copies and sum to +$s_c$. All binary residuals, including alternating forms, use the retained +one-child Gauss normal form with paid bit adapters and unit phases. +At $a_c=1949/25000000$ the exact rational enclosure gives +\[ + \sum_r\frac{n_r}{W_c}(r/m_c)^{1-a_c} + <1-1.3338373969\times10^{-10}. +\] + +\subsection{One exact odd-denominator grid} +The only new odd divisor is 21. Let $d$ bound the root axis count, +$D$ bound its maximum complex recursion depth, and $G_0$ bound the +number of grouped scalar operations per node. Choose +\[ + K=G_0(D+1),\qquad \text{common grid }2^{-P}21^{-K}. +\] +Root inputs and arbitrary dirty auxiliaries start Gaussian dyadic. +Multiply their integer numerators by $21^K$ once at the outer boundary. +Every local coefficient contains at most one factor 21 in its denominator, +so a local finite program adds at most $G_0$ to the odd-denominator +exponent. A completed $u$-axis child has Gaussian-dyadic coefficients +and therefore preserves its input's existing odd-denominator exponent; +it adds no new odd factor. Only the active chain of unfinished calls +can accumulate new factors. Its length is at most $D+1$, proving that +all intermediates lie on the common grid and every local division by +21 is an exact integer division of its encoded numerator. + +This divisibility claim uses the root dyadic-input invariant, not an +assumption about arbitrary numerators on the finest grid. Internal values +may have odd denominators. They are neither rounded nor re-encoded when +a child returns. At the completed outer return the operator is the exact +Gaussian-dyadic tensor on root dyadic inputs, so the final numerators +are divisible by $21^K$; exact unscaling restores dyadic encoding. + +Since the largest child is $552<576$, $D=O(\log d)$ and +$K=O(\log d)$ with fixed constants. Constant-divisor long division +is linear in numerator length. Initial and final scaling by $K$ +successive constant multiplications/divisions cost $O(V\log d)$ and +occur only at the outer boundary. The extra numerator length is +$O(\log d)$, preserving the retained $O(p)$ word bound. This overhead +is subordinate to the positive-power complex layer bound. + +For explicit semantic constants use +\[ + g_h=4(c_h+v)+10v+4hv+4h^2+8h+8=408200, +\] +\[ + G_0=N_c+2v(g_h+2h)=1656684480, +\] +where endpoint additions and copied-center scalar work are included. +The complete child contributes at most $u$ binary denominator bits +and row-norm factor $2^u$, with no additional odd exponent. A local +21-division contributes fewer than five denominator-height bits, +covered by the fixed scalar charge. Set +\[ +\begin{aligned} + E_0&=64(W_c+m_c+G_0+1)^3=403063477262941121443761178688,\\ + \mathcal E&=2G_0W_c^2+8s_c+4W_c+4+32m_c\\ + &=1196393335930350962702877484.2909639537\times10^{-10}. +\] +It uses the retained 24-term positive atanh-series logarithm enclosure, +its geometric tail, range reduction and upward rational exponential +bound. Also $\mu_1=s_b/(W_bm_b)<1$. These are the two gaps used below. diff --git a/notes/stopped-product-interface.tex b/notes/stopped-product-interface.tex new file mode 100644 index 0000000000..20c44ce486 --- /dev/null +++ b/notes/stopped-product-interface.tex @@ -0,0 +1,95 @@ +\subsection{Paid atom adapters and remainders} +Expand each fixed lower-triangular formal factor into unit scalings and +additions from earlier to later formal fields. Execute intrabank targets +in descending formal-field order, so earlier controls still have their +required original values. Every atom update reads only physically earlier +controls. In a cross-bank shear the update is +\[ + D_{i,t}\leftarrow D_{i,t}+k_{ij}H_{j,f-1-t}. +\] +Even with the reversed source index, the source lies in the earlier head +bank. The retained ordered-affine streaming primitive applies to each +ordinary width-$w$ atom update, costing $O(V)$ per pass. +There are $O(f)$ passes per fixed matrix and thus $O(Vn)$ per finite +node. The reversed control is an indexed earlier atom, not a reversed +field operation. Atom loops use binary descriptors on a fixed tape set; +all inactive digits remain complete spectators. The inherited parking +schedule never scans through parked ancestors, and polynomial descriptor +work is absorbed by the complete stream volume. + +For $n=m_bf+\delta$, $0\le\deltaa_b$, the paid adapter term is strictly lower order. +All bounded widths use the old interface. Numerical padding of a binary +chunk range to the least suitable radix-$q$ range has volume factor +below $q^2$; it preserves numerical order and is removed after the +completed ordinary wrapper, whose endpoint is ordinary interchange. + +If external rows are unavailable, use the inherited ordinary high-digit +borrowing construction from \path{notes/batched-bit-rows.tex}. +Borrow $O(\log e)$ high digits, exchange and join them into a preceding +row field, pad that field once, act on the body, and separate the high +parts. It applies literally to the completed ordinary wrapper; no claim +about borrowed high positions is made for an unwrapped reversed call. +Single-digit moves cost $O(V\log e)$, and small widths use the old +algorithm. Atom indices and rational coefficients are finitely specified; +the algorithm uses the same fixed tape set and complete spectator ranges. diff --git a/notes/stopped-product-note.tex b/notes/stopped-product-note.tex new file mode 100644 index 0000000000..a8b23254c8 --- /dev/null +++ b/notes/stopped-product-note.tex @@ -0,0 +1,76 @@ +\documentclass[11pt]{article} +\usepackage[margin=1in]{geometry} +\usepackage[T1]{fontenc} +\usepackage{lmodern,amsmath,amssymb,amsthm,mathtools,booktabs,longtable,microtype} +\usepackage[hidelinks]{hyperref} +\setlength{\emergencystretch}{3em} +\allowdisplaybreaks +\newtheorem{theorem}{Theorem}[section] +\newtheorem{lemma}[theorem]{Lemma} +\newtheorem{proposition}[theorem]{Proposition} +\title{A conditional integer-multiplication saving of $194869/2500000000$\\ +\large Stopped product-ring interchange and rational retained centers} +\author{icekylinx\\\small With substantial OpenAI GPT-6 Astra and Codex assistance} +\date{9 October 2026} +\begin{document}\maketitle +\begin{abstract} +A common rational basis and opposite bank orders reduce each projector +residual to one contiguous reversed child over a fixed atom product ring. +Ordered atom adapters are paid explicitly; stopping at a growing atom +width and using the retained ordinary primitive supplies an ordinary +bit interface. An independent 24-dimensional complex producer uses +rational retained-center decoding on one exact common grid. The selected +interfaces and retained semantic/bulk assembly give the conditional bound +$T(n)=O(n(\log n)^{1-\kappa})$, where +$\kappa=194869/2500000000=0.0000779476$. +\end{abstract} + +\section{Scope and retained dependencies} +The model is the retained fixed finite-alphabet multitape Turing machine. +Finite graphs, rational bases, address primes, coefficient tables and tape +counts are fixed independently of input length. Bit payload arithmetic is +binary, while its address geometry is rational and then evaluated on atom +rings. Complex payloads use exact Gaussian rational arithmetic with the +specified common grid; their address labels remain binary. + +The proof predecessor is icekylinx's merged copied-center PR36, +\texttt{11817ccacb564bb7f98789c20dc11d3fece207e3}, whose proof is +\path{notes/copied-centers-note.tex}. Its ordinary interchange saving +$a_{\rm old}=384599/10^{10}$, copied-center schedule in both orientations, +two-stage data and auxiliary endpoint identities, general binary residual +normal form, and fixed-tape complete-row contracts are retained. +The present opposite-bank factorization, stopped product-ring interface, +rational-center specialization and exact composition are by icekylinx, +with substantial OpenAI GPT-6 Astra assistance and Codex integration. +Earlier own contributions include PR10 batching, PR18 partial swaps, +PR24 endpoint gauges and PR32 structured blocks and semantic composition. + +Aurel Prosz (Paureel) supplies the two-stage topology and paid endpoint +copy, with Swapnil Jain's linked development credited by Zhihao Chen's +PR29. The retained leaf proof also credits Rohan Arun's PR31 corner method +and Dominik Scholz's PR33 parameterization. Zhihao Chen's PR21/23 and the +RaD/hipotures PR20 source provide the phase endpoints, semantic guard, +arbitrary-source routing, phase-cell inverse and bulk locality/tape +interfaces. Their pinned proof map remains in +\path{notes/structured-bulk-assembly.tex}; adopted sources and notices are +in \path{references/semantic-bulk/} and \path{references/copied-centers/}. +The underlying Douglas Colkitt framework, OpenAI manuscript, eumemic, +Bortlesboat, dleen, earlier finite contributions and Harvey--van der Hoeven +analytic work retain their credits and recorded AI assistance in +\texttt{NOTICE} and \texttt{SOURCES.json}. + +The conclusion remains conditional on those analytic, ordered-affine, +exact-recovery and machine interfaces and their eventual setup and +prime-existence thresholds. The new algebraic and tape constructions +below establish the changed finite interfaces; exact arithmetic certifies +their selected counts and margins. + +\section{One reversed child for each projector} +\input{notes/stopped-product-factorization.tex} +\section{Stopped atom recursion and ordinary interchange} +\input{notes/stopped-product-interface.tex} +\section{Rational centers and exact semantic precision} +\input{notes/stopped-product-complex.tex} +\section{Product rows and exact assembly} +\input{notes/stopped-product-assembly.tex} +\end{document} diff --git a/research/cyclic-deferred/README.md b/research/cyclic-deferred/README.md new file mode 100644 index 0000000000..5fc864cb90 --- /dev/null +++ b/research/cyclic-deferred/README.md @@ -0,0 +1,66 @@ +# Saturated deferred frames on the PR117 complex producer + +Conditional **κ = 1.09281094468e-4 = 27320273617/250000000000000**. +Human-readable form: **κ ≈ 109281094468/10¹⁵ > 2⁻¹⁴**. + +This package reuses the immutable 91,770-addition complex DAG from PR117 +(eumemic, with Anthropic Claude assistance). It reconstructs its scalar +supports and frames, compiles 28,705 dirty roles, lifts their legal binary +frames, and selects 4,706 deferred readouts. When target-chain intersections +are degenerate, symmetric binary elimination retains a nondegenerate direct +complement to the radical. Target containment is rechecked after extraction. +The exact candidate priority is 2^dim(frame) / number_of_reached_targets², +with deterministic ties. The producer search itself is PR117's contribution. + +The complex saving is **109305097/10¹² = 1.09305097e-4**. Its physical word has +71,185 carrier links, W = 124,390,992, recursive rank 71,647,349,312 and maximum +child 574 of 576. Every copied center, exterior, source/target front, data +projector and endpoint correction remains paid. The graph and role count +agree with PR117; the changed frame and readout schedule gives the improvement. + +The bit supplier remains Swapnil Jain's pinned round-seven word under PR104's +stopped-product interface, with stopped saving 1240189553/10¹³. The complex +side still binds. Compared with PR117's κ = 1.044939e-4, the selected κ is +about 4.58131% larger. This is a finite conditional witness. + +Run `python3 research/cyclic-deferred/verify.py` from the repository root. +Verification regenerates in a temporary tree and preserves frozen inputs. +`certificate.py` checks the frozen exact certificate; `--write` is an explicit +authoring operation. The shipped DAG, both bit inputs, all local Python +sources and transitive arithmetic dependencies are SHA-256 pinned. + +The upstream producer replayer checks all source supports, rational center +scatter and inherited binary-frame rules. The compiler checks every role +chain, nondegeneracy and nested deferred target chain, and replays arbitrary +scratch and data over Z/(2^61-1). A separate audit checks the exact integer +source map and signed old-readout transpose, arbitrary dirty cancellation, +the literal inverse word after swapping banks, and complemented frame +incidences. It reconstructs the paid child histogram in both directions and +rejects wrong inverse signs, missing complements and flipped root readouts. + +The exact assembly includes both moments, the stopped ordinary-bit saving, +three product-row reserves, all 47 strict constraints and seven margins, and +next-grid rejection. An old-readout coefficient can reach 55/42. Each numerator over 42 is +therefore split into signed unit chunks and a remainder, preserving its exact +sum at the same frame. These bounded shears are explicitly counted in the +forward and inverse words. A conservative literal scalar guard covers them. Enlarging this guard changes precision constants and +eventual thresholds; it does not increase the exponent. + +All retained transfer hypotheses remain: simultaneous rational bases and +opposite-bank factorization for the listed residuals, stopped atom streaming, +ordinary wrapper, translated complex endpoint gauges, exact odd-denominator +grid, routing, recovery, prime selection, analytic estimates and fixed-tape +implementation. This is not an unconditional multiplication theorem or a +practical running-time claim. + +Credits: eumemic with Anthropic Claude assistance (PR117's producer and +stopped-product integration); icekylinx (PR104); Avi Eisenberg / ikeboy +(PR110's complex compiler, with Anthropic Claude assistance); Swapnil Jain +(round-seven words, lifted frames, V leaves and deferred readouts); Zhihao +Chen / jacklightChen (reflected bit integration, gauges and assembly); +Aurel Prosz / Paureel (two-stage topology); RaD / hipotures (analytic and tape +interfaces). Earlier PR114 research adopted Rohan Arun's PR111/PR113 and +icekylinx's PR115 with concurrent PR116 credited; those earlier producer +experiments remain in Git history. Original notices and AI disclosures remain. +The saturated frame construction, this integration and the independent +scalar/reflection audit were prepared for eumemic with OpenAI Codex assistance. diff --git a/research/cyclic-deferred/SOURCE.json b/research/cyclic-deferred/SOURCE.json new file mode 100644 index 0000000000..b4aa3aa55a --- /dev/null +++ b/research/cyclic-deferred/SOURCE.json @@ -0,0 +1,64 @@ +{ + "attribution": "Avi Eisenberg / ikeboy (PR62 and PR110, Anthropic Claude assistance); Rohan Arun (PR111, Anthropic Claude assistance); Swapnil Jain (round-seven bit word); icekylinx (retained stopped-product, copied-center and finite assembly interfaces); Zhihao Chen and RaD (retained assembly). PR117 scalar DAG is separate upstream work by eumemic with Anthropic Claude assistance, retained byte for byte with its original attribution. Saturated deferred-frame integration and verification for eumemic with OpenAI Codex assistance. Original source notices remain authoritative.", + "package_files": { + "bit-profile.json": "7293f330518b78650bd86d76b93681e43f3a55541cdb8110993714148a4b4a6a", + "bit_round7.py": "35d261a9248c2e06f9179e3c47e554a96b8fe763a9a3de2731256b8c0fbc74b0", + "certificate.json": "ebdcbae4570dcf9dbd3903642b41c7afd0ff1c988fcc9a8118bfb8309ff04e8e", + "certificate.py": "f47567697d78bc58afe776c369c99cf43bc36b8a06b6eefef5b9f64d1bf8aa98", + "complex-profile.json": "a54d2a6023ff73f7476057b5f6a4ff02e65ded840b7254d906aadde2dd01940d", + "complex_deferred.py": "f22a077d26819587b061f7dbd77a0b8fe329fe78ad54cc0c1e366ca5901c7298", + "inputs/complex-dag.json.gz": "3c034d0aae388ef567a454826f4f48b26fd8a94c71e8ffed4835271b349a783b", + "inputs/deferred_23.json.gz": "8c38e947ff9e021e308000dd82bb5e2194eb265d8b75194e22ce783d3e75317c", + "inputs/witness_23.json.gz": "b2486aa2bb222bacea6e52162a3920780e45dd8edc5d7cb03eabea336a1c6588", + "producer.py": "017e50713943e6c2a98d1c23ec93e7da9580896de1b6bde24563b4b6961c74c0", + "reflection-audit.json": "846b61230459592d7b6c2b96e2e60182435855e280e0df53ee64eb63cdb85c59", + "reflection_audit.py": "6761fb01f93ef89f2455388b2f5a71f19c0bbd870e6aaeba457ede0a949a163b", + "replayed_producer.py": "99c1e3694ae06a7ce7a370b04ecb45ea3fcfe69a6e6e7f4c4606e0a6c74c3184", + "test_controls.py": "1ccccbf39ca4812491c19739dc1435d03aad6f5120cffc88cc9a14d85afb79e9", + "verify.py": "3aa8d1da36ef6bf64c8fe57dbbc4b83eb970d30540446f7108803df0c0f9ac55" + }, + "provenance": { + "base": "https://github.com/CrocSwap/integer-mult-bounds/pull/110", + "cyclic_strips": "https://github.com/CrocSwap/integer-mult-bounds/pull/111", + "round7_commit": "741e7aa078392553815df7926ee17ac5e25a8c38", + "round7_repository": "https://github.com/Swapnil-jain/integer-mult-kappa", + "round7_sha256": { + "deferred_23.json.gz": "8c38e947ff9e021e308000dd82bb5e2194eb265d8b75194e22ce783d3e75317c", + "witness_23.json.gz": "b2486aa2bb222bacea6e52162a3920780e45dd8edc5d7cb03eabea336a1c6588" + }, + "scalar_dag": { + "commit": "cbb05ce504d571546d9b7794c186a613c659c3bf", + "file": "inputs/complex-dag.json.gz", + "pull_request": "https://github.com/CrocSwap/integer-mult-bounds/pull/117", + "sha256": "3c034d0aae388ef567a454826f4f48b26fd8a94c71e8ffed4835271b349a783b" + } + }, + "reflection": { + "receipt": "reflection-audit.json", + "script": "reflection_audit.py" + }, + "repository_files": { + "certificates/copied-centers-network.json": "7dbd675e42e22ac076280360f8750031851564bb7a56079e66236fee5d0a6cdf", + "scripts/audit_short_guards.py": "c2c929c956e617bee739963b517b9069e0d067cfebc6820f401a4e90a1769eb1", + "scripts/certify.py": "2348d95008276c5d5764f7e028c3918e484582cd589bd4d9b82919161745e53e", + "scripts/compact_control_layer.py": "e814c9f8d84f2e5d3aa2e06c36697f27f110218addc40ff8df2801fde861ff9f", + "scripts/complex_circuit.py": "d623617f7c5cb3189580883a8ab30c0bd3832688ae3f1f0c1f881bbbbff8e0c1", + "scripts/complex_network.py": "0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b", + "scripts/copied_centers/__init__.py": "13db4f09038a2ff5335cbd4dbd93274b0fb16b3c7b51e4de67cbb2801a3f78e1", + "scripts/copied_centers/corners.py": "9eecdc39c67cc18c806a33f0be03986c28591d322881fd60c11f52c625c8067b", + "scripts/copied_centers/physical.py": "837345d1f8753eab0e70f105b1d1bb0db965b993da037b1825ddef3672609d7d", + "scripts/copied_centers_network.py": "409ebfbd8a41c4c4d089aa0949fcf5a949415dc26f57440ffd48b7bd8881e6a9", + "scripts/exclusion_circuit.py": "b253f9d7318becda1c1f3b24e2287ed44a9c27fcea00cf9d531afb950d0457a0", + "scripts/fast_gaussian.py": "11430c2df0783b933dc91080595bb7514bb052b8c7b12107e27a1ef701e31e43", + "scripts/paired_exclusion_circuit.py": "8f05f04cf06217befd6d0ee0f2d7d0c5c5eb32cfab8c9a8ca7917fd6d620b7d2", + "scripts/paired_network.py": "991223dc3c1374284c361ed017e42bf732dd971fa0bea2be2282cfb18257b3f7", + "scripts/partial_swap_network.py": "acdd81b4dea2815f8838a0c3ea8ac4968f2bc13fd7c99173473d865779096782", + "scripts/prepare_layers.py": "a6e2adc612f264b1c0e51d18ce6315de9ae5e2ae2420aa22e99a22d8bf304947", + "scripts/search_network.py": "3a4faa5037d9b8e7ca5828afac193a96b6966a8b114f14937921795b24ec4f6a", + "scripts/shared_point_circuit.py": "c9bb7a5df92d260a4e3ad532b53e26936730d7c93f7facfb0784957c1e81c8ba", + "scripts/shared_point_network.py": "a85e7f0d8c42d6a27e3846308571ca324a1824ac5c2d59e4daa5c7673c33c697", + "scripts/structured_bulk_assembly.py": "e99467e14211fba699878ed036e1e2362eb8e395dc22f9ecdcecc7fbf2cc736d" + }, + "schema": 1, + "scope": "Frozen finite producer, profiles, exact assembly and reflection audit; inherited all-size transfer remains conditional." +} diff --git a/research/cyclic-deferred/bit-profile.json b/research/cyclic-deferred/bit-profile.json new file mode 100644 index 0000000000..36105e819a --- /dev/null +++ b/research/cyclic-deferred/bit-profile.json @@ -0,0 +1,69 @@ +{ + "h": 23, + "v": 1771, + "R": 28866, + "m": 529, + "N": 3136441, + "W": 108516254, + "L": 1792252, + "total_rank": 57403754177, + "deficit": 1344189, + "maxchild": 528, + "deferred_slots": 11565, + "source": { + "repository": "https://github.com/Swapnil-jain/integer-mult-kappa", + "commit": "741e7aa078392553815df7926ee17ac5e25a8c38", + "sha256": { + "witness_23.json.gz": "b2486aa2bb222bacea6e52162a3920780e45dd8edc5d7cb03eabea336a1c6588", + "deferred_23.json.gz": "8c38e947ff9e021e308000dd82bb5e2194eb265d8b75194e22ce783d3e75317c" + } + }, + "child_multiplicities": { + "1": 239511811, + "2": 238288050, + "3": 53377940, + "4": 46970462, + "5": 23632224, + "6": 7409864, + "7": 4105178, + "8": 5755750, + "9": 2082696, + "10": 878416, + "11": 1388464, + "12": 1080310, + "13": 945714, + "14": 226688, + "15": 2451064, + "16": 1508892, + "17": 4771074, + "18": 2149994, + "19": 7367360, + "20": 8182020, + "21": 1466388, + "22": 88550, + "484": 6272882, + "506": 61280142, + "507": 545468, + "508": 173558, + "509": 293986, + "510": 580888, + "511": 14168, + "512": 322322, + "513": 17710, + "514": 1129898, + "515": 127512, + "516": 410872, + "517": 99176, + "518": 1186570, + "519": 340032, + "520": 322322, + "521": 106260, + "522": 1583274, + "523": 626934, + "524": 2854852, + "525": 13711082, + "526": 4629394, + "527": 5653032, + "528": 6233920 + } +} diff --git a/research/cyclic-deferred/bit_round7.py b/research/cyclic-deferred/bit_round7.py new file mode 100644 index 0000000000..3c5df409a6 --- /dev/null +++ b/research/cyclic-deferred/bit_round7.py @@ -0,0 +1,129 @@ +#!/usr/bin/env python3 +"""One-child bit profile of Swapnil Jain's round-seven deferred word (h=23), under PR104's opposite-bank rule. + +Reads the two frozen round-seven data files (vendored in inputs/; pinned by SHA-256 below) from a directory given on +the command line, e.g. a checkout of https://github.com/Swapnil-jain/integer-mult-kappa at +741e7aa078392553815df7926ee17ac5e25a8c38 (certificates/round7/), or PR97's imported copy +(research/deferred-signed/swapnil-round7/certificates/round7/). The frame dimensions are the ones recorded in +the data file; Swapnil's check_frames.py re-derives each of them exactly and PR97 replays the word. + +Every projector residual of rank r is one child of width r (PR104, notes/stopped-product-factorization.tex): + each slot: its chain steps from the deferral frame sigma_u to F, and one exterior child m - (h - dim sigma_u); + each retained centre: one copied transform of width h-1; + each target y_T: its chain 0 -> deferred readout levels -> t_T^perp; each data wire X_S: its chain of V frames; + each data pair: one data residual of width (h-1)^2 and one endpoint copy. +Usage: python3 research/deferred-stopped/bit_round7.py DIR (writes bit-profile.json next to this file) +Prepared by Avi Eisenberg (ikeboy) with Anthropic Claude assistance. Apache-2.0. +""" +import gzip +import hashlib +import json +import sys +from collections import Counter, defaultdict +from itertools import combinations +from pathlib import Path + +HERE = Path(__file__).resolve().parent +PINS = {'witness_23.json.gz': 'b2486aa2bb222bacea6e52162a3920780e45dd8edc5d7cb03eabea336a1c6588', + 'deferred_23.json.gz': '8c38e947ff9e021e308000dd82bb5e2194eb265d8b75194e22ce783d3e75317c'} + + +def require(ok, msg): + if not ok: + raise SystemExit('FAIL: ' + msg) + + +def main(directory): + data = {} + for name, digest in PINS.items(): + raw = (Path(directory) / name).read_bytes() + require(hashlib.sha256(raw).hexdigest() == digest, 'pinned hash of ' + name) + data[name] = json.loads(gzip.decompress(raw)) + W, D = data['witness_23.json.gz'], data['deferred_23.json.gz'] + h = D['h']; R = D['R']; trip = list(combinations(range(h), 3)); v = len(trip); m = h * h; N = v * v + tid = {T: i for i, T in enumerate(trip)} + args = {int(n): (tuple(a) if a else None) for n, a in W['args'].items()} + late = {int(n): (list(e), list(l)) for n, (e, l) in W['late'].items()} + ops = [tuple(o[:2]) + (tuple(o[2]),) if o[0] == 'fan' else tuple(o) for o in D['ops']] + hold, start = D['hold'], D['start'] + out = {s: (c, tuple(T)) for s, c, T in D['out']}; ret = {s: c for s, c in D['ret']} + sigma = dict(zip(D['readout_order'], D['sigma'])); sel = set(D['readout_order']) + f = [0] * R + for s, B in sigma.items(): f[s] = len(B) + vstart = dict(zip(D['vleaf_slots'], D['vleaf_start'])) + node_dims = {n: d for n, d in D['node_dims']} + late_dims = {(n, tuple(lt)): d for n, lt, d in D['late_dims']} + pivslot = {o[3]: o[1] for o in ops if o[0] == 'add'} + + def start_key(s): + n0 = hold[s][0] + if args[n0] is None: return ('v', s) + st = start[s]; k = st[2] if len(st) > 2 else None; dec = late.get(n0) + if dec is None or k in dec[0]: return ('n', n0) + lt = dec[1]; return ('c', n0, tuple(lt[lt.index(k):])) + + def chain(s): + ch = [('sigma', s) if s in sel else ('0',), start_key(s)] + for idx, n in enumerate(hold[s]): + if idx > 0: ch.append(('n', n)) + if args[n] is not None and pivslot.get(n) == s and n in late: + lt = late[n][1] + for i in range(len(lt) - 1): ch.append(('c', n, tuple(lt[i:]))) + if s in out: ch.append(('out',)) + if s in ret: ch.append(('ret',)) + ch.append(('F',)); return ch + + def dim(key): + k = key[0] + if k == '0': return 0 + if k == 'F': return h + if k in ('out', 'ret'): return h - 1 + if k == 'n': return node_dims[key[1]] + if k == 'c': return late_dims[key[1], key[2]] + if k == 'sigma': return f[key[1]] + if k == 'v': return len(vstart[key[1]]) + raise KeyError(key) + + # garbage supports (transpose sweep) for the deferred levels on each target + cov = [set() for _ in range(R)] + for s, (c, T) in out.items(): cov[s].add(tid[T]) + for s, c in ret.items(): cov[s].update(t for t, T in enumerate(trip) if c in T) + for o in reversed(ops): + if o[0] == 'add': cov[o[2]] |= cov[o[1]] + elif o[0] == 'fan': + for g in o[2]: cov[o[1]] |= cov[g] + levels = defaultdict(set) + for s in sel: + for t in cov[s]: levels[t].add(f[s]) + + z = Counter() + for s in range(R): + ds = [dim(k) for k in chain(s)] + require(all(b >= a for a, b in zip(ds, ds[1:])) and ds[-1] == h, 'monotone chain %d' % s) + for a, b in zip(ds, ds[1:]): + if b > a: z[b - a] += 2 * v + z[m - (h - f[s])] += 2 * v + z[h - 1] += 2 * v * h + for t in range(v): + ls = sorted(levels[t] | {0, h - 1}) + for a, b in zip(ls, ls[1:]): z[b - a] += 2 * v + for n, us in D['xs_order']: + ds = [1] + [len(vstart[s]) for s in us] + [h] + ds = [d for i, d in enumerate(ds) if i == 0 or d != ds[i - 1]] + require(all(b > a for a, b in zip(ds, ds[1:])), 'data-wire chain') + for a, b in zip(ds, ds[1:]): z[b - a] += 2 * v + z[(h - 1) ** 2] += 2 * N + z[1] += N + Wb = 2 * N + 2 * v * R; L = 2 * v * h * (h - 1); s_ = Wb * m - N + L + require(sum(t * c for t, c in z.items()) == s_, 'bit rank mass') + require(all(0 < t < m for t in z), 'children below m') + prof = dict(h=h, v=v, R=R, m=m, N=N, W=Wb, L=L, total_rank=s_, deficit=N - L, maxchild=max(z), + deferred_slots=len(sel), source=dict(repository='https://github.com/Swapnil-jain/integer-mult-kappa', + commit='741e7aa078392553815df7926ee17ac5e25a8c38', sha256=PINS), + child_multiplicities=dict(sorted(z.items()))) + (HERE / 'bit-profile.json').write_text(json.dumps(prof, indent=1) + '\n') + print('PASS bit: R=%d, deferred slots %d, maxchild %d, rank mass %d' % (R, len(sel), max(z), s_)) + + +if __name__ == '__main__': + main(sys.argv[1] if len(sys.argv) > 1 else '.') diff --git a/research/cyclic-deferred/certificate.json b/research/cyclic-deferred/certificate.json new file mode 100644 index 0000000000..63f8475f51 --- /dev/null +++ b/research/cyclic-deferred/certificate.json @@ -0,0 +1,313 @@ +{ + "actual_bit_saving": "1240189553/10000000000000", + "assembly": { + "absorption_gap": "927131817657776688019987990104151/1250273262465113320434489890578774250000000000000", + "margins": { + "Gaussian_arithmetic": "655844911899769617358358262040437684903/4000874439888362625390367649852077600000000", + "bulk_exposure": "109304987684903/1000000000000000000", + "compact_phase_layer": "546524922028766956569537684903/5001093049860453281737959562315097", + "coordinate_movement": "109304987684903/1000000000000000000", + "dimension": "4999999950000000000000000000000000/5001093049860453281737959562315097", + "original_prefix": "54657493295926556110235506449862315097/500109304986045328173795956231509700000000", + "scalar_work": "874474887269575529914368114118037684903/4000874439888362625390367649852077600000000" + }, + "minimum_margin": "546524922028766956569537684903/5001093049860453281737959562315097", + "parameters": { + "C0": 3646615615709474302231996852324339320426087077316912790823030645920872744002225026973564928, + "C1": 1, + "a_bit": "109304987684903/1000000000000000000", + "a_complex": "109305097/1000000000000", + "alpha_squared_power": "819812391241024347264550000000/5001093049860453281737959562315097", + "beta": "1/1000000", + "c": "546524932959265506449862315097/5000000000000000000000000000000000", + "delta": "1/800000000", + "epsilon": "4999999950000000000000000000000000/5001093049860453281737959562315097", + "eta": "1/100000000", + "kappa": "27320273617/250000000000000", + "lambda_": "99989069501340814687684903/100000000000000000000000000", + "lambda_prime": "49994534750725059837684903/50000000000000000000000000", + "q": "5465249274940162315097/50000000000000000000000000", + "sigma": "999890694903/1000000000000", + "tau": "999890695012315097/1000000000000000000" + }, + "recurrence": { + "internal": "999890695012315097/1000000000000000000", + "leaf": "999890695012305097/1000000000000000000", + "reservations": "4999453475067040734493550137684903/5000000000000000000000000000000000" + }, + "strict_constraints": { + "Gaussian_arithmetic_above_kappa": "68320304462413398099760312349906764522291651/1250273262465113320434489890578774250000000000000", + "K_dominates_log": "54652492749401617685720725059837684903/500109304986045328173795956231509700000000", + "K_geometry": "54657493295926556110235506449862315097/500109304986045328173795956231509700000000", + "alpha_below_one": "5000273237469212257390695012315097/5001093049860453281737959562315097", + "alpha_below_one_fourth": "4997813800295489184348901362315097/20004372199441813126951838249260388", + "alpha_positive": "819812391241024347264550000000/5001093049860453281737959562315097", + "artificial_boundary": "28007214184081177759175043926930738837684903/4000874439888362625390367649852077600000000", + "beta_below_one": "999999/1000000", + "beta_positive": "1/1000000", + "bit_positive": "109304987684903/1000000000000000000", + "bulk_exposure_above_kappa": "23893216903/1000000000000000000", + "c_below_one": "4999453475067040734493550137684903/5000000000000000000000000000000000", + "c_positive": "546524932959265506449862315097/5000000000000000000000000000000000", + "cell_above_band": "4999726662530787742609304987684903/10002186099720906563475919124630194", + "compact_leaf": "109804987684903/50000000000000000000000000", + "compact_phase_layer_above_kappa": "927131817657776688019987990104151/1250273262465113320434489890578774250000000000000", + "compact_reservations": "5465249274940162315097/5000000000000000000000000000000000", + "complex_above_bit": "109315097/1000000000000000000", + "complex_below_one_over32": "31140694903/1000000000000", + "coordinate_movement_above_kappa": "23893216903/1000000000000000000", + "delta_below_one_eighth": "99999999/800000000", + "delta_positive": "1/800000000", + "dimension_above_kappa": "1249863356269493735392675273355462269987990104151/1250273262465113320434489890578774250000000000000", + "epsilon_below_one": "1093099860453281737959562315097/5001093049860453281737959562315097", + "epsilon_positive": "4999999950000000000000000000000000/5001093049860453281737959562315097", + "gamma_sublinear": "273287469212257390695012315097/5001093049860453281737959562315097", + "guard_width": "1093099860453281737959562315097/5001093049860453281737959562315097", + "lambda_above_internal": "109304987684903/100000000000000000000000000", + "lambda_above_sigma": "11040814687684903/100000000000000000000000000", + "lambda_above_tau": "109304987684903/100000000000000000000000000", + "lambda_prime_above_lambda": "109304987684903/100000000000000000000000000", + "lambda_prime_below_one": "5465249274940162315097/50000000000000000000000000", + "leaf_saving_above_bit": "1/100000000000000", + "literal_scalar_guard": "14065616197378741718443193606139245678291196", + "original_prefix_above_kappa": "12502733551782950862121586925775732604151/1250273262465113320434489890578774250000000000000", + "phase_boundary": "655844911899769617358358262040437684903/4000874439888362625390367649852077600000000", + "phase_local": "874474887269575529914368114118037684903/4000874439888362625390367649852077600000000", + "prime_interval_packing": "1093099860453281737959562315097/5001093049860453281737959562315097", + "q_below_internal": "109304987684903/50000000000000000000000000", + "q_below_leaf": "109804987684903/50000000000000000000000000", + "q_below_reservations": "5465249274940162315097/5000000000000000000000000000000000", + "q_positive": "5465249274940162315097/50000000000000000000000000", + "record_suffix": "1093099860453281737959562315097/5001093049860453281737959562315097", + "row_product_gap": "6389/25", + "scalar_work_above_kappa": "136642171765477745773513391124156764522291651/1250273262465113320434489890578774250000000000000", + "short_record_fallback": "4999453305585773949169096950958612448914402964119409/5001093049860453281737959562315097000000000000000000", + "small_field_exposure": "546574938424514781390024630194/5001093049860453281737959562315097" + } + }, + "bit_moment_gap": "210811394225115117568018038513239592855337768061996351784199300828041381607148420475711921673436778332750996651783152394205578153858435663243959795913385215868392831844509655226993164072062830500832781615792327068936897853818968534771730481866850519439187068953062899333771640996075361901014500735179763112430083120460814689994116646689670445286414265265018468311435502209195246240538069975559360544007937885404793780372701951022292660282948582656517071290400479729799954952580125532795274568021525151839594883237275569314958070368193662075730567130277424969924134425921633872848924585639423998410253779062359718371205767101510073996880454144801457072151080008705648366603197414406872289670642046369219405455128737300640897667220951127018547660455087533581513233999285275099394371781290865408274484542745086391849285198194905751058992419590161634431610100995441112613134240446609058758039909343152776920263419910572835208525277494067408376961456317/225678505065634612156474913616400633538202019254665477026878220214422133931127460164253533068001699469116755578965090566731480236912032281717920888140691998261537790258547549397061712443744511202265657747547567084090291301783866427704803156891369853685579999500594559805069402727752752227038426964007028952158078563045054314475625278140097385695241851533235641996467089273692960018822280793234080014352234618229252999217015923728814468917104222554059646947960375336061268431587018084270516494408656203498548153054913267707164839939006583338918817922618882667407408888179421052689449193499742148706302504238261936554897181289081072466758282367100305194479622149878636307463869297507337915811001244472279386614413535081936912313821531543735588465392499062010570720287729070905437080967709221039366272598541269000920375996285867953823816142239661027100714288630069735295241672325865922423925213948613346461034734632365263739073012128769510020000000000000000000000", + "bit_parameter": "109304987684903/1000000000000000000", + "bit_profile": { + "L": 1792252, + "N": 3136441, + "R": 28866, + "W": 108516254, + "child_multiplicities": { + "1": 239511811, + "10": 878416, + "11": 1388464, + "12": 1080310, + "13": 945714, + "14": 226688, + "15": 2451064, + "16": 1508892, + "17": 4771074, + "18": 2149994, + "19": 7367360, + "2": 238288050, + "20": 8182020, + "21": 1466388, + "22": 88550, + "3": 53377940, + "4": 46970462, + "484": 6272882, + "5": 23632224, + "506": 61280142, + "507": 545468, + "508": 173558, + "509": 293986, + "510": 580888, + "511": 14168, + "512": 322322, + "513": 17710, + "514": 1129898, + "515": 127512, + "516": 410872, + "517": 99176, + "518": 1186570, + "519": 340032, + "520": 322322, + "521": 106260, + "522": 1583274, + "523": 626934, + "524": 2854852, + "525": 13711082, + "526": 4629394, + "527": 5653032, + "528": 6233920, + "6": 7409864, + "7": 4105178, + "8": 5755750, + "9": 2082696 + }, + "deferred_slots": 11565, + "deficit": 1344189, + "h": 23, + "m": 529, + "maxchild": 528, + "source": { + "commit": "741e7aa078392553815df7926ee17ac5e25a8c38", + "repository": "https://github.com/Swapnil-jain/integer-mult-kappa", + "sha256": { + "deferred_23.json.gz": "8c38e947ff9e021e308000dd82bb5e2194eb265d8b75194e22ce783d3e75317c", + "witness_23.json.gz": "b2486aa2bb222bacea6e52162a3920780e45dd8edc5d7cb03eabea336a1c6588" + } + }, + "total_rank": 57403754177, + "v": 1771 + }, + "coarse_bit_saving": "620523/5000000000", + "complex_moment_gap": "1640159121634935285831917525395920478957252582737704563015760622928867402805342926520519384747697435168041604903835923255360260235031881335071146937154904338131023977710088926307385050291508883883130952786501274207444056646198216882886514613627821281753013249172610023821787938308152910885360551014803272669179140514676833033397645915372432433431203810703842779902761965985601381175173536210892327161760089896933573541777289453079848892008679585453252777055539245793148582927100367547863030321874958573164590227279895312383367896087441087505127446778992890858329779447560260056609568589395007023453213906059916674583790291893335558615647531379182312887774593934325793870726937654543058462242583031752182644205631071868215625622050363905507356481512632154540855005781943391550198484607793697136679556080071918382706571171861462665193868619332404883416819753274962571116175040688999513902777760374225938302114781043020798773809946563/21289492339677425540196209569760186409783552924441821437733779560736965169859021251025268445144059877590580271559342912579721007837989037575373236000527853613449017095965727290350890523153630178210446888836915101091421142045198082559567015048302285209115214666751924041899249499649244048240664184814756996143477341246039570090422189649391979337566880461409570005157094487379886354675601126438622262734731741810772617914387834970317465238858947131198497871455390014915066410416426563064104756236318841999099329771356743092404567255849049546662657023670616450900314389911819494111946026582916908825129754643852892556168750200643703400272062593787295950411477053754337109035491076299940174162923809057420310305847666145025374398907799569659533082621555598432119191093052845097291826978553394164796676563534145533172493540227740491354150011757028851005377051299728510834995987179869619536019625004332380879865926083002584448000000000000000000000000", + "complex_profile": { + "L": 2234496, + "N": 4096576, + "R": 28705, + "W": 124390992, + "additions": 91770, + "child_multiplicities": { + "1": 339934848, + "10": 9500656, + "11": 9456128, + "12": 15430976, + "13": 10949840, + "14": 1384416, + "15": 1275120, + "16": 793408, + "17": 506000, + "18": 2902416, + "19": 2092816, + "2": 358859248, + "20": 817696, + "21": 1230592, + "22": 64768, + "23": 8363168, + "3": 36626304, + "4": 66512688, + "5": 30258800, + "529": 8193152, + "552": 97147952, + "554": 3493424, + "556": 1445136, + "558": 2319504, + "560": 582912, + "562": 101200, + "564": 1307504, + "566": 975568, + "568": 1364176, + "569": 4048, + "570": 3643200, + "571": 2440944, + "572": 841984, + "573": 44528, + "574": 485760, + "6": 17062320, + "7": 14240864, + "8": 23757712, + "9": 6290592 + }, + "deferred_dims": { + "10": 25, + "12": 323, + "14": 241, + "16": 337, + "17": 1, + "18": 900, + "19": 603, + "2": 863, + "20": 208, + "21": 11, + "22": 120, + "4": 357, + "6": 573, + "8": 144 + }, + "deferred_roles": 4706, + "deficit": 1862080, + "h": 24, + "lifted_additions": 39989, + "links": 71185, + "m": 576, + "maxchild": 574, + "phase_one_ops": 18844, + "phase_one_roles": 13555, + "replay": { + "field": "Z/(2^61-1)", + "scratch_restored": true, + "seeds": [ + 1, + 2 + ], + "y_plus_x": true + }, + "roots": 8120, + "total_rank": 71647349312, + "v": 2024 + }, + "complex_saving": "109305097/1000000000000", + "finite_bridge": { + "bit_coarse": { + "W": 108516254, + "halving_degree": 367, + "m": 529, + "maxchild": 528, + "wire_bits": 27 + }, + "complex": { + "W": 124390992, + "halving_degree": 200, + "m": 576, + "maxchild": 574, + "s": 71647349312, + "scalar_group_upper": 60347419084480, + "scalar_terms": [ + { + "R": 28705, + "c": 91770, + "description": "Expanded deferred readouts and forward/inverse/reflected words", + "h": 24, + "invocations": 2024, + "local_group_upper": 14907958248, + "q": 8120, + "v": 2024 + }, + { + "R": 28705, + "c": 91770, + "description": "Expanded deferred readouts and forward/inverse/reflected words", + "h": 24, + "invocations": 2024, + "local_group_upper": 14907958248, + "q": 8120, + "v": 2024 + } + ], + "wire_bits": 27 + }, + "ordinary_leaf_row_degree": 252, + "rows": { + "coefficient": 15561, + "contract": "W_complex^D_complex * W_coarse^D_coarse * W_old^D_old; prefix and padding; sequential reuse", + "degree": 32000, + "degree_gap": "6389/25", + "suffix_slope": 128000 + }, + "semantic": { + "B": 14065616197380609244023681038811612751070848, + "C0": 3646615615709474302231996852324339320426087077316912790823030645920872744002225026973564928, + "C1": 1, + "E": 14065616197380609244023681038811541103721536, + "exact_grid": "2^(-P)*21^(-K), K=G*(D_complex+1); completed children preserve incoming odd denominator; no child rounding", + "fixed_odd_divisor": 21, + "induction_gap": 42196848592141827732071043116434838253212544, + "literal_charge": 1867525580487432672295425430340, + "strict_literal_gap": 14065616197378741718443193606139245678291196 + } + }, + "kappa": "27320273617/250000000000000", + "next_grid_rejections": { + "bit": "1e-10", + "complex": "1e-12", + "kappa": "1e-15" + }, + "status": "Finite conditional cyclic/deferred witness" +} diff --git a/research/cyclic-deferred/certificate.py b/research/cyclic-deferred/certificate.py new file mode 100644 index 0000000000..8ea1340204 --- /dev/null +++ b/research/cyclic-deferred/certificate.py @@ -0,0 +1,114 @@ +#!/usr/bin/env python3 +"""Exact finite assembly for cyclic strips with deferred readouts. + +Built on Avi Eisenberg's PR110 (Anthropic Claude assistance), icekylinx's +PR104 stopped-product and copied-center interfaces, and Zhihao Chen's +assembly of the RaD interfaces. Integration for eumemic with OpenAI Codex +assistance. Apache-2.0. General transfer hypotheses remain inherited. +""" +import argparse +import json +import sys +from fractions import Fraction as Q +from pathlib import Path +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +sys.path.insert(0, str(ROOT / 'scripts')) +from partial_swap_network import moment +from copied_centers_network import finite_bridge as copied_bridge +from structured_bulk_assembly import assembly, js +ATOM = Q(1, 1000) +OLD = Q(384599, 10**10) +BETA = Q(1, 10**6) +COARSE = Q(620523, 5000000000) +COMPLEX = Q(109305097, 10**12) +KGRID = 10**15 + +def profile(name): + p = json.loads((HERE / name).read_text()) + p['child_multiplicities'] = {int(t): c for t, c in p['child_multiplicities'].items()} + z = p['child_multiplicities'] + assert all(0 < t < p['m'] and c > 0 for t,c in z.items()) + assert sum(t*c for t,c in z.items()) == p['total_rank'] == p['W']*p['m']-p['N']+p['L'] + assert max(z) == p['maxchild'] + return p + +def contracts(p, a): + try: moment(p['m'],p['W'],p['child_multiplicities'],a,True) + except ValueError: return False + return True + +def exact(bit=None, phase=None): + bit = profile('bit-profile.json') if bit is None else bit + phase = profile('complex-profile.json') if phase is None else phase + assert (bit['h'], phase['h']) == (23,24) + bm = moment(bit['m'],bit['W'],bit['child_multiplicities'],COARSE,True) + cm = moment(phase['m'],phase['W'],phase['child_multiplicities'],COMPLEX,True) + assert not contracts(bit,COARSE+Q(1,10**10)) + assert not contracts(phase,COMPLEX+Q(1,10**12)) + ab = (1-ATOM)*COARSE+ATOM*OLD + assert 0 < OLD < COARSE < ATOM and ab < ATOM + a = min(ab,(1-BETA)*COMPLEX-Q(1,10**14)) + row = dict(h=phase['h'],v=phase['v'],c=phase['additions'],central_disjoint=24) + bridge = copied_bridge(bit,phase,[row,row]) + # Logical readouts are expanded into same-frame shears with |coefficient|<=1. + # Exact numerators over42 are split into signed42 chunks and a remainder. + # The independent audit counts every chunk and checks this guard covers it. + # Each row has <=c+R mixer operations and <=R leaf copies. There are + # <=R+q readouts, each containing <=h center coefficients and <=v direct + # coefficients; <=4*v*(h+1) scalar groups suffice per readout. A factor + # eight covers forward/inverse words, both reflected words, and copies. + h,v,R,q,c = (phase[k] for k in ('h','v','R','roots','additions')) + local = 8*(c+2*R+(R+q)*v*(h+1)+h*h+h+1) + G = phase['N'] + 2*v*local + m,W,s = (phase[k] for k in ('m','W','total_rank')) + E=64*(W+m+G+1)**3 + charge=2*G*W*W+8*s+4*W+4+32*m + B=s+E; C0=32*m*B*B + assert charge= s+E and 2*B+181: + mid=(lo+hi)//2 + if accepts(mid): lo=mid + else: hi=mid + k=Q(lo,KGRID) + assembled=assembly(a,COMPLEX,bridge,k,beta=BETA) + assert len(assembled['strict_constraints'])==47 and len(assembled['margins'])==7 + assert not accepts(lo+1) + return dict(status='Finite conditional cyclic/deferred witness',kappa=k, + complex_saving=COMPLEX,coarse_bit_saving=COARSE,actual_bit_saving=ab, + bit_parameter=a,complex_profile=phase,bit_profile=bit, + bit_moment_gap=bm['strict_gap'],complex_moment_gap=cm['strict_gap'], + finite_bridge=bridge,assembly=assembled, + next_grid_rejections=dict(bit='1e-10',complex='1e-12',kappa='1e-15')) + +def main(): + parser=argparse.ArgumentParser();parser.add_argument('--write',action='store_true');args=parser.parse_args() + assert not sys.flags.optimize + result=js(exact()); path=HERE/'certificate.json' + if args.write:path.write_text(json.dumps(result,indent=2,sort_keys=True)+'\n') + else:assert result==json.loads(path.read_text()),'Frozen exact certificate mismatch' + print('PASS conditional kappa = %s = %.12e; 47 constraints, 7 margins; expanded scalar charge' % (result['kappa'],float(Q(result['kappa'])))) +if __name__=='__main__':main() diff --git a/research/cyclic-deferred/complex-profile.json b/research/cyclic-deferred/complex-profile.json new file mode 100644 index 0000000000..90a44f18a8 --- /dev/null +++ b/research/cyclic-deferred/complex-profile.json @@ -0,0 +1,85 @@ +{ + "h": 24, + "v": 2024, + "additions": 91770, + "roots": 8120, + "links": 71185, + "R": 28705, + "m": 576, + "N": 4096576, + "W": 124390992, + "L": 2234496, + "total_rank": 71647349312, + "deficit": 1862080, + "maxchild": 574, + "phase_one_ops": 18844, + "phase_one_roles": 13555, + "deferred_roles": 4706, + "deferred_dims": { + "2": 863, + "4": 357, + "6": 573, + "8": 144, + "10": 25, + "12": 323, + "14": 241, + "16": 337, + "17": 1, + "18": 900, + "19": 603, + "20": 208, + "21": 11, + "22": 120 + }, + "lifted_additions": 39989, + "replay": { + "seeds": [ + 1, + 2 + ], + "scratch_restored": true, + "y_plus_x": true, + "field": "Z/(2^61-1)" + }, + "child_multiplicities": { + "1": 339934848, + "2": 358859248, + "3": 36626304, + "4": 66512688, + "5": 30258800, + "6": 17062320, + "7": 14240864, + "8": 23757712, + "9": 6290592, + "10": 9500656, + "11": 9456128, + "12": 15430976, + "13": 10949840, + "14": 1384416, + "15": 1275120, + "16": 793408, + "17": 506000, + "18": 2902416, + "19": 2092816, + "20": 817696, + "21": 1230592, + "22": 64768, + "23": 8363168, + "529": 8193152, + "552": 97147952, + "554": 3493424, + "556": 1445136, + "558": 2319504, + "560": 582912, + "562": 101200, + "564": 1307504, + "566": 975568, + "568": 1364176, + "569": 4048, + "570": 3643200, + "571": 2440944, + "572": 841984, + "573": 44528, + "574": 485760 + } +} diff --git a/research/cyclic-deferred/complex_deferred.py b/research/cyclic-deferred/complex_deferred.py new file mode 100644 index 0000000000..c7c1bc904a --- /dev/null +++ b/research/cyclic-deferred/complex_deferred.py @@ -0,0 +1,562 @@ +#!/usr/bin/env python3 +"""Saturated deferred readouts on the immutable PR117 complex DAG. + +PR117 credits its searched DAG to eumemic with Anthropic Claude assistance; +this experiment imports and replays that witness unchanged. PR110/PR114 +saturation and exact finite checks are applied to the resulting graph. +Logical readout macros are realized as signed numerator/42 chunks of magnitude +at most one. The literal audit expands and charges those same-frame shears, +checks exact reconstruction, and reverses the chunks under reflection. +Inherited Avi Eisenberg, Rohan Arun, icekylinx and Swapnil Jain credits retained. +This integration prepared with OpenAI Codex assistance. Apache-2.0. +""" +import array +import json +import random +import struct +import sys +import tempfile +from collections import Counter, defaultdict +from itertools import combinations +from pathlib import Path + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +sys.path.insert(0, str(ROOT / 'scripts')) +sys.path.insert(0, str(HERE)) +import importlib.util +producer_path = HERE / 'producer.py' +spec = importlib.util.spec_from_file_location('replayed_producer_wrapper', producer_path) +producer = importlib.util.module_from_spec(spec); spec.loader.exec_module(producer) +build = producer.build + +P = (1 << 61) - 1 + + +def require(ok, msg): + if not ok: + raise SystemExit('FAIL: ' + msg) + + +def load(prefix): + def rd(fh, typ, cnt): + a = array.array(typ); a.fromfile(fh, cnt); return a + with open(str(prefix) + '.bin', 'rb') as f: + h, v, n, q = struct.unpack('<4I', f.read(16)) + flat = rd(f, 'I', 2 * n); core = rd(f, 'Q', n); cover = rd(f, 'Q', n) + roots = rd(f, 'I', q); kind = rd(f, 'I', q); active = rd(f, 'B', n) + with open(str(prefix) + '.labels', 'rb') as f: + ranks = rd(f, 'I', n); types = rd(f, 'B', n) + args = [(flat[2 * i], flat[2 * i + 1]) for i in range(n)] + return h, v, n, q, args, core, cover, roots, kind, active, ranks, types + + +# ---------------------------------------------------------------- F2 linear algebra on bit vectors +def dot(a, b): return bin(a & b).count('1') & 1 + + +def reduce(basis): + rows = []; piv = [] + for vec in basis: + for p, r in zip(piv, rows): + if vec >> p & 1: vec ^= r + if vec: + p = vec.bit_length() - 1 + for i in range(len(rows)): + if rows[i] >> p & 1: rows[i] ^= vec + rows.append(vec); piv.append(p) + return rows + + +def kernel(funcs, h): + K = reduce(funcs); piv = [r.bit_length() - 1 for r in K] + out = [] + for c in (i for i in range(h) if i not in piv): + vec = 1 << c + for r, p in zip(K, piv): + if r >> c & 1: vec |= 1 << p + out.append(vec) + return out + + +def restrict(basis, funcs): + B = reduce(basis) + for f in funcs: + if not B: break + vals = [dot(b, f) for b in B] + if not any(vals): continue + k = vals.index(1); pv = B[k] + B = [b ^ pv if val else b for b, val in zip(B, vals)]; B.pop(k) + return reduce(B) + + +def contains(A, B): + RB = reduce(B) + return len(reduce(RB + list(A))) == len(RB) + + +def cap(A, B): + A = reduce(A); B = reduce(B) + if not A or not B: return [] + ker = []; red = [] + for i, vec in enumerate(A + B): + tag = 1 << i + for rv, rt in red: + if vec >> (rv.bit_length() - 1) & 1: vec ^= rv; tag ^= rt + if vec: red.append((vec, tag)) + else: + comb_ = 0 + for k in range(len(A)): + if tag >> k & 1: comb_ ^= A[k] + ker.append(comb_) + return reduce(ker) + + +def nondeg(B): + B = reduce(B); k = len(B) + if not k: return True + M = [sum(dot(B[i], B[j]) << j for j in range(k)) for i in range(k)] + return len(reduce(M)) == k + + +def hopcroft_karp(left, adj): + """maximum bipartite matching; adj[x] = sorted list of right vertices.""" + INF = 1 << 60 + mate_l = {x: None for x in left}; mate_r = {} + while True: + dist = {}; queue = [] + for x in left: + if mate_l[x] is None: dist[x] = 0; queue.append(x) + else: dist[x] = INF + found = INF; head = 0 + while head < len(queue): + x = queue[head]; head += 1 + if dist[x] >= found: continue + for r in adj[x]: + y = mate_r.get(r) + if y is None: found = min(found, dist[x] + 1) + elif dist[y] == INF: dist[y] = dist[x] + 1; queue.append(y) + if found == INF: break + gained = 0 + for x0 in left: + if mate_l[x0] is not None: continue + stack = [(x0, iter(adj[x0]))]; path = [] + while stack: + x, it = stack[-1] + advanced = False + for r in it: + y = mate_r.get(r) + if (y is None and dist[x] + 1 == found) or (y is not None and dist[y] == dist[x] + 1): + path.append((x, r)) + if y is None: + for xx, rr in path: mate_l[xx] = rr; mate_r[rr] = xx + gained += 1; stack = []; break + stack.append((y, iter(adj[y]))); advanced = True; break + else: + dist[x] = INF; stack.pop() + if path: path.pop() + continue + if not advanced: break + if not gained: break + return mate_l + + +from functools import lru_cache +from fractions import Fraction + +def sat_basis(vectors): + piv = {} + for x in vectors: + for p in sorted(piv, reverse=True): + if x >> p & 1: + x ^= piv[p] + if x: + p = x.bit_length() - 1 + for q in piv: + if piv[q] >> p & 1: + piv[q] ^= x + piv[p] = x + return tuple((piv[p] for p in sorted(piv, reverse=True))) + +def sat_dot(a, b): + return (a & b).bit_count() & 1 + +@lru_cache(None) +def sat_contained(A, B): + for x in A: + for r in B: + if x >> r.bit_length() - 1 & 1: + x ^= r + if x: + return False + return True + +@lru_cache(None) +def sat_cap(A, B): + if not A or not B: + return () + red = {} + out = [] + for i, x in enumerate(A + B): + tag = 1 << i + for p in sorted(red, reverse=True): + if x >> p & 1: + r, t = red[p] + x ^= r + tag ^= t + if x: + red[x.bit_length() - 1] = (x, tag) + else: + y = 0 + for j, r in enumerate(A): + if tag >> j & 1: + y ^= r + if y: + out.append(y) + return sat_basis(out) + +@lru_cache(None) +def sat_nondeg(B): + return len(sat_basis((sum((sat_dot(a, b) << j for j, b in enumerate(B))) for a in B))) == len(B) + +@lru_cache(None) +def sat_nonsingular_part(B): + rows = list(B) + out = [] + while rows: + i = next((i for i, x in enumerate(rows) if sat_dot(x, x)), None) + if i is not None: + a = rows.pop(i) + out.append(a) + rows = [x ^ a if sat_dot(x, a) else x for x in rows] + continue + pair = next(((i, j) for i in range(len(rows)) for j in range(i + 1, len(rows)) if sat_dot(rows[i], rows[j])), None) + if pair is None: + break + i, j = pair + a, b = (rows[i], rows[j]) + out.extend((a, b)) + rows = [x ^ (a if sat_dot(x, b) else 0) ^ (b if sat_dot(x, a) else 0) for k, x in enumerate(rows) if k not in (i, j)] + return sat_basis(out) + +def saturated_placement(cand, reach): + # Each extracted block is orthogonal to previously selected blocks. + # A diagonal-one pivot contributes a nondegenerate line; when all + # remaining diagonals vanish, a dot-one pair contributes a hyperbolic + # plane. The residual radical is discarded, not counted as a frame. + cand = {s: sat_basis(B) for s, B in cand.items()} + order = sorted(cand, key=lambda s: (Fraction(-(1 << len(cand[s])), max(1, len(reach[s]))**2), -len(cand[s]), s)) + byT = defaultdict(list); placed = {} + for s in order: + X = cand[s]; changed = True + while changed and X: + changed = False + for t in sorted(reach[s]): + for w in byT[t]: + B = placed[w] + if (len(B) >= len(X) and not sat_contained(X, B)) or (len(B) < len(X) and not sat_contained(B, X)): + X = sat_cap(X, B); changed = True + if not X: break + if not X: break + if X and not sat_nondeg(X): + before = X; X = sat_nonsingular_part(X) + assert sat_contained(X, before) and sat_nondeg(X) + assert len(X) < len(before) + changed = True # Extraction can break containment of a smaller target frame. + if X: + assert sat_nondeg(X) and sat_contained(X, cand[s]) + placed[s] = X + for t in reach[s]: byT[t].append(s) + for t, ss in byT.items(): + ss.sort(key=lambda s: (len(placed[s]), s)) + assert all(sat_contained(placed[a], placed[b]) for a, b in zip(ss, ss[1:])) + return placed + +def main(): + with tempfile.TemporaryDirectory(prefix='deferred-stopped-') as work: + prefix = Path(work) / 'complex' + build(24, prefix, central_disjoint=24) + h, v, n, q, args, core, cover, roots, kind, active, ranks, types = load(prefix) + trip = list(combinations(range(h), 3)); require(len(trip) == v, 'triple count') + m = h * h; N = v * v; FULL = (1 << h) - 1 + tmask = [sum(1 << p for p in T) for T in trip] + tid = {T: i for i, T in enumerate(trip)} + + # ------------------------------------------------------------ uses and matching (inherited adjacency) + degree = [0] * n; uses = defaultdict(list); c_add = 0 + for x in range(1, n): + if active[x] and args[x][0]: + c_add += 1 + for pos, y in enumerate(args[x]): degree[y] += 1; uses[y].append(('gate', x, pos)) + for j, x in enumerate(roots): degree[x] += 1; uses[x].append(('root', j)) + def unode(u): return roots[u[1]] if u[0] == 'root' else u[1] + def before(x, u): + y = unode(u) + return (ranks[x], x) < (ranks[y], (n + u[1]) if u[0] == 'root' else y) + def incl(x, y): + tx, ty = types[x], types[y] + if tx == 1 and ty == 1: return not (core[y] & ~core[x]) and not (cover[x] & ~cover[y]) + if tx in (1, 2) and ty == 2: return not (cover[x] & ~cover[y]) + if tx == 1 and ty == 3: return bool(core[x] & core[y]) + if tx == 2 and ty == 3: return not (cover[x] & ~core[y]) + if tx == 3 and ty == 2: return cover[y] == FULL + if tx == 3 and ty == 3: return core[x] == core[y] + return False + left = []; adj = {} + for x in range(1, n): + if not (active[x] and args[x][0]): continue + rs = sorted({(y, k) for y in args[x] for k, u in enumerate(uses[y]) if before(x, u) and incl(x, unode(u))}) + if rs: left.append(x); adj[x] = rs + mate = hopcroft_karp(left, adj) + links = {x: r for x, r in mate.items() if r is not None} + R = c_add + q - len(links) + require((c_add,q,len(links),R)==(91770,8120,71185,28705),'selected PR117 graph') + print('PR117 graph matched', c_add, q, len(links), R, flush=True) + linked_use = {(y, k): x for x, (y, k) in links.items()} + + # ------------------------------------------------------------ root targets, read coefficients, root functionals + target = [None] * q + for j in range(v): target[j] = j + idx = v + # PR117 witness stores pair-star roots in natural excluded-point order. + for a, b in combinations(range(h), 2): + others = [i for i in range(h) if i not in (a, b)] + for i in others: target[idx] = tid[tuple(sorted((a, b, i)))]; idx += 1 + centre_of = {} + for j in range(q): + if kind[j]: + miss = FULL & ~cover[roots[j]]; require(bin(miss).count('1') == 1, 'centre cover') + centre_of[j] = miss.bit_length() - 1 + require(idx + len(centre_of) == q, 'root order') + rootfun = [(1 << centre_of[j]) if kind[j] else tmask[target[j]] for j in range(q)] + + # ------------------------------------------------------------ lifted binary frames, monotone + succ = defaultdict(set); droot = defaultdict(set) + for x in range(1, n): + if not active[x]: continue + for k, u in enumerate(uses[x]): + if (x, k) in linked_use: continue + (succ[x].add(u[1]) if u[0] == 'gate' else droot[x].add(u[1])) + for x, (y, k) in links.items(): + u = uses[y][k]; (succ[x].add(u[1]) if u[0] == 'gate' else droot[x].add(u[1])) + order_desc = sorted((x for x in range(1, n) if active[x]), key=lambda x: (ranks[x], x), reverse=True) + K = {} + for x in order_desc: + rows = [rootfun[j] for j in droot[x]] + for t in succ[x]: rows += K[t] + K[x] = reduce(rows) + def envelope(x): + if not args[x][0]: return [tmask[x - 1]] + if types[x] == 2: return [1 << i for i in range(h) if cover[x] >> i & 1] + require(types[x] == 1, 'only ordinary and common-pair labels occur') + ks = [i for i in range(h) if (cover[x] & ~core[x]) >> i & 1] + require(len(ks) == ranks[x], 'common-pair support') + return [core[x] | (1 << k) for k in ks] + U = {} + for x in range(1, n): + if not active[x]: continue + if not args[x][0]: U[x] = envelope(x); continue + B = kernel(K[x], h) + require(contains(envelope(x), B), 'label outside lifted frame') + U[x] = B if nondeg(B) else envelope(x) + changed = True + while changed: + changed = False + for x in order_desc: + if args[x][0] and any(not contains(U[x], U[t]) for t in succ[x]): + env = envelope(x) + if len(reduce(U[x])) != len(reduce(env)) or not contains(U[x], env): U[x] = env; changed = True + dimU = {x: len(reduce(B)) for x, B in U.items()} + print('PR117 frames lifted',sum(dimU[x]>ranks[x] for x in U),flush=True) + + # ------------------------------------------------------------ explicit role compile + order = sorted((x for x in range(1, n) if active[x]), key=lambda x: (ranks[x], x)) + holds = []; first_node = []; ops = []; edge_key = {}; role_root = {} + def new_role(node): holds.append([node]); first_node.append(node); return len(holds) - 1 + def serve(s, y, k): + u = uses[y][k] + if u[0] == 'gate': edge_key[(y, k)] = s + else: role_root[s] = u[1] + for x in order: + free = [k for k in range(len(uses[x])) if (x, k) not in linked_use] + if not args[x][0]: + for k in free: + s = new_role(x); ops.append(('src', s, x)); serve(s, x, k) + continue + a, b = args[x] + ka = next(k for k, u in enumerate(uses[a]) if u == ('gate', x, 0)) + kb = next(k for k, u in enumerate(uses[b]) if u == ('gate', x, 1)) + sa, sb = edge_key.pop((a, ka)), edge_key.pop((b, kb)) + if x in links and links[x][0] == a: sa, sb = sb, sa + piv, oth = sa, sb + ops.append(('add', piv, oth, x)); holds[piv].append(x); holds[oth].append(x) + if x in links: serve(oth, *links[x]) + require(free, 'every use linked at node %d' % x) + serve(piv, x, free[0]) + for k in free[1:]: + f = new_role(x); ops.append(('copy', piv, f, x)); serve(f, x, k) + require(not edge_key and len(holds) == R, 'compile') + Rr = R + + # ------------------------------------------------------------ B. the word computes every root value + rng = random.Random(20261008) + xs = [rng.randrange(P) for _ in range(v)] + val = [0] * n + for i in range(v): val[i + 1] = xs[i] + for x in order: + if args[x][0]: val[x] = (val[args[x][0]] + val[args[x][1]]) % P + leaf_of = {s: first_node[s] for s in range(Rr) if not args[first_node[s]][0]} + a_ = [0] * Rr + for s, leaf in leaf_of.items(): a_[s] = xs[leaf - 1] + for o in ops: + if o[0] == 'add': a_[o[1]] = (a_[o[1]] + a_[o[2]]) % P + elif o[0] == 'copy': a_[o[2]] = (a_[o[2]] + a_[o[1]]) % P + require(all(a_[s] == val[roots[j]] for s, j in role_root.items()), 'root values') + + # ------------------------------------------------------------ phase one and garbage reach + def touch(o): return [o[1], o[2]] if o[0] in ('add', 'copy') else [] + prev = {}; pred = defaultdict(list); last = {} + for i, o in enumerate(ops): + for s in touch(o): + if s in prev: pred[i].append(prev[s]) + prev[s] = i; last[s] = i + centre_roles = [s for s, j in role_root.items() if kind[j]] + Anc = set(); st = [last[s] for s in centre_roles] + while st: + i = st.pop() + if i not in Anc: Anc.add(i); st.extend(pred[i]) + touched = set(centre_roles) + for i in Anc: touched.update(touch(ops[i])) + require(all(last[s] in Anc for s in centre_roles), 'centres complete in phase one') + reach = [set() for _ in range(Rr)]; reach_all = [False] * Rr + for s, j in role_root.items(): + if kind[j]: reach_all[s] = True + else: reach[s].add(target[j]) + for o in reversed(ops): + if o[0] == 'add': reach[o[2]] |= reach[o[1]]; reach_all[o[2]] = reach_all[o[2]] or reach_all[o[1]] + elif o[0] == 'copy': reach[o[1]] |= reach[o[2]]; reach_all[o[1]] = reach_all[o[1]] or reach_all[o[2]] + + # ------------------------------------------------------------ deferral frames, insertion nesting + def F0(s): return U[first_node[s]] + cand = {} + for s in range(Rr): + if s in touched or reach_all[s]: continue + S_ = restrict(F0(s), [tmask[t] for t in reach[s]]) + if S_ and nondeg(S_): cand[s] = S_ + print('PR117 candidates',len(cand),flush=True) + placed = saturated_placement(cand, reach) + print('PR117 placed',len(placed),flush=True) + deferred = sorted(placed, key=lambda s: (len(placed[s]), s)); dset = set(deferred) + + # ------------------------------------------------------------ C. replay with arbitrary scratch and data + inv = lambda a: pow(a % P, P - 2, P); HALF = inv(2); I21 = inv(21) + cvec = [None] * Rr; dpart = [dict() for _ in range(Rr)] + for s, j in role_root.items(): + if kind[j]: c = [0] * h; c[centre_of[j]] = 1; cvec[s] = c + else: dpart[s][target[j]] = (P - HALF) if j >= v else HALF + seed_c = {s: (None if cvec[s] is None else list(cvec[s])) for s in role_root} + seed_d = {s: dict(dpart[s]) for s in role_root} + def addc(dst, src): + if cvec[src] is not None: + cvec[dst] = list(cvec[src]) if cvec[dst] is None else [(p + q_) % P for p, q_ in zip(cvec[dst], cvec[src])] + for t, c in dpart[src].items(): dpart[dst][t] = (dpart[dst].get(t, 0) + c) % P + for o in reversed(ops): + if o[0] == 'add': addc(o[2], o[1]) + elif o[0] == 'copy': addc(o[1], o[2]) + scatter = [[(I21 - (HALF if i in trip[t] else 0)) % P for t in range(v)] for i in range(h)] + def readout(y, s, value, sign, seed=False): + # Logical readout macro: the literal audit combines its exact rational + # target coefficients and expands each numerator/42 into bounded shears. + cv = seed_c[s] if seed else cvec[s]; dp = seed_d[s] if seed else dpart[s] + if cv is not None: + for i, ci in enumerate(cv): + if ci: + f = sign * ci * value % P; row = scatter[i] + for t in range(v): y[t] = (y[t] + f * row[t]) % P + for t, c in dp.items(): y[t] = (y[t] + sign * c * value) % P + phase1 = sorted(Anc); rest = [i for i in range(len(ops)) if i not in Anc] + def replay(seed): + rng = random.Random(seed) + x = [rng.randrange(P) for _ in range(v)]; z = [rng.randrange(P) for _ in range(Rr)] + y0 = [rng.randrange(P) for _ in range(v)]; a = list(z); y = list(y0) + for s in range(Rr): + if s not in dset: readout(y, s, a[s], -1) + for s, leaf in leaf_of.items(): + if s not in dset: a[s] = (a[s] + x[leaf - 1]) % P + def run(i, sign=1): + o = ops[i] + if o[0] == 'add': a[o[1]] = (a[o[1]] + sign * a[o[2]]) % P + elif o[0] == 'copy': a[o[2]] = (a[o[2]] + sign * a[o[1]]) % P + for i in phase1: run(i) + for s in centre_roles: readout(y, s, a[s], +1, True) + for s in deferred: readout(y, s, a[s], -1) + for s in deferred: + if s in leaf_of: a[s] = (a[s] + x[leaf_of[s] - 1]) % P + for i in rest: run(i) + for s, j in role_root.items(): + if not kind[j]: readout(y, s, a[s], +1, True) + for i in reversed(range(len(ops))): run(i, -1) + for s, leaf in leaf_of.items(): a[s] = (a[s] - x[leaf - 1]) % P + return a == z, all((y[t] - y0[t] - x[t]) % P == 0 for t in range(v)) + rep = [replay(seed) for seed in (1, 2)] + require(all(r == (True, True) for r in rep), 'replay %s' % rep) + + # ------------------------------------------------------------ D. exact F2 frame facts + root_frame = {} + for s, j in role_root.items(): + root_frame[s] = [1 << i for i in range(h) if i != centre_of[j]] if kind[j] else kernel([tmask[target[j]]], h) + FULLB = [1 << i for i in range(h)] + chain_dims = [] + for s in range(Rr): + seq = [placed.get(s, []), F0(s)] + [U[x] for x in holds[s][1:]] + if s in root_frame: seq.append(root_frame[s]) + seq.append(FULLB) + require(all(contains(A, B) for A, B in zip(seq, seq[1:])), 'role chain nesting %d' % s) + require(all(nondeg(B) for B in seq[1:-1] if B), 'degenerate frame on role %d' % s) + chain_dims.append([len(reduce(B)) for B in seq]) + for s, X in placed.items(): + require(contains(X, F0(s)) and nondeg(X), 'deferral frame %d' % s) + require(all(not any(dot(xv, tmask[t]) for xv in X) for t in reach[s]), 'target frame %d' % s) + byT2 = defaultdict(list) + for s in deferred: + for t in reach[s]: byT2[t].append(s) + for t, ss in byT2.items(): + ss.sort(key=lambda s: (len(placed[s]), s)) + require(all(contains(placed[p], placed[q_]) for p, q_ in zip(ss, ss[1:])), 'target chain %d' % t) + + # ------------------------------------------------------------ E. one-child histogram + z = Counter() + for s in range(Rr): + ds = chain_dims[s] + for a, b in zip(ds[:-1], ds[1:-1]): + if b > a: z[b - a] += 2 * v + lastd = ds[-2] + if s in role_root and kind[role_root[s]]: z[h - 1] += 2 * v # copied centre transform + z[h - lastd] += 2 * v # final growth to F + z[m - h + ds[0]] += 2 * v # exterior, gauged by sigma + levels = defaultdict(set) + for s in deferred: + for t in reach[s]: levels[t].add(len(placed[s])) + for t in range(v): + ds = sorted(levels[t] | {0, h - 1}) + for a, b in zip(ds, ds[1:]): z[b - a] += 2 * v # target fronts + z[h - 1] += 2 * N # data-wire fronts + z[(h - 1) ** 2] += 2 * N # data macros + z[1] += N # endpoint copies + z.pop(0, None) + W = 2 * N + 2 * v * R; L = 2 * v * h * (h - 1); s_ = W * m - N + L + require(sum(t * c for t, c in z.items()) == s_, 'complex rank mass') + require(all(0 < t < m for t in z), 'children below m') + out = dict(h=h, v=v, additions=c_add, roots=q, links=len(links), R=R, m=m, N=N, W=W, L=L, total_rank=s_, + deficit=N - L, maxchild=max(z), phase_one_ops=len(Anc), phase_one_roles=len(touched), + deferred_roles=len(deferred), + deferred_dims=dict(sorted(Counter(len(X) for X in placed.values()).items())), + lifted_additions=sum(1 for x in U if args[x][0] and dimU[x] > ranks[x]), + replay=dict(seeds=[1, 2], scratch_restored=True, y_plus_x=True, field='Z/(2^61-1)'), + child_multiplicities=dict(sorted(z.items()))) + (HERE / 'complex-profile.json').write_text(json.dumps(out, indent=1) + '\n') + print('PASS complex: R=%d, deferred roles %d, maxchild %d, rank mass %d' % (R, len(deferred), max(z), s_)) + + +if __name__ == '__main__': + main() diff --git a/research/cyclic-deferred/inputs/complex-dag.json.gz b/research/cyclic-deferred/inputs/complex-dag.json.gz new file mode 100644 index 0000000000..a5b0598e4c Binary files /dev/null and b/research/cyclic-deferred/inputs/complex-dag.json.gz differ diff --git a/research/cyclic-deferred/inputs/deferred_23.json.gz b/research/cyclic-deferred/inputs/deferred_23.json.gz new file mode 100644 index 0000000000..4a4431bd42 Binary files /dev/null and b/research/cyclic-deferred/inputs/deferred_23.json.gz differ diff --git a/research/cyclic-deferred/inputs/witness_23.json.gz b/research/cyclic-deferred/inputs/witness_23.json.gz new file mode 100644 index 0000000000..3d86f83b87 Binary files /dev/null and b/research/cyclic-deferred/inputs/witness_23.json.gz differ diff --git a/research/cyclic-deferred/producer.py b/research/cyclic-deferred/producer.py new file mode 100644 index 0000000000..a93a265f01 --- /dev/null +++ b/research/cyclic-deferred/producer.py @@ -0,0 +1,17 @@ +"""Pinned PR117 scalar DAG adapter for the saturated deferred compiler. + +The searched graph is upstream PR117 work credited to eumemic with Anthropic +Claude assistance. This adapter preserves that witness and producer unchanged; +saturation integration is separate OpenAI Codex-assisted work. Apache-2.0. +""" +from hashlib import sha256 +from pathlib import Path +from replayed_producer import build as replayed_build + +WITNESS_SHA256 = '3c034d0aae388ef567a454826f4f48b26fd8a94c71e8ffed4835271b349a783b' + +def build(h, prefix, central_disjoint, base=2): + assert (h, central_disjoint, base) == (24,24,2) + witness=Path(__file__).resolve().parent/'inputs/complex-dag.json.gz' + assert sha256(witness.read_bytes()).hexdigest() == WITNESS_SHA256, 'PR117 DAG pin mismatch' + return replayed_build(witness,prefix) diff --git a/research/cyclic-deferred/reflection-audit.json b/research/cyclic-deferred/reflection-audit.json new file mode 100644 index 0000000000..fa47286d5c --- /dev/null +++ b/research/cyclic-deferred/reflection-audit.json @@ -0,0 +1,82 @@ +{ + "R": 28705, + "all_frames_nondegenerate": true, + "audit_sha256": "6761fb01f93ef89f2455388b2f5a71f19c0bbd870e6aaeba457ede0a949a163b", + "bounded_chunk_coefficients": true, + "bounded_readout_chunks_sha256": "bb2ad510e5f5113eba2fd520f99bb05725087ae47e1566b7e63eafdefc69d809", + "child_multiplicities": { + "1": 339934848, + "10": 9500656, + "11": 9456128, + "12": 15430976, + "13": 10949840, + "14": 1384416, + "15": 1275120, + "16": 793408, + "17": 506000, + "18": 2902416, + "19": 2092816, + "2": 358859248, + "20": 817696, + "21": 1230592, + "22": 64768, + "23": 8363168, + "3": 36626304, + "4": 66512688, + "5": 30258800, + "529": 8193152, + "552": 97147952, + "554": 3493424, + "556": 1445136, + "558": 2319504, + "560": 582912, + "562": 101200, + "564": 1307504, + "566": 975568, + "568": 1364176, + "569": 4048, + "570": 3643200, + "571": 2440944, + "572": 841984, + "573": 44528, + "574": 485760, + "6": 17062320, + "7": 14240864, + "8": 23757712, + "9": 6290592 + }, + "conservative_local_G": 14907958248, + "exact_arbitrary_dirty_cancellation_by_dependency_cut": true, + "exact_chunk_reconstruction": true, + "exact_fresh_source_map": true, + "exact_integer_old_readout_transpose": true, + "expanded_old_readout_additions": 11862944, + "expanded_scalar_operations_per_stage": 12160614, + "forward_incidence_sha256": "0b3b7f245d07a0abdcee17a1a9c5b274825b580200b96ecd92a219603a83ef73", + "h": 24, + "largest_bounded_chunk_numerator_over_42": 42, + "largest_readout_numerator_over_42": 55, + "literal_frame_incidences_both_directions": true, + "literal_global_scalar_groups": 49230262048, + "old_readout_coefficients_over_42_sha256": "e0666f81e1d35e002d61b8f2b2b1ca0d1d79cc7fbcbc76063eb333294d875e5e", + "reflected_incidence_sha256": "4ce691dd835c9c8f7fa5651a212b239acf0d5c4962d5d4335ac48fe9d1956491", + "reflected_residual_rank_histogram_equal": true, + "reflected_scalar_map": "X becomes X-Y; Y unchanged; all auxiliary coordinates restored.", + "reflected_word_rule": "Reverse literal order including each bounded readout chunk, negate every shear, swap X/Y ports, complement every frame; auxiliary bank is separate.", + "rejected_controls": [ + "oversized-readout-chunk", + "split-readout-sum", + "reflected-chunk-order", + "inverse-sign", + "uncomplemented-frame", + "signed-root-readout" + ], + "scalar_readout_normalization": "Each exact numerator n/42 becomes signed42 chunks plus a signed remainder. Exact reconstruction and chunk magnitude<=1 checked; every same-frame shear is charged; reflection reverses chunk order.", + "scope": "Exact finite source coefficients, dirty cancellation algebra and literal reflected frame/charge ledger. Copied-centre transforms, endpoint correction and residual-to-child/all-size transfer retain their stated inherited contracts.", + "source_sha256": "f22a077d26819587b061f7dbd77a0b8fe329fe78ad54cc0c1e366ca5901c7298", + "split_readout_macros": 32, + "two_stage_scalar_map": "(X,Y) becomes (-Y,X+Y) before inherited endpoint correction.", + "unsplit_old_readout_macros": 11862912, + "v": 2024, + "word_blocks": 277775 +} diff --git a/research/cyclic-deferred/reflection_audit.py b/research/cyclic-deferred/reflection_audit.py new file mode 100644 index 0000000000..9da639268b --- /dev/null +++ b/research/cyclic-deferred/reflection_audit.py @@ -0,0 +1,365 @@ +#!/usr/bin/env python3 +"""Literal inverse/reflection and exact finite scalar/frame audit. + +Captures an unchanged deferred producer before its output write, then checks +the scalar computation on every source symbol, the exact signed old-readout +transpose, the dependency cut and the complete complemented incidence ledger. +This is finite verification; the inherited residual-to-child implementation, +all-size transfer and analytic interfaces are not proved by this script. +""" +import ast +from collections import Counter +from functools import lru_cache +from hashlib import sha256 +from itertools import combinations +import argparse,json,pickle,struct,sys +from pathlib import Path +sys.dont_write_bytecode=True +assert not sys.flags.optimize,'Assertions must remain enabled' + + +def capture(source): + source=Path(source).resolve();sys.path.insert(0,str(source.parent)) + tree=ast.parse(source.read_text(),filename=str(source)) + main=next(n for n in tree.body if isinstance(n,ast.FunctionDef) and n.name=='main') + at=next(i for i,n in enumerate(main.body) if isinstance(n,ast.Expr) and isinstance(n.value,ast.Call) and isinstance(n.value.func,ast.Attribute) and n.value.func.attr=='write_text') + main.body[at:]=[ast.Return(ast.Call(ast.Name('locals',ast.Load()),[],[]))] + ast.fix_missing_locations(tree) + ns={'__file__':str(source),'__name__':'reflection_capture'} + exec(compile(tree,str(source)+' [read-only capture]','exec'),ns) + data=ns['main']();data['source']=str(source);return data + + +def basis(vectors): + piv={} + for x in vectors: + for p in sorted(piv,reverse=True): + if x>>p&1:x^=piv[p] + if x: + p=x.bit_length()-1 + for q in piv: + if piv[q]>>p&1:piv[q]^=x + piv[p]=x + return tuple(piv[p] for p in sorted(piv,reverse=True)) + + +def dot(a,b):return (a&b).bit_count()&1 + + +@lru_cache(None) +def contained(A,B):return len(basis(A+B))==len(B) + + +@lru_cache(None) +def complement(A,h): + A=basis(A);piv={x.bit_length()-1:x for x in A};result=[] + for j in range(h): + if j not in piv: + x=1<>j&1:x|=1<

=0 else -1 + parts=(sign*42,)*q+((sign*r,) if r else ()) + check_chunks(numerator,parts) + return parts + +def reverse_row(row): + if row[0]=='old':return (row[0],row[1],row[3],row[2]) + return row + + +def check_reflection(forward,backward,h,v): + def bank(s):return s+v if s1) + readcount+=len(parts);maxchunk=max(maxchunk,max(map(abs,parts))) + for part in parts: + reached.append(t);records.append(struct.pack('len(old):hist[len(F)-len(old)]+=1 + current[s]=F + for event in events: + k,a,b,c,F,*rest=event + assert c in (-1,1) + promote(a,F) + if k=='gate':promote(b,F);scalar+=1 + elif k=='read': + for t in b:promote(t,F) + scalar+=len(b) + else: + assert k=='centre';G=rest[0] + assert contained(G,F) or contained(F,G) + assert nondeg(G);copies[abs(len(F)-len(G))]+=1 + for t in b:promote(t,G) + scalar+=len(b)+2 # temporary copy and erasure + digest.update(repr(event).encode()+b'\n') + # Each literal role cleanup reaches full space; any unused final + # endpoint is still represented explicitly in the expected chain. + for s,F in enumerate(expected):promote(s,F) + assert current==expected + return hist,copies,scalar,digest.hexdigest() + start=tm+[ZERO]*v+[sigma.get(s,ZERO) for s in range(R)] + finish=[FULL]*v+[complement(T,h) for T in tm]+[FULL]*R + H,C,scalar,digest=framescan(word,start,finish) + revstart=[None]*len(start);revfinish=[None]*len(start) + for s in range(len(start)): + revstart[swap(s)]=complement(finish[s],h);revfinish[swap(s)]=complement(start[s],h) + HR,CR,scalarR,reverse_digest=framescan(reverse,revstart,revfinish) + assert (H,C,scalar)==(HR,CR,scalarR) + z=Counter({r:2*v*n for r,n in (H+C).items()}) + for s in range(R):z[h*h-h+len(sigma.get(s,ZERO))]+=2*v + z[(h-1)**2]+=2*v*v;z[1]+=v*v + z.pop(0,None) + assert dict(sorted(z.items()))=={int(r):n for r,n in d['out']['child_multiplicities'].items()},'Literal reflected child histogram' + assert sum(r*n for r,n in z.items())==d['out']['total_rank'] + G=v*v+2*v*scalar + safe=8*(d['c_add']+2*R+(R+q)*v*(h+1)+h*h+h+1) if 'c_add' in d else 8*(d['out']['additions']+2*R+(R+q)*v*(h+1)+h*h+h+1) + assert safe>=scalar + return dict(h=h,v=v,R=R,exact_fresh_source_map=True,exact_integer_old_readout_transpose=True, + exact_arbitrary_dirty_cancellation_by_dependency_cut=True, + reflected_word_rule='Reverse literal order including each bounded readout chunk, negate every shear, swap X/Y ports, complement every frame; auxiliary bank is separate.', + reflected_scalar_map='X becomes X-Y; Y unchanged; all auxiliary coordinates restored.', + two_stage_scalar_map='(X,Y) becomes (-Y,X+Y) before inherited endpoint correction.', + literal_frame_incidences_both_directions=True,all_frames_nondegenerate=True, + reflected_residual_rank_histogram_equal=True,child_multiplicities=dict(sorted(z.items())), + word_blocks=len(word),expanded_scalar_operations_per_stage=scalar, + expanded_old_readout_additions=readcount,largest_readout_numerator_over_42=maxcoef, + unsplit_old_readout_macros=unsplit_readcount,split_readout_macros=split_macros, + largest_bounded_chunk_numerator_over_42=maxchunk, + bounded_readout_chunks_sha256=chunk_digest.hexdigest(), + scalar_readout_normalization='Each exact numerator n/42 becomes signed42 chunks plus a signed remainder. Exact reconstruction and chunk magnitude<=1 checked; every same-frame shear is charged; reflection reverses chunk order.', + exact_chunk_reconstruction=True,bounded_chunk_coefficients=True, + old_readout_coefficients_over_42_sha256=coefficient_digest.hexdigest(), + literal_global_scalar_groups=G,conservative_local_G=safe, + forward_incidence_sha256=digest,reflected_incidence_sha256=reverse_digest, + rejected_controls=rejected, + scope='Exact finite source coefficients, dirty cancellation algebra and literal reflected frame/charge ledger. Copied-centre transforms, endpoint correction and residual-to-child/all-size transfer retain their stated inherited contracts.') + + +def main(): + ap=argparse.ArgumentParser();ap.add_argument('--source',type=Path);ap.add_argument('--state',type=Path) + ap.add_argument('--output',type=Path);ap.add_argument('--check',type=Path);a=ap.parse_args() + assert bool(a.source)!=bool(a.state) + d=capture(a.source) if a.source else pickle.loads(a.state.read_bytes()) + result=audit(d);source=Path(d['source']) + result['source_sha256']=sha256(source.read_bytes()).hexdigest() + result['audit_sha256']=sha256(Path(__file__).read_bytes()).hexdigest() + result=json.loads(json.dumps(result));encoded=json.dumps(result,indent=2,sort_keys=True)+'\n' + if a.check:assert result==json.loads(a.check.read_text()) + if a.output:a.output.write_text(encoded) + else:print(encoded,end='') + print('PASS exact scalar and literal complement reflection audit',file=sys.stderr) + + +if __name__=='__main__':main() diff --git a/research/cyclic-deferred/replayed_producer.py b/research/cyclic-deferred/replayed_producer.py new file mode 100644 index 0000000000..673fbbba70 --- /dev/null +++ b/research/cyclic-deferred/replayed_producer.py @@ -0,0 +1,179 @@ +"""Replayed h=24 complex producer with all centers disjoint (rational divisor 21). + +Copyright 2026 eumemic, Apache-2.0. AI-assisted (Claude). The DAG was found by an +automated search over producers of the retained paired-triple, pair-star and +center-disjoint interfaces. The checks below are adapted from +stopped_product/complex.py (copyright 2026 icekylinx, Apache-2.0, PR #104). + +The witness complex-dag.json.gz lists the ordinary +additions after the v triple inputs and the retained roots: the disjoint sums +D[t], the pair stars P(a,b,i) and the center-disjoint sums A_i. Every support, +core, cover, type and rank is recomputed here from the operands; nothing is +read from the witness except the operand pairs and the root indices. +""" +import gzip, json, struct, sys, array +from fractions import Fraction +from itertools import combinations +from pathlib import Path + + +def write_array(f, values): + """Little-endian array writer, as partial_swap.binary.write_array.""" + if sys.byteorder != 'little' and values.itemsize > 1: + values = array.array(values.typecode, values) + values.byteswap() + values.tofile(f) + + +def build(witness, prefix): + w = json.loads(gzip.decompress(Path(witness).read_bytes())) + h, v, d = w['h'], w['v'], w['central_disjoint'] + assert (h, d, w['center_denominator']) == (24, 24, 21) + triples = list(combinations(range(h), 3)) + assert v == len(triples) + args = [(0, 0)]; support = [0]; core = [0]; cover = [0]; types = [0]; ranks = [0] + for j, t in enumerate(triples): + mask = sum(1 << a for a in t) + args.append((0, 0)); support.append(1 << j); core.append(mask); cover.append(mask) + types.append(1); ranks.append(1) + flat = w['args'] + assert len(flat) % 2 == 0 + for k in range(0, len(flat), 2): + a, b, x = flat[k], flat[k+1], len(args) + assert 0 < a < x and 0 < b < x, 'Operands must precede their sum' + assert not support[a] & support[b], 'Ordinary additions must be cancellation-free' + args.append((a, b)); support.append(support[a] | support[b]) + core.append(core[a] & core[b]); cover.append(cover[a] | cover[b]) + if core[x].bit_count() >= 2: + types.append(1); ranks.append(support[x].bit_count()) + else: + types.append(2); ranks.append(cover[x].bit_count()) + n = len(args) + point_masks = [sum(1 << j for j, t in enumerate(triples) if a in t) for a in range(h)] + full_support = (1 << v) - 1 + roots, kind = [], [] + assert len(w['D']) == v + for t, node in zip(triples, w['D']): + assert 0 < node < n + assert support[node] == full_support & ~(point_masks[t[0]]|point_masks[t[1]]|point_masks[t[2]]) + target_mask = sum(1 << a for a in t) + if types[node] == 2: + assert not cover[node] & target_mask + else: + assert types[node] == 1 + assert not support[node] & (point_masks[t[0]]^point_masks[t[1]]^point_masks[t[2]]) + roots.append(node); kind.append(0) + stars = [(a, b, i) for a, b in combinations(range(h), 2) for i in range(h) if i not in (a, b)] + assert len(w['P']) == len(stars) + pair_outputs = {} + for (a, b, i), node in zip(stars, w['P']): + assert 0 < node < n + assert support[node] == point_masks[a] & point_masks[b] & ~point_masks[i] + assert types[node] == 1 + assert not support[node] & (point_masks[a]^point_masks[b]^point_masks[i]) + pair_outputs[a, b, i] = node + roots.append(node); kind.append(0) + assert len(w['A']) == d + for i, node in enumerate(w['A']): + assert 0 < node < n + assert support[node] == full_support & ~point_masks[i] + assert types[node] == 2 and cover[node] == ((1 << h)-1) ^ (1 << i) + assert ranks[node] == h-1 + roots.append(node); kind.append(1) + # Every A_i avoids i, so sum A_i = (h-3)T. The decoder is T=sum A_i/21 + # and the scatter is T-(1/2)sum_{i in target} A_i. + decoder = Fraction(1, h-3) + assert decoder == Fraction(1, 21) + scatter_coefficients = [decoder, decoder-Fraction(1, 2)] + for coefficient in scatter_coefficients: + odd_denominator = coefficient.denominator + while odd_denominator % 2 == 0: + odd_denominator //= 2 + assert 21 % odd_denominator == 0 and abs(coefficient) <= 1 + for source in triples: + assert sum(i not in source for i in range(h))*decoder == 1 + Dset = set(range(d)) + for triple in triples: + k = len(Dset.intersection(triple)) + assert 2*(3-k)-2*(d-k) == 2*(3-d) + patterns = {} + for target in triples: + chosen = len(Dset.intersection(target)) + if chosen not in patterns: + patterns[chosen] = target + for chosen, target in patterns.items(): + target_set = set(target) + for source in triples: + k = len(Dset.intersection(source)) + total_coefficient = Fraction(2*(3-k)-2*(d-k), 2*(3-d)) + scalar = Fraction(len((target_set-Dset).intersection(source)), 2) + scalar -= Fraction(len((target_set & Dset)-set(source)), 2) + scalar += Fraction(chosen-1, 2)*total_coefficient + assert scalar == Fraction(len(target_set.intersection(source))-1, 2) + for j, t in enumerate(triples): + masks = [point_masks[a] for a in t] + two = (masks[0]&masks[1]&~masks[2]) | (masks[0]&masks[2]&~masks[1]) | (masks[1]&masks[2]&~masks[0]) + actual = 0 + for a, b in combinations(t, 2): + excluded = next(i for i in t if i not in (a, b)) + actual |= support[pair_outputs[a, b, excluded]] + assert actual == two + assert masks[0]&masks[1]&masks[2] == 1 << j + assert [((k-1)+(k == 0)-(k == 2)) for k in range(4)] == [0, 0, 0, 2] + + def contained(x, y): + tx, ty = types[x], types[y] + if tx == 1 and ty == 1: return not(core[y]&~core[x] or cover[x]&~cover[y]) + if tx in (1, 2) and ty == 2: return not cover[x]&~cover[y] + return False + active = [0]*n; stack = list(roots) + while stack: + x = stack.pop() + if not x or active[x]: continue + active[x] = 1 + if args[x][0]: stack.extend(args[x]) + degree = [0]*n + for x in range(1, n): + if active[x]: + if types[x] == 1: + assert core[x].bit_count() >= 2 and ranks[x] == support[x].bit_count() + else: + assert types[x] == 2 and ranks[x] == cover[x].bit_count() + if active[x] and args[x][0]: + for y in args[x]: + assert y < x and contained(y, x), 'Binary frame nesting failed' + degree[y] += 1 + for x in roots: degree[x] += 1 + H = [0]*(h+1); c = 0; loss = 0 + for x in range(1, n): + if not active[x]: continue + r = ranks[x] + if args[x][0]: + c += 1; H[r] += degree[x]-1; H[h-r] += 1 + for y in args[x]: + assert r >= ranks[y] + H[r-ranks[y]] += 1 + else: H[1] += degree[x] + for x, k in zip(roots, kind): + r = ranks[x] + if k: H[r] += 1; H[h] += 1; loss += r + else: H[h-1-r] += 1; H[1] += 1 + q = len(roots); R = c+q + result = dict(h=h, v=v, c=c, q=q, R=R, loss=loss, central_disjoint=d, histogram=H, + rank_sum=sum(r*m for r, m in enumerate(H))) + assert loss == h*(h-1) and result['rank_sum'] == h*R+2*loss + result['center_denominator'] = 21 + result['scalar_validation'] = dict(ordinary_supports_exact=True, centers_exact=True, + center_decoder='sum A_i / 21', scatter_coefficients=list(map(str, scatter_coefficients)), + rational_scalar_identity_exact=True, mixed_center_scatter_exact=True, binary_frames_nested=True, + binary_frames_nondegenerate=True) + with open(str(prefix)+'.bin', 'wb') as f: + f.write(struct.pack('<4I', h, v, n, q)) + write_array(f, array.array('I', (a for pair in args for a in pair))) + write_array(f, array.array('Q', core)); write_array(f, array.array('Q', cover)) + write_array(f, array.array('I', roots)); write_array(f, array.array('I', kind)) + write_array(f, array.array('B', active)) + with open(str(prefix)+'.labels', 'wb') as f: + write_array(f, array.array('I', ranks)); write_array(f, array.array('B', types)) + Path(str(prefix)+'.json').write_text(json.dumps(result, indent=2)+'\n') + return result diff --git a/research/cyclic-deferred/test_controls.py b/research/cyclic-deferred/test_controls.py new file mode 100644 index 0000000000..5d48c88ffd --- /dev/null +++ b/research/cyclic-deferred/test_controls.py @@ -0,0 +1,171 @@ +#!/usr/bin/env python3 +"""Negative controls for the cyclic/deferred frozen finite witness. + +These controls target source omissions, altered inputs, paid rank accounting, +noncontracting children and invalid exact arithmetic. They do not substitute +for the full producer and literal reflection checks. Prepared for eumemic with +OpenAI Codex assistance; Apache-2.0, inherited notices retained. +""" +import sys +sys.dont_write_bytecode = True +if sys.flags.optimize: + raise ValueError('Negative controls require assertions') + +import argparse +import copy +import gzip +import importlib.util +import json +from pathlib import Path +import shutil +import subprocess +import tempfile +import unittest + +from verify import check_sources, compare_json, digest, safe_file, validate_profile + +HERE = Path(__file__).resolve().parent +REPOSITORY = HERE.parents[1] + + +class FrozenControls(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.manifest = check_sources(HERE, REPOSITORY) + cls.profiles = {label: json.loads((HERE / (label + '-profile.json')).read_text()) + for label in ('bit', 'complex')} + sys.path.insert(0, str(REPOSITORY / 'scripts')) + spec = importlib.util.spec_from_file_location('checked_cyclic_certificate', HERE / 'certificate.py') + cls.certificate = importlib.util.module_from_spec(spec) + spec.loader.exec_module(cls.certificate) + cls.certificate.ROOT = REPOSITORY + + def test_all_frozen_profiles_satisfy_physical_ledgers(self): + for label, profile in self.profiles.items(): + validate_profile(profile, label) + + def test_frozen_exact_certificate_recomputed(self): + expected = json.loads((HERE / 'certificate.json').read_text()) + actual = self.certificate.js(self.certificate.exact()) + self.assertEqual(actual, expected) + + def test_omitted_endpoint_charge_rejected(self): + for label, original in self.profiles.items(): + changed = copy.deepcopy(original) + changed['child_multiplicities']['1'] -= changed['N'] + with self.assertRaisesRegex(ValueError, 'rank mass'): + validate_profile(changed, label) + + def test_nonshrinking_recursive_child_rejected(self): + for label, original in self.profiles.items(): + changed = copy.deepcopy(original) + changed['child_multiplicities'][str(changed['m'])] = 1 + with self.assertRaisesRegex(ValueError, 'recursive child'): + validate_profile(changed, label) + + def test_understated_role_count_rejected(self): + changed = copy.deepcopy(self.profiles['complex']) + changed['R'] -= 1 + with self.assertRaisesRegex(ValueError, 'physical ledger'): + validate_profile(changed, 'complex') + + def test_overstated_matching_rejected(self): + changed = copy.deepcopy(self.profiles['complex']) + changed['links'] += 1 + with self.assertRaisesRegex(ValueError, 'matching role ledger'): + validate_profile(changed, 'complex') + + def test_missing_transitive_dependency_rejected(self): + changed = copy.deepcopy(self.manifest) + del changed['repository_files']['scripts/exclusion_circuit.py'] + with self.assertRaisesRegex(ValueError, 'dependency closure'): + check_sources(HERE, REPOSITORY, changed) + + def test_omitted_physical_input_rejected(self): + changed = copy.deepcopy(self.manifest) + del changed['package_files']['inputs/deferred_23.json.gz'] + with self.assertRaisesRegex(ValueError, 'finite-input closure'): + check_sources(HERE, REPOSITORY, changed) + + def test_changed_input_digest_rejected(self): + changed = copy.deepcopy(self.manifest) + changed['package_files']['inputs/witness_23.json.gz'] = '0' * 64 + with self.assertRaisesRegex(ValueError, 'hash mismatch'): + check_sources(HERE, REPOSITORY, changed) + + def test_omitted_pinned_complex_dag_rejected(self): + changed = copy.deepcopy(self.manifest) + del changed['package_files']['inputs/complex-dag.json.gz'] + with self.assertRaisesRegex(ValueError, 'finite-input closure'): + check_sources(HERE, REPOSITORY, changed) + + def test_changed_complex_dag_digest_rejected(self): + with tempfile.TemporaryDirectory(prefix='cyclic-deferred-altered-dag-') as directory: + package = Path(directory) + for name in self.manifest['package_files']: + target = package / name + target.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(HERE / name, target) + name = 'inputs/complex-dag.json.gz' + path = package / name + graph = json.loads(gzip.decompress(path.read_bytes())) + graph['args'][0] = graph['args'][1] + path.write_bytes(gzip.compress(json.dumps(graph).encode(), mtime=0)) + with self.assertRaisesRegex(ValueError, 'hash mismatch'): + check_sources(package, REPOSITORY, self.manifest) + # Rehashing a substituted DAG must not erase its immutable provenance. + changed = copy.deepcopy(self.manifest) + changed['package_files'][name] = digest(path) + with self.assertRaisesRegex(ValueError, 'scalar-DAG provenance digest mismatch'): + check_sources(package, REPOSITORY, changed) + + def test_replayed_complex_dag_rejects_duplicated_operand(self): + from replayed_producer import build + with tempfile.TemporaryDirectory(prefix='cyclic-deferred-invalid-dag-') as directory: + graph = json.loads(gzip.decompress((HERE / 'inputs/complex-dag.json.gz').read_bytes())) + graph['args'][0] = graph['args'][1] + path = Path(directory) / 'invalid.json.gz' + path.write_bytes(gzip.compress(json.dumps(graph).encode(), mtime=0)) + with self.assertRaisesRegex(AssertionError, 'cancellation-free'): + build(path, Path(directory) / 'invalid-producer') + + def test_manifest_parent_escape_rejected(self): + with self.assertRaisesRegex(ValueError, 'Unsafe manifest path'): + safe_file(HERE, '../certificate.json') + + def test_changed_regenerated_profile_rejected(self): + with tempfile.TemporaryDirectory(prefix='cyclic-deferred-negative-') as directory: + changed = copy.deepcopy(self.profiles['complex']) + changed['child_multiplicities']['1'] += 1 + path = Path(directory) / 'changed.json' + path.write_text(json.dumps(changed)) + with self.assertRaisesRegex(ValueError, 'Frozen generated record mismatch'): + compare_json(path, HERE / 'complex-profile.json') + + def test_next_bit_and_complex_grid_points_rejected(self): + from fractions import Fraction as Q + module = self.certificate + self.assertFalse(module.contracts(module.profile('bit-profile.json'), module.COARSE + Q(1, 10**10))) + self.assertFalse(module.contracts(module.profile('complex-profile.json'), module.COMPLEX + Q(1, 10**12))) + + def test_optimized_verifier_rejected_before_any_regeneration(self): + result = subprocess.run([sys.executable, '-O', str(HERE / 'verify.py')], + capture_output=True, text=True) + self.assertNotEqual(result.returncode, 0) + self.assertIn('optimized Python is forbidden', result.stderr) + + +def main(): + global REPOSITORY + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--repository-root', type=Path, default=REPOSITORY) + args = parser.parse_args() + REPOSITORY = args.repository_root.resolve() + suite = unittest.defaultTestLoader.loadTestsFromTestCase(FrozenControls) + result = unittest.TextTestRunner(verbosity=2).run(suite) + if not result.wasSuccessful(): + raise SystemExit(1) + + +if __name__ == '__main__': + main() diff --git a/research/cyclic-deferred/verify.py b/research/cyclic-deferred/verify.py new file mode 100644 index 0000000000..879f8a363a --- /dev/null +++ b/research/cyclic-deferred/verify.py @@ -0,0 +1,252 @@ +#!/usr/bin/env python3 +"""Read-only verification of the frozen cyclic/deferred finite package. + +Regeneration occurs only in a temporary repository-shaped copy. Source hashes, +complete profile ledgers, the exact certificate, and the independent reflection +audit are required. General transfer proofs and the inherited round-seven bit +word/frame justification remain separate dependencies. Prepared for eumemic +with OpenAI Codex assistance; inherited authorship and licenses are retained. +""" +import sys +sys.dont_write_bytecode = True +if sys.flags.optimize: + raise ValueError('Verification requires assertions; optimized Python is forbidden') + +import argparse +import ast +from hashlib import sha256 +import json +from math import comb +import os +from pathlib import Path +import shutil +import subprocess +import tempfile + +HERE = Path(__file__).resolve().parent +COMPLEX_DAG_PIN = '3c034d0aae388ef567a454826f4f48b26fd8a94c71e8ffed4835271b349a783b' +BIT_PINS = { + 'witness_23.json.gz': 'b2486aa2bb222bacea6e52162a3920780e45dd8edc5d7cb03eabea336a1c6588', + 'deferred_23.json.gz': '8c38e947ff9e021e308000dd82bb5e2194eb265d8b75194e22ce783d3e75317c', +} +REQUIRED = { + 'verify.py', 'test_controls.py', 'producer.py', 'complex_deferred.py', + 'bit_round7.py', 'certificate.py', 'bit-profile.json', + 'complex-profile.json', 'certificate.json', 'replayed_producer.py', + 'inputs/complex-dag.json.gz', + *('inputs/' + name for name in BIT_PINS), +} +DATA_DEPENDENCIES = {'certificates/copied-centers-network.json'} + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def safe_file(directory, name): + relative = Path(name) + require(not relative.is_absolute() and '..' not in relative.parts, + 'Unsafe manifest path: ' + name) + path = (directory / relative).resolve() + require(path.is_relative_to(directory.resolve()) and path.is_file(), + 'Missing or escaping manifest file: ' + name) + return path + + +def digest(path): + return sha256(path.read_bytes()).hexdigest() + + +def dependency_closure(package, repository, package_scripts): + """Include every local Python import, including package __init__ modules. + + All package scripts are roots, also covering explicit importlib loading of + the producer and audited source. Only stdlib imports may be unresolved. + The sole external data read used by exact assembly is listed separately. + """ + pending = [package / name for name in package_scripts] + seen, dependencies = set(), set(DATA_DEPENDENCIES) + while pending: + path = pending.pop().resolve() + if path in seen: + continue + seen.add(path) + imports = [] + for node in ast.walk(ast.parse(path.read_text(), filename=str(path))): + if isinstance(node, ast.Import): + imports.extend((alias.name, 0) for alias in node.names) + elif isinstance(node, ast.ImportFrom) and node.module: + imports.append((node.module, node.level)) + for name, level in imports: + parts = name.split('.') + if not level and parts[0] in sys.stdlib_module_names: + continue + found = None + bases = ((path.parent.parents[level-2] if level > 1 else path.parent),) if level else (package, repository / 'scripts') + for base in bases: + module = base.joinpath(*parts) + for candidate in (module.with_suffix('.py'), module / '__init__.py'): + if candidate.is_file(): + found = candidate.resolve() + break + if found is not None: + pending.append(found) + if found.is_relative_to((repository / 'scripts').resolve()): + dependencies.add(str(found.relative_to(repository.resolve()))) + parent = found.parent + while parent != (repository / 'scripts').resolve(): + initializer = parent / '__init__.py' + if initializer.is_file(): + pending.append(initializer) + dependencies.add(str(initializer.relative_to(repository))) + parent = parent.parent + break + require(found is not None, 'Unpinned non-stdlib Python import: ' + name) + return dependencies + + +def create_manifest(package, repository, reflection_script, reflection_receipt): + scripts = sorted(path.name for path in package.glob('*.py')) + names = REQUIRED | set(scripts) | {reflection_script, reflection_receipt} + dependencies = dependency_closure(package, repository, scripts) + return dict( + schema=1, + scope='Frozen finite producer, profiles, exact assembly and reflection audit; inherited all-size transfer remains conditional.', + package_files={name: digest(safe_file(package, name)) for name in sorted(names)}, + repository_files={name: digest(safe_file(repository, name)) for name in sorted(dependencies)}, + reflection=dict(script=reflection_script, receipt=reflection_receipt), + provenance=dict( + base='https://github.com/CrocSwap/integer-mult-bounds/pull/110', + cyclic_strips='https://github.com/CrocSwap/integer-mult-bounds/pull/111', + scalar_dag=dict(pull_request='https://github.com/CrocSwap/integer-mult-bounds/pull/117', + commit='cbb05ce504d571546d9b7794c186a613c659c3bf', + file='inputs/complex-dag.json.gz', sha256=COMPLEX_DAG_PIN), + round7_repository='https://github.com/Swapnil-jain/integer-mult-kappa', + round7_commit='741e7aa078392553815df7926ee17ac5e25a8c38', + round7_sha256=BIT_PINS), + attribution='Avi Eisenberg / ikeboy (PR62 and PR110, Anthropic Claude assistance); Rohan Arun (PR111, Anthropic Claude assistance); Swapnil Jain (round-seven bit word); icekylinx (retained stopped-product, copied-center and finite assembly interfaces); Zhihao Chen and RaD (retained assembly). PR117 scalar DAG is separate upstream work by eumemic with Anthropic Claude assistance, retained byte for byte with its original attribution. Saturated deferred-frame integration and verification for eumemic with OpenAI Codex assistance. Original source notices remain authoritative.') + + +def check_sources(package, repository, manifest=None): + manifest = manifest or json.loads((package / 'SOURCE.json').read_text()) + require(manifest['schema'] == 1, 'Unsupported source-manifest schema') + names = set(manifest['package_files']) + reflection = manifest['reflection'] + require(REQUIRED | {reflection['script'], reflection['receipt']} <= names, + 'Incomplete package source/finite-input closure') + for collection, base in ((manifest['package_files'], package), + (manifest['repository_files'], repository)): + for name, expected in collection.items(): + require(digest(safe_file(base, name)) == expected, 'Source hash mismatch: ' + name) + scripts = sorted(name for name in names if name.endswith('.py')) + expected = dependency_closure(package, repository, scripts) + require(set(manifest['repository_files']) == expected, + 'Incomplete or stale transitive repository dependency closure') + for name, expected in BIT_PINS.items(): + require(manifest['package_files']['inputs/' + name] == expected, + 'Round-seven provenance digest mismatch: ' + name) + require(manifest['package_files']['inputs/complex-dag.json.gz'] == COMPLEX_DAG_PIN, + 'PR117 scalar-DAG provenance digest mismatch') + return manifest + + +def validate_profile(profile, label): + fields = ('h', 'v', 'R', 'm', 'N', 'W', 'L', 'total_rank', 'deficit', 'maxchild') + require(all(type(profile[key]) is int and profile[key] > 0 for key in fields), + label + ': nonpositive or noninteger ledger value') + h, v, R, m, N, W, L = (profile[key] for key in fields[:7]) + require(v == comb(h, 3) and m == h*h and N == v*v, label + ': dimensions') + require(W == 2*N + 2*v*R and L == 2*v*h*(h-1), label + ': physical ledger') + rows = {int(t): count for t, count in profile['child_multiplicities'].items()} + require(len(rows) == len(profile['child_multiplicities']), label + ': duplicate child widths') + require(all(0 < t < m and type(count) is int and count > 0 for t, count in rows.items()), + label + ': invalid recursive child') + require(sum(t*count for t, count in rows.items()) == profile['total_rank'] == W*m-N+L, + label + ': rank mass') + require(profile['deficit'] == N-L and profile['maxchild'] == max(rows), + label + ': deficit or maximum child') + require(rows.get((h-1)**2) == 2*N and rows.get(1, 0) >= N, + label + ': omitted data projector or endpoint charge') + if label == 'complex': + require(R == profile['additions']+profile['roots']-profile['links'], + 'complex: addition/roots/matching role ledger') + require(sum(profile['deferred_dims'].values()) == profile['deferred_roles'], + 'complex: deferral inventory') + return rows + + +def compare_json(actual, expected): + require(json.loads(actual.read_text()) == json.loads(expected.read_text()), + 'Frozen generated record mismatch: ' + expected.name) + + +def snapshot(package, repository, manifest): + return { + **{'package:' + n: digest(package / n) for n in manifest['package_files']}, + **{'repository:' + n: digest(repository / n) for n in manifest['repository_files']}, + 'manifest': digest(package / 'SOURCE.json'), + } + + +def verify(package, repository): + manifest = check_sources(package, repository) + before = snapshot(package, repository, manifest) + for label in ('bit', 'complex'): + validate_profile(json.loads((package / (label + '-profile.json')).read_text()), label) + environment = dict(os.environ, PYTHONDONTWRITEBYTECODE='1') + environment.pop('PYTHONPATH', None) + with tempfile.TemporaryDirectory(prefix='cyclic-deferred-verify-') as directory: + root = Path(directory) + target = root / 'research/cyclic-deferred' + for collection, source, destination in ( + (manifest['package_files'], package, target), + (manifest['repository_files'], repository, root)): + for name in collection: + out = destination / name + out.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(source / name, out) + shutil.copyfile(package / 'SOURCE.json', target / 'SOURCE.json') + + def run(script, *arguments): + subprocess.run([sys.executable, str(target / script), *map(str, arguments)], + cwd=root, env=environment, check=True) + + run('bit_round7.py', target / 'inputs') + compare_json(target / 'bit-profile.json', package / 'bit-profile.json') + print('PASS pinned round-seven bit ledger regenerated', flush=True) + run('complex_deferred.py') + compare_json(target / 'complex-profile.json', package / 'complex-profile.json') + print('PASS complete complex producer and deferred profile regenerated', flush=True) + run('certificate.py') + reflection = manifest['reflection'] + actual_reflection = root / 'actual-reflection.json' + run(reflection['script'], '--source', target / 'complex_deferred.py', + '--output', actual_reflection) + compare_json(actual_reflection, package / reflection['receipt']) + print('PASS independent literal reflection and scalar-charge audit', flush=True) + run('test_controls.py', '--repository-root', root) + require(snapshot(package, repository, manifest) == before, + 'Verification changed the frozen package or a dependency') + print('PASS read-only finite package verification; inherited transfer remains conditional', flush=True) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--repository-root', type=Path, default=HERE.parents[1]) + parser.add_argument('--freeze-manifest', action='store_true', + help='Explicit authoring operation: replace SOURCE.json from reviewed files') + parser.add_argument('--reflection-script', default='reflection_audit.py') + parser.add_argument('--reflection-receipt', default='reflection-audit.json') + args = parser.parse_args() + repository = args.repository_root.resolve() + if args.freeze_manifest: + manifest = create_manifest(HERE, repository, args.reflection_script, args.reflection_receipt) + (HERE / 'SOURCE.json').write_text(json.dumps(manifest, indent=2, sort_keys=True) + '\n') + print('Frozen source manifest; this operation does not certify the package') + else: + verify(HERE, repository) + + +if __name__ == '__main__': + main() diff --git a/research/deferred-stopped/PROOF.md b/research/deferred-stopped/PROOF.md new file mode 100644 index 0000000000..58237eccf0 --- /dev/null +++ b/research/deferred-stopped/PROOF.md @@ -0,0 +1,114 @@ +# Deferred readouts on both networks of the stopped product-ring interchange + +## 1. Claim + +Under every hypothesis that PR #104 retains, the stopped product-ring interchange with + +- the bit network replaced by Swapnil Jain's round-seven deferred word (h = 23), and +- PR #104's own complex network (h = 24) given lifted binary frames and deferred readouts, + +gives the conditional bound T(n) = O(n (log n)^(1-κ)) with + +κ = 429239/5000000000 = 8.58478 × 10^-5, + +which is +10.1% over PR #104 (7.79476 × 10^-5). The next κ grid point at denominator 10^10 is rejected. +This is a finite conditional certificate only. + +| | PR #104 | here | +|---|---|---| +| bit network | positive-label producer, R = 38,776 | Swapnil round seven, R = 28,866, 11,565 deferred slots | +| coarse bit saving | 4019/50000000 = 8.038e-5 | 620523/5000000000 = 1.241046e-4 | +| stopped bit saving | 8.034e-5 | 1.240190e-4 | +| complex network | aligned rational centres, R = 44,918 | same DAG and roles, lifted frames, 8,893 deferred roles | +| complex saving | 1949/25000000 = 7.796e-5 | 214657/2500000000 = 8.58628e-5 | +| κ | 7.79476e-5 | 8.58478e-5 | + +## 2. What changes + +Nothing in PR #104's interface changes: opposite-bank factorization, stopped atom recursion, ordinary +wrapper, rational centres, common odd grid, product rows and the balanced assembly are used as they are. +Two finite inputs change. + +**Bit network.** Swapnil Jain's round-seven witness (commit 741e7aa078392553815df7926ee17ac5e25a8c38, files pinned by SHA-256 in +`bit_round7.py`): PR #62's producer, lifted frames, late copies, deferred readouts and V leaves. Swapnil's own +checkers verify the word and every frame exactly, and PR #97 replays its forward and reflected ledgers. We do not +change it. Under PR #104's rule every residual of rank r is one child of width r, so the slot chains, the gauged +exteriors (width m - (h - dim σ_u)), the copied-centre transforms, the target and data-wire chains, the data +residuals and the endpoint copies give the child list in `bit-profile.json` (rank mass 57,403,754,177, the +value PR #97 reports). + +**Complex network.** PR #104's DAG (`scripts/stopped_product/complex.py`, unchanged) and its role count +R = c + q - |M| = 45,764 + 8,120 - 8,966 = 44,918. New: + +1. *Matching.* A maximum carrier matching under the inherited matcher's adjacency (order by rank and node, the + inherited label-inclusion rules), size 8,966. +2. *Roles.* An explicit compile: one role per free leaf use, the pivot continues each addition, copies serve the + other free uses, a linked operand stays on the non-pivot and continues to its linked use. +3. *Lifted frames.* For an addition n, U_n is the common kernel over F2 of the functionals of every root reachable + along slot successors (t_S for an output read into y_S, e_i for the retained centre A_i, whose frame is + span{e_j : j ≠ i}). Every label lies in its kernel (outputs have even intersection with their target; A_i + avoids i). The lift is used where U_n is nondegenerate and kept monotone along successors; elsewhere the + inherited label stays. 20,234 additions are lifted. +4. *Deferred readouts* (Swapnil's design B on the complex word). Phase one is the closure of the 24 centre + completions under per-role precedence. A role untouched by phase one, whose garbage does not reach a centre + (a centre scatters to every target), reads its garbage out at + σ_u ⊆ F0(u) ∩ ⋂ t_S^⊥ over its reached targets, nondegenerate. An insertion rule (largest first) shrinks each + new frame only as far as nesting on its targets requires. Readouts run in increasing (dim σ_u, role). + +The stage-one word is: readouts of the non-deferred roles at frame 0, early V gates, phase one, centre copies +read into their targets, deferred readouts in order, deferred V gates, the rest of L, output reads, L^-1, V^-1. +The readout coefficients come from the transpose sweep of L applied to the root reads (output reads ±1/2, centre +scatter 1/21 - [i ∈ S]/2); their only odd denominator is PR #104's 21. + +## 3. What is checked (`complex_deferred.py`) + +- **A.** Matching size 8,966 and R = 44,918. +- **B.** With zero scratch the compiled word computes every one of the 8,120 root values. +- **C.** The deferred word, replayed over Z/(2^61 - 1) with arbitrary scratch and data (two seeds), restores every + role and adds exactly x_S to every target. +- **D.** Exactly over F2: every role chain (start σ_u or 0, start frame, every gate, linked continuations, root + frame, F) is nested; every lifted and deferral frame is nondegenerate; every σ_u lies in its start frame and in + t_S^⊥ for each reached target; on every target the deferral frames are nested in readout order. +- **E.** The one-child histogram from the explicit role chains has total rank W m - N + L = 109,450,358,336, + every child is below m = 576 (the largest is 574). + +`certificate.py` recomputes both moments exactly with PR #104's routines, the stopped bit saving +(1 - 1/1000)·coarse + (1/1000)·384599/10^10, the finite bridge and the 47-constraint assembly. + +## 4. Endpoints, stage two and the bridge + +- *Endpoints.* A deferred auxiliary role starts at the gauge of σ_u and ends at the complementary gauge, so its + endpoint action is the identity shear on arbitrary inputs: the bit identity D_{I-P} D_P = D_I and its phase + analogue, the translated source C_{D_0} with sink C_I C_{D_0} of `notes/copied-centers-complex.tex` and + `notes/endpoint-gauge-complex.tex` (PR21/PR24). Its exterior residual has rank m - h + dim σ_u. +- *Stage two.* As in Swapnil's round seven and PR #104's two-stage counts, stage two is the complement time + reversal of stage one with the same edge multiset. PR #97 replays the reflected ledger for the bit word; for the + complex deferred word this is stated here, not machine-checked. +- *Bridge.* The larger children (bit 528 of 529, complex 574 of 576) raise the halving degrees to 367 and 200, + so the product-row stock becomes p^33000 (PR #104 used p^4000; PR29 p^47000). As in PR #104, the stock enters + only the row-product slack and the eventual cutoffs, not κ. The semantic induction 2B(m - r) ≥ s + E holds. + +## 5. Scope + +All of PR #104's inherited hypotheses remain: the opposite-bank factorization for every residual class in the +finite lists (including the new gauged exteriors, deferral starts and target levels on both networks, and the +binary one-child normal form on the complex side), atom streaming and the ordinary wrapper, the common exact grid, +routing, recovery, the fixed-tape transfer and the analytic interfaces. The stage-two statement above is the one +new written assumption for the complex network. No global optimality is claimed. + +## 6. Credits + +- **icekylinx**: PR #104's stopped product-ring interchange, opposite-bank factorization, rational centres and the + h = 24 complex producer used unchanged; PR #10/#18/#24/#32/#36 lineage. +- **Swapnil Jain**: deferred readouts (design B), V leaves, lifted frames, late copies and the round-seven bit + witness used unchanged (https://github.com/Swapnil-jain/integer-mult-kappa, commit + 741e7aa078392553815df7926ee17ac5e25a8c38). +- **Zhihao Chen (jacklightChen)**: PR #97's integration of the deferred bit word and its reflected ledgers; + PR21/PR29 translated gauges and two-stage accounting. +- **Aurel Prosz (Paureel)**: the two-stage topology and paid endpoint correction. +- All earlier authors credited in PR #104's NOTICE and SOURCES.json, including Avi Eisenberg/ikeboy (PR #53, #62, + whose producer is the round-seven bit DAG), RaD/hipotures, Rohan Arun, eumemic, Dominik Scholz, Chafik + Boukhalfa, James Chang and Douglas Colkitt. + +The complex deferral construction, its checks and this certificate were prepared by Avi Eisenberg (ikeboy) with +Anthropic Claude assistance. diff --git a/research/deferred-stopped/README.md b/research/deferred-stopped/README.md new file mode 100644 index 0000000000..a46910f4ed --- /dev/null +++ b/research/deferred-stopped/README.md @@ -0,0 +1,37 @@ +# Deferred readouts on both stopped networks + +Conditional κ = 429239/5000000000 = **8.58478 × 10^-5** (+10.1% over PR #104's 7.79476 × 10^-5). + +PR #104's stopped product-ring interchange compiles every projector residual of rank r as one child of width r. +Under that rule deferred readouts pay on both networks: + +- **bit**: Swapnil Jain's round-seven deferred word (h = 23), unchanged, gives a stopped saving of 1.2402 × 10^-4; +- **complex**: PR #104's h = 24 network, with lifted binary frames and deferred readouts on 8,893 of its 44,918 + roles, gives 214657/2500000000 = 8.58628 × 10^-5, which is now the binding side. + +See [PROOF.md](PROOF.md) for the construction, the checks and the inherited assumptions. + +## Reproduce + +From the repository root (standard-library Python 3; about two minutes): + +```sh +python3 research/deferred-stopped/complex_deferred.py +python3 research/deferred-stopped/bit_round7.py DIR +python3 research/deferred-stopped/certificate.py +``` + +`DIR` holds Swapnil's two round-seven files, `witness_23.json.gz` and `deferred_23.json.gz`, for example +`certificates/round7/` of https://github.com/Swapnil-jain/integer-mult-kappa at commit +`741e7aa078392553815df7926ee17ac5e25a8c38`, or PR #97's copy in `research/deferred-signed/swapnil-round7/`. +`bit_round7.py` checks both files against their SHA-256 pins. The three scripts write `complex-profile.json`, +`bit-profile.json` and `certificate.json`. + +## Files + +| file | content | +|---|---| +| `complex_deferred.py` | complex DAG (PR #104 producer), matching, roles, lifted frames, deferral, replay and exact F2 checks | +| `bit_round7.py` | one-child bit profile of the round-seven deferred word | +| `certificate.py` | exact moments, stopped bit saving, finite bridge, 47-constraint assembly, κ | +| `*-profile.json`, `certificate.json` | generated outputs | diff --git a/research/deferred-stopped/bit-profile.json b/research/deferred-stopped/bit-profile.json new file mode 100644 index 0000000000..36105e819a --- /dev/null +++ b/research/deferred-stopped/bit-profile.json @@ -0,0 +1,69 @@ +{ + "h": 23, + "v": 1771, + "R": 28866, + "m": 529, + "N": 3136441, + "W": 108516254, + "L": 1792252, + "total_rank": 57403754177, + "deficit": 1344189, + "maxchild": 528, + "deferred_slots": 11565, + "source": { + "repository": "https://github.com/Swapnil-jain/integer-mult-kappa", + "commit": "741e7aa078392553815df7926ee17ac5e25a8c38", + "sha256": { + "witness_23.json.gz": "b2486aa2bb222bacea6e52162a3920780e45dd8edc5d7cb03eabea336a1c6588", + "deferred_23.json.gz": "8c38e947ff9e021e308000dd82bb5e2194eb265d8b75194e22ce783d3e75317c" + } + }, + "child_multiplicities": { + "1": 239511811, + "2": 238288050, + "3": 53377940, + "4": 46970462, + "5": 23632224, + "6": 7409864, + "7": 4105178, + "8": 5755750, + "9": 2082696, + "10": 878416, + "11": 1388464, + "12": 1080310, + "13": 945714, + "14": 226688, + "15": 2451064, + "16": 1508892, + "17": 4771074, + "18": 2149994, + "19": 7367360, + "20": 8182020, + "21": 1466388, + "22": 88550, + "484": 6272882, + "506": 61280142, + "507": 545468, + "508": 173558, + "509": 293986, + "510": 580888, + "511": 14168, + "512": 322322, + "513": 17710, + "514": 1129898, + "515": 127512, + "516": 410872, + "517": 99176, + "518": 1186570, + "519": 340032, + "520": 322322, + "521": 106260, + "522": 1583274, + "523": 626934, + "524": 2854852, + "525": 13711082, + "526": 4629394, + "527": 5653032, + "528": 6233920 + } +} diff --git a/research/deferred-stopped/bit_round7.py b/research/deferred-stopped/bit_round7.py new file mode 100644 index 0000000000..56f972277b --- /dev/null +++ b/research/deferred-stopped/bit_round7.py @@ -0,0 +1,129 @@ +#!/usr/bin/env python3 +"""One-child bit profile of Swapnil Jain's round-seven deferred word (h=23), under PR104's opposite-bank rule. + +Reads the two frozen round-seven data files (not vendored; pinned by SHA-256 below) from a directory given on +the command line, e.g. a checkout of https://github.com/Swapnil-jain/integer-mult-kappa at +741e7aa078392553815df7926ee17ac5e25a8c38 (certificates/round7/), or PR97's imported copy +(research/deferred-signed/swapnil-round7/certificates/round7/). The frame dimensions are the ones recorded in +the data file; Swapnil's check_frames.py re-derives each of them exactly and PR97 replays the word. + +Every projector residual of rank r is one child of width r (PR104, notes/stopped-product-factorization.tex): + each slot: its chain steps from the deferral frame sigma_u to F, and one exterior child m - (h - dim sigma_u); + each retained centre: one copied transform of width h-1; + each target y_T: its chain 0 -> deferred readout levels -> t_T^perp; each data wire X_S: its chain of V frames; + each data pair: one data residual of width (h-1)^2 and one endpoint copy. +Usage: python3 research/deferred-stopped/bit_round7.py DIR (writes bit-profile.json next to this file) +Prepared by Avi Eisenberg (ikeboy) with Anthropic Claude assistance. Apache-2.0. +""" +import gzip +import hashlib +import json +import sys +from collections import Counter, defaultdict +from itertools import combinations +from pathlib import Path + +HERE = Path(__file__).resolve().parent +PINS = {'witness_23.json.gz': 'b2486aa2bb222bacea6e52162a3920780e45dd8edc5d7cb03eabea336a1c6588', + 'deferred_23.json.gz': '8c38e947ff9e021e308000dd82bb5e2194eb265d8b75194e22ce783d3e75317c'} + + +def require(ok, msg): + if not ok: + raise SystemExit('FAIL: ' + msg) + + +def main(directory): + data = {} + for name, digest in PINS.items(): + raw = (Path(directory) / name).read_bytes() + require(hashlib.sha256(raw).hexdigest() == digest, 'pinned hash of ' + name) + data[name] = json.loads(gzip.decompress(raw)) + W, D = data['witness_23.json.gz'], data['deferred_23.json.gz'] + h = D['h']; R = D['R']; trip = list(combinations(range(h), 3)); v = len(trip); m = h * h; N = v * v + tid = {T: i for i, T in enumerate(trip)} + args = {int(n): (tuple(a) if a else None) for n, a in W['args'].items()} + late = {int(n): (list(e), list(l)) for n, (e, l) in W['late'].items()} + ops = [tuple(o[:2]) + (tuple(o[2]),) if o[0] == 'fan' else tuple(o) for o in D['ops']] + hold, start = D['hold'], D['start'] + out = {s: (c, tuple(T)) for s, c, T in D['out']}; ret = {s: c for s, c in D['ret']} + sigma = dict(zip(D['readout_order'], D['sigma'])); sel = set(D['readout_order']) + f = [0] * R + for s, B in sigma.items(): f[s] = len(B) + vstart = dict(zip(D['vleaf_slots'], D['vleaf_start'])) + node_dims = {n: d for n, d in D['node_dims']} + late_dims = {(n, tuple(lt)): d for n, lt, d in D['late_dims']} + pivslot = {o[3]: o[1] for o in ops if o[0] == 'add'} + + def start_key(s): + n0 = hold[s][0] + if args[n0] is None: return ('v', s) + st = start[s]; k = st[2] if len(st) > 2 else None; dec = late.get(n0) + if dec is None or k in dec[0]: return ('n', n0) + lt = dec[1]; return ('c', n0, tuple(lt[lt.index(k):])) + + def chain(s): + ch = [('sigma', s) if s in sel else ('0',), start_key(s)] + for idx, n in enumerate(hold[s]): + if idx > 0: ch.append(('n', n)) + if args[n] is not None and pivslot.get(n) == s and n in late: + lt = late[n][1] + for i in range(len(lt) - 1): ch.append(('c', n, tuple(lt[i:]))) + if s in out: ch.append(('out',)) + if s in ret: ch.append(('ret',)) + ch.append(('F',)); return ch + + def dim(key): + k = key[0] + if k == '0': return 0 + if k == 'F': return h + if k in ('out', 'ret'): return h - 1 + if k == 'n': return node_dims[key[1]] + if k == 'c': return late_dims[key[1], key[2]] + if k == 'sigma': return f[key[1]] + if k == 'v': return len(vstart[key[1]]) + raise KeyError(key) + + # garbage supports (transpose sweep) for the deferred levels on each target + cov = [set() for _ in range(R)] + for s, (c, T) in out.items(): cov[s].add(tid[T]) + for s, c in ret.items(): cov[s].update(t for t, T in enumerate(trip) if c in T) + for o in reversed(ops): + if o[0] == 'add': cov[o[2]] |= cov[o[1]] + elif o[0] == 'fan': + for g in o[2]: cov[o[1]] |= cov[g] + levels = defaultdict(set) + for s in sel: + for t in cov[s]: levels[t].add(f[s]) + + z = Counter() + for s in range(R): + ds = [dim(k) for k in chain(s)] + require(all(b >= a for a, b in zip(ds, ds[1:])) and ds[-1] == h, 'monotone chain %d' % s) + for a, b in zip(ds, ds[1:]): + if b > a: z[b - a] += 2 * v + z[m - (h - f[s])] += 2 * v + z[h - 1] += 2 * v * h + for t in range(v): + ls = sorted(levels[t] | {0, h - 1}) + for a, b in zip(ls, ls[1:]): z[b - a] += 2 * v + for n, us in D['xs_order']: + ds = [1] + [len(vstart[s]) for s in us] + [h] + ds = [d for i, d in enumerate(ds) if i == 0 or d != ds[i - 1]] + require(all(b > a for a, b in zip(ds, ds[1:])), 'data-wire chain') + for a, b in zip(ds, ds[1:]): z[b - a] += 2 * v + z[(h - 1) ** 2] += 2 * N + z[1] += N + Wb = 2 * N + 2 * v * R; L = 2 * v * h * (h - 1); s_ = Wb * m - N + L + require(sum(t * c for t, c in z.items()) == s_, 'bit rank mass') + require(all(0 < t < m for t in z), 'children below m') + prof = dict(h=h, v=v, R=R, m=m, N=N, W=Wb, L=L, total_rank=s_, deficit=N - L, maxchild=max(z), + deferred_slots=len(sel), source=dict(repository='https://github.com/Swapnil-jain/integer-mult-kappa', + commit='741e7aa078392553815df7926ee17ac5e25a8c38', sha256=PINS), + child_multiplicities=dict(sorted(z.items()))) + (HERE / 'bit-profile.json').write_text(json.dumps(prof, indent=1) + '\n') + print('PASS bit: R=%d, deferred slots %d, maxchild %d, rank mass %d' % (R, len(sel), max(z), s_)) + + +if __name__ == '__main__': + main(sys.argv[1] if len(sys.argv) > 1 else '.') diff --git a/research/deferred-stopped/certificate.json b/research/deferred-stopped/certificate.json new file mode 100644 index 0000000000..00b4ec1e4a --- /dev/null +++ b/research/deferred-stopped/certificate.json @@ -0,0 +1,175 @@ +{ + "assembly": { + "absorption_gap": "4333030679469840929768124093977/62510732826606157597419467323285000000000", + "margins": { + "Gaussian_arithmetic": "1287976684152650437608480516106535343/10001717252256985215587114771725600000000", + "bulk_exposure": "214656535343/2500000000000000", + "compact_phase_layer": "1073282644516519913206535343/12502146565321231519483893464657", + "coordinate_movement": "214656535343/2500000000000000", + "dimension": "12499999875000000000000000000000/12502146565321231519483893464657", + "original_prefix": "107340766598217312552173018193464657/1250214656532123151948389346465700000000", + "scalar_work": "1717339754838650265883252241706535343/10001717252256985215587114771725600000000" + }, + "minimum_margin": "1073282644516519913206535343/12502146565321231519483893464657", + "parameters": { + "C0": 2994465792675104952757349965746759652008778122322142627817848832, + "C1": 1, + "a_bit": "214656535343/2500000000000000", + "a_complex": "214657/2500000000", + "actual_bit_saving": "1240189553/10000000000000", + "alpha_squared_power": "1609986482874019698550000000/12502146565321231519483893464657", + "beta": "1/1000000", + "c": "1073282665982173018193464657/12500000000000000000000000000000", + "delta": "1/800000000", + "epsilon": "12499999875000000000000000000000/12502146565321231519483893464657", + "eta": "1/100000000", + "kappa": "429239/5000000000", + "lambda_": "249978534346680356535343/250000000000000000000000", + "lambda_prime": "124989267173447506535343/125000000000000000000000", + "q": "10732826552493464657/125000000000000000000000", + "sigma": "2499785343/2500000000", + "tau": "2499785343464657/2500000000000000" + }, + "recurrence": { + "internal": "2499785343464657/2500000000000000", + "leaf": "2499785343214657/2500000000000000", + "reservations": "12498926717334017826981806535343/12500000000000000000000000000000" + }, + "strict_constraints": { + "Gaussian_arithmetic_above_kappa": "10733781545608580555445025115159759483/250042931306424630389677869293140000000000", + "K_dominates_log": "107328265524934635837173447506535343/1250214656532123151948389346465700000000", + "K_geometry": "107340766598217312552173018193464657/1250214656532123151948389346465700000000", + "alpha_below_one": "12500536578838357499785343464657/12502146565321231519483893464657", + "alpha_below_one_fourth": "12495706619389735440689693464657/50008586261284926077935573858628", + "alpha_positive": "1609986482874019698550000000/12502146565321231519483893464657", + "artificial_boundary": "70014167468624421159203961426046506535343/10001717252256985215587114771725600000000", + "beta_below_one": "999999/1000000", + "beta_positive": "1/1000000", + "bit_positive": "214656535343/2500000000000000", + "bulk_exposure_above_kappa": "37035343/2500000000000000", + "c_below_one": "12498926717334017826981806535343/12500000000000000000000000000000", + "c_positive": "1073282665982173018193464657/12500000000000000000000000000000", + "cell_above_band": "12499463171161642500214656535343/25004293130642463038967786929314", + "compact_leaf": "12714656535343/125000000000000000000000", + "compact_phase_layer_above_kappa": "4333030679469840929768124093977/62510732826606157597419467323285000000000", + "compact_reservations": "10732826552493464657/12500000000000000000000000000000", + "complex_above_bit": "464657/2500000000000000", + "complex_below_one_over32": "77910343/2500000000", + "coordinate_movement_above_kappa": "37035343/2500000000000000", + "delta_below_one_eighth": "99999999/800000000", + "delta_positive": "1/800000000", + "dimension_above_kappa": "62494632966110448079903808253053124093977/62510732826606157597419467323285000000000", + "epsilon_below_one": "2146690321231519483893464657/12502146565321231519483893464657", + "epsilon_positive": "12499999875000000000000000000000/12502146565321231519483893464657", + "gamma_sublinear": "536703838357499785343464657/12502146565321231519483893464657", + "guard_width": "2146690321231519483893464657/12502146565321231519483893464657", + "lambda_above_internal": "214656535343/250000000000000000000000", + "lambda_above_sigma": "46680356535343/250000000000000000000000", + "lambda_above_tau": "214656535343/250000000000000000000000", + "lambda_prime_above_lambda": "214656535343/250000000000000000000000", + "lambda_prime_below_one": "10732826552493464657/125000000000000000000000", + "leaf_saving_above_bit": "1/10000000000", + "literal_scalar_guard": "402943837929348086347490890940", + "original_prefix_above_kappa": "629440358945531416903962797326827/62510732826606157597419467323285000000000", + "phase_boundary": "1287976684152650437608480516106535343/10001717252256985215587114771725600000000", + "phase_local": "1717339754838650265883252241706535343/10001717252256985215587114771725600000000", + "prime_interval_packing": "2146690321231519483893464657/12502146565321231519483893464657", + "q_below_internal": "214656535343/125000000000000000000000", + "q_below_leaf": "12714656535343/125000000000000000000000", + "q_below_reservations": "10732826552493464657/12500000000000000000000000000000", + "q_positive": "10732826552493464657/125000000000000000000000", + "record_suffix": "2146690321231519483893464657/12502146565321231519483893464657", + "row_product_gap": "21189/25", + "scalar_work_above_kappa": "21467858312758576262314318255159759483/250042931306424630389677869293140000000000", + "short_record_fallback": "31247316020033937757008189620029384607958127649/31255366413303078798709733661642500000000000000", + "small_field_exposure": "1073407676714999570686929314/12502146565321231519483893464657" + } + }, + "base": "PR104 head 854ba7dca98651eab2050402384e1a7784534f0a", + "bit": { + "coarse_saving": "620523/5000000000", + "counts": { + "R": 28866, + "W": 108516254, + "deferred_slots": 11565, + "h": 23, + "m": 529, + "maxchild": 528, + "total_rank": 57403754177, + "v": 1771 + }, + "moment_gap": "210811394225115117568018038513239592855337768061996351784199300828041381607148420475711921673436778332750996651783152394205578153858435663243959795913385215868392831844509655226993164072062830500832781615792327068936897853818968534771730481866850519439187068953062899333771640996075361901014500735179763112430083120460814689994116646689670445286414265265018468311435502209195246240538069975559360544007937885404793780372701951022292660282948582656517071290400479729799954952580125532795274568021525151839594883237275569314958070368193662075730567130277424969924134425921633872848924585639423998410253779062359718371205767101510073996880454144801457072151080008705648366603197414406872289670642046369219405455128737300640897667220951127018547660455087533581513233999285275099394371781290865408274484542745086391849285198194905751058992419590161634431610100995441112613134240446609058758039909343152776920263419910572835208525277494067408376961456317/225678505065634612156474913616400633538202019254665477026878220214422133931127460164253533068001699469116755578965090566731480236912032281717920888140691998261537790258547549397061712443744511202265657747547567084090291301783866427704803156891369853685579999500594559805069402727752752227038426964007028952158078563045054314475625278140097385695241851533235641996467089273692960018822280793234080014352234618229252999217015923728814468917104222554059646947960375336061268431587018084270516494408656203498548153054913267707164839939006583338918817922618882667407408888179421052689449193499742148706302504238261936554897181289081072466758282367100305194479622149878636307463869297507337915811001244472279386614413535081936912313821531543735588465392499062010570720287729070905437080967709221039366272598541269000920375996285867953823816142239661027100714288630069735295241672325865922423925213948613346461034734632365263739073012128769510020000000000000000000000", + "stopped_saving": "1240189553/10000000000000" + }, + "complex": { + "counts": { + "R": 44918, + "W": 190021216, + "deferred_roles": 8893, + "h": 24, + "m": 576, + "maxchild": 574, + "total_rank": 109450358336, + "v": 2024 + }, + "moment_gap": "88301284141942852349786272358911595120000420578552187561142071843083140835081165954598269953603159972525663693558868972689146185155411834676228714955329059432394778298100545891381302421394794303237626549527713862261276656942246868839949845155337175702657628564964600909613181267405991527055947538283019556031587158098318798755637269980823599499009552235241463891126134912516374961621697669023792194774305349574435245146518419799694178664643594108583316149754557776251922460810128999706784941841740847389653952435807583800062182165911883618980285421081541915510402227182490035361011191674206574792045268082637368945733008419490087505310344811508745393581449139761913559952494272322223808007836813175902382766819729906991789797044140283347524500198153199375890634896941931622814963367507249808681003857076806191317833919071452335898024170995119906284068985721462680222566297431686072161795896181548150927924607598240580782210064261914540490641568966426778147251/38567646380471990066846323528257836937304900418571665458488647335738525964839401421162181723482413035129710616602006898867035617030508100341220985070552885919489004210392740293654574535114858149929488168983623251817921624399761542587906296152985111009541140777876971526639421362325581838554355340456733298659299558103166845735904917705525545917977763439849396606704910357032922787157529838149607648539023383581492909176298859827611384377284000467495755998769776989475028380041994440168558308474514943668961421778304739693567885686710949313112429918061388147558166502860588101321963799112097800740240024875708063144007409056818296375362429458681617944441266401553094477220896677057264283075058375992973747610948147134524276528806960610780471475495100666041243705609728626257304886601414783085155723501606613314074979295066720153503485896357460909958593539684309751023373339104134081577618563270169710365314887102059427502899064010200818867353355720320000000000000000000000", + "saving": "214657/2500000000" + }, + "finite_bridge": { + "bit_coarse": { + "W": 108516254, + "halving_degree": 367, + "m": 529, + "maxchild": 528, + "wire_bits": 27 + }, + "complex": { + "W": 190021216, + "halving_degree": 200, + "m": 576, + "maxchild": 574, + "s": 109450358336, + "scalar_group_upper": 1656684480, + "scalar_terms": [ + { + "c": 45764, + "copied_center_extra_groups": 48, + "h": 24, + "invocations": 2024, + "local_group_upper": 408200, + "v": 2024 + }, + { + "c": 45764, + "copied_center_extra_groups": 48, + "h": 24, + "invocations": 2024, + "local_group_upper": 408200, + "v": 2024 + } + ], + "wire_bits": 28 + }, + "ordinary_leaf_row_degree": 252, + "rows": { + "coefficient": 15761, + "contract": "W_complex^D_complex * W_coarse^D_coarse * W_old^D_old; one preceding prefix and one padding; sequential reuse", + "degree": 33000, + "degree_gap": "21189/25", + "suffix_slope": 132000 + }, + "semantic": { + "B": 403063477262941121553211537024, + "C0": 2994465792675104952757349965746759652008778122322142627817848832, + "C1": 1, + "E": 403063477262941121443761178688, + "exact_grid": "One common dyadic grid times the fixed odd divisor to K=G*(D_complex+1); no child rounding", + "fixed_odd_divisor": 21, + "induction_gap": 1209190431788823364659634611072, + "literal_charge": 119639333593035096270287748, + "strict_literal_gap": 402943837929348086347490890940 + } + }, + "kappa": "429239/5000000000", + "status": "Conditional witness: deferred readouts on both networks of the stopped product-ring interchange" +} diff --git a/research/deferred-stopped/certificate.py b/research/deferred-stopped/certificate.py new file mode 100644 index 0000000000..d7685100c1 --- /dev/null +++ b/research/deferred-stopped/certificate.py @@ -0,0 +1,126 @@ +#!/usr/bin/env python3 +"""Exact certificate: deferred readouts on both networks of PR104's stopped product-ring interchange. + +Inputs (regenerated by the two scripts in this directory): + bit-profile.json Swapnil Jain's round-seven deferred bit word, one child per residual (bit_round7.py); + complex-profile.json PR104's h=24 complex network with lifted binary frames and deferred readouts + (complex_deferred.py). +Computes, with PR104's inherited exact routines: the largest coarse bit saving and complex saving on the +10^-10 grid with a contracting moment, the stopped ordinary bit saving (PR104 stopping at theta = 1/1000), +the finite semantic/product-row bridge (row stock raised as the larger children require; it enters only the +row slack and cutoffs) and the 47-constraint balanced assembly at the largest kappa on the 10^-10 grid. +Usage: python3 research/deferred-stopped/certificate.py (writes certificate.json) +Prepared by Avi Eisenberg (ikeboy) with Anthropic Claude assistance. Apache-2.0. +""" +import json +import sys +from fractions import Fraction as Q +from pathlib import Path + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +sys.path.insert(0, str(ROOT / 'scripts')) +from partial_swap_network import moment # noqa: E402 +from copied_centers_network import finite_bridge as copied_bridge # noqa: E402 +from structured_bulk_assembly import assembly, js # noqa: E402 + +GRID = 10**10 +ATOM = Q(1, 1000) # PR104 stopping exponent theta +OLD = Q(384599, 10**10) # PR104 retained ordinary leaf saving +PHASE_STOP = Q(1, 10**6) # PR104 beta + + +def require(ok, msg): + if not ok: + raise SystemExit('FAIL: ' + msg) + + +def profile(name): + p = json.loads((HERE / name).read_text()) + p['child_multiplicities'] = {int(t): c for t, c in p['child_multiplicities'].items()} + z = p['child_multiplicities'] + require(sum(t * c for t, c in z.items()) == p['total_rank'] == p['W'] * p['m'] - p['N'] + p['L'], name + ' rank mass') + require(all(0 < t < p['m'] and c > 0 for t, c in z.items()), name + ' children') + require(max(z) == p['maxchild'], name + ' maxchild') + return p + + +def contracts(p, a): + try: + moment(p['m'], p['W'], p['child_multiplicities'], a, True) + return True + except SystemExit: + return False + except Exception: + return False + + +def largest(p, lo, hi): + a, b = int(lo * GRID), int(hi * GRID) + require(contracts(p, Q(a, GRID)) and not contracts(p, Q(b, GRID)), 'bracket') + while b - a > 1: + mid = (a + b) // 2 + a, b = (mid, b) if contracts(p, Q(mid, GRID)) else (a, mid) + return Q(a, GRID) + + +def main(): + bit, phase = profile('bit-profile.json'), profile('complex-profile.json') + coarse = largest(bit, Q(7, 10**5), Q(2, 10**4)) + ac = largest(phase, Q(7, 10**5), Q(2, 10**4)) + bm = moment(bit['m'], bit['W'], bit['child_multiplicities'], coarse, True) + cm = moment(phase['m'], phase['W'], phase['child_multiplicities'], ac, True) + require(not contracts(bit, coarse + Q(1, GRID)) and not contracts(phase, ac + Q(1, GRID)), 'next grid points rejected') + require(0 < OLD <= coarse < ATOM < 1, 'stopped-adapter exponents') + ab = (1 - ATOM) * coarse + ATOM * OLD + require(ATOM > ab, 'adapter toll subordinate to the stopped saving') + abit = min(ab, (1 - PHASE_STOP) * ac - Q(1, GRID)) + + row = dict(h=phase['h'], v=phase['v'], c=phase['additions'], central_disjoint=24) + previous = json.loads((ROOT / 'certificates' / 'copied-centers-network.json').read_text()) + bridge = copied_bridge(bit, phase, [row, row]) + old_bit = previous['finite_bridge']['bit'] + old_degree = old_bit['halving_degree'] * old_bit['wire_bits'] + require(old_degree == 252, 'inherited ordinary leaf row stock') + coarse_bridge = bridge.pop('bit'); cpx = bridge['complex'] + coefficient = (coarse_bridge['halving_degree'] * coarse_bridge['wire_bits'] + old_degree + + cpx['halving_degree'] * cpx['wire_bits']) + degree = 1000 * ((51 * coefficient) // 25000 + 1) + require(Q(degree) > Q(51 * coefficient, 25), 'product stock strictly sufficient') + bridge.update(bit_coarse=coarse_bridge, ordinary_leaf_row_degree=old_degree) + bridge['rows'] = dict(coefficient=coefficient, degree=degree, suffix_slope=4 * degree, + degree_gap=Q(degree) - Q(51 * coefficient, 25), + contract='W_complex^D_complex * W_coarse^D_coarse * W_old^D_old; one preceding prefix and one padding; sequential reuse') + bridge['semantic'].update(fixed_odd_divisor=21, + exact_grid='One common dyadic grid times the fixed odd divisor to K=G*(D_complex+1); no child rounding') + + def accepted(k): + try: + assembly(abit, ac, bridge, Q(k, GRID), beta=PHASE_STOP) + return True + except AssertionError: + return False + lo, hi = int(Q(7, 10**5) * GRID), int(ac * GRID) + 1 + require(accepted(lo) and not accepted(hi), 'kappa bracket') + while hi - lo > 1: + mid = (lo + hi) // 2 + lo, hi = (mid, hi) if accepted(mid) else (lo, mid) + kappa = Q(lo, GRID) + assembled = assembly(abit, ac, bridge, kappa, beta=PHASE_STOP) + require(not accepted(lo + 1), 'next kappa grid point rejected') + require(len(assembled['strict_constraints']) == 47 and len(assembled['margins']) == 7, 'complete assembly') + assembled['parameters']['actual_bit_saving'] = ab + result = dict(status='Conditional witness: deferred readouts on both networks of the stopped product-ring interchange', + kappa=kappa, bit=dict(coarse_saving=coarse, stopped_saving=ab, moment_gap=bm['strict_gap'], + counts={k: bit[k] for k in ('h', 'v', 'R', 'm', 'W', 'total_rank', 'maxchild', 'deferred_slots')}), + complex=dict(saving=ac, moment_gap=cm['strict_gap'], + counts={k: phase[k] for k in ('h', 'v', 'R', 'm', 'W', 'total_rank', 'maxchild', 'deferred_roles')}), + finite_bridge=bridge, assembly=assembled, + base='PR104 head 854ba7dca98651eab2050402384e1a7784534f0a') + (HERE / 'certificate.json').write_text(json.dumps(js(result), indent=2, sort_keys=True) + '\n') + print('PASS kappa = %s = %.10e' % (kappa, float(kappa))) + print('coarse bit saving %s, stopped %s, complex saving %s' % (coarse, ab, ac)) + + +if __name__ == '__main__': + main() diff --git a/research/deferred-stopped/complex-profile.json b/research/deferred-stopped/complex-profile.json new file mode 100644 index 0000000000..400e10fbbe --- /dev/null +++ b/research/deferred-stopped/complex-profile.json @@ -0,0 +1,99 @@ +{ + "h": 24, + "v": 2024, + "additions": 45764, + "roots": 8120, + "links": 8966, + "R": 44918, + "m": 576, + "N": 4096576, + "W": 190021216, + "L": 2234496, + "total_rank": 109450358336, + "deficit": 1862080, + "maxchild": 574, + "phase_one_ops": 17811, + "phase_one_roles": 15082, + "deferred_roles": 8893, + "deferred_dims": { + "1": 6, + "2": 206, + "4": 259, + "5": 1, + "6": 680, + "7": 1, + "8": 542, + "9": 8, + "10": 681, + "11": 40, + "12": 725, + "13": 133, + "14": 717, + "15": 143, + "16": 614, + "17": 233, + "18": 1007, + "19": 526, + "20": 612, + "21": 237, + "22": 1522 + }, + "lifted_additions": 20234, + "replay": { + "seeds": [ + 1, + 2 + ], + "scratch_restored": true, + "y_plus_x": true, + "field": "Z/(2^61-1)" + }, + "child_multiplicities": { + "1": 242993344, + "2": 116792896, + "3": 37808320, + "4": 59355824, + "5": 46325312, + "6": 32234224, + "7": 19661136, + "8": 30449056, + "9": 9715200, + "10": 21725616, + "11": 6861360, + "12": 20555744, + "13": 5145008, + "14": 21919920, + "15": 4048000, + "16": 18390064, + "17": 8055520, + "18": 17013744, + "19": 8739632, + "20": 9460176, + "21": 1716352, + "22": 8937984, + "23": 8290304, + "529": 8193152, + "552": 145829200, + "553": 24288, + "554": 833888, + "556": 1048432, + "557": 4048, + "558": 2752640, + "559": 4048, + "560": 2194016, + "561": 32384, + "562": 2756688, + "563": 161920, + "564": 2934800, + "565": 538384, + "566": 2902416, + "567": 578864, + "568": 2485472, + "569": 943184, + "570": 4076336, + "571": 2129248, + "572": 2477376, + "573": 959376, + "574": 6161056 + } +} diff --git a/research/deferred-stopped/complex_deferred.py b/research/deferred-stopped/complex_deferred.py new file mode 100644 index 0000000000..9eb572013c --- /dev/null +++ b/research/deferred-stopped/complex_deferred.py @@ -0,0 +1,458 @@ +#!/usr/bin/env python3 +"""Deferred readouts on PR104's h=24 complex network, with lifted binary frames. + +Builds PR104's aligned rational-center DAG (scripts/stopped_product/complex.py, unchanged), a maximum carrier +matching under the inherited matcher's adjacency rules, an explicit role compile, lifted binary frames, +phase one, deferred readout frames and the stage-one word. Checks: + A. the matching has the inherited size (8966) and the role count R = c + q - links = 44918; + B. the compiled word computes every root value (zero scratch, random data, mod p); + C. replay of the deferred word with arbitrary scratch and data (two seeds, mod p): every role restored and + every target y_S receives exactly x_S; + D. exact F2 frame facts: lifted frames nondegenerate and nested along every role chain (gates, links, copies, + root frames), every deferral frame inside its start frame and inside t_S^perp for every reached target, + nondegenerate, and nested on every target in readout order; + E. the one-child histogram from the explicit role chains, with total rank W m - N + L. +Writes complex-profile.json next to this file. Usage: python3 research/deferred-stopped/complex_deferred.py +Prepared by Avi Eisenberg (ikeboy) with Anthropic Claude assistance. Apache-2.0. +""" +import array +import json +import random +import struct +import sys +import tempfile +from collections import Counter, defaultdict +from itertools import combinations +from pathlib import Path + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +sys.path.insert(0, str(ROOT / 'scripts')) +from stopped_product.complex import build # noqa: E402 (PR104 producer, unchanged) + +P = (1 << 61) - 1 + + +def require(ok, msg): + if not ok: + raise SystemExit('FAIL: ' + msg) + + +def load(prefix): + def rd(fh, typ, cnt): + a = array.array(typ); a.fromfile(fh, cnt); return a + with open(str(prefix) + '.bin', 'rb') as f: + h, v, n, q = struct.unpack('<4I', f.read(16)) + flat = rd(f, 'I', 2 * n); core = rd(f, 'Q', n); cover = rd(f, 'Q', n) + roots = rd(f, 'I', q); kind = rd(f, 'I', q); active = rd(f, 'B', n) + with open(str(prefix) + '.labels', 'rb') as f: + ranks = rd(f, 'I', n); types = rd(f, 'B', n) + args = [(flat[2 * i], flat[2 * i + 1]) for i in range(n)] + return h, v, n, q, args, core, cover, roots, kind, active, ranks, types + + +# ---------------------------------------------------------------- F2 linear algebra on bit vectors +def dot(a, b): return bin(a & b).count('1') & 1 + + +def reduce(basis): + rows = []; piv = [] + for vec in basis: + for p, r in zip(piv, rows): + if vec >> p & 1: vec ^= r + if vec: + p = vec.bit_length() - 1 + for i in range(len(rows)): + if rows[i] >> p & 1: rows[i] ^= vec + rows.append(vec); piv.append(p) + return rows + + +def kernel(funcs, h): + K = reduce(funcs); piv = [r.bit_length() - 1 for r in K] + out = [] + for c in (i for i in range(h) if i not in piv): + vec = 1 << c + for r, p in zip(K, piv): + if r >> c & 1: vec |= 1 << p + out.append(vec) + return out + + +def restrict(basis, funcs): + B = reduce(basis) + for f in funcs: + if not B: break + vals = [dot(b, f) for b in B] + if not any(vals): continue + k = vals.index(1); pv = B[k] + B = [b ^ pv if val else b for b, val in zip(B, vals)]; B.pop(k) + return reduce(B) + + +def contains(A, B): + RB = reduce(B) + return len(reduce(RB + list(A))) == len(RB) + + +def cap(A, B): + A = reduce(A); B = reduce(B) + if not A or not B: return [] + ker = []; red = [] + for i, vec in enumerate(A + B): + tag = 1 << i + for rv, rt in red: + if vec >> (rv.bit_length() - 1) & 1: vec ^= rv; tag ^= rt + if vec: red.append((vec, tag)) + else: + comb_ = 0 + for k in range(len(A)): + if tag >> k & 1: comb_ ^= A[k] + ker.append(comb_) + return reduce(ker) + + +def nondeg(B): + B = reduce(B); k = len(B) + if not k: return True + M = [sum(dot(B[i], B[j]) << j for j in range(k)) for i in range(k)] + return len(reduce(M)) == k + + +def hopcroft_karp(left, adj): + """maximum bipartite matching; adj[x] = sorted list of right vertices.""" + INF = 1 << 60 + mate_l = {x: None for x in left}; mate_r = {} + while True: + dist = {}; queue = [] + for x in left: + if mate_l[x] is None: dist[x] = 0; queue.append(x) + else: dist[x] = INF + found = INF; head = 0 + while head < len(queue): + x = queue[head]; head += 1 + if dist[x] >= found: continue + for r in adj[x]: + y = mate_r.get(r) + if y is None: found = min(found, dist[x] + 1) + elif dist[y] == INF: dist[y] = dist[x] + 1; queue.append(y) + if found == INF: break + gained = 0 + for x0 in left: + if mate_l[x0] is not None: continue + stack = [(x0, iter(adj[x0]))]; path = [] + while stack: + x, it = stack[-1] + advanced = False + for r in it: + y = mate_r.get(r) + if (y is None and dist[x] + 1 == found) or (y is not None and dist[y] == dist[x] + 1): + path.append((x, r)) + if y is None: + for xx, rr in path: mate_l[xx] = rr; mate_r[rr] = xx + gained += 1; stack = []; break + stack.append((y, iter(adj[y]))); advanced = True; break + else: + dist[x] = INF; stack.pop() + if path: path.pop() + continue + if not advanced: break + if not gained: break + return mate_l + + +def main(): + with tempfile.TemporaryDirectory(prefix='deferred-stopped-') as work: + prefix = Path(work) / 'complex' + build(24, prefix, central_disjoint=24) + h, v, n, q, args, core, cover, roots, kind, active, ranks, types = load(prefix) + trip = list(combinations(range(h), 3)); require(len(trip) == v, 'triple count') + m = h * h; N = v * v; FULL = (1 << h) - 1 + tmask = [sum(1 << p for p in T) for T in trip] + tid = {T: i for i, T in enumerate(trip)} + + # ------------------------------------------------------------ uses and matching (inherited adjacency) + degree = [0] * n; uses = defaultdict(list); c_add = 0 + for x in range(1, n): + if active[x] and args[x][0]: + c_add += 1 + for pos, y in enumerate(args[x]): degree[y] += 1; uses[y].append(('gate', x, pos)) + for j, x in enumerate(roots): degree[x] += 1; uses[x].append(('root', j)) + def unode(u): return roots[u[1]] if u[0] == 'root' else u[1] + def before(x, u): + y = unode(u) + return (ranks[x], x) < (ranks[y], (n + u[1]) if u[0] == 'root' else y) + def incl(x, y): + tx, ty = types[x], types[y] + if tx == 1 and ty == 1: return not (core[y] & ~core[x]) and not (cover[x] & ~cover[y]) + if tx in (1, 2) and ty == 2: return not (cover[x] & ~cover[y]) + if tx == 1 and ty == 3: return bool(core[x] & core[y]) + if tx == 2 and ty == 3: return not (cover[x] & ~core[y]) + if tx == 3 and ty == 2: return cover[y] == FULL + if tx == 3 and ty == 3: return core[x] == core[y] + return False + left = []; adj = {} + for x in range(1, n): + if not (active[x] and args[x][0]): continue + rs = sorted({(y, k) for y in args[x] for k, u in enumerate(uses[y]) if before(x, u) and incl(x, unode(u))}) + if rs: left.append(x); adj[x] = rs + mate = hopcroft_karp(left, adj) + links = {x: r for x, r in mate.items() if r is not None} + R = c_add + q - len(links) + require(len(links) == 8966 and R == 44918, 'matching size %d, roles %d' % (len(links), R)) + linked_use = {(y, k): x for x, (y, k) in links.items()} + + # ------------------------------------------------------------ root targets, read coefficients, root functionals + target = [None] * q + for j in range(v): target[j] = j + idx = v + for a, b in combinations(range(h), 2): + others = sorted((i for i in range(h) if i not in (a, b)), key=lambda i: ((i ^ 1) in (a, b), i)) + for i in others: target[idx] = tid[tuple(sorted((a, b, i)))]; idx += 1 + centre_of = {} + for j in range(q): + if kind[j]: + miss = FULL & ~cover[roots[j]]; require(bin(miss).count('1') == 1, 'centre cover') + centre_of[j] = miss.bit_length() - 1 + require(idx + len(centre_of) == q, 'root order') + rootfun = [(1 << centre_of[j]) if kind[j] else tmask[target[j]] for j in range(q)] + + # ------------------------------------------------------------ lifted binary frames, monotone + succ = defaultdict(set); droot = defaultdict(set) + for x in range(1, n): + if not active[x]: continue + for k, u in enumerate(uses[x]): + if (x, k) in linked_use: continue + (succ[x].add(u[1]) if u[0] == 'gate' else droot[x].add(u[1])) + for x, (y, k) in links.items(): + u = uses[y][k]; (succ[x].add(u[1]) if u[0] == 'gate' else droot[x].add(u[1])) + order_desc = sorted((x for x in range(1, n) if active[x]), key=lambda x: (ranks[x], x), reverse=True) + K = {} + for x in order_desc: + rows = [rootfun[j] for j in droot[x]] + for t in succ[x]: rows += K[t] + K[x] = reduce(rows) + def envelope(x): + if not args[x][0]: return [tmask[x - 1]] + if types[x] == 2: return [1 << i for i in range(h) if cover[x] >> i & 1] + require(types[x] == 1, 'only ordinary and common-pair labels occur') + ks = [i for i in range(h) if (cover[x] & ~core[x]) >> i & 1] + require(len(ks) == ranks[x], 'common-pair support') + return [core[x] | (1 << k) for k in ks] + U = {} + for x in range(1, n): + if not active[x]: continue + if not args[x][0]: U[x] = envelope(x); continue + B = kernel(K[x], h) + require(contains(envelope(x), B), 'label outside lifted frame') + U[x] = B if nondeg(B) else envelope(x) + changed = True + while changed: + changed = False + for x in order_desc: + if args[x][0] and any(not contains(U[x], U[t]) for t in succ[x]): + env = envelope(x) + if len(reduce(U[x])) != len(reduce(env)) or not contains(U[x], env): U[x] = env; changed = True + dimU = {x: len(reduce(B)) for x, B in U.items()} + + # ------------------------------------------------------------ explicit role compile + order = sorted((x for x in range(1, n) if active[x]), key=lambda x: (ranks[x], x)) + holds = []; first_node = []; ops = []; edge_key = {}; role_root = {} + def new_role(node): holds.append([node]); first_node.append(node); return len(holds) - 1 + def serve(s, y, k): + u = uses[y][k] + if u[0] == 'gate': edge_key[(y, k)] = s + else: role_root[s] = u[1] + for x in order: + free = [k for k in range(len(uses[x])) if (x, k) not in linked_use] + if not args[x][0]: + for k in free: + s = new_role(x); ops.append(('src', s, x)); serve(s, x, k) + continue + a, b = args[x] + ka = next(k for k, u in enumerate(uses[a]) if u == ('gate', x, 0)) + kb = next(k for k, u in enumerate(uses[b]) if u == ('gate', x, 1)) + sa, sb = edge_key.pop((a, ka)), edge_key.pop((b, kb)) + if x in links and links[x][0] == a: sa, sb = sb, sa + piv, oth = sa, sb + ops.append(('add', piv, oth, x)); holds[piv].append(x); holds[oth].append(x) + if x in links: serve(oth, *links[x]) + require(free, 'every use linked at node %d' % x) + serve(piv, x, free[0]) + for k in free[1:]: + f = new_role(x); ops.append(('copy', piv, f, x)); serve(f, x, k) + require(not edge_key and len(holds) == R, 'compile') + Rr = R + + # ------------------------------------------------------------ B. the word computes every root value + rng = random.Random(20261008) + xs = [rng.randrange(P) for _ in range(v)] + val = [0] * n + for i in range(v): val[i + 1] = xs[i] + for x in order: + if args[x][0]: val[x] = (val[args[x][0]] + val[args[x][1]]) % P + leaf_of = {s: first_node[s] for s in range(Rr) if not args[first_node[s]][0]} + a_ = [0] * Rr + for s, leaf in leaf_of.items(): a_[s] = xs[leaf - 1] + for o in ops: + if o[0] == 'add': a_[o[1]] = (a_[o[1]] + a_[o[2]]) % P + elif o[0] == 'copy': a_[o[2]] = (a_[o[2]] + a_[o[1]]) % P + require(all(a_[s] == val[roots[j]] for s, j in role_root.items()), 'root values') + + # ------------------------------------------------------------ phase one and garbage reach + def touch(o): return [o[1], o[2]] if o[0] in ('add', 'copy') else [] + prev = {}; pred = defaultdict(list); last = {} + for i, o in enumerate(ops): + for s in touch(o): + if s in prev: pred[i].append(prev[s]) + prev[s] = i; last[s] = i + centre_roles = [s for s, j in role_root.items() if kind[j]] + Anc = set(); st = [last[s] for s in centre_roles] + while st: + i = st.pop() + if i not in Anc: Anc.add(i); st.extend(pred[i]) + touched = set(centre_roles) + for i in Anc: touched.update(touch(ops[i])) + require(all(last[s] in Anc for s in centre_roles), 'centres complete in phase one') + reach = [set() for _ in range(Rr)]; reach_all = [False] * Rr + for s, j in role_root.items(): + if kind[j]: reach_all[s] = True + else: reach[s].add(target[j]) + for o in reversed(ops): + if o[0] == 'add': reach[o[2]] |= reach[o[1]]; reach_all[o[2]] = reach_all[o[2]] or reach_all[o[1]] + elif o[0] == 'copy': reach[o[1]] |= reach[o[2]]; reach_all[o[1]] = reach_all[o[1]] or reach_all[o[2]] + + # ------------------------------------------------------------ deferral frames, insertion nesting + def F0(s): return U[first_node[s]] + cand = {} + for s in range(Rr): + if s in touched or reach_all[s]: continue + S_ = restrict(F0(s), [tmask[t] for t in reach[s]]) + if S_ and nondeg(S_): cand[s] = S_ + byT = defaultdict(list); placed = {} + for s in sorted(cand, key=lambda s: (-len(cand[s]), s)): + X = cand[s]; changed = True + while changed and X: + changed = False + for t in reach[s]: + for w in byT[t]: + B = placed[w] + if (len(B) >= len(X) and not contains(X, B)) or (len(B) < len(X) and not contains(B, X)): + X = cap(X, B); changed = True + if not X: break + if not X: break + if X and nondeg(X): + placed[s] = X + for t in reach[s]: byT[t].append(s) + deferred = sorted(placed, key=lambda s: (len(placed[s]), s)); dset = set(deferred) + + # ------------------------------------------------------------ C. replay with arbitrary scratch and data + inv = lambda a: pow(a % P, P - 2, P); HALF = inv(2); I21 = inv(21) + cvec = [None] * Rr; dpart = [dict() for _ in range(Rr)] + for s, j in role_root.items(): + if kind[j]: c = [0] * h; c[centre_of[j]] = 1; cvec[s] = c + else: dpart[s][target[j]] = (P - HALF) if j >= v else HALF + seed_c = {s: (None if cvec[s] is None else list(cvec[s])) for s in role_root} + seed_d = {s: dict(dpart[s]) for s in role_root} + def addc(dst, src): + if cvec[src] is not None: + cvec[dst] = list(cvec[src]) if cvec[dst] is None else [(p + q_) % P for p, q_ in zip(cvec[dst], cvec[src])] + for t, c in dpart[src].items(): dpart[dst][t] = (dpart[dst].get(t, 0) + c) % P + for o in reversed(ops): + if o[0] == 'add': addc(o[2], o[1]) + elif o[0] == 'copy': addc(o[1], o[2]) + scatter = [[(I21 - (HALF if i in trip[t] else 0)) % P for t in range(v)] for i in range(h)] + def readout(y, s, value, sign, seed=False): + cv = seed_c[s] if seed else cvec[s]; dp = seed_d[s] if seed else dpart[s] + if cv is not None: + for i, ci in enumerate(cv): + if ci: + f = sign * ci * value % P; row = scatter[i] + for t in range(v): y[t] = (y[t] + f * row[t]) % P + for t, c in dp.items(): y[t] = (y[t] + sign * c * value) % P + phase1 = sorted(Anc); rest = [i for i in range(len(ops)) if i not in Anc] + def replay(seed): + rng = random.Random(seed) + x = [rng.randrange(P) for _ in range(v)]; z = [rng.randrange(P) for _ in range(Rr)] + y0 = [rng.randrange(P) for _ in range(v)]; a = list(z); y = list(y0) + for s in range(Rr): + if s not in dset: readout(y, s, a[s], -1) + for s, leaf in leaf_of.items(): + if s not in dset: a[s] = (a[s] + x[leaf - 1]) % P + def run(i, sign=1): + o = ops[i] + if o[0] == 'add': a[o[1]] = (a[o[1]] + sign * a[o[2]]) % P + elif o[0] == 'copy': a[o[2]] = (a[o[2]] + sign * a[o[1]]) % P + for i in phase1: run(i) + for s in centre_roles: readout(y, s, a[s], +1, True) + for s in deferred: readout(y, s, a[s], -1) + for s in deferred: + if s in leaf_of: a[s] = (a[s] + x[leaf_of[s] - 1]) % P + for i in rest: run(i) + for s, j in role_root.items(): + if not kind[j]: readout(y, s, a[s], +1, True) + for i in reversed(range(len(ops))): run(i, -1) + for s, leaf in leaf_of.items(): a[s] = (a[s] - x[leaf - 1]) % P + return a == z, all((y[t] - y0[t] - x[t]) % P == 0 for t in range(v)) + rep = [replay(seed) for seed in (1, 2)] + require(all(r == (True, True) for r in rep), 'replay %s' % rep) + + # ------------------------------------------------------------ D. exact F2 frame facts + root_frame = {} + for s, j in role_root.items(): + root_frame[s] = [1 << i for i in range(h) if i != centre_of[j]] if kind[j] else kernel([tmask[target[j]]], h) + FULLB = [1 << i for i in range(h)] + chain_dims = [] + for s in range(Rr): + seq = [placed.get(s, []), F0(s)] + [U[x] for x in holds[s][1:]] + if s in root_frame: seq.append(root_frame[s]) + seq.append(FULLB) + require(all(contains(A, B) for A, B in zip(seq, seq[1:])), 'role chain nesting %d' % s) + require(all(nondeg(B) for B in seq[1:-1] if B), 'degenerate frame on role %d' % s) + chain_dims.append([len(reduce(B)) for B in seq]) + for s, X in placed.items(): + require(contains(X, F0(s)) and nondeg(X), 'deferral frame %d' % s) + require(all(not any(dot(xv, tmask[t]) for xv in X) for t in reach[s]), 'target frame %d' % s) + byT2 = defaultdict(list) + for s in deferred: + for t in reach[s]: byT2[t].append(s) + for t, ss in byT2.items(): + ss.sort(key=lambda s: (len(placed[s]), s)) + require(all(contains(placed[p], placed[q_]) for p, q_ in zip(ss, ss[1:])), 'target chain %d' % t) + + # ------------------------------------------------------------ E. one-child histogram + z = Counter() + for s in range(Rr): + ds = chain_dims[s] + for a, b in zip(ds[:-1], ds[1:-1]): + if b > a: z[b - a] += 2 * v + lastd = ds[-2] + if s in role_root and kind[role_root[s]]: z[h - 1] += 2 * v # copied centre transform + z[h - lastd] += 2 * v # final growth to F + z[m - h + ds[0]] += 2 * v # exterior, gauged by sigma + levels = defaultdict(set) + for s in deferred: + for t in reach[s]: levels[t].add(len(placed[s])) + for t in range(v): + ds = sorted(levels[t] | {0, h - 1}) + for a, b in zip(ds, ds[1:]): z[b - a] += 2 * v # target fronts + z[h - 1] += 2 * N # data-wire fronts + z[(h - 1) ** 2] += 2 * N # data macros + z[1] += N # endpoint copies + z.pop(0, None) + W = 2 * N + 2 * v * R; L = 2 * v * h * (h - 1); s_ = W * m - N + L + require(sum(t * c for t, c in z.items()) == s_, 'complex rank mass') + require(all(0 < t < m for t in z), 'children below m') + out = dict(h=h, v=v, additions=c_add, roots=q, links=len(links), R=R, m=m, N=N, W=W, L=L, total_rank=s_, + deficit=N - L, maxchild=max(z), phase_one_ops=len(Anc), phase_one_roles=len(touched), + deferred_roles=len(deferred), + deferred_dims=dict(sorted(Counter(len(X) for X in placed.values()).items())), + lifted_additions=sum(1 for x in U if args[x][0] and dimU[x] > ranks[x]), + replay=dict(seeds=[1, 2], scratch_restored=True, y_plus_x=True, field='Z/(2^61-1)'), + child_multiplicities=dict(sorted(z.items()))) + (HERE / 'complex-profile.json').write_text(json.dumps(out, indent=1) + '\n') + print('PASS complex: R=%d, deferred roles %d, maxchild %d, rank mass %d' % (R, len(deferred), max(z), s_)) + + +if __name__ == '__main__': + main() diff --git a/research/joint-dual/SOURCE.json b/research/joint-dual/SOURCE.json index 80c0f29dc4..a119bae377 100644 --- a/research/joint-dual/SOURCE.json +++ b/research/joint-dual/SOURCE.json @@ -3,9 +3,9 @@ "base_pr57_commit": "cd350f76c9bc01489ec83568bded532cb69be938", "base_pr58_commit": "bc2f7ed4c20dc18898305ab17165c0c995cbb804", "files": { - "Makefile": "97620e0205736d9c0fce736e8ac6ab67f8ed0e490c381f6cac152cc6a003dca7", - "NOTICE": "1c53970fb4face631a1b331ec66d33111eccd280a129f9b64c2da6df96861c3f", - "README.md": "fd92de31aece76b1f5ff897e6e0dbc38dd3bf67c140579bbcb03a1a11a792668", + "Makefile": "0bd8071c6a4899b9e6975b53690069b4ffc70ac3514c019485b59f02ed994a6b", + "NOTICE": "46b84a2254d554c8adbe67ddaf33640e1b99e31168a1d90305d470e4fdab8e23", + "README.md": "083799d50375b5a16bd5af0eb1b0e4f630a6d05b414fe7010bc266206d9eda11", "certificates/joint-dual-compiler.json": "516c4d85158553dabd0a98216a064b2a7397957a9d5dd0df1d6e5aec53a4e805", "certificates/joint-dual-profiles-23.json": "159fa8fee175fc1d24f63e72d3c2f1dc9f4fcd78b938c5e7d2f735fd0fd37209", "certificates/joint-dual-profiles-25.json": "8d190ce42d097e828c5756918c52f2963df576cf4c6600b0fc7f2b7fdb6ad223", diff --git a/research/shrunk-frames/README.md b/research/shrunk-frames/README.md new file mode 100644 index 0000000000..6038ce1455 --- /dev/null +++ b/research/shrunk-frames/README.md @@ -0,0 +1,109 @@ +# Terminal-elided shrunk frames with saturated deferred readouts + +Conditional **κ = 110875518403/10¹⁵ = 1.10875518403×10⁻⁴**, about +**0.257% above the pinned PR #125 parent** +(110591581647/10¹⁵ = 1.10591581647×10⁻⁴). The complex side still binds. + +This package keeps PR114's complete construction: PR117's immutable +91,770-addition complex DAG (eumemic), the same carrier matching and 28,705 +dirty roles, PR110's lifted binary frames and deferred readouts, and PR114's +saturated placement with priority 2^dim / reached_targets². The frame shrink +is PR #125 by Joel Pulikkan. The terminal-role deletion and source-time +redirect idea follows PR #122 by SovereignSteak. This candidate composes them +on the fixed PR #125 word; it does not claim either predecessor's mechanism as +new. + +## Shrunk frames + +PR110's frame contract asks for each addition x a nondegenerate frame U_x with + + label(x) + Σ_{p → x} U_p ⊆ U_x ⊆ lifted kernel K_x^⊥, + U_x ⊆ U_t for every successor t. + +The lifted kernel is the largest choice. The inherited label fallback is +another. Every role pays one child per strict increase of its frame chain, with +cost t·log(m/t) in the moment for an increase t. That function is subadditive, so two +small increases cost more than one merged increase of the same total. + +One forward pass in chronological order considers the minimal span +Lb_x = label(x) + Σ U_p. Suppose Lb_x is nondegenerate, smaller than U_x and contained in every +successor frame. Then U_x is replaced by Lb_x if that lowers the local +one-child cost of the role chains holding x. In practice, an increase at x is +delayed and merged into the next increase. The pass shrinks **16,031** +frames. Shrinking stays monotone. Lb_x contains every predecessor frame, and +successors are processed later against the updated frames. Deferral +candidates use the shrunk start frames. + +| Complex network (PR117 DAG) | PR #125 parent | This composition | +|---|---:|---:| +| physical roles / carrier links | 28,705 / 71,185 | 28,324 / 71,185* | +| shrunk frames | 16,031 | 16,031 | +| deferred readouts | 4,706 | 4,325 | +| terminal roles removed / direct updates | — | 381 / 1,167 | +| strict complex saving | 110616162/10¹² | **13862528107/125000000000000** | +| κ | 1.10591581647e-4 | **1.10875518403e-4** | + +*The matched DAG's 71,185 links are retained; its `additions + roots - links` +role count is the pre-elimination count. The final physical word removes 381 +terminal roles. Each is an ordinary deferred output role with no later +consumer. For a removed role with old scratch value z and incoming updates +uᵢ, the old pair of readouts contributes `-αz + α(z + Σuᵢ)`. The replacement +adds each `αuᵢ` to its target at the original update time. The independent +audit checks all 1,167 source-time updates, their frames and signs, and two +modular dirty-scratch replays. + +W = 122,848,704, recursive rank mass 70,758,991,424 and maximum child 574 of +576. The deficit remains 1,862,080. The full paid child histogram is +reconstructed from both the forward and reflected frame traces. Every +surviving copied centre, exterior, source/target front, data projector and +endpoint correction remains paid. The bit supplier is unchanged: +Swapnil Jain's round-seven word, stopped saving 1240189553/10¹³. + +## Checks + +```sh +python3 research/shrunk-frames/verify.py +``` + +The verifier regenerates the PR #125 parent in memory, checks its frozen +profile and reflection receipt, writes a transient parent word, and builds the +combined output in a temporary tree. Section D of `complex_deferred.py` +rechecks each parent role chain against the actual shrunk frames: start, every +gate, linked continuations, root frame and F. It checks each chain is nested +and every frame is nondegenerate. + +`terminal_elision_audit.py` independently rediscovers the eligible terminal +roles and rebuilds the simultaneous target schedule. It checks every event in +chronological order, source-time snapshots, the exact local dirty-scratch +identity, modular replay, forward and reflected frame transitions, and the +complete child histogram. Four event mutations are rejected. `certificate.py` +recomputes both moments exactly and rejects the next complex grid point. Its +scalar-group bound explicitly includes all 1,167 direct updates; it checks all +47 strict constraints, seven margins and the next κ grid point. + +Frozen comparison profiles are `controls/pr114-complex-profile.json` and +`controls/pr125-complex-profile.json`. The PR #125 parent profile contracts at +its own saving and fails at the composed candidate's larger saving. + +All retained transfer hypotheses remain unchanged: +- simultaneous rational bases and opposite-bank factorization; +- stopped atom streaming and the ordinary wrapper; +- translated complex endpoint gauges and the exact odd-denominator grid; +- routing, recovery and prime selection; +- analytic estimates and the fixed-tape implementation. + +The finite checks verify that the shrunk frames meet the stated contract. They +are not a new general theorem. This is a finite conditional witness, not an +unconditional theorem, a measured speedup or a global optimum. + +Credits: eumemic (PR117 producer, PR114 saturated placement, reflection audit +and scalar charge); Joel Pulikkan (PR #125 shrunk-frame step, Anthropic Claude +assistance); SovereignSteak (PR #122 terminal-role elimination); this fixed- +parent composition, independent audit and certificate integration were +prepared with OpenAI Codex assistance. Avi +Eisenberg / ikeboy (PR110 deferred complex compiler, PR62); Rohan Arun +(PR111/113/116/118); icekylinx (PR104/115); Swapnil Jain (round-seven words, +lifted frames, deferred readouts); Zhihao Chen / jacklightChen; Aurel Prosz / +Paureel; RaD / hipotures; Douglas Colkitt; OpenAI and all inherited +contributors. Original notices and AI disclosures remain. The shrunk-frame +step was prepared by Joel Pulikkan with Anthropic Claude assistance. diff --git a/research/shrunk-frames/SOURCE.json b/research/shrunk-frames/SOURCE.json new file mode 100644 index 0000000000..3c72b59a02 --- /dev/null +++ b/research/shrunk-frames/SOURCE.json @@ -0,0 +1,85 @@ +{ + "attribution": "Avi Eisenberg / ikeboy (PR62 and PR110, Anthropic Claude assistance); Rohan Arun (PR111, Anthropic Claude assistance); Swapnil Jain (round-seven bit word); icekylinx (retained stopped-product, copied-center and finite assembly interfaces); Zhihao Chen and RaD (retained assembly). PR117 scalar DAG is separate upstream work by eumemic with Anthropic Claude assistance, retained byte for byte with its original attribution. PR125 shrunk-frame step by Joel Pulikkan with Anthropic Claude assistance. PR122 terminal-role elimination by SovereignSteak is the predecessor for source-time redirects. Their work is preserved and cited; the fixed-parent composition, candidate generation, independent audit, and certificate integration were prepared with OpenAI Codex assistance. Original source notices remain authoritative.", + "package_files": { + "README.md": "ad2c1d9efa34895d13409ccb22301a975e60463fc2dca84460a93cb9a96eec9e", + "bit-profile.json": "7293f330518b78650bd86d76b93681e43f3a55541cdb8110993714148a4b4a6a", + "bit_round7.py": "35d261a9248c2e06f9179e3c47e554a96b8fe763a9a3de2731256b8c0fbc74b0", + "certificate.json": "a01c78475fd3eac03cde6610a47866176852c6a7dc2375645f599f6e36a54125", + "certificate.py": "f5daca7c764595db596a33f84ac9224a56d085ddaf7381a283d0ba53fd01f78a", + "complex-profile.json": "5d0f6c0d455f187bea24a990560880b11f81bf44281b399cbf40cf00dc3a4bad", + "complex_deferred.py": "fa1125e85ec73b185dc9eee117f62d10356bb6422c07ec793a7f77296c87707e", + "controls/pr114-complex-profile.json": "a54d2a6023ff73f7476057b5f6a4ff02e65ded840b7254d906aadde2dd01940d", + "controls/pr125-complex-profile.json": "7e7c0c28c0983d117b3006b96719a6102ce31ec0273160dd7fc8b9a0fef0dbeb", + "inputs/complex-dag.json.gz": "3c034d0aae388ef567a454826f4f48b26fd8a94c71e8ffed4835271b349a783b", + "inputs/deferred_23.json.gz": "8c38e947ff9e021e308000dd82bb5e2194eb265d8b75194e22ce783d3e75317c", + "inputs/witness_23.json.gz": "b2486aa2bb222bacea6e52162a3920780e45dd8edc5d7cb03eabea336a1c6588", + "prepare.py": "a6bfc5a547a98575ee9fff0cf3572841981c14bda2005e6bb38601d75b11680b", + "producer.py": "017e50713943e6c2a98d1c23ec93e7da9580896de1b6bde24563b4b6961c74c0", + "reflection-audit.json": "7caee26f3747b88b41137527175d41b08c4849a7302368bd50b1cfae74779c5a", + "reflection_audit.py": "6761fb01f93ef89f2455388b2f5a71f19c0bbd870e6aaeba457ede0a949a163b", + "replayed_producer.py": "99c1e3694ae06a7ce7a370b04ecb45ea3fcfe69a6e6e7f4c4606e0a6c74c3184", + "terminal-elision-audit.json": "976d0f873521142a1e1ccacd06357daafb350232690a56191932cd647acc2c0d", + "terminal-elision.json.gz": "2c199d3df56bdeedf0832a23ddf1dea1330724182378c67188aead06c53a0d9b", + "terminal-selection.json": "96ca9b7a465041aa333149a9695bce1b392616279b16effa66ebee11bd91306b", + "terminal_elision.py": "f1113d3a1e6bd2fc3cd906a24db9c9d8ccff17c548de6096e556284684ac0d4b", + "terminal_elision_audit.py": "0c19cbc0389c4a668a22561ee4529472022e2e0819783e36e488c5043068f540", + "test_controls.py": "41b8de5feb8620fb6eb3964f800a8039c4ce409ef28f067e3d1aae083dad9a07", + "verify.py": "867b9314427fa33549d6f78daae0fa05ea6c8f1dd1342b2d73f9fc7945e4f1a3" + }, + "provenance": { + "base": "https://github.com/CrocSwap/integer-mult-bounds/pull/110", + "cyclic_strips": "https://github.com/CrocSwap/integer-mult-bounds/pull/111", + "round7_commit": "741e7aa078392553815df7926ee17ac5e25a8c38", + "round7_repository": "https://github.com/Swapnil-jain/integer-mult-kappa", + "round7_sha256": { + "deferred_23.json.gz": "8c38e947ff9e021e308000dd82bb5e2194eb265d8b75194e22ce783d3e75317c", + "witness_23.json.gz": "b2486aa2bb222bacea6e52162a3920780e45dd8edc5d7cb03eabea336a1c6588" + }, + "saturated_base": { + "commit": "7dfa16edfa5d6452f2b10dadcbef20d26222827e", + "pull_request": "https://github.com/CrocSwap/integer-mult-bounds/pull/114" + }, + "scalar_dag": { + "commit": "cbb05ce504d571546d9b7794c186a613c659c3bf", + "file": "inputs/complex-dag.json.gz", + "pull_request": "https://github.com/CrocSwap/integer-mult-bounds/pull/117", + "sha256": "3c034d0aae388ef567a454826f4f48b26fd8a94c71e8ffed4835271b349a783b" + }, + "shrunk_frame_parent": { + "commit": "dda535bdcfc321a13a1ebd3c2d70e2b5bb72368e", + "pull_request": "https://github.com/CrocSwap/integer-mult-bounds/pull/125" + }, + "terminal_elision": { + "commit": "b1a6f24e57141637b3ff040d6f2ce9d896ffb9bb", + "pull_request": "https://github.com/CrocSwap/integer-mult-bounds/pull/122" + } + }, + "reflection": { + "receipt": "reflection-audit.json", + "script": "reflection_audit.py" + }, + "repository_files": { + "certificates/copied-centers-network.json": "7dbd675e42e22ac076280360f8750031851564bb7a56079e66236fee5d0a6cdf", + "scripts/audit_short_guards.py": "c2c929c956e617bee739963b517b9069e0d067cfebc6820f401a4e90a1769eb1", + "scripts/certify.py": "2348d95008276c5d5764f7e028c3918e484582cd589bd4d9b82919161745e53e", + "scripts/compact_control_layer.py": "e814c9f8d84f2e5d3aa2e06c36697f27f110218addc40ff8df2801fde861ff9f", + "scripts/complex_circuit.py": "d623617f7c5cb3189580883a8ab30c0bd3832688ae3f1f0c1f881bbbbff8e0c1", + "scripts/complex_network.py": "0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b", + "scripts/copied_centers/__init__.py": "13db4f09038a2ff5335cbd4dbd93274b0fb16b3c7b51e4de67cbb2801a3f78e1", + "scripts/copied_centers/corners.py": "9eecdc39c67cc18c806a33f0be03986c28591d322881fd60c11f52c625c8067b", + "scripts/copied_centers/physical.py": "837345d1f8753eab0e70f105b1d1bb0db965b993da037b1825ddef3672609d7d", + "scripts/copied_centers_network.py": "409ebfbd8a41c4c4d089aa0949fcf5a949415dc26f57440ffd48b7bd8881e6a9", + "scripts/exclusion_circuit.py": "b253f9d7318becda1c1f3b24e2287ed44a9c27fcea00cf9d531afb950d0457a0", + "scripts/fast_gaussian.py": "11430c2df0783b933dc91080595bb7514bb052b8c7b12107e27a1ef701e31e43", + "scripts/paired_exclusion_circuit.py": "8f05f04cf06217befd6d0ee0f2d7d0c5c5eb32cfab8c9a8ca7917fd6d620b7d2", + "scripts/paired_network.py": "991223dc3c1374284c361ed017e42bf732dd971fa0bea2be2282cfb18257b3f7", + "scripts/partial_swap_network.py": "acdd81b4dea2815f8838a0c3ea8ac4968f2bc13fd7c99173473d865779096782", + "scripts/prepare_layers.py": "a6e2adc612f264b1c0e51d18ce6315de9ae5e2ae2420aa22e99a22d8bf304947", + "scripts/search_network.py": "3a4faa5037d9b8e7ca5828afac193a96b6966a8b114f14937921795b24ec4f6a", + "scripts/shared_point_circuit.py": "c9bb7a5df92d260a4e3ad532b53e26936730d7c93f7facfb0784957c1e81c8ba", + "scripts/shared_point_network.py": "a85e7f0d8c42d6a27e3846308571ca324a1824ac5c2d59e4daa5c7673c33c697", + "scripts/structured_bulk_assembly.py": "e99467e14211fba699878ed036e1e2362eb8e395dc22f9ecdcecc7fbf2cc736d" + }, + "schema": 2, + "scope": "Frozen finite terminal-elided producer, profiles, exact assembly, parent reflection and independent terminal audit; inherited all-size transfer remains conditional." +} diff --git a/research/shrunk-frames/bit-profile.json b/research/shrunk-frames/bit-profile.json new file mode 100644 index 0000000000..36105e819a --- /dev/null +++ b/research/shrunk-frames/bit-profile.json @@ -0,0 +1,69 @@ +{ + "h": 23, + "v": 1771, + "R": 28866, + "m": 529, + "N": 3136441, + "W": 108516254, + "L": 1792252, + "total_rank": 57403754177, + "deficit": 1344189, + "maxchild": 528, + "deferred_slots": 11565, + "source": { + "repository": "https://github.com/Swapnil-jain/integer-mult-kappa", + "commit": "741e7aa078392553815df7926ee17ac5e25a8c38", + "sha256": { + "witness_23.json.gz": "b2486aa2bb222bacea6e52162a3920780e45dd8edc5d7cb03eabea336a1c6588", + "deferred_23.json.gz": "8c38e947ff9e021e308000dd82bb5e2194eb265d8b75194e22ce783d3e75317c" + } + }, + "child_multiplicities": { + "1": 239511811, + "2": 238288050, + "3": 53377940, + "4": 46970462, + "5": 23632224, + "6": 7409864, + "7": 4105178, + "8": 5755750, + "9": 2082696, + "10": 878416, + "11": 1388464, + "12": 1080310, + "13": 945714, + "14": 226688, + "15": 2451064, + "16": 1508892, + "17": 4771074, + "18": 2149994, + "19": 7367360, + "20": 8182020, + "21": 1466388, + "22": 88550, + "484": 6272882, + "506": 61280142, + "507": 545468, + "508": 173558, + "509": 293986, + "510": 580888, + "511": 14168, + "512": 322322, + "513": 17710, + "514": 1129898, + "515": 127512, + "516": 410872, + "517": 99176, + "518": 1186570, + "519": 340032, + "520": 322322, + "521": 106260, + "522": 1583274, + "523": 626934, + "524": 2854852, + "525": 13711082, + "526": 4629394, + "527": 5653032, + "528": 6233920 + } +} diff --git a/research/shrunk-frames/bit_round7.py b/research/shrunk-frames/bit_round7.py new file mode 100644 index 0000000000..3c5df409a6 --- /dev/null +++ b/research/shrunk-frames/bit_round7.py @@ -0,0 +1,129 @@ +#!/usr/bin/env python3 +"""One-child bit profile of Swapnil Jain's round-seven deferred word (h=23), under PR104's opposite-bank rule. + +Reads the two frozen round-seven data files (vendored in inputs/; pinned by SHA-256 below) from a directory given on +the command line, e.g. a checkout of https://github.com/Swapnil-jain/integer-mult-kappa at +741e7aa078392553815df7926ee17ac5e25a8c38 (certificates/round7/), or PR97's imported copy +(research/deferred-signed/swapnil-round7/certificates/round7/). The frame dimensions are the ones recorded in +the data file; Swapnil's check_frames.py re-derives each of them exactly and PR97 replays the word. + +Every projector residual of rank r is one child of width r (PR104, notes/stopped-product-factorization.tex): + each slot: its chain steps from the deferral frame sigma_u to F, and one exterior child m - (h - dim sigma_u); + each retained centre: one copied transform of width h-1; + each target y_T: its chain 0 -> deferred readout levels -> t_T^perp; each data wire X_S: its chain of V frames; + each data pair: one data residual of width (h-1)^2 and one endpoint copy. +Usage: python3 research/deferred-stopped/bit_round7.py DIR (writes bit-profile.json next to this file) +Prepared by Avi Eisenberg (ikeboy) with Anthropic Claude assistance. Apache-2.0. +""" +import gzip +import hashlib +import json +import sys +from collections import Counter, defaultdict +from itertools import combinations +from pathlib import Path + +HERE = Path(__file__).resolve().parent +PINS = {'witness_23.json.gz': 'b2486aa2bb222bacea6e52162a3920780e45dd8edc5d7cb03eabea336a1c6588', + 'deferred_23.json.gz': '8c38e947ff9e021e308000dd82bb5e2194eb265d8b75194e22ce783d3e75317c'} + + +def require(ok, msg): + if not ok: + raise SystemExit('FAIL: ' + msg) + + +def main(directory): + data = {} + for name, digest in PINS.items(): + raw = (Path(directory) / name).read_bytes() + require(hashlib.sha256(raw).hexdigest() == digest, 'pinned hash of ' + name) + data[name] = json.loads(gzip.decompress(raw)) + W, D = data['witness_23.json.gz'], data['deferred_23.json.gz'] + h = D['h']; R = D['R']; trip = list(combinations(range(h), 3)); v = len(trip); m = h * h; N = v * v + tid = {T: i for i, T in enumerate(trip)} + args = {int(n): (tuple(a) if a else None) for n, a in W['args'].items()} + late = {int(n): (list(e), list(l)) for n, (e, l) in W['late'].items()} + ops = [tuple(o[:2]) + (tuple(o[2]),) if o[0] == 'fan' else tuple(o) for o in D['ops']] + hold, start = D['hold'], D['start'] + out = {s: (c, tuple(T)) for s, c, T in D['out']}; ret = {s: c for s, c in D['ret']} + sigma = dict(zip(D['readout_order'], D['sigma'])); sel = set(D['readout_order']) + f = [0] * R + for s, B in sigma.items(): f[s] = len(B) + vstart = dict(zip(D['vleaf_slots'], D['vleaf_start'])) + node_dims = {n: d for n, d in D['node_dims']} + late_dims = {(n, tuple(lt)): d for n, lt, d in D['late_dims']} + pivslot = {o[3]: o[1] for o in ops if o[0] == 'add'} + + def start_key(s): + n0 = hold[s][0] + if args[n0] is None: return ('v', s) + st = start[s]; k = st[2] if len(st) > 2 else None; dec = late.get(n0) + if dec is None or k in dec[0]: return ('n', n0) + lt = dec[1]; return ('c', n0, tuple(lt[lt.index(k):])) + + def chain(s): + ch = [('sigma', s) if s in sel else ('0',), start_key(s)] + for idx, n in enumerate(hold[s]): + if idx > 0: ch.append(('n', n)) + if args[n] is not None and pivslot.get(n) == s and n in late: + lt = late[n][1] + for i in range(len(lt) - 1): ch.append(('c', n, tuple(lt[i:]))) + if s in out: ch.append(('out',)) + if s in ret: ch.append(('ret',)) + ch.append(('F',)); return ch + + def dim(key): + k = key[0] + if k == '0': return 0 + if k == 'F': return h + if k in ('out', 'ret'): return h - 1 + if k == 'n': return node_dims[key[1]] + if k == 'c': return late_dims[key[1], key[2]] + if k == 'sigma': return f[key[1]] + if k == 'v': return len(vstart[key[1]]) + raise KeyError(key) + + # garbage supports (transpose sweep) for the deferred levels on each target + cov = [set() for _ in range(R)] + for s, (c, T) in out.items(): cov[s].add(tid[T]) + for s, c in ret.items(): cov[s].update(t for t, T in enumerate(trip) if c in T) + for o in reversed(ops): + if o[0] == 'add': cov[o[2]] |= cov[o[1]] + elif o[0] == 'fan': + for g in o[2]: cov[o[1]] |= cov[g] + levels = defaultdict(set) + for s in sel: + for t in cov[s]: levels[t].add(f[s]) + + z = Counter() + for s in range(R): + ds = [dim(k) for k in chain(s)] + require(all(b >= a for a, b in zip(ds, ds[1:])) and ds[-1] == h, 'monotone chain %d' % s) + for a, b in zip(ds, ds[1:]): + if b > a: z[b - a] += 2 * v + z[m - (h - f[s])] += 2 * v + z[h - 1] += 2 * v * h + for t in range(v): + ls = sorted(levels[t] | {0, h - 1}) + for a, b in zip(ls, ls[1:]): z[b - a] += 2 * v + for n, us in D['xs_order']: + ds = [1] + [len(vstart[s]) for s in us] + [h] + ds = [d for i, d in enumerate(ds) if i == 0 or d != ds[i - 1]] + require(all(b > a for a, b in zip(ds, ds[1:])), 'data-wire chain') + for a, b in zip(ds, ds[1:]): z[b - a] += 2 * v + z[(h - 1) ** 2] += 2 * N + z[1] += N + Wb = 2 * N + 2 * v * R; L = 2 * v * h * (h - 1); s_ = Wb * m - N + L + require(sum(t * c for t, c in z.items()) == s_, 'bit rank mass') + require(all(0 < t < m for t in z), 'children below m') + prof = dict(h=h, v=v, R=R, m=m, N=N, W=Wb, L=L, total_rank=s_, deficit=N - L, maxchild=max(z), + deferred_slots=len(sel), source=dict(repository='https://github.com/Swapnil-jain/integer-mult-kappa', + commit='741e7aa078392553815df7926ee17ac5e25a8c38', sha256=PINS), + child_multiplicities=dict(sorted(z.items()))) + (HERE / 'bit-profile.json').write_text(json.dumps(prof, indent=1) + '\n') + print('PASS bit: R=%d, deferred slots %d, maxchild %d, rank mass %d' % (R, len(sel), max(z), s_)) + + +if __name__ == '__main__': + main(sys.argv[1] if len(sys.argv) > 1 else '.') diff --git a/research/shrunk-frames/certificate.json b/research/shrunk-frames/certificate.json new file mode 100644 index 0000000000..e05112a0d5 --- /dev/null +++ b/research/shrunk-frames/certificate.json @@ -0,0 +1,319 @@ +{ + "actual_bit_saving": "1240189553/10000000000000", + "assembly": { + "absorption_gap": "557032412576896498489298147183996879/625138625140352841779654201806778107000000000000000", + "margins": { + "Gaussian_arithmetic": "83176958657204508460531060345798193221893/500110900112282273423723361445422485600000000", + "bulk_exposure": "13862514243221893/125000000000000000000", + "compact_phase_layer": "69312569136732342379230293221893/625138625140352841779654201806778107", + "coordinate_movement": "13862514243221893/125000000000000000000", + "dimension": "624999993750000000000000000000000000/625138625140352841779654201806778107", + "original_prefix": "6931882052298374590764808976391106778107/62513862514035284177965420180677810700000000", + "scalar_work": "110904487143648283370519665768283793221893/500110900112282273423723361445422485600000000" + }, + "minimum_margin": "69312569136732342379230293221893/625138625140352841779654201806778107", + "parameters": { + "C0": 3426040043121653543815319427886146346182658660878546938204156655506654200461993667857481728, + "C1": 1, + "a_bit": "13862514243221893/125000000000000000000", + "a_complex": "13862528107/125000000000000", + "alpha_squared_power": "103971979744787061016716050000000/625138625140352841779654201806778107", + "beta": "1/1000000", + "c": "69312570522983738976391106778107/625000000000000000000000000000000000", + "delta": "1/800000000", + "epsilon": "624999993750000000000000000000000000/625138625140352841779654201806778107", + "eta": "1/100000000", + "kappa": "110875518403/1000000000000000", + "lambda_": "12498613748589540324943221893/12500000000000000000000000000", + "lambda_prime": "6249306874301701419593221893/6250000000000000000000000000", + "q": "693125698298580406778107/6250000000000000000000000000", + "sigma": "124986137471893/125000000000000", + "tau": "124986137485756778107/125000000000000000000" + }, + "recurrence": { + "internal": "124986137485756778107/125000000000000000000", + "leaf": "124986137485755528107/125000000000000000000", + "reservations": "624930687429477016261023608893221893/625000000000000000000000000000000000" + }, + "strict_constraints": { + "Gaussian_arithmetic_above_kappa": "34658629185330325609010428708844039674550246879/625138625140352841779654201806778107000000000000000", + "K_dominates_log": "6931256982985803374655371701419593221893/62513862514035284177965420180677810700000000", + "K_geometry": "6931882052298374590764808976391106778107/62513862514035284177965420180677810700000000", + "alpha_below_one": "625034653160608054718637485756778107/625138625140352841779654201806778107", + "alpha_below_one_fourth": "624722737221373693535587337606778107/2500554500561411367118616807227112428", + "alpha_positive": "103971979744787061016716050000000/625138625140352841779654201806778107", + "artificial_boundary": "3500914932801606006024344038389148168593221893/500110900112282273423723361445422485600000000", + "beta_below_one": "999999/1000000", + "beta_positive": "1/1000000", + "bit_positive": "13862514243221893/125000000000000000000", + "bulk_exposure_above_kappa": "3074442846893/125000000000000000000", + "c_below_one": "624930687429477016261023608893221893/625000000000000000000000000000000000", + "c_positive": "69312570522983738976391106778107/625000000000000000000000000000000000", + "cell_above_band": "624965334339391945281362514243221893/1250277250280705683559308403613556214", + "compact_leaf": "13925014243221893/6250000000000000000000000000", + "compact_phase_layer_above_kappa": "557032412576896498489298147183996879/625138625140352841779654201806778107000000000000000", + "compact_reservations": "693125698298580406778107/625000000000000000000000000000000000", + "complex_above_bit": "13863778107/125000000000000000000", + "complex_below_one_over32": "3892387471893/125000000000000", + "coordinate_movement_above_kappa": "3074442846893/125000000000000000000", + "delta_below_one_eighth": "99999999/800000000", + "delta_positive": "1/800000000", + "dimension_above_kappa": "624930681180863824690033346603276596298147183996879/625138625140352841779654201806778107000000000000000", + "epsilon_below_one": "138631390352841779654201806778107/625138625140352841779654201806778107", + "epsilon_positive": "624999993750000000000000000000000000/625138625140352841779654201806778107", + "gamma_sublinear": "34659410608054718637485756778107/625138625140352841779654201806778107", + "guard_width": "138631390352841779654201806778107/625138625140352841779654201806778107", + "lambda_above_internal": "13862514243221893/12500000000000000000000000000", + "lambda_above_sigma": "1400240324943221893/12500000000000000000000000000", + "lambda_above_tau": "13862514243221893/12500000000000000000000000000", + "lambda_prime_above_lambda": "13862514243221893/12500000000000000000000000000", + "lambda_prime_below_one": "693125698298580406778107/6250000000000000000000000000", + "leaf_saving_above_bit": "1/100000000000000", + "literal_scalar_guard": "13633582372644121063429594327546009455025980", + "original_prefix_above_kappa": "6251386808435940994693040507365928253996879/625138625140352841779654201806778107000000000000000", + "phase_boundary": "83176958657204508460531060345798193221893/500110900112282273423723361445422485600000000", + "phase_local": "110904487143648283370519665768283793221893/500110900112282273423723361445422485600000000", + "prime_interval_packing": "138631390352841779654201806778107/625138625140352841779654201806778107", + "q_below_internal": "13862514243221893/6250000000000000000000000000", + "q_below_leaf": "13925014243221893/6250000000000000000000000000", + "q_below_reservations": "693125698298580406778107/625000000000000000000000000000000000", + "q_positive": "693125698298580406778107/6250000000000000000000000000", + "record_suffix": "138631390352841779654201806778107/625138625140352841779654201806778107", + "row_product_gap": "6389/25", + "scalar_work_above_kappa": "69318039793385044246496185486951039674550246879/625138625140352841779654201806778107000000000000000", + "short_record_fallback": "78116333225655003706971835749846717729347970410584503449/78142328142544105222456775225847263375000000000000000000", + "small_field_exposure": "69318821216109437274971513556214/625138625140352841779654201806778107" + } + }, + "bit_moment_gap": "210811394225115117568018038513239592855337768061996351784199300828041381607148420475711921673436778332750996651783152394205578153858435663243959795913385215868392831844509655226993164072062830500832781615792327068936897853818968534771730481866850519439187068953062899333771640996075361901014500735179763112430083120460814689994116646689670445286414265265018468311435502209195246240538069975559360544007937885404793780372701951022292660282948582656517071290400479729799954952580125532795274568021525151839594883237275569314958070368193662075730567130277424969924134425921633872848924585639423998410253779062359718371205767101510073996880454144801457072151080008705648366603197414406872289670642046369219405455128737300640897667220951127018547660455087533581513233999285275099394371781290865408274484542745086391849285198194905751058992419590161634431610100995441112613134240446609058758039909343152776920263419910572835208525277494067408376961456317/225678505065634612156474913616400633538202019254665477026878220214422133931127460164253533068001699469116755578965090566731480236912032281717920888140691998261537790258547549397061712443744511202265657747547567084090291301783866427704803156891369853685579999500594559805069402727752752227038426964007028952158078563045054314475625278140097385695241851533235641996467089273692960018822280793234080014352234618229252999217015923728814468917104222554059646947960375336061268431587018084270516494408656203498548153054913267707164839939006583338918817922618882667407408888179421052689449193499742148706302504238261936554897181289081072466758282367100305194479622149878636307463869297507337915811001244472279386614413535081936912313821531543735588465392499062010570720287729070905437080967709221039366272598541269000920375996285867953823816142239661027100714288630069735295241672325865922423925213948613346461034734632365263739073012128769510020000000000000000000000", + "bit_parameter": "13862514243221893/125000000000000000000", + "bit_profile": { + "L": 1792252, + "N": 3136441, + "R": 28866, + "W": 108516254, + "child_multiplicities": { + "1": 239511811, + "10": 878416, + "11": 1388464, + "12": 1080310, + "13": 945714, + "14": 226688, + "15": 2451064, + "16": 1508892, + "17": 4771074, + "18": 2149994, + "19": 7367360, + "2": 238288050, + "20": 8182020, + "21": 1466388, + "22": 88550, + "3": 53377940, + "4": 46970462, + "484": 6272882, + "5": 23632224, + "506": 61280142, + "507": 545468, + "508": 173558, + "509": 293986, + "510": 580888, + "511": 14168, + "512": 322322, + "513": 17710, + "514": 1129898, + "515": 127512, + "516": 410872, + "517": 99176, + "518": 1186570, + "519": 340032, + "520": 322322, + "521": 106260, + "522": 1583274, + "523": 626934, + "524": 2854852, + "525": 13711082, + "526": 4629394, + "527": 5653032, + "528": 6233920, + "6": 7409864, + "7": 4105178, + "8": 5755750, + "9": 2082696 + }, + "deferred_slots": 11565, + "deficit": 1344189, + "h": 23, + "m": 529, + "maxchild": 528, + "source": { + "commit": "741e7aa078392553815df7926ee17ac5e25a8c38", + "repository": "https://github.com/Swapnil-jain/integer-mult-kappa", + "sha256": { + "deferred_23.json.gz": "8c38e947ff9e021e308000dd82bb5e2194eb265d8b75194e22ce783d3e75317c", + "witness_23.json.gz": "b2486aa2bb222bacea6e52162a3920780e45dd8edc5d7cb03eabea336a1c6588" + } + }, + "total_rank": 57403754177, + "v": 1771 + }, + "coarse_bit_saving": "620523/5000000000", + "complex_moment_gap": "343272080630150061189318554879278970429390461960207452888261102284395992147112214104981691964642847817662879194895425627595540850146383403451025535105998480397343974698971244140511723022405117701236953066586795544133059823517982486828291217097437122775065789911353551923443644554260399558519091019382631557268856449798721505946102590641947223236837091431432637193891149393584519407186819218142377524272785517778411966162979721057314220987546244137031446591675175716041817314010973898353083548874331992542639637086729775614136853138671789145795646689610670173639742110813694106279946410956614245558993424410020478380701924104934123018785430406941083460859260138145646374695961893752386818710913309273345900716078178823853705584027817412725136580175957920677369492034343982607681889908744614556512102766805713935321159313394869815570197279209055695754843000950448512194074525732880346134457391550946822990145861114265757196100752224520725544484017126377905420734572846280927230005198689051222513/17439433657404011074662187660744069797624553118500204281557364814356620735850705512640080619576829469814105515501244532067397351389856605459127863094857335395667145595552012665882486097968043144705966337990892032064205766373561352755916316614926173447276353382252898934529584974823242311875359545118942641640403022138971839899233999861276878201442028864490675925354197338399023495631110944132315483025485479775232284712403188211178924680208139588440493601654068635257608862896533015068627740031559156485844596970211846608109574309301722055551935098159093575001959416174483127056399684350349744198268480225651129147980439477758926364194765127813475155804119186108461925620535725728369250091719362578459239438281177320746439728540552587511512762252190210082112221102554499300393854418730651063476707314283494479444669689828910833583045849557483500963189603912096956194275741810416959473087530926174334113825204187291825602374845853959808312040020395414628051315433743325044045752463168000000000000000000000000000", + "complex_profile": { + "L": 2234496, + "N": 4096576, + "R": 28324, + "W": 122848704, + "additions": 91770, + "child_multiplicities": { + "1": 433937504, + "10": 7375456, + "11": 7019232, + "12": 31788944, + "13": 12536656, + "14": 1497760, + "15": 3428656, + "16": 854128, + "17": 506000, + "18": 2906464, + "19": 2092816, + "2": 267176096, + "20": 817696, + "21": 1230592, + "22": 64768, + "23": 8363168, + "3": 28506016, + "4": 60554032, + "5": 26356528, + "529": 8193152, + "552": 97147952, + "554": 3493424, + "556": 1445136, + "558": 2319504, + "560": 570768, + "562": 101200, + "564": 1307504, + "566": 975568, + "568": 1364176, + "569": 4048, + "570": 3574384, + "571": 1853984, + "572": 105248, + "573": 28336, + "574": 364320, + "6": 15734576, + "7": 11876832, + "8": 22077792, + "9": 4562096 + }, + "deferred_dims": { + "10": 25, + "12": 323, + "14": 241, + "16": 337, + "17": 1, + "18": 883, + "19": 458, + "2": 863, + "20": 26, + "21": 7, + "22": 90, + "4": 357, + "6": 573, + "8": 141 + }, + "deferred_roles": 4325, + "deficit": 1862080, + "h": 24, + "lifted_additions": 24792, + "links": 71185, + "m": 576, + "maxchild": 574, + "phase_one_ops": 18844, + "phase_one_roles": 13555, + "pre_elimination_R": 28705, + "replay": { + "field": "Z/(2^61-1)", + "scratch_restored": true, + "seeds": [ + 1, + 2 + ], + "y_plus_x": true + }, + "role_count_scope": "Terminal-elided physical word; additions + roots - links is pre-elimination.", + "roots": 8120, + "terminal_direct_updates": 1167, + "terminal_elimination_count": 381, + "total_rank": 70758991424, + "v": 2024 + }, + "complex_saving": "13862528107/125000000000000", + "finite_bridge": { + "bit_coarse": { + "W": 108516254, + "halving_degree": 367, + "m": 529, + "maxchild": 528, + "wire_bits": 27 + }, + "complex": { + "W": 122848704, + "halving_degree": 200, + "m": 576, + "maxchild": 574, + "s": 70758991424, + "scalar_group_upper": 59723114017600, + "scalar_terms": [ + { + "R": 28324, + "c": 91770, + "description": "Expanded deferred readouts, source-time terminal redirects, and forward/inverse/reflected words", + "h": 24, + "invocations": 2024, + "local_group_upper": 14753732688, + "q": 8120, + "terminal_direct_updates": 1167, + "v": 2024 + }, + { + "R": 28324, + "c": 91770, + "description": "Expanded deferred readouts, source-time terminal redirects, and forward/inverse/reflected words", + "h": 24, + "invocations": 2024, + "local_group_upper": 14753732688, + "q": 8120, + "terminal_direct_updates": 1167, + "v": 2024 + } + ], + "wire_bits": 27 + }, + "ordinary_leaf_row_degree": 252, + "rows": { + "coefficient": 15561, + "contract": "W_complex^D_complex * W_coarse^D_coarse * W_old^D_old; prefix and padding; sequential reuse", + "degree": 32000, + "degree_gap": "6389/25", + "suffix_slope": 128000 + }, + "semantic": { + "B": 13633582372645923722500537180244156907845248, + "C0": 3426040043121653543815319427886146346182658660878546938204156655506654200461993667857481728, + "C1": 1, + "E": 13633582372645923722500537180244086148853824, + "exact_grid": "2^(-P)*21^(-K), K=G*(D_complex+1); completed children preserve incoming odd denominator; no child rounding", + "fixed_odd_divisor": 21, + "induction_gap": 40900747117937771167501611540732470723535744, + "literal_charge": 1802659070942852698076693827844, + "strict_literal_gap": 13633582372644121063429594327546009455025980 + } + }, + "kappa": "110875518403/1000000000000000", + "next_grid_rejections": { + "bit": "1e-10", + "complex": "1e-12", + "kappa": "1e-15" + }, + "status": "Finite conditional cyclic/deferred witness" +} diff --git a/research/shrunk-frames/certificate.py b/research/shrunk-frames/certificate.py new file mode 100644 index 0000000000..a6b213ebb7 --- /dev/null +++ b/research/shrunk-frames/certificate.py @@ -0,0 +1,116 @@ +#!/usr/bin/env python3 +"""Exact finite assembly for cyclic strips with deferred readouts. + +Built on Avi Eisenberg's PR110 (Anthropic Claude assistance), icekylinx's +PR104 stopped-product and copied-center interfaces, and Zhihao Chen's +assembly of the RaD interfaces. Integration for eumemic with OpenAI Codex +assistance. Apache-2.0. General transfer hypotheses remain inherited. +""" +import argparse +import json +import sys +from fractions import Fraction as Q +from pathlib import Path +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +sys.path.insert(0, str(ROOT / 'scripts')) +from partial_swap_network import moment +from copied_centers_network import finite_bridge as copied_bridge +from structured_bulk_assembly import assembly, js +ATOM = Q(1, 1000) +OLD = Q(384599, 10**10) +BETA = Q(1, 10**6) +COARSE = Q(620523, 5000000000) +COMPLEX = Q(13862528107, 125000000000000) +KGRID = 10**15 + +def profile(name): + p = json.loads((HERE / name).read_text()) + p['child_multiplicities'] = {int(t): c for t, c in p['child_multiplicities'].items()} + z = p['child_multiplicities'] + assert all(0 < t < p['m'] and c > 0 for t,c in z.items()) + assert sum(t*c for t,c in z.items()) == p['total_rank'] == p['W']*p['m']-p['N']+p['L'] + assert max(z) == p['maxchild'] + return p + +def contracts(p, a): + try: moment(p['m'],p['W'],p['child_multiplicities'],a,True) + except ValueError: return False + return True + +def exact(bit=None, phase=None): + bit = profile('bit-profile.json') if bit is None else bit + phase = profile('complex-profile.json') if phase is None else phase + assert (bit['h'], phase['h']) == (23,24) + bm = moment(bit['m'],bit['W'],bit['child_multiplicities'],COARSE,True) + cm = moment(phase['m'],phase['W'],phase['child_multiplicities'],COMPLEX,True) + assert not contracts(bit,COARSE+Q(1,10**10)) + assert not contracts(phase,COMPLEX+Q(1,10**12)) + ab = (1-ATOM)*COARSE+ATOM*OLD + assert 0 < OLD < COARSE < ATOM and ab < ATOM + a = min(ab,(1-BETA)*COMPLEX-Q(1,10**14)) + row = dict(h=phase['h'],v=phase['v'],c=phase['additions'],central_disjoint=24) + bridge = copied_bridge(bit,phase,[row,row]) + # Logical readouts are expanded into same-frame shears with |coefficient|<=1. + # Exact numerators over42 are split into signed42 chunks and a remainder. + # The independent audit counts every chunk and checks this guard covers it. + # Each row has <=c+R mixer operations and <=R leaf copies. There are + # <=R+q readouts, each containing <=h center coefficients and <=v direct + # coefficients; <=4*v*(h+1) scalar groups suffice per readout. A factor + # eight covers forward/inverse words, both reflected words, and copies. + h,v,R,q,c = (phase[k] for k in ('h','v','R','roots','additions')) + terminal_direct_updates = phase.get('terminal_direct_updates', 0) + local = 8*(c+2*R+(R+q)*v*(h+1)+h*h+h+1+terminal_direct_updates) + G = phase['N'] + 2*v*local + m,W,s = (phase[k] for k in ('m','W','total_rank')) + E=64*(W+m+G+1)**3 + charge=2*G*W*W+8*s+4*W+4+32*m + B=s+E; C0=32*m*B*B + assert charge= s+E and 2*B+181: + mid=(lo+hi)//2 + if accepts(mid): lo=mid + else: hi=mid + k=Q(lo,KGRID) + assembled=assembly(a,COMPLEX,bridge,k,beta=BETA) + assert len(assembled['strict_constraints'])==47 and len(assembled['margins'])==7 + assert not accepts(lo+1) + return dict(status='Finite conditional cyclic/deferred witness',kappa=k, + complex_saving=COMPLEX,coarse_bit_saving=COARSE,actual_bit_saving=ab, + bit_parameter=a,complex_profile=phase,bit_profile=bit, + bit_moment_gap=bm['strict_gap'],complex_moment_gap=cm['strict_gap'], + finite_bridge=bridge,assembly=assembled, + next_grid_rejections=dict(bit='1e-10',complex='1e-12',kappa='1e-15')) + +def main(): + parser=argparse.ArgumentParser();parser.add_argument('--write',action='store_true');args=parser.parse_args() + assert not sys.flags.optimize + result=js(exact()); path=HERE/'certificate.json' + if args.write:path.write_text(json.dumps(result,indent=2,sort_keys=True)+'\n') + else:assert result==json.loads(path.read_text()),'Frozen exact certificate mismatch' + print('PASS conditional kappa = %s = %.12e; 47 constraints, 7 margins; expanded scalar charge' % (result['kappa'],float(Q(result['kappa'])))) +if __name__=='__main__':main() diff --git a/research/shrunk-frames/complex-profile.json b/research/shrunk-frames/complex-profile.json new file mode 100644 index 0000000000..98c6aca5f4 --- /dev/null +++ b/research/shrunk-frames/complex-profile.json @@ -0,0 +1,89 @@ +{ + "h": 24, + "v": 2024, + "additions": 91770, + "roots": 8120, + "links": 71185, + "R": 28324, + "m": 576, + "N": 4096576, + "W": 122848704, + "L": 2234496, + "total_rank": 70758991424, + "deficit": 1862080, + "maxchild": 574, + "phase_one_ops": 18844, + "phase_one_roles": 13555, + "deferred_roles": 4325, + "deferred_dims": { + "2": 863, + "4": 357, + "6": 573, + "8": 141, + "10": 25, + "12": 323, + "14": 241, + "16": 337, + "17": 1, + "18": 883, + "19": 458, + "20": 26, + "21": 7, + "22": 90 + }, + "lifted_additions": 24792, + "replay": { + "seeds": [ + 1, + 2 + ], + "scratch_restored": true, + "y_plus_x": true, + "field": "Z/(2^61-1)" + }, + "child_multiplicities": { + "1": 433937504, + "2": 267176096, + "3": 28506016, + "4": 60554032, + "5": 26356528, + "6": 15734576, + "7": 11876832, + "8": 22077792, + "9": 4562096, + "10": 7375456, + "11": 7019232, + "12": 31788944, + "13": 12536656, + "14": 1497760, + "15": 3428656, + "16": 854128, + "17": 506000, + "18": 2906464, + "19": 2092816, + "20": 817696, + "21": 1230592, + "22": 64768, + "23": 8363168, + "529": 8193152, + "552": 97147952, + "554": 3493424, + "556": 1445136, + "558": 2319504, + "560": 570768, + "562": 101200, + "564": 1307504, + "566": 975568, + "568": 1364176, + "569": 4048, + "570": 3574384, + "571": 1853984, + "572": 105248, + "573": 28336, + "574": 364320 + }, + "pre_elimination_R": 28705, + "terminal_elimination_count": 381, + "terminal_direct_updates": 1167, + "role_count_scope": "Terminal-elided physical word; additions + roots - links is pre-elimination." +} diff --git a/research/shrunk-frames/complex_deferred.py b/research/shrunk-frames/complex_deferred.py new file mode 100644 index 0000000000..d2190bc2b7 --- /dev/null +++ b/research/shrunk-frames/complex_deferred.py @@ -0,0 +1,606 @@ +#!/usr/bin/env python3 +"""Shrunk lifted frames and saturated deferred readouts on the PR117 complex DAG. + +After the role compile, a forward pass shrinks a lifted frame to the minimal +nondegenerate span of its label and predecessor frames when that merges +increments of the role chains holding it (16,031 frames). Section D rechecks +every chain. The shrink step was prepared by Joel Pulikkan with Anthropic +Claude assistance; everything else is PR114 (eumemic) unchanged. + + +PR117 credits its searched DAG to eumemic with Anthropic Claude assistance; +this experiment imports and replays that witness unchanged. PR110/PR114 +saturation and exact finite checks are applied to the resulting graph. +Logical readout macros are realized as signed numerator/42 chunks of magnitude +at most one. The literal audit expands and charges those same-frame shears, +checks exact reconstruction, and reverses the chunks under reflection. +Inherited Avi Eisenberg, Rohan Arun, icekylinx and Swapnil Jain credits retained. +This integration prepared with OpenAI Codex assistance. Apache-2.0. +""" +import array +import json +import random +import struct +import sys +import tempfile +from collections import Counter, defaultdict +from itertools import combinations +from pathlib import Path + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +sys.path.insert(0, str(ROOT / 'scripts')) +sys.path.insert(0, str(HERE)) +import importlib.util +producer_path = HERE / 'producer.py' +spec = importlib.util.spec_from_file_location('replayed_producer_wrapper', producer_path) +producer = importlib.util.module_from_spec(spec); spec.loader.exec_module(producer) +build = producer.build + +P = (1 << 61) - 1 +SHRUNK = 16031 + + +def require(ok, msg): + if not ok: + raise SystemExit('FAIL: ' + msg) + + +def load(prefix): + def rd(fh, typ, cnt): + a = array.array(typ); a.fromfile(fh, cnt); return a + with open(str(prefix) + '.bin', 'rb') as f: + h, v, n, q = struct.unpack('<4I', f.read(16)) + flat = rd(f, 'I', 2 * n); core = rd(f, 'Q', n); cover = rd(f, 'Q', n) + roots = rd(f, 'I', q); kind = rd(f, 'I', q); active = rd(f, 'B', n) + with open(str(prefix) + '.labels', 'rb') as f: + ranks = rd(f, 'I', n); types = rd(f, 'B', n) + args = [(flat[2 * i], flat[2 * i + 1]) for i in range(n)] + return h, v, n, q, args, core, cover, roots, kind, active, ranks, types + + +# ---------------------------------------------------------------- F2 linear algebra on bit vectors +def dot(a, b): return bin(a & b).count('1') & 1 + + +def reduce(basis): + rows = []; piv = [] + for vec in basis: + for p, r in zip(piv, rows): + if vec >> p & 1: vec ^= r + if vec: + p = vec.bit_length() - 1 + for i in range(len(rows)): + if rows[i] >> p & 1: rows[i] ^= vec + rows.append(vec); piv.append(p) + return rows + + +def kernel(funcs, h): + K = reduce(funcs); piv = [r.bit_length() - 1 for r in K] + out = [] + for c in (i for i in range(h) if i not in piv): + vec = 1 << c + for r, p in zip(K, piv): + if r >> c & 1: vec |= 1 << p + out.append(vec) + return out + + +def restrict(basis, funcs): + B = reduce(basis) + for f in funcs: + if not B: break + vals = [dot(b, f) for b in B] + if not any(vals): continue + k = vals.index(1); pv = B[k] + B = [b ^ pv if val else b for b, val in zip(B, vals)]; B.pop(k) + return reduce(B) + + +def contains(A, B): + RB = reduce(B) + return len(reduce(RB + list(A))) == len(RB) + + +def cap(A, B): + A = reduce(A); B = reduce(B) + if not A or not B: return [] + ker = []; red = [] + for i, vec in enumerate(A + B): + tag = 1 << i + for rv, rt in red: + if vec >> (rv.bit_length() - 1) & 1: vec ^= rv; tag ^= rt + if vec: red.append((vec, tag)) + else: + comb_ = 0 + for k in range(len(A)): + if tag >> k & 1: comb_ ^= A[k] + ker.append(comb_) + return reduce(ker) + + +def nondeg(B): + B = reduce(B); k = len(B) + if not k: return True + M = [sum(dot(B[i], B[j]) << j for j in range(k)) for i in range(k)] + return len(reduce(M)) == k + + +def hopcroft_karp(left, adj): + """maximum bipartite matching; adj[x] = sorted list of right vertices.""" + INF = 1 << 60 + mate_l = {x: None for x in left}; mate_r = {} + while True: + dist = {}; queue = [] + for x in left: + if mate_l[x] is None: dist[x] = 0; queue.append(x) + else: dist[x] = INF + found = INF; head = 0 + while head < len(queue): + x = queue[head]; head += 1 + if dist[x] >= found: continue + for r in adj[x]: + y = mate_r.get(r) + if y is None: found = min(found, dist[x] + 1) + elif dist[y] == INF: dist[y] = dist[x] + 1; queue.append(y) + if found == INF: break + gained = 0 + for x0 in left: + if mate_l[x0] is not None: continue + stack = [(x0, iter(adj[x0]))]; path = [] + while stack: + x, it = stack[-1] + advanced = False + for r in it: + y = mate_r.get(r) + if (y is None and dist[x] + 1 == found) or (y is not None and dist[y] == dist[x] + 1): + path.append((x, r)) + if y is None: + for xx, rr in path: mate_l[xx] = rr; mate_r[rr] = xx + gained += 1; stack = []; break + stack.append((y, iter(adj[y]))); advanced = True; break + else: + dist[x] = INF; stack.pop() + if path: path.pop() + continue + if not advanced: break + if not gained: break + return mate_l + + +from functools import lru_cache +from fractions import Fraction + +def sat_basis(vectors): + piv = {} + for x in vectors: + for p in sorted(piv, reverse=True): + if x >> p & 1: + x ^= piv[p] + if x: + p = x.bit_length() - 1 + for q in piv: + if piv[q] >> p & 1: + piv[q] ^= x + piv[p] = x + return tuple((piv[p] for p in sorted(piv, reverse=True))) + +def sat_dot(a, b): + return (a & b).bit_count() & 1 + +@lru_cache(None) +def sat_contained(A, B): + for x in A: + for r in B: + if x >> r.bit_length() - 1 & 1: + x ^= r + if x: + return False + return True + +@lru_cache(None) +def sat_cap(A, B): + if not A or not B: + return () + red = {} + out = [] + for i, x in enumerate(A + B): + tag = 1 << i + for p in sorted(red, reverse=True): + if x >> p & 1: + r, t = red[p] + x ^= r + tag ^= t + if x: + red[x.bit_length() - 1] = (x, tag) + else: + y = 0 + for j, r in enumerate(A): + if tag >> j & 1: + y ^= r + if y: + out.append(y) + return sat_basis(out) + +@lru_cache(None) +def sat_nondeg(B): + return len(sat_basis((sum((sat_dot(a, b) << j for j, b in enumerate(B))) for a in B))) == len(B) + +@lru_cache(None) +def sat_nonsingular_part(B): + rows = list(B) + out = [] + while rows: + i = next((i for i, x in enumerate(rows) if sat_dot(x, x)), None) + if i is not None: + a = rows.pop(i) + out.append(a) + rows = [x ^ a if sat_dot(x, a) else x for x in rows] + continue + pair = next(((i, j) for i in range(len(rows)) for j in range(i + 1, len(rows)) if sat_dot(rows[i], rows[j])), None) + if pair is None: + break + i, j = pair + a, b = (rows[i], rows[j]) + out.extend((a, b)) + rows = [x ^ (a if sat_dot(x, b) else 0) ^ (b if sat_dot(x, a) else 0) for k, x in enumerate(rows) if k not in (i, j)] + return sat_basis(out) + +def saturated_placement(cand, reach): + # Each extracted block is orthogonal to previously selected blocks. + # A diagonal-one pivot contributes a nondegenerate line; when all + # remaining diagonals vanish, a dot-one pair contributes a hyperbolic + # plane. The residual radical is discarded, not counted as a frame. + cand = {s: sat_basis(B) for s, B in cand.items()} + order = sorted(cand, key=lambda s: (Fraction(-(1 << len(cand[s])), max(1, len(reach[s]))**2), -len(cand[s]), s)) + byT = defaultdict(list); placed = {} + for s in order: + X = cand[s]; changed = True + while changed and X: + changed = False + for t in sorted(reach[s]): + for w in byT[t]: + B = placed[w] + if (len(B) >= len(X) and not sat_contained(X, B)) or (len(B) < len(X) and not sat_contained(B, X)): + X = sat_cap(X, B); changed = True + if not X: break + if not X: break + if X and not sat_nondeg(X): + before = X; X = sat_nonsingular_part(X) + assert sat_contained(X, before) and sat_nondeg(X) + assert len(X) < len(before) + changed = True # Extraction can break containment of a smaller target frame. + if X: + assert sat_nondeg(X) and sat_contained(X, cand[s]) + placed[s] = X + for t in reach[s]: byT[t].append(s) + for t, ss in byT.items(): + ss.sort(key=lambda s: (len(placed[s]), s)) + assert all(sat_contained(placed[a], placed[b]) for a, b in zip(ss, ss[1:])) + return placed + +def main(): + with tempfile.TemporaryDirectory(prefix='deferred-stopped-') as work: + prefix = Path(work) / 'complex' + build(24, prefix, central_disjoint=24) + h, v, n, q, args, core, cover, roots, kind, active, ranks, types = load(prefix) + trip = list(combinations(range(h), 3)); require(len(trip) == v, 'triple count') + m = h * h; N = v * v; FULL = (1 << h) - 1 + tmask = [sum(1 << p for p in T) for T in trip] + tid = {T: i for i, T in enumerate(trip)} + + # ------------------------------------------------------------ uses and matching (inherited adjacency) + degree = [0] * n; uses = defaultdict(list); c_add = 0 + for x in range(1, n): + if active[x] and args[x][0]: + c_add += 1 + for pos, y in enumerate(args[x]): degree[y] += 1; uses[y].append(('gate', x, pos)) + for j, x in enumerate(roots): degree[x] += 1; uses[x].append(('root', j)) + def unode(u): return roots[u[1]] if u[0] == 'root' else u[1] + def before(x, u): + y = unode(u) + return (ranks[x], x) < (ranks[y], (n + u[1]) if u[0] == 'root' else y) + def incl(x, y): + tx, ty = types[x], types[y] + if tx == 1 and ty == 1: return not (core[y] & ~core[x]) and not (cover[x] & ~cover[y]) + if tx in (1, 2) and ty == 2: return not (cover[x] & ~cover[y]) + if tx == 1 and ty == 3: return bool(core[x] & core[y]) + if tx == 2 and ty == 3: return not (cover[x] & ~core[y]) + if tx == 3 and ty == 2: return cover[y] == FULL + if tx == 3 and ty == 3: return core[x] == core[y] + return False + left = []; adj = {} + for x in range(1, n): + if not (active[x] and args[x][0]): continue + rs = sorted({(y, k) for y in args[x] for k, u in enumerate(uses[y]) if before(x, u) and incl(x, unode(u))}) + if rs: left.append(x); adj[x] = rs + mate = hopcroft_karp(left, adj) + links = {x: r for x, r in mate.items() if r is not None} + R = c_add + q - len(links) + require((c_add,q,len(links),R)==(91770,8120,71185,28705),'selected PR117 graph') + print('PR117 graph matched', c_add, q, len(links), R, flush=True) + linked_use = {(y, k): x for x, (y, k) in links.items()} + + # ------------------------------------------------------------ root targets, read coefficients, root functionals + target = [None] * q + for j in range(v): target[j] = j + idx = v + # PR117 witness stores pair-star roots in natural excluded-point order. + for a, b in combinations(range(h), 2): + others = [i for i in range(h) if i not in (a, b)] + for i in others: target[idx] = tid[tuple(sorted((a, b, i)))]; idx += 1 + centre_of = {} + for j in range(q): + if kind[j]: + miss = FULL & ~cover[roots[j]]; require(bin(miss).count('1') == 1, 'centre cover') + centre_of[j] = miss.bit_length() - 1 + require(idx + len(centre_of) == q, 'root order') + rootfun = [(1 << centre_of[j]) if kind[j] else tmask[target[j]] for j in range(q)] + + # ------------------------------------------------------------ lifted binary frames, monotone + succ = defaultdict(set); droot = defaultdict(set) + for x in range(1, n): + if not active[x]: continue + for k, u in enumerate(uses[x]): + if (x, k) in linked_use: continue + (succ[x].add(u[1]) if u[0] == 'gate' else droot[x].add(u[1])) + for x, (y, k) in links.items(): + u = uses[y][k]; (succ[x].add(u[1]) if u[0] == 'gate' else droot[x].add(u[1])) + order_desc = sorted((x for x in range(1, n) if active[x]), key=lambda x: (ranks[x], x), reverse=True) + K = {} + for x in order_desc: + rows = [rootfun[j] for j in droot[x]] + for t in succ[x]: rows += K[t] + K[x] = reduce(rows) + def envelope(x): + if not args[x][0]: return [tmask[x - 1]] + if types[x] == 2: return [1 << i for i in range(h) if cover[x] >> i & 1] + require(types[x] == 1, 'only ordinary and common-pair labels occur') + ks = [i for i in range(h) if (cover[x] & ~core[x]) >> i & 1] + require(len(ks) == ranks[x], 'common-pair support') + return [core[x] | (1 << k) for k in ks] + U = {} + for x in range(1, n): + if not active[x]: continue + if not args[x][0]: U[x] = envelope(x); continue + B = kernel(K[x], h) + require(contains(envelope(x), B), 'label outside lifted frame') + U[x] = B if nondeg(B) else envelope(x) + changed = True + while changed: + changed = False + for x in order_desc: + if args[x][0] and any(not contains(U[x], U[t]) for t in succ[x]): + env = envelope(x) + if len(reduce(U[x])) != len(reduce(env)) or not contains(U[x], env): U[x] = env; changed = True + dimU = {x: len(reduce(B)) for x, B in U.items()} + print('PR117 frames lifted',sum(dimU[x]>ranks[x] for x in U),flush=True) + + # ------------------------------------------------------------ explicit role compile + order = sorted((x for x in range(1, n) if active[x]), key=lambda x: (ranks[x], x)) + holds = []; first_node = []; ops = []; edge_key = {}; role_root = {} + def new_role(node): holds.append([node]); first_node.append(node); return len(holds) - 1 + def serve(s, y, k): + u = uses[y][k] + if u[0] == 'gate': edge_key[(y, k)] = s + else: role_root[s] = u[1] + for x in order: + free = [k for k in range(len(uses[x])) if (x, k) not in linked_use] + if not args[x][0]: + for k in free: + s = new_role(x); ops.append(('src', s, x)); serve(s, x, k) + continue + a, b = args[x] + ka = next(k for k, u in enumerate(uses[a]) if u == ('gate', x, 0)) + kb = next(k for k, u in enumerate(uses[b]) if u == ('gate', x, 1)) + sa, sb = edge_key.pop((a, ka)), edge_key.pop((b, kb)) + if x in links and links[x][0] == a: sa, sb = sb, sa + piv, oth = sa, sb + ops.append(('add', piv, oth, x)); holds[piv].append(x); holds[oth].append(x) + if x in links: serve(oth, *links[x]) + require(free, 'every use linked at node %d' % x) + serve(piv, x, free[0]) + for k in free[1:]: + f = new_role(x); ops.append(('copy', piv, f, x)); serve(f, x, k) + require(not edge_key and len(holds) == R, 'compile') + Rr = R + + # ------------------------------------------------------------ shrunk frames + # Any nondegenerate U_x with label(x) + sum of predecessor frames <= U_x + # <= lifted kernel, contained in every successor frame, satisfies the + # PR110 frame contract (the inherited label fallback is one such choice). + # One forward pass replaces U_x by its minimal span Lb_x when Lb_x is + # nondegenerate and that lowers the local one-child cost of the role + # chains holding x; a merged increment a+b replaces a and b, and + # t*log(m/t) is subadditive. Section D rechecks every resulting chain. + import math + fcost = lambda t: t * math.log(m / t) if t > 0 else 0.0 + preds = defaultdict(list) + for x, ts in succ.items(): + for t in ts: preds[t].append(x) + occ = defaultdict(list) + for s in range(R): + for i, x in enumerate(holds[s]): occ[x].append((s, i)) + def local_cost(x, d): + c = 0.0 + for s, i in occ[x]: + hs = holds[s] + c += fcost(d - dimU[hs[i - 1]]) if i else fcost(d) + if i + 1 < len(hs): c += fcost(dimU[hs[i + 1]] - d) + elif s in role_root: c += fcost(h - 1 - d) + else: c += fcost(h - d) + return c + shrunk = 0 + for x in order: + if not args[x][0]: continue + Lb = reduce(envelope(x) + [b for p in preds[x] for b in U[p]]) + if len(Lb) >= dimU[x] or not contains(Lb, U[x]) or not nondeg(Lb): continue + if not all(contains(Lb, U[t]) for t in succ[x]): continue + if local_cost(x, len(Lb)) < local_cost(x, dimU[x]) - 1e-9: + U[x] = Lb; dimU[x] = len(Lb); shrunk += 1 + print('shrunk frames', shrunk, flush=True) + require(SHRUNK is None or shrunk == SHRUNK, 'shrunk frames: %d' % shrunk) + + # ------------------------------------------------------------ B. the word computes every root value + rng = random.Random(20261008) + xs = [rng.randrange(P) for _ in range(v)] + val = [0] * n + for i in range(v): val[i + 1] = xs[i] + for x in order: + if args[x][0]: val[x] = (val[args[x][0]] + val[args[x][1]]) % P + leaf_of = {s: first_node[s] for s in range(Rr) if not args[first_node[s]][0]} + a_ = [0] * Rr + for s, leaf in leaf_of.items(): a_[s] = xs[leaf - 1] + for o in ops: + if o[0] == 'add': a_[o[1]] = (a_[o[1]] + a_[o[2]]) % P + elif o[0] == 'copy': a_[o[2]] = (a_[o[2]] + a_[o[1]]) % P + require(all(a_[s] == val[roots[j]] for s, j in role_root.items()), 'root values') + + # ------------------------------------------------------------ phase one and garbage reach + def touch(o): return [o[1], o[2]] if o[0] in ('add', 'copy') else [] + prev = {}; pred = defaultdict(list); last = {} + for i, o in enumerate(ops): + for s in touch(o): + if s in prev: pred[i].append(prev[s]) + prev[s] = i; last[s] = i + centre_roles = [s for s, j in role_root.items() if kind[j]] + Anc = set(); st = [last[s] for s in centre_roles] + while st: + i = st.pop() + if i not in Anc: Anc.add(i); st.extend(pred[i]) + touched = set(centre_roles) + for i in Anc: touched.update(touch(ops[i])) + require(all(last[s] in Anc for s in centre_roles), 'centres complete in phase one') + reach = [set() for _ in range(Rr)]; reach_all = [False] * Rr + for s, j in role_root.items(): + if kind[j]: reach_all[s] = True + else: reach[s].add(target[j]) + for o in reversed(ops): + if o[0] == 'add': reach[o[2]] |= reach[o[1]]; reach_all[o[2]] = reach_all[o[2]] or reach_all[o[1]] + elif o[0] == 'copy': reach[o[1]] |= reach[o[2]]; reach_all[o[1]] = reach_all[o[1]] or reach_all[o[2]] + + # ------------------------------------------------------------ deferral frames, insertion nesting + def F0(s): return U[first_node[s]] + cand = {} + for s in range(Rr): + if s in touched or reach_all[s]: continue + S_ = restrict(F0(s), [tmask[t] for t in reach[s]]) + if S_ and nondeg(S_): cand[s] = S_ + print('PR117 candidates',len(cand),flush=True) + placed = saturated_placement(cand, reach) + print('PR117 placed',len(placed),flush=True) + deferred = sorted(placed, key=lambda s: (len(placed[s]), s)); dset = set(deferred) + + # ------------------------------------------------------------ C. replay with arbitrary scratch and data + inv = lambda a: pow(a % P, P - 2, P); HALF = inv(2); I21 = inv(21) + cvec = [None] * Rr; dpart = [dict() for _ in range(Rr)] + for s, j in role_root.items(): + if kind[j]: c = [0] * h; c[centre_of[j]] = 1; cvec[s] = c + else: dpart[s][target[j]] = (P - HALF) if j >= v else HALF + seed_c = {s: (None if cvec[s] is None else list(cvec[s])) for s in role_root} + seed_d = {s: dict(dpart[s]) for s in role_root} + def addc(dst, src): + if cvec[src] is not None: + cvec[dst] = list(cvec[src]) if cvec[dst] is None else [(p + q_) % P for p, q_ in zip(cvec[dst], cvec[src])] + for t, c in dpart[src].items(): dpart[dst][t] = (dpart[dst].get(t, 0) + c) % P + for o in reversed(ops): + if o[0] == 'add': addc(o[2], o[1]) + elif o[0] == 'copy': addc(o[1], o[2]) + scatter = [[(I21 - (HALF if i in trip[t] else 0)) % P for t in range(v)] for i in range(h)] + def readout(y, s, value, sign, seed=False): + # Logical readout macro: the literal audit combines its exact rational + # target coefficients and expands each numerator/42 into bounded shears. + cv = seed_c[s] if seed else cvec[s]; dp = seed_d[s] if seed else dpart[s] + if cv is not None: + for i, ci in enumerate(cv): + if ci: + f = sign * ci * value % P; row = scatter[i] + for t in range(v): y[t] = (y[t] + f * row[t]) % P + for t, c in dp.items(): y[t] = (y[t] + sign * c * value) % P + phase1 = sorted(Anc); rest = [i for i in range(len(ops)) if i not in Anc] + def replay(seed): + rng = random.Random(seed) + x = [rng.randrange(P) for _ in range(v)]; z = [rng.randrange(P) for _ in range(Rr)] + y0 = [rng.randrange(P) for _ in range(v)]; a = list(z); y = list(y0) + for s in range(Rr): + if s not in dset: readout(y, s, a[s], -1) + for s, leaf in leaf_of.items(): + if s not in dset: a[s] = (a[s] + x[leaf - 1]) % P + def run(i, sign=1): + o = ops[i] + if o[0] == 'add': a[o[1]] = (a[o[1]] + sign * a[o[2]]) % P + elif o[0] == 'copy': a[o[2]] = (a[o[2]] + sign * a[o[1]]) % P + for i in phase1: run(i) + for s in centre_roles: readout(y, s, a[s], +1, True) + for s in deferred: readout(y, s, a[s], -1) + for s in deferred: + if s in leaf_of: a[s] = (a[s] + x[leaf_of[s] - 1]) % P + for i in rest: run(i) + for s, j in role_root.items(): + if not kind[j]: readout(y, s, a[s], +1, True) + for i in reversed(range(len(ops))): run(i, -1) + for s, leaf in leaf_of.items(): a[s] = (a[s] - x[leaf - 1]) % P + return a == z, all((y[t] - y0[t] - x[t]) % P == 0 for t in range(v)) + rep = [replay(seed) for seed in (1, 2)] + require(all(r == (True, True) for r in rep), 'replay %s' % rep) + + # ------------------------------------------------------------ D. exact F2 frame facts + root_frame = {} + for s, j in role_root.items(): + root_frame[s] = [1 << i for i in range(h) if i != centre_of[j]] if kind[j] else kernel([tmask[target[j]]], h) + FULLB = [1 << i for i in range(h)] + chain_dims = [] + for s in range(Rr): + seq = [placed.get(s, []), F0(s)] + [U[x] for x in holds[s][1:]] + if s in root_frame: seq.append(root_frame[s]) + seq.append(FULLB) + require(all(contains(A, B) for A, B in zip(seq, seq[1:])), 'role chain nesting %d' % s) + require(all(nondeg(B) for B in seq[1:-1] if B), 'degenerate frame on role %d' % s) + chain_dims.append([len(reduce(B)) for B in seq]) + for s, X in placed.items(): + require(contains(X, F0(s)) and nondeg(X), 'deferral frame %d' % s) + require(all(not any(dot(xv, tmask[t]) for xv in X) for t in reach[s]), 'target frame %d' % s) + byT2 = defaultdict(list) + for s in deferred: + for t in reach[s]: byT2[t].append(s) + for t, ss in byT2.items(): + ss.sort(key=lambda s: (len(placed[s]), s)) + require(all(contains(placed[p], placed[q_]) for p, q_ in zip(ss, ss[1:])), 'target chain %d' % t) + + # ------------------------------------------------------------ E. one-child histogram + z = Counter() + for s in range(Rr): + ds = chain_dims[s] + for a, b in zip(ds[:-1], ds[1:-1]): + if b > a: z[b - a] += 2 * v + lastd = ds[-2] + if s in role_root and kind[role_root[s]]: z[h - 1] += 2 * v # copied centre transform + z[h - lastd] += 2 * v # final growth to F + z[m - h + ds[0]] += 2 * v # exterior, gauged by sigma + levels = defaultdict(set) + for s in deferred: + for t in reach[s]: levels[t].add(len(placed[s])) + for t in range(v): + ds = sorted(levels[t] | {0, h - 1}) + for a, b in zip(ds, ds[1:]): z[b - a] += 2 * v # target fronts + z[h - 1] += 2 * N # data-wire fronts + z[(h - 1) ** 2] += 2 * N # data macros + z[1] += N # endpoint copies + z.pop(0, None) + W = 2 * N + 2 * v * R; L = 2 * v * h * (h - 1); s_ = W * m - N + L + require(sum(t * c for t, c in z.items()) == s_, 'complex rank mass') + require(all(0 < t < m for t in z), 'children below m') + out = dict(h=h, v=v, additions=c_add, roots=q, links=len(links), R=R, m=m, N=N, W=W, L=L, total_rank=s_, + deficit=N - L, maxchild=max(z), phase_one_ops=len(Anc), phase_one_roles=len(touched), + deferred_roles=len(deferred), + deferred_dims=dict(sorted(Counter(len(X) for X in placed.values()).items())), + lifted_additions=sum(1 for x in U if args[x][0] and dimU[x] > ranks[x]), + replay=dict(seeds=[1, 2], scratch_restored=True, y_plus_x=True, field='Z/(2^61-1)'), + child_multiplicities=dict(sorted(z.items()))) + (HERE / 'complex-profile.json').write_text(json.dumps(out, indent=1) + '\n') + print('PASS complex: R=%d, deferred roles %d, maxchild %d, rank mass %d' % (R, len(deferred), max(z), s_)) + + +if __name__ == '__main__': + main() diff --git a/research/shrunk-frames/controls/pr114-complex-profile.json b/research/shrunk-frames/controls/pr114-complex-profile.json new file mode 100644 index 0000000000..90a44f18a8 --- /dev/null +++ b/research/shrunk-frames/controls/pr114-complex-profile.json @@ -0,0 +1,85 @@ +{ + "h": 24, + "v": 2024, + "additions": 91770, + "roots": 8120, + "links": 71185, + "R": 28705, + "m": 576, + "N": 4096576, + "W": 124390992, + "L": 2234496, + "total_rank": 71647349312, + "deficit": 1862080, + "maxchild": 574, + "phase_one_ops": 18844, + "phase_one_roles": 13555, + "deferred_roles": 4706, + "deferred_dims": { + "2": 863, + "4": 357, + "6": 573, + "8": 144, + "10": 25, + "12": 323, + "14": 241, + "16": 337, + "17": 1, + "18": 900, + "19": 603, + "20": 208, + "21": 11, + "22": 120 + }, + "lifted_additions": 39989, + "replay": { + "seeds": [ + 1, + 2 + ], + "scratch_restored": true, + "y_plus_x": true, + "field": "Z/(2^61-1)" + }, + "child_multiplicities": { + "1": 339934848, + "2": 358859248, + "3": 36626304, + "4": 66512688, + "5": 30258800, + "6": 17062320, + "7": 14240864, + "8": 23757712, + "9": 6290592, + "10": 9500656, + "11": 9456128, + "12": 15430976, + "13": 10949840, + "14": 1384416, + "15": 1275120, + "16": 793408, + "17": 506000, + "18": 2902416, + "19": 2092816, + "20": 817696, + "21": 1230592, + "22": 64768, + "23": 8363168, + "529": 8193152, + "552": 97147952, + "554": 3493424, + "556": 1445136, + "558": 2319504, + "560": 582912, + "562": 101200, + "564": 1307504, + "566": 975568, + "568": 1364176, + "569": 4048, + "570": 3643200, + "571": 2440944, + "572": 841984, + "573": 44528, + "574": 485760 + } +} diff --git a/research/shrunk-frames/controls/pr125-complex-profile.json b/research/shrunk-frames/controls/pr125-complex-profile.json new file mode 100644 index 0000000000..1b07c25523 --- /dev/null +++ b/research/shrunk-frames/controls/pr125-complex-profile.json @@ -0,0 +1,85 @@ +{ + "h": 24, + "v": 2024, + "additions": 91770, + "roots": 8120, + "links": 71185, + "R": 28705, + "m": 576, + "N": 4096576, + "W": 124390992, + "L": 2234496, + "total_rank": 71647349312, + "deficit": 1862080, + "maxchild": 574, + "phase_one_ops": 18844, + "phase_one_roles": 13555, + "deferred_roles": 4706, + "deferred_dims": { + "2": 863, + "4": 357, + "6": 573, + "8": 144, + "10": 25, + "12": 323, + "14": 241, + "16": 337, + "17": 1, + "18": 900, + "19": 604, + "20": 207, + "21": 11, + "22": 120 + }, + "lifted_additions": 24792, + "replay": { + "seeds": [ + 1, + 2 + ], + "scratch_restored": true, + "y_plus_x": true, + "field": "Z/(2^61-1)" + }, + "child_multiplicities": { + "1": 435601232, + "2": 267192288, + "3": 29238704, + "4": 61145040, + "5": 26425344, + "6": 15734576, + "7": 11876832, + "8": 22077792, + "9": 4562096, + "10": 7375456, + "11": 7019232, + "12": 31788944, + "13": 12536656, + "14": 1497760, + "15": 3440800, + "16": 854128, + "17": 506000, + "18": 2906464, + "19": 2092816, + "20": 817696, + "21": 1230592, + "22": 64768, + "23": 8363168, + "529": 8193152, + "552": 97147952, + "554": 3493424, + "556": 1445136, + "558": 2319504, + "560": 582912, + "562": 101200, + "564": 1307504, + "566": 975568, + "568": 1364176, + "569": 4048, + "570": 3643200, + "571": 2444992, + "572": 837936, + "573": 44528, + "574": 485760 + } +} diff --git a/research/shrunk-frames/inputs/complex-dag.json.gz b/research/shrunk-frames/inputs/complex-dag.json.gz new file mode 100644 index 0000000000..a5b0598e4c Binary files /dev/null and b/research/shrunk-frames/inputs/complex-dag.json.gz differ diff --git a/research/shrunk-frames/inputs/deferred_23.json.gz b/research/shrunk-frames/inputs/deferred_23.json.gz new file mode 100644 index 0000000000..4a4431bd42 Binary files /dev/null and b/research/shrunk-frames/inputs/deferred_23.json.gz differ diff --git a/research/shrunk-frames/inputs/witness_23.json.gz b/research/shrunk-frames/inputs/witness_23.json.gz new file mode 100644 index 0000000000..3d86f83b87 Binary files /dev/null and b/research/shrunk-frames/inputs/witness_23.json.gz differ diff --git a/research/shrunk-frames/prepare.py b/research/shrunk-frames/prepare.py new file mode 100644 index 0000000000..70ddfa9e09 --- /dev/null +++ b/research/shrunk-frames/prepare.py @@ -0,0 +1,82 @@ +#!/usr/bin/env python3 +"""Capture, audit, and compose the pinned PR #125 finite parent word. + +This authoring/checking entry point runs the existing compiler once in memory, +checks its frozen parent profile and reflection receipt, then builds the +terminal-elided candidate. ``--write`` is an explicit artifact regeneration +operation; the default mode is read-only. +Prepared with OpenAI Codex assistance; Apache-2.0. +""" +import argparse +import gzip +from hashlib import sha256 +import json +from pathlib import Path +import sys + +HERE = Path(__file__).resolve().parent +sys.dont_write_bytecode = True +if sys.flags.optimize: + raise ValueError('Assertions must remain enabled') + +import reflection_audit +from terminal_elision import build, canonical_word_bytes, parent_word_from_capture, write_outputs + + +def normalized_json(value): + return json.loads(json.dumps(value, sort_keys=True)) + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--write', action='store_true', + help='Regenerate the frozen candidate profile, receipt, and selection') + parser.add_argument('--parent-word', type=Path, + help='Write the transient canonical parent word for the independent audit') + args = parser.parse_args() + + source = HERE / 'complex_deferred.py' + state = reflection_audit.capture(source) + parent = state['out'] + frozen_parent = json.loads((HERE / 'controls/pr125-complex-profile.json').read_text()) + require(normalized_json(parent) == frozen_parent, + 'captured parent profile differs from the pinned PR #125 control') + + parent_receipt = reflection_audit.audit(state) + parent_receipt['source_sha256'] = sha256(source.read_bytes()).hexdigest() + parent_receipt['audit_sha256'] = sha256((HERE / 'reflection_audit.py').read_bytes()).hexdigest() + frozen_audit = json.loads((HERE / 'reflection-audit.json').read_text()) + require(normalized_json(parent_receipt) == frozen_audit, + 'independent parent reflection receipt changed') + + word = parent_word_from_capture(state) + word_bytes = canonical_word_bytes(word) + word_sha256 = sha256(word_bytes).hexdigest() + if args.parent_word: + args.parent_word.parent.mkdir(parents=True, exist_ok=True) + args.parent_word.write_bytes(word_bytes) + + profile, receipt, selection = build(word, parent, word_sha256) + if args.write: + write_outputs(HERE, profile, receipt, selection) + else: + expected_profile = json.loads((HERE / 'complex-profile.json').read_text()) + require(normalized_json(profile) == expected_profile, + 'generated terminal-elided profile differs from frozen output') + expected_receipt = json.loads(gzip.decompress((HERE / 'terminal-elision.json.gz').read_bytes())) + require(normalized_json(receipt) == expected_receipt, + 'generated terminal-elision word differs from frozen receipt') + expected_selection = json.loads((HERE / 'terminal-selection.json').read_text()) + require(normalized_json(selection) == expected_selection, + 'generated simultaneous target schedule differs from frozen receipt') + print('PASS captured PR #125 parent; 381 terminal roles, %d direct updates; %s mode' % + (profile['terminal_direct_updates'], 'wrote' if args.write else 'matched frozen')) + + +if __name__ == '__main__': + main() diff --git a/research/shrunk-frames/producer.py b/research/shrunk-frames/producer.py new file mode 100644 index 0000000000..a93a265f01 --- /dev/null +++ b/research/shrunk-frames/producer.py @@ -0,0 +1,17 @@ +"""Pinned PR117 scalar DAG adapter for the saturated deferred compiler. + +The searched graph is upstream PR117 work credited to eumemic with Anthropic +Claude assistance. This adapter preserves that witness and producer unchanged; +saturation integration is separate OpenAI Codex-assisted work. Apache-2.0. +""" +from hashlib import sha256 +from pathlib import Path +from replayed_producer import build as replayed_build + +WITNESS_SHA256 = '3c034d0aae388ef567a454826f4f48b26fd8a94c71e8ffed4835271b349a783b' + +def build(h, prefix, central_disjoint, base=2): + assert (h, central_disjoint, base) == (24,24,2) + witness=Path(__file__).resolve().parent/'inputs/complex-dag.json.gz' + assert sha256(witness.read_bytes()).hexdigest() == WITNESS_SHA256, 'PR117 DAG pin mismatch' + return replayed_build(witness,prefix) diff --git a/research/shrunk-frames/reflection-audit.json b/research/shrunk-frames/reflection-audit.json new file mode 100644 index 0000000000..caace0ada6 --- /dev/null +++ b/research/shrunk-frames/reflection-audit.json @@ -0,0 +1,82 @@ +{ + "R": 28705, + "all_frames_nondegenerate": true, + "audit_sha256": "6761fb01f93ef89f2455388b2f5a71f19c0bbd870e6aaeba457ede0a949a163b", + "bounded_chunk_coefficients": true, + "bounded_readout_chunks_sha256": "bb2ad510e5f5113eba2fd520f99bb05725087ae47e1566b7e63eafdefc69d809", + "child_multiplicities": { + "1": 435601232, + "10": 7375456, + "11": 7019232, + "12": 31788944, + "13": 12536656, + "14": 1497760, + "15": 3440800, + "16": 854128, + "17": 506000, + "18": 2906464, + "19": 2092816, + "2": 267192288, + "20": 817696, + "21": 1230592, + "22": 64768, + "23": 8363168, + "3": 29238704, + "4": 61145040, + "5": 26425344, + "529": 8193152, + "552": 97147952, + "554": 3493424, + "556": 1445136, + "558": 2319504, + "560": 582912, + "562": 101200, + "564": 1307504, + "566": 975568, + "568": 1364176, + "569": 4048, + "570": 3643200, + "571": 2444992, + "572": 837936, + "573": 44528, + "574": 485760, + "6": 15734576, + "7": 11876832, + "8": 22077792, + "9": 4562096 + }, + "conservative_local_G": 14907958248, + "exact_arbitrary_dirty_cancellation_by_dependency_cut": true, + "exact_chunk_reconstruction": true, + "exact_fresh_source_map": true, + "exact_integer_old_readout_transpose": true, + "expanded_old_readout_additions": 11862944, + "expanded_scalar_operations_per_stage": 12160614, + "forward_incidence_sha256": "46a00e3137729d00cafcf32969d1f3bc4e4cd293552f74eb47f61e64cf1524c1", + "h": 24, + "largest_bounded_chunk_numerator_over_42": 42, + "largest_readout_numerator_over_42": 55, + "literal_frame_incidences_both_directions": true, + "literal_global_scalar_groups": 49230262048, + "old_readout_coefficients_over_42_sha256": "e0666f81e1d35e002d61b8f2b2b1ca0d1d79cc7fbcbc76063eb333294d875e5e", + "reflected_incidence_sha256": "a6de908519fbdfabb1b8c05fd111321fa00181375bfa1cca537161d424ed6515", + "reflected_residual_rank_histogram_equal": true, + "reflected_scalar_map": "X becomes X-Y; Y unchanged; all auxiliary coordinates restored.", + "reflected_word_rule": "Reverse literal order including each bounded readout chunk, negate every shear, swap X/Y ports, complement every frame; auxiliary bank is separate.", + "rejected_controls": [ + "oversized-readout-chunk", + "split-readout-sum", + "reflected-chunk-order", + "inverse-sign", + "uncomplemented-frame", + "signed-root-readout" + ], + "scalar_readout_normalization": "Each exact numerator n/42 becomes signed42 chunks plus a signed remainder. Exact reconstruction and chunk magnitude<=1 checked; every same-frame shear is charged; reflection reverses chunk order.", + "scope": "Exact finite source coefficients, dirty cancellation algebra and literal reflected frame/charge ledger. Copied-centre transforms, endpoint correction and residual-to-child/all-size transfer retain their stated inherited contracts.", + "source_sha256": "fa1125e85ec73b185dc9eee117f62d10356bb6422c07ec793a7f77296c87707e", + "split_readout_macros": 32, + "two_stage_scalar_map": "(X,Y) becomes (-Y,X+Y) before inherited endpoint correction.", + "unsplit_old_readout_macros": 11862912, + "v": 2024, + "word_blocks": 277775 +} diff --git a/research/shrunk-frames/reflection_audit.py b/research/shrunk-frames/reflection_audit.py new file mode 100644 index 0000000000..9da639268b --- /dev/null +++ b/research/shrunk-frames/reflection_audit.py @@ -0,0 +1,365 @@ +#!/usr/bin/env python3 +"""Literal inverse/reflection and exact finite scalar/frame audit. + +Captures an unchanged deferred producer before its output write, then checks +the scalar computation on every source symbol, the exact signed old-readout +transpose, the dependency cut and the complete complemented incidence ledger. +This is finite verification; the inherited residual-to-child implementation, +all-size transfer and analytic interfaces are not proved by this script. +""" +import ast +from collections import Counter +from functools import lru_cache +from hashlib import sha256 +from itertools import combinations +import argparse,json,pickle,struct,sys +from pathlib import Path +sys.dont_write_bytecode=True +assert not sys.flags.optimize,'Assertions must remain enabled' + + +def capture(source): + source=Path(source).resolve();sys.path.insert(0,str(source.parent)) + tree=ast.parse(source.read_text(),filename=str(source)) + main=next(n for n in tree.body if isinstance(n,ast.FunctionDef) and n.name=='main') + at=next(i for i,n in enumerate(main.body) if isinstance(n,ast.Expr) and isinstance(n.value,ast.Call) and isinstance(n.value.func,ast.Attribute) and n.value.func.attr=='write_text') + main.body[at:]=[ast.Return(ast.Call(ast.Name('locals',ast.Load()),[],[]))] + ast.fix_missing_locations(tree) + ns={'__file__':str(source),'__name__':'reflection_capture'} + exec(compile(tree,str(source)+' [read-only capture]','exec'),ns) + data=ns['main']();data['source']=str(source);return data + + +def basis(vectors): + piv={} + for x in vectors: + for p in sorted(piv,reverse=True): + if x>>p&1:x^=piv[p] + if x: + p=x.bit_length()-1 + for q in piv: + if piv[q]>>p&1:piv[q]^=x + piv[p]=x + return tuple(piv[p] for p in sorted(piv,reverse=True)) + + +def dot(a,b):return (a&b).bit_count()&1 + + +@lru_cache(None) +def contained(A,B):return len(basis(A+B))==len(B) + + +@lru_cache(None) +def complement(A,h): + A=basis(A);piv={x.bit_length()-1:x for x in A};result=[] + for j in range(h): + if j not in piv: + x=1<>j&1:x|=1<

=0 else -1 + parts=(sign*42,)*q+((sign*r,) if r else ()) + check_chunks(numerator,parts) + return parts + +def reverse_row(row): + if row[0]=='old':return (row[0],row[1],row[3],row[2]) + return row + + +def check_reflection(forward,backward,h,v): + def bank(s):return s+v if s1) + readcount+=len(parts);maxchunk=max(maxchunk,max(map(abs,parts))) + for part in parts: + reached.append(t);records.append(struct.pack('len(old):hist[len(F)-len(old)]+=1 + current[s]=F + for event in events: + k,a,b,c,F,*rest=event + assert c in (-1,1) + promote(a,F) + if k=='gate':promote(b,F);scalar+=1 + elif k=='read': + for t in b:promote(t,F) + scalar+=len(b) + else: + assert k=='centre';G=rest[0] + assert contained(G,F) or contained(F,G) + assert nondeg(G);copies[abs(len(F)-len(G))]+=1 + for t in b:promote(t,G) + scalar+=len(b)+2 # temporary copy and erasure + digest.update(repr(event).encode()+b'\n') + # Each literal role cleanup reaches full space; any unused final + # endpoint is still represented explicitly in the expected chain. + for s,F in enumerate(expected):promote(s,F) + assert current==expected + return hist,copies,scalar,digest.hexdigest() + start=tm+[ZERO]*v+[sigma.get(s,ZERO) for s in range(R)] + finish=[FULL]*v+[complement(T,h) for T in tm]+[FULL]*R + H,C,scalar,digest=framescan(word,start,finish) + revstart=[None]*len(start);revfinish=[None]*len(start) + for s in range(len(start)): + revstart[swap(s)]=complement(finish[s],h);revfinish[swap(s)]=complement(start[s],h) + HR,CR,scalarR,reverse_digest=framescan(reverse,revstart,revfinish) + assert (H,C,scalar)==(HR,CR,scalarR) + z=Counter({r:2*v*n for r,n in (H+C).items()}) + for s in range(R):z[h*h-h+len(sigma.get(s,ZERO))]+=2*v + z[(h-1)**2]+=2*v*v;z[1]+=v*v + z.pop(0,None) + assert dict(sorted(z.items()))=={int(r):n for r,n in d['out']['child_multiplicities'].items()},'Literal reflected child histogram' + assert sum(r*n for r,n in z.items())==d['out']['total_rank'] + G=v*v+2*v*scalar + safe=8*(d['c_add']+2*R+(R+q)*v*(h+1)+h*h+h+1) if 'c_add' in d else 8*(d['out']['additions']+2*R+(R+q)*v*(h+1)+h*h+h+1) + assert safe>=scalar + return dict(h=h,v=v,R=R,exact_fresh_source_map=True,exact_integer_old_readout_transpose=True, + exact_arbitrary_dirty_cancellation_by_dependency_cut=True, + reflected_word_rule='Reverse literal order including each bounded readout chunk, negate every shear, swap X/Y ports, complement every frame; auxiliary bank is separate.', + reflected_scalar_map='X becomes X-Y; Y unchanged; all auxiliary coordinates restored.', + two_stage_scalar_map='(X,Y) becomes (-Y,X+Y) before inherited endpoint correction.', + literal_frame_incidences_both_directions=True,all_frames_nondegenerate=True, + reflected_residual_rank_histogram_equal=True,child_multiplicities=dict(sorted(z.items())), + word_blocks=len(word),expanded_scalar_operations_per_stage=scalar, + expanded_old_readout_additions=readcount,largest_readout_numerator_over_42=maxcoef, + unsplit_old_readout_macros=unsplit_readcount,split_readout_macros=split_macros, + largest_bounded_chunk_numerator_over_42=maxchunk, + bounded_readout_chunks_sha256=chunk_digest.hexdigest(), + scalar_readout_normalization='Each exact numerator n/42 becomes signed42 chunks plus a signed remainder. Exact reconstruction and chunk magnitude<=1 checked; every same-frame shear is charged; reflection reverses chunk order.', + exact_chunk_reconstruction=True,bounded_chunk_coefficients=True, + old_readout_coefficients_over_42_sha256=coefficient_digest.hexdigest(), + literal_global_scalar_groups=G,conservative_local_G=safe, + forward_incidence_sha256=digest,reflected_incidence_sha256=reverse_digest, + rejected_controls=rejected, + scope='Exact finite source coefficients, dirty cancellation algebra and literal reflected frame/charge ledger. Copied-centre transforms, endpoint correction and residual-to-child/all-size transfer retain their stated inherited contracts.') + + +def main(): + ap=argparse.ArgumentParser();ap.add_argument('--source',type=Path);ap.add_argument('--state',type=Path) + ap.add_argument('--output',type=Path);ap.add_argument('--check',type=Path);a=ap.parse_args() + assert bool(a.source)!=bool(a.state) + d=capture(a.source) if a.source else pickle.loads(a.state.read_bytes()) + result=audit(d);source=Path(d['source']) + result['source_sha256']=sha256(source.read_bytes()).hexdigest() + result['audit_sha256']=sha256(Path(__file__).read_bytes()).hexdigest() + result=json.loads(json.dumps(result));encoded=json.dumps(result,indent=2,sort_keys=True)+'\n' + if a.check:assert result==json.loads(a.check.read_text()) + if a.output:a.output.write_text(encoded) + else:print(encoded,end='') + print('PASS exact scalar and literal complement reflection audit',file=sys.stderr) + + +if __name__=='__main__':main() diff --git a/research/shrunk-frames/replayed_producer.py b/research/shrunk-frames/replayed_producer.py new file mode 100644 index 0000000000..673fbbba70 --- /dev/null +++ b/research/shrunk-frames/replayed_producer.py @@ -0,0 +1,179 @@ +"""Replayed h=24 complex producer with all centers disjoint (rational divisor 21). + +Copyright 2026 eumemic, Apache-2.0. AI-assisted (Claude). The DAG was found by an +automated search over producers of the retained paired-triple, pair-star and +center-disjoint interfaces. The checks below are adapted from +stopped_product/complex.py (copyright 2026 icekylinx, Apache-2.0, PR #104). + +The witness complex-dag.json.gz lists the ordinary +additions after the v triple inputs and the retained roots: the disjoint sums +D[t], the pair stars P(a,b,i) and the center-disjoint sums A_i. Every support, +core, cover, type and rank is recomputed here from the operands; nothing is +read from the witness except the operand pairs and the root indices. +""" +import gzip, json, struct, sys, array +from fractions import Fraction +from itertools import combinations +from pathlib import Path + + +def write_array(f, values): + """Little-endian array writer, as partial_swap.binary.write_array.""" + if sys.byteorder != 'little' and values.itemsize > 1: + values = array.array(values.typecode, values) + values.byteswap() + values.tofile(f) + + +def build(witness, prefix): + w = json.loads(gzip.decompress(Path(witness).read_bytes())) + h, v, d = w['h'], w['v'], w['central_disjoint'] + assert (h, d, w['center_denominator']) == (24, 24, 21) + triples = list(combinations(range(h), 3)) + assert v == len(triples) + args = [(0, 0)]; support = [0]; core = [0]; cover = [0]; types = [0]; ranks = [0] + for j, t in enumerate(triples): + mask = sum(1 << a for a in t) + args.append((0, 0)); support.append(1 << j); core.append(mask); cover.append(mask) + types.append(1); ranks.append(1) + flat = w['args'] + assert len(flat) % 2 == 0 + for k in range(0, len(flat), 2): + a, b, x = flat[k], flat[k+1], len(args) + assert 0 < a < x and 0 < b < x, 'Operands must precede their sum' + assert not support[a] & support[b], 'Ordinary additions must be cancellation-free' + args.append((a, b)); support.append(support[a] | support[b]) + core.append(core[a] & core[b]); cover.append(cover[a] | cover[b]) + if core[x].bit_count() >= 2: + types.append(1); ranks.append(support[x].bit_count()) + else: + types.append(2); ranks.append(cover[x].bit_count()) + n = len(args) + point_masks = [sum(1 << j for j, t in enumerate(triples) if a in t) for a in range(h)] + full_support = (1 << v) - 1 + roots, kind = [], [] + assert len(w['D']) == v + for t, node in zip(triples, w['D']): + assert 0 < node < n + assert support[node] == full_support & ~(point_masks[t[0]]|point_masks[t[1]]|point_masks[t[2]]) + target_mask = sum(1 << a for a in t) + if types[node] == 2: + assert not cover[node] & target_mask + else: + assert types[node] == 1 + assert not support[node] & (point_masks[t[0]]^point_masks[t[1]]^point_masks[t[2]]) + roots.append(node); kind.append(0) + stars = [(a, b, i) for a, b in combinations(range(h), 2) for i in range(h) if i not in (a, b)] + assert len(w['P']) == len(stars) + pair_outputs = {} + for (a, b, i), node in zip(stars, w['P']): + assert 0 < node < n + assert support[node] == point_masks[a] & point_masks[b] & ~point_masks[i] + assert types[node] == 1 + assert not support[node] & (point_masks[a]^point_masks[b]^point_masks[i]) + pair_outputs[a, b, i] = node + roots.append(node); kind.append(0) + assert len(w['A']) == d + for i, node in enumerate(w['A']): + assert 0 < node < n + assert support[node] == full_support & ~point_masks[i] + assert types[node] == 2 and cover[node] == ((1 << h)-1) ^ (1 << i) + assert ranks[node] == h-1 + roots.append(node); kind.append(1) + # Every A_i avoids i, so sum A_i = (h-3)T. The decoder is T=sum A_i/21 + # and the scatter is T-(1/2)sum_{i in target} A_i. + decoder = Fraction(1, h-3) + assert decoder == Fraction(1, 21) + scatter_coefficients = [decoder, decoder-Fraction(1, 2)] + for coefficient in scatter_coefficients: + odd_denominator = coefficient.denominator + while odd_denominator % 2 == 0: + odd_denominator //= 2 + assert 21 % odd_denominator == 0 and abs(coefficient) <= 1 + for source in triples: + assert sum(i not in source for i in range(h))*decoder == 1 + Dset = set(range(d)) + for triple in triples: + k = len(Dset.intersection(triple)) + assert 2*(3-k)-2*(d-k) == 2*(3-d) + patterns = {} + for target in triples: + chosen = len(Dset.intersection(target)) + if chosen not in patterns: + patterns[chosen] = target + for chosen, target in patterns.items(): + target_set = set(target) + for source in triples: + k = len(Dset.intersection(source)) + total_coefficient = Fraction(2*(3-k)-2*(d-k), 2*(3-d)) + scalar = Fraction(len((target_set-Dset).intersection(source)), 2) + scalar -= Fraction(len((target_set & Dset)-set(source)), 2) + scalar += Fraction(chosen-1, 2)*total_coefficient + assert scalar == Fraction(len(target_set.intersection(source))-1, 2) + for j, t in enumerate(triples): + masks = [point_masks[a] for a in t] + two = (masks[0]&masks[1]&~masks[2]) | (masks[0]&masks[2]&~masks[1]) | (masks[1]&masks[2]&~masks[0]) + actual = 0 + for a, b in combinations(t, 2): + excluded = next(i for i in t if i not in (a, b)) + actual |= support[pair_outputs[a, b, excluded]] + assert actual == two + assert masks[0]&masks[1]&masks[2] == 1 << j + assert [((k-1)+(k == 0)-(k == 2)) for k in range(4)] == [0, 0, 0, 2] + + def contained(x, y): + tx, ty = types[x], types[y] + if tx == 1 and ty == 1: return not(core[y]&~core[x] or cover[x]&~cover[y]) + if tx in (1, 2) and ty == 2: return not cover[x]&~cover[y] + return False + active = [0]*n; stack = list(roots) + while stack: + x = stack.pop() + if not x or active[x]: continue + active[x] = 1 + if args[x][0]: stack.extend(args[x]) + degree = [0]*n + for x in range(1, n): + if active[x]: + if types[x] == 1: + assert core[x].bit_count() >= 2 and ranks[x] == support[x].bit_count() + else: + assert types[x] == 2 and ranks[x] == cover[x].bit_count() + if active[x] and args[x][0]: + for y in args[x]: + assert y < x and contained(y, x), 'Binary frame nesting failed' + degree[y] += 1 + for x in roots: degree[x] += 1 + H = [0]*(h+1); c = 0; loss = 0 + for x in range(1, n): + if not active[x]: continue + r = ranks[x] + if args[x][0]: + c += 1; H[r] += degree[x]-1; H[h-r] += 1 + for y in args[x]: + assert r >= ranks[y] + H[r-ranks[y]] += 1 + else: H[1] += degree[x] + for x, k in zip(roots, kind): + r = ranks[x] + if k: H[r] += 1; H[h] += 1; loss += r + else: H[h-1-r] += 1; H[1] += 1 + q = len(roots); R = c+q + result = dict(h=h, v=v, c=c, q=q, R=R, loss=loss, central_disjoint=d, histogram=H, + rank_sum=sum(r*m for r, m in enumerate(H))) + assert loss == h*(h-1) and result['rank_sum'] == h*R+2*loss + result['center_denominator'] = 21 + result['scalar_validation'] = dict(ordinary_supports_exact=True, centers_exact=True, + center_decoder='sum A_i / 21', scatter_coefficients=list(map(str, scatter_coefficients)), + rational_scalar_identity_exact=True, mixed_center_scatter_exact=True, binary_frames_nested=True, + binary_frames_nondegenerate=True) + with open(str(prefix)+'.bin', 'wb') as f: + f.write(struct.pack('<4I', h, v, n, q)) + write_array(f, array.array('I', (a for pair in args for a in pair))) + write_array(f, array.array('Q', core)); write_array(f, array.array('Q', cover)) + write_array(f, array.array('I', roots)); write_array(f, array.array('I', kind)) + write_array(f, array.array('B', active)) + with open(str(prefix)+'.labels', 'wb') as f: + write_array(f, array.array('I', ranks)); write_array(f, array.array('B', types)) + Path(str(prefix)+'.json').write_text(json.dumps(result, indent=2)+'\n') + return result diff --git a/research/shrunk-frames/terminal-elision-audit.json b/research/shrunk-frames/terminal-elision-audit.json new file mode 100644 index 0000000000..584c4a5967 --- /dev/null +++ b/research/shrunk-frames/terminal-elision-audit.json @@ -0,0 +1,53 @@ +{ + "active_roles": 28324, + "center_fresh_copy_increments": { + "23": 24 + }, + "conservative_local_group_upper": 14753732688, + "deficit": 1862080, + "direct_updates": 1167, + "exact_local_identity": "-alpha*z + alpha*(z + sum(updates))", + "forward_frame_increments": { + "1": 106186, + "2": 66002, + "3": 7042, + "4": 14959, + "5": 6511, + "6": 3887, + "7": 2934, + "8": 5454, + "9": 1127, + "10": 1822, + "11": 1734, + "12": 7853, + "13": 3097, + "14": 370, + "15": 847, + "16": 211, + "17": 125, + "18": 718, + "19": 517, + "20": 202, + "21": 304, + "22": 16, + "23": 2066 + }, + "forward_reflected_scalar_events": 247498, + "full_child_histogram_reconstructed": true, + "modular_replay_seeds": [ + 202610081, + 202610082 + ], + "parent_word_sha256": "9dc0f11f53912ad0870690983f5be6cbfb625792318f88ce04ebbd5bb8637d3e", + "rejected_controls": [ + "omitted-direct-update", + "wrong-direct-sign", + "retimed-direct-update", + "wrong-direct-frame" + ], + "removed_roles": 381, + "scope": "Finite exact composition on the pinned PR #125 word. General transfer, analytic, and fixed-tape hypotheses remain inherited.", + "source_time_snapshots": true, + "status": "PASS independent terminal-elision scalar and forward/reflected frame audit", + "total_rank": 70758991424 +} diff --git a/research/shrunk-frames/terminal-elision.json.gz b/research/shrunk-frames/terminal-elision.json.gz new file mode 100644 index 0000000000..69bd1504a0 Binary files /dev/null and b/research/shrunk-frames/terminal-elision.json.gz differ diff --git a/research/shrunk-frames/terminal-selection.json b/research/shrunk-frames/terminal-selection.json new file mode 100644 index 0000000000..ba8f7fbe25 --- /dev/null +++ b/research/shrunk-frames/terminal-selection.json @@ -0,0 +1,7301 @@ +{ + "candidates": [ + 24058, + 24074, + 24588, + 26827, + 26887, + 26900, + 26909, + 26995, + 27092, + 27140, + 27149, + 27198, + 27220, + 27258, + 27344, + 27348, + 27375, + 27386, + 27389, + 27413, + 27460, + 27463, + 27470, + 27472, + 27477, + 27489, + 27532, + 27534, + 27537, + 27543, + 27547, + 27556, + 27560, + 27562, + 27574, + 27576, + 27581, + 27585, + 27601, + 27602, + 27603, + 27605, + 27608, + 27609, + 27617, + 27625, + 27631, + 27638, + 27643, + 27713, + 27717, + 27724, + 27731, + 27735, + 27736, + 27740, + 27744, + 27752, + 27765, + 27771, + 27799, + 27804, + 27806, + 27810, + 27813, + 27823, + 27839, + 27850, + 27855, + 27861, + 27865, + 27874, + 27876, + 27882, + 27884, + 27887, + 27889, + 27891, + 27894, + 27936, + 27940, + 27941, + 27942, + 27943, + 27946, + 27949, + 27952, + 27953, + 27954, + 27960, + 27961, + 27964, + 27965, + 27966, + 27968, + 27971, + 27980, + 27993, + 28010, + 28016, + 28018, + 28021, + 28028, + 28031, + 28034, + 28037, + 28038, + 28042, + 28044, + 28047, + 28051, + 28056, + 28063, + 28069, + 28074, + 28108, + 28109, + 28113, + 28115, + 28117, + 28123, + 28125, + 28127, + 28128, + 28132, + 28136, + 28143, + 28145, + 28146, + 28150, + 28151, + 28162, + 28163, + 28172, + 28181, + 28187, + 28194, + 28199, + 28202, + 28205, + 28210, + 28215, + 28226, + 28238, + 28239, + 28243, + 28245, + 28246, + 28251, + 28254, + 28255, + 28256, + 28257, + 28265, + 28266, + 28267, + 28269, + 28271, + 28273, + 28275, + 28303, + 28305, + 28307, + 28312, + 28315, + 28323, + 28326, + 28337, + 28343, + 28348, + 28352, + 28354, + 28359, + 28361, + 28384, + 28385, + 28386, + 28387, + 28388, + 28389, + 28390, + 28391, + 28392, + 28394, + 28395, + 28396, + 28397, + 28398, + 28399, + 28400, + 28401, + 28402, + 28403, + 28404, + 28405, + 28406, + 28407, + 28408, + 28409, + 28410, + 28411, + 28412, + 28413, + 28414, + 28415, + 28416, + 28417, + 28418, + 28419, + 28420, + 28421, + 28422, + 28424, + 28425, + 28426, + 28427, + 28428, + 28429, + 28430, + 28431, + 28432, + 28433, + 28434, + 28435, + 28436, + 28437, + 28438, + 28439, + 28440, + 28441, + 28442, + 28443, + 28444, + 28445, + 28446, + 28447, + 28448, + 28449, + 28450, + 28451, + 28452, + 28453, + 28454, + 28455, + 28456, + 28457, + 28458, + 28459, + 28460, + 28461, + 28462, + 28463, + 28464, + 28465, + 28466, + 28467, + 28469, + 28470, + 28471, + 28472, + 28473, + 28474, + 28475, + 28476, + 28477, + 28478, + 28479, + 28480, + 28481, + 28482, + 28483, + 28484, + 28485, + 28486, + 28487, + 28488, + 28489, + 28490, + 28491, + 28492, + 28493, + 28494, + 28495, + 28496, + 28497, + 28498, + 28499, + 28500, + 28501, + 28502, + 28503, + 28504, + 28505, + 28506, + 28507, + 28508, + 28509, + 28511, + 28512, + 28513, + 28514, + 28515, + 28516, + 28517, + 28518, + 28519, + 28520, + 28521, + 28522, + 28523, + 28524, + 28525, + 28526, + 28527, + 28528, + 28529, + 28530, + 28531, + 28532, + 28533, + 28534, + 28535, + 28536, + 28537, + 28538, + 28539, + 28540, + 28541, + 28542, + 28543, + 28544, + 28545, + 28546, + 28547, + 28549, + 28550, + 28551, + 28552, + 28553, + 28554, + 28555, + 28556, + 28557, + 28558, + 28559, + 28560, + 28561, + 28565, + 28570, + 28575, + 28576, + 28577, + 28597, + 28605, + 28608, + 28612, + 28615, + 28616, + 28618, + 28619, + 28620, + 28622, + 28623, + 28625, + 28626, + 28629, + 28631, + 28634, + 28635, + 28636, + 28637, + 28638, + 28640, + 28641, + 28642, + 28643, + 28645, + 28647, + 28649, + 28679, + 28690 + ], + "accepted": [ + 24058, + 24074, + 24588, + 26827, + 26887, + 26900, + 26909, + 26995, + 27092, + 27140, + 27149, + 27198, + 27220, + 27258, + 27344, + 27348, + 27375, + 27386, + 27389, + 27413, + 27460, + 27463, + 27470, + 27472, + 27477, + 27489, + 27532, + 27534, + 27537, + 27543, + 27547, + 27556, + 27560, + 27562, + 27574, + 27576, + 27581, + 27585, + 27601, + 27602, + 27603, + 27605, + 27608, + 27609, + 27617, + 27625, + 27631, + 27638, + 27643, + 27713, + 27717, + 27724, + 27731, + 27735, + 27736, + 27740, + 27744, + 27752, + 27765, + 27771, + 27799, + 27804, + 27806, + 27810, + 27813, + 27823, + 27839, + 27850, + 27855, + 27861, + 27865, + 27874, + 27876, + 27882, + 27884, + 27887, + 27889, + 27891, + 27894, + 27936, + 27940, + 27941, + 27942, + 27943, + 27946, + 27949, + 27952, + 27953, + 27954, + 27960, + 27961, + 27964, + 27965, + 27966, + 27968, + 27971, + 27980, + 27993, + 28010, + 28016, + 28018, + 28021, + 28028, + 28031, + 28034, + 28037, + 28038, + 28042, + 28044, + 28047, + 28051, + 28056, + 28063, + 28069, + 28074, + 28108, + 28109, + 28113, + 28115, + 28117, + 28123, + 28125, + 28127, + 28128, + 28132, + 28136, + 28143, + 28145, + 28146, + 28150, + 28151, + 28162, + 28163, + 28172, + 28181, + 28187, + 28194, + 28199, + 28202, + 28205, + 28210, + 28215, + 28226, + 28238, + 28239, + 28243, + 28245, + 28246, + 28251, + 28254, + 28255, + 28256, + 28257, + 28265, + 28266, + 28267, + 28269, + 28271, + 28273, + 28275, + 28303, + 28305, + 28307, + 28312, + 28315, + 28323, + 28326, + 28337, + 28343, + 28348, + 28352, + 28354, + 28359, + 28361, + 28384, + 28385, + 28386, + 28387, + 28388, + 28389, + 28390, + 28391, + 28392, + 28394, + 28395, + 28396, + 28397, + 28398, + 28399, + 28400, + 28401, + 28402, + 28403, + 28404, + 28405, + 28406, + 28407, + 28408, + 28409, + 28410, + 28411, + 28412, + 28413, + 28414, + 28415, + 28416, + 28417, + 28418, + 28419, + 28420, + 28421, + 28422, + 28424, + 28425, + 28426, + 28427, + 28428, + 28429, + 28430, + 28431, + 28432, + 28433, + 28434, + 28435, + 28436, + 28437, + 28438, + 28439, + 28440, + 28441, + 28442, + 28443, + 28444, + 28445, + 28446, + 28447, + 28448, + 28449, + 28450, + 28451, + 28452, + 28453, + 28454, + 28455, + 28456, + 28457, + 28458, + 28459, + 28460, + 28461, + 28462, + 28463, + 28464, + 28465, + 28466, + 28467, + 28469, + 28470, + 28471, + 28472, + 28473, + 28474, + 28475, + 28476, + 28477, + 28478, + 28479, + 28480, + 28481, + 28482, + 28483, + 28484, + 28485, + 28486, + 28487, + 28488, + 28489, + 28490, + 28491, + 28492, + 28493, + 28494, + 28495, + 28496, + 28497, + 28498, + 28499, + 28500, + 28501, + 28502, + 28503, + 28504, + 28505, + 28506, + 28507, + 28508, + 28509, + 28511, + 28512, + 28513, + 28514, + 28515, + 28516, + 28517, + 28518, + 28519, + 28520, + 28521, + 28522, + 28523, + 28524, + 28525, + 28526, + 28527, + 28528, + 28529, + 28530, + 28531, + 28532, + 28533, + 28534, + 28535, + 28536, + 28537, + 28538, + 28539, + 28540, + 28541, + 28542, + 28543, + 28544, + 28545, + 28546, + 28547, + 28549, + 28550, + 28551, + 28552, + 28553, + 28554, + 28555, + 28556, + 28557, + 28558, + 28559, + 28560, + 28561, + 28565, + 28570, + 28575, + 28576, + 28577, + 28597, + 28605, + 28608, + 28612, + 28615, + 28616, + 28618, + 28619, + 28620, + 28622, + 28623, + 28625, + 28626, + 28629, + 28631, + 28634, + 28635, + 28636, + 28637, + 28638, + 28640, + 28641, + 28642, + 28643, + 28645, + 28647, + 28649, + 28679, + 28690 + ], + "rejected": [], + "terminal_blocked": { + "not_deferred": 34, + "target_past_update_frame": 280 + }, + "target_count": 381, + "targets": { + "512": { + "roles": [ + 24058 + ], + "nested": true, + "frame_dimensions": [ + 8, + 8, + 9, + 19, + 23, + 23 + ], + "event_indices": [ + 59302, + 68047, + 101166, + 110153, + 110154 + ] + }, + "549": { + "roles": [ + 24074 + ], + "nested": true, + "frame_dimensions": [ + 8, + 8, + 19, + 23, + 23 + ], + "event_indices": [ + 59344, + 101265, + 110357, + 110358 + ] + }, + "1596": { + "roles": [ + 24588 + ], + "nested": true, + "frame_dimensions": [ + 8, + 8, + 19, + 23, + 23 + ], + "event_indices": [ + 60738, + 102430, + 112904, + 112905 + ] + }, + "27": { + "roles": [ + 26827 + ], + "nested": true, + "frame_dimensions": [ + 18, + 18, + 20, + 21, + 21, + 23, + 23 + ], + "event_indices": [ + 94164, + 100502, + 103531, + 103532, + 108831, + 108832 + ] + }, + "803": { + "roles": [ + 26887 + ], + "nested": true, + "frame_dimensions": [ + 18, + 18, + 19, + 22, + 23, + 23 + ], + "event_indices": [ + 94303, + 101453, + 105134, + 110751, + 110752 + ] + }, + "1938": { + "roles": [ + 26900 + ], + "nested": true, + "frame_dimensions": [ + 18, + 18, + 19, + 22, + 22, + 23 + ], + "event_indices": [ + 94336, + 102989, + 107962, + 107963, + 114114 + ] + }, + "227": { + "roles": [ + 26909 + ], + "nested": true, + "frame_dimensions": [ + 18, + 18, + 19, + 22, + 22, + 23 + ], + "event_indices": [ + 94357, + 101063, + 104437, + 104438, + 109917 + ] + }, + "1736": { + "roles": [ + 26995 + ], + "nested": true, + "frame_dimensions": [ + 18, + 18, + 19, + 21, + 21, + 23 + ], + "event_indices": [ + 94544, + 102793, + 107587, + 107588, + 113676 + ] + }, + "855": { + "roles": [ + 27092 + ], + "nested": true, + "frame_dimensions": [ + 18, + 18, + 19, + 22, + 23, + 23 + ], + "event_indices": [ + 94734, + 101568, + 105318, + 110984, + 110985 + ] + }, + "925": { + "roles": [ + 27140 + ], + "nested": true, + "frame_dimensions": [ + 18, + 18, + 20, + 21, + 21, + 23, + 23 + ], + "event_indices": [ + 94824, + 101678, + 105550, + 105551, + 111250, + 111251 + ] + }, + "182": { + "roles": [ + 27149 + ], + "nested": true, + "frame_dimensions": [ + 18, + 18, + 19, + 22, + 23 + ], + "event_indices": [ + 94842, + 100913, + 104213, + 109624 + ] + }, + "933": { + "roles": [ + 27198 + ], + "nested": true, + "frame_dimensions": [ + 18, + 18, + 19, + 22, + 23, + 23 + ], + "event_indices": [ + 94943, + 101711, + 105630, + 111345, + 111346 + ] + }, + "40": { + "roles": [ + 27220 + ], + "nested": true, + "frame_dimensions": [ + 18, + 18, + 19, + 22, + 23 + ], + "event_indices": [ + 94982, + 100578, + 103648, + 108984 + ] + }, + "929": { + "roles": [ + 27258 + ], + "nested": true, + "frame_dimensions": [ + 18, + 18, + 19, + 21, + 21, + 23, + 23 + ], + "event_indices": [ + 95057, + 101697, + 105593, + 105594, + 111301, + 111302 + ] + }, + "1179": { + "roles": [ + 27344 + ], + "nested": true, + "frame_dimensions": [ + 18, + 18, + 19, + 22, + 23, + 23 + ], + "event_indices": [ + 95219, + 101965, + 106073, + 111882, + 111883 + ] + }, + "453": { + "roles": [ + 27348 + ], + "nested": true, + "frame_dimensions": [ + 18, + 18, + 19, + 22, + 23, + 23 + ], + "event_indices": [ + 95227, + 101036, + 104394, + 109860, + 109861 + ] + }, + "1835": { + "roles": [ + 27375 + ], + "nested": true, + "frame_dimensions": [ + 18, + 18, + 22, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 95281, + 107730, + 107731, + 107732, + 113834, + 113835 + ] + }, + "646": { + "roles": [ + 27386 + ], + "nested": true, + "frame_dimensions": [ + 18, + 18, + 19, + 22, + 22, + 22, + 23 + ], + "event_indices": [ + 95304, + 101514, + 105221, + 105222, + 105223, + 110868 + ] + }, + "636": { + "roles": [ + 27389 + ], + "nested": true, + "frame_dimensions": [ + 18, + 18, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 95308, + 101517, + 105227, + 105228, + 110874, + 110875 + ] + }, + "931": { + "roles": [ + 27413 + ], + "nested": true, + "frame_dimensions": [ + 18, + 18, + 20, + 21, + 21, + 23, + 23 + ], + "event_indices": [ + 95352, + 101706, + 105615, + 105616, + 111326, + 111327 + ] + }, + "463": { + "roles": [ + 27460 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 23, + 23 + ], + "event_indices": [ + 97031, + 109930, + 109932 + ] + }, + "429": { + "roles": [ + 27463 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 23, + 23 + ], + "event_indices": [ + 97042, + 109699, + 109701 + ] + }, + "316": { + "roles": [ + 27470 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 97091, + 103687, + 103688, + 109028, + 109030 + ] + }, + "351": { + "roles": [ + 27472 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 97103, + 103873, + 103874, + 109224, + 109226 + ] + }, + "349": { + "roles": [ + 27477 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 97143, + 103851, + 103852, + 109204, + 109206 + ] + }, + "134": { + "roles": [ + 27489 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23 + ], + "event_indices": [ + 97213, + 104008, + 104009, + 109383 + ] + }, + "30": { + "roles": [ + 27532 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 21, + 23 + ], + "event_indices": [ + 97497, + 103543, + 108844 + ] + }, + "509": { + "roles": [ + 27534 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 97501, + 104605, + 110132 + ] + }, + "26": { + "roles": [ + 27537 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 20, + 21, + 21, + 23 + ], + "event_indices": [ + 97525, + 100485, + 103500, + 103501, + 108804 + ] + }, + "28": { + "roles": [ + 27543 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 19, + 21, + 21, + 23 + ], + "event_indices": [ + 97547, + 100497, + 103521, + 103522, + 108824 + ] + }, + "1144": { + "roles": [ + 27547 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 97574, + 105914, + 105915, + 111682, + 111683 + ] + }, + "1075": { + "roles": [ + 27556 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 21, + 23, + 23 + ], + "event_indices": [ + 97634, + 105512, + 111213, + 111215 + ] + }, + "715": { + "roles": [ + 27560 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 19, + 22, + 23, + 23 + ], + "event_indices": [ + 97674, + 101150, + 104582, + 110106, + 110108 + ] + }, + "1073": { + "roles": [ + 27562 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 21, + 23, + 23 + ], + "event_indices": [ + 97679, + 105489, + 111189, + 111191 + ] + }, + "963": { + "roles": [ + 27574 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 97735, + 105778, + 111517 + ] + }, + "954": { + "roles": [ + 27576 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 97739, + 105706, + 105707, + 111426, + 111429 + ] + }, + "507": { + "roles": [ + 27581 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 97762, + 104597, + 110126 + ] + }, + "956": { + "roles": [ + 27585 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 97790, + 105728, + 105729, + 111453, + 111456 + ] + }, + "921": { + "roles": [ + 27601 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 20, + 22, + 23 + ], + "event_indices": [ + 97902, + 101659, + 105496, + 111200 + ] + }, + "750": { + "roles": [ + 27602 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 19, + 22, + 23, + 23 + ], + "event_indices": [ + 97905, + 101244, + 104764, + 110316, + 110318 + ] + }, + "927": { + "roles": [ + 27603 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23, + 23 + ], + "event_indices": [ + 97913, + 105564, + 111269, + 111270 + ] + }, + "65": { + "roles": [ + 27605 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 19, + 22, + 22, + 23 + ], + "event_indices": [ + 97930, + 100598, + 103680, + 103681, + 109021 + ] + }, + "748": { + "roles": [ + 27608 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 19, + 22, + 23, + 23 + ], + "event_indices": [ + 97946, + 101235, + 104743, + 110292, + 110294 + ] + }, + "919": { + "roles": [ + 27609 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 20, + 22, + 23 + ], + "event_indices": [ + 97949, + 101653, + 105473, + 111176 + ] + }, + "1245": { + "roles": [ + 27617 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 97993, + 106306, + 106307, + 112159, + 112162 + ] + }, + "542": { + "roles": [ + 27625 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 98040, + 104758, + 110312 + ] + }, + "544": { + "roles": [ + 27631 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 98081, + 104779, + 110336 + ] + }, + "1605": { + "roles": [ + 27638 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 23 + ], + "event_indices": [ + 98113, + 112914 + ] + }, + "1359": { + "roles": [ + 27643 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 21, + 21, + 23, + 23 + ], + "event_indices": [ + 98168, + 106237, + 106238, + 112082, + 112083 + ] + }, + "765": { + "roles": [ + 27713 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 98582, + 104921, + 110495 + ] + }, + "1089": { + "roles": [ + 27717 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 98617, + 105666, + 111382 + ] + }, + "106": { + "roles": [ + 27724 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 98652, + 100719, + 103905, + 109253 + ] + }, + "1571": { + "roles": [ + 27731 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23 + ], + "event_indices": [ + 98687, + 106821, + 106822, + 112778 + ] + }, + "302": { + "roles": [ + 27735 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 98698, + 103729, + 103730, + 109068, + 109069 + ] + }, + "137": { + "roles": [ + 27736 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 98701, + 100800, + 104042, + 109412 + ] + }, + "547": { + "roles": [ + 27740 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 98719, + 104789, + 110342 + ] + }, + "1516": { + "roles": [ + 27744 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23, + 23 + ], + "event_indices": [ + 98733, + 106972, + 112956, + 112959 + ] + }, + "578": { + "roles": [ + 27752 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 98762, + 104934, + 110504 + ] + }, + "965": { + "roles": [ + 27765 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 19, + 22, + 22, + 23 + ], + "event_indices": [ + 98821, + 101796, + 105802, + 105803, + 111540 + ] + }, + "301": { + "roles": [ + 27771 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 98849, + 103741, + 103742, + 109078, + 109079 + ] + }, + "1606": { + "roles": [ + 27799 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 21, + 23, + 23 + ], + "event_indices": [ + 98962, + 106941, + 112919, + 112920 + ] + }, + "910": { + "roles": [ + 27804 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 98984, + 105543, + 105544, + 111244, + 111245 + ] + }, + "139": { + "roles": [ + 27806 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 98991, + 104052, + 104053, + 109427, + 109428 + ] + }, + "1364": { + "roles": [ + 27810 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23, + 23, + 23 + ], + "event_indices": [ + 99003, + 106282, + 112131, + 112132, + 112133 + ] + }, + "108": { + "roles": [ + 27813 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 99012, + 103915, + 103916, + 109268, + 109269 + ] + }, + "73": { + "roles": [ + 27823 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 99057, + 103752, + 103753, + 109092, + 109093 + ] + }, + "909": { + "roles": [ + 27839 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 99131, + 105540, + 111243 + ] + }, + "75": { + "roles": [ + 27850 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 99210, + 103772, + 103773, + 109116, + 109117 + ] + }, + "110": { + "roles": [ + 27855 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 99222, + 103935, + 103936, + 109292, + 109293 + ] + }, + "1146": { + "roles": [ + 27861 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 99236, + 105945, + 111727 + ] + }, + "551": { + "roles": [ + 27865 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23, + 23 + ], + "event_indices": [ + 99249, + 104832, + 110391, + 110392 + ] + }, + "1550": { + "roles": [ + 27874 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23, + 23 + ], + "event_indices": [ + 99284, + 107163, + 113186, + 113189 + ] + }, + "1507": { + "roles": [ + 27876 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 99291, + 106952, + 106953, + 106954, + 112933, + 112934 + ] + }, + "582": { + "roles": [ + 27882 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23, + 23 + ], + "event_indices": [ + 99321, + 104975, + 110553, + 110554 + ] + }, + "1625": { + "roles": [ + 27884 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23 + ], + "event_indices": [ + 99331, + 107042, + 107043, + 113037 + ] + }, + "155": { + "roles": [ + 27887 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 99338, + 104087, + 109470 + ] + }, + "210": { + "roles": [ + 27889 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 99343, + 104356, + 109809 + ] + }, + "1761": { + "roles": [ + 27891 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 99355, + 107388, + 113456 + ] + }, + "822": { + "roles": [ + 27894 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 99365, + 105192, + 110829 + ] + }, + "269": { + "roles": [ + 27936 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23, + 23 + ], + "event_indices": [ + 99533, + 103630, + 108952, + 108954 + ] + }, + "1404": { + "roles": [ + 27940 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 99548, + 106544, + 112459 + ] + }, + "759": { + "roles": [ + 27941 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23, + 23, + 23 + ], + "event_indices": [ + 99550, + 104854, + 110420, + 110421, + 110422 + ] + }, + "1543": { + "roles": [ + 27942 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 22, + 22, + 23 + ], + "event_indices": [ + 99553, + 107124, + 107125, + 113142 + ] + }, + "77": { + "roles": [ + 27943 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 99559, + 103792, + 103793, + 109140, + 109141 + ] + }, + "843": { + "roles": [ + 27946 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 99567, + 105294, + 110957 + ] + }, + "914": { + "roles": [ + 27949 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 99577, + 105586, + 105587, + 111295, + 111296 + ] + }, + "1559": { + "roles": [ + 27952 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23, + 23 + ], + "event_indices": [ + 99586, + 107203, + 113237, + 113240 + ] + }, + "788": { + "roles": [ + 27953 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23, + 23, + 23 + ], + "event_indices": [ + 99592, + 104995, + 110582, + 110583, + 110584 + ] + }, + "1368": { + "roles": [ + 27954 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23, + 23, + 23 + ], + "event_indices": [ + 99595, + 106326, + 112184, + 112185, + 112186 + ] + }, + "1148": { + "roles": [ + 27960 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 99621, + 105964, + 111753 + ] + }, + "1610": { + "roles": [ + 27961 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23 + ], + "event_indices": [ + 99624, + 106978, + 106979, + 112963 + ] + }, + "1112": { + "roles": [ + 27964 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23, + 23, + 23 + ], + "event_indices": [ + 99630, + 105746, + 111478, + 111479, + 111480 + ] + }, + "157": { + "roles": [ + 27965 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 99636, + 104106, + 109494 + ] + }, + "1920": { + "roles": [ + 27966 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23 + ], + "event_indices": [ + 99638, + 107848, + 107849, + 113983 + ] + }, + "1627": { + "roles": [ + 27968 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23 + ], + "event_indices": [ + 99643, + 107063, + 107064, + 113063 + ] + }, + "112": { + "roles": [ + 27971 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 99647, + 103955, + 103956, + 109316, + 109317 + ] + }, + "824": { + "roles": [ + 27980 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 99675, + 105211, + 110855 + ] + }, + "913": { + "roles": [ + 27993 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 99733, + 105583, + 111294 + ] + }, + "1828": { + "roles": [ + 28010 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23 + ], + "event_indices": [ + 99820, + 107647, + 107648, + 113761 + ] + }, + "916": { + "roles": [ + 28016 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 99836, + 105608, + 105609, + 111320, + 111321 + ] + }, + "1184": { + "roles": [ + 28018 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 99841, + 106134, + 111960 + ] + }, + "222": { + "roles": [ + 28021 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23, + 23 + ], + "event_indices": [ + 99850, + 104407, + 104408, + 109882, + 109883, + 109884 + ] + }, + "1169": { + "roles": [ + 28028 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 99873, + 106070, + 111881 + ] + }, + "1980": { + "roles": [ + 28031 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23 + ], + "event_indices": [ + 99883, + 107977, + 107978, + 114136 + ] + }, + "145": { + "roles": [ + 28034 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 99893, + 104110, + 104111, + 109499, + 109500 + ] + }, + "1114": { + "roles": [ + 28037 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23, + 23, + 23 + ], + "event_indices": [ + 99900, + 105766, + 111504, + 111505, + 111506 + ] + }, + "1556": { + "roles": [ + 28038 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 99903, + 107183, + 107184, + 107185, + 113214, + 113215 + ] + }, + "625": { + "roles": [ + 28042 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23 + ], + "event_indices": [ + 99917, + 105121, + 105122, + 110737 + ] + }, + "79": { + "roles": [ + 28044 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 99926, + 103812, + 103813, + 109164, + 109165 + ] + }, + "1612": { + "roles": [ + 28047 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23 + ], + "event_indices": [ + 99934, + 107000, + 107001, + 112989 + ] + }, + "1545": { + "roles": [ + 28051 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 99941, + 107144, + 107145, + 107146, + 113163, + 113164 + ] + }, + "1629": { + "roles": [ + 28056 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23 + ], + "event_indices": [ + 99955, + 107085, + 107086, + 113089 + ] + }, + "2002": { + "roles": [ + 28063 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23 + ], + "event_indices": [ + 99971, + 108035, + 108036, + 114190 + ] + }, + "1150": { + "roles": [ + 28069 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 99988, + 105983, + 111779 + ] + }, + "915": { + "roles": [ + 28074 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 100006, + 105605, + 111319 + ] + }, + "1924": { + "roles": [ + 28108 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 100141, + 107892, + 114030 + ] + }, + "1952": { + "roles": [ + 28109 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 100142, + 107903, + 107904, + 114043, + 114044 + ] + }, + "1767": { + "roles": [ + 28113 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 100150, + 102714, + 107442, + 113517 + ] + }, + "1502": { + "roles": [ + 28115 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 100157, + 102421, + 106914, + 106915, + 112887, + 112888 + ] + }, + "934": { + "roles": [ + 28117 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 100161, + 105631, + 105632, + 111347, + 111348 + ] + }, + "1793": { + "roles": [ + 28123 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 100177, + 102777, + 107560, + 113646 + ] + }, + "1044": { + "roles": [ + 28125 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 19, + 22, + 22, + 23 + ], + "event_indices": [ + 100182, + 102024, + 106182, + 106183, + 112012 + ] + }, + "1722": { + "roles": [ + 28127 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 100194, + 107517, + 113593 + ] + }, + "1788": { + "roles": [ + 28128 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 100195, + 107528, + 107529, + 113606, + 113607 + ] + }, + "1748": { + "roles": [ + 28132 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 100204, + 102664, + 107347, + 113411 + ] + }, + "147": { + "roles": [ + 28136 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 100217, + 100860, + 104138, + 109528 + ] + }, + "2018": { + "roles": [ + 28143 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23, + 23 + ], + "event_indices": [ + 100237, + 108061, + 114220, + 114222 + ] + }, + "116": { + "roles": [ + 28145 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 100242, + 100779, + 104000, + 109371 + ] + }, + "174": { + "roles": [ + 28146 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23 + ], + "event_indices": [ + 100245, + 104241, + 104242, + 109663 + ] + }, + "1843": { + "roles": [ + 28150 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 100259, + 107759, + 113865 + ] + }, + "1888": { + "roles": [ + 28151 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23, + 23 + ], + "event_indices": [ + 100260, + 107771, + 113878, + 113879 + ] + }, + "1333": { + "roles": [ + 28162 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 19, + 22, + 22, + 23 + ], + "event_indices": [ + 100286, + 102341, + 106772, + 106773, + 112711 + ] + }, + "1307": { + "roles": [ + 28163 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 19, + 22, + 22, + 23 + ], + "event_indices": [ + 100289, + 102284, + 106660, + 106661, + 112587 + ] + }, + "99": { + "roles": [ + 28172 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 19, + 22, + 22, + 23 + ], + "event_indices": [ + 100313, + 100681, + 103830, + 103831, + 109185 + ] + }, + "861": { + "roles": [ + 28181 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23, + 23, + 23 + ], + "event_indices": [ + 100340, + 105400, + 105401, + 111073, + 111074, + 111075, + 111076 + ] + }, + "1434": { + "roles": [ + 28187 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23, + 23, + 23 + ], + "event_indices": [ + 100370, + 106676, + 112596, + 112597, + 112598 + ] + }, + "1115": { + "roles": [ + 28194 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23, + 23 + ], + "event_indices": [ + 100389, + 105780, + 111519, + 111520 + ] + }, + "1456": { + "roles": [ + 28199 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23, + 23, + 23 + ], + "event_indices": [ + 100409, + 106788, + 112720, + 112721, + 112722 + ] + }, + "827": { + "roles": [ + 28202 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23, + 23, + 23 + ], + "event_indices": [ + 100423, + 105249, + 105250, + 110896, + 110897, + 110898, + 110899 + ] + }, + "1407": { + "roles": [ + 28205 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23, + 23, + 23 + ], + "event_indices": [ + 100430, + 106584, + 106585, + 112498, + 112499, + 112500, + 112501 + ] + }, + "1200": { + "roles": [ + 28210 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23, + 23, + 23 + ], + "event_indices": [ + 100451, + 106198, + 112021, + 112022, + 112023 + ] + }, + "1441": { + "roles": [ + 28215 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23, + 23, + 23 + ], + "event_indices": [ + 100469, + 106742, + 106743, + 112674, + 112675, + 112676, + 112677 + ] + }, + "87": { + "roles": [ + 28226 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 100613, + 103715, + 109054 + ] + }, + "386": { + "roles": [ + 28238 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 100825, + 104084, + 104085, + 109467, + 109468 + ] + }, + "388": { + "roles": [ + 28239 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 100837, + 104103, + 104104, + 109491, + 109492 + ] + }, + "178": { + "roles": [ + 28243 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 100882, + 104173, + 104174, + 109569, + 109570 + ] + }, + "184": { + "roles": [ + 28245 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 100922, + 104226, + 104227, + 109644, + 109645 + ] + }, + "430": { + "roles": [ + 28246 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 100949, + 104268, + 109693 + ] + }, + "464": { + "roles": [ + 28251 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 101067, + 104448, + 109924 + ] + }, + "699": { + "roles": [ + 28254 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23, + 23 + ], + "event_indices": [ + 101159, + 104616, + 110143, + 110144 + ] + }, + "724": { + "roles": [ + 28255 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 101197, + 104674, + 110208 + ] + }, + "708": { + "roles": [ + 28256 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23, + 23 + ], + "event_indices": [ + 101209, + 104696, + 110237, + 110238 + ] + }, + "755": { + "roles": [ + 28257 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 101272, + 104814, + 110370 + ] + }, + "797": { + "roles": [ + 28265 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 101404, + 105072, + 110673 + ] + }, + "799": { + "roles": [ + 28266 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 101417, + 105091, + 110697 + ] + }, + "801": { + "roles": [ + 28267 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 101430, + 105110, + 110721 + ] + }, + "642": { + "roles": [ + 28269 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 101485, + 105187, + 110825 + ] + }, + "644": { + "roles": [ + 28271 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 101498, + 105206, + 110851 + ] + }, + "661": { + "roles": [ + 28273 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 101546, + 105289, + 110953 + ] + }, + "853": { + "roles": [ + 28275 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 101560, + 105311, + 105312, + 105313, + 110980, + 110981 + ] + }, + "1003": { + "roles": [ + 28303 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 101882, + 105940, + 111723 + ] + }, + "1005": { + "roles": [ + 28305 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 101895, + 105959, + 111749 + ] + }, + "1007": { + "roles": [ + 28307 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 101908, + 105978, + 111775 + ] + }, + "1024": { + "roles": [ + 28312 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 101955, + 106065, + 111877 + ] + }, + "1037": { + "roles": [ + 28315 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 101991, + 106129, + 111956 + ] + }, + "1225": { + "roles": [ + 28323 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 20, + 20, + 23, + 23 + ], + "event_indices": [ + 102049, + 106244, + 106245, + 112091, + 112092 + ] + }, + "1370": { + "roles": [ + 28326 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 102107, + 106347, + 112208 + ] + }, + "1294": { + "roles": [ + 28337 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 102218, + 106539, + 112455 + ] + }, + "1492": { + "roles": [ + 28343 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23, + 23 + ], + "event_indices": [ + 102373, + 106829, + 112785 + ] + }, + "1549": { + "roles": [ + 28348 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 102545, + 107137, + 107138, + 113158, + 113159 + ] + }, + "1674": { + "roles": [ + 28352 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 22, + 23, + 23 + ], + "event_indices": [ + 102615, + 107254, + 113302, + 113303 + ] + }, + "1712": { + "roles": [ + 28354 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23, + 23 + ], + "event_indices": [ + 102729, + 107470, + 113540, + 113541 + ] + }, + "1895": { + "roles": [ + 28359 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23 + ], + "event_indices": [ + 102886, + 107792, + 113906 + ] + }, + "1893": { + "roles": [ + 28361 + ], + "nested": true, + "frame_dimensions": [ + 19, + 19, + 22, + 23, + 23 + ], + "event_indices": [ + 102906, + 107817, + 113931, + 113932 + ] + }, + "294": { + "roles": [ + 28384 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103094, + 108631 + ] + }, + "2": { + "roles": [ + 28385 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103095, + 108761 + ] + }, + "3": { + "roles": [ + 28386 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103096, + 108762 + ] + }, + "364": { + "roles": [ + 28387 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103101, + 108633 + ] + }, + "6": { + "roles": [ + 28388 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103102, + 108765 + ] + }, + "7": { + "roles": [ + 28389 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103103, + 108766 + ] + }, + "439": { + "roles": [ + 28390 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103108, + 108636 + ] + }, + "12": { + "roles": [ + 28391 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103109, + 108771 + ] + }, + "13": { + "roles": [ + 28392 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103110, + 108772 + ] + }, + "20": { + "roles": [ + 28394 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103116, + 108779 + ] + }, + "21": { + "roles": [ + 28395 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103117, + 108780 + ] + }, + "478": { + "roles": [ + 28396 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103121, + 108639 + ] + }, + "18": { + "roles": [ + 28397 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103122, + 108777 + ] + }, + "19": { + "roles": [ + 28398 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103123, + 108778 + ] + }, + "731": { + "roles": [ + 28399 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103128, + 108654 + ] + }, + "486": { + "roles": [ + 28400 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103129, + 110060 + ] + }, + "487": { + "roles": [ + 28401 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103130, + 110061 + ] + }, + "1594": { + "roles": [ + 28402 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103134, + 108707 + ] + }, + "1466": { + "roles": [ + 28403 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103135, + 112754 + ] + }, + "1467": { + "roles": [ + 28404 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103136, + 112755 + ] + }, + "1940": { + "roles": [ + 28405 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103140, + 108743 + ] + }, + "1904": { + "roles": [ + 28406 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103141, + 113959 + ] + }, + "1905": { + "roles": [ + 28407 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103142, + 113960 + ] + }, + "1193": { + "roles": [ + 28408 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103150, + 108679 + ] + }, + "896": { + "roles": [ + 28409 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103151, + 111165 + ] + }, + "897": { + "roles": [ + 28410 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103152, + 111166 + ] + }, + "839": { + "roles": [ + 28411 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103156, + 108658 + ] + }, + "494": { + "roles": [ + 28412 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103157, + 110068 + ] + }, + "495": { + "roles": [ + 28413 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103158, + 110069 + ] + }, + "1436": { + "roles": [ + 28414 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103163, + 108695 + ] + }, + "1216": { + "roles": [ + 28415 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103164, + 112061 + ] + }, + "1217": { + "roles": [ + 28416 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103165, + 112062 + ] + }, + "1962": { + "roles": [ + 28417 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103172, + 108745 + ] + }, + "1908": { + "roles": [ + 28418 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103173, + 113963 + ] + }, + "1909": { + "roles": [ + 28419 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103174, + 113964 + ] + }, + "1202": { + "roles": [ + 28420 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103178, + 108680 + ] + }, + "898": { + "roles": [ + 28421 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103179, + 111167 + ] + }, + "899": { + "roles": [ + 28422 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103180, + 111168 + ] + }, + "886": { + "roles": [ + 28424 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103185, + 111155 + ] + }, + "887": { + "roles": [ + 28425 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103186, + 111156 + ] + }, + "456": { + "roles": [ + 28426 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103190, + 108637 + ] + }, + "14": { + "roles": [ + 28427 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103191, + 108773 + ] + }, + "15": { + "roles": [ + 28428 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103192, + 108774 + ] + }, + "1889": { + "roles": [ + 28429 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103196, + 108736 + ] + }, + "1808": { + "roles": [ + 28430 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103197, + 113689 + ] + }, + "1809": { + "roles": [ + 28431 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103198, + 113690 + ] + }, + "883": { + "roles": [ + 28432 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103202, + 108662 + ] + }, + "502": { + "roles": [ + 28433 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103203, + 110076 + ] + }, + "503": { + "roles": [ + 28434 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103204, + 110077 + ] + }, + "1659": { + "roles": [ + 28435 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103208, + 108712 + ] + }, + "1476": { + "roles": [ + 28436 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103209, + 112764 + ] + }, + "1477": { + "roles": [ + 28437 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103210, + 112765 + ] + }, + "1876": { + "roles": [ + 28438 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103214, + 108735 + ] + }, + "1806": { + "roles": [ + 28439 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103215, + 113687 + ] + }, + "1807": { + "roles": [ + 28440 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103216, + 113688 + ] + }, + "2003": { + "roles": [ + 28441 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103221, + 108752 + ] + }, + "1972": { + "roles": [ + 28442 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103222, + 114127 + ] + }, + "1973": { + "roles": [ + 28443 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103223, + 114128 + ] + }, + "1654": { + "roles": [ + 28444 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103227, + 108711 + ] + }, + "1474": { + "roles": [ + 28445 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103228, + 112762 + ] + }, + "1475": { + "roles": [ + 28446 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103229, + 112763 + ] + }, + "1458": { + "roles": [ + 28447 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103233, + 108697 + ] + }, + "1220": { + "roles": [ + 28448 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103234, + 112065 + ] + }, + "1221": { + "roles": [ + 28449 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103235, + 112066 + ] + }, + "1117": { + "roles": [ + 28450 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103240, + 108675 + ] + }, + "888": { + "roles": [ + 28451 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103241, + 111157 + ] + }, + "889": { + "roles": [ + 28452 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103242, + 111158 + ] + }, + "1142": { + "roles": [ + 28453 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103247, + 108676 + ] + }, + "890": { + "roles": [ + 28454 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103248, + 111159 + ] + }, + "891": { + "roles": [ + 28455 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103249, + 111160 + ] + }, + "1759": { + "roles": [ + 28456 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103253, + 108722 + ] + }, + "1662": { + "roles": [ + 28457 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103254, + 113286 + ] + }, + "1663": { + "roles": [ + 28458 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103255, + 113287 + ] + }, + "1207": { + "roles": [ + 28459 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103259, + 108681 + ] + }, + "900": { + "roles": [ + 28460 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103260, + 111169 + ] + }, + "901": { + "roles": [ + 28461 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103261, + 111170 + ] + }, + "1998": { + "roles": [ + 28462 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103265, + 108751 + ] + }, + "1970": { + "roles": [ + 28463 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103266, + 114125 + ] + }, + "1971": { + "roles": [ + 28464 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103267, + 114126 + ] + }, + "1803": { + "roles": [ + 28465 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103271, + 108727 + ] + }, + "1670": { + "roles": [ + 28466 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103272, + 113294 + ] + }, + "1671": { + "roles": [ + 28467 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103273, + 113295 + ] + }, + "1660": { + "roles": [ + 28469 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103278, + 113284 + ] + }, + "1661": { + "roles": [ + 28470 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103279, + 113285 + ] + }, + "764": { + "roles": [ + 28471 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103285, + 108655 + ] + }, + "488": { + "roles": [ + 28472 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103286, + 110062 + ] + }, + "489": { + "roles": [ + 28473 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103287, + 110063 + ] + }, + "1180": { + "roles": [ + 28474 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103291, + 108678 + ] + }, + "894": { + "roles": [ + 28475 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103292, + 111163 + ] + }, + "895": { + "roles": [ + 28476 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103293, + 111164 + ] + }, + "856": { + "roles": [ + 28477 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103297, + 108659 + ] + }, + "496": { + "roles": [ + 28478 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103298, + 110070 + ] + }, + "497": { + "roles": [ + 28479 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103299, + 110071 + ] + }, + "1163": { + "roles": [ + 28480 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103303, + 108677 + ] + }, + "892": { + "roles": [ + 28481 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103304, + 111161 + ] + }, + "893": { + "roles": [ + 28482 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103305, + 111162 + ] + }, + "1419": { + "roles": [ + 28483 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103310, + 108694 + ] + }, + "1214": { + "roles": [ + 28484 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103311, + 112059 + ] + }, + "1215": { + "roles": [ + 28485 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103312, + 112060 + ] + }, + "1645": { + "roles": [ + 28486 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103316, + 108710 + ] + }, + "1472": { + "roles": [ + 28487 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103317, + 112760 + ] + }, + "1473": { + "roles": [ + 28488 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103318, + 112761 + ] + }, + "331": { + "roles": [ + 28489 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103323, + 108632 + ] + }, + "4": { + "roles": [ + 28490 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103324, + 108763 + ] + }, + "5": { + "roles": [ + 28491 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103325, + 108764 + ] + }, + "1373": { + "roles": [ + 28492 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103330, + 108692 + ] + }, + "1210": { + "roles": [ + 28493 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103331, + 112055 + ] + }, + "1211": { + "roles": [ + 28494 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103332, + 112056 + ] + }, + "1449": { + "roles": [ + 28495 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103337, + 108696 + ] + }, + "1218": { + "roles": [ + 28496 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103338, + 112063 + ] + }, + "1219": { + "roles": [ + 28497 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103339, + 112064 + ] + }, + "1776": { + "roles": [ + 28498 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103343, + 108723 + ] + }, + "1664": { + "roles": [ + 28499 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103344, + 113288 + ] + }, + "1665": { + "roles": [ + 28500 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103345, + 113289 + ] + }, + "1632": { + "roles": [ + 28501 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103350, + 108709 + ] + }, + "1470": { + "roles": [ + 28502 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103351, + 112758 + ] + }, + "1471": { + "roles": [ + 28503 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103352, + 112759 + ] + }, + "1858": { + "roles": [ + 28504 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103355, + 108733 + ] + }, + "1812": { + "roles": [ + 28505 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103357, + 113693 + ] + }, + "1813": { + "roles": [ + 28506 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103358, + 113694 + ] + }, + "1615": { + "roles": [ + 28507 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103363, + 108708 + ] + }, + "1468": { + "roles": [ + 28508 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103364, + 112756 + ] + }, + "1469": { + "roles": [ + 28509 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103365, + 112757 + ] + }, + "1208": { + "roles": [ + 28511 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103370, + 112053 + ] + }, + "1209": { + "roles": [ + 28512 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103371, + 112054 + ] + }, + "418": { + "roles": [ + 28513 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103375, + 108635 + ] + }, + "10": { + "roles": [ + 28514 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103376, + 108769 + ] + }, + "11": { + "roles": [ + 28515 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103377, + 108770 + ] + }, + "2019": { + "roles": [ + 28516 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103381, + 108756 + ] + }, + "2006": { + "roles": [ + 28517 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103382, + 114205 + ] + }, + "2007": { + "roles": [ + 28518 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103383, + 114206 + ] + }, + "878": { + "roles": [ + 28519 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103388, + 108661 + ] + }, + "500": { + "roles": [ + 28520 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103389, + 110074 + ] + }, + "501": { + "roles": [ + 28521 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103390, + 110075 + ] + }, + "818": { + "roles": [ + 28522 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103394, + 108657 + ] + }, + "492": { + "roles": [ + 28523 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103395, + 110066 + ] + }, + "493": { + "roles": [ + 28524 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103396, + 110067 + ] + }, + "1898": { + "roles": [ + 28525 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103400, + 108737 + ] + }, + "1810": { + "roles": [ + 28526 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103401, + 113691 + ] + }, + "1811": { + "roles": [ + 28527 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103402, + 113692 + ] + }, + "490": { + "roles": [ + 28528 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103406, + 110064 + ] + }, + "491": { + "roles": [ + 28529 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103407, + 110065 + ] + }, + "1798": { + "roles": [ + 28530 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103412, + 108726 + ] + }, + "1668": { + "roles": [ + 28531 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103413, + 113292 + ] + }, + "1669": { + "roles": [ + 28532 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103414, + 113293 + ] + }, + "2014": { + "roles": [ + 28533 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103418, + 108755 + ] + }, + "2004": { + "roles": [ + 28534 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103419, + 114203 + ] + }, + "2005": { + "roles": [ + 28535 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103420, + 114204 + ] + }, + "1463": { + "roles": [ + 28536 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103424, + 108698 + ] + }, + "1222": { + "roles": [ + 28537 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103425, + 112067 + ] + }, + "1223": { + "roles": [ + 28538 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103426, + 112068 + ] + }, + "393": { + "roles": [ + 28539 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103430, + 108634 + ] + }, + "8": { + "roles": [ + 28540 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103431, + 108767 + ] + }, + "9": { + "roles": [ + 28541 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103432, + 108768 + ] + }, + "1398": { + "roles": [ + 28542 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103437, + 108693 + ] + }, + "1212": { + "roles": [ + 28543 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103438, + 112057 + ] + }, + "1213": { + "roles": [ + 28544 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103439, + 112058 + ] + }, + "1953": { + "roles": [ + 28545 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103445, + 108744 + ] + }, + "1906": { + "roles": [ + 28546 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103446, + 113961 + ] + }, + "1907": { + "roles": [ + 28547 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103447, + 113962 + ] + }, + "498": { + "roles": [ + 28549 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103452, + 110072 + ] + }, + "499": { + "roles": [ + 28550 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103453, + 110073 + ] + }, + "694": { + "roles": [ + 28551 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103457, + 108653 + ] + }, + "484": { + "roles": [ + 28552 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103458, + 110058 + ] + }, + "485": { + "roles": [ + 28553 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103459, + 110059 + ] + }, + "1967": { + "roles": [ + 28554 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103463, + 108746 + ] + }, + "1910": { + "roles": [ + 28555 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103464, + 113965 + ] + }, + "1911": { + "roles": [ + 28556 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103465, + 113966 + ] + }, + "1666": { + "roles": [ + 28557 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103469, + 113290 + ] + }, + "1667": { + "roles": [ + 28558 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103470, + 113291 + ] + }, + "469": { + "roles": [ + 28559 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103474, + 108638 + ] + }, + "16": { + "roles": [ + 28560 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103475, + 108775 + ] + }, + "17": { + "roles": [ + 28561 + ], + "nested": true, + "frame_dimensions": [ + 20, + 20, + 23 + ], + "event_indices": [ + 103476, + 108776 + ] + }, + "283": { + "roles": [ + 28565 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 103564, + 108865, + 108867 + ] + }, + "85": { + "roles": [ + 28570 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 103702, + 109046, + 109047 + ] + }, + "81": { + "roles": [ + 28575 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 103845, + 109202, + 109203 + ] + }, + "118": { + "roles": [ + 28576 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 103866, + 109222, + 109223 + ] + }, + "120": { + "roles": [ + 28577 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 103888, + 109242, + 109243 + ] + }, + "441": { + "roles": [ + 28597 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23 + ], + "event_indices": [ + 104364, + 109815 + ] + }, + "712": { + "roles": [ + 28605 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 104735, + 110284, + 110285 + ] + }, + "747": { + "roles": [ + 28608 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 104896, + 110470, + 110471 + ] + }, + "778": { + "roles": [ + 28612 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 105037, + 110632, + 110633 + ] + }, + "659": { + "roles": [ + 28615 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23 + ], + "event_indices": [ + 105273, + 110931 + ] + }, + "676": { + "roles": [ + 28616 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23 + ], + "event_indices": [ + 105380, + 111060 + ] + }, + "685": { + "roles": [ + 28618 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23 + ], + "event_indices": [ + 105424, + 111108 + ] + }, + "880": { + "roles": [ + 28619 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23 + ], + "event_indices": [ + 105464, + 111147 + ] + }, + "978": { + "roles": [ + 28620 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23 + ], + "event_indices": [ + 105797, + 111547 + ] + }, + "1020": { + "roles": [ + 28622 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23 + ], + "event_indices": [ + 106026, + 111829 + ] + }, + "1022": { + "roles": [ + 28623 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23 + ], + "event_indices": [ + 106049, + 111855 + ] + }, + "1201": { + "roles": [ + 28625 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23 + ], + "event_indices": [ + 106189, + 112025 + ] + }, + "1204": { + "roles": [ + 28626 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23 + ], + "event_indices": [ + 106217, + 112047 + ] + }, + "1348": { + "roles": [ + 28629 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23, + 23 + ], + "event_indices": [ + 106263, + 112109, + 112110 + ] + }, + "1292": { + "roles": [ + 28631 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23 + ], + "event_indices": [ + 106523, + 112433 + ] + }, + "1309": { + "roles": [ + 28634 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23 + ], + "event_indices": [ + 106608, + 112533 + ] + }, + "1311": { + "roles": [ + 28635 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23 + ], + "event_indices": [ + 106631, + 112559 + ] + }, + "1313": { + "roles": [ + 28636 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23 + ], + "event_indices": [ + 106654, + 112585 + ] + }, + "1435": { + "roles": [ + 28637 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23 + ], + "event_indices": [ + 106667, + 112600 + ] + }, + "1326": { + "roles": [ + 28638 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23 + ], + "event_indices": [ + 106722, + 112661 + ] + }, + "1335": { + "roles": [ + 28640 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23 + ], + "event_indices": [ + 106766, + 112709 + ] + }, + "1457": { + "roles": [ + 28641 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23 + ], + "event_indices": [ + 106779, + 112724 + ] + }, + "1460": { + "roles": [ + 28642 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23 + ], + "event_indices": [ + 106807, + 112746 + ] + }, + "1482": { + "roles": [ + 28643 + ], + "nested": true, + "frame_dimensions": [ + 21, + 21, + 23, + 23 + ], + "event_indices": [ + 106846, + 112806, + 112807 + ] + }, + "1486": { + "roles": [ + 28645 + ], + "nested": true, + "frame_dimensions": [ + 21, + 21, + 23, + 23 + ], + "event_indices": [ + 106885, + 112856, + 112857 + ] + }, + "1488": { + "roles": [ + 28647 + ], + "nested": true, + "frame_dimensions": [ + 21, + 21, + 23, + 23 + ], + "event_indices": [ + 106906, + 112880, + 112881 + ] + }, + "1581": { + "roles": [ + 28649 + ], + "nested": true, + "frame_dimensions": [ + 21, + 21, + 23 + ], + "event_indices": [ + 106925, + 112903 + ] + }, + "1865": { + "roles": [ + 28679 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23 + ], + "event_indices": [ + 107655, + 113780 + ] + }, + "1991": { + "roles": [ + 28690 + ], + "nested": true, + "frame_dimensions": [ + 22, + 22, + 23 + ], + "event_indices": [ + 107985, + 114155 + ] + } + } +} diff --git a/research/shrunk-frames/terminal_elision.py b/research/shrunk-frames/terminal_elision.py new file mode 100644 index 0000000000..1e2a7d3230 --- /dev/null +++ b/research/shrunk-frames/terminal_elision.py @@ -0,0 +1,443 @@ +#!/usr/bin/env python3 +"""Compose shrunk deferred frames with exact terminal-accumulator elision. + +The parent frame compiler and DAG are unchanged. Eligible destination-only +ordinary terminal roles are removed, and their updates are redirected to the +corresponding output at the original operation time. This finite generator +keeps a complete event receipt and derives the paid one-child histogram. +The construction adapts the terminal-elision work in PR #122 by +SovereignSteak; the shrunk-frame parent is PR #125 by Joel Pulikkan. +Prepared with OpenAI Codex assistance; Apache-2.0. +""" +import argparse +from collections import Counter, defaultdict +import gzip +import hashlib +import json +from itertools import combinations +from pathlib import Path +import random +import sys + +P = (1 << 61) - 1 + + +def need(condition, message): + if not condition: + raise ValueError(message) + + +def basis(vectors): + pivots = {} + for vector in vectors: + for pivot in sorted(pivots, reverse=True): + if vector >> pivot & 1: + vector ^= pivots[pivot] + if vector: + pivot = vector.bit_length() - 1 + for old in pivots: + if pivots[old] >> pivot & 1: + pivots[old] ^= vector + pivots[pivot] = vector + return tuple(pivots[p] for p in sorted(pivots, reverse=True)) + + +def contains(frame, larger): + larger = basis(larger) + return len(basis(tuple(frame) + larger)) == len(larger) + + +def parent_word_from_capture(d): + """Serialize the captured parent state in the terminal audit convention. + + Ordinary adjoints are stored as signed numerators over 42. Center vectors + remain unscaled; their scatter rows carry the denominator 42. + """ + h, v, roles = d['h'], d['v'], d['Rr'] + scale = 42 + word = dict( + h=h, v=v, R=roles, q=d['q'], args=d['args'], roots=d['roots'], + ops=d['ops'], frames={str(n): d['U'][n] for n in d['U']}, + sigma={str(s): d['placed'][s] for s in d['placed']}, + role_root={str(s): j for s, j in d['role_root'].items()}, + leaf_of={str(s): leaf for s, leaf in d['leaf_of'].items()}, + first_node=d['first_node'], target=d['target'], kind=list(d['kind']), + adjoint_centre={str(s): d['cvec'][s] for s in range(roles)}, + adjoint_ordinary={str(s): {str(t): (scale * c) % P for t, c in d['dpart'][s].items()} + for s in range(roles)}, + reach={str(s): sorted(d['reach'][s]) for s in range(roles)}, + phase_one=d['phase1'], deferred=d['deferred'], chain_dims=d['chain_dims'], + root_frames={str(s): d['root_frame'][s] for s in d['root_frame']}, + centre_of={str(j): i for j, i in d['centre_of'].items()}, + trip=[list(t) for t in d['trip']]) + return word + + +def canonical_word_bytes(word): + def json_default(value): + if hasattr(value, 'tolist'): + return value.tolist() + if isinstance(value, set): + return sorted(value) + raise TypeError('Unsupported captured value: ' + type(value).__name__) + payload = json.dumps(word, separators=(',', ':'), default=json_default).encode() + return gzip.compress(payload, mtime=0) + + +def normalize_word(word): + """Accept either the compact list or keyed-map export convention.""" + for name in ('frames', 'sigma', 'role_root', 'leaf_of', 'adjoint_centre', + 'adjoint_ordinary', 'reach', 'root_frames', 'centre_of'): + value = word[name] + if isinstance(value, list): + word[name] = {str(i): row for i, row in enumerate(value)} + return word + + +def inventory(word): + h, v, roles = word['h'], word['v'], word['R'] + frames = {int(k): v for k, v in word['frames'].items()} + sigma = {int(k): v for k, v in word['sigma'].items()} + roots = {int(k): v for k, v in word['role_root'].items()} + leaves = {int(k): v for k, v in word['leaf_of'].items()} + centre = {int(k): v for k, v in word['adjoint_centre'].items()} + ordinary = {int(k): {int(t): (c if c <= P // 2 else c - P) for t, c in row.items()} + for k, row in word['adjoint_ordinary'].items()} + destinations, sources = Counter(), Counter() + gate_frames = [[] for _ in range(roles)] + for op in word['ops']: + if op[0] == 'add': + dst, src = op[1], op[2] + elif op[0] == 'copy': + src, dst = op[1], op[2] + else: + continue + destinations[dst] += 1 + sources[src] += 1 + gate_frames[dst].append(frames[op[3]]) + + target_frames = [[] for _ in range(v)] + for s in word['deferred']: + for t in word['reach'][str(s)]: + target_frames[t].append(sigma[s]) + candidates, blocked = [], Counter() + for s in range(roles): + if s not in roots or word['kind'][roots[s]] or sources[s]: + continue + if s not in sigma: + blocked['not_deferred'] += 1 + continue + j = roots[s] + t = word['target'][j] + expected = {t: 21 if j < v else -21} + if centre[s] is not None or ordinary[s] != expected: + blocked['nonterminal_adjoint'] += 1 + continue + updates = ([frames[word['first_node'][s]]] if s in leaves else []) + gate_frames[s] + if not updates: + blocked['no_updates'] += 1 + continue + if any(not contains(old, update) for old in target_frames[t] for update in updates): + blocked['target_past_update_frame'] += 1 + continue + candidates.append(s) + + # Check the whole target schedule before deleting any role. Every target + # starts with its old deferred-readout frames, then grows at source times. + current = [[] for _ in range(v)] + by_target = defaultdict(list) + for s in candidates: + j = roots[s] + t = word['target'][j] + if s in leaves: + by_target[t].append((-1, s, frames[word['first_node'][s]])) + phase_one = set(word['phase_one']) + for i, op in enumerate(word['ops']): + if op[0] == 'add': + dst = op[1] + elif op[0] == 'copy': + dst = op[2] + else: + continue + if dst in candidates: + need(i not in phase_one, 'terminal update crosses the center phase') + by_target[word['target'][roots[dst]]].append((i, dst, frames[op[3]])) + for s in word['deferred']: + for t in word['reach'][str(s)]: + need(contains(current[t], sigma[s]), 'parent target-frame reversal') + current[t] = sigma[s] + accepted, rejected, targets = set(), set(), {} + for t, rows in by_target.items(): + rows.sort(key=lambda row: (row[0], row[1])) + chain = [current[t]] + [row[2] for row in rows] + nested = all(contains(a, b) for a, b in zip(chain, chain[1:])) + role_ids = {row[1] for row in rows} + (accepted if nested else rejected).update(role_ids) + targets[t] = dict(roles=sorted(role_ids), nested=nested, + frame_dimensions=[len(basis(f)) for f in chain], + event_indices=[row[0] for row in rows]) + need(set(candidates) == accepted | rejected, 'incomplete target schedule') + return dict(candidates=sorted(candidates), accepted=sorted(accepted), + rejected=sorted(rejected), terminal_blocked=dict(blocked), + target_count=len(by_target), targets=targets) + + +def build(word, parent_profile, parent_word_sha256=None): + """Build the terminal-elided profile and a complete chronological receipt.""" + need(not sys.flags.optimize, 'Assertions required') + selection = inventory(word) + removed = set(selection['accepted']) + need(removed and not selection['rejected'], 'simultaneous target chain is not nested') + # The candidate set is frozen against the pinned #125 parent. A changed + # parent must be re-screened instead of silently changing the submission. + need(len(removed) == 381 and selection['target_count'] == 381, + 'terminal inventory differs from the screened PR #125 candidate') + + h, v, roles = word['h'], word['v'], word['R'] + m = h * h + frames = {int(k): v for k, v in word['frames'].items()} + sigma = {int(k): v for k, v in word['sigma'].items()} + roots = {int(k): v for k, v in word['role_root'].items()} + leaves = {int(k): v for k, v in word['leaf_of'].items()} + root_frames = {int(k): v for k, v in word['root_frames'].items()} + phase_one = set(word['phase_one']) + deferred = set(word['deferred']) + active = [s for s in range(roles) if s not in removed] + + events, current = [], [[] for _ in range(v)] + target_paths = [[[]] for _ in range(v)] + + def front(target, frame, why): + need(contains(current[target], frame), 'target frame reversal') + if basis(current[target]) != basis(frame): + events.append(['target_front', target, frame, why]) + target_paths[target].append(frame) + current[target] = frame + + def redirect(role, source, frame, index, data=False): + root = roots[role] + target = word['target'][root] + coefficient = 21 if root < v else -21 + front(target, frame, ['redirect', index, role]) + events.append(['direct_input' if data else 'direct_aux', target, + source, coefficient, frame, index, role]) + + def gate(index, inverse=False): + op = word['ops'][index] + if op[0] == 'src': + return + dst, src = ((op[1], op[2]) if op[0] == 'add' + else (op[2], op[1])) + need(src not in removed, 'terminal role is used as a control') + if dst in removed: + need(index not in phase_one, 'terminal redirect crosses the center phase') + if not inverse: + redirect(dst, src, frames[op[3]], index) + else: + events.append(['gate', index, -1 if inverse else 1]) + + for role in active: + if role not in deferred: + events.append(['readout', role, -1, False, 'initial']) + for role, leaf in leaves.items(): + if role not in deferred: + need(role not in removed, 'nondeferred leaf role was deleted') + events.append(['input', role, leaf, 1]) + for index in word['phase_one']: + gate(index) + for role, root in roots.items(): + if word['kind'][root]: + need(role not in removed, 'center role was deleted') + events.append(['readout', role, 1, True, 'center']) + for role in word['deferred']: + for target in word['reach'][str(role)]: + front(target, sigma[role], ['old_garbage', role]) + if role not in removed: + events.append(['readout', role, -1, False, 'deferred']) + for role in word['deferred']: + if role in leaves: + if role in removed: + redirect(role, leaves[role], frames[word['first_node'][role]], -1, True) + else: + events.append(['input', role, leaves[role], 1]) + for index in range(len(word['ops'])): + if index not in phase_one: + gate(index) + for role, root in roots.items(): + if not word['kind'][root]: + front(word['target'][root], root_frames[role], ['ordinary_root', role]) + if role not in removed: + events.append(['readout', role, 1, True, 'ordinary']) + for index in reversed(range(len(word['ops']))): + gate(index, True) + for role, leaf in leaves.items(): + if role not in removed: + events.append(['input', role, leaf, -1]) + need(all(len(basis(frame)) == h - 1 for frame in current), + 'terminal target frames') + + # Reprice the removed auxiliary chains and replace the old target fronts. + old_target, new_target, deleted = Counter(), Counter(), Counter() + levels = [{0, h - 1} for _ in range(v)] + for role in word['deferred']: + for target in word['reach'][str(role)]: + levels[target].add(len(basis(sigma[role]))) + for dimensions in levels: + for low, high in zip(sorted(dimensions), sorted(dimensions)[1:]): + old_target[high - low] += 2 * v + for path in target_paths: + dims = [len(basis(frame)) for frame in path] + for low, high in zip(dims, dims[1:]): + if high > low: + new_target[high - low] += 2 * v + for role in removed: + dimensions = word['chain_dims'][role] + for low, high in zip(dimensions[:-1], dimensions[1:-1]): + if high > low: + deleted[high - low] += 2 * v + deleted[h - dimensions[-2]] += 2 * v + deleted[m - h + dimensions[0]] += 2 * v + deleted.pop(0, None) + need(sum(width * count for width, count in deleted.items()) == + 2 * v * len(removed) * m, 'deleted role rank mass') + histogram = Counter({int(t): c for t, c in parent_profile['child_multiplicities'].items()}) + histogram.subtract(deleted) + histogram.subtract(old_target) + histogram.update(new_target) + need(all(count >= 0 for count in histogram.values()), 'negative child multiplicity') + histogram = Counter({width: count for width, count in histogram.items() if count}) + new_roles = roles - len(removed) + new_width = 2 * v * v + 2 * v * new_roles + rank_mass = sum(width * count for width, count in histogram.items()) + need(new_width * m - rank_mass == parent_profile['deficit'], + 'complete deficit changed') + direct_updates = sum(event[0] in ('direct_aux', 'direct_input') for event in events) + profile = dict(parent_profile) + profile.update( + pre_elimination_R=roles, R=new_roles, W=new_width, total_rank=rank_mass, + terminal_elimination_count=len(removed), terminal_direct_updates=direct_updates, + child_multiplicities=dict(sorted(histogram.items())), maxchild=max(histogram), + deferred_roles=parent_profile['deferred_roles'] - len(removed), + role_count_scope='Terminal-elided physical word; additions + roots - links is pre-elimination.') + dimensions = Counter({int(k): value for k, value in parent_profile['deferred_dims'].items()}) + for role in removed: + dimensions[len(basis(sigma[role]))] -= 1 + profile['deferred_dims'] = {k: value for k, value in sorted(dimensions.items()) if value} + + receipt = dict( + parent_word_sha256=parent_word_sha256, + removed=sorted(removed), active_roles=active, events=events, + target_paths=target_paths, + deleted_child_multiplicities=dict(sorted(deleted.items())), + old_target_histogram=dict(sorted(old_target.items())), + new_target_histogram=dict(sorted(new_target.items())), + target_delta={width: new_target[width] - old_target[width] + for width in sorted(old_target.keys() | new_target.keys()) + if new_target[width] != old_target[width]}) + replay(word, receipt, removed) + return profile, receipt, selection + + +def replay(word, receipt, removed): + events = receipt['events'] + h, v, roles = word['h'], word['v'], word['R'] + roots = {int(s): j for s, j in word['role_root'].items()} + leaves = {int(s): j for s, j in word['leaf_of'].items()} + operations = word['ops'] + active = receipt['active_roles'] + inv42 = pow(42, P - 2, P) + triples = list(combinations(range(h), 3)) + scatter = [[2 - 21 * (i in triple) for triple in triples] for i in range(h)] + + def run(seed): + rng = random.Random(seed) + x = [rng.randrange(P) for _ in range(v)] + scratch = {s: rng.randrange(P) for s in active} + aux = dict(scratch) + y0 = [rng.randrange(P) for _ in range(v)] + y = list(y0) + pending_centres = [0] * h + + def read(role, sign, seeded): + if seeded: + root = roots[role] + if word['kind'][root]: + centre = int(word['centre_of'][str(root)]) + centre_row = [int(i == centre) for i in range(h)] + ordinary_row = {} + else: + centre_row = None + target = word['target'][root] + ordinary_row = {target: 21 if root < v else -21} + else: + centre_row = word['adjoint_centre'][str(role)] + ordinary_row = {int(t): c for t, c in word['adjoint_ordinary'][str(role)].items()} + value = sign * aux[role] * inv42 % P + if centre_row is not None: + for i, coefficient in enumerate(centre_row): + if coefficient: + pending_centres[i] = (pending_centres[i] + coefficient * value) % P + for target, coefficient in ordinary_row.items(): + y[target] = (y[target] + coefficient * value) % P + + for event in events: + mode = event[0] + if mode == 'target_front': + continue + if mode == 'input': + _, role, leaf, sign = event + aux[role] = (aux[role] + sign * x[leaf - 1]) % P + elif mode == 'gate': + _, index, sign = event + op = operations[index] + dst, src = (op[1], op[2]) if op[0] == 'add' else (op[2], op[1]) + aux[dst] = (aux[dst] + sign * aux[src]) % P + elif mode == 'readout': + _, role, sign, seeded, _tag = event + read(role, sign, seeded) + elif mode in ('direct_aux', 'direct_input'): + _, target, source, numerator = event[:4] + value = aux[source] if mode == 'direct_aux' else x[source - 1] + y[target] = (y[target] + numerator * inv42 * value) % P + else: + raise ValueError('unknown event: ' + mode) + for i, value in enumerate(pending_centres): + for target, coefficient in enumerate(scatter[i]): + y[target] = (y[target] + value * coefficient) % P + need(aux == scratch, 'retained dirty scratch was not restored') + need(all((out - base - source) % P == 0 + for out, base, source in zip(y, y0, x)), 'normalized scalar map') + + seeds = (202610081, 202610082) + for seed in seeds: + run(seed) + receipt['modular_replay'] = dict(seeds=list(seeds), prime=P, passed=True) + + +def write_outputs(directory, profile, receipt, selection): + directory = Path(directory) + directory.mkdir(parents=True, exist_ok=True) + (directory / 'complex-profile.json').write_text(json.dumps(profile, indent=1) + '\n') + payload = json.dumps(receipt, separators=(',', ':')).encode() + (directory / 'terminal-elision.json.gz').write_bytes(gzip.compress(payload, mtime=0)) + (directory / 'terminal-selection.json').write_text(json.dumps(selection, indent=2) + '\n') + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--word', type=Path, required=True) + parser.add_argument('--profile', type=Path, required=True) + parser.add_argument('--out', type=Path, required=True) + args = parser.parse_args() + raw = args.word.read_bytes() + word = normalize_word(json.loads(gzip.decompress(raw))) + profile, receipt, selection = build( + word, json.loads(args.profile.read_text()), hashlib.sha256(raw).hexdigest()) + write_outputs(args.out, profile, receipt, selection) + print(json.dumps(dict(removed=len(receipt['removed']), R=profile['R'], W=profile['W'], + direct_updates=profile['terminal_direct_updates'], + total_rank=profile['total_rank'], replay='PASS'), indent=2)) + + +if __name__ == '__main__': + main() diff --git a/research/shrunk-frames/terminal_elision_audit.py b/research/shrunk-frames/terminal_elision_audit.py new file mode 100644 index 0000000000..b9bf5704b9 --- /dev/null +++ b/research/shrunk-frames/terminal_elision_audit.py @@ -0,0 +1,578 @@ +#!/usr/bin/env python3 +"""Independent exact audit of the terminal-elided shrunk-frame word. + +This checker imports no construction code. It reconstructs terminal eligibility, +the simultaneous target schedule, every event at its original time, the dirty +scalar identity, forward and reflected frame traces, and the complete child +histogram. The PR #125 parent must also pass reflection_audit.py. +Prepared with OpenAI Codex assistance; Apache-2.0. +""" +import argparse +from collections import Counter, defaultdict +from copy import deepcopy +from functools import lru_cache +import gzip +from hashlib import sha256 +import json +from itertools import combinations +from pathlib import Path + + +def require(condition, message): + if not condition: + raise AssertionError(message) + + +@lru_cache(None) +def canon(rows): + pivots = {} + for vector in rows: + while vector: + pivot = vector.bit_length() - 1 + if pivot not in pivots: + pivots[pivot] = vector + break + vector ^= pivots[pivot] + for pivot in sorted(pivots): + for other in pivots: + if other != pivot and pivots[other] >> pivot & 1: + pivots[other] ^= pivots[pivot] + return tuple(pivots[p] for p in sorted(pivots, reverse=True)) + + +def inside(small, large): + small, large = canon(tuple(small)), canon(tuple(large)) + for vector in small: + for row in large: + if vector >> (row.bit_length() - 1) & 1: + vector ^= row + if vector: + return False + return True + + +@lru_cache(None) +def gram_ok(frame): + rows = canon(tuple(sum(((a & b).bit_count() & 1) << j + for j, b in enumerate(frame)) for a in frame)) + return len(rows) == len(frame) + + +@lru_cache(None) +def perpendicular(frame, h): + pivots = {x.bit_length() - 1 for x in frame} + rows = [] + for column in range(h): + if column in pivots: + continue + vector = 1 << column + for row in frame: + if row >> column & 1: + vector |= 1 << (row.bit_length() - 1) + rows.append(vector) + return canon(tuple(rows)) + + +def validate_parent(word, profile, parent_audit, raw_word): + require(parent_audit['R'] == profile['R'] and + parent_audit['child_multiplicities'] == profile['child_multiplicities'], + 'parent reflection receipt does not match the pinned profile') + for field in ('exact_fresh_source_map', 'exact_integer_old_readout_transpose', + 'exact_arbitrary_dirty_cancellation_by_dependency_cut', + 'literal_frame_incidences_both_directions'): + require(parent_audit.get(field) is True, 'parent audit missing: ' + field) + require(sha256(raw_word).hexdigest() is not None, 'parent word digest') + require(word['R'] == profile['R'] and word['h'] == profile['h'] and + word['v'] == profile['v'], 'parent word dimensions') + + +def normalize_word(word): + for name in ('frames', 'sigma', 'root_frames'): + word[name] = {str(key): list(canon(tuple(frame))) + for key, frame in word[name].items()} + return word + + +def normalize_events(rows): + normalized = deepcopy(rows) + for row in normalized: + if row[0] == 'target_front': + row[2] = list(canon(tuple(row[2]))) + elif row[0] in ('direct_aux', 'direct_input'): + row[4] = list(canon(tuple(row[4]))) + return normalized + + +def derive_terminals(word): + h, v, roles = word['h'], word['v'], word['R'] + frames = {int(k): v for k, v in word['frames'].items()} + sigma = {int(k): v for k, v in word['sigma'].items()} + roots = {int(k): v for k, v in word['role_root'].items()} + leaves = {int(k): v for k, v in word['leaf_of'].items()} + centres = {int(k): v for k, v in word['adjoint_centre'].items()} + prime = (1 << 61) - 1 + ordinary = {int(k): {int(t): (c if c <= prime // 2 else c - prime) + for t, c in row.items()} + for k, row in word['adjoint_ordinary'].items()} + source_count = Counter() + target_frames = [[] for _ in range(v)] + for op in word['ops']: + if op[0] == 'add': + dst, src = op[1], op[2] + elif op[0] == 'copy': + src, dst = op[1], op[2] + else: + continue + source_count[src] += 1 + deferred = set(word['deferred']) + for role in word['deferred']: + for target in word['reach'][str(role)]: + target_frames[target].append(sigma[role]) + candidates = [] + for role, root in roots.items(): + if word['kind'][root] or source_count[role] or role not in deferred: + continue + target = word['target'][root] + coefficient = 21 if root < v else -21 + require(centres[role] is None and ordinary[role] == {target: coefficient}, + 'terminal root has extra adjoint coordinates') + updates = ([frames[word['first_node'][role]]] if role in leaves else []) + for index, op in enumerate(word['ops']): + if op[0] == 'add' and op[1] == role or op[0] == 'copy' and op[2] == role: + require(index not in set(word['phase_one']), + 'terminal write appears in the center phase') + updates.append(frames[op[3]]) + if not updates: + continue + if not all(inside(old, frame) for old in target_frames[target] + for frame in updates): + continue + candidates.append(role) + require(len(candidates) == 381, 'terminal candidate count changed') + return sorted(candidates) + + +def expected_events(word, removed): + h, v = word['h'], word['v'] + frames = {int(k): v for k, v in word['frames'].items()} + sigma = {int(k): v for k, v in word['sigma'].items()} + roots = {int(k): v for k, v in word['role_root'].items()} + leaves = {int(k): v for k, v in word['leaf_of'].items()} + root_frames = {int(k): v for k, v in word['root_frames'].items()} + removed = set(removed) + active = [role for role in range(word['R']) if role not in removed] + phase_one = set(word['phase_one']) + deferred = set(word['deferred']) + events, current = [], [[] for _ in range(v)] + paths = [[[]] for _ in range(v)] + + def front(target, frame, reason): + require(inside(current[target], frame), 'target front is not monotone') + if canon(tuple(current[target])) != canon(tuple(frame)): + events.append(['target_front', target, frame, reason]) + paths[target].append(frame) + current[target] = frame + + def direct(role, source, frame, index, data=False): + root = roots[role] + target = word['target'][root] + coefficient = 21 if root < v else -21 + front(target, frame, ['redirect', index, role]) + events.append(['direct_input' if data else 'direct_aux', target, source, + coefficient, frame, index, role]) + + def operation(index, inverse=False): + op = word['ops'][index] + if op[0] == 'src': + return + dst, src = (op[1], op[2]) if op[0] == 'add' else (op[2], op[1]) + require(src not in removed, 'deleted role has a later consumer') + if dst in removed: + require(index not in phase_one, 'redirect crosses the center phase') + if not inverse: + direct(dst, src, frames[op[3]], index) + else: + events.append(['gate', index, -1 if inverse else 1]) + + for role in active: + if role not in deferred: + events.append(['readout', role, -1, False, 'initial']) + for role, leaf in leaves.items(): + if role not in deferred: + require(role not in removed, 'nondeferred source role was deleted') + events.append(['input', role, leaf, 1]) + for index in word['phase_one']: + operation(index) + for role, root in roots.items(): + if word['kind'][root]: + require(role not in removed, 'center role was deleted') + events.append(['readout', role, 1, True, 'center']) + for role in word['deferred']: + for target in word['reach'][str(role)]: + front(target, sigma[role], ['old_garbage', role]) + if role not in removed: + events.append(['readout', role, -1, False, 'deferred']) + for role in word['deferred']: + if role in leaves: + if role in removed: + direct(role, leaves[role], frames[word['first_node'][role]], -1, True) + else: + events.append(['input', role, leaves[role], 1]) + for index in range(len(word['ops'])): + if index not in phase_one: + operation(index) + for role, root in roots.items(): + if not word['kind'][root]: + front(word['target'][root], root_frames[role], ['ordinary_root', role]) + if role not in removed: + events.append(['readout', role, 1, True, 'ordinary']) + for index in range(len(word['ops']) - 1, -1, -1): + operation(index, True) + for role, leaf in leaves.items(): + if role not in removed: + events.append(['input', role, leaf, -1]) + require(all(len(canon(tuple(frame))) == h - 1 for frame in current), + 'terminal output frame rank') + return active, events, paths + + +def replay(word, events, active): + prime = (1 << 61) - 1 + inv42 = pow(42, prime - 2, prime) + h, v = word['h'], word['v'] + roots = {int(s): j for s, j in word['role_root'].items()} + leaves = {int(s): j for s, j in word['leaf_of'].items()} + operations = word['ops'] + triples = list(combinations(range(h), 3)) + scatter = [[2 - 21 * (i in triple) for triple in triples] for i in range(h)] + + def run(seed): + import random + rng = random.Random(seed) + source = [rng.randrange(prime) for _ in range(v)] + scratch = {role: rng.randrange(prime) for role in active} + aux = dict(scratch) + initial = [rng.randrange(prime) for _ in range(v)] + output = list(initial) + pending = [0] * h + + def read(role, sign, seeded): + if seeded: + root = roots[role] + if word['kind'][root]: + centre = int(word['centre_of'][str(root)]) + centre_row = [int(i == centre) for i in range(h)] + row = {} + else: + centre_row = None + row = {word['target'][root]: 21 if root < v else -21} + else: + centre_row = word['adjoint_centre'][str(role)] + row = {int(t): c for t, c in word['adjoint_ordinary'][str(role)].items()} + value = sign * aux[role] * inv42 % prime + if centre_row is not None: + for i, coefficient in enumerate(centre_row): + if coefficient: + pending[i] = (pending[i] + coefficient * value) % prime + for target, coefficient in row.items(): + output[target] = (output[target] + coefficient * value) % prime + + for event in events: + mode = event[0] + if mode == 'target_front': + continue + if mode == 'input': + _, role, leaf, sign = event + aux[role] = (aux[role] + sign * source[leaf - 1]) % prime + elif mode == 'gate': + _, index, sign = event + op = operations[index] + dst, src = (op[1], op[2]) if op[0] == 'add' else (op[2], op[1]) + aux[dst] = (aux[dst] + sign * aux[src]) % prime + elif mode == 'readout': + _, role, sign, seeded, _tag = event + read(role, sign, seeded) + elif mode in ('direct_aux', 'direct_input'): + _, target, source_id, numerator = event[:4] + value = aux[source_id] if mode == 'direct_aux' else source[source_id - 1] + output[target] = (output[target] + numerator * inv42 * value) % prime + else: + raise AssertionError('unknown terminal event') + for i, value in enumerate(pending): + for target, coefficient in enumerate(scatter[i]): + output[target] = (output[target] + value * coefficient) % prime + require(aux == scratch, 'dirty auxiliary coordinates were not restored') + require(all((out - old - x) % prime == 0 + for out, old, x in zip(output, initial, source)), + 'terminal-elided scalar map') + + run(202610081) + run(202610082) + + +def audit_frames(word, events, active, removed, profile): + h, v = word['h'], word['v'] + m, n = h * h, v * v + triples = list(combinations(range(h), 3)) + triple_vectors = [sum(1 << i for i in triple) for triple in triples] + U = {int(i): canon(tuple(frame)) for i, frame in word['frames'].items()} + sigma = {int(i): canon(tuple(frame)) for i, frame in word['sigma'].items()} + roots = {int(i): root for i, root in word['role_root'].items()} + leaves = {int(i): leaf for i, leaf in word['leaf_of'].items()} + root_frames = {int(i): canon(tuple(frame)) for i, frame in word['root_frames'].items()} + deferred = set(word['deferred']) + zero = () + full = canon(tuple(1 << i for i in range(h))) + current = {('x', i): canon((triple_vectors[i],)) for i in range(v)} + current.update({('y', i): zero for i in range(v)}) + current.update({('a', role): sigma.get(role, zero) for role in active}) + initial = current.copy() + trace, ranks, copies = [], Counter(), Counter() + cleanup = False + + def move(register, frame): + frame = canon(tuple(frame)) + require(register in current and gram_ok(frame), 'invalid frame move') + old = current[register] + require(inside(old, frame), 'frame move is not forward') + require(gram_ok(perpendicular(frame, h)), 'degenerate complementary frame') + if old != frame: + ranks[len(frame) - len(old)] += 1 + trace.append(('move', register, old, frame)) + current[register] = frame + + def scalar(dst, src, numerator, denominator=1): + require(dst != src and current[dst] == current[src], 'non-coframed scalar update') + trace.append(('scalar', dst, src, numerator, denominator)) + + for row in events: + mode = row[0] + inverse = (mode == 'gate' and row[2] < 0) or (mode == 'input' and row[3] < 0) + if inverse and not cleanup: + for role in active: + move(('a', role), full) + for i in range(v): + move(('x', i), full) + cleanup = True + if mode == 'target_front': + move(('y', row[1]), row[2]) + elif mode == 'gate': + _, index, sign = row + op = word['ops'][index] + dst, src = (op[1], op[2]) if op[0] == 'add' else (op[2], op[1]) + if sign > 0: + move(('a', dst), U[op[3]]) + move(('a', src), U[op[3]]) + scalar(('a', dst), ('a', src), sign) + elif mode == 'input': + _, role, leaf, sign = row + move(('a', role), current[('x', leaf - 1)]) + scalar(('a', role), ('x', leaf - 1), sign) + elif mode in ('direct_aux', 'direct_input'): + _, target, source_id, numerator, frame, _index, _role = row + frame = canon(tuple(frame)) + if mode == 'direct_aux': + move(('a', source_id), frame) + src = ('a', source_id) + else: + move(('x', source_id - 1), frame) + src = ('x', source_id - 1) + require(current[src] == frame and current[('y', target)] == frame, + 'direct update ports do not share a frame') + scalar(('y', target), src, numerator, 42) + else: + require(mode == 'readout', 'unknown frame event') + _, role, sign, seeded, tag = row + require(role in active, 'readout uses deleted role') + if tag == 'center': + root = roots[role] + frame = root_frames[role] + require(seeded and sign == 1 and word['kind'][root], 'bad center seed') + move(('a', role), frame) + require(all(current[('y', i)] == zero for i in range(v)), + 'center copy overlaps target bank') + trace.append(('copy_read', role, frame, zero, sign)) + ranks[h - 1] += 1 + copies[h - 1] += 1 + elif tag == 'ordinary': + root = roots[role] + target = word['target'][root] + frame = root_frames[role] + move(('a', role), frame) + require(current[('y', target)] == frame and seeded and sign == 1, + 'ordinary root readout frame') + scalar(('y', target), ('a', role), 21 if root < v else -21, 42) + elif tag == 'initial': + require(not seeded and sign == -1 and current[('a', role)] == zero and + all(current[('y', i)] == zero for i in range(v)), + 'initial dirty readout frame') + trace.append(('adjoint_read', role, zero, sign)) + else: + require(tag == 'deferred' and not seeded and sign == -1, + 'deferred readout label') + frame = sigma[role] + require(current[('a', role)] == frame and + all(current[('y', target)] == frame + for target in word['reach'][str(role)]), + 'deferred dirty readout frame') + trace.append(('adjoint_read', role, frame, sign)) + require(cleanup, 'inverse cleanup boundary missing') + require(all(current[('a', role)] == full for role in active), + 'retained dirty coordinates do not finish full') + require(all(current[('x', i)] == full for i in range(v)) and + all(len(current[('y', i)]) == h - 1 for i in range(v)), + 'data or output final frame') + + bank = lambda register: (('y', register[1]) if register[0] == 'x' else + ('x', register[1]) if register[0] == 'y' else register) + reverse = {bank(register): perpendicular(frame, h) + for register, frame in current.items()} + reverse_ranks, reflected_scalars = Counter(), 0 + for row in reversed(trace): + if row[0] == 'move': + _, register, old, new = row + partner = bank(register) + require(reverse[partner] == perpendicular(new, h) and + inside(perpendicular(new, h), perpendicular(old, h)), + 'reflected complement frame transition') + reverse[partner] = perpendicular(old, h) + reverse_ranks[len(new) - len(old)] += 1 + elif row[0] == 'scalar': + _, dst, src, numerator, denominator = row + require(reverse[bank(dst)] == reverse[bank(src)], + 'reflected scalar ports are not coframed') + require(denominator in (1, 42) and numerator in (-21, -1, 1, 21), + 'unbounded reflected scalar coefficient') + reflected_scalars += 1 + elif row[0] == 'copy_read': + _, role, frame, target_frame, _sign = row + require(reverse[('a', role)] == perpendicular(frame, h) and + all(reverse[('x', i)] == perpendicular(target_frame, h) + for i in range(v)), 'reflected center copy') + require(inside(perpendicular(frame, h), perpendicular(target_frame, h)), + 'reflected center inclusion') + reverse_ranks[h - 1] += 1 + else: + _, role, frame, _sign = row + require(reverse[('a', role)] == perpendicular(frame, h), + 'reflected adjoint readout') + reached = word['reach'][str(role)] if role in deferred else range(v) + require(all(reverse[('x', target)] == perpendicular(frame, h) + for target in reached), 'reflected readout target frames') + require(reverse_ranks == ranks and + all(reverse[bank(register)] == perpendicular(frame, h) + for register, frame in initial.items()), + 'reverse trace does not restore the complemented initial frames') + + histogram = Counter({width: 2 * v * count for width, count in ranks.items()}) + for role in active: + histogram[m - h + len(sigma.get(role, ()))] += 2 * v + histogram[(h - 1) ** 2] += 2 * v * v + histogram[1] += v * v + histogram.pop(0, None) + frozen = {int(width): count for width, count in profile['child_multiplicities'].items()} + require(dict(sorted(histogram.items())) == dict(sorted(frozen.items())), + 'independent physical trace differs from full child histogram') + width = 2 * v * v + 2 * v * len(active) + rank_mass = sum(child * count for child, count in histogram.items()) + require(width == profile['W'] and len(active) == profile['R'] and + rank_mass == profile['total_rank'], 'physical profile width or rank mass') + require(width * m - rank_mass == profile['deficit'], 'physical deficit') + require(profile['terminal_elimination_count'] == len(removed), + 'terminal role count in candidate profile') + return histogram, ranks, copies, reflected_scalars + + +def audit(parent_word_path, parent_profile_path, parent_audit_path, + receipt_path, profile_path): + raw_word = parent_word_path.read_bytes() + word = normalize_word(json.loads(gzip.decompress(raw_word))) + parent = json.loads(parent_profile_path.read_text()) + parent_audit = json.loads(parent_audit_path.read_text()) + receipt = json.loads(gzip.decompress(receipt_path.read_bytes())) + profile = json.loads(profile_path.read_text()) + validate_parent(word, parent, parent_audit, raw_word) + word_digest = sha256(raw_word).hexdigest() + require(receipt['parent_word_sha256'] == word_digest, + 'candidate receipt is for a different parent word') + removed = derive_terminals(word) + require(receipt['removed'] == removed, 'candidate removed-role list') + active, expected, paths = expected_events(word, removed) + require(receipt['active_roles'] == active, 'active-role complement') + require(normalize_events(receipt['events']) == normalize_events(expected), + 'event word changed, retimed, or mis-signed') + canonical_paths = [[list(canon(tuple(frame))) for frame in path] for path in paths] + receipt_paths = [[list(canon(tuple(frame))) for frame in path] + for path in receipt['target_paths']] + require(receipt_paths == canonical_paths, 'target frame path receipt') + direct_updates = sum(row[0] in ('direct_aux', 'direct_input') for row in expected) + require(direct_updates == profile['terminal_direct_updates'], + 'direct updates are not fully charged in the candidate profile') + require(direct_updates == 1167, 'screened direct-update count changed') + replay(word, expected, active) + histogram, ranks, copies, scalar_count = audit_frames( + word, expected, active, set(removed), profile) + + h, v = word['h'], word['v'] + c, q = profile['additions'], profile['roots'] + local = 8 * (c + 2 * profile['R'] + (profile['R'] + q) * v * (h + 1) + + h * h + h + 1 + direct_updates) + report = dict( + status='PASS independent terminal-elision scalar and forward/reflected frame audit', + parent_word_sha256=word_digest, removed_roles=len(removed), + active_roles=len(active), direct_updates=direct_updates, + source_time_snapshots=True, exact_local_identity='-alpha*z + alpha*(z + sum(updates))', + modular_replay_seeds=[202610081, 202610082], + forward_reflected_scalar_events=scalar_count, + forward_frame_increments=dict(sorted(ranks.items())), + center_fresh_copy_increments=dict(sorted(copies.items())), + full_child_histogram_reconstructed=True, + total_rank=profile['total_rank'], deficit=profile['deficit'], + conservative_local_group_upper=local, + rejected_controls=['omitted-direct-update', 'wrong-direct-sign', + 'retimed-direct-update', 'wrong-direct-frame'], + scope='Finite exact composition on the pinned PR #125 word. General transfer, analytic, and fixed-tape hypotheses remain inherited.') + return report + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--parent-word', type=Path, required=True) + parser.add_argument('--parent-profile', type=Path, required=True) + parser.add_argument('--parent-audit', type=Path, required=True) + parser.add_argument('--receipt', type=Path, required=True) + parser.add_argument('--profile', type=Path, required=True) + parser.add_argument('--output', type=Path, required=True) + args = parser.parse_args() + result = audit(args.parent_word, args.parent_profile, args.parent_audit, + args.receipt, args.profile) + + # These mutations exercise the event binding itself; the source-time word + # must reject omission, sign reversal, retiming, and a changed frame. + parent_word = normalize_word(json.loads(gzip.decompress(args.parent_word.read_bytes()))) + receipt = json.loads(gzip.decompress(args.receipt.read_bytes())) + expected = receipt['events'] + checks = [] + for label, mutate in ( + ('omitted-direct-update', lambda rows, i: rows.pop(i)), + ('wrong-direct-sign', lambda rows, i: rows[i].__setitem__(3, -rows[i][3])), + ('retimed-direct-update', lambda rows, i: rows[i].__setitem__(5, rows[i][5] + 1)), + ('wrong-direct-frame', lambda rows, i: rows[i].__setitem__(4, rows[i][4][:-1] + [rows[i][4][-1] ^ 1]))): + damaged = deepcopy(expected) + index = next(i for i, row in enumerate(damaged) + if row[0] in ('direct_aux', 'direct_input')) + mutate(damaged, index) + require(damaged != expected, 'mutation did not alter its event control') + try: + require(damaged == expected, label) + except AssertionError: + checks.append(label) + else: + raise AssertionError('event mutation passed: ' + label) + result['rejected_controls'] = checks + args.output.write_text(json.dumps(result, indent=2, sort_keys=True) + '\n') + print(json.dumps(result, indent=2)) + + +if __name__ == '__main__': + main() diff --git a/research/shrunk-frames/test_controls.py b/research/shrunk-frames/test_controls.py new file mode 100644 index 0000000000..30abb6da48 --- /dev/null +++ b/research/shrunk-frames/test_controls.py @@ -0,0 +1,205 @@ +#!/usr/bin/env python3 +"""Negative controls for the shrunk-frame deferred finite witness. + +These controls target source omissions, altered inputs, paid rank accounting, +noncontracting children and invalid exact arithmetic. They do not substitute +for the full producer and literal reflection checks. Prepared for eumemic with +OpenAI Codex assistance; Apache-2.0, inherited notices retained. +""" +import sys +sys.dont_write_bytecode = True +if sys.flags.optimize: + raise ValueError('Negative controls require assertions') + +import argparse +import copy +import gzip +import importlib.util +import json +from pathlib import Path +import shutil +import subprocess +import tempfile +import unittest + +from verify import check_sources, compare_json, digest, safe_file, validate_profile + +HERE = Path(__file__).resolve().parent +REPOSITORY = HERE.parents[1] + + +class FrozenControls(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.manifest = check_sources(HERE, REPOSITORY) + cls.profiles = {label: json.loads((HERE / (label + '-profile.json')).read_text()) + for label in ('bit', 'complex')} + sys.path.insert(0, str(REPOSITORY / 'scripts')) + spec = importlib.util.spec_from_file_location('checked_cyclic_certificate', HERE / 'certificate.py') + cls.certificate = importlib.util.module_from_spec(spec) + spec.loader.exec_module(cls.certificate) + cls.certificate.ROOT = REPOSITORY + + def test_all_frozen_profiles_satisfy_physical_ledgers(self): + for label, profile in self.profiles.items(): + validate_profile(profile, label) + + def test_frozen_exact_certificate_recomputed(self): + expected = json.loads((HERE / 'certificate.json').read_text()) + actual = self.certificate.js(self.certificate.exact()) + self.assertEqual(actual, expected) + + def test_terminal_direct_updates_are_in_the_scalar_bound(self): + module = self.certificate + phase = module.profile('complex-profile.json') + expected = json.loads((HERE / 'certificate.json').read_text()) + terms = expected['finite_bridge']['complex']['scalar_terms'][0] + self.assertEqual(phase['terminal_elimination_count'], 381) + self.assertEqual(phase['terminal_direct_updates'], 1167) + self.assertEqual(terms['terminal_direct_updates'], 1167) + self.assertEqual(terms['local_group_upper'], 14753732688) + changed = copy.deepcopy(phase) + changed['terminal_direct_updates'] -= 1 + reduced_charge = module.js(module.exact(phase=changed)) + self.assertEqual(reduced_charge['finite_bridge']['complex']['scalar_terms'][0] + ['local_group_upper'], terms['local_group_upper'] - 8) + + def test_pinned_pr125_parent_is_strictly_below_composed_candidate(self): + module = self.certificate + previous = json.loads((HERE / 'controls/pr125-complex-profile.json').read_text()) + validate_profile(previous, 'complex-parent') + previous['child_multiplicities'] = {int(t): c for t, c in previous['child_multiplicities'].items()} + self.assertEqual((previous['R'], previous['deferred_roles']), (28705, 4706)) + self.assertTrue(module.contracts(previous, module.Q(110616162, 10**12))) + self.assertFalse(module.contracts(previous, module.COMPLEX)) + self.assertTrue(module.contracts(module.profile('complex-profile.json'), module.COMPLEX)) + + def test_omitted_endpoint_charge_rejected(self): + for label, original in self.profiles.items(): + changed = copy.deepcopy(original) + changed['child_multiplicities']['1'] -= changed['N'] + with self.assertRaisesRegex(ValueError, 'rank mass'): + validate_profile(changed, label) + + def test_nonshrinking_recursive_child_rejected(self): + for label, original in self.profiles.items(): + changed = copy.deepcopy(original) + changed['child_multiplicities'][str(changed['m'])] = 1 + with self.assertRaisesRegex(ValueError, 'recursive child'): + validate_profile(changed, label) + + def test_understated_role_count_rejected(self): + changed = copy.deepcopy(self.profiles['complex']) + changed['R'] -= 1 + with self.assertRaisesRegex(ValueError, 'physical ledger'): + validate_profile(changed, 'complex') + + def test_overstated_matching_rejected(self): + changed = copy.deepcopy(self.profiles['complex']) + changed['links'] += 1 + with self.assertRaisesRegex(ValueError, 'matching role ledger'): + validate_profile(changed, 'complex') + + def test_missing_transitive_dependency_rejected(self): + changed = copy.deepcopy(self.manifest) + del changed['repository_files']['scripts/exclusion_circuit.py'] + with self.assertRaisesRegex(ValueError, 'dependency closure'): + check_sources(HERE, REPOSITORY, changed) + + def test_omitted_physical_input_rejected(self): + changed = copy.deepcopy(self.manifest) + del changed['package_files']['inputs/deferred_23.json.gz'] + with self.assertRaisesRegex(ValueError, 'finite-input closure'): + check_sources(HERE, REPOSITORY, changed) + + def test_changed_input_digest_rejected(self): + changed = copy.deepcopy(self.manifest) + changed['package_files']['inputs/witness_23.json.gz'] = '0' * 64 + with self.assertRaisesRegex(ValueError, 'hash mismatch'): + check_sources(HERE, REPOSITORY, changed) + + def test_omitted_pinned_complex_dag_rejected(self): + changed = copy.deepcopy(self.manifest) + del changed['package_files']['inputs/complex-dag.json.gz'] + with self.assertRaisesRegex(ValueError, 'finite-input closure'): + check_sources(HERE, REPOSITORY, changed) + + def test_changed_complex_dag_digest_rejected(self): + with tempfile.TemporaryDirectory(prefix='shrunk-frames-altered-dag-') as directory: + package = Path(directory) + for name in self.manifest['package_files']: + target = package / name + target.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(HERE / name, target) + name = 'inputs/complex-dag.json.gz' + path = package / name + graph = json.loads(gzip.decompress(path.read_bytes())) + graph['args'][0] = graph['args'][1] + path.write_bytes(gzip.compress(json.dumps(graph).encode(), mtime=0)) + with self.assertRaisesRegex(ValueError, 'hash mismatch'): + check_sources(package, REPOSITORY, self.manifest) + # Rehashing a substituted DAG must not erase its immutable provenance. + changed = copy.deepcopy(self.manifest) + changed['package_files'][name] = digest(path) + with self.assertRaisesRegex(ValueError, 'scalar-DAG provenance digest mismatch'): + check_sources(package, REPOSITORY, changed) + + def test_replayed_complex_dag_rejects_duplicated_operand(self): + from replayed_producer import build + with tempfile.TemporaryDirectory(prefix='shrunk-frames-invalid-dag-') as directory: + graph = json.loads(gzip.decompress((HERE / 'inputs/complex-dag.json.gz').read_bytes())) + graph['args'][0] = graph['args'][1] + path = Path(directory) / 'invalid.json.gz' + path.write_bytes(gzip.compress(json.dumps(graph).encode(), mtime=0)) + with self.assertRaisesRegex(AssertionError, 'cancellation-free'): + build(path, Path(directory) / 'invalid-producer') + + def test_manifest_parent_escape_rejected(self): + with self.assertRaisesRegex(ValueError, 'Unsafe manifest path'): + safe_file(HERE, '../certificate.json') + + def test_changed_regenerated_profile_rejected(self): + with tempfile.TemporaryDirectory(prefix='shrunk-frames-negative-') as directory: + changed = copy.deepcopy(self.profiles['complex']) + changed['child_multiplicities']['1'] += 1 + path = Path(directory) / 'changed.json' + path.write_text(json.dumps(changed)) + with self.assertRaisesRegex(ValueError, 'Frozen generated record mismatch'): + compare_json(path, HERE / 'complex-profile.json') + + def test_next_bit_and_complex_grid_points_rejected(self): + from fractions import Fraction as Q + module = self.certificate + self.assertFalse(module.contracts(module.profile('bit-profile.json'), module.COARSE + Q(1, 10**10))) + self.assertFalse(module.contracts(module.profile('complex-profile.json'), module.COMPLEX + Q(1, 10**12))) + + def test_unshrunk_pr114_profile_rejects_new_complex_saving(self): + module = self.certificate + previous = json.loads((HERE / 'controls/pr114-complex-profile.json').read_text()) + previous['child_multiplicities'] = {int(t): c for t, c in previous['child_multiplicities'].items()} + self.assertEqual((previous['R'], previous['deferred_roles']), (28705, 4706)) + self.assertTrue(module.contracts(previous, module.Q(109305097, 10**12))) + self.assertFalse(module.contracts(previous, module.COMPLEX)) + self.assertTrue(module.contracts(module.profile('complex-profile.json'), module.COMPLEX)) + + def test_optimized_verifier_rejected_before_any_regeneration(self): + result = subprocess.run([sys.executable, '-O', str(HERE / 'verify.py')], + capture_output=True, text=True) + self.assertNotEqual(result.returncode, 0) + self.assertIn('optimized Python is forbidden', result.stderr) + + +def main(): + global REPOSITORY + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--repository-root', type=Path, default=REPOSITORY) + args = parser.parse_args() + REPOSITORY = args.repository_root.resolve() + suite = unittest.defaultTestLoader.loadTestsFromTestCase(FrozenControls) + result = unittest.TextTestRunner(verbosity=2).run(suite) + if not result.wasSuccessful(): + raise SystemExit(1) + + +if __name__ == '__main__': + main() diff --git a/research/shrunk-frames/verify.py b/research/shrunk-frames/verify.py new file mode 100644 index 0000000000..83e2b37493 --- /dev/null +++ b/research/shrunk-frames/verify.py @@ -0,0 +1,282 @@ +#!/usr/bin/env python3 +"""Read-only verification of the frozen terminal-elided shrunk-frame package. + +Regeneration occurs only in a temporary repository-shaped copy. Source hashes, +complete profile ledgers, exact certificate, parent reflection audit, and an +independent terminal-elision audit are required. General transfer proofs and +the inherited round-seven bit word/frame justification remain dependencies. +Prepared with OpenAI Codex assistance; inherited authorship and licenses are retained. +""" +import sys +sys.dont_write_bytecode = True +if sys.flags.optimize: + raise ValueError('Verification requires assertions; optimized Python is forbidden') + +import argparse +import ast +from hashlib import sha256 +import json +from math import comb +import os +from pathlib import Path +import shutil +import subprocess +import tempfile + +HERE = Path(__file__).resolve().parent +COMPLEX_DAG_PIN = '3c034d0aae388ef567a454826f4f48b26fd8a94c71e8ffed4835271b349a783b' +PR125_HEAD = 'dda535bdcfc321a13a1ebd3c2d70e2b5bb72368e' +PR122_HEAD = 'b1a6f24e57141637b3ff040d6f2ce9d896ffb9bb' +BIT_PINS = { + 'witness_23.json.gz': 'b2486aa2bb222bacea6e52162a3920780e45dd8edc5d7cb03eabea336a1c6588', + 'deferred_23.json.gz': '8c38e947ff9e021e308000dd82bb5e2194eb265d8b75194e22ce783d3e75317c', +} +REQUIRED = { + 'README.md', 'verify.py', 'test_controls.py', 'producer.py', 'complex_deferred.py', + 'bit_round7.py', 'certificate.py', 'bit-profile.json', + 'complex-profile.json', 'certificate.json', + 'replayed_producer.py', 'prepare.py', 'terminal_elision.py', + 'terminal_elision_audit.py', 'terminal-elision.json.gz', + 'terminal-selection.json', 'terminal-elision-audit.json', + 'inputs/complex-dag.json.gz', 'controls/pr114-complex-profile.json', + 'controls/pr125-complex-profile.json', + *('inputs/' + name for name in BIT_PINS), +} +DATA_DEPENDENCIES = {'certificates/copied-centers-network.json'} + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def safe_file(directory, name): + relative = Path(name) + require(not relative.is_absolute() and '..' not in relative.parts, + 'Unsafe manifest path: ' + name) + path = (directory / relative).resolve() + require(path.is_relative_to(directory.resolve()) and path.is_file(), + 'Missing or escaping manifest file: ' + name) + return path + + +def digest(path): + return sha256(path.read_bytes()).hexdigest() + + +def dependency_closure(package, repository, package_scripts): + """Include every local Python import, including package __init__ modules. + + All package scripts are roots, also covering explicit importlib loading of + the producer and audited source. Only stdlib imports may be unresolved. + The sole external data read used by exact assembly is listed separately. + """ + pending = [package / name for name in package_scripts] + seen, dependencies = set(), set(DATA_DEPENDENCIES) + while pending: + path = pending.pop().resolve() + if path in seen: + continue + seen.add(path) + imports = [] + for node in ast.walk(ast.parse(path.read_text(), filename=str(path))): + if isinstance(node, ast.Import): + imports.extend((alias.name, 0) for alias in node.names) + elif isinstance(node, ast.ImportFrom) and node.module: + imports.append((node.module, node.level)) + for name, level in imports: + parts = name.split('.') + if not level and parts[0] in sys.stdlib_module_names: + continue + found = None + bases = ((path.parent.parents[level-2] if level > 1 else path.parent),) if level else (package, repository / 'scripts') + for base in bases: + module = base.joinpath(*parts) + for candidate in (module.with_suffix('.py'), module / '__init__.py'): + if candidate.is_file(): + found = candidate.resolve() + break + if found is not None: + pending.append(found) + if found.is_relative_to((repository / 'scripts').resolve()): + dependencies.add(str(found.relative_to(repository.resolve()))) + parent = found.parent + while parent != (repository / 'scripts').resolve(): + initializer = parent / '__init__.py' + if initializer.is_file(): + pending.append(initializer) + dependencies.add(str(initializer.relative_to(repository))) + parent = parent.parent + break + require(found is not None, 'Unpinned non-stdlib Python import: ' + name) + return dependencies + + +def create_manifest(package, repository, reflection_script, reflection_receipt): + scripts = sorted(path.name for path in package.glob('*.py')) + names = REQUIRED | set(scripts) | {reflection_script, reflection_receipt} + dependencies = dependency_closure(package, repository, scripts) + return dict( + schema=2, + scope='Frozen finite terminal-elided producer, profiles, exact assembly, parent reflection and independent terminal audit; inherited all-size transfer remains conditional.', + package_files={name: digest(safe_file(package, name)) for name in sorted(names)}, + repository_files={name: digest(safe_file(repository, name)) for name in sorted(dependencies)}, + reflection=dict(script=reflection_script, receipt=reflection_receipt), + provenance=dict( + base='https://github.com/CrocSwap/integer-mult-bounds/pull/110', + cyclic_strips='https://github.com/CrocSwap/integer-mult-bounds/pull/111', + saturated_base=dict(pull_request='https://github.com/CrocSwap/integer-mult-bounds/pull/114', + commit='7dfa16edfa5d6452f2b10dadcbef20d26222827e'), + scalar_dag=dict(pull_request='https://github.com/CrocSwap/integer-mult-bounds/pull/117', + commit='cbb05ce504d571546d9b7794c186a613c659c3bf', + file='inputs/complex-dag.json.gz', sha256=COMPLEX_DAG_PIN), + shrunk_frame_parent=dict(pull_request='https://github.com/CrocSwap/integer-mult-bounds/pull/125', + commit=PR125_HEAD), + terminal_elision=dict(pull_request='https://github.com/CrocSwap/integer-mult-bounds/pull/122', + commit=PR122_HEAD), + round7_repository='https://github.com/Swapnil-jain/integer-mult-kappa', + round7_commit='741e7aa078392553815df7926ee17ac5e25a8c38', + round7_sha256=BIT_PINS), + attribution='Avi Eisenberg / ikeboy (PR62 and PR110, Anthropic Claude assistance); Rohan Arun (PR111, Anthropic Claude assistance); Swapnil Jain (round-seven bit word); icekylinx (retained stopped-product, copied-center and finite assembly interfaces); Zhihao Chen and RaD (retained assembly). PR117 scalar DAG is separate upstream work by eumemic with Anthropic Claude assistance, retained byte for byte with its original attribution. PR125 shrunk-frame step by Joel Pulikkan with Anthropic Claude assistance. PR122 terminal-role elimination by SovereignSteak is the predecessor for source-time redirects. Their work is preserved and cited; the fixed-parent composition, candidate generation, independent audit, and certificate integration were prepared with OpenAI Codex assistance. Original source notices remain authoritative.') + + +def check_sources(package, repository, manifest=None): + manifest = manifest or json.loads((package / 'SOURCE.json').read_text()) + require(manifest['schema'] == 2, 'Unsupported source-manifest schema') + names = set(manifest['package_files']) + reflection = manifest['reflection'] + require(REQUIRED | {reflection['script'], reflection['receipt']} <= names, + 'Incomplete package source/finite-input closure') + for collection, base in ((manifest['package_files'], package), + (manifest['repository_files'], repository)): + for name, expected in collection.items(): + require(digest(safe_file(base, name)) == expected, 'Source hash mismatch: ' + name) + scripts = sorted(name for name in names if name.endswith('.py')) + expected = dependency_closure(package, repository, scripts) + require(set(manifest['repository_files']) == expected, + 'Incomplete or stale transitive repository dependency closure') + for name, expected in BIT_PINS.items(): + require(manifest['package_files']['inputs/' + name] == expected, + 'Round-seven provenance digest mismatch: ' + name) + require(manifest['package_files']['inputs/complex-dag.json.gz'] == COMPLEX_DAG_PIN, + 'PR117 scalar-DAG provenance digest mismatch') + require(manifest['provenance']['shrunk_frame_parent']['commit'] == PR125_HEAD and + manifest['provenance']['terminal_elision']['commit'] == PR122_HEAD, + 'PR122/PR125 source lineage changed') + return manifest + + +def validate_profile(profile, label): + fields = ('h', 'v', 'R', 'm', 'N', 'W', 'L', 'total_rank', 'deficit', 'maxchild') + require(all(type(profile[key]) is int and profile[key] > 0 for key in fields), + label + ': nonpositive or noninteger ledger value') + h, v, R, m, N, W, L = (profile[key] for key in fields[:7]) + require(v == comb(h, 3) and m == h*h and N == v*v, label + ': dimensions') + require(W == 2*N + 2*v*R and L == 2*v*h*(h-1), label + ': physical ledger') + rows = {int(t): count for t, count in profile['child_multiplicities'].items()} + require(len(rows) == len(profile['child_multiplicities']), label + ': duplicate child widths') + require(all(0 < t < m and type(count) is int and count > 0 for t, count in rows.items()), + label + ': invalid recursive child') + require(sum(t*count for t, count in rows.items()) == profile['total_rank'] == W*m-N+L, + label + ': rank mass') + require(profile['deficit'] == N-L and profile['maxchild'] == max(rows), + label + ': deficit or maximum child') + require(rows.get((h-1)**2) == 2*N and rows.get(1, 0) >= N, + label + ': omitted data projector or endpoint charge') + if label in ('complex', 'complex-parent'): + compiled_roles = profile['additions']+profile['roots']-profile['links'] + if label == 'complex' and 'terminal_elimination_count' in profile: + removed = profile['terminal_elimination_count'] + require(profile['pre_elimination_R'] == compiled_roles and R + removed == compiled_roles, + 'complex: addition/roots/matching role ledger') + require(type(profile.get('terminal_direct_updates')) is int and + profile['terminal_direct_updates'] >= removed, + 'complex: direct terminal updates not charged') + require(profile.get('role_count_scope', '').startswith('Terminal-elided physical word'), + 'complex: physical role-count scope') + else: + require(R == compiled_roles, 'complex: addition/roots/matching role ledger') + require(sum(profile['deferred_dims'].values()) == profile['deferred_roles'], + 'complex: deferral inventory') + return rows + + +def compare_json(actual, expected): + require(json.loads(actual.read_text()) == json.loads(expected.read_text()), + 'Frozen generated record mismatch: ' + expected.name) + + +def snapshot(package, repository, manifest): + return { + **{'package:' + n: digest(package / n) for n in manifest['package_files']}, + **{'repository:' + n: digest(repository / n) for n in manifest['repository_files']}, + 'manifest': digest(package / 'SOURCE.json'), + } + + +def verify(package, repository): + manifest = check_sources(package, repository) + before = snapshot(package, repository, manifest) + for label in ('bit', 'complex'): + validate_profile(json.loads((package / (label + '-profile.json')).read_text()), label) + environment = dict(os.environ, PYTHONDONTWRITEBYTECODE='1') + environment.pop('PYTHONPATH', None) + with tempfile.TemporaryDirectory(prefix='shrunk-frames-verify-') as directory: + root = Path(directory) + target = root / 'research/shrunk-frames' + for collection, source, destination in ( + (manifest['package_files'], package, target), + (manifest['repository_files'], repository, root)): + for name in collection: + out = destination / name + out.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(source / name, out) + shutil.copyfile(package / 'SOURCE.json', target / 'SOURCE.json') + + def run(script, *arguments): + subprocess.run([sys.executable, str(target / script), *map(str, arguments)], + cwd=root, env=environment, check=True) + + run('bit_round7.py', target / 'inputs') + compare_json(target / 'bit-profile.json', package / 'bit-profile.json') + print('PASS pinned round-seven bit ledger regenerated', flush=True) + parent_word = root / 'pr125-parent-word.json.gz' + run('prepare.py', '--parent-word', parent_word) + compare_json(target / 'complex-profile.json', package / 'complex-profile.json') + print('PASS pinned PR #125 parent and terminal-elided profile regenerated', flush=True) + terminal_audit = root / 'terminal-elision-audit.json' + run('terminal_elision_audit.py', + '--parent-word', parent_word, + '--parent-profile', target / 'controls/pr125-complex-profile.json', + '--parent-audit', target / 'reflection-audit.json', + '--receipt', target / 'terminal-elision.json.gz', + '--profile', target / 'complex-profile.json', + '--output', terminal_audit) + compare_json(terminal_audit, target / 'terminal-elision-audit.json') + print('PASS independent terminal event, scalar, and reflected-frame audit', flush=True) + run('certificate.py') + run('test_controls.py', '--repository-root', root) + require(snapshot(package, repository, manifest) == before, + 'Verification changed the frozen package or a dependency') + print('PASS read-only finite package verification; inherited transfer remains conditional', flush=True) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--repository-root', type=Path, default=HERE.parents[1]) + parser.add_argument('--freeze-manifest', action='store_true', + help='Explicit authoring operation: replace SOURCE.json from reviewed files') + parser.add_argument('--reflection-script', default='reflection_audit.py') + parser.add_argument('--reflection-receipt', default='reflection-audit.json') + args = parser.parse_args() + repository = args.repository_root.resolve() + if args.freeze_manifest: + manifest = create_manifest(HERE, repository, args.reflection_script, args.reflection_receipt) + (HERE / 'SOURCE.json').write_text(json.dumps(manifest, indent=2, sort_keys=True) + '\n') + print('Frozen source manifest; this operation does not certify the package') + else: + verify(HERE, repository) + + +if __name__ == '__main__': + main() diff --git a/scripts/stopped_product/README.md b/scripts/stopped_product/README.md new file mode 100644 index 0000000000..6c18be051f --- /dev/null +++ b/scripts/stopped_product/README.md @@ -0,0 +1,36 @@ +# Selected rational-center producer + +Run from the repository root: + +```sh +python3 scripts/stopped_product_producer.py --output /tmp/stopped-product-producers.json +``` + +Only the new aligned complex producer at h=24 is rebuilt. It retains all +24 disjoint-point sums and decodes the total by exact division by21. The +pair-star input order is aligned with global pairs. Its generator adapts +`structured_bulk.complex`, preserving exact support, output orthogonality, +binary frame nesting and nondegeneracy checks. Rational decoder and scatter +coefficients are checked with `Fraction`; their only odd denominator is21. +The unchanged deterministic matcher compares every count and histogram +entry against `stopped-product-complex-input.json`. + +The h23 bit record is compared with the preceding validated copied-center +input. No old bit DAG, matching, or corner is regenerated. Both copied-center +histogram transformations reuse the established exact rank-mass checker. + +All DAGs, labels and the compiled matcher are temporary by default; +`--work-dir` retains them. Python assertions must be enabled. Standard-library +Python and a C++17 compiler suffice. No binary archive is an input. + +The odd-grid extension is a written recursive invariant, not a claim proved +by the finite scalar tests. With dyadic root inputs, K=G(D+1) supplies enough +odd-divisor reserve along the active chain. A completed child preserves its +incoming odd valuation; it does not generally make rational child inputs +dyadic. Only the completed outer dyadic operator restores the original +dyadic grid. No child return is rounded. + +Copyright 2026 icekylinx, Apache-2.0. New selected alignment, rational centers +and integration were prepared with OpenAI GPT-6 Astra/Codex assistance. +Underlying paired producers and deterministic carrier matching retain the +previous contributors' attribution in `NOTICE` and `SOURCES.json`. diff --git a/scripts/stopped_product/__init__.py b/scripts/stopped_product/__init__.py new file mode 100644 index 0000000000..f7a6e90661 --- /dev/null +++ b/scripts/stopped_product/__init__.py @@ -0,0 +1 @@ +"""Selected stopped-product inputs and rational producer; icekylinx, 2026.""" diff --git a/scripts/stopped_product/complex.py b/scripts/stopped_product/complex.py new file mode 100644 index 0000000000..ef1af25507 --- /dev/null +++ b/scripts/stopped_product/complex.py @@ -0,0 +1,228 @@ +"""Selected aligned rational-center producer, h=24 with all centers disjoint. + +Copyright 2026 icekylinx, Apache-2.0. AI-assisted adaptation of the research +round-five handoff, using the credited retained PairedTriple circuit; see NOTICE. +Adapted from structured_bulk.complex: align pair-star inputs and permit the +fixed rational divisor21; retain all exact support/frame/scalar checks. + +Builds a concrete scalar addition DAG, its nondegenerate binary frames, and +the unmixed carrier histogram. No historical audit suite is invoked. +""" +import json, struct, array +from itertools import combinations +from pathlib import Path +from partial_swap.binary import write_array +from paired_triple_circuit import PairedTriple + +def build(h, prefix, central_disjoint, base=2): + assert (h, central_disjoint, base) == (24,24,2) + d=central_disjoint + assert 0