diff --git a/.github/workflows/birth-read-reuse.yml b/.github/workflows/birth-read-reuse.yml new file mode 100644 index 0000000000..2e20ee9934 --- /dev/null +++ b/.github/workflows/birth-read-reuse.yml @@ -0,0 +1,23 @@ +name: Verify birth-read reuse witness +on: [push, pull_request, workflow_dispatch] +permissions: + contents: read +jobs: + focused: + runs-on: ubuntu-24.04 + timeout-minutes: 10 + 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 }} + - name: Reconstruct and check the frozen birth-read witness + run: python3 research/birth-read-reuse/run_checks.py + - name: Require unchanged tracked inputs and receipts + run: git diff --exit-code diff --git a/.github/workflows/cube-deferred.yml b/.github/workflows/cube-deferred.yml new file mode 100644 index 0000000000..2c75aeec3f --- /dev/null +++ b/.github/workflows/cube-deferred.yml @@ -0,0 +1,21 @@ +name: Verify cube 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/cube-deferred/verify.py + - run: git diff --exit-code 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/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/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/birth-read-reuse/BASE_INPUTS.json b/research/birth-read-reuse/BASE_INPUTS.json new file mode 100644 index 0000000000..36c46849a3 --- /dev/null +++ b/research/birth-read-reuse/BASE_INPUTS.json @@ -0,0 +1,9 @@ +{ + "head": "6ec868e8568ca9a74b7245494de1b187c7be78fe", + "files": { + "research/deferred-replayed-117/complex-dag.json.gz": "3c034d0aae388ef567a454826f4f48b26fd8a94c71e8ffed4835271b349a783b", + "research/deferred-replayed-117/complex-profile.json": "ff5e9bbc1a3794d8dd3f75e194ea002cef8439c40a5d434c4a84e46967edc98e", + "research/deferred-replayed-117/certificate.json": "f1d77d26036cf2b01bc630a572b2cdea0027e0faa2e4899b5b907b9d455ff916", + "certificates/copied-centers-network.json": "7dbd675e42e22ac076280360f8750031851564bb7a56079e66236fee5d0a6cdf" + } +} diff --git a/research/birth-read-reuse/BIRTH_AUDIT.json b/research/birth-read-reuse/BIRTH_AUDIT.json new file mode 100644 index 0000000000..95bb9fb93b --- /dev/null +++ b/research/birth-read-reuse/BIRTH_AUDIT.json @@ -0,0 +1,24 @@ +{ + "status": "PASS original complete forward/reflected paid frame scan", + "source_head": "6ec868e8568ca9a74b7245494de1b187c7be78fe", + "matches": 2106, + "physical_original_roles": 26599, + "virtual_roles": 28705, + "word_blocks": 277775, + "workspace_forward_gates": 120475, + "all_data_source_target_banks_disjoint": true, + "targets_never_controls": true, + "donors_dead_before_birth": true, + "recipients_untouched_before_birth": true, + "all_selected_recipients_have_no_source_injection": true, + "inverse_order": "Reverse actual workspace and source events chronologically at full frame", + "forward_frame_transitions": 235337, + "reverse_frame_transitions": 235337, + "copies_per_direction": 24, + "all_histogram_bins_match": true, + "forward_word_sha256": "5a5b636125766e2298b790257a8849a45ce5c7311d0f75edeb043fbed15f434f", + "reverse_word_sha256": "f674eed9455e89316cdf1e35ff811627beb621398a88ad76ea427e251aad1132", + "scalar_scope": "All-size arbitrary dirty algebra is the birth-cut identity with exact old-readout responses; complete source supports checked, no dense dirty-square expansion", + "seconds": 7.160254608999821, + "rss_KiB": 381252 +} diff --git a/research/birth-read-reuse/BIRTH_MATCHES.json.gz b/research/birth-read-reuse/BIRTH_MATCHES.json.gz new file mode 100644 index 0000000000..4dc46617e4 Binary files /dev/null and b/research/birth-read-reuse/BIRTH_MATCHES.json.gz differ diff --git a/research/birth-read-reuse/CANDIDATE.json b/research/birth-read-reuse/CANDIDATE.json new file mode 100644 index 0000000000..baaf87cd36 --- /dev/null +++ b/research/birth-read-reuse/CANDIDATE.json @@ -0,0 +1,176 @@ +{ + "status": "AUTHOR_CHECKED_CONDITIONAL_ASSEMBLY; independent review pending", + "source_head": "6ec868e8568ca9a74b7245494de1b187c7be78fe", + "profile_source_head": "ec862a5af51537495c745d9f2323e8a5736ee265", + "pins": { + "new/BIRTH_MATCHES.json.gz": "0d5b0d183d7fae082572e5d1459962c9bcff007e0b4691dec4ff1aecf817408c", + "new/READOUT_COST.json": "f728c380abcc2540e667e3c04829f59e0c7bb49abcaf8eb027eb8b823bfacd3d", + "base/research/deferred-replayed-117/certificate.json": "f1d77d26036cf2b01bc630a572b2cdea0027e0faa2e4899b5b907b9d455ff916", + "base/certificates/copied-centers-network.json": "7dbd675e42e22ac076280360f8750031851564bb7a56079e66236fee5d0a6cdf" + }, + "kappa": "5519166047173/50000000000000000", + "complex_saving": "11040781/100000000000", + "actual_bit_saving": "1240189553/10000000000000", + "supported_bit_parameter": "11040769859219/100000000000000000", + "moments": [ + { + "label": "coarse_bit", + "m": 529, + "W": 108516254, + "saving": "620523/5000000000", + "rank": 57403754177, + "lower": "784637716922602063515542551544255819453717996929624743891/784637716923335095479473677900958302012794430558004314112", + "upper": "6277101735380816508124340412354046570438871708765866670471/6277101735386680763835789423207666416102355444464034512896", + "strict_gap": "5864255711449010853619845663483735698167842425/6277101735386680763835789423207666416102355444464034512896", + "enclosure_grid_bits": 192, + "log_terms": 40, + "exponential_degree": 8 + }, + { + "label": "old_ordinary", + "m": 575, + "W": 188181929, + "saving": "384599/10000000000", + "rank": 108202762275, + "lower": "3138550867686721189167984360005808400490072591471054502465/3138550867693340381917894711603833208051177722232017256448", + "upper": "1569275433843360594583992180002904200245357738750846857189/1569275433846670190958947355801916604025588861116008628224", + "strict_gap": "3309596374955175799012403780231122365161771035/1569275433846670190958947355801916604025588861116008628224", + "enclosure_grid_bits": 192, + "log_terms": 40, + "exponential_degree": 8 + }, + { + "label": "birth_reused_complex", + "m": 576, + "W": 115865904, + "saving": "11040781/100000000000", + "rank": 66736898624, + "lower": "6277101735382321508129685478727696076870887623968283610229/6277101735386680763835789423207666416102355444464034512896", + "upper": "1569275433845580377032421369681924021027032349608600110115/1569275433846670190958947355801916604025588861116008628224", + "strict_gap": "1089813926525986119992582998556511507408518109/1569275433846670190958947355801916604025588861116008628224", + "enclosure_grid_bits": 192, + "log_terms": 40, + "exponential_degree": 8 + } + ], + "finite_bridge": { + "m": 576, + "W": 115865904, + "rank": 66736898624, + "R": 26599, + "maxchild": 574, + "G": 3113921927424, + "E": 1932642881240371272040452135872748328000, + "literal_charge": 83608228981988458892886294212, + "B": 1932642881240371272040452135939485226624, + "C0": 68845519990132232905167052999896129702712483320195776417730326486472166903677714432, + "C1": 1, + "stock": [ + { + "m": 529, + "W": 108516254, + "maxchild": 528, + "depth": 367, + "wire_bits": 27 + }, + { + "m": 575, + "W": 188181929, + "maxchild": 529, + "depth": 9, + "wire_bits": 28 + }, + { + "m": 576, + "W": 115865904, + "maxchild": 574, + "depth": 200, + "wire_bits": 27 + } + ], + "rows": 15561, + "row_degree": 32000, + "row_gap": "6389/25", + "suffix_slope": 128000, + "odd_grid": "2^-P21^-K; K=G*(D_complex+1), with completed child preserving incoming odd exponent" + }, + "assembly": { + "parameters": { + "a": "11040769859219/100000000000000000", + "b": "11040781/100000000000", + "beta": "1/1000000", + "eta": "1/100000000", + "q": "552038481920180140781/5000000000000000000000000", + "c": "55203848744056495998280140781/500000000000000000000000000000000", + "epsilon": "499999995000000000000000000000000/500110407696936074510076380140781", + "lambda_": "9998895923025118869859219/10000000000000000000000000", + "lambda_prime": "4999447961518079819859219/5000000000000000000000000", + "r": "82808272288027021117150000000/500110407696936074510076380140781", + "delta": "1/800000000", + "C0": 68845519990132232905167052999896129702712483320195776417730326486472166903677714432, + "C1": 1 + }, + "constraints": { + "bit_positive": "11040769859219/100000000000000000", + "complex_above_bit": "11140781/100000000000000000", + "complex_below_one_over32": "3113959219/100000000000", + "beta_positive": "1/1000000", + "beta_below_one": "999999/1000000", + "leaf_saving_above_bit": "1/1000000000000", + "q_positive": "552038481920180140781/5000000000000000000000000", + "q_below_internal": "11040769859219/5000000000000000000000000", + "q_below_leaf": "16040769859219/5000000000000000000000000", + "c_positive": "55203848744056495998280140781/500000000000000000000000000000000", + "c_below_one": "499944796151255943504001719859219/500000000000000000000000000000000", + "q_below_reservations": "552038481920180140781/500000000000000000000000000000000", + "lambda_above_tau": "11040769859219/10000000000000000000000000", + "lambda_above_sigma": "1125118869859219/10000000000000000000000000", + "lambda_above_internal": "11040769859219/10000000000000000000000000", + "lambda_prime_above_lambda": "11040769859219/10000000000000000000000000", + "compact_leaf": "16040769859219/5000000000000000000000000", + "compact_reservations": "552038481920180140781/500000000000000000000000000000000", + "lambda_prime_below_one": "552038481920180140781/5000000000000000000000000", + "epsilon_positive": "499999995000000000000000000000000/500110407696936074510076380140781", + "epsilon_below_one": "110412696936074510076380140781/500110407696936074510076380140781", + "guard_width": "110412696936074510076380140781/500110407696936074510076380140781", + "K_geometry": "5520884874405650151866495998280140781/50011040769693607451007638014078100000000", + "K_dominates_log": "5520384819201800855771518079819859219/50011040769693607451007638014078100000000", + "record_suffix": "110412696936074510076380140781/500110407696936074510076380140781", + "phase_local": "88329657438451911125029602548419859219/400088326157548859608061104112624800000000", + "phase_boundary": "66246117720013919957645489923619859219/400088326157548859608061104112624800000000", + "gamma_sublinear": "27604424648047488959230140781/500110407696936074510076380140781", + "cell_above_band": "499972390575351952511040769859219/1000220815393872149020152760281562", + "prime_interval_packing": "110412696936074510076380140781/500110407696936074510076380140781", + "alpha_positive": "82808272288027021117150000000/500110407696936074510076380140781", + "alpha_below_one": "500027599424648047488959230140781/500110407696936074510076380140781", + "alpha_below_one_fourth": "499779174607783966425607780140781/2000441630787744298040305520563124", + "delta_positive": "1/800000000", + "delta_below_one_eighth": "99999999/800000000", + "short_record_fallback": "49994477896084417942402613741510036132231229289961/50011040769693607451007638014078100000000000000000", + "small_field_exposure": "55208849296094977918460281562/500110407696936074510076380140781", + "artificial_boundary": "2800728696299998907158720142503546819859219/400088326157548859608061104112624800000000", + "literal_scalar_guard": "1932642881156763043058463676979862033788", + "row_product_gap": "6389/25", + "original_prefix_above_kappa": "250055204048927036202341600163601472937887/25005520384846803725503819007039050000000000000000", + "coordinate_movement_above_kappa": "2437764873/100000000000000000", + "compact_phase_layer_above_kappa": "200458998947303410093210972937887/25005520384846803725503819007039050000000000000000", + "bulk_exposure_above_kappa": "2437764873/100000000000000000", + "Gaussian_arithmetic_above_kappa": "1380189975502093848455797462686334412160437887/25005520384846803725503819007039050000000000000000", + "scalar_work_above_kappa": "2760411207904468296417304501736334412160437887/25005520384846803725503819007039050000000000000000", + "dimension_above_kappa": "24997239557618001223851102954342460093210972937887/25005520384846803725503819007039050000000000000000" + }, + "margins": { + "original_prefix": "5520884874405650151866495998280140781/50011040769693607451007638014078100000000", + "coordinate_movement": "11040769859219/100000000000000000", + "compact_phase_layer": "55203847639979532157919859219/500110407696936074510076380140781", + "bulk_exposure": "11040769859219/100000000000000000", + "Gaussian_arithmetic": "66246117720013919957645489923619859219/400088326157548859608061104112624800000000", + "scalar_work": "88329657438451911125029602548419859219/400088326157548859608061104112624800000000", + "dimension": "499999995000000000000000000000000/500110407696936074510076380140781" + }, + "minimum_margin": "55203847639979532157919859219/500110407696936074510076380140781", + "absorption_gap": "200458998947303410093210972937887/25005520384846803725503819007039050000000000000000" + }, + "next_grid": "11038332094347/100000000000000000", + "next_grid_gap": "-99192409802329254323654434265007/50011040769693607451007638014078100000000000000000" +} diff --git a/research/birth-read-reuse/FRAMES_CHECK.json b/research/birth-read-reuse/FRAMES_CHECK.json new file mode 100644 index 0000000000..ab600a1f10 --- /dev/null +++ b/research/birth-read-reuse/FRAMES_CHECK.json @@ -0,0 +1,11 @@ +{ + "status": "PASS original114 full frame/profile reconstruction", + "roles": 28705, + "deferred": 3020, + "maxchild": 574, + "weighted_rank": 71647349312, + "all_bins_match": true, + "frame_sha256": "56e542713d156a93273d0fa69bc0106738356530fe36920691f5cc3c5c2a5f46", + "seconds": 16.050913337996462, + "rss_KiB": 389268 +} diff --git a/research/birth-read-reuse/GRAPH_CHECK.json b/research/birth-read-reuse/GRAPH_CHECK.json new file mode 100644 index 0000000000..945c856fa5 --- /dev/null +++ b/research/birth-read-reuse/GRAPH_CHECK.json @@ -0,0 +1,10 @@ +{ + "status": "PASS original full-source/frame reconstruction of pinned117 DAG for118", + "source_sha256": "3c034d0aae388ef567a454826f4f48b26fd8a94c71e8ffed4835271b349a783b", + "graph_sha256": "35443d283a9f307dab6dc42c0c46804fd63f18be2449ac3da5fbba4710b481a2", + "additions": 91770, + "roots": 8120, + "root_order": "pair stars ascending i", + "seconds": 0.30043780099367723, + "rss_KiB": 84952 +} diff --git a/research/birth-read-reuse/PROOF.md b/research/birth-read-reuse/PROOF.md new file mode 100644 index 0000000000..870ac02975 --- /dev/null +++ b/research/birth-read-reuse/PROOF.md @@ -0,0 +1,45 @@ +# Dirty readouts permit physical slot reuse + +Base: rohanarun/integer-mult-bounds at6ec868e8568ca9a74b7245494de1b187c7be78fe (corrected PR118). The operand/root DAG and virtual role/frame profile are unchanged fromec862a5af51537495c745d9f2323e8a5736ee265. Under its retained analytic, exact-recovery, prime, whole-residual, complete-row and fixed-tape hypotheses, this construction gives + + T(n)=O(n(log n)^(1−kappa)), + kappa=5519166047173/50000000000000000=0.00011038332094346. + +This is an author-checked conditional draft; independent review remains pending. No upstream program is executed by the supplied checks. + +## The new operation + +In a linear virtual program, regard the initial value of each newly born register as an independent symbol g_a. Let D_a be its exact future contribution to output accumulators, cutting propagation at each subsequent birth on that storage. Then the output is Fx+sum(D_a g_a). A physical birth may leave any old value in its slot: read that value and add −D_a g_a to the output. The corrections cancel identically even if birth values contain source signals or are correlated with earlier dirt. Reverse every actual workspace/source gate chronologically to restore all original workspace. + +Sources, workspace and output banks must be disjoint. Outputs are never later controls, sources, guards or addresses. Every correction is paid and must occur at a legal common frame. There is no physical dirty reset and no assumption that a fresh-signal relation is equality of dirty contents. + +PR118 already reads each untouched deferred register B negatively at sigma_B after center phase one. Choose an old role A whose last forward gate and every terminal read are already finished, with final frame E contained in sigma_B. Raise A to sigma_B; use its actual value in B's existing negative readout; route B's future virtual life through A. The virtual program and D_B are unchanged. The new offset is canceled by the same readout. Selected pairs are disjoint, and all selected recipients have no source injection. The implementation nevertheless uses true reverse chronology for every inverse source gate. + +Per matched local role, put e=dim E and s=dim sigma_B. Remove children24−e and552+s; add child s−e (record zero rank explicitly); remove one original physical role. Weighted rank drops by576. All target read frames, copied centers and response coefficients remain unchanged. Added positive residuals are checked nonalternating. For0v for s in removed),'Selected deferred source injection requires explicit inverse insertion review' +for b,a in merge.items():assert a not in g['placed']and b in g['placed']and b not in g['touched']and g['last'][a]in g['phase']and a not in g['terminal'] +frames=[()];ids={():0} +def fid(F): + if F not in ids:ids[F]=len(frames);frames.append(F) + return ids[F] +FULL=fid(fulltuple);tm=[fid((m,))for m in g['tm']];U=[fid(F)for F in g['U']] +def basis(rows): + piv={} + for x in rows: + 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)) +@lru_cache(None) +def dual(i): + A=frames[i];piv={r.bit_length()-1 for r in A};out=[] + for j in range(24): + if j not in piv: + x=1<>j&1:x|=1<<(r.bit_length()-1) + out.append(x) + return fid(basis(out)) +@lru_cache(131072) +def nested(i,j): + for x in frames[i]: + for r in frames[j]: + if x>>(r.bit_length()-1)&1:x^=r + if x:return False + return True +word=[];forward_workspace=[] +def gate(d,s,c,F,remember=False): + assert d!=s;word.append(('g',d,s,c,F)) + if remember:forward_workspace.append((d,s,c,F)) +def oldread(s,F): + mask=ALL if g['reach_all'][s]else g['reach'][s] + word.append(('r',physical(s),v,mask,-1,F,('old',s))) +def source(s): + x=g['first'][s];assert 1<=x<=v;gate(physical(s),x-1,1,U[x],True) +def mix(i): + op,s,t,x=g['ops'][i] + if op==1:gate(physical(s),physical(t),1,U[x],True) + elif op==2:gate(physical(t),physical(s),1,U[x],True) +for s in range(R): + if s not in g['placed']:oldread(s,0) +for s,x in enumerate(g['first']): + if x<=v and s not in g['placed']:source(s) +for i in sorted(g['phase']):mix(i) +for s in g['center_roles']: + j=g['terminal'][s];F=fid(g['U'][g['roots'][j]]);assert len(frames[F])==23 + word.append(('c',physical(s),v,ALL,1,F,0,('center',j-(len(g['roots'])-24)))) +for s,F in sorted(g['placed'].items(),key=lambda item:(len(item[1]),item[0])):oldread(s,fid(F)) +for s,x in enumerate(g['first']): + if x<=v and s in g['placed']:source(s) +for i in range(len(g['ops'])): + if i not in g['phase']:mix(i) +for s,j in sorted(g['terminal'].items(),key=lambda item:item[1]): + if j0 + hist[r]+=1;current[s]=F;incidences+=1 + if s<2*v: + bank=s//v;counts[bank][old]-=1 + if not counts[bank][old]:del counts[bank][old] + counts[bank][F]+=1 + def targets(bank,mask,F): + if len(counts[bank//v])==1 and counts[bank//v].get(F)==v:return + while mask: + b=mask&-mask;mask-=b;promote(bank+b.bit_length()-1,F) + for e in events: + digest.update(repr(e).encode()) + if e[0]=='g':_,d,s,c,F=e;assert c in(-1,1);promote(d,F);promote(s,F) + elif e[0]=='r':_,s,bank,mask,sign,F,key=e;assert mask>=0 and not(mask&~ALL);promote(s,F);targets(bank,mask,F) + else: + _,s,bank,mask,sign,F,T,key=e;promote(s,F);targets(bank,mask,T) + assert (F==FULL and T==0)or nested(F,T)or nested(T,F) + r=abs(len(frames[F])-len(frames[T]));assert r==23;hist[r]+=1;copies+=1 + for s in active:promote(s,end[s]) + assert current==end + return hist,copies,incidences,digest.hexdigest() +active_set=set(active);forward=scan(word,initial,finish) +def swap(s):return s+v if s>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)) +@lru_cache(65536) +def 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(65536) +def perpendicular(A): + piv={r.bit_length()-1 for r in A};out=[] + for j in range(H): + if j not in piv: + x=1<>j&1:x|=1<<(r.bit_length()-1) + out.append(x) + return basis(out) +@lru_cache(65536) +def intersection(A,B):return perpendicular(basis(perpendicular(A)+perpendicular(B))) +@lru_cache(65536) +def nondeg(A):return len(basis(sum(((x&y).bit_count()%2)<=0 else 1<<(j-(len(roots)-H))for j,t in enumerate(g['targets'])] + succ=[set()for _ in range(n)];rootf=[[]for _ in range(n)] + def connect(x,uid): + _,typ,dest,_=use[uid] + if typ:rootf[x].append(fun[dest]) + else:succ[x].add(dest) + for x in active: + for uid in uses[x]: + if matched[uid]<0:connect(x,uid) + for x,uid in links.items():connect(x,uid) + order=sorted(active,key=lambda x:(rank[x],x),reverse=True);demand=[()]*n + for x in order:demand[x]=basis(rootf[x]+[r for y in sorted(succ[x])for r in demand[y]]) + def envelope(x): + if not args[x]:return (tm[x-1],) + if kind[x]==2:return basis(1<=len(roots)-H:dense[s]=True + else:reach[s]=1<rank[x]for x in active)) + assert g['lifted']==39989,g['lifted'];save('LIFTED.pkl',g) + print('Lifted checkpoint',len(cand),'candidates',round(time.monotonic()-start,2),flush=True) +# Only this saturating placement is repeated if a previous cap ended after LIFTED. +U=g['U'];reach=g['reach'];cand=g['candidates'];bytarget=defaultdict(list);placed={};order=sorted(cand,key=lambda s:(-len(cand[s]),s)) +for step,s in enumerate(order): + X=cand[s];changed=True + while changed and X: + changed=False + for t in bits(reach[s]): + for prior in bytarget[t]: + B=placed[prior] + if (len(B)>=len(X)and not contained(X,B))or(len(B)=len(g['roots'])-H else perpendicular((g['tm'][g['targets'][j]],)) + actual.append(terminal_frame) + assert all(contained(a,b)for a,b in zip(actual,actual[1:]))and all(nondeg(A)for A in actual) + ds=[len(A)for A in actual];chains[s]=ds + for a,b in zip(ds,ds[1:]): + if b>a:hist[b-a]+=2*v + if s in g['terminal']and g['terminal'][s]>=len(g['roots'])-H:hist[H-1]+=2*v + if H>ds[-1]:hist[H-ds[-1]]+=2*v + hist[576-H+ds[0]]+=2*v +for t in range(v): + levels=sorted({0,H-1}|{len(placed[s])for s in bytarget[t]}) + for a,b in zip(levels,levels[1:]):hist[b-a]+=2*v +hist[H-1]+=2*N;hist[(H-1)**2]+=2*N;hist[1]+=N +expected=json.loads((REPO/'research/deferred-replayed-117/complex-profile.json').read_text()) +assert dict(hist)=={int(k):v for k,v in expected['child_multiplicities'].items()},('Histogram mismatch',hist) +assert Counter(len(A)for A in placed.values())==Counter({int(k):v for k,v in expected['deferred_dims'].items()}) +g.update(placed=placed,bytarget=dict(bytarget),histogram=dict(hist),chain_dims=chains);digest=save('FRAMES.pkl',g) +result=dict(status='PASS original118 full frame/profile reconstruction',roles=roles,deferred=len(placed),maxchild=max(hist),weighted_rank=sum(t*n for t,n in hist.items()),all_bins_match=True,frame_sha256=digest,seconds=time.monotonic()-start,rss_KiB=resource.getrusage(resource.RUSAGE_SELF).ru_maxrss) +(ROOT/'FRAMES_CHECK.json').write_text(json.dumps(result,indent=2)+'\n');print(json.dumps(result,indent=2)) diff --git a/research/birth-read-reuse/build_roles.py b/research/birth-read-reuse/build_roles.py new file mode 100644 index 0000000000..427d518e8f --- /dev/null +++ b/research/birth-read-reuse/build_roles.py @@ -0,0 +1,109 @@ +"""Original exact carrier matching/role reconstruction, no upstream imports.""" +import sys,os +if sys.flags.optimize or os.environ.get('PYTHONOPTIMIZE'):raise RuntimeError('Assertions required') +from pathlib import Path +from collections import deque +import pickle,json,time,resource,hashlib +ROOT=Path(__file__).resolve().parent;REPO=Path(os.environ.get('BIRTH_REPO',ROOT.parents[1]));start=time.monotonic() +resource.setrlimit(resource.RLIMIT_AS,(512*1024**2,512*1024**2));resource.setrlimit(resource.RLIMIT_CPU,(30,30));sys.setrecursionlimit(5000) +g=pickle.loads((ROOT/'GRAPH.pkl').read_bytes());h,v=g['h'],g['v'];args,core,cover,rank,kind=[g[k]for k in ('args','core','cover','rank','kind')];active=g['active'];roots=g['roots'];n=len(args);full=(1<=shortest:continue + for uid in adj[x]: + y=R[uid] + if y<0:shortest=dist[x]+1 + elif dist[y]==INF:dist[y]=dist[x]+1;queue.append(y) + if shortest==INF:break + def augment(x): + for uid in adj[x]: + y=R[uid] + if (y<0 and dist[x]+1==shortest)or(y>=0 and dist[y]==dist[x]+1 and augment(y)): + L[x]=uid;R[uid]=x;return True + dist[x]=INF;return False + gained=sum(augment(x)for x in left if L[x]<0);assert gained;rounds.append((shortest,gained)) +links={x:L[x]for x in left if L[x]>=0};assert len(links)==71185,len(links) +# Every matched edge is an actual unchanged input continuation into a later use. +assert len(set(links.values()))==len(links) +for x,uid in links.items():assert use[uid][0]in args[x]and uid in adj[x] +held=[];first=[];ops=[];role_of={};terminal={} +def alloc(x): + s=len(first);first.append(x);held.append([x]);return s +for x in sorted(active,key=lambda x:(rank[x],x)): + free=[uid for uid in uses[x]if R[uid]<0] + if not args[x]: + for uid in free: + s=alloc(x);ops.append((0,s,x,-1));role_of[uid]=s + continue + a,b=args[x];sa,sb=role_of.pop(edge[x,0]),role_of.pop(edge[x,1]);assert sa!=sb + if x in links and use[links[x]][0]==a:sa,sb=sb,sa + ops.append((1,sa,sb,x));held[sa].append(x);held[sb].append(x) + if x in links:role_of[links[x]]=sb + assert free;role_of[free[0]]=sa + for uid in free[1:]: + s=alloc(x);ops.append((2,sa,s,x));role_of[uid]=s +for uid,row in enumerate(use): + if row[1]:terminal[role_of.pop(uid)]=row[2] +assert not role_of and len(first)==28705 and len(terminal)==len(roots) +# All original-role fresh signals, not sampled values. +values=[0]*len(first) +for op,s,t,x in ops: + if op==0:values[s]=1<<(t-1) + elif op==1: + assert not(values[s]&values[t]);values[s]|=values[t];assert values[s]==g['support'][x] + else:assert values[t]==0;values[t]=values[s];assert values[t]==g['support'][x] +for s,j in terminal.items():assert values[s]==g['support'][roots[j]] +for chain in held: + for a,b in zip(chain,chain[1:]):assert contains(a,b) +# Dependencies in the exact selected chronological program. +previous=[-1]*len(first);pred=[[]for _ in ops];last=[-1]*len(first) +for i,(op,s,t,x)in enumerate(ops): + if op: + for r in(s,t): + if previous[r]>=0:pred[i].append(previous[r]) + previous[r]=i;last[r]=i +centers=[s for s,j in terminal.items()if j>=len(roots)-h] +phase=set();todo=[last[s]for s in centers] +while todo: + i=todo.pop() + if i not in phase:phase.add(i);todo.extend(pred[i]) +touched=set(centers) +for i in phase: + _,s,t,_=ops[i];touched.update((s,t)) +expected=json.loads((REPO/'research/deferred-replayed-117/complex-profile.json').read_text());assert (len(phase),len(touched))==(expected['phase_one_ops'],expected['phase_one_roles']),(len(phase),len(touched)) +g.update(uses=uses,use=use,links=links,matched_use=R,holds=held,first=first,ops=ops,terminal=terminal,last=last,phase=phase,touched=touched,center_roles=centers) +raw=pickle.dumps(g,protocol=4);(ROOT/'ROLES.pkl').write_bytes(raw) +receipt=dict(status='PASS original exact118 matching/role/source reconstruction',links=len(links),roles=len(first),ops=len(ops),phase_one_ops=len(phase),phase_one_roles=len(touched),augmenting_rounds=rounds,checkpoint_sha256=hashlib.sha256(raw).hexdigest(),seconds=time.monotonic()-start,rss_KiB=resource.getrusage(resource.RUSAGE_SELF).ru_maxrss) +(ROOT/'ROLES_CHECK.json').write_text(json.dumps(receipt,indent=2)+'\n');print(json.dumps(receipt,indent=2)) diff --git a/research/birth-read-reuse/check_assembly.py b/research/birth-read-reuse/check_assembly.py new file mode 100644 index 0000000000..088f44ee93 --- /dev/null +++ b/research/birth-read-reuse/check_assembly.py @@ -0,0 +1,71 @@ +"""Original exact assembly for paid birth-read slot reuse. No upstream imports.""" +import sys,os,gzip +if sys.flags.optimize or os.environ.get('PYTHONOPTIMIZE'):raise RuntimeError('Assertions required') +from pathlib import Path +from fractions import Fraction as Q +from math import factorial +import json,hashlib,time,resource +root=Path(__file__).resolve().parent;repo=Path(os.environ.get('BIRTH_REPO',root.parents[1]));start=time.monotonic() +profile=json.loads(gzip.decompress((root/'BIRTH_MATCHES.json.gz').read_bytes()));bill=json.loads((root/'READOUT_COST.json').read_text()) +source=repo/'research/deferred-replayed-117/certificate.json' +oldpath=repo/'certificates/copied-centers-network.json' +cert=json.loads(source.read_text());old_leaf=json.loads(oldpath.read_text()) +logcache={} +def smalllog(x): + z=(x-1)/(x+1);N=40;lo=2*sum((z**(2*j+1)/Q(2*j+1)for j in range(N)),Q(0));tail=2*z**(2*N+1)/(Q(2*N+1)*(1-z*z));return lo,lo+tail +ln2=smalllog(Q(2)) +def logbound(x): + if x in logcache:return logcache[x] + k=0;y=x + while y>=2:y/=2;k+=1 + lo,hi=smalllog(y);out=(k*ln2[0]+lo,k*ln2[1]+hi);logcache[x]=out;return out + +def expbound(lo,hi): + n=8;assert 0<=lo<=hi<1 + a=sum((lo**j/Q(factorial(j))for j in range(n+1)),Q(0));b=sum((hi**j/Q(factorial(j))for j in range(n+1)),Q(0));b+=hi**(n+1)/Q(factorial(n+1))/(1-hi/Q(n+2));return a,b + +def moment(label,m,W,children,saving): + rows={int(t):int(n)for t,n in children.items()};assert rows and all(00 for t,n in rows.items());lo=Q(0);hi=Q(0) + for t,n in sorted(rows.items()): + ll,lh=logbound(Q(m,t));a,b=expbound(saving*ll,saving*lh);weight=Q(n*t,m*W);lo+=weight*a;hi+=weight*b + scale=1<<192 + lo=Q((lo*scale).numerator//(lo*scale).denominator,scale) + u=hi*scale;hi=Q((u.numerator+u.denominator-1)//u.denominator,scale) + assert hi<1,label + return dict(label=label,m=m,W=W,saving=saving,rank=sum(t*n for t,n in rows.items()),lower=lo,upper=hi,strict_gap=1-hi,enclosure_grid_bits=192,log_terms=40,exponential_degree=8) + + +coarse=cert['bit_profile'];old=old_leaf['bit']['counts'];alpha=Q(1,1000);a0=Q(620523,5000000000);old_a=Q(384599,10**10) +aactual=(1-alpha)*a0+alpha*old_a;b=Q(11040781,10**11);beta=Q(1,10**6);buffer=Q(1,10**12);a=min(aactual,(1-beta)*b-buffer) +assert aactual==Q(1240189553,10**13)==Q(cert['actual_bit_saving'])and aactual>a>0 +moments=[moment('coarse_bit',529,coarse['W'],coarse['child_multiplicities'],a0),moment('old_ordinary',old['m'],old['W'],old['child_multiplicities'],old_a),moment('birth_reused_complex',576,profile['W'],profile['child_histogram'],b)] +m,W,s,rmax,R=576,profile['W'],profile['rank'],max(map(int,profile['child_histogram'])),profile['R'];G=bill['global_scalar_group_upper'] +assert (W,s,R,rmax)==(115865904,66736898624,26599,574) +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+182*r**t) +stock=[dict(m=mm,W=ww,maxchild=rr,depth=halving(mm,rr),wire_bits=ww.bit_length())for mm,ww,rr in [(529,coarse['W'],528),(575,old['W'],529),(576,W,rmax)]] +rows=sum(x['depth']*x['wire_bits']for x in stock);rowgap=Q(32000)-Q(51,25)*rows +assert rows==15561 and rowgap==Q(6389,25) +bridge=dict(m=m,W=W,rank=s,R=R,maxchild=rmax,G=G,E=E,literal_charge=charge,B=B,C0=C0,C1=1,stock=stock,rows=rows,row_degree=32000,row_gap=rowgap,suffix_slope=128000,odd_grid='2^-P21^-K; K=G*(D_complex+1), with completed child preserving incoming odd exponent') +# Exact retained assembly formulas, written independently and never imported. +eta=Q(1,10**8);beta=Q(1,10**6);tau=1-a;sigma=1-b;q=a*(1-2*eta);c=q*(1+eta);eps=(1-eta)/(1+c+q);lp=1-q;lam=(tau+lp)/2;g=eps*q;rr=(g+1-eps)/2;delta=eta/8 +internal=tau+(1-beta)*max(sigma-tau,Q(0));leaf=sigma+beta*(1-sigma) +grid=10**17;kappa=Q((g*grid).numerator//(g*grid).denominator,grid) +if kappa==g:kappa-=Q(1,grid) +margins=dict(original_prefix=1-eps*(1+c),coordinate_movement=a,compact_phase_layer=g,bulk_exposure=a,Gaussian_arithmetic=min(1-eps-delta,rr-delta),scalar_work=1-eps-delta,dimension=eps) +slacks=dict(bit_positive=a,complex_above_bit=b-a,complex_below_one_over32=Q(1,32)-b,beta_positive=beta,beta_below_one=1-beta,leaf_saving_above_bit=(1-beta)*b-a,q_positive=q,q_below_internal=1-internal-q,q_below_leaf=1-leaf-q,c_positive=c,c_below_one=1-c,q_below_reservations=c-q,lambda_above_tau=lam-tau,lambda_above_sigma=lam-sigma,lambda_above_internal=lam-internal,lambda_prime_above_lambda=lp-lam,compact_leaf=lp-leaf,compact_reservations=lp-(1-c),lambda_prime_below_one=q,epsilon_positive=eps,epsilon_below_one=1-eps,guard_width=1-eps,K_geometry=1-eps*(1+c),K_dominates_log=eps*c,record_suffix=1-eps,phase_local=1-eps-delta,phase_boundary=rr-delta,gamma_sublinear=1-eps-rr,cell_above_band=eps-(1-rr)/2,prime_interval_packing=1-eps,alpha_positive=rr,alpha_below_one=1-rr,alpha_below_one_fourth=Q(1,4)-rr,delta_positive=delta,delta_below_one_eighth=Q(1,8)-delta,short_record_fallback=eps-a,small_field_exposure=1-eps-g,artificial_boundary=8-eps+rr-delta-g,literal_scalar_guard=Q(E-charge),row_product_gap=rowgap) +slacks.update({name+'_above_kappa':v-kappa for name,v in margins.items()}) +assert len(slacks)==47 and len(margins)==7 and all(v>0 for v in slacks.values());assert min(margins.values())==g and margins['original_prefix']-g==eta +next_kappa=kappa+Q(1,grid);assert g-next_kappa<=0 + + +inputfiles=[root/'BIRTH_MATCHES.json.gz',root/'READOUT_COST.json',source,oldpath] +pins={('new/'+p.name)if p.parent==root else('base/'+str(p.relative_to(repo))):hashlib.sha256(p.read_bytes()).hexdigest()for p in inputfiles} +out=dict(status='AUTHOR_CHECKED_CONDITIONAL_ASSEMBLY; independent review pending',source_head='6ec868e8568ca9a74b7245494de1b187c7be78fe',profile_source_head='ec862a5af51537495c745d9f2323e8a5736ee265',pins=pins,kappa=kappa,complex_saving=b,actual_bit_saving=aactual,supported_bit_parameter=a,moments=moments,finite_bridge=bridge,assembly=dict(parameters=dict(a=a,b=b,beta=beta,eta=eta,q=q,c=c,epsilon=eps,lambda_=lam,lambda_prime=lp,r=rr,delta=delta,C0=C0,C1=1),constraints=slacks,margins=margins,minimum_margin=g,absorption_gap=g-kappa),next_grid=next_kappa,next_grid_gap=g-next_kappa) +def js(x): + if isinstance(x,Q):return str(x) + if isinstance(x,dict):return {str(k):js(v)for k,v in x.items()} + if isinstance(x,(list,tuple)):return [js(v)for v in x] + return x +(root/'CANDIDATE.json').write_text(json.dumps(js(out),indent=2)+'\n');print(json.dumps(dict(kappa=str(kappa),decimal=float(kappa),complex_saving=str(b),G=G,W=W,R=R,constraints=len(slacks),margins=len(margins),seconds=time.monotonic()-start),indent=2)) diff --git a/research/birth-read-reuse/check_birth_lemma.py b/research/birth-read-reuse/check_birth_lemma.py new file mode 100644 index 0000000000..67f9e2c1e9 --- /dev/null +++ b/research/birth-read-reuse/check_birth_lemma.py @@ -0,0 +1,87 @@ +"""Original exact adversarial check of reset compensation; no upstream imports.""" +import sys,os +if sys.flags.optimize or os.environ.get('PYTHONOPTIMIZE'):raise RuntimeError('Assertions required') +from fractions import Fraction as F +from random import Random +from pathlib import Path +import json,time,resource +T0=time.monotonic() +def add(a,b,c=F(1)): + for i,x in enumerate(b):a[i]+=c*x + +def response(events,R,X,Y,cut=True): + B=[[F(0)for _ in range(Y)]for _ in range(R)];M=[[F(0)for _ in range(Y)]for _ in range(X)];D={} + for k in range(len(events)-1,-1,-1): + e=events[k];kind,r=e[:2] + if kind=='read':_,r,t,c=e;B[r][t]+=c + elif kind=='gate':_,r,s,c=e;add(B[s],B[r],c) + elif kind=='source':_,r,j,c=e;add(M[j],B[r],c) + elif kind=='birth': + D[k]=B[r][:] + if cut:B[r]=[F(0)for _ in range(Y)] + else:raise AssertionError(e) + return B,M,D + +def run(events,R,X,Y,x,z,D=None,uncompute=True,omit=None,fresh_only=False): + a=z[:];out=[F(0)for _ in range(Y)];gates=[];births=[] + for k,e in enumerate(events): + kind,r=e[:2] + if kind=='birth': + if D is None:a[r]=F(0) + else: + g=a[r];births.append((k,g)) + if k!=omit: + for t,d in enumerate(D[k]):out[t]-=d*g + elif kind=='gate':_,r,s,c=e;a[r]+=c*a[s];gates.append(e) + elif kind=='source':_,r,j,c=e;a[r]+=c*x[j];gates.append(e) + elif kind=='read':_,r,t,c=e;out[t]+=c*a[r] + if D is not None and uncompute: + for e in reversed(gates): + kind,r,j,c=e;a[r]-=c*(a[j]if kind=='gate'else x[j]) + return out,a,births +rng=Random(114113);basis_checks=0;dependent_nonzero_births=0;coefficient_max=F(0) +for case in range(96): + R=1+case%5;X=1+(case//5)%4;Y=1+(case//20)%4 + events=[('birth',r)for r in range(R)] + for step in range(24): + kind=rng.choice(['birth','source','read','gate']if R>1 else['birth','source','read']) + r=rng.randrange(R);c=rng.choice([F(1),F(-1),F(2),F(-2),F(1,2),F(-1,3)]) + if kind=='birth':events.append((kind,r)) + elif kind=='source':events.append((kind,r,rng.randrange(X),c)) + elif kind=='read':events.append((kind,r,rng.randrange(Y),c)) + else: + s=rng.choice([i for i in range(R)if i!=r]);events.append((kind,r,s,c)) + # Force a genuinely used reuse with a nonzero old-source offset. + events += [('source',0,0,F(1)),('read',0,0,F(1)),('birth',0),('source',0,0,F(2)),('read',0,Y-1,F(1))] + B,M,D=response(events,R,X,Y);assert all(not any(row)for row in B) + coefficient_max=max(coefficient_max,max((abs(c)for row in D.values()for c in row),default=F(0))) + for b in range(X+R): + x=[F(i==b)for i in range(X)];z=[F(X+i==b)for i in range(R)] + expected=run(events,R,X,Y,x,[F(0)]*R)[0] + actual,restored,births=run(events,R,X,Y,x,z,D) + assert actual==expected and restored==z + assert expected==[sum(M[i][t]*x[i]for i in range(X))for t in range(Y)] + basis_checks+=1;dependent_nonzero_births+=sum(bool(g)for _,g in births) + # Dense signed rational source/dirty inputs exercise dependent birth values. + x=[F(rng.randrange(-7,8),rng.randrange(1,5))for _ in range(X)];z=[F(rng.randrange(-7,8),rng.randrange(1,5))for _ in range(R)] + assert run(events,R,X,Y,x,z,D)[:2]==(run(events,R,X,Y,x,[F(0)]*R)[0],z) +# A one-slot two-life example: x0 is still in the slot at its second birth. +e=[('birth',0),('source',0,0,F(1)),('read',0,0,F(1)),('birth',0),('source',0,1,F(1)),('read',0,1,F(1))] +B,M,D=response(e,1,2,2);x=[F(3),F(5)];z=[F(7)] +out,restored,births=run(e,1,2,2,x,z,D);assert out==x and restored==z and births==[(0,F(7)),(3,F(10))] +controls={} +controls['omit_reuse_readout']=run(e,1,2,2,x,z,D,omit=3)[0]!=x +controls['do_not_cut_next_birth']=run(e,1,2,2,x,z,response(e,1,2,2,cut=False)[2])[0]!=x +controls['omit_inverse_workspace']=run(e,1,2,2,x,z,D,uncompute=False)[1]!=z +# Grouping negative source injections at the end fails after role aliasing. +e2=[('birth',0),('birth',1),('source',0,0,F(1)),('gate',1,0,F(1)),('read',1,0,F(1)),('birth',0),('source',0,1,F(1)),('read',0,1,F(1))] +_,_,D2=response(e2,2,2,2);z2=[F(7),F(11)] +assert run(e2,2,2,2,x,z2,D2)[:2]==(x,z2) +a=run(e2,2,2,2,x,z2,D2,uncompute=False)[1] +for kind,r,s,c in reversed([v for v in e2 if v[0]=='gate']):a[r]-=c*a[s] +for kind,r,j,c in reversed([v for v in e2 if v[0]=='source']):a[r]-=c*x[j] +controls['group_negative_sources_at_end']=a!=z2 +# The gate/readout model forbids source-target-workspace aliasing by construction. +assert all(controls.values()) +result=dict(status='PASS exact scalar lemma controls; no actual114 word or bound yet',cases=96,complete_source_dirty_basis_vectors=basis_checks,dense_rational_cases=96,nonzero_dependent_birth_values=dependent_nonzero_births,largest_test_response_coefficient=str(coefficient_max),rejected_controls=controls,one_slot_example=dict(source=['3','5'],dirty='7',birth_values=['7','10'],output=['3','5'],restored='7'),seconds=time.monotonic()-T0,rss_KiB=resource.getrusage(resource.RUSAGE_SELF).ru_maxrss) +Path(__file__).with_name('CHECKS.json').write_text(json.dumps(result,indent=2)+'\n');print(json.dumps(result,indent=2)) diff --git a/research/birth-read-reuse/load_graph.py b/research/birth-read-reuse/load_graph.py new file mode 100644 index 0000000000..72118a4c86 --- /dev/null +++ b/research/birth-read-reuse/load_graph.py @@ -0,0 +1,31 @@ +"""Original exact reconstruction from PR117's passive operand/root witness.""" +import sys,os +if sys.flags.optimize or os.environ.get('PYTHONOPTIMIZE'):raise RuntimeError('Assertions required') +from pathlib import Path +from itertools import combinations +import json,gzip,pickle,time,resource,hashlib +ROOT=Path(__file__).resolve().parent;REPO=Path(os.environ.get('BIRTH_REPO',ROOT.parents[1]));start=time.monotonic();resource.setrlimit(resource.RLIMIT_AS,(512*1024**2,512*1024**2));resource.setrlimit(resource.RLIMIT_CPU,(30,30)) +p=REPO/'research/deferred-replayed-117/complex-dag.json.gz';raw=p.read_bytes();assert hashlib.sha256(raw).hexdigest()=='3c034d0aae388ef567a454826f4f48b26fd8a94c71e8ffed4835271b349a783b';w=json.loads(gzip.decompress(raw));h=24;tr=list(combinations(range(h),3));v=len(tr);assert (w['h'],w['v'],w['central_disjoint'],w['center_denominator'])==(24,v,24,21) +args=[None]*(v+1);support=[0]+[1<=2 else 2;kind.append(ty);rank.append(support[x].bit_count()if ty==1 else cover[x].bit_count()) +point=[sum(1<>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 perp(A): + piv={x.bit_length()-1 for x in A};out=[] + for j in range(24): + if j not in piv: + x=1<>j&1:x|=1<<(r.bit_length()-1) + out.append(x) + return basis(out) +def contained(A,B):return all(not any((a&b).bit_count()%2 for a in A)for b in perp(B)) +@lru_cache(None) +def characteristic(A): + k=len(A);rows=[sum(((a&b).bit_count()%2)<>j&1);rows[j],rows[p]=rows[p],rows[j] + for i in range(k): + if i!=j and rows[i]>>j&1:rows[i]^=rows[j] + result=0 + for j in range(k): + if rows[j]>>k&1:result^=A[j] + return result +DG=defaultdict(list) +for s,last in enumerate(g['last']): + if last in g['phase']and(s not in g['terminal']or s in g['center_roles']):DG[g['U'][g['holds'][s][-1]]].append(s) +frames=sorted(DG,key=lambda F:(-len(F),F));pool=[DG[F][:]for F in frames];byB=defaultdict(list) +for b,F in g['placed'].items():byB[F].append(b) +allgroups=(1<25:raise RuntimeError('Bounded eligibility screen capped before matching; no partial claim') +# Deterministic most-constrained frame classes, highest-rank legal donor first. +available=allgroups;pairs=[] +for F in sorted(byB,key=lambda F:(capacity[F],len(F),F)): + for b in sorted(byB[F]): + mask=eligible[F]&available + if not mask:break + i=(mask&-mask).bit_length()-1;a=pool[i].pop();A=frames[i] + if not pool[i]:available^=1<e:H[s-e]+=2*v +assert min(H.values())>=0 +roles=len(g['first'])-len(pairs);W=2*v*v+2*v*roles;mass=sum(r*n for r,n in H.items());assert mass==576*W-1862080 +assert len({p['donor']for p in pairs})==len(pairs)==len({p['recipient']for p in pairs}) +def moment(a):return math.fsum(n*r*math.exp(a*math.log(576/r))for r,n in H.items()if n)/(576*W) +lo,hi=0.,.001 +for _ in range(65): + mid=(lo+hi)/2 + if moment(mid)<1:lo=mid + else:hi=mid +res=dict(status='Author exact liveness/containment/paid-profile birth-reuse screen; scalar expansion and full reflected word still to check',source_head='ec862a5af51537495c745d9f2323e8a5736ee265',base_roles=len(g['first']),donors=sum(len(v)for v in DG.values()),donor_frame_classes=len(frames),births=len(g['placed']),matched=len(pairs),R=roles,W=W,rank=mass,deficit=1862080,child_histogram=dict(sorted((r,n)for r,n in H.items()if n)),match_ranks=dict(Counter(f"{r['e']}->{r['s']}"for r in pairs)),new_positive_residuals_nonalternating=True,root_float_screen=(lo+hi)/2,zero_rank_merge_records=sum(r['e']==r['s']for r in pairs),pairs=pairs,source_frame_checkpoint_sha256=hashlib.sha256((ROOT/'FRAMES.pkl').read_bytes()).hexdigest(),seconds=time.monotonic()-start,rss_KiB=resource.getrusage(resource.RUSAGE_SELF).ru_maxrss) +(ROOT/'BIRTH_MATCHES.json.gz').write_bytes(gzip.compress((json.dumps(res,indent=2)+'\n').encode(),mtime=0));print(json.dumps({k:v for k,v in res.items()if k not in('pairs','child_histogram','match_ranks')},indent=2)) diff --git a/research/birth-read-reuse/readout_cost.py b/research/birth-read-reuse/readout_cost.py new file mode 100644 index 0000000000..a5b3bc5075 --- /dev/null +++ b/research/birth-read-reuse/readout_cost.py @@ -0,0 +1,70 @@ +"""Original exact signed integer dirty-readout responses and literal unit bill. +All coefficients are represented over42 by unsigned bitplanes; no modular test. +""" +import sys,os +if sys.flags.optimize or os.environ.get('PYTHONOPTIMIZE'):raise RuntimeError('Assertions required') +from pathlib import Path +from functools import reduce +from operator import or_ +from itertools import combinations +import pickle,json,time,resource,hashlib +ROOT=Path(__file__).resolve().parent;start=time.monotonic();resource.setrlimit(resource.RLIMIT_AS,(512*1024**2,512*1024**2));resource.setrlimit(resource.RLIMIT_CPU,(30,30)) +g=pickle.loads((ROOT/'FRAMES.pkl').read_bytes());R=len(g['first']);v=g['v'];N=v*v;allbits=(1<>i&1 else 0 for i in range(n.bit_length())) +def plus(a,b): + out=[];carry=0 + for i in range(max(len(a),len(b))): + x=a[i]if i=len(g['roots'])-24: + i=j-(len(g['roots'])-24);P[s]=scaled(allbits^point[i],2);M[s]=scaled(point[i],19) + elif jmaximum:maximum=maxhere;max_role=s + # Pin full exact responses, including zero coefficients and signs. + digest.update(s.to_bytes(4,'little'));digest.update(len(z).to_bytes(4,'little'));digest.update(neg.to_bytes((v+7)//8,'little')) + for w in z:digest.update(w.to_bytes((v+7)//8,'little')) + if s in g['placed']: + # Deferred origin has no center contribution; every actual target is in the conservative reach set. + assert not(nonzero&~g['reach'][s]);dense_reached+=nonzero.bit_count() +terminal_weight=0;terminal_count=0 +for a,b in zip(*seeds): + z,_=absdiff(a,b);terminal_weight+=sum(w.bit_count()*(1< 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/cube-deferred/certificate.json b/research/cube-deferred/certificate.json new file mode 100644 index 0000000000..cbce9a75d5 --- /dev/null +++ b/research/cube-deferred/certificate.json @@ -0,0 +1,321 @@ +{ + "status": "Finite conditional cyclic/deferred witness", + "kappa": "49349675169/500000000000000", + "complex_saving": "98718939/1000000000000", + "coarse_bit_saving": "620523/5000000000", + "actual_bit_saving": "1240189553/10000000000000", + "bit_parameter": "98718840271061/1000000000000000000", + "complex_profile": { + "h": 24, + "v": 2024, + "additions": 70252, + "roots": 8120, + "links": 42694, + "R": 35678, + "m": 576, + "N": 4096576, + "W": 152617696, + "L": 2234496, + "total_rank": 87905930816, + "deficit": 1862080, + "maxchild": 574, + "phase_one_ops": 18517, + "phase_one_roles": 15404, + "deferred_roles": 4909, + "deferred_dims": { + "1": 4, + "2": 45, + "4": 60, + "5": 1, + "6": 39, + "8": 79, + "10": 241, + "12": 348, + "13": 1, + "14": 234, + "15": 1, + "16": 218, + "17": 1, + "18": 1511, + "19": 682, + "20": 236, + "21": 225, + "22": 983 + }, + "lifted_additions": 34513, + "replay": { + "seeds": [ + 1, + 2 + ], + "scratch_restored": true, + "y_plus_x": true, + "field": "Z/(2^61-1)" + }, + "child_multiplicities": { + "1": 289160784, + "2": 238698416, + "3": 41451520, + "4": 67346576, + "5": 32064208, + "6": 32238272, + "7": 14451360, + "8": 14831872, + "9": 7549520, + "10": 10423600, + "11": 4849504, + "12": 8816544, + "13": 4602576, + "14": 12297824, + "15": 5505280, + "16": 8468416, + "17": 8828688, + "18": 9541136, + "19": 9367072, + "20": 4748304, + "21": 3149344, + "22": 6108432, + "23": 8322688, + "529": 8193152, + "552": 124552912, + "553": 16192, + "554": 182160, + "556": 242880, + "557": 4048, + "558": 157872, + "560": 319792, + "562": 975568, + "564": 1408704, + "565": 4048, + "566": 947232, + "567": 4048, + "568": 882464, + "569": 4048, + "570": 6116528, + "571": 2760736, + "572": 955328, + "573": 910800, + "574": 3979184 + } + }, + "bit_profile": { + "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 + } + }, + "bit_moment_gap": "210811394225115117568018038513239592855337768061996351784199300828041381607148420475711921673436778332750996651783152394205578153858435663243959795913385215868392831844509655226993164072062830500832781615792327068936897853818968534771730481866850519439187068953062899333771640996075361901014500735179763112430083120460814689994116646689670445286414265265018468311435502209195246240538069975559360544007937885404793780372701951022292660282948582656517071290400479729799954952580125532795274568021525151839594883237275569314958070368193662075730567130277424969924134425921633872848924585639423998410253779062359718371205767101510073996880454144801457072151080008705648366603197414406872289670642046369219405455128737300640897667220951127018547660455087533581513233999285275099394371781290865408274484542745086391849285198194905751058992419590161634431610100995441112613134240446609058758039909343152776920263419910572835208525277494067408376961456317/225678505065634612156474913616400633538202019254665477026878220214422133931127460164253533068001699469116755578965090566731480236912032281717920888140691998261537790258547549397061712443744511202265657747547567084090291301783866427704803156891369853685579999500594559805069402727752752227038426964007028952158078563045054314475625278140097385695241851533235641996467089273692960018822280793234080014352234618229252999217015923728814468917104222554059646947960375336061268431587018084270516494408656203498548153054913267707164839939006583338918817922618882667407408888179421052689449193499742148706302504238261936554897181289081072466758282367100305194479622149878636307463869297507337915811001244472279386614413535081936912313821531543735588465392499062010570720287729070905437080967709221039366272598541269000920375996285867953823816142239661027100714288630069735295241672325865922423925213948613346461034734632365263739073012128769510020000000000000000000000", + "complex_moment_gap": "8713002844707470603810572602811292071491073861680845100468422371355958805664066456911340430581799759600275009891823114363455829566580551875226631915385552312120196234612200803204747207581360283870615890933973275541564754841444929880722876454538980847382880418521125090192737893482026319811048890579527952283973971770565808566874123052772783728880396398501453926792854413801375581070904150758646234078385074698384766042470679842764127343147308702721937377031942962483179809457278468728016243855770540660748546130943436758631451390487721642687040141070692725038546160870511261869754088334985065355083171789000779136720105840161036647076727518225343113560482305684073025864624378546056184784682494133791860301459307496815192457520304549554230482449793458763471948201700244472296795468366154352663969582175552823611715631240040844525868091672812638299169911214584495614265716706603859560014103057335754226573090926347153532213808307662065799694509789753747254605469698072651442614773968667354348480268789577707428337/82004595540487109222410472477584395055225491990612804025505949409210739120479669585422360259650556631013333007897240375010898496811585023796883493143444442230421442067579096095992625288692678084097364687380712500354565103444673005468571785486668403984361592817616412790231595283157179174295196417719561001023285211289278916124290564007327793841455387378435404548160415050113934008394722146017891540035448075876605319966074939051969777457326758978562797928706674129126199967346585226840774785239700506261422039149360933383141939946634909499491199165047645095133906172497002898943912030078641043695394060930799110997796118255678267900941808208143351080782964611532545791013666853036267576749951161024850609430651823565128566811916696237249601001826588863053163566178603319010010171194364183773308589146646653448901324852152074358769410805096463824695542692196738974692473208326683945740548009619928898866419895976538089696888620694630599254827899786029946953622959760066903810758504244456789924369830656000000000000000000000000", + "finite_bridge": { + "complex": { + "m": 576, + "W": 152617696, + "s": 87905930816, + "maxchild": 574, + "halving_degree": 200, + "wire_bits": 28, + "scalar_terms": [ + { + "h": 24, + "v": 2024, + "c": 70252, + "R": 35678, + "q": 8120, + "invocations": 2024, + "local_group_upper": 17730568072, + "description": "Expanded deferred readouts and forward/inverse/reflected words" + }, + { + "h": 24, + "v": 2024, + "c": 70252, + "R": 35678, + "q": 8120, + "invocations": 2024, + "local_group_upper": 17730568072, + "description": "Expanded deferred readouts and forward/inverse/reflected words" + } + ], + "scalar_group_upper": 71773343652032 + }, + "semantic": { + "E": 23663134977676537687468327305713605031848000, + "literal_charge": 3343512570701091329748038698372, + "strict_literal_gap": 23663134977673194174897626214383856993149628, + "B": 23663134977676537687468327305713692937778816, + "C0": 10320887014903089483460091488744256300011976338006629722006596843490496619188358441485729792, + "C1": 1, + "induction_gap": 70989404933029613062404981917141078813336448, + "fixed_odd_divisor": 21, + "exact_grid": "2^(-P)*21^(-K), K=G*(D_complex+1); completed children preserve incoming odd denominator; no child rounding" + }, + "rows": { + "coefficient": 15761, + "degree": 33000, + "suffix_slope": 132000, + "degree_gap": "21189/25", + "contract": "W_complex^D_complex * W_coarse^D_coarse * W_old^D_old; prefix and padding; sequential reuse" + }, + "bit_coarse": { + "m": 529, + "W": 108516254, + "maxchild": 528, + "halving_degree": 367, + "wire_bits": 27 + }, + "ordinary_leaf_row_degree": 252 + }, + "assembly": { + "parameters": { + "a_bit": "98718840271061/1000000000000000000", + "a_complex": "98718939/1000000000000", + "tau": "999901281159728939/1000000000000000000", + "sigma": "999901281061/1000000000000", + "eta": "1/100000000", + "beta": "1/1000000", + "q": "4935941914834209728939/50000000000000000000000000", + "c": "493594196419362887728109728939/5000000000000000000000000000000000", + "epsilon": "4999999950000000000000000000000000/5000987188387902783860622009728939", + "lambda_": "99990128116071612740271061/100000000000000000000000000", + "lambda_prime": "49995064058085165790271061/50000000000000000000000000", + "alpha_squared_power": "740416287225131459340850000000/5000987188387902783860622009728939", + "delta": "1/800000000", + "C0": 10320887014903089483460091488744256300011976338006629722006596843490496619188358441485729792, + "C1": 1, + "kappa": "49349675169/500000000000000" + }, + "strict_constraints": { + "bit_positive": "98718840271061/1000000000000000000", + "complex_above_bit": "98728939/1000000000000000000", + "complex_below_one_over32": "31151281061/1000000000000", + "beta_positive": "1/1000000", + "beta_below_one": "999999/1000000", + "leaf_saving_above_bit": "1/100000000000000", + "q_positive": "4935941914834209728939/50000000000000000000000000", + "q_below_internal": "98718840271061/50000000000000000000000000", + "q_below_leaf": "99218840271061/50000000000000000000000000", + "c_positive": "493594196419362887728109728939/5000000000000000000000000000000000", + "c_below_one": "4999506405803580637112271890271061/5000000000000000000000000000000000", + "q_below_reservations": "4935941914834209728939/5000000000000000000000000000000000", + "lambda_above_tau": "98718840271061/100000000000000000000000000", + "lambda_above_sigma": "9971612740271061/100000000000000000000000000", + "lambda_above_internal": "98718840271061/100000000000000000000000000", + "lambda_prime_above_lambda": "98718840271061/100000000000000000000000000", + "compact_leaf": "99218840271061/50000000000000000000000000", + "compact_reservations": "4935941914834209728939/5000000000000000000000000000000000", + "lambda_prime_below_one": "4935941914834209728939/50000000000000000000000000", + "epsilon_positive": "4999999950000000000000000000000000/5000987188387902783860622009728939", + "epsilon_below_one": "987238387902783860622009728939/5000987188387902783860622009728939", + "guard_width": "987238387902783860622009728939/5000987188387902783860622009728939", + "K_geometry": "49364419641936293708752887728109728939/500098718838790278386062200972893900000000", + "K_dominates_log": "49359419148342092353448085165790271061/500098718838790278386062200972893900000000", + "record_suffix": "987238387902783860622009728939/5000987188387902783860622009728939", + "phase_local": "789785709335038700594823922529190271061/4000789750710322227088497607783151200000000", + "phase_boundary": "592328028792916779569896139377990271061/4000789750710322227088497607783151200000000", + "gamma_sublinear": "246822100677652401281159728939/5000987188387902783860622009728939", + "cell_above_band": "4999753127899322347598718840271061/10001974376775805567721244019457878", + "prime_interval_packing": "987238387902783860622009728939/5000987188387902783860622009728939", + "alpha_positive": "740416287225131459340850000000/5000987188387902783860622009728939", + "alpha_below_one": "5000246772100677652401281159728939/5000987188387902783860622009728939", + "alpha_below_one_fourth": "4998025523239002258023258609728939/20003948753551611135442488038915756", + "delta_positive": "1/800000000", + "delta_below_one_eighth": "99999999/800000000", + "short_record_fallback": "4999506258344551912178872895357025046364910104065721/5000987188387902783860622009728939000000000000000000", + "small_field_exposure": "493644201355304802562319457878/5000987188387902783860622009728939", + "artificial_boundary": "28006515498362132750241103006187738790271061/4000789750710322227088497607783151200000000", + "literal_scalar_guard": "23663134977673194174897626214383856993149628", + "row_product_gap": "21189/25", + "original_prefix_above_kappa": "25004938407857391091926690133547305984309/2500493594193951391930311004864469500000000000000", + "coordinate_movement_above_kappa": "19489933061/1000000000000000000", + "compact_phase_layer_above_kappa": "2465917877172623580084902610984309/2500493594193951391930311004864469500000000000000", + "bulk_exposure_above_kappa": "19489933061/1000000000000000000", + "Gaussian_arithmetic_above_kappa": "123407924724299376078512575160828822024109309/2500493594193951391930311004864469500000000000000", + "scalar_work_above_kappa": "246818975063125576719092439630328822024109309/2500493594193951391930311004864469500000000000000", + "dimension_above_kappa": "2499753177906728726388847327488049584902610984309/2500493594193951391930311004864469500000000000000" + }, + "margins": { + "original_prefix": "49364419641936293708752887728109728939/500098718838790278386062200972893900000000", + "coordinate_movement": "98718840271061/1000000000000000000", + "compact_phase_layer": "493594186547479058059690271061/5000987188387902783860622009728939", + "bulk_exposure": "98718840271061/1000000000000000000", + "Gaussian_arithmetic": "592328028792916779569896139377990271061/4000789750710322227088497607783151200000000", + "scalar_work": "789785709335038700594823922529190271061/4000789750710322227088497607783151200000000", + "dimension": "4999999950000000000000000000000000/5000987188387902783860622009728939" + }, + "minimum_margin": "493594186547479058059690271061/5000987188387902783860622009728939", + "absorption_gap": "2465917877172623580084902610984309/2500493594193951391930311004864469500000000000000", + "recurrence": { + "internal": "999901281159728939/1000000000000000000", + "leaf": "999901281159718939/1000000000000000000", + "reservations": "4999506405803580637112271890271061/5000000000000000000000000000000000" + } + }, + "next_grid_rejections": { + "bit": "1e-10", + "complex": "1e-12", + "kappa": "1e-15" + } +} \ No newline at end of file diff --git a/research/cube-deferred/certificate.py b/research/cube-deferred/certificate.py new file mode 100644 index 0000000000..b31e1ed0c9 --- /dev/null +++ b/research/cube-deferred/certificate.py @@ -0,0 +1,112 @@ +#!/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(98718939, 1000000000000) +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]) + # A literal expanded readout is charged even if it could be factored. + # 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/cube-deferred/complex-profile.json b/research/cube-deferred/complex-profile.json new file mode 100644 index 0000000000..49cfd4740c --- /dev/null +++ b/research/cube-deferred/complex-profile.json @@ -0,0 +1,93 @@ +{ + "h": 24, + "v": 2024, + "additions": 70252, + "roots": 8120, + "links": 42694, + "R": 35678, + "m": 576, + "N": 4096576, + "W": 152617696, + "L": 2234496, + "total_rank": 87905930816, + "deficit": 1862080, + "maxchild": 574, + "phase_one_ops": 18517, + "phase_one_roles": 15404, + "deferred_roles": 4909, + "deferred_dims": { + "1": 4, + "2": 45, + "4": 60, + "5": 1, + "6": 39, + "8": 79, + "10": 241, + "12": 348, + "13": 1, + "14": 234, + "15": 1, + "16": 218, + "17": 1, + "18": 1511, + "19": 682, + "20": 236, + "21": 225, + "22": 983 + }, + "lifted_additions": 34513, + "replay": { + "seeds": [ + 1, + 2 + ], + "scratch_restored": true, + "y_plus_x": true, + "field": "Z/(2^61-1)" + }, + "child_multiplicities": { + "1": 289160784, + "2": 238698416, + "3": 41451520, + "4": 67346576, + "5": 32064208, + "6": 32238272, + "7": 14451360, + "8": 14831872, + "9": 7549520, + "10": 10423600, + "11": 4849504, + "12": 8816544, + "13": 4602576, + "14": 12297824, + "15": 5505280, + "16": 8468416, + "17": 8828688, + "18": 9541136, + "19": 9367072, + "20": 4748304, + "21": 3149344, + "22": 6108432, + "23": 8322688, + "529": 8193152, + "552": 124552912, + "553": 16192, + "554": 182160, + "556": 242880, + "557": 4048, + "558": 157872, + "560": 319792, + "562": 975568, + "564": 1408704, + "565": 4048, + "566": 947232, + "567": 4048, + "568": 882464, + "569": 4048, + "570": 6116528, + "571": 2760736, + "572": 955328, + "573": 910800, + "574": 3979184 + } +} diff --git a/research/cube-deferred/complex_deferred.py b/research/cube-deferred/complex_deferred.py new file mode 100644 index 0000000000..59012fc43c --- /dev/null +++ b/research/cube-deferred/complex_deferred.py @@ -0,0 +1,466 @@ +#!/usr/bin/env python3 +"""Cyclic strips and core-aware pair assembly with lifted frames and deferred readouts. + +The scalar h=24 producer uses PR111's cyclic PairedTriple strips and dual-suffix +pair stars, with PR62's core-aware pair assembly, a two-point base case, and +column-pair coarse sums inside contracted pair subproblems. PR110's maximum +carrier matching, explicit role compiler, lifted binary frames, deferred +readouts, finite-field replay, exact F2 frame checks, and actual one-child +profile are retained. The selected graph has 70252 additions, 8120 roots, +42694 carrier links, and 35678 roles. + +Credits: Avi Eisenberg (PR110 deferred complex compiler and PR62 pair assembly), +Rohan Arun (PR111 cyclic-strip and dual-suffix producer), Swapnil Jain (deferred +readouts), icekylinx (PR104 stopped product-ring and PairedTriple lineage), and +all predecessors credited in those sources. Integration and the contracted +pair replacement were prepared with OpenAI Codex assistance. Apache-2.0. + +This script checks the original assertions and writes complex-profile.json +next to itself. Reflected-word verification is a separate audit. +""" +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')) +import importlib.util +producer_path = HERE / 'producer.py' +spec = importlib.util.spec_from_file_location('cyclic_producer', 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 + + +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) == (70252, 8120, 42694, 35678), + 'selected graph size: additions=%d, roots=%d, matching=%d, roles=%d' % (c_add, q, 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/cube-deferred/core_pair_block.py b/research/cube-deferred/core_pair_block.py new file mode 100644 index 0000000000..b80eb8b5cb --- /dev/null +++ b/research/cube-deferred/core_pair_block.py @@ -0,0 +1,47 @@ +"""Core-aware pair assembly within PairedTriple's contracted pair subproblems. + +Adapted from Avi Eisenberg's PR62 interval-strip/core-aware pair producer +(Apache-2.0, Anthropic Claude assistance), on the inherited icekylinx paired +exclusion recursion. This adaptation uses a two-point base case, the caller's +cyclic-strip vector routine, and column-pair coarse sums at every level. +Prepared with OpenAI Codex assistance. All operations remain disjoint sums; +the enclosing producer checks exact supports and binary frame inclusions. +""" +from itertools import combinations + +def block(self,points,edges,weights): + if len(points)<=2: + total=lambda omit:self.total([x for p,x in edges.items()if not set(p)&set(omit)]+[x for p,x in weights.items()if p not in omit]) + return total(()),{a:total((a,))for a in points},{(a,b):total((a,b))for a,b in combinations(points,2)} + groups=self.grouping(points);ng=len(groups);e=lambda a,b:edges[tuple(sorted((a,b)))] + coarse={(i,j):self.total([self.total([e(a,b)for a in groups[i]])for b in groups[j]])for i,j in combinations(range(ng),2)} + wt={i:self.total([weights[a]for a in g]+[e(a,b)for a,b in combinations(g,2)])for i,g in enumerate(groups)} + total,outside,far=self.block(list(range(ng)),coarse,wt) + strips={};sums={} + for i,g in enumerate(groups): + other=[j for j in range(ng)if j!=i] + for a in g: + carry=self.total([weights[u]for u in g if u!=a]) + vals=[self.total([e(u,v)for u in g if u!=a for v in groups[j]])for j in other] + st,one,_=self.vector([carry]+vals,False) + strips[a]={j:z for j,z in zip(other,one[1:])};sums[a]=st + out={};single={a:self.add(outside[i],sums[a])for i,g in enumerate(groups)for a in g} + for i,g in enumerate(groups): + for a,b in combinations(g,2):out[a,b]=outside[i] + for i,j in combinations(range(ng),2): + if len(groups[i])==2 and len(groups[j])==2: + (a,a2),(b,b2)=groups[i],groups[j];F=far[i,j] + Sa,Sa2,Sb,Sb2=strips[a][j],strips[a2][j],strips[b][i],strips[b2][i] + FSa,FSa2=self.add(F,Sa),self.add(F,Sa2) + FSb,FSb2=self.add(F,Sb),self.add(F,Sb2) + Y1=self.add(FSb,Sa);Y2=self.add(FSa,Sb2) + Y3=self.add(FSa2,e(a,b2));Y4=self.add(FSb2,e(a,b)) + out[a,b]=self.add(e(a2,b2),Y1);out[a,b2]=self.add(e(a2,b),Y2) + out[a2,b]=self.add(Y3,Sb);out[a2,b2]=self.add(Y4,Sa2) + else: + for a in groups[i]: + left=self.add(far[i,j],strips[a][j]) + for b in groups[j]: + cross=self.total([e(u,v)for u in groups[i]if u!=a for v in groups[j]if v!=b]) + out[a,b]=self.add(left,self.add(strips[b][i],cross)) + return total,single,out diff --git a/research/cube-deferred/cube115.py b/research/cube-deferred/cube115.py new file mode 100644 index 0000000000..136c0898d6 --- /dev/null +++ b/research/cube-deferred/cube115.py @@ -0,0 +1,93 @@ +# Imported from icekylinx PR115 cf60442983c153a3a0f5272ea4713f99eba13c86; local import adapted. +# Copyright 2026 icekylinx. Apache-2.0. +# Prepared with OpenAI GPT-6 Astra and Codex assistance; see NOTICE. +"""Pair-first cube override of the retained PairedTriple recursion.""" +from itertools import combinations +from collections import defaultdict +from interval115 import IntervalTriple + +def cube_values(self,G,groups,out_coarse,one,two,w): + (a,a2),(b,b2),(c,c2)=[groups[g] for g in G] + def piece(*points): + p=tuple(sorted(points)) + if not p:return out_coarse[G] + if len(p)==1: + u=p[0];omit=tuple(g for g in G if u not in groups[g]);return one[u][omit] + if len(p)==2: + omit=tuple(g for g in G if not set(p)&set(groups[g]));return two[p][omit] + return w.get(p,0) + def plane(z): + val=lambda *p:piece(*(p+(() if z is None else (z,)))) + F=val();Sa,Sa2,Sb,Sb2=[val(x) for x in (a2,a,b2,b)] + e=lambda u,v:val(u,v) + FSa,FSa2,FSb,FSb2=[self.add(F,x) for x in (Sa,Sa2,Sb,Sb2)] + Y1=self.add(FSb,Sa);Y2=self.add(FSa,Sb2) + Y3=self.add(FSa2,e(a,b2));Y4=self.add(FSb2,e(a,b)) + return {(a2,b2):self.add(e(a2,b2),Y1),(a2,b):self.add(e(a2,b),Y2), + (a,b2):self.add(Y3,Sb),(a,b):self.add(Y4,Sa2)} + F=plane(None);V={z:plane(z) for z in (c,c2)} + return {tuple(sorted((u,v,z))):self.add(F[u,v],V[z][u,v]) for u,v in F for z in (c,c2)} + +class CubeTriple(IntervalTriple): + cube_values=cube_values + def triple(self,pts,w): + subsets=[s for k in range(4) for s in combinations(pts,k)] + if len(pts)<=self.base: + return {s:self.total([v for t,v in w.items() if not set(s)&set(t)]) for s in subsets} + groups=self.grouping(pts);ng=len(groups) + group_of={u:i for i,g in enumerate(groups) for u in g} + coarse_parts=defaultdict(list) + for t,v in w.items():coarse_parts[tuple(sorted({group_of[u] for u in t}))].append(v) + coarse={s:self.total(xs) for s,xs in coarse_parts.items()} + out_coarse=self.triple(list(range(ng)),coarse) + # Contract one surviving point and aggregate by the other point groups. + one={} + for u in pts: + g=group_of[u];others=[j for j in range(ng) if j!=g] + pieces=defaultdict(list) + for t,v in w.items(): + if u not in t:continue + rest=[a for a in t if a!=u] + if any(group_of[a]==g for a in rest):continue + pieces[tuple(sorted({group_of[a] for a in rest}))].append(v) + coeff={s:self.total(xs) for s,xs in pieces.items()} + edges={s:coeff.get(s,0) for s in combinations(others,2)} + weights={j:coeff.get((j,),0) for j in others} + total,single,pair=self.block(others,edges,weights) + const=coeff.get((),0) + one[u]={():self.add(const,total)} + one[u].update({(j,):self.add(const,x) for j,x in single.items()}) + one[u].update({s:self.add(const,x) for s,x in pair.items()}) + # Contract two surviving points. The remaining degree is at most one. + two={} + for u,v in combinations(pts,2): + i,j=group_of[u],group_of[v] + if i==j:continue + others=[k for k in range(ng) if k not in (i,j)] + vals=[self.total([w.get(tuple(sorted((u,v,a))),0) for a in groups[k]]) for k in others] + total,leave,_=self.vector([w.get((u,v),0)]+vals,False) + two[u,v]={():total}|{(k,):x for k,x in zip(others,leave[1:])} + + result={};cube_cache={} + for excluded in subsets: + E=set(excluded);G=tuple(sorted({group_of[a] for a in E})) + survivors=[u for i in G for u in groups[i] if u not in E] + assert len(survivors)<=3 + pieces={():out_coarse[G]} + for u in survivors: + omit=tuple(i for i in G if i!=group_of[u]) + pieces[u,]=one[u][omit] + for u,v in combinations(survivors,2): + omit=tuple(i for i in G if i not in (group_of[u],group_of[v])) + pieces[u,v]=two[u,v][omit] + if len(survivors)==3:pieces[tuple(survivors)]=w.get(tuple(survivors),0) + if len(survivors)==3 and all(len(groups[g])==2 for g in G): + if G not in cube_cache:cube_cache[G]=self.cube_values(G,groups,out_coarse,one,two,w) + result[excluded]=cube_cache[G][tuple(sorted(survivors))] + continue + if len(survivors)==3: + a,b,c=survivors + order=[(),(a,),(b,),(a,b),(c,),(a,c),(b,c),(a,b,c)] + else:order=[s for k in range(len(survivors)+1) for s in combinations(survivors,k)] + result[excluded]=self.total([pieces[s] for s in order]) + return result diff --git a/research/cube-deferred/inputs/deferred_23.json.gz b/research/cube-deferred/inputs/deferred_23.json.gz new file mode 100644 index 0000000000..4a4431bd42 Binary files /dev/null and b/research/cube-deferred/inputs/deferred_23.json.gz differ diff --git a/research/cube-deferred/inputs/witness_23.json.gz b/research/cube-deferred/inputs/witness_23.json.gz new file mode 100644 index 0000000000..3d86f83b87 Binary files /dev/null and b/research/cube-deferred/inputs/witness_23.json.gz differ diff --git a/research/cube-deferred/interval115.py b/research/cube-deferred/interval115.py new file mode 100644 index 0000000000..980555b0ab --- /dev/null +++ b/research/cube-deferred/interval115.py @@ -0,0 +1,71 @@ +# Imported from icekylinx PR115 cf60442983c153a3a0f5272ea4713f99eba13c86; local import adapted. +# Copyright 2026 icekylinx. Apache-2.0. +# Prepared with OpenAI GPT-6 Astra and Codex assistance; see NOTICE. +"""Cyclic intervals and core-aware pairs, adapted from Avi Eisenberg PR62.""" +from pathlib import Path +from itertools import combinations +import sys +from paired_triple_circuit import PairedTriple +from paired_exclusion_circuit import PairedExclusionCircuit + +def interval_sums(add,values): + nz=[(i,x) for i,x in enumerate(values) if x] + n=len(nz) + if not n:return 0,[0]*len(values) + if n==1: + result=[nz[0][1]]*len(values);result[nz[0][0]]=0 + return nz[0][1],result + v=[x for _,x in nz];states={(a,1):x for a,x in enumerate(v)} + for length in range(2,n): + for a in range(n):states[a,length]=add(states[a,length-1],v[(a+length-1)%n]) + total=add(states[0,n-1],v[-1]) + out=[total]*len(values) + for j,(i,x) in enumerate(nz):out[i]=states[(j+1)%n,n-1] + return total,out + +class IntervalTriple(PairedTriple): + def vector(self,values,two=True): + if two:return super().vector(values,two) + total,one=interval_sums(self.add,values) + return total,one,{} + + def block(self,points,edges,weights): + if len(points)<=2: + return PairedExclusionCircuit.block(self,points,edges,weights) + groups=self.grouping(points);ng=len(groups) + edge=lambda a,b:edges[tuple(sorted((a,b)))] + coarse={(i,j):self.total([edge(a,b) for a in groups[i] for b in groups[j]]) + for i,j in combinations(range(ng),2)} + wt={i:self.total([weights[a] for a in g]+[edge(a,b) for a,b in combinations(g,2)]) + for i,g in enumerate(groups)} + total,outside,far=self.block(list(range(ng)),coarse,wt) + strips={};sums={} + for i,g in enumerate(groups): + other=[j for j in range(ng) if j!=i] + for a in g: + carry=self.total([weights[u] for u in g if u!=a]) + vals=[self.total([edge(u,v) for u in g if u!=a for v in groups[j]]) for j in other] + st,one=interval_sums(self.add,[carry]+vals) + strips[a]={j:z for j,z in zip(other,one[1:])};sums[a]=st + out={};single={a:self.add(outside[i],sums[a]) for i,g in enumerate(groups) for a in g} + for i,g in enumerate(groups): + for a,b in combinations(g,2):out[a,b]=outside[i] + for i,j in combinations(range(ng),2): + if len(groups[i])==len(groups[j])==2: + (a,a2),(b,b2)=groups[i],groups[j] + F=far[i,j];Sa,Sa2,Sb,Sb2=strips[a][j],strips[a2][j],strips[b][i],strips[b2][i] + FSa,FSa2=self.add(F,Sa),self.add(F,Sa2) + FSb,FSb2=self.add(F,Sb),self.add(F,Sb2) + Y1=self.add(FSb,Sa);Y2=self.add(FSa,Sb2) + Y3=self.add(FSa2,edge(a,b2));Y4=self.add(FSb2,edge(a,b)) + out[a,b]=self.add(edge(a2,b2),Y1) + out[a,b2]=self.add(edge(a2,b),Y2) + out[a2,b]=self.add(Y3,Sb) + out[a2,b2]=self.add(Y4,Sa2) + else: + for a in groups[i]: + left=self.add(far[i,j],strips[a][j]) + for b in groups[j]: + cross=self.total([edge(u,v) for u in groups[i] if u!=a for v in groups[j] if v!=b]) + out[a,b]=self.add(left,self.add(strips[b][i],cross)) + return total,single,out diff --git a/research/cube-deferred/producer.py b/research/cube-deferred/producer.py new file mode 100644 index 0000000000..03831b4e4f --- /dev/null +++ b/research/cube-deferred/producer.py @@ -0,0 +1,276 @@ +# Cube recurrence from icekylinx PR115 composed with eumemic PR114 core pairs and Rohan Arun PR111 pair stars. +# Cyclic-strip recursion plus dual-suffix pair stars, by Rohan Arun with Anthropic Claude assistance. +# Parent: PR107 (Rohan Arun with OpenAI Codex) on icekylinx PR104 at 854ba7dca98651eab2050402384e1a7784534f0a. +# Pair-star leave-one-out identity: PR55 dual-suffix strips (credited there). +# Original copyright, Apache-2.0 notice and scalar/frame assertions retained. +"""Aligned h=24 rational-center producer with cyclic strips and core-aware pairs. + +PR111's cyclic-strip PairedTriple recursion and dual-suffix pair stars are +retained. Contracted pair subproblems use core_pair_block.py: PR62's core-aware +four-output assembly, two-point base cases, and balanced column coarse sums. +All ordinary-support, exact rational-scatter, center, and binary-frame +assertions from PR111/PR104 remain enabled. + +Copyright 2026 icekylinx and the credited contributors, Apache-2.0. PR111 by +Rohan Arun with Anthropic Claude assistance; PR62 pair assembly by Avi +Eisenberg with Anthropic Claude assistance. This integration was prepared +with OpenAI Codex assistance. See the inherited NOTICE and source credits. +""" +import json, struct, array +from itertools import combinations +from pathlib import Path +from partial_swap.binary import write_array +from cube115 import CubeTriple as PairedTriple +from exclusion_circuit import ExclusionCircuit + + +def cyclic_vector(self,values,two=True): + """Leave-one-out by cyclic interval strips (PR62 idea): I(a,m)=I(a,m-1)+v_(a+m-1). + + Used for every strip of the PairedTriple recursion; leave-two-out vectors are unchanged. + Zero entries are omitted (their leave-one-out value is the total), exactly as before.""" + if two:return ExclusionCircuit.vector(self,values,two) + vals=list(values);n=len(vals) + if n==0:return 0,[],{} + nz=[i for i,x in enumerate(vals) if x] + if not nz:return 0,[0]*n,{} + if len(nz)==1: + x=vals[nz[0]];return x,[0 if i==nz[0] else x for i in range(n)],{} + v=[vals[i] for i in nz];k=len(v) + if k<3: + tot=self.add(v[0],v[1]);one=[v[1],v[0]] + else: + full=(1<