diff --git a/.github/workflows/split-centres-global.yml b/.github/workflows/split-centres-global.yml new file mode 100644 index 0000000000..1adf7dc2ea --- /dev/null +++ b/.github/workflows/split-centres-global.yml @@ -0,0 +1,23 @@ +name: Split-centres global kappa +on: + pull_request: + paths: + - 'research/split-centres-global/**' + - '.github/workflows/split-centres-global.yml' + push: + paths: + - 'research/split-centres-global/**' + - '.github/workflows/split-centres-global.yml' + workflow_dispatch: +jobs: + verify: + runs-on: ubuntu-latest + strategy: + matrix: + python: ['3.11', '3.14'] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + - run: python -B research/split-centres-global/verify.py "$RUNNER_TEMP/split-centres-check" diff --git a/certificates/joint-dual-kappa.json b/certificates/joint-dual-kappa.json index b7f7b89bc2..1f35b89221 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": "4f3c15b82a2d97335d4fe95fb8bcb96bd2a921087da289d9da16c68213a17f17", + "source_manifest_sha256": "698fe862a620e5b80b85fbc6034c9456fa0fa9aea638dbbbcb3f9edd24c0415e", "sources": [ { "files": { diff --git a/certificates/joint-dual-validation.json b/certificates/joint-dual-validation.json index 194861d3c3..61a8d41622 100644 --- a/certificates/joint-dual-validation.json +++ b/certificates/joint-dual-validation.json @@ -226,7 +226,7 @@ } }, "bit_saving": "2382370177/50000000000000", - "certificate_sha256": "9801147b1502cf1e43d5fa39aa37f5291f03b48c30c4dd4f272e0877894a1c24", + "certificate_sha256": "6f684fa7f747073a132e8d0b5652cf12a8afa389f2a16ff6ade8e080d786dd22", "kappa": "4764513337/100000000000000", "margins": 7, "producer_words_regenerated_and_matched": true, diff --git a/research/joint-dual/SOURCE.json b/research/joint-dual/SOURCE.json index e3a8386b17..e1fbf9c5aa 100644 --- a/research/joint-dual/SOURCE.json +++ b/research/joint-dual/SOURCE.json @@ -3,9 +3,9 @@ "base_pr57_commit": "cd350f76c9bc01489ec83568bded532cb69be938", "base_pr58_commit": "bc2f7ed4c20dc18898305ab17165c0c995cbb804", "files": { - "Makefile": "768131bd4ce18433f6abccdc9812a38c92e11220e3a1019c6d95334b42f529d1", + "Makefile": "cd0fb59dc078d1fdf54a163ea13bb3660d03c8fe69c1a7f99fc8e5f476a3d5c2", "NOTICE": "b49022cb4104d90b182e4c335f670faf45529025b15db77bf0291835083c28bd", - "README.md": "d104c31d5b7e0d3a8d011a0e3517ab615e5b499b3dc05684f7ad3cadcd28bdae", + "README.md": "b81f8035b859007add6693c6d860371c9100a6766e494045495a28a457a5fcb9", "certificates/joint-dual-compiler.json": "516c4d85158553dabd0a98216a064b2a7397957a9d5dd0df1d6e5aec53a4e805", "certificates/joint-dual-profiles-23.json": "159fa8fee175fc1d24f63e72d3c2f1dc9f4fcd78b938c5e7d2f735fd0fd37209", "certificates/joint-dual-profiles-25.json": "8d190ce42d097e828c5756918c52f2963df576cf4c6600b0fc7f2b7fdb6ad223", diff --git a/research/split-centres-global/.gitattributes b/research/split-centres-global/.gitattributes new file mode 100644 index 0000000000..a251e913f2 --- /dev/null +++ b/research/split-centres-global/.gitattributes @@ -0,0 +1,6 @@ +# Hashes bind exact imported and generated bytes. +* -text +vendor/** -whitespace +inputs/** -whitespace +notices/** -whitespace +proofs/** -whitespace diff --git a/research/split-centres-global/CERTIFICATE.json b/research/split-centres-global/CERTIFICATE.json new file mode 100644 index 0000000000..7e807079c1 --- /dev/null +++ b/research/split-centres-global/CERTIFICATE.json @@ -0,0 +1,119 @@ +{ + "status": "PASS_CONDITIONAL_SPLIT_CENTRE_ASSEMBLY", + "kappa": "560432476129139/500000000000000000", + "kappa_decimal": "0.001120864952258278", + "bit_lower": "561061350132569610283/500000000000000000000000", + "complex_lower": "1183986549206329/1000000000000000000", + "binding_component": "bit", + "gain_over_pr425_percent": 6.9522005058117555, + "bit_invoice": { + "prefix_bits": 223, + "charged_prefix_bits": 256, + "coefficient_bits": 223, + "two_level_coefficient_bits": 483, + "charged_two_level_coefficient_bits": 512, + "row_coefficient": 18355, + "live": 14502, + "physical": 14511 + }, + "strict_outer_constraints": { + "bit_positive": "14363170563393781995540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "complex_above_bit": "791857266447229204459483569705102945201339627252022591017013352985113602942786795000164759817249951996149235225861576966507630300630689893816878766552471016817/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "complex_below_one_over32": "30066013450793671/1000000000000000000", + "beta_positive": "1/1000000000000000000", + "beta_below_one": "999999999999999999/1000000000000000000", + "leaf_saving_above_bit": "791857266447229189304455739864091745201339627252022591017013352985113602942786795000164759817249951996149235225861576966507630300630689893816878766552471016817/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "q_positive": "7181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "q_below_internal": "14363170563393781995540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "q_below_leaf": "395928633223614609015398433325827868141186243920908350307167049240534210454380044514968776965838180997909857795680836487104579924453767980400809082645545614591621233447528983183/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "c_positive": "7181585281696892583407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "c_below_one": "6392818414718303107416592912348246333468141186243920908350307167049240534210454380044514968776965838180997909857795680836487104579924453767980400809082645545614591621233447528983183/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "q_below_reservations": "1/4000000000000000000", + "lambda_above_tau": "14363170563393781995540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "lambda_above_sigma": "791857266447229218822654133098884940741856057546919645815673725733091011925773442015051156874463156995984475408611624970358395074769112927309248465921781123000121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "lambda_above_internal": "14363170563393781995540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "lambda_prime_above_lambda": "14363170563393781995540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "compact_leaf": "395928633223614609015398433325827868141186243920908350307167049240534210454380044514968776965838180997909857795680836487104579924453767980400809082645545614591621233447528983183/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "compact_reservations": "1/4000000000000000000", + "lambda_prime_below_one": "7181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "epsilon_positive": "6399999999999999993600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817", + "epsilon_below_one": "7181585281696897383407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817", + "guard_width": "7181585281696897383407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817", + "K_geometry": "4807181585281696892583407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817000000000000000000", + "K_dominates_log": "231664041345061050845983947421186256401668584010497584446258683699366907737186677571792433338340060113453513521617978855187267028104098984087218414251878140832554446748323117142213588175726741393/206683276944570867451077647988766247307479316572776744891925575256476111799662761934047904233001101994161357746522719973016545013550824072000632231965075950141464786411824273258607000000000000000000", + "record_suffix": "7181585281696897383407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817", + "phase_local": "57452682253575172660075115932332441271463422396879066665683849849996634666672126693120783994727674596531689914600391489101073218400050692643898107263289403063667839215065313749127621233447528983183/51257452682253575127867256701214029332254870510048632733197542663606075726316364959643880249784273294552016721137634553308103163360604369856156793527338835635083267030132419768134536000000000000000000", + "phase_boundary": "11490536450715029406269754961108975467567014357972880107649718965136053613580158978016584167309038954918313004492748842618542529916554807718463285392220894997054215109129499241498821233447528983183/10251490536450715025573451340242805866450974102009726546639508532721215145263272991928776049956854658910403344227526910661620632672120873971231358705467767127016653406026483953626907200000000000000000", + "gamma_sublinear": "1/2000000000000000000", + "cell_above_band": "12799999999999999980792818414718303109016592912348246333468141186243920908350307167049240534210454380044514968776965838180997909857795680836487104579924453767980400809082645545614591621233447528983183/25628726341126787563933628350607014666127435255024316366598771331803037863158182479821940124892136647276008360568817276654051581680302184928078396763669417817541633515066209884067268000000000000000000", + "prime_interval_packing": "7181585281696897383407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817", + "alpha_positive": "14363170563393788359632590021810442080310539860404516767526852145439839929398406960210596656522703682519149061374476508023700697946773300526302961759162676751217566615750487648225621233447528983183/12814363170563393781966814175303507333063717627512158183299385665901518931579091239910970062446068323638004180284408638327025790840151092464039198381834708908770816757533104942033634000000000000000000", + "alpha_below_one": "12799999999999999993607181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/12814363170563393781966814175303507333063717627512158183299385665901518931579091239910970062446068323638004180284408638327025790840151092464039198381834708908770816757533104942033634000000000000000000", + "alpha_below_one_fourth": "3189227622077454657132070953804066391185618867017635029057319564329939892965374403017531918954994377226981896009727683073732747012090999815483496633699514550441486622767525747860182878766552471016817/12814363170563393781966814175303507333063717627512158183299385665901518931579091239910970062446068323638004180284408638327025790840151092464039198381834708908770816757533104942033634000000000000000000", + "delta_positive": "1/8000000000000000000", + "delta_below_one_eighth": "999999999999999999/8000000000000000000", + "short_record_fallback": "81827972558059963142482295831039750365059753405165839859500887157900070163784215146039541956047009515286378723945407637791323146319740145866082020356197908534083134290654194352838948148633280800174595114507063924980758679362172726895650066012032777455278212210736064133662717611940569491044304210260992667579958374711353997952140066809896811489/82011924291605720204587610721942446931607792816077812373116068261769721162106183935430208399654837271283226753820215285292965061376966991769850869643742137016133227248211871629015257600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "small_field_exposure": "1/1000000000000000000", + "artificial_boundary": "358859621458028601093359598365557325330989185343344322865175917750116843085479998176003320395642823216282588862770178911921831577311447916339793034478937323776724933813811421508232513136299657413050451/51257452682253575127867256701214029332254870510048632733197542663606075726316364959643880249784273294552016721137634553308103163360604369856156793527338835635083267030132419768134536000000000000000000", + "literal_scalar_guard": "1", + "row_product_gap": "23971789/25", + "balanced_prefix_above_kappa": "5122866517862023505724960619093421545844111701898553134698525509504383311993872387184513125657251444712150871805627114225726283245038727038504547469670408073428467093191496467269437/3203590792640848445491703543825876833265929406878039545824846416475379732894772809977742515611517080909501045071102159581756447710037773116009799595458677227192704189383276235508408500000000000000000", + "coordinate_movement_above_kappa": "16099174487823595540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "compact_phase_layer_above_kappa": "3838551450442350120466514150535089425156364590041027177747358186058007158198199154413541220091468727605299653469049909287939671070001907844989495748423461692471525807616440463522057/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817000000000000000000", + "bulk_exposure_above_kappa": "16099174487823595540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "Gaussian_arithmetic_above_kappa": "49929956359383891636682334467235976400846493161596454696927943987316335662954230095174784854400852306299403498179012231794056054820241901455974763560139756902928431597231181121226907/51257452682253575127867256701214029332254870510048632733197542663606075726316364959643880249784273294552016721137634553308103163360604369856156793527338835635083267030132419768134536000000000000000000", + "scalar_work_above_kappa": "3022347308020427168024638512713719642678957136664830842541068612764774941044496502999868999171719558143016474349913180337924305460021763455362126412952366988818802604491895640211767/2050298107290143005114690268048561173290194820401945309327901706544243029052654598385755209991370931782080668845505382132324126534424174794246271741093553425403330681205296790725381440000000000000000", + "dimension_above_kappa": "3196409207359151553231162974036146672459031212215382000019265285423173401803752699526640796382355306275012080586149285130394424095589341109716483649580049811311843280287131837920058593191496467269437/3203590792640848445491703543825876833265929406878039545824846416475379732894772809977742515611517080909501045071102159581756447710037773116009799595458677227192704189383276235508408500000000000000000" + }, + "outer_controls": [ + "next_grid", + "zero_eta", + "zero_beta", + "unit_beta" + ], + "bootstrap": [ + { + "gap": "48640105104416009930955104551272628756769/40000000000000000000000000000000000000000000000", + "cutoff_log2": "24346328299693" + }, + { + "gap": "10916033216189494908506938862091413300675156484737667525550897/8000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "19335382939135799529" + }, + { + "gap": "2449825733746901655394438404809502019511708753179325050819248403056515410563319361/1600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "15355787073969246541017124" + }, + { + "gap": "549801013506219857550281901936704203615404924098069138182437287931091972275689180385852832590942771793/320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "12195269025875323655994833423982" + }, + { + "gap": "123388839576821941106964776874551364767558290306753584545234931806617408234472738882773008179061080923160999418343337504609/64000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "9685246734476302780854842486398253310" + }, + { + "gap": "27691483569705102945201339627252022591017013352985113602942786795000164759817249951996149235225861576966507630300630689893816878766552471016817/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "7691835588756193183914168151850588989363719" + } + ], + "bit_template_sha256": "c40f89a2ae3c2c5635ddf8f18d74f24567ddf67fc8c8e93a1fc7a1a8098e857e", + "complex_template_sha256": "942d030fa43316c560c88d7d7d904583446e1a96945b3ebd37a91c88a192ab4f", + "scope": "Finite research composition with explicit changed words, exact local and global replay and incremental phase evidence. All-size correlated dirty-bank, compressed-window, compiler, restored-work, tape/common-grid, precision and analytic interfaces remain inherited assumptions. This certificate makes no unconditional integer-multiplication or Lean-kernel claim.", + "verification_steps": [ + "hamming_packets", + "complex_construct", + "complex_audit", + "complex_emit", + "complex_phases", + "bit_construct", + "bit_export", + "bit_global", + "bit_audit", + "bit_price", + "complex_integrate", + "complex_replay", + "combined" + ], + "phase_mode": "source-bound unchanged evidence" +} diff --git a/research/split-centres-global/EXPECTED.json b/research/split-centres-global/EXPECTED.json new file mode 100644 index 0000000000..de7c122419 --- /dev/null +++ b/research/split-centres-global/EXPECTED.json @@ -0,0 +1,9 @@ +{ + "kappa": "560432476129139/500000000000000000", + "kappa_decimal": "0.001120864952258278", + "bit_lower": "561061350132569610283/500000000000000000000000", + "complex_lower": "1183986549206329/1000000000000000000", + "binding_component": "bit", + "bit_template_sha256": "c40f89a2ae3c2c5635ddf8f18d74f24567ddf67fc8c8e93a1fc7a1a8098e857e", + "complex_template_sha256": "942d030fa43316c560c88d7d7d904583446e1a96945b3ebd37a91c88a192ab4f" +} diff --git a/research/split-centres-global/LICENSE b/research/split-centres-global/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/split-centres-global/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/split-centres-global/MANIFEST.json b/research/split-centres-global/MANIFEST.json new file mode 100644 index 0000000000..1695125698 --- /dev/null +++ b/research/split-centres-global/MANIFEST.json @@ -0,0 +1,51 @@ +{ + "format": "split-centres-global-manifest/1", + "files": { + ".gitattributes": "2f9541c7c27f084baad73b4cd50ddaeb264cc3aa8dbf13ec21df5ab3f673ca7e", + "CERTIFICATE.json": "f71580f22193726fb582eae604807ff70a7302265e001d9484a718e63bbe14c4", + "EXPECTED.json": "9b8e56eee3d5bdabd2e3e6e4ba0d9eba537525fba25a54126f9f0e41d2491a06", + "LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "NOTICE.md": "66101a9e74d0ba9c2da4c8802bcb1968534adfa7130b954628eb8bf515fc0389", + "PROOF.md": "6983e75f29af6eeaab20a30b08307ec6fab75ccb8b10291df8f9eb04d497f894", + "README.md": "b432292594adf2fcba2a8ddd87eda6167c76ff055e85aa5e3e2af7dd7e0f976e", + "SOURCES.json": "11aa666d678fed084b01d1e8e47239e1674eaedbc6fe0cee7edb2753477af9be", + "VALIDATION.json": "656d9bd7bd66058fdeb60cc90bd887e7ce75c0e0f9a100514e2bd84b95de89b6", + "code/bit_audit.py": "7fdbc077b7501a53662769ff2bf2ab44cc2e32dafc34478d7ef2c10e3144503a", + "code/bit_construct.py": "a461e6c983531beb5c8ac82ff593f39ce4e056387d1d6061f6e6b294dde4395f", + "code/bit_global.py": "3b2cb3ba21e5cf9b4deddb9e606322f33e9d8082020c0ee9092c21f4ebd9ad48", + "code/bit_price.py": "36bf15803567a95b139a908461541bf19efe1f5b85fb31c270021833ab1393ee", + "code/combined.py": "9c5bc70f2331b7342ceb252adcddb993581c45f80c37bcc58642dbad3b9775c2", + "code/complex_audit.py": "adeba5ea113652b60105db2e8719b18ffa292d3cc23730cca614b40272348330", + "code/complex_construct.py": "0f7f45b2333ec7daf4291e2bf675b49bc330b97fb5965dd27220ba353c291d6f", + "code/complex_emit.py": "f56d5f01f7c121741f175814138dca7190d769920f0a27e2d5b99c21aebed0f1", + "code/complex_integrate.py": "3792f41e409383e6989bda22801a4836a646a530f99e99bbd7244a8f3a1a8b4f", + "code/complex_phases.py": "13a959c52092776ae217df554b51c0298fa9eb3a350279acff6dece651c3f9cc", + "code/complex_phases_full.py": "0f2795aaffafe0c64d77f3748ef2109a3c42c58da867e4cf269a0a8cb6109466", + "code/complex_replay.py": "be2dccce2d1ad2c4f5c01a851c9c3896cc88236b5aeae706aad2ab16d6bfdad9", + "inputs/bit-geometry.json.gz": "5c980202227859e8bb9b863f94503930c2a59d460c0421356688e2b0d828b4a1", + "inputs/bit-r767.json.gz": "bd3b84244528767b85d8d7fe423b155630b5c659e21e51563674b1dcb6305ad7", + "inputs/complex-data-phases.json.gz": "c972b5b60649c2a52354f5160f69adc0f4a270fa09d32012beff9888774ab84f", + "inputs/complex-phase-receipt.json": "01763fee5017745de982f2ff5ee68004e815d6684097cc88011dfbfb1e789581", + "inputs/complex-phase-recipes.json.gz": "b5472bb1d3f9ff41b0819780a42886a7686b4caf3c0617bb1dc86158b3fb8671", + "inputs/complex-ports.json.gz": "77b0c0fa19ef3da1c7316010e13493aa5eea1a50c3506eddc08f7480e659878b", + "inputs/complex-template.json.gz": "1b84904a31a733aab9bfdda3f528c06719f590d2133a43687a8bded955dc991e", + "inputs/e8-r865.json.gz": "1fb726ea3818fe0837cceb0dd22a71a0814f064e5e781628104610d6468e0e55", + "notices/NOTICE-PR352.md": "967e6d7e76e216e4898cf543c75b527e8d397ec1ddba3800cb20701f24c89524", + "notices/NOTICE.md": "025773f32fb43667395e64c627a1752877bdc93afbfe01b106703eee438d21d3", + "notices/PR386.txt": "ae2241615a23063b18a04f1b7a88a52e62b3d7d42e333fbd21e3668567ab83d1", + "notices/PR426-SOURCE-PINS.json": "18ace817f2f9af22511bb303e99656ed114e534b87f3dd95a65ca4ca670baf2f", + "notices/PR426.md": "6a5593d0f284a2f0865037f5c5fa9e5f76f9e12cf50ec5284486d3b8137c89da", + "notices/SUSSMAN-NOTICE": "9419dd03a2f52cf8bdfc4d18216ce29f263ab583b27f01ced8e420985bcb7c81", + "proofs/INHERITED-COMPLEX-GEOMETRY.txt": "c1ff55536594222a8d2a30bc0e0956959774e1be2d5420b7838ad553ee556df2", + "proofs/PR386-BIT-GEOMETRY.txt": "c5f077b849e9add9957ab4ee36095dd47bc678dee7e09baa146dac4c0a0d66b2", + "proofs/PR425-COMPLEX.txt": "2cda27b9b9a1eb24127c38c2c7a6e085155a2472183e220189a3ea2c2b7720dc", + "proofs/PR426.md": "5787738ceb6faf14d3d96e8452592860a6c6a469733a9bcf196e8d1562ba1ffb", + "vendor/clifford_exact.py": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962", + "vendor/engines/base_two_moment.py": "aee70c242a2f1d225528fabe2002e1564d1dc884797c07d28a831c7878ee9098", + "vendor/engines/moment.py": "81cbc864e106418fc7854322746f72180cb8110ff39f74450a3b8d55a82c1482", + "vendor/engines/outer.py": "c1ebb52163a7219504c728a5c2b098bf1e50bf20148a2879c5a74c3cadc7c03c", + "vendor/export_records.py": "8a5999601f917dbb492bb9ae9a344611f18cc7cedc53dc3c76496a369e530eb3", + "vendor/hamming_packets.py": "daa9301e2767a711cfe66c6bebaad68e1a3bdb97ec9e848c927527ab43b37ae5", + "verify.py": "12fcdb20a87f75812b09c4916fbfc86305982cb410247186a123b5c58d517b4c" + } +} diff --git a/research/split-centres-global/NOTICE.md b/research/split-centres-global/NOTICE.md new file mode 100644 index 0000000000..b7daf8de49 --- /dev/null +++ b/research/split-centres-global/NOTICE.md @@ -0,0 +1,41 @@ +# Attribution + +Copyright 2026 icekylinx. New split-centre cancellation, reversible source-centre +composition, integration and verification changes were prepared by icekylinx +with substantial OpenAI Codex assistance. Apache-2.0 applies to these changes. +Earlier private Pro exploration used GPT-6 Astra; the new construction and +composition in this package were developed with Codex. + +## Direct sources + +- Zhihao Chen, with OpenAI Codex assistance: PR425's mutable-basis Hamming packet + producer, common-frame scalar interface, exact phase lowering and verification; + PR386's compressed nine-stage bit geometry, owner template, audit and finite + accounting. These supply the immediate complex and geometric baselines. +- ai-nanachi, with OpenAI Codex assistance: PR426's R767 bit word, including 55 + clean-reset helper reuses and 54 frame changes. The complete selected word is + imported unchanged before the nine source-centre replacements. +- Dylan Crow (utcorvusvolat-dotcom), with Anthropic Claude assistance: PR370's + Hamming E8 bit producer, root table, record exporter and local format. +- Jacob Sussman: the E8 family, complex unit and underlying interchange framework. +- applecrusher, Dugongue, eumemic, Rohan Arun, Chafik Boukhalfa, DaysSky, + DreamingOfClouds, Henry Grant, Evan McKinney, LJH-217 and other contributors: + the source, frame, compiler, rational-pricing and analytic lineage detailed + in the preserved original notices. + +The current value is computed from the two actual resulting programs. +Independently published improvements are not added numerically. `SOURCES.json` +records original commits and file hashes; `notices/` preserves source notices. +Files under `proofs/` describe their original packages and retain their original +scope and attribution; the current statement is in `PROOF.md`. + +## Earlier contributions by icekylinx + +The earlier #10, #18, #24, #32 and #36 contributions developed projector batching, +partial-swap frames, endpoint gauges and conditional analytic/tape integration. +The subsequent #104, #115, #130 and #144 contributions covered stopped-product +integration, partial gauges, three-stage covers and paired-cube/source chronology. +These provide historical context, not additional savings in this ledger. The +source-centre idea from the preceding local round is used here on PR426's bit +word. Unselected research experiments and superseded submission candidates are +not part of this package. diff --git a/research/split-centres-global/PROOF.md b/research/split-centres-global/PROOF.md new file mode 100644 index 0000000000..8366a89e36 --- /dev/null +++ b/research/split-centres-global/PROOF.md @@ -0,0 +1,184 @@ +# Split centres and a joint conditional exponent + +The finite construction gives + +$$ +T(n)=O\!\left(n(\log n)^{1-\kappa}\right), +\qquad \kappa=0.001120864952258278, +$$ + +conditional on the retained all-size compiler, compressed-window, correlated +bank-dirt, restored-work, fixed-tape/common-grid, precision and analytic +interfaces. The changes below concern both finite suppliers. Original source +proofs and notices are retained; they do not replace the changed checks. + +## 1. Cancel coordinate terms before lifting the complex decoder + +Partition the 120 Hamming E8 root lines into the 112 code lines C and the eight +coordinate lines F, represented by 2e_i. Write r_s for a root representative and +G_ts = r_t · r_s / 2. The parent decoder is the rank-eight centre factorization +G/2 together with its negative off-diagonal entries. + +For each code target t, the coordinate-source centre contribution is +r_ti x_(2e_i)/2. Its side contribution is its negative. Cancel this pair before +constructing the lifted program. For code targets retain only + +$$ +Z_i=\sum_{s\in C}r_{si}x_s, +\qquad +\sum_i\frac{r_{ti}}4Z_i +-\sum_{\substack{s\in C\\s\ne t}}\frac{G_{ts}}2x_s=x_t. +$$ + +For coordinate targets, implement the identity x_(2e_i) directly. Thus the +entire 120-by-120 clean decoder is still the identity, including both cross +blocks between C and F. + +In the parent's binary address realization, + +$$ +p_s\cdot p_t=1+G_{st}\pmod2. +$$ + +Every code source contributing to Z_i is orthogonal to p_(2e_i), because its +ith root coordinate is ±1. The already constructed global sum Z_i lies in that +rank-eight hyperplane. Copy it there, lower the private copy to frame zero with +one rank-eight child, and scatter into the code targets. The eight coordinate +identities copy their source lines with one rank-one child each. Each private +copy has a sequential lifetime, and is erased before the next episode. + +The total copied rank is unchanged: + +$$ +8\cdot8+8\cdot1=72. +$$ + +The 112 coordinate-source helpers and eight dedicated full-centre helpers are +removed. Own-block corrections use their original source-copy rows directly; +all remaining signed packets and selected target butterflies are retained. +The actual helper count is 560. No rank-four recovered row is substituted for +a rank-three input. + +## 2. Arbitrary dirt and heterogeneous copy frames + +The explicit main word has block form z' = Uz and y' = Vy + x + Ks, where +z=(x,s), and U,V are invertible. No target feeds z. At the common initial frame, +apply V^-1 to the target basis and the literal correction -V^-1 Ks. Recompute K +from the new word. After all main gates and final climbs, apply the literal +inverse of the source/helper subword at the common full frame. This restores +all sources and arbitrary helpers while adding x to y. + +The parent common-frame proof applies to each copy separately. A private copy +created at label L(F) is lowered by the exact operator L(0)L(F)^-1, whether F +has rank one or eight. Scalar operations occur only at equal labels. Adding +the common exterior window to both labels cancels it exactly. The proof +therefore does not require a full-frame centre, or infer an operator from rank +alone. The inverse-transpose negates/transposes each scalar shear in the same +order and reverses each private gather/child/scatter operation as emitted. + +Both scalar orientations and the serialized private-work programs replay all +800 input columns. Both restore arbitrary source/helper inputs and erase private +work. The changed exact Gaussian recipes include the heterogeneous centre +transitions and their global phases. Of 2,918 selected directed pairs, 248 were +newly computed; 2,670 were unchanged source-bound exact pairs already checked in +the local phase run. The release optionally replays all selected pairs. + +The local paid profile is + +$$ +\{1:1912,\ 2:784,\ 3:168,\ 4:224,\ 5:392,\ 8:24\}. +$$ + +The compressed complex geometry uses m=73, eight replicas and nine stages. +There are 560 banks per stage, each holding eight whole rank-nine residuals and +one paid rank-one pad. Live width is 12,720; physical stock is 13,298, including +16 centre slots, the conservative 560-row tableau reserve and two coefficient +streams. The global rank deficit is 2,496. Explicit owner tables, padding, +terminal translations and the cover correction are independently decoded. +The largest child is 48; 73² > 2·48² gives two-level halving. + +The fresh invoice fits the retained 2^30000 router, 2^100000 literal and 2^210000 +precision reserves. Two exact rational engines certify + +$$ +b=0.001183986549206329. +$$ + +## 3. Source-centre bit composition + +Start with the exact R767 word from PR426. Its nine retained rows are written +only by original sources at the full frame and are not read by ordinary A/B +gates. Their nine independent binary forms have an invertible minor in source +columns 0,1,2,4,8,9,16,32,64. + +Replace those rows of the 120-dimensional identity by the nine retained forms. +Exact elimination produces an invertible source basis T, emitted as 559 XOR +additions. Delete the nine retained helper rows and their old-dirt columns. +After A apply T, perform the same nine sequential copies using the designated +source rows, and immediately apply T^-1 before B. The copies have unchanged +rank eight. All scalar operations of T and its inverse use the full frame. + +All 998 columns, arbitrary dirt, frame incidences and restoration pass. Omitting +T^-1 or the remaining old-dirt correction fails. The actual exported record +stream is reflected in reverse order with complementary frames. A reflected +ERASE becomes a fresh COPY at that chronological point; the original source +row remains unchanged within each copy episode. Both reflected programs and +all nine composed invocations are replayed, rather than assuming that mutable +source rows meet an old immutability restriction. + +Use the unchanged compressed bit windows in dimension 64: a local eight-space +and eight exterior seven-spaces. The root data, rational frame family, form, +port isometries and bank slots are source-bound to PR386. Every changed nested +pair is checked by exact rational spans; positive definiteness gives the +projector identity and its reflected version. There are 758 banks per stage, +each filled by eight rank-eight residuals, with no padding. Live width is 14,502 +and physical stock is 14,511. All 54,576 owner assignments are checked. The +unbanked global replay restores all 7,782 independent columns. + +The bit local profile is + +$$ +\{1:2367,\ 2:875,\ 3:475,\ 4:321,\ 5:164,\ 7:14,\ 8:9\}. +$$ + +Its global deficit is again 2,496. The maximum child is 42 and 64² > 2·42². +The actual cancellation-free prefix bound needs 223 bits; the new charge is +256 bits, replacing the parent's 192-bit allowance. The finite two-level +coefficient needs 483 bits and fits the retained 2^512 allowance. The row +coefficient is 18,355 < 20,161. These costs, including the basis operations, +are recomputed from the emitted word. Two exact rational moment engines give + +$$ +c=0.001122122700265139220566. +$$ + +## 4. Joint strict assembly + +Both moments include the inherited 10^-16 bad-branch allowance. The bit supplier +binds because c < b. Let eta=beta=10^-18 and + +$$ +s=\min\{c,(1-\beta)b\}-10^{-24}. +$$ + +Starting at a_0=384599/10^10, use six fixed ordinary bootstrap levels + +$$ +a_{j+1}=(1-s)s+sa_j. +$$ + +All bootstrap cutoff inequalities are checked with the actual charged finite +coefficient. With q=a_6(1-2eta), choose the greatest 10^-18 grid point strictly +below (1-eta)q/(1+q). It is + +$$ +\kappa=\frac{560432476129139}{500000000000000000} + =0.001120864952258278. +$$ + +All 47 retained strict outer inequalities pass. The next grid point, zero eta, +zero beta and unit beta are rejected. The candidate is computed from both +actual new templates; no independently reported savings are added together. + +The source-bound finite claims above do not discharge the inherited all-size +interfaces or establish unconditional integer-multiplication complexity. diff --git a/research/split-centres-global/README.md b/research/split-centres-global/README.md new file mode 100644 index 0000000000..1e31463921 --- /dev/null +++ b/research/split-centres-global/README.md @@ -0,0 +1,56 @@ +# Conditional κ = 0.001120864952258278 + +This package combines a split-centre Hamming complex construction with a +source-centre bit construction in compressed nine-stage windows. The resulting +conditional exponent saving is + +$$ +\kappa=\frac{560432476129139}{500000000000000000} + =0.001120864952258278. +$$ + +This is approximately **6.9522% above PR425**. Both components change: + +| Component | Helpers | Ambient width | Certified saving | +|---|---:|---:|---:| +| Complex | 560 | 73 | 0.001183986549206329 | +| Bit | 758 | 64 | 0.001122122700265139220566 | + +The bit component limits the final assembly. The complex construction removes +coordinate contributions that cancel in the decoder, replacing eight full +centres with eight rank-eight and eight rank-one copies. The bit construction +starts from PR426's R767 word, computes its nine retained forms reversibly in +source rows, and uses PR386's compressed windows. + +## Verification + +Python 3.11+ and its standard library suffice. Use a new output directory: + +```sh +python3 -B research/split-centres-global/verify.py /tmp/split-centres-check +``` + +The default replays both changed words, reflected/inverse-transpose programs, +bank ownership, costs, two rational moment engines and 47 strict outer +inequalities. Exact complex phase evidence is reused only when the regenerated +canonical word and complete recipe hashes match. To regenerate every selected +Gaussian phase pair as well: + +```sh +python3 -B research/split-centres-global/verify.py /tmp/split-centres-full-phases --replay-phases +``` + +The unchanged historical repository suite and PDF build are not required by +this package. `EXPECTED.json` binds the result to both emitted global templates; +`MANIFEST.json` binds the package files; `SOURCES.json` pins imported sources. + +## Scope + +[PROOF.md](PROOF.md) supplies the changed finite construction. The all-size +compressed-window and correlated dirty-bank semantics, recursive compiler, +restored-work/tape/common-grid precision, and analytic transfer interfaces remain +conditional. This does not claim unchanged legacy gx/gxcore acceptance, a new +Lean proof, or an unconditional multiplication theorem. + +Contributor history and AI assistance are recorded in [NOTICE.md](NOTICE.md). +Original notices and the inherited proofs are retained separately. diff --git a/research/split-centres-global/SOURCES.json b/research/split-centres-global/SOURCES.json new file mode 100644 index 0000000000..215f58a649 --- /dev/null +++ b/research/split-centres-global/SOURCES.json @@ -0,0 +1,134 @@ +{ + "upstream_base": "12a4934d15006e8c10f9b2264f13f8f341be802b", + "pr425": "e11ccea1d092beb1b01b4ee4ce49da478234254c", + "pr426": "88d552526893cd15325948bb1487e9a4d4bf32f6", + "imported_files": [ + { + "path": "vendor/hamming_packets.py", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-network/hamming_packets.py", + "sha256": "daa9301e2767a711cfe66c6bebaad68e1a3bdb97ec9e848c927527ab43b37ae5" + }, + { + "path": "vendor/clifford_exact.py", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/odd-stages/clifford_exact.py", + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962" + }, + { + "path": "inputs/complex-ports.json.gz", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/higher-stage-e8/verified/gcert1-e8-retimed.json.gz", + "sha256": "77b0c0fa19ef3da1c7316010e13493aa5eea1a50c3506eddc08f7480e659878b" + }, + { + "path": "inputs/complex-template.json.gz", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-nine-native/GLOBAL-TEMPLATE.json.gz", + "sha256": "1b84904a31a733aab9bfdda3f528c06719f590d2133a43687a8bded955dc991e" + }, + { + "path": "inputs/complex-data-phases.json.gz", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-nine-native/DATA-PHASES.json", + "sha256": "c972b5b60649c2a52354f5160f69adc0f4a270fa09d32012beff9888774ab84f", + "source_sha256": "f621f6d4296cb215f334830356c5f79fe10d6d04d15b3ccda76ba0885ab67d0a", + "encoding": "gzip; decoded bytes identical to source" + }, + { + "path": "inputs/e8-r865.json.gz", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/pr370-source/research/e8-bit/data/bit/bitE8-r865.json.gz", + "sha256": "1fb726ea3818fe0837cceb0dd22a71a0814f064e5e781628104610d6468e0e55" + }, + { + "path": "proofs/PR425-COMPLEX.txt", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-network/hamming/PROOF.txt", + "sha256": "2cda27b9b9a1eb24127c38c2c7a6e085155a2472183e220189a3ea2c2b7720dc" + }, + { + "path": "proofs/INHERITED-COMPLEX-GEOMETRY.txt", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-nine-native/PROOF.txt", + "sha256": "c1ff55536594222a8d2a30bc0e0956959774e1be2d5420b7838ad553ee556df2" + }, + { + "path": "vendor/engines/moment.py", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/pr361/code/engines/moment.py", + "sha256": "81cbc864e106418fc7854322746f72180cb8110ff39f74450a3b8d55a82c1482" + }, + { + "path": "vendor/engines/base_two_moment.py", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/pr361/code/engines/base_two_moment.py", + "sha256": "aee70c242a2f1d225528fabe2002e1564d1dc884797c07d28a831c7878ee9098" + }, + { + "path": "vendor/engines/outer.py", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/pr361/code/engines/outer.py", + "sha256": "c1ebb52163a7219504c728a5c2b098bf1e50bf20148a2879c5a74c3cadc7c03c" + }, + { + "path": "vendor/export_records.py", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/e8-bit/code/bit/export_records.py", + "sha256": "8a5999601f917dbb492bb9ae9a344611f18cc7cedc53dc3c76496a369e530eb3" + }, + { + "path": "inputs/bit-geometry.json.gz", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/e8-bit-complex-nine-validation/GEOMETRY.json.gz", + "sha256": "5c980202227859e8bb9b863f94503930c2a59d460c0421356688e2b0d828b4a1" + }, + { + "path": "proofs/PR386-BIT-GEOMETRY.txt", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/e8-bit-complex-nine/PROOF.txt", + "sha256": "c5f077b849e9add9957ab4ee36095dd47bc678dee7e09baa146dac4c0a0d66b2" + }, + { + "path": "notices/PR386.txt", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/e8-bit-complex-nine/NOTICE.txt", + "sha256": "ae2241615a23063b18a04f1b7a88a52e62b3d7d42e333fbd21e3668567ab83d1" + }, + { + "path": "inputs/bit-r767.json.gz", + "source": "CrocSwap/integer-mult-bounds@88d552526893cd15325948bb1487e9a4d4bf32f6:research/e8-clean-reuse-extension/data/bit-candidate.json.gz", + "sha256": "bd3b84244528767b85d8d7fe423b155630b5c659e21e51563674b1dcb6305ad7" + }, + { + "path": "notices/PR426.md", + "source": "CrocSwap/integer-mult-bounds@88d552526893cd15325948bb1487e9a4d4bf32f6:research/e8-clean-reuse-extension/NOTICE.md", + "sha256": "6a5593d0f284a2f0865037f5c5fa9e5f76f9e12cf50ec5284486d3b8137c89da" + }, + { + "path": "proofs/PR426.md", + "source": "CrocSwap/integer-mult-bounds@88d552526893cd15325948bb1487e9a4d4bf32f6:research/e8-clean-reuse-extension/PROOF.md", + "sha256": "5787738ceb6faf14d3d96e8452592860a6c6a469733a9bcf196e8d1562ba1ffb" + }, + { + "path": "notices/PR426-SOURCE-PINS.json", + "source": "CrocSwap/integer-mult-bounds@88d552526893cd15325948bb1487e9a4d4bf32f6:research/e8-clean-reuse-extension/SOURCE-PINS.json", + "sha256": "18ace817f2f9af22511bb303e99656ed114e534b87f3dd95a65ca4ca670baf2f" + }, + { + "path": "notices/NOTICE-PR352.md", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/pr370-source/research/e8-bit/NOTICE-PR352.md", + "sha256": "967e6d7e76e216e4898cf543c75b527e8d397ec1ddba3800cb20701f24c89524" + }, + { + "path": "notices/NOTICE.md", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/pr370-source/research/e8-bit/NOTICE.md", + "sha256": "025773f32fb43667395e64c627a1752877bdc93afbfe01b106703eee438d21d3" + }, + { + "path": "LICENSE", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/pr370-source/research/e8-bit/LICENSE", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + }, + { + "path": "notices/SUSSMAN-NOTICE", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/e8-bit/code/complex/inputs/complex/NOTICE", + "sha256": "9419dd03a2f52cf8bdfc4d18216ce29f263ab583b27f01ced8e420985bcb7c81" + } + ], + "adapted_sources": { + "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-network/hamming_full.py": "613796df039dfc08de708831582533e553316eaf157485531e4df2d897bdb3bb", + "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-network/audit_full.py": "fdc1da8fa95716d60076383e691a5be1bf8bec0b229b7582bc056afac28951d0", + "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-network/integrate.py": "eb5b427f2095578f28a1fb320b4694047e20abdbe0c8bcdc65b1e9e05ab90d01", + "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-network/phase_full.py": "5c2bd267cc3106c9eee8787132c460614fdde8177c0c2653435f8a7b110ebac1", + "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-network/replay_ir.py": "f7a3829118581ee59fdeefc1f91166d8e7bb94686ea92e7743a2ef7d50139dcc", + "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/e8-bit-complex-nine/global_word.py": "2c438be46213e014170e607a745185e45e33c7b7240b833efc86a2330de0d1f6", + "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/e8-bit-complex-nine/audit.py": "75811327b0d6cbd56aae8e28d72abd42d57c7f3f3630781d045efee2d36446e9", + "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/e8-bit-complex-nine/certify.py": "550b1408fb3a581dd6b82c90e3f84ad7a9f78746d2be11ffa1cf543d719ae2d4" + } +} diff --git a/research/split-centres-global/VALIDATION.json b/research/split-centres-global/VALIDATION.json new file mode 100644 index 0000000000..70b00c0bc7 --- /dev/null +++ b/research/split-centres-global/VALIDATION.json @@ -0,0 +1,39 @@ +{ + "status": "PASS_CLEAN_DIRECTORY_INCREMENTAL_REPLAY", + "python": "3.14", + "tested_code_vendor_input_digest": "c15599626c4222a95ddb4f0a9da028cfce5c8636c7a737d6869155c2f33301ed", + "steps": [ + "hamming_packets", + "complex_construct", + "complex_audit", + "complex_emit", + "complex_phases", + "bit_construct", + "bit_export", + "bit_global", + "bit_audit", + "bit_price", + "complex_integrate", + "complex_replay", + "combined" + ], + "phase_mode": "source-bound unchanged evidence", + "new_complex_phase_pairs": 248, + "reused_verified_complex_phase_pairs": 2670, + "source_bound_bit_geometry": "PR386; exact unchanged root/frame/port/slot identities", + "historical_full_suite_rerun": false, + "pdf_built": false, + "ci_status": "Not yet run for this commit", + "post_replay_packaging": "Phase JSON gzip round-trip matched the verified decoded bytes; mathematical code and witnesses unchanged.", + "portability_validation": { + "python": "3.11.17", + "status": "PASS_ALL_PACKAGE_STEPS_AND_UNCHANGED_EXPECTED_RESULT", + "cause": "gzip OS header differs from Python 3.14; exact decoded canonical bytes agree", + "phase_binding": "SHA256 of exact decompressed bytes; current archive hash remains bound in downstream receipts", + "negative_control": "A modified canonical witness is rejected", + "python314_incremental": "Changed phase-binding step passed against the previously validated output", + "historical_full_suite_rerun": false + }, + "portability_code_vendor_input_digest": "a2534c803ecb3afb25662517ad542c1b05869046ced4ac78250625b1707014e4", + "portability_digest_format": "SHA256 of compact sorted JSON mapping package-relative code/vendor/inputs paths to file SHA256" +} diff --git a/research/split-centres-global/code/bit_audit.py b/research/split-centres-global/code/bit_audit.py new file mode 100644 index 0000000000..82e1663e58 --- /dev/null +++ b/research/split-centres-global/code/bit_audit.py @@ -0,0 +1,126 @@ +# Adapted with exact rational span checks by icekylinx; Codex assistance. +"""Independent audit of the emitted bit template, including mutation controls. +Prepared by Zhihao Chen with OpenAI Codex assistance; Apache-2.0. +""" +import argparse, copy, gzip, hashlib, json, struct, time +from collections import Counter, defaultdict +from pathlib import Path +from fractions import Fraction as Q + +def sha(p): return hashlib.sha256(p.read_bytes()).hexdigest() + +def main(): + ap=argparse.ArgumentParser(); ap.add_argument('--local-check',type=Path,required=True); ap.add_argument('--out',type=Path,required=True) + a=ap.parse_args(); start=time.monotonic(); out=a.out + blob=gzip.decompress((out/'GLOBAL-TEMPLATE.json.gz').read_bytes()); t=json.loads(blob) + g=json.loads((out/'GLOBAL.json').read_text()); geo=json.loads((out/'GEOMETRY.json').read_text()) + assert hashlib.sha256(blob).hexdigest()==g['template_sha256'] + assert t['geometry_sha256']==sha(out/'GEOMETRY.json') and t['source_record_sha256']==sha(a.local_check/'records/249-records.bin') + fs=json.loads((a.local_check/'records/frames.json').read_text())['frames'] + records=list(struct.iter_unpack('<6i',(a.local_check/'records/249-records.bin').read_bytes())) + word=json.loads((a.local_check/'bit-source-centres.json').read_text()) + assert g['word_sha256']==sha(a.local_check/'bit-source-centres.json') + def rank(rows): + piv={} + for rr in rows: + row=list(map(Q,rr)) + for k,b in sorted(piv.items()): + q=row[k] + if q:row=[x-q*y for x,y in zip(row,b)] + k=next((j for j,x in enumerate(row) if x),None) + if k is not None: + q=row[k];piv[k]=[x/q for x in row] + return len(piv) + dimensions={};proj={} + for key,f in fs.items(): + k=int(key);B=f['B'];roots=[word['lines'][j] for j in word['frames'][k]] + assert rank(B)==f['dim']==rank(B+roots)==rank(roots) + dimensions[k]=f['dim'];proj[k]=B + sets=[set(f) for f in word['frames']];pairs={} + for op,x,y,c,r,z in records: + if op==0: + assert sets[y]<=sets[c] and dimensions[c]-dimensions[y]==r + pairs[y,c]=r + # Positive definite rational form: exact inclusion implies commuting + # orthogonal projectors and rank(P_V-P_U)=dim(V)-dim(U), also in reflection. + assert len(proj)==944 + expected={} + for rev in (False,True): + es=[] + for op,x,y,c,f,z in (reversed(records) if rev else records): + if op==0: es.append([0,x,c if rev else y,y if rev else c,f,int(rev)]) + elif op==1: es.append([1,x,y,-c if rev else c,f,int(rev)]) + elif op==(3 if rev else 2): es.append([2,x,y,c,f,abs(dimensions[c]-dimensions[f]),int(rev)]) + else: es.append([3,x,y,c,f,z,int(rev)]) + expected['reverse' if rev else 'forward']=es + assert t['local_programs']==expected + + def validate(q,check_profile=True): + assert (q['m'],q['live'],q['replicas'],q['stages'])==(64,14502,8,9) + assert q['bank_padding'] is None and q['local_programs']==expected + hist=Counter(); occupation=defaultdict(set); calls=set() + for c in q['calls']: + st,rep,p=c['stage'],c['replica'],c['pair']; rev=c['orientation']=='reverse' + assert 0<=st<9 and 0<=rep<8 and p==max(0,(st-1)//2) + assert rev==(st in (1,3,5,7)) and (st,rep) not in calls; calls.add((st,rep)) + own=c['owners']; assert len(own)==998 + assert len({(f,tuple(r)) for f,r in own})==998 + for i,(family,route) in enumerate(own): + assert 0<=family<14502 + if i<240: + side=i//120; side=1-side if rev else side + assert family==rep*960+(2*p+side)*120+i%120 and route==['data',st,i%120] + else: + j=i-240; bank,slot=divmod(rep*758+j,8) + assert family==7680+st*758+bank and route==['bank',slot] + assert slot not in occupation[family]; occupation[family].add(slot) + for e in q['local_programs'][c['orientation']]: + if e[0]==0 and e[4]: hist[e[4]]+=1 + if e[0]==2: hist[e[5]]+=1 + assert calls=={(s,r) for s in range(9) for r in range(8)} + assert set(occupation)==set(range(7680,14502)) and all(s==set(range(8)) for s in occupation.values()) + levels=[-1]*4; scalar=[1<> p & 1: + row ^= q + assert row, 'Retained forms must be independent' + p = (row & -row).bit_length() - 1 + echelon[p] = row + pivots = sorted(echelon) + matrix = [1 << i for i in range(v)] + for p, row in zip(pivots, rows): + matrix[p] = row + target = matrix[:] + elimination = [] + def add(d, s): + matrix[d] ^= matrix[s] + elimination.append((d, s)) + for p in range(v): + q = next(i for i in range(p, v) if matrix[i] >> p & 1) + if q != p: + add(p, q); add(q, p); add(p, q) + for i in range(v): + if i != p and matrix[i] >> p & 1: + add(i, p) + assert matrix == [1 << i for i in range(v)] + forward = [[full, d, [s]] for d, s in reversed(elimination)] + inverse = list(reversed(forward)) + check = [1 << i for i in range(v)] + for f, d, ss in forward: + check[d] ^= check[ss[0]] + assert check == target + out = copy.deepcopy(old) + physical = [i for i in range(2*v+old['R']) if i not in retired] + index = {r: i for i, r in enumerate(physical)} + def remap(gs): + return [[f, index[d], [index[s] for s in ss if s not in retired]] + for f, d, ss in gs if d not in retired] + out['R'] -= len(retired) + out['ret'] = pivots + out['D'] = remap(old['D']) + out['A'] = remap(old['A']) + forward + out['B'] = inverse + remap(old['B']) + out['C'] = remap(old['C']) + out['start'] = [old['start'][i] for i in physical] + out['final'] = [old['final'][i] for i in physical] + out['source_basis_gates'] = len(forward) + assert replay(out), 'All independent source, target and dirty columns' + assert not replay(out, skip_inverse=True) + assert not replay(out, skip_dirt=True) + # Frame incidence inclusion uses the root-closed sets in this bit format. + frames = [set(f) for f in out['frames']] + cur = out['start'][:] + for phase in ['D', 'A', 'B', 'C']: + for f, d, ss in out[phase]: + for r in [d] + ss: + assert frames[cur[r]] <= frames[f], (phase, r, cur[r], f) + cur[r] = f + if phase == 'A': + assert all(cur[r] == full for r in out['ret']) + assert all(frames[f] <= frames[g] for f, g in zip(cur, out['final'])) + raw = json.dumps(out, sort_keys=True, separators=(',', ':')).encode() + (ROOT / 'bit-source-centres.json').write_bytes(raw) + result = dict(status='PASS_LOCAL_ALL_COLUMNS_AND_NESTED_FRAMES', + original_R=old['R'], new_R=out['R'], + removed_retained_helpers=sorted(retired), retained_source_rows=pivots, + formal_columns=2*v+out['R'], reversible_basis_gates_each_way=len(forward), + source_sha256=sha256(source.read_bytes()).hexdigest(), + output_sha256=sha256(raw).hexdigest(), + controls=['unmodified word passes', 'missing inverse rejected', 'missing dirt rejected'], + kappa_claimed=False, + remaining=['global ordinary-call and reflected integration', 'finite coefficient and tape invoice', 'exact priced component comparison']) + (ROOT / 'bit-source-centres-receipt.json').write_text(json.dumps(result, indent=2)+'\n') + print(json.dumps(result)) + + +if __name__ == '__main__': + main() diff --git a/research/split-centres-global/code/bit_global.py b/research/split-centres-global/code/bit_global.py new file mode 100644 index 0000000000..5ccf622825 --- /dev/null +++ b/research/split-centres-global/code/bit_global.py @@ -0,0 +1,226 @@ +# Adapted for the PR426/source-centre composition by icekylinx with Codex assistance. +"""Source-bound compressed nine-stage bit template and exact scalar audits. + +Prepared by Zhihao Chen with OpenAI Codex assistance, Apache-2.0. +The local E8 bit word is Dylan Crow's pinned PR #370 contribution. +""" +import argparse, gzip, hashlib, json, struct, time +from collections import Counter +from pathlib import Path + +H,V,R,L,K,T,M=8,120,758,9,4,8,64 +LOCAL=2*V+R; DATA=2*K*V*T; LIVE=DATA+L*R +def sha(p): return hashlib.sha256(p.read_bytes()).hexdigest() +def write(p,x): p.write_text(json.dumps(x,indent=2)+'\n') + +def recipe(): + out=[dict(kind='local',stage=0,pair=0,reverse=False)]; stage=1 + for j in range(K): + out.append(dict(kind='local',stage=stage,pair=j,reverse=True)); stage+=1 + if j=0 + cur[x]=newf + if f: hist[f]+=1 + events.append([0,x,oldf,newf,f,int(reverse)]) + elif op==1: + assert cur[x]==cur[y]==f and x!=y and x0 + cutoff=max(ceil(36/gap**2),ceil(2*(4+512)/gap)) + assert cutoff*gap**2>=36 and cutoff*gap>=2*(4+512) + cutoffs.append(dict(gap=str(gap),cutoff_log2=str(cutoff)));chain.append(a) +q=chain[-1]*(1-2*eta);margin=(1-eta)*q/(1+q);ticks=margin/grid;k=grid*((ticks.numerator-1)//ticks.denominator) +bridge={'semantic':{'C0':{'base':2,'exponent':210000},'strict_literal_gap':1},'rows':{'degree_gap':Q(10**6)-Q(51*20161,25)}} +a=Outer.assembly(chain[-1],b,bridge,k,eta=eta,beta=beta) +assert len(a['strict_constraints'])==47 and all(x>0 for x in a['strict_constraints'].values()) +controls=[] +for name,kk,ee,bb in [('next_grid',k+grid,eta,beta),('zero_eta',k,Q(0),beta),('zero_beta',k,eta,Q(0)),('unit_beta',k,eta,Q(1))]: + try:Outer.assembly(chain[-1],b,bridge,kk,eta=ee,beta=bb) + except AssertionError:controls.append(name) + else:raise AssertionError(name) +result=dict(status='PASS_CONDITIONAL_SPLIT_CENTRE_ASSEMBLY',kappa=str(k),kappa_decimal=format(float(k),'.18f'),bit_lower=str(c),complex_lower=str(b),binding_component='bit',gain_over_pr425_percent=float(100*(k/Q(1048005508028206,10**18)-1)),bit_invoice=dict(prefix_bits=prefix.bit_length(),charged_prefix_bits=256,coefficient_bits=coefficient.bit_length(),two_level_coefficient_bits=two.bit_length(),charged_two_level_coefficient_bits=512,row_coefficient=row,live=W,physical=physical),strict_outer_constraints={n:str(x) for n,x in a['strict_constraints'].items()},outer_controls=controls,bootstrap=cutoffs,bit_template_sha256=g['template_sha256'],complex_template_sha256=cx['global_template_sha256'],scope='Finite research composition with explicit changed words, exact local and global replay and incremental phase evidence. All-size correlated dirty-bank, compressed-window, compiler, restored-work, tape/common-grid, precision and analytic interfaces remain inherited assumptions. This certificate makes no unconditional integer-multiplication or Lean-kernel claim.') +(ROOT/'RESULT.json').write_text(json.dumps(result,indent=2)+'\n') +print(result['status'],result['kappa_decimal'],result['gain_over_pr425_percent'],result['bit_invoice']) diff --git a/research/split-centres-global/code/complex_audit.py b/research/split-centres-global/code/complex_audit.py new file mode 100644 index 0000000000..ba6789a3a6 --- /dev/null +++ b/research/split-centres-global/code/complex_audit.py @@ -0,0 +1,168 @@ +# Modified from PR425 by icekylinx with Codex assistance. +"""Read-back audit, independent of the Hamming producer and its row state.""" +import copy,gzip,hashlib,importlib.util,json,math,time +from collections import Counter +from fractions import Fraction as Q +from pathlib import Path + +OUT=Path('split-centres');p=OUT/'FULL-WORD.json.gz' +word=json.load(gzip.open(p));v=120;n=240+word['report']['R'];start=time.monotonic() +def apply(e,rows): + if e[0]=='scale': + _,t,a,b,*_=e;q=Q(a,b);assert q + rows[t]={j:q*x for j,x in rows[t].items()} + else: + _,t,s,a,b,*_=e;q=Q(a,b);assert t!=s + for j,x in list(rows[s].items()): + z=rows[t].get(j,Q(0))+q*x + if z:rows[t][j]=z + else:rows[t].pop(j,None) +def ident():return [{r:Q(1)} for r in range(n)] +def inv(e): + e=copy.deepcopy(e) + if e[0]=='add':e[3]*=-1 + else:e[2],e[3]=e[3],e[2] + return e +def dual(e): + e=inv(e) + if e[0]=='add':e[1],e[2]=e[2],e[1] + return e + +main=word['A']+word['cut']+word['B'] +assert all(not 120<=e[2]<240 for e in word['A']+word['B'] if e[0]=='add' and not 120<=e[1]<240) +matrix=ident() +for e in main:apply(e,matrix) +print('full main columns',n,'replayed',flush=True) +# Compute -A_Y^-1 B_S using only rows of the explicit main operator. +dirty=[{} for r in range(n)] +for r in range(v,2*v):dirty[r]={j:x for j,x in matrix[r].items() if j>=2*v} +for e in word['precondition']:apply(e,dirty) +comp=[] +for r in range(v,2*v): + for j,q in sorted(dirty[r].items()):comp.append(['add',r,j,-q.numerator,q.denominator,[]]) + +cleanup=[inv(e) for e in reversed(word['A']+word['B']) if not v<=e[1]<2*v] +assert [e[:-1] for e in cleanup]==[e[:-1] for e in word['cleanup']] +program=word['precondition']+comp+main+cleanup +actual=ident() +for e in program:apply(e,actual) +expected=ident() +for t in range(v):expected[v+t][t]=Q(1) +assert actual==expected +print('PASS exact arbitrary dirt and restored sources/helpers',flush=True) +back=ident() +for e in program:apply(dual(e),back) +expected_back=ident() +for t in range(v):expected_back[t][v+t]=Q(-1) +assert back==expected_back +print('PASS exact inverse-transpose on every column',flush=True) +# Independent sparse vector controls avoid repeating a dense full replay. +def vector(es,x): + x=list(map(Q,x)) + for e in es: + if e[0]=='scale':x[e[1]]*=Q(e[2],e[3]) + else:x[e[1]]+=Q(e[3],e[4])*x[e[2]] + return x +sample=[((i*137+13)%101)-50 for i in range(n)] +want=vector(program,sample) +controls={ + 'missing_dirty_compensation':word['precondition']+main+cleanup, + 'missing_Y_inverse_basis':comp+main+cleanup, + 'missing_source_cleanup':word['precondition']+comp+main, + 'wrong_dual_event_order':[dual(e) for e in reversed(program)], +} +for name,es in controls.items(): + expected_sample=vector([dual(e) for e in program],sample) if name=='wrong_dual_event_order' else want + assert vector(es,sample)!=expected_sample,name + +# Orthogonal transvection and a port permutation bring the new geometry onto +# the already fixed 120-port routing family. Every incidence is transformed. +old=json.load(gzip.open('work/higher-stage-e8/verified/gcert1-e8-retimed.json.gz')) +def tau(x):return x^(43 if (x&43).bit_count()%2 else 0) +assert 43 .bit_count()%2==0 +assert set(map(tau,word['ports']))==set(old['ports']) +mapping={i:old['ports'].index(tau(q)) for i,q in enumerate(word['ports'])} +mapping.update({v+i:v+mapping[i] for i in range(v)}) +mapping.update({r:r for r in range(2*v,n)}) +def basis(vs): + b={} + for x in vs: + for k in sorted(b,reverse=True): + if x>>k&1:x^=b[k] + if x: + k=x.bit_length()-1 + for j in b: + if b[j]>>k&1:b[j]^=x + b[k]=x + return tuple(b[k] for k in sorted(b,reverse=True)) +def perp(x):return basis([z for z in range(1,512) if not (x&z).bit_count()%2]) +full=tuple(1<0 + edges.add((old,f));paid[delta]+=1;cur[r]=f +for part in ('A','B'): + if part=='B': + assert all(cur[r]==f for r,f in zip(can['centers'],can['center_frames'])) + assert all(cur[r]==0 for r in range(v,2*v)) + for f in can['center_frames']:paid[len(frames[f])]+=1 + for e in can[part]: + rs=[e[1]]+([e[2]] if e[0]=='add' else []) + for r in rs:climb(r,e[-1]);incidences+=1 +for r,f in enumerate(can['final']):climb(r,f) +assert dict(paid)=={int(r):x for r,x in word['report']['local_profile'].items()} +assert sum(r*x for r,x in paid.items())==9*can['R']+240*8+72 +can['local_profile']=dict(sorted(paid.items()));can['edges']=sorted(edges) +cp=OUT/'CANONICAL-WORD.json.gz';cp.write_bytes(gzip.compress(json.dumps(can,sort_keys=True,separators=(',',':')).encode(),mtime=0)) + +def engine(name): + p=Path('work/pr361/code/engines')/(name+'.py');s=importlib.util.spec_from_file_location('hamming_'+name,p) + m=importlib.util.module_from_spec(s);s.loader.exec_module(m);return m +M,M2=engine('moment'),engine('base_two_moment');m,W=73,12720 +HG={int(r):z for r,z in word['report']['global_profile'].items()} +root=M.certify(HG,m,W,True);b=Q(int(Q(root['lower'])*10**18),10**18);grid=Q(1,10**18) +assert M.moment(HG,m,W,b,True)[1]<1>p&1:x^=b[p] + if x: + p=x.bit_length()-1 + for q in b: + if b[q]>>p&1:b[q]^=x + b[p]=x + return tuple(b[p] for p in sorted(b,reverse=True)) +def inside(a,b):return basis(a+b)==b +def hyper(p):return basis([x for x in range(1,512) if (x&p).bit_count()%2==0]) +FULL=basis([1<>p&1:x^=b[p] + if x: + p=x.bit_length()-1 + for q in b: + if b[q]>>p&1:b[q]^=x + b[p]=x + return tuple(b[p] for p in sorted(b,reverse=True)) +def dual(e): + e=list(e) + if e[0]=='add':e[1],e[2]=e[2],e[1];e[3]*=-1 + else:e[2],e[3]=e[3],e[2] + return e +def scalar(e,back): + e=dual(e) if back else list(e) + if e[0]=='add':return ['add',['L',e[1]],['L',e[2]],e[3],e[4]] + return ['scale',['L',e[1]],e[2],e[3]] +def primitive_bound(e): + if e[0] in ('clear','copy'):return 1 + q=Q(e[3],e[4]) if e[0]=='add' else Q(e[2],e[3]) + a,b=abs(q.numerator),q.denominator + assert b&(b-1)==0 + if e[0]=='scale': + assert a&(a-1)==0 + return abs(a.bit_length()-b.bit_length())+int(q<0) + # Exact binary Horner multiplication on a cleared private stream, repeated + # halving, signed accumulation into the target, then clear the private stream. + return 3+(a.bit_length()-1)+a.bit_count()+(b.bit_length()-1) + +def emit(back): + out=[];cur=c['start'].copy() + def event(e):out.append(e) + def scal(e,f):event(['scalar',e,f]) + event(['phase','zero_frame_precondition']) + for e in c['precondition']+c['compensation']: + regs=[e[1]]+([e[2]] if e[0]=='add' else []) + assert all(c['start'][r]==0 for r in regs) + scal(scalar(e,back),0) + event(['phase','entry_adapters']) + for r,f in enumerate(c['start']):event(['adapter','old_to_new',r,f]) + def climb(r,f,part): + old=cur[r] + if old==f:return + assert basis(frames[old]+frames[f])==tuple(frames[f]) + rank=len(frames[f])-len(frames[old]);assert rank>0 + event(['climb',part,r,old,f,rank]);cur[r]=f + for part in ('A','centers','B','final'): + event(['phase',part]) + if part in ('A','B'): + for e in c[part]: + regs=[e[1]]+([e[2]] if e[0]=='add' else []) + for r in regs:climb(r,e[-1],part) + scal(scalar(e,back),e[-1]) + elif part=='centers': + assert all(cur[r]==0 for r in range(v,2*v)) + for k,r in enumerate(c['centers']): + cf=c['center_frames'][k];rank=len(frames[cf]);assert cur[r]==cf + C=['C',k];scal(['clear',C],0 if back else cf) + terms=[e for e in c['cut'] if e[2]==r] + if back: + for e in terms:scal(['add',C,['L',e[1]],e[3],e[4]],0) + else:scal(['copy',C,['L',r]],cf) + event(['center',k,0 if back else cf,cf if back else 0,rank]) + if back:scal(['add',['L',r],C,-1,1],cf) + else: + for e in terms:scal(['add',['L',e[1]],C,e[3],e[4]],0) + scal(['clear',C],cf if back else 0) + else: + for r,f in enumerate(c['final']):climb(r,f,part) + event(['phase','exit_adapters']) + for r,f in enumerate(c['final']):event(['adapter','new_to_old',r,f]) + event(['phase','full_frame_cleanup']) + for e in c['cleanup']: + regs=[e[1]]+([e[2]] if e[0]=='add' else []) + assert all(c['final'][r]==1 for r in regs) + scal(scalar(e,back),1) + event(['phase','done']) + return out + +def check_local(events,back): + # Literal scalar replay of the emitted stream, including center lifetimes. + state={('L',r):{r:Q(1)} for r in range(n)};live=[];paid=Counter();prims=0;macros=0 + for e in events: + if e[0]=='climb':assert not live;paid[e[5]]+=1 + elif e[0]=='center':assert live==[e[1]];paid[e[4]]+=1 + elif e[0]=='scalar': + op=e[1];tag=op[0];t=tuple(op[1]);macros+=1;prims+=2*primitive_bound(op) + if tag=='clear': + state[t]={} + if t[0]=='C' and t[1] in live:live.remove(t[1]) + elif tag=='copy':state[t]=dict(state.get(tuple(op[2]),{}));live.append(t[1]) + elif tag=='scale':state[t]={j:Q(op[2],op[3])*x for j,x in state[t].items()} + else: + s=tuple(op[2]);q=Q(op[3],op[4]);row=state.setdefault(t,{}) + if t[0]=='C' and t[1] not in live:live.append(t[1]) + for j,x in list(state.get(s,{}).items()): + z=row.get(j,Q(0))+q*x + if z:row[j]=z + else:row.pop(j,None) + assert not live and all(not row for r,row in state.items() if r[0]=='C') + for r in range(n): + expected={r:Q(1)} + if back and r2*maxchild**depth +assert local_bound<1<<48 and logical<1<<6050 and router0 + bound=max(math.ceil(36/gap**2),math.ceil(2*(4+512)/gap)) + assert bound*gap**2>=36 and bound*gap>=2*(4+512) + cutoffs.append(str(bound));chain.append(z) +bridge={'semantic':{'C0':{'base':2,'exponent':210000},'strict_literal_gap':1}, + 'rows':{'degree_gap':Q(10**6)-Q(51*20161,25)}} +q=chain[-1]*(1-2*eta);ticks=(1-eta)*q/(1+q)/grid;kap=Q((ticks.numerator-1)//ticks.denominator,10**18) +assembly=Outer.assembly(chain[-1],b,bridge,kap,eta=eta,beta=beta) +try:Outer.assembly(chain[-1],b,bridge,kap+grid,eta=eta,beta=beta) +except AssertionError:pass +else:raise AssertionError('next kappa grid accepted') +result={'status':'PASS_NEW_STRUCTURAL_PROGRAM_AND_FINITE_ASSEMBLY_PENDING_REPLAY', + 'canonical_word_sha256':sha(cp),'scalar_audit_sha256':sha(OUT/'SCALAR-FRAME-AUDIT.json'), + 'exact_phase_receipt_sha256':sha(OUT/'CLIFFORD-REVIEW.json'),'global_template_sha256':hashlib.sha256(blob).hexdigest(), + 'local_program_checks':checks,'R':R,'m':m,'live':W,'physical':physical, + 'bank_assignments':len(assignments),'rank_mass':mass,'deficit':2496, + 'global_profile':dict(sorted(paid.items())),'emitted_local_events_all_calls':event_count, + 'finite_invoice':{'local_primitive_bound':local_bound,'local_adapters':adapters, + 'pervertex':pervertex,'physical_stock_bits':stock.bit_length(), + 'router_bits':router.bit_length(),'literal_bits':literal.bit_length(), + 'physical_row_coefficient':row,'retained_row_coefficient':20161, + 'compiler':compiler,'G_exponent':30000,'E_exponent':100000,'C0_exponent':210000, + 'required_C0_bits':(32*m*BB*BB).bit_length(),'halving_degree':depth, + 'halving_integer_inequality':[m**depth,2*maxchild**depth]}, + 'complex_b':str(b),'bit_c':str(bit),'prospective_kappa':str(kap),'kappa_float':float(kap), + 'log2_kappa':math.log2(float(kap)), + 'kappa_gain_percent':float(100*(kap/Q(998390813251625,10**18)-1)), + 'strict_outer_constraints':{name:str(z) for name,z in assembly['strict_constraints'].items()}, + 'next_kappa_grid_rejected':True,'bootstrap_cutoffs_log2':cutoffs, + 'scope':'New finite scalar interface with a written conjugation proof, conditional on inherited all-size compiler, precision/tape and analytic transfer. Independent emitted-program replay and fresh package replay still required before final promotion.'} +(OUT/'INTEGRATION.json').write_text(json.dumps(result,indent=2)+'\n') +print('PASS prospective kappa',float(kap),'gain',result['kappa_gain_percent'],'percent',flush=True) diff --git a/research/split-centres-global/code/complex_phases.py b/research/split-centres-global/code/complex_phases.py new file mode 100644 index 0000000000..88d6afa045 --- /dev/null +++ b/research/split-centres-global/code/complex_phases.py @@ -0,0 +1,24 @@ +"""Bind unchanged exact phase evidence, or regenerate all selected phase pairs.""" +import gzip,hashlib,json,os,subprocess,sys +from pathlib import Path +P=Path(__file__).resolve().parent.parent;O=Path('split-centres') +def sha(p):return hashlib.sha256(p.read_bytes()).hexdigest() +c=json.load(gzip.open(O/'CANONICAL-WORD.json.gz')) +r=json.loads((P/'inputs/complex-phase-receipt.json').read_text()) +raw=gzip.decompress((P/'inputs/complex-phase-recipes.json.gz').read_bytes());recipes=json.loads(raw) +# Bind the exact decoded witness, independently of gzip implementation metadata. +assert hashlib.sha256(gzip.decompress((O/'CANONICAL-WORD.json.gz').read_bytes())).hexdigest()==r['canonical_word_payload_sha256'] +r['canonical_word_sha256']=sha(O/'CANONICAL-WORD.json.gz') +assert hashlib.sha256(raw).hexdigest()==r['recipe_sha256'] +edges=set(map(tuple,c['edges']))|{(a,b) for f in c['center_frames'] for a,b in ((f,0),(0,f))} +assert {(z['old'],z['new']) for z in recipes['children']}==edges +assert len(recipes['children'])==len(edges) and len(recipes['endpoint_adapters'])==240 +for z in recipes['children']:assert z['rank']==abs(len(c['frames'][z['old']])-len(c['frames'][z['new']])) +if os.environ.get('E8_REPLAY_PHASES')=='1': + subprocess.run([sys.executable,'-B',str(P/'code/complex_phases_full.py')],check=True) + assert (O/'CLIFFORD-RECIPES.json').read_bytes()==raw +else: + (O/'CLIFFORD-RECIPES.json').write_bytes(raw) + r['validation_mode']='Reuse exact phase evidence bound to the unchanged canonical word and recipe hashes' + (O/'CLIFFORD-REVIEW.json').write_text(json.dumps(r,indent=2)+'\n') +print('PASS source-bound phase recipes',len(edges)) diff --git a/research/split-centres-global/code/complex_phases_full.py b/research/split-centres-global/code/complex_phases_full.py new file mode 100644 index 0000000000..b5a5bd64b4 --- /dev/null +++ b/research/split-centres-global/code/complex_phases_full.py @@ -0,0 +1,39 @@ +# Adapted from PR425 for heterogeneous centres by icekylinx with Codex assistance. +"""Exact phase-aware lowering of every used edge of the new structural word.""" +import gzip,hashlib,json,sys,time +from collections import Counter +from pathlib import Path +sys.path.insert(0,str(Path('work/odd-stages').resolve())) +from clifford_exact import * + +OUT=Path('split-centres');P=OUT/'CANONICAL-WORD.json.gz' +c=json.load(gzip.open(P));n=c['h'];frames=c['frames'];start=time.monotonic();ops=[] +for U in frames: + op=canonical_frame(n,U) + L=[u|(u<>(y.bit_length()-1)&1:x^=y + if x:return False + return True +def local(events,back): + rows={('L',r):{r:Q(1)} for r in range(n)} + norm={('L',r):Q(1) for r in range(n)};prefix=Q(1);cur=c['start'].copy();private={} + hist=Counter();phases=[];entry=[];exit=[];centers=[];matrix_hash=hashlib.sha256() + allowed=['zero_frame_precondition','entry_adapters','A','centers','B','final','exit_adapters','full_frame_cleanup','done'] + for event in events: + tag=event[0] + if tag=='phase': + phases.append(event[1]);assert phases==allowed[:len(phases)] + if event[1]=='A':assert entry==list(enumerate(c['start'])) + if event[1]=='centers':assert all(cur[r]==0 for r in range(v,2*v)) + if event[1]=='full_frame_cleanup':assert cur==c['final'] and exit==list(enumerate(c['final'])) + assert not private + elif tag=='adapter': + assert event[3]==(c['start'] if event[1]=='old_to_new' else c['final'])[event[2]] + (entry if event[1]=='old_to_new' else exit).append((event[2],event[3])) + elif tag=='climb': + _,part,r,a,b,rank=event + assert not private and phases[-1]==part and cur[r]==a + assert contains(frames[a],frames[b]) and rank==len(frames[b])-len(frames[a])>0 + hist[rank]+=1;cur[r]=b + elif tag=='center': + _,k,a,b,rank=event + assert phases[-1]=='centers' and private=={('C',k):a} + cf=c['center_frames'][k];cr=len(frames[cf]) + assert (a,b,rank)==((0,cf,cr) if back else (cf,0,cr)) + private['C',k]=b;hist[rank]+=1;centers.append(k) + elif tag=='scalar': + _,e,f=event;op=e[0];target=tuple(e[1]);source=tuple(e[2]) if op in ('copy','add') else None + if target[0]=='C' and op=='clear': + assert private.get(target,f)==f + private.pop(target,None) + else: + for r in (target,source): + if r is None:continue + if r[0]=='L':assert cur[r[1]]==f,('common frame',r,cur[r[1]],f) + else: + if r==target and r not in private:private[r]=f + assert private[r]==f + if op=='clear':rows[target]={};norm[target]=Q(0) + elif op=='copy':rows[target]=dict(rows[source]);norm[target]=norm[source] + elif op=='scale': + q=Q(e[2],e[3]);a,b=abs(q.numerator),q.denominator + assert a&(a-1)==0 and b&(b-1)==0 + rows[target]={j:q*x for j,x in rows[target].items()};norm[target]*=abs(q) + else: + q=Q(e[3],e[4]);a,b=abs(q.numerator),q.denominator + assert source!=target and b&(b-1)==0 + # Independent symbolic replay of the cleared coefficient work. + w=0 + for bit in bin(a)[2:]:w=2*w+int(bit) + assert Q(w,b)*(1 if q>0 else -1)==q + prefix=max(prefix,Q(a)*norm[source]) + norm[target]=norm.get(target,Q(0))+abs(q)*norm[source] + row=rows.setdefault(target,{}) + for j,x in list(rows[source].items()): + z=row.get(j,Q(0))+q*x + if z:row[j]=z + else:row.pop(j,None) + prefix=max(prefix,norm[target]) + else:raise AssertionError(tag) + assert phases==allowed and centers==list(range(len(c['centers']))) and not private + assert all(not row for reg,row in rows.items() if reg[0]=='C') + for r in range(n): + expected={r:Q(1)} + if back and r x + ((q+e_j).x)(q+e_j). Its remaining columns are an orthonormal basis +of q^perp. For s>0, rho_s,q exchanges that complement in the local block +with exterior block s and fixes q and all other exterior coordinates. +It is a symmetric orthogonal involution. The stage data owners are +g=d*rho_s,q, with rho_0,q=I, so the right factors are bijections of O(73,2). + +Use canonical data levels X_s=C_[0,9+8s), Y_s=X_s C_q^(-1), and initially +X_(-1)=C_q, Y_(-1)=I. The routed stage starts at level s-1 and ends at level s. +Their binary preimages agree with the window endpoints. Exact phase +polynomials determine the translation that reconciles each endpoint, and +the template applies that translation. There are 3840 nonzero such +translations across the 120 port types and nine stages, before replica +multiplicity. These operators are not silently identified from equal +binary matrices. + +Four-pair scalar chain and idle children + +Starting with F_0 (Y_0 += X_0), for j=0,1,2,3 apply B_j (X_j -= Y_j), +then for j<3 apply X_j += X_(j+1), Y_(j+1) -= Y_j, apply F_j, and undo +that bridge. The last pair has B_3,F_3 without a following bridge. +Afterwards apply, in descending j=2,1,0, X_(j+1)+=X_j and Y_j-=Y_(j+1). +Finally exchange each pair by newX=oldY, newY=-oldX. The complete signed +integer scalar matrix is the identity; omission of every bridge fails. + +Before a bridge, advance the idle pair to the active pair's level. The +two advances for the newly used pairs have ranks (16,8), (32,8), (48,8). +The final advances have ranks 48,32,16,0. Each rank occurs on both members +of the pair, each of 120 ports, and each of eight replicas. A nested idle +transition is factored in the explicit orthonormal basis U_q direct_sum I. +Its exact Z4 phase is reconciled by the stored translation after that child. + +The final Y endpoint is C_all C_q^(-1). A source began at C_q, so its +unadjusted exchange route would be C_all C_q^(-2)=C_all X_q. Applying the +literal X_q to each final Y before the signed exchange removes this factor. +The corresponding 120 omission controls fail. This correction is charged. + +Banks and arbitrary correlated dirt + +There are eight replicas of each of the four data pairs, hence 7680 data +families. Each stage has 783 independent bank families. Number a local +helper occurrence by z=783*replica+helper. It uses bank floor(z/8) and slot +z mod 8, with its nine-dimensional residual assigned to coordinates +[9*slot,9*slot+9). A paid coordinate C child at coordinate 72 completes +each bank. All eight whole residuals and this padding fill dimension 73. +Thus there are 9*783=7047 bank families and live stock 14727. + +Let Pi_slot swap the first nine coordinates with the assigned block. The +local invocation at class d uses the bank class g=d*Pi_slot^(-1). Its +residual at that owner is P_g C_block P_g^(-1). Right multiplication is a +bijection. Local helpers sharing one bank have distinct slots, hence +different right factors and different actual bank classes for every d. +All data and private families are disjoint from banks. The checker verifies +these injections for all 72 invocation/replica templates and 56376 residual +assignments. A complete cover sweep for one replica finishes before the +next begins. The local dirty invocation is block diagonal on helpers at +its endpoint and permits arbitrary correlated helper values. Therefore +overlap between different invocations does not impose a cleanliness or +independence assumption. At each bank class, the eight residuals and the +padding are coordinate factors in one common conjugated basis, and their +exact product is P_g C_all P_g^(-1). + +One more exact correction is essential. Orthogonality alone does not imply +that P_g commutes with C_all as an exact operator. In fact + P_g C_all P_g^(-1) = C_all X_delta(g), + delta(g)_i = (weight(row_i(g))-1)/2 mod 2. +The quadratic terms cancel by row orthogonality and the remaining even +linear terms give the displayed translation. Both sides fix the uniform +vector, fixing the global scalar. Apply X_delta(g) to EVERY final live +family in cover class g, after the bank padding and signed data exchange. +The template includes and charges all 14727 corrections per cover. This +identity is also checked on every orthogonal matrix in dimensions 1..5. + +Finite work and recurrence charges + +The source emitter is regenerated and revalidated in both orientations. +It accounts for 1242936 local events over 72 invocations, with all copied +center and dirty-tableau lifetimes intact. Forward and backward scalar +words freshly replay all 1023 independent dirty live columns. Only the +private work starts at zero. Work comprises 783 tableau streams, nine +reserved center streams (eight used), and one coefficient stream. Each +invocation completes and erases its private work before the next. Physical +stock is therefore 15520 per cover; scalar-only work is excluded from the +recursion-volume denominator. + +GLOBAL-REVIEW.json records the complete recomputed finite overcharge, with +64*(73+1)^3 compiler groups per rank-zero adapter, source-counted scalar +primitives, and overcharges for all data routes, bank selectors, phases, +padding, bridges, exchanges and cover corrections. The O(73,2) order is +2^(36^2)*product(2^(2i)-1,i=1..36); its bit length is 2628. The recomputed +router fits 2^30000, the literal charge fits 2^100000, and the precision +guard fits C0=2^210000. No even-dimensional orthogonal-order formula is used. + +Largest child 48 does not satisfy one-layer halving. Instead +73^2=5329>2*48^2=4608, so two nested children have width strictly below +half the parent, including floors. The general depth is bounded by +2*ceil(log2 e), with direct small leaves. For B=s+E the completed-child +semantic induction has 2B(73-48)-s-E=49B>0. The resulting conservative +complete-row coefficient is 2*2642+9909+252=15445<20161, retaining the +external bit/base-row allowance as an explicit interface assumption. +The inherited bad-branch envelope is priced conservatively as before. + +Two independent rational moment engines admit +b=999240641319551/10^18 and exclude b+10^-18 for the source-bound profile. +The rank mass is 1072575, and 73*14727-1072575=2496=8*(8*120-9*72). +This complex component exceeds 1/1024 but does not improve the current +bit bottleneck. No improved final kappa or completed PR milestone follows. diff --git a/research/split-centres-global/proofs/PR386-BIT-GEOMETRY.txt b/research/split-centres-global/proofs/PR386-BIT-GEOMETRY.txt new file mode 100644 index 0000000000..31efe31268 --- /dev/null +++ b/research/split-centres-global/proofs/PR386-BIT-GEOMETRY.txt @@ -0,0 +1,191 @@ +Compressed nine-stage E8 bit supplier and combined conditional bound + +Claim and source assumptions + +The conditional combined value is + kappa = 998243154231047 / 10^18 = 0.000998243154231047 > 1/1024. +It is approximately 2^-9.9683211064. This is a conditional finite construction +in the inherited supplier framework, not a Lean proof of integer multiplication. +No priority claim is made. + +The E8 bit word, its 120 root lines, all 865 helpers, and nine retained totals +are taken without modification from Dylan Crow's PR #370, commit +b7fe9cdf2da009c947ff6b334c562bc190b30373. Its raw word has SHA256 +1fb726ea3818fe0837cceb0dd22a71a0814f064e5e781628104610d6468e0e55. +The original verification is rerun, including regeneration, independent +1105-column F2 checking, official record legality/formal columns, all-frame +Gram and prime witnesses, negative controls, and the original regression set. +Its five-stage c is 904072820242522/10^18, insufficient by itself for -10. + +The complex supplier is the separately reconstructed compressed nine-stage +component from PR #377, with b = 999240641319551/10^18. Its complete source, +notices, exact Clifford and Z4 phase checks, global template and finite bill +remain included. In particular, its terminal X_q and every-live-family +X_delta(g) corrections are retained; equality of binary matrices is not +substituted for equality of complex operators. + +The inherited all-size weighted bit compiler, tape/prime/precision and +analytic transfer interfaces remain conditional. PR #370's explicit admission +of nine copied totals at h=8 is retained. The complex local E8 theorem, +Clifford compiler, common fine-grid, restored-row and analytic interfaces +remain conditional exactly as stated in the companion component. The new +window, banking and two-level finite charges are described below rather +than inferred from a rank histogram. + +Exact bit operators and compressed ambient space + +Over an admitted odd address field, the E8 form is G=I_8/2. For a nondegenerate +subspace U, write P_U for its orthogonal projector. On the doubled address +space define + D_U = [[I-P_U, P_U], [P_U, I-P_U]]. +Thus D_U is an exact involution. If U is contained in V then +D_V D_U = D_(V intersect U-perp), with rank dim(V)-dim(U). Also + D_I D_P = D_(I-P). +These are literal address matrices. Unlike the complex C operators, they +have no hidden scalar phase. The auditor reconstructs all 944 rational +projectors and checks all 3289 used nested pairs, in both orientations. + +Set V_global = Q^8 direct_sum (Q^7)^8, m=64, with form I_64/2. +Let E_s be the first s exterior 7-blocks, s=0,...,8. At stage s lift the +entire local word by replacing U with U direct_sum E_s. Both ends of every +local transition contain the same E_s, so it cancels exactly; the child +projector and rank are unchanged. This holds for copied totals as well: +the temporary transforms between the source and scatter frames, whose +common E_s cancels. COPY/ERASE windows remain sequential and immutable. +No assumption that m is a multiple of 9h is used. + +Port routes + +The reference root is q*=2e_0. For every root q, the checked product g_q +of at most two E8 root reflections sends q* to plus or minus q. Let A_q be +its last seven columns. They form an orthonormal basis of q-perp: + A_q^T A_q=I_7, A_q A_q^T=I_8-P_q, P_q=q q^T/4. +For stage s>0 use, on the local block and exterior block s, + rho_(s,q) = [[P_q, A_q], [A_q^T, 0]], +and fix all other coordinates. For s=0 use the identity. These matrices +are orthogonal involutions. Conjugating the lifted endpoints gives + (P_q,E_s) -> (I_8,E_(s-1)), (I_8,E_s) -> (I_8,E_s), + (0,E_s) -> (I_8-P_q,E_(s-1)), + (I_8-P_q,E_s) -> (I_8-P_q,E_s). +These equalities are checked as exact rational matrices for every port. +Each nontrivial route has a replayed elementary factorization, at most +77 factors, with denominators 1,2,4. Omitting a factor fails. Thus all +routes remain defined at every odd address prime; there is no new odd +exceptional prime. The existing local prime witnesses are rerun separately. + +Nine-stage scalar recipe and deferred endpoint completion + +Use four data pairs (X_j,Y_j). Start with F_0: Y_0 += X_0. For j=0,...,3, +apply B_j: X_j -= Y_j; when j<3 insert the two shears + X_j += X_(j+1), Y_(j+1) -= Y_j; +apply F_j; then undo those two shears. After all stages, for j=2,1,0 apply + X_(j+1) += X_j, Y_j -= Y_(j+1). +Finally replace (X_j,Y_j) by (Y_j,-X_j). The complete signed integer +8-by-8 scalar matrix is the identity. Omitting any of the eighteen +individual bridge shears changes it. + +Each B_j is the reflected inverse of the actual local record stream: +reverse the order, negate ADD coefficients, replace U by U-perp, and +turn ERASE into a fresh COPY from the original unchanged center. No erase +is inverted. PR #370 stores zero in the ERASE rank field; the reflected +COPY rank is freshly derived from its two frames, giving rank 8. Both +oriented streams replay all 1105 independent input columns and close work. + +Before each bridge the newly used pair is advanced to the active level. +The two idle increments are (14,7), (28,7), (42,7). Endpoint completion of +the earlier pairs is deferred to the final stage, with ranks 42,28,14,0. +Every increment acts on both members of every port pair and every replica. +The schedule checker requires equal complete frames at every bridge. +The signed terminal exchange completes the data transform using the exact +identity D_I D_P=D_(I-P). Scalar replay on 8745 independent columns includes +960 data and 7785 separate stage-helper inputs. All are restored after +the exchange; the reflected copy work closes to zero. + +Whole-block banks and arbitrary correlated dirt + +Use eight replicas. There are 4*2*120*8=7680 data families. For each stage, +number a local helper occurrence by z=865*replica+helper, and assign it +to bank floor(z/8), slot z mod 8. There are 865 banks at each of nine +stages. Each slot is one whole 8-dimensional coordinate block in Q^64. +The eight slots are mutually perpendicular and fill the ambient space; +no padding child is needed. Live recursion stock is 7680+9*865=15465. +Nine private center slots are reserved and excluded from recursion volume, +so charged physical stock is 15474. Only one such slot is used at a time. + +Let Pi_slot exchange the first eight coordinates with its bank block. +For a cover class d in O(I_64/2,F_q), the helper owner is the bank class +g=d Pi_slot^-1, and a data owner is d rho_(s,q). Right multiplication is a +bijection of the finite cover. Within every local invocation, helpers in +the same bank have different slots, hence different actual cover classes; +all data and work families are disjoint from banks. All 62280 assignments +are checked, and every physical bank receives each of its eight slots once. + +The local all-column theorem permits arbitrary helper inputs, including +correlations created by earlier invocations. After its endpoint each helper +has only the known residual D_H. The common E_s cancels, so no cleanliness +assumption is imposed by a previous bank action. Complete cover sweeps run +sequentially. At a fixed bank owner g the residuals are D on the eight +orthogonal coordinate blocks conjugated by g. They commute and multiply +to D_I. Since diag(g,g) commutes with the literal head/tail exchange D_I, +no complex-style cover phase correction is needed on the bit side. +This is a symbolic finite cover proof, not an enumeration of O(64,F_q). + +Actual emitted ledger + +The source-bound template emits 72 local invocations and 1355328 events. +All local COPY/ERASE and helper lifetimes are rechecked. Its paid profile is + 1:149472, 2:67824, 3:32256, 4:30096, 5:22176, 6:144, + 7:5760, 8:1296, 14:3840, 28:3840, 42:3840. +There are 320544 paid children, rank mass 987264 and deficit + 64*15465-987264 = 2496 = 8*(8*120-9*72). +The independent auditor recomputes the profile from the emitted template +and rejects missing idle/bridge/exchange/invocation events, bank-slot aliasing, +understated stock, a missing local MOVE and a wrong reflected COPY charge. + +Finite cost, precision allowance and two-level halving + +The largest child is 42, so one-level halving is false. Two levels suffice: + 2*42^2=3528 < 64^2=4096. +Floors only reduce descendant widths. The exact one-level moment, including +the inherited 10^-16 bad-branch envelope, is strictly below one; composing +two levels squares this contraction. The finite composite may be used with +the inherited halving-based compiler and direct small leaves. + +The old five-stage 104-bit payload-prefix guard is not reused. Fresh local +cancellation-free row bounds are 742 forward and 6308 reverse. For five +forward calls, four reflected calls and eighteen bridge shears, the bound + 2^18 * 742^5 * 6308^4 +has 117 bits. We explicitly charge 192 bits per nine-stage block. The actual +source operations, copy episodes, 77-factor routes, selectors, all owner +adapters and this prefix bound enter certify.py's finite coefficient. It +has 117 bits; the charged two-level coefficient has 269 bits and is bounded +by 2^512. This deliberately increases the finite cutoff, rather than passing +the old 104-bit assertion. The exact three bootstrap cutoff inequalities +are checked using the changed coefficient. + +For cover/routing enumeration use the inherited coarse q^(m^2+1) bound; +two levels and the retained additive row charges give + 2*(64^2+1)+9909+252 = 18355 < 20161. +The explicit rational bit routes introduce only powers of two. The new +finite constants fit well below the companion bridge's 2^30000 reserve, +and the common external C0=2^210000 and row allowance 20161 are retained. +As for the companion complex component, the general compiler/common-grid +interfaces are assumptions; no new Lean formalization is asserted. + +Exact price and combined assembly + +Two independent rational moment engines, both with the 10^-16 envelope, +admit c=1057833103534317/10^18 and reject c+10^-18. The complex supplier +therefore binds. With eta=10^-12 and beta=10^-9 choose + s=999240640320309/10^18 < (1-beta)*b < c. +Start a0=384599/10^10 and apply a_(j+1)=(1-s)s+s*a_j three times. The retained +outer assembly at (a3,b) admits kappa=998243154231047/10^18. All 47 strict +constraints are positive; the next 10^-18 kappa grid point is rejected. +The strict excess over 1/1024 is 21680654231047/10^18. Final kappa is about +24.0286% above frozen #361, within the explicitly retained assumptions. + +Attribution: Dylan Crow / Anthropic Claude for PR #370's new local bit word; +Jacob Sussman for E8 and the complex unit; the inherited source527, PR234, +PR266, PR315, PR346, PR352 and PR363 contributors as listed in the preserved +notices; Zhihao Chen with OpenAI Codex assistance for this compressed bit +composition, its independent audit, and the combined nine-stage package. diff --git a/research/split-centres-global/proofs/PR425-COMPLEX.txt b/research/split-centres-global/proofs/PR425-COMPLEX.txt new file mode 100644 index 0000000000..41061757ce --- /dev/null +++ b/research/split-centres-global/proofs/PR425-COMPLEX.txt @@ -0,0 +1,211 @@ +Hamming packets with mutable source and target bases +Conditional finite extension of the complex E8 supplier + +1. What is new + +The old r783 word keeps source values fixed and does not read target registers. +Those are sufficient restrictions on a scalar word, not necessary conditions +for a common-frame linear program. The new word uses 680 helper registers: + + * source registers themselves carry one branch of a simultaneous signed + packet computation; + * retired packet registers retain a full source basis, from which the eight + central coordinate sums are reconstructed; + * 56 pairs of targets carry a first two-output butterfly, with its input + basis explicitly compensated at frame zero and in the center decoder; + * an exact inverse on all source/helper registers is executed at their + common full frame after the last recursive climb. + +No recursive work is deleted from the ledger. A helper is counted for its +entire lifetime, including unused final climbs. All 120 sources and targets +retain their original line/full and zero/hyperplane endpoint ranks. + +The new local histogram is + {1:2248, 2:896, 3:168, 4:336, 5:392, 8:24, 9:8}. +Its rank mass is 9*680 + 240*8 + 72 = 8112. There are 4072 local children. +There are more local children than in the old r783 word, but substantially +less helper rank mass; the complete moment, not a count proxy, decides gain. + +2. Exact Hamming geometry and signed packet algebra + +Use the pinned PR370 table of 120 E8 root lines in Construction-A coordinates: +eight coordinate lines 2e_i and 112 sign lines on the 14 weight-four Hamming +blocks. For integer representatives r_s, let G_st = r_s dot r_t / 2. +The matrix C_st = 1 + G_st mod 2 has binary rank nine. The construction gives +an explicit orthonormal realization p_s in F_2^9 with + + p_s dot p_t = C_st, and p_s dot p_s = 1. + +Consequently the nonzero off-diagonal entries of G/2 occur only where a source +line lies in the target hyperplane. The rank-eight central factorization is + + (G/2)_ts = sum_i r_ti r_si / 4. + +For a source Hamming block d, a coordinate pair {i,j} in d, and epsilon=+-1, +define the signed face packet + + P(d,ij,epsilon) = sum_{s in d, r_si*r_sj=epsilon} r_si x_s. + +Each packet has four terms and its binary port span has rank three. Split +the eight sign lines of a block into its two parity tetrads. Each tetrad pair +occurs in two face packets with independent signed coefficient rows. The two +rows are formed simultaneously by two determinant-one shears, rather than +forming independent one-output sums. The packet factory uses its eight source +registers and sixteen additional helpers. Its twelve retired registers can +be oriented to retain a full rank-eight source basis. Exact elimination on +that stock produces four coordinate sums without allocating more helpers. + +This comparison of an individual factory is not a claim that the whole old +supplier used 48 helpers per block. The relevant complete counts are 783 and +680, both charged with their full actual profiles. + +For two target/source blocks whose intersection is {i,j}, the contribution +to target t is -r_ti P(d,ij,r_ti*r_tj)/2. The remaining within-block and +coordinate-line contributions are explicit four-output signed transforms. +Every one of the 14400 rational decoder entries is rechecked. Adding the +eight coordinate centers leaves precisely the identity matrix on sources. + +The binary transvection x -> x+(x dot 43)*43 is orthogonal because 43 has +even weight. It maps the constructed port set exactly to the old fixed E8 +port set. All frames and register indices are transported, so the old nine- +window data routes and their global phase correction apply to exactly the +same ordered ports, without introducing an unproved new covering geometry. + +3. General scalar-interface lemma + +Write z=(x,s) for the source and arbitrary dirty helper streams, and y for +the targets. Permit scalar additions and invertible dyadic scalings between +registers at the same current label. No target may feed a z register. The +raw A/center/B word therefore has block form + + z' = U z, + y' = V y + J x + K s, + +where U and V are invertible, and the retained-center operations are included +in J and K. The actual word has J=I after its adjusted center scatter. The +checks compute every coefficient over Q, rather than inferring it from a +desired sparsity pattern. + +At frame zero, before entry adapters or recursive children, execute + + y <- V^{-1} y - V^{-1} K s. + +Both y and s have label zero there. The code emits the literal inverse of +the 56 disjoint two-output target bases and a direct, charged dyadic old- +response matrix with 13216 additions. There is no uncharged oracle for K. +It is computed from the explicit scalar word and serialized. All coefficient +work is cleared immediately after its use. + +After the last main gate, finish every z register's climb to the full frame, +then execute U^{-1} by reversing and inverting the non-target gates. These +gates are legal at one common full frame, including helper-to-source gates. +The result is exactly + + (x,s,y) -> (x,s,y+x). + +The second orientation is the inverse transpose: negate and transpose every +addition and invert every scale in the SAME event order. Each retained +center is implemented by the transposed gather/child/scatter stream. The +result is (x,s,y) -> (x-y,s,y). Both orientations are replayed on all 920 +independent live columns, including all 680 arbitrary helper columns. +Missing compensation, missing output preconditioning, missing cleanup and +the wrong inverse-transpose order are rejected. + +Why the scalar argument lifts to exact complex labels: for each binary +subspace F use the exact canonical representative L(F). A climb from A to B +acts as L(B)L(A)^{-1}. If two registers share F, a scalar addition commutes +with their common L(F), as does a scalar scaling. Induction through the +actual stream therefore gives the block-diagonal conjugation of its scalar +matrix by the current labels. Center copies explicitly move from full to +zero, or zero to full in the other orientation. The preconditioner uses +only label-zero registers, and the z cleanup uses only full-label registers. +Thus the proof never moves a scalar operation across unequal labels or +identifies two frames merely because their ranks agree. + +Every used canonical frame, nested transition, center direction and endpoint +adapter is independently lowered by the exact Gaussian Clifford compiler. +Equalities include global phase. The old restricted gx gate-shape checker +is not used to admit this new interface; the stronger explicit matrix and +common-frame checks replace its source-immutability/target-read restrictions. +This is a written finite algebraic extension, not a new Lean theorem. + +4. Complete programs and work lifetimes + +Each orientation emits 27537 events, including startup, entry/exit adapters, +all recursive climbs, eight sequential center children, scalar operations +and final cleanup. Temporary centers are initialized, used and erased one +at a time. No center or coefficient work stream survives a live child. + +All added coefficients are dyadic. To apply a/2^j, compute |a| times the +source by binary Horner additions on a cleared private stream, halve j +times, accumulate with its sign, and clear the private stream. In-place +scales are signed powers of two. Every such primitive is charged. This +introduces no new denominator prime. Independent replay bounds the actual +cancellation-free prefix norms, including coefficient work; a 192-bit local +payload allowance is retained conservatively. + +5. Nine-window composition and finite bill + +Use the previously verified m=73 compressed nine-window geometry, four data +pairs, eight replicas, and the original signed bridges, idle children, +terminal exchange, terminal translations and full-cover phase correction. +The source scalar identity and its negative inverse-transpose are exactly +the two local interfaces consumed by that unchanged geometry. + +There are 680 whole-block banks per stage, each containing eight rank-nine +helper blocks plus one paid rank-one padding child. The live width is + + W = 240*4*8 + 9*680 = 13800. + +The conservative physical width is W+680+9+2=14491. The old-response matrix +uses no persistent tableau, but the old-size reserve is still charged. +The emitted owner table has 48960 distinct stage/replica/helper assignments. +The new global profile is + + {1:167976, 2:64512, 3:12096, 4:24192, 5:28224, + 8:7488, 9:576, 16:3840, 32:3840, 48:3840}. + +Its rank deficit is 73*13800 - sum(r*H_r) = 2496. The maximum child is 48, +and 73^2 > 2*48^2 supplies the same charged two-level halving argument. + +The finite bill is recomputed from the new scalar programs, bank owners, +work stock and adapter counts. It is not asserted unchanged. The local +primitive bound fits 2^48; the tape router fits 2^30000; the literal envelope +fits 2^100000; the precision envelope fits 2^210000. The physical row +coefficient is 15445, below the explicitly inherited external allowance +20161. Full-cover corrections apply to all 13800 live families. + +6. Conditional numerical conclusion and retained assumptions + +Two independent rational moment engines, with the inherited 10^-16 bad- +branch envelope, accept + + b = 1049104978040580 / 10^18 = 0.001049104978040580 + +and reject the next 10^-18 grid point. With the unchanged bit parameter +c=0.001057833103534317, three bootstrap steps and all 47 strict outer +conditions give the prospective finite-assembly value + + kappa = 1048005508028206 / 10^18 + = 0.001048005508028206, approximately 2^-9.898137985359. + +The finite statement is conditional on the same all-size weighted compiler, +common fine grid, restored-row/base allowance, tape/prime/precision and +analytic transfer interfaces as the retained nine-stage result. The new +scalar-interface lemma above and its serialized program are additional +reviewable material, not an appeal to gx accepting a program outside its +grammar. No unconditional integer-multiplication theorem is claimed. +The result is approximately +4.97% over the locally verified retimed bound, +and remains well short of 2^-9. A fresh extracted-package replay is required +by this research workflow before publication or final promotion. + +Attribution + +The root table and the motivation to use Hamming coordinates come from the +already pinned PR370 bit package (Dylan Crow, with Anthropic Claude assistance). +The E8 complex label family, original scalar word and gx interfaces are due +to Jacob Sussman. The retained complex admission, pricing and global analytic +interfaces are credited in the original package notices and PROOF.txt. +The mutable-basis packet word, transported geometry, expanded scalar proof, +new finite program and the present checks were developed in this local +research session by Zhihao Chen with OpenAI Codex assistance. diff --git a/research/split-centres-global/proofs/PR426.md b/research/split-centres-global/proofs/PR426.md new file mode 100644 index 0000000000..e589cfbf50 --- /dev/null +++ b/research/split-centres-global/proofs/PR426.md @@ -0,0 +1,108 @@ +# Construction, dependencies and sufficient argument + +The fixed complex witness starts from Chafik Boukhalfa's far-retimed E8 word +and applecrusher's two equal-helper substitutions and two frame refinements. +It additionally replaces helper 556 by -2 times helpers 354 and 461, then +helper 576 by -2 times helpers 402 and 478 after compaction. Exact clean +linear forms agree at every substituted read. The backward upper-frame and +forward nested repairs retain copied-total pins and final address caps. +R is 779. The actual new dirty response and cleanup are regenerated: equality +on clean values alone is not the arbitrary-dirt proof. + +The signed prefix restoration is the PR390/395 bracket. For 25 disjoint +targets, subtract lambda times the donor before the prefix, emit the exact +source/write-version/frame difference, and restore lambda times that donor +at the common recovery frame. Lambda is +1 or -1. The full rational main +operator and all retained totals agree with the explicit same-width R779 +baseline on all 1,019 independent columns. Source/helper subwords agree +exactly, so the new baseline's explicit dirty response and cleanup remain +valid. The changed compiler permits a main Y read only when its target is Y; +helper-to-X remains forbidden. Both signed orientations and private lifetimes +are freshly admitted, with all actual Clifford phases and physical incidences. + +The shared entrance construction follows PR401/404. Each pivot p satisfies +K_p + sum_d a_pd K_d = 0 in the explicit baseline response. Four re-pivots +from PR412 replace the basis of these same relations, including the +half-valued donor that otherwise fails the original sixths-denominator +condition. PR410 enlarges eight entrance subspaces. Removed original helpers +556 and 577 are mapped explicitly onto our R779 word. The shared layer has +192 pivots, rank mass 350, and 496 literal unit shears. Its pivots and donors +are disjoint, so this layer alone has (S-I)^2=0. + +PR409's four ordered groups, with PR412's two additional re-pivots, prepend +55 more shears and admit ten further pivots. The combined word has 202 +gauges of rank mass 360 and 551 entrance shears. The complete chronological +prefix need not have (S-I)^2=0. We check its actual product M S, all retained +totals, and that every gauged target-response column is zero. Every entrance +source is read before any earlier entrance operation writes it. + +Every one of the 551 omission controls is recomputed from the suffix +response. If shear t += q s is removed, its suffix response is multiplied +by -q times the original independent s column: earlier operations leave s +unchanged by the read-before-write condition. A nonzero response is required +for each omission; the entire changed scalar schedule is also replayed for +sampled omissions. No global donor/pivot disjointness is assumed here. Both +unchanged original gx.check1 and gxcore.mirror checkers pass, including the +native denominator conditions. Every actual nested transition is charged. + +PR376's additional target201/helper491 frame change from rank eight to seven +is checked for full operator equality and nested paid paths before gauging. +PR404's target125/124 overlapping-prefix recovery requires a different +chronological input and is not imported. Its numerical gain is not included. + +Each entrance chart is normalized explicitly. Even and degenerate E_p use +the full two-sided exact Clifford factorization of F T_E inverse. The right +inverse adapter precedes the entire old-response invocation; the left inverse +adapter follows all main and helper cleanup. Both orientations retain every +unitary address operator in the inverse-adjoint chronology. Rank-zero adapters +are costed. All old/new/reflected Gaussian child pairs are recomputed, +including Pauli signs and global phase. Newly assigned mixed-bank coordinate +permutations and inverse owners are emitted and independently decoded. +Padding is an exact fixed integer witness, not a claim of solver optimality. + +The new bit operation differs from the preceding all-dirt reset: a retired +helper only needs its clean X-content zeroed before a new logical helper is +placed in the same slot. An arbitrary residual helper value is allowed. The +new helper basis determines a newly computed initial D compensation. C is +the reversed helper subword, restoring every physical helper, including its +original independent dirt. Each reset is checked exactly before reuse; the +retired slot has no later original use, the new helper has no earlier use, +and copied totals are protected. The combined word is checked over every +independent binary column. It uses 55 fewer helpers (822 to 767). The initial 27 reuses and 26 frame +moves are followed by two fixed rounds of 14 reuses and 14 frame moves. +The later resets use exact two- or three-parent clean forms; every parent +and all rebuilt dirty compensation are charged and independently checked. Integer signed-prefix bounds, lifting, +copied-center controls, routes and whole-bank packing are recomputed rather +than inferred from the clean calculation. + +The complex assembly has dimension 73, 14,286 live and +15,075 physical families, 734 banks per stage, deficit 2,496, +maximum child rank 48 and halving degree two. The bit assembly has dimension +56, 10,409 live families, deficit 1,512 and halving degree two. Actual row +coefficients fit the common 20,161 reserve. Both finite invoices and both +exact rational moment engines retain the positive 10^-16 fallback. Adjacent +10^-24 complex coarse grid points are rejected; the unchanged bit coarse +grid remains 10^-18. The exact outer assembly uses positive eta=10^-24, +beta=10^-18, eight finite bootstrap continuations and a 10^-27 grid; it +checks 47 strict constraints and invalid eta/beta/adjacent-point controls. + +The complex coefficient is 254951444354246755323/250000000000000000000000. The bit coefficient is +104575879789097/100000000000000000. The resulting conditional kappa is 40750673324589432209923/40000000000000000000000000. +Using the preceding unchanged bit supplier with this same complex coefficient +gives 203354853562950029967497/200000000000000000000000000, where the bit side +binds. The new clean-reuse bit supplier removes that bottleneck. Its exact +additional kappa contribution is recorded as the difference from this fair +control; the combined witness is limited by the new complex coefficient. + +All original files are manifest-bound and immutable. A copied supplier tree +is changed only through asserted literal edits. DERIVATION.json records every +old/new digest, changed pin and textual difference. Both full predecessor +supplier suites run before the changed admission. Expected records are checked +after recomputation, rather than used to obtain a PASS. + +This is a sufficient finite conditional construction. The inherited all-size +recursive suppliers, canonical/rank-zero compiler, compressed Clifford windows, +dirty banking/cover, routing, restored-row, fixed tape, common-grid, Gaussian +precision/recovery and analytic interfaces remain assumptions. No new full +Lean theorem or unconditional integer-multiplication exponent is asserted. +The target kappa > 0.002 is not attained by this witness. diff --git a/research/split-centres-global/vendor/clifford_exact.py b/research/split-centres-global/vendor/clifford_exact.py new file mode 100644 index 0000000000..166841a037 --- /dev/null +++ b/research/split-centres-global/vendor/clifford_exact.py @@ -0,0 +1,149 @@ +"""Small exact Gaussian-dyadic Clifford compiler, independent of gx internals. +Paulis use i^p X^x Z^z. State vectors use integer Gaussian numerators / 2^d. +The tableau is supplemented by a literal circuit, so global phases are kept. +""" +from dataclasses import dataclass + +def parity(x):return x.bit_count()&1 +def rank(rows): + p={} + for x in rows: + while x: + b=x.bit_length()-1 + if b not in p:p[b]=x;break + x^=p[b] + return len(p) +def transpose(rows,n):return tuple(sum(((rows[j]>>i)&1)<>j&1);a[j],a[k]=a[k],a[j] + for i in range(n): + if i!=j and a[i]>>j&1:a[i]^=a[j] + assert [r&((1<>n for r in a) +def basis_extend(cols,n): + out=[] + for x in list(cols)+[1<len(out):out.append(x) + assert len(out)==n + return tuple(out) +def nullspace(rows,n): + a=list(rows);p=[];k=0 + for j in range(n): + t=next((i for i in range(k,len(a)) if a[i]>>j&1),None) + if t is None:continue + a[t],a[k]=a[k],a[t] + for i in range(len(a)): + if i!=k and a[i]>>j&1:a[i]^=a[k] + p.append(j);k+=1 + return tuple((1<>j)&1)<>i&1:out=pmul(out,T[i]) + for i in range(n): + if z>>i&1:out=pmul(out,T[n+i]) + return out +def compose(A,B):return tuple(apply(A,p) for p in B) +def inverse(T): + n=len(T)//2;cols=[x|(z<>n;u,v,p=apply(T,(x,z,0));assert (u,v)==identity(n)[j][:2];out.append((x,z,(-p)%4)) + return tuple(out) +def qvalue(Q,alpha,x,n): + return (sum(alpha[i] for i in range(n) if x>>i&1)+2*sum(parity((Q[i]>>(i+1))&(x>>(i+1))) for i in range(n) if x>>i&1))%4 +def mul_i(a,p): + x,y=a;p%=4 + return [(x,y),(-y,x),(-x,-y),(y,-x)][p] +@dataclass +class Op: + n:int + tab:tuple + circuit:list + def then(self,b): + assert self.n==b.n + return Op(self.n,compose(b.tab,self.tab),self.circuit+b.circuit) + def adjoint(self): + circ=[] + for e in reversed(self.circuit): + if e[0]=='P':circ.append(('P',inv(e[1],self.n))) + elif e[0]=='D':circ.append(('D',e[1],tuple((-x)%4 for x in e[2]))) + elif e[0]=='C':circ.append(('C',e[1],-e[2])) + elif e[0]=='phase':circ.append(('phase',(-e[1])%4)) + else:circ.append(e) + return Op(self.n,inverse(self.tab),circ) + def zero_state(self,basis=0): + N=1<>i)&1 for i in range(n)) + assert all(alpha[i]%2==(Q[i]>>i)&1 for i in range(n)) + return Op(n,tuple([(1<>i&1 else 0,1<>i&1 else 0) for i in range(n)]),[('C',q,sgn)]) +def xgate(n,b):return Op(n,tuple([(1<>i)&1)) for i in range(n)]),[('X',b)]) +def fourier(n,axes=None): + out=ident(n) + for i in range(n) if axes is None else axes:out=out.then(cgate(n,1<len(selected):picks.append(j);selected.append(x) + assert len(picks)==r and all(x>>r==0 for x in Bcols) + Br=transpose(selected,r);Bi=inv(Br,r);Dr=transpose([Dcols[j]&((1< 2: + x /= 2 + k += 1 + lo, hi = log_unit(x) + l2, u2 = log_unit(Q(2)) + lo, hi = lo+k*l2, hi+k*u2 + # Outward rational rounding keeps later certificates compact. + return Q((lo*GRID).__floor__(), GRID), Q((hi*GRID).__ceil__(), GRID) + + +def exp_bounds(x): + require(0 <= x < 1, "exponential range") + term = total = Q(1) + for j in range(1, 13): + term *= x/j + total += term + tail = term*x/13/(1-x/14) + return total, total+tail + + +def moment(m, W, entries, saving): + lo = hi = Q(0) + for t, count in entries: + t, count = int(t), int(count) + require(0 < t < m and count > 0, "improper child") + l, u = log_bounds(Q(m, t)) + lower = exp_bounds(saving*l)[0] + upper = exp_bounds(saving*u)[1] + lo += Q(t*count, m*W)*lower + hi += Q(t*count, m*W)*upper + return Q((lo*GRID).__floor__(), GRID), Q((hi*GRID).__ceil__(), GRID) + diff --git a/research/split-centres-global/vendor/engines/moment.py b/research/split-centres-global/vendor/engines/moment.py new file mode 100644 index 0000000000..7d697cb452 --- /dev/null +++ b/research/split-centres-global/vendor/engines/moment.py @@ -0,0 +1,113 @@ +"""Independent prospective ordinary five-stage cost, never supplier admission. + +Consumes a raw one-invocation ledger made from the actual source/internal/target +paths. No packed profile is used as an input. Missing physical/finite/compiler +obligations must remain explicit in the accompanying report. +""" +from collections import Counter +from decimal import Decimal, localcontext, ROUND_FLOOR +from fractions import Fraction as F +from functools import lru_cache +from math import factorial +import hashlib, json, sys +from pathlib import Path + +DYAD = 1 << 224 + +def floor(x): return F(x.numerator*DYAD//x.denominator, DYAD) +def ceil(x): return -floor(-x) + +@lru_cache(None) +def logarithm(x): + """Mercator bounds after binary reduction; ln(2) via two Mercator sums. + + For 1 <= y < 2, log(y) is an alternating series in z=y-1. + We instead reduce to 1 <= y < 3/2, and bound log(3/2) and + log(2) by the same alternating series at z=1/2 and z=1/3, + using log(2)=log(3/2)+log(4/3). All sums are exact rationals. + """ + assert x >= 1 + k = 0 + while x >= 2: x /= 2; k += 1 + j = int(x >= F(3, 2)) + if j: x /= F(3, 2) + def mercator(y): + z=y-1 + assert 0 <= z <= F(1,2) + # An even partial sum is below log; the next term bounds its tail. + t=z; s=F(0) + for n in range(1, 225): + s += (t if n & 1 else -t)/n + t *= z + return s, s+t/225 + a,b=mercator(x); c,d=mercator(F(3,2)); e,f=mercator(F(4,3)) + return floor(a+(k+j)*c+k*e), ceil(b+(k+j)*d+k*f) + +def exponential(l,u): + assert 0 <= l <= u < F(1,10) + def poly(x): + s=t=F(1) + for j in range(1,25): t=t*x/j; s+=t + return s,t + lo,_=poly(l);hi,last=poly(u) + return floor(lo),ceil(hi+last*u/25/(1-u/26)) + +def moment(H,m,W,a,bad=False): + lo=hi=F(0) + for r,n in H.items(): + assert 0 < r < m and n > 0 + l,u=logarithm(F(m,r)); e,f=exponential(a*l,a*u) + p=F(r*n,m*W);lo+=p*e;hi+=p*f + if bad: + # Existing envelope shape, only conditionally portable to the new cover. + l,u=logarithm(F(m));e,f=exponential(a*l,a*u) + p=F(32*m*sum(H.values()),10**16*W) + lo+=p*e;hi+=p*f + return floor(lo),ceil(hi) + +def decimal(x): + with localcontext() as c: + c.prec=70 + return str(Decimal(x.numerator)/Decimal(x.denominator)) + +def certify(H,m,W,bad=False): + with localcontext() as c: + c.prec=70 + terms=[(Decimal(r*n)/Decimal(m*W),(Decimal(m)/Decimal(r)).ln()) for r,n in H.items()] + fallback=Decimal(32*m*sum(H.values()))/Decimal(10**16*W) if bad else Decimal(0) + lm=Decimal(m).ln();lo=Decimal(0);hi=Decimal('.003') + for _ in range(210): + a=(lo+hi)/2 + if sum(p*(a*l).exp() for p,l in terms)+fallback*(a*lm).exp()<1:lo=a + else:hi=a + q=int(((lo+hi)/2*10**24).to_integral_value(rounding=ROUND_FLOOR)) + lo=F(q,10**24);hi=lo+F(1,10**24) + lv=moment(H,m,W,lo,bad);hv=moment(H,m,W,hi,bad) + assert lv[1]<10 for v in slacks.values()),{k:str(v) for k,v in slacks.items() if v<=0} + assert min(margins.values())==minimum + assert margins['balanced_prefix']-minimum==eta and 1-eps-r==eta/2 + assert 1-eps*(1+c)==eta-eps*eta/4 + return dict(parameters=dict(a_bit=a,a_complex=b,tau=tau,sigma=sigma, + eta=eta,beta=beta,q=q,c=c,epsilon=eps,lambda_=lam, + lambda_prime=lp,alpha_squared_power=r,delta=delta, + C0=bridge['semantic']['C0'],C1=1,kappa=kappa), + strict_constraints=slacks,margins=margins,minimum_margin=minimum, + absorption_gap=minimum-kappa, + recurrence=dict(internal=internal,leaf=leaf,reservations=1-c)) diff --git a/research/split-centres-global/vendor/export_records.py b/research/split-centres-global/vendor/export_records.py new file mode 100644 index 0000000000..3632d37048 --- /dev/null +++ b/research/split-centres-global/vendor/export_records.py @@ -0,0 +1,72 @@ +"""Export a bitE8/1 word to the PR249 record format read by PR #266's official cohort checkers and PR #315's engines. +usage: python3 export_records.py word.json[.gz] OUTDIR -> OUTDIR/{249-records.bin,249-states.json,frames.json} +Records are int32 six-tuples: MOVE(0,role,old,new,rank,0), ADD(1,dst,src,1,frame,phase), COPY(2,centre,temp,frame,ZERO,rank), +ERASE(3,centre,temp,frame,ZERO,0). A multi-source gate becomes one ADD per source, preceded by the MOVEs of every +register of the gate to the gate frame. Frames: integer basis rows B (label vectors of the frame's root lines in the +word's coordinates, a rational basis) and integer annihilator rows A (standard dot product), as PR #266 expects. +Dylan Crow, with Anthropic Claude assistance; Apache-2.0.""" +import sys, json, gzip, struct, os +from fractions import Fraction as Fr +from math import gcd +def load(p): + with (gzip.open(p,'rt') if p.endswith('.gz') else open(p)) as f: return json.load(f) +c=load(sys.argv[1]); out=sys.argv[2]; os.makedirs(out,exist_ok=True) +v,R,h=c['v'],c['R'],c['h']; n=2*v+R; lines=c['lines'] +def basis(idx): + rows=[]; piv=[]; B=[] + for i in idx: + x=[Fr(a) for a in lines[i]] + for p,r in zip(piv,rows): + if x[p]: f=x[p]/r[p]; x=[a-f*b for a,b in zip(x,r)] + nz=[k for k in range(h) if x[k]] + if nz: rows.append(x); piv.append(nz[0]); B.append(list(lines[i])) + return B,rows,piv +def annihilator(rows,piv): + # rows in echelon (pivot columns piv); free columns give the null space of the row space under the dot product + # reduce to RREF + R_=[r[:] for r in rows] + for i,(p,r) in enumerate(zip(piv,R_)): + R_[i]=[a/r[p] for a in r] + for i,p in enumerate(piv): + for j in range(len(R_)): + if j!=i and R_[j][p]: f=R_[j][p]; R_[j]=[a-f*b for a,b in zip(R_[j],R_[i])] + free=[k for k in range(h) if k not in piv]; A=[] + for f in free: + a=[Fr(0)]*h; a[f]=Fr(1) + for i,p in enumerate(piv): a[p]=-R_[i][f] + L=1 + for x in a: L=L*x.denominator//gcd(L,x.denominator) + ai=[int(x*L) for x in a]; g=0 + for x in ai: g=gcd(g,abs(x)) + A.append([x//g for x in ai]) + return A +frames={} +for k,idx in enumerate(c['frames']): + B,rows,piv=basis(idx); A=annihilator(rows,piv) if B else [[int(i==j) for j in range(h)] for i in range(h)] + assert all(sum(a*b for a,b in zip(x,y))==0 for x in A for y in B) and len(A)+len(B)==h + frames[str(k)]=dict(dim=len(B),B=B,A=A) +dim=[frames[str(k)]['dim'] for k in range(len(c['frames']))] +ZERO=[k for k in range(len(dim)) if dim[k]==0]; assert len(ZERO)==1; ZERO=ZERO[0] +cur=list(c['start']); rec=[] +def move(r,f): + if cur[r]!=f: rec.append((0,r,cur[r],f,dim[f]-dim[cur[r]],0)); cur[r]=f +def run(gates,ph): + for f,d,srcs in gates: + for r in [d]+srcs: move(r,f) + for s in srcs: rec.append((1,d,s,1,f,ph)) +run(c['D'],1); run(c['A'],2) +temp=n +for k,q in enumerate(c['ret']): + fq=cur[q]; rec.append((2,q,temp,fq,ZERO,dim[fq])) + for t,row in enumerate(c['scatter']): + if k in row: rec.append((1,v+t,temp,1,ZERO,3)) + rec.append((3,q,temp,fq,ZERO,0)) +run(c['B'],4); run(c['C'],5) +for r in range(n): move(r,c['final'][r]) +with open(out+'/249-records.bin','wb') as f: + for e in rec: f.write(struct.pack('<6i',*e)) +st=dict(n=n,v=v,h=h,R=R,ZERO=ZERO,initial={str(r):c['start'][r] for r in range(n)},final={str(r):c['final'][r] for r in range(n)}, + retained_totals=c['ret'],source_owned_roles=[],regs=[]) +json.dump(st,open(out+'/249-states.json','w'),sort_keys=True,separators=(',',':')) +json.dump(dict(frames=frames),open(out+'/frames.json','w'),sort_keys=True,separators=(',',':')) +print('exported',len(rec),'records,',len(frames),'frames, n',n,'ZERO',ZERO) diff --git a/research/split-centres-global/vendor/hamming_packets.py b/research/split-centres-global/vendor/hamming_packets.py new file mode 100644 index 0000000000..c129996656 --- /dev/null +++ b/research/split-centres-global/vendor/hamming_packets.py @@ -0,0 +1,253 @@ +"""A structural prototype: mutable source bases and simultaneous signed packets. + +Input geometry is the pinned PR370 Hamming E8 root table. The binary realization, +packet construction, two-shear synthesis and arbitrary-dirt replay below are new +local experiments. This does NOT produce a complete improved E8 supplier. +""" +import gzip +import hashlib +import itertools as it +import json +import random +from collections import Counter,defaultdict +from fractions import Fraction as Q +from pathlib import Path + +OUT=Path('work/complex-network/hamming');OUT.mkdir(parents=True,exist_ok=True) +SRC=Path('work/pr370-source/research/e8-bit/data/bit/bitE8-r865.json.gz') +word=json.load(gzip.open(SRC));roots=word['lines'];v=len(roots) +G=[[sum(x*y for x,y in zip(a,b))//2 for b in roots] for a in roots] +C=[sum((1^(G[i][j]&1))<>p&1:x^=b[p] + if x: + p=x.bit_length()-1 + for q in b: + if b[q]>>p&1:b[q]^=x + b[p]=x + return tuple(b[p] for p in sorted(b,reverse=True)) + +def inside(a,b):return basis(a+b)==b + +indices=[] +for i,row in enumerate(C): + if len(basis([C[j] for j in indices]+[row]))>len(indices):indices.append(i) +assert len(indices)==9 +gram=[sum(((C[i]>>j)&1)<>i)&1)*((gram[i]&b).bit_count()&1) for i in range(9))&1 +orth=[] +for step in range(9): + choices=[x for x in range(1,512) if ip(x,x) and all(not ip(x,y) for y in orth)] + chosen=next(x for x in choices if step==8 or any(y!=x and not ip(x,y) for y in choices)) + orth.append(chosen) +assert all(ip(x,y)==int(i==j) for i,x in enumerate(orth) for j,y in enumerate(orth)) +ports=[] +for i in range(v): + row=sum(((C[i]>>j)&1)<>j)&1) for i in range(v) for j in range(v)) + +blocks=defaultdict(list);frame_lines={} +for i,r in enumerate(roots): + support=tuple(k for k,x in enumerate(r) if x) + if len(support)==4:blocks[support].append(i) + else:assert len(support)==1;frame_lines[support[0]]=i +assert len(blocks)==14 and all(len(xs)==8 for xs in blocks.values()) + +def sparse_add(rows,t,s,q): + for j,x in list(rows[s].items()): + z=rows[t].get(j,Q(0))+q*x + if z:rows[t][j]=z + else:rows[t].pop(j,None) + +def simulate(n,events): + rows=[{r:Q(1)} for r in range(n)] + for t,s,q in events:sparse_add(rows,t,s,q) + return rows + +def serialize(events):return [[t,s,q.numerator,q.denominator] for t,s,q in events] + +packet_table={};module_receipts=[];all_programs=[] +for block,ids in sorted(blocks.items()): + ids=sorted(ids);pos={s:i for i,s in enumerate(ids)} + tetrads=[sorted(s for s in ids if sum(roots[s][k]<0 for k in block)%2==p) for p in (0,1)] + assert all(len(t)==4 for t in tetrads) + faces=[] + for i,j in it.combinations(block,2): + for epsilon in (-1,1): + support=[s for s in ids if roots[s][i]*roots[s][j]==epsilon] + content={s:Q(roots[s][i]) for s in support} + frame=basis([ports[s] for s in support]);assert len(frame)==3 + key=(block,(i,j),epsilon);packet_table[key]=(content,frame) + faces.append((key,content,frame)) + pair_uses=defaultdict(list) + for f,(_,content,frame) in enumerate(faces): + for tet in tetrads: + pair=tuple(s for s in tet if s in content) + assert len(pair)==2 + pair_uses[pair].append(f) + assert len(pair_uses)==12 and all(len(fs)==2 for fs in pair_uses.values()) + bysource=defaultdict(list) + for pair in sorted(pair_uses): + for s in pair:bysource[s].append(pair) + # One of the three pair branches is carried by x itself, two by helpers. + regs={};nextreg=8;events=[];event_frames=[];cur=[basis([ports[s]]) for s in ids] + start=list(cur);dead=[] + def add(t,s,q,F): + assert t!=s and inside(cur[t],F) and inside(cur[s],F) + cur[t]=cur[s]=F;events.append((t,s,Q(q)));event_frames.append(F) + for s in ids: + for j,pair in enumerate(sorted(bysource[s])): + if j==0:reg=pos[s] + else: + reg=nextreg;nextreg+=1;cur.append(());start.append(()) + add(reg,pos[s],1,basis([ports[s]])) + regs[pair,s]=reg + assert nextreg==24 + partial={} + for pair,fs in sorted(pair_uses.items()): + s,t=pair;a,b=regs[pair,s],regs[pair,t];f,g=fs + alpha,beta=faces[f][1][s],faces[f][1][t] + gamma,delta=faces[g][1][s],faces[g][1][t] + assert alpha*delta-beta*gamma in (-2,2) + F=basis([ports[s],ports[t]]);assert len(F)==2 + add(a,b,beta/alpha,F) + k=gamma/(delta-gamma*beta/alpha) + add(b,a,k,F) + partial[f,pair]=(a,alpha) + partial[g,pair]=(b,delta-gamma*beta/alpha) + pre_packets=simulate(24,events) + def clean_rank(registers): + piv={} + for reg in registers: + row=[pre_packets[reg].get(i,Q(0)) for i in range(8)] + for j in sorted(piv): + q=row[j] + if q:row=[a-q*b for a,b in zip(row,piv[j])] + j=next((i for i,q in enumerate(row) if q),None) + if j is not None: + q=row[j];piv[j]=[a/q for a in row] + return len(piv) + choices=[[value for (ff,pair),value in partial.items() if ff==f] for f in range(12)] + rng=random.Random(38639);orientation=None + for trial in range(4096): + bits=rng.randrange(1<<12) + if clean_rank([pieces[1-((bits>>f)&1)][0] for f,pieces in enumerate(choices)])==8: + orientation=bits;break + assert orientation is not None + outputs=[] + for f,(key,content,F) in enumerate(faces): + pieces=[value for (ff,pair),value in partial.items() if ff==f] + assert len(pieces)==2 + if orientation>>f&1:pieces.reverse() + (a,alpha),(b,beta)=pieces + add(a,b,beta/alpha,F) + outputs.append((a,alpha));dead.append(b) + assert len(set(r for r,a in outputs))==12 and len(set(dead))==12 + assert not set(dead)&{r for r,a in outputs} + core=simulate(24,events) + for f,(reg,scale) in enumerate(outputs): + clean={ids[j]:scale*x for j,x in core[reg].items() if j<8 and x} + assert clean==faces[f][1] + + # Probe complete borrowing: output each packet, cancel its old dirt at label + # zero, then undo every source/helper operation at the full frame. + # Actual supplier consumers and their remaining chronology are NOT inferred. + n=36;main=events.copy();dirt=[];chosen_targets=[] + for f,(reg,scale) in enumerate(outputs): + main.append((24+f,reg,scale)) + for j,q in core[reg].items(): + if j>=8:dirt.append((24+f,j,-scale*q)) + valid=[t for t in range(v) if all((ports[t]&x).bit_count()%2==0 for x in faces[f][2])] + assert valid;chosen_targets.append(valid[0]) + cleanup=[(t,s,-q) for t,s,q in reversed(events)] + actual=simulate(n,dirt+main+cleanup) + for r in range(24):assert actual[r]=={r:Q(1)} + for f in range(12): + expected={24+f:Q(1)} + expected.update({pos[s]:q for s,q in faces[f][1].items()}) + assert actual[24+f]==expected + # A mutation of the compensator must corrupt at least one arbitrary dirt column. + wrong=simulate(n,main+cleanup) + assert any(wrong[r]!=actual[r] for r in range(24,36)) + # Inverse-transpose: transpose and negate each elementary shear in the SAME + # event order. Reversing as well would generally compute the wrong map. + dual=simulate(n,[(s,t,-q) for t,s,q in dirt+main+cleanup]) + for r in range(n): + expected={r:Q(1)} + if r<8: + expected.update({24+f:-content[ids[r]] for f,(_,content,F) in enumerate(faces) if ids[r] in content}) + assert dual[r]==expected + receipt={'block':block,'source_lines':ids,'packets':12,'pair_butterflies':12, + 'packet_additions':len(events),'live_source_registers_borrowed':8, + 'helper_registers':16,'total_source_and_helper_registers':24, + 'retired_register_clean_rank':8, + 'independent_pair_branch_comparison_helpers':48, + 'comparison_scope':'48 is a specified independent two-input-form implementation, not the helper count of the current r783 supplier.', + 'frame_rank_counts':dict(Counter(map(len,event_frames))), + 'all_dirty_columns_forward_and_inverse_transpose':n, + 'compensator_omission_rejected':True, + 'scope':'A 12-output packet factory and probe sinks. Not a complete 120-port supplier or global frame schedule.'} + module_receipts.append(receipt) + all_programs.append({'receipt':receipt,'start_frames':start,'events':serialize(events), + 'event_frames':event_frames,'outputs':[[r,str(q)] for r,q in outputs], + 'dead_registers':dead, + 'dirt':serialize(dirt),'cleanup':serialize(cleanup), + 'probe_target_ports':[ports[t] for t in chosen_targets]}) + +# Reconstruct the entire signed E8 neighbour correction from the packet family. +# This proves all 120 rational source columns of the abstract decomposition. +decomposition=[] +for target,r in enumerate(roots): + row=defaultdict(Q);terms=[];support=[i for i,x in enumerate(r) if x] + if len(support)==4: + c=tuple(support) + for d in blocks: + inter=tuple(sorted(set(c)&set(d))) + if len(inter)!=2:continue + i,j=inter;epsilon=r[i]*r[j];content,F=packet_table[d,inter,epsilon] + coefficient=-Q(r[i],2) + assert all((ports[target]&p).bit_count()%2==0 for p in F) + for s,a in content.items():row[s]+=coefficient*a + terms.append({'source_block':d,'pair':inter,'epsilon':epsilon,'coefficient':str(coefficient)}) + for s in blocks[c]+list(frame_lines.values()): + if s!=target and G[target][s]:row[s]-=Q(G[target][s],2) + else: + i=support[0] + for d in blocks: + if i in d: + for s in blocks[d]:row[s]-=Q(roots[s][i],2) + expected={s:-Q(G[target][s],2) for s in range(v) if s!=target and G[target][s]} + assert {s:a for s,a in row.items() if a}==expected + # Eight coordinate centers recover the diagonal after side corrections. + for s in range(v): + center=sum(Q(r[i]*roots[s][i],4) for i in range(8)) + assert center+row.get(s,Q(0))==int(s==target) + decomposition.append({'target':target,'cross_block_packets':terms,'side_support':len(expected)}) + +program_path=OUT/'PACKET-PROGRAMS.json.gz' +program_path.write_bytes(gzip.compress(json.dumps(all_programs,sort_keys=True,separators=(',',':')).encode(),mtime=0)) +report={'status':'PASS_STRUCTURAL_PACKET_PROTOTYPE_NOT_A_NEW_SUPPLIER', + 'source_sha256':hashlib.sha256(SRC.read_bytes()).hexdigest(), + 'binary_address_dimension':9,'binary_gram_rank':len(indices), + 'binary_ports':ports,'root_lines':roots, + 'binary_gram_identity':'p_s dot p_t = 1 + (root_s dot root_t / 2) mod 2', + 'modules':module_receipts,'signed_packets':len(packet_table), + 'full_target_decomposition_columns':120,'full_target_decomposition_entries':120*120, + 'program_sha256':hashlib.sha256(program_path.read_bytes()).hexdigest(), + 'decomposition':decomposition, + 'remaining':['Joint scheduling and charging of all packet fan-outs and target accumulations', + 'Forming all eight centers from the available mixed source basis without an uncharged restore', + 'Full 120-port arbitrary-dirt forward/backward program and restored work stocks', + 'Exact complex adapters and global phases; finite invoice; two independent prices and outer assembly'], + 'no_new_coarse_b_or_kappa_claim':True} +(OUT/'PROTOTYPE.json').write_text(json.dumps(report,indent=2)+'\n') +print('PASS: 14 factories, 168 signed packets; each factory uses 8 source + 16 helper registers') +print('PASS: exact dirty forward and inverse-transpose columns, omission controls, all 14400 decoder entries') +print('NOT A SUPPLIER: global scheduling, mixed-basis centers, phase and full price remain open') diff --git a/research/split-centres-global/verify.py b/research/split-centres-global/verify.py new file mode 100644 index 0000000000..01d78bf0d1 --- /dev/null +++ b/research/split-centres-global/verify.py @@ -0,0 +1,51 @@ +"""Verify the selected two-supplier composition using Python's standard library.""" +import argparse,gzip,hashlib,json,os,shutil,subprocess,sys +from pathlib import Path +assert __debug__, 'Assertions must remain enabled' +ROOT=Path(__file__).resolve().parent +ap=argparse.ArgumentParser(description=__doc__) +ap.add_argument('output',type=Path,help='A new output directory outside this package') +ap.add_argument('--replay-phases',action='store_true',help='Recompute all selected Gaussian phase pairs instead of reusing their source-bound evidence') +a=ap.parse_args();out=a.output.resolve() +assert not out.exists() and not out.is_relative_to(ROOT) +def snapshot(): + return {p.relative_to(ROOT).as_posix():hashlib.sha256(p.read_bytes()).hexdigest() for p in ROOT.rglob('*') if p.is_file() and p.name!='MANIFEST.json'} +manifest=json.loads((ROOT/'MANIFEST.json').read_text());assert snapshot()==manifest['files'],'Source manifest mismatch' +sources=json.loads((ROOT/'SOURCES.json').read_text()) +for z in sources['imported_files']: + data=(ROOT/z['path']).read_bytes();assert hashlib.sha256(data).hexdigest()==z['sha256'] + if 'source_sha256' in z:assert hashlib.sha256(gzip.decompress(data)).hexdigest()==z['source_sha256'] +out.mkdir(parents=True) +def copy(src,dst): + p=out/dst;p.parent.mkdir(parents=True,exist_ok=True) + data=(ROOT/src).read_bytes();p.write_bytes(gzip.decompress(data) if src.endswith('.gz') and not dst.endswith('.gz') else data) +for src,dst in [ + ('inputs/e8-r865.json.gz','work/pr370-source/research/e8-bit/data/bit/bitE8-r865.json.gz'), + ('inputs/complex-ports.json.gz','work/higher-stage-e8/verified/gcert1-e8-retimed.json.gz'), + ('inputs/complex-template.json.gz','work/complex-nine-native/GLOBAL-TEMPLATE.json.gz'), + ('inputs/complex-data-phases.json.gz','work/complex-nine-native/DATA-PHASES.json'), + ('inputs/bit-geometry.json.gz','inherited/bit-geometry.json.gz'), + ('vendor/clifford_exact.py','work/odd-stages/clifford_exact.py')]:copy(src,dst) +for name in ('moment','base_two_moment','outer'):copy('vendor/engines/'+name+'.py','work/pr361/code/engines/'+name+'.py') +p=out/'bit426-source-centres';p.mkdir();(p/'bit-input.json').write_bytes(gzip.decompress((ROOT/'inputs/bit-r767.json.gz').read_bytes())) +env=dict(os.environ,E8_OUTPUT=str(out),E8_REPLAY_PHASES=str(int(a.replay_phases)),PYTHONDONTWRITEBYTECODE='1');env.pop('PYTHONOPTIMIZE',None) +steps=[] +def run(name,file,*args): + with (out/(name+'.log')).open('w') as log: + r=subprocess.run([sys.executable,'-B',str(ROOT/file),*map(str,args)],cwd=out,env=env,stdout=log,stderr=subprocess.STDOUT) + if r.returncode: + print((out/(name+'.log')).read_text()[-16000:],file=sys.stderr,flush=True) + raise RuntimeError((name,r.returncode,str(out/(name+'.log')))) + steps.append(name);print('PASS',name,flush=True) +run('hamming_packets','vendor/hamming_packets.py') +for name in ('complex_construct','complex_audit','complex_emit','complex_phases','bit_construct'):run(name,'code/'+name+'.py') +run('bit_export','vendor/export_records.py',p/'bit-source-centres.json',p/'records') +run('bit_global','code/bit_global.py','--source',p,'--local-check',p,'--out',p/'global') +run('bit_audit','code/bit_audit.py','--local-check',p,'--out',p/'global') +for name in ('bit_price','complex_integrate','complex_replay','combined'):run(name,'code/'+name+'.py') +assert snapshot()==manifest['files'],'Package modified during verification' +r=json.loads((out/'RESULT.json').read_text());expected=json.loads((ROOT/'EXPECTED.json').read_text()) +for key,value in expected.items():assert r[key]==value,(key,r[key],value) +r['verification_steps']=steps;r['phase_mode']='full replay' if a.replay_phases else 'source-bound unchanged evidence';r['manifest_sha256']=hashlib.sha256((ROOT/'MANIFEST.json').read_bytes()).hexdigest() +(out/'RESULT.json').write_text(json.dumps(r,indent=2)+'\n') +print('PASS conditional kappa',r['kappa_decimal']) diff --git a/research/split-centres-kernel-r747/.gitattributes b/research/split-centres-kernel-r747/.gitattributes new file mode 100644 index 0000000000..a251e913f2 --- /dev/null +++ b/research/split-centres-kernel-r747/.gitattributes @@ -0,0 +1,6 @@ +# Hashes bind exact imported and generated bytes. +* -text +vendor/** -whitespace +inputs/** -whitespace +notices/** -whitespace +proofs/** -whitespace diff --git a/research/split-centres-kernel-r747/CERTIFICATE.json b/research/split-centres-kernel-r747/CERTIFICATE.json new file mode 100644 index 0000000000..7e807079c1 --- /dev/null +++ b/research/split-centres-kernel-r747/CERTIFICATE.json @@ -0,0 +1,119 @@ +{ + "status": "PASS_CONDITIONAL_SPLIT_CENTRE_ASSEMBLY", + "kappa": "560432476129139/500000000000000000", + "kappa_decimal": "0.001120864952258278", + "bit_lower": "561061350132569610283/500000000000000000000000", + "complex_lower": "1183986549206329/1000000000000000000", + "binding_component": "bit", + "gain_over_pr425_percent": 6.9522005058117555, + "bit_invoice": { + "prefix_bits": 223, + "charged_prefix_bits": 256, + "coefficient_bits": 223, + "two_level_coefficient_bits": 483, + "charged_two_level_coefficient_bits": 512, + "row_coefficient": 18355, + "live": 14502, + "physical": 14511 + }, + "strict_outer_constraints": { + "bit_positive": "14363170563393781995540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "complex_above_bit": "791857266447229204459483569705102945201339627252022591017013352985113602942786795000164759817249951996149235225861576966507630300630689893816878766552471016817/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "complex_below_one_over32": "30066013450793671/1000000000000000000", + "beta_positive": "1/1000000000000000000", + "beta_below_one": "999999999999999999/1000000000000000000", + "leaf_saving_above_bit": "791857266447229189304455739864091745201339627252022591017013352985113602942786795000164759817249951996149235225861576966507630300630689893816878766552471016817/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "q_positive": "7181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "q_below_internal": "14363170563393781995540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "q_below_leaf": "395928633223614609015398433325827868141186243920908350307167049240534210454380044514968776965838180997909857795680836487104579924453767980400809082645545614591621233447528983183/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "c_positive": "7181585281696892583407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "c_below_one": "6392818414718303107416592912348246333468141186243920908350307167049240534210454380044514968776965838180997909857795680836487104579924453767980400809082645545614591621233447528983183/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "q_below_reservations": "1/4000000000000000000", + "lambda_above_tau": "14363170563393781995540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "lambda_above_sigma": "791857266447229218822654133098884940741856057546919645815673725733091011925773442015051156874463156995984475408611624970358395074769112927309248465921781123000121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "lambda_above_internal": "14363170563393781995540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "lambda_prime_above_lambda": "14363170563393781995540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "compact_leaf": "395928633223614609015398433325827868141186243920908350307167049240534210454380044514968776965838180997909857795680836487104579924453767980400809082645545614591621233447528983183/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "compact_reservations": "1/4000000000000000000", + "lambda_prime_below_one": "7181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "epsilon_positive": "6399999999999999993600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817", + "epsilon_below_one": "7181585281696897383407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817", + "guard_width": "7181585281696897383407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817", + "K_geometry": "4807181585281696892583407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817000000000000000000", + "K_dominates_log": "231664041345061050845983947421186256401668584010497584446258683699366907737186677571792433338340060113453513521617978855187267028104098984087218414251878140832554446748323117142213588175726741393/206683276944570867451077647988766247307479316572776744891925575256476111799662761934047904233001101994161357746522719973016545013550824072000632231965075950141464786411824273258607000000000000000000", + "record_suffix": "7181585281696897383407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817", + "phase_local": "57452682253575172660075115932332441271463422396879066665683849849996634666672126693120783994727674596531689914600391489101073218400050692643898107263289403063667839215065313749127621233447528983183/51257452682253575127867256701214029332254870510048632733197542663606075726316364959643880249784273294552016721137634553308103163360604369856156793527338835635083267030132419768134536000000000000000000", + "phase_boundary": "11490536450715029406269754961108975467567014357972880107649718965136053613580158978016584167309038954918313004492748842618542529916554807718463285392220894997054215109129499241498821233447528983183/10251490536450715025573451340242805866450974102009726546639508532721215145263272991928776049956854658910403344227526910661620632672120873971231358705467767127016653406026483953626907200000000000000000", + "gamma_sublinear": "1/2000000000000000000", + "cell_above_band": "12799999999999999980792818414718303109016592912348246333468141186243920908350307167049240534210454380044514968776965838180997909857795680836487104579924453767980400809082645545614591621233447528983183/25628726341126787563933628350607014666127435255024316366598771331803037863158182479821940124892136647276008360568817276654051581680302184928078396763669417817541633515066209884067268000000000000000000", + "prime_interval_packing": "7181585281696897383407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817", + "alpha_positive": "14363170563393788359632590021810442080310539860404516767526852145439839929398406960210596656522703682519149061374476508023700697946773300526302961759162676751217566615750487648225621233447528983183/12814363170563393781966814175303507333063717627512158183299385665901518931579091239910970062446068323638004180284408638327025790840151092464039198381834708908770816757533104942033634000000000000000000", + "alpha_below_one": "12799999999999999993607181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817/12814363170563393781966814175303507333063717627512158183299385665901518931579091239910970062446068323638004180284408638327025790840151092464039198381834708908770816757533104942033634000000000000000000", + "alpha_below_one_fourth": "3189227622077454657132070953804066391185618867017635029057319564329939892965374403017531918954994377226981896009727683073732747012090999815483496633699514550441486622767525747860182878766552471016817/12814363170563393781966814175303507333063717627512158183299385665901518931579091239910970062446068323638004180284408638327025790840151092464039198381834708908770816757533104942033634000000000000000000", + "delta_positive": "1/8000000000000000000", + "delta_below_one_eighth": "999999999999999999/8000000000000000000", + "short_record_fallback": "81827972558059963142482295831039750365059753405165839859500887157900070163784215146039541956047009515286378723945407637791323146319740145866082020356197908534083134290654194352838948148633280800174595114507063924980758679362172726895650066012032777455278212210736064133662717611940569491044304210260992667579958374711353997952140066809896811489/82011924291605720204587610721942446931607792816077812373116068261769721162106183935430208399654837271283226753820215285292965061376966991769850869643742137016133227248211871629015257600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "small_field_exposure": "1/1000000000000000000", + "artificial_boundary": "358859621458028601093359598365557325330989185343344322865175917750116843085479998176003320395642823216282588862770178911921831577311447916339793034478937323776724933813811421508232513136299657413050451/51257452682253575127867256701214029332254870510048632733197542663606075726316364959643880249784273294552016721137634553308103163360604369856156793527338835635083267030132419768134536000000000000000000", + "literal_scalar_guard": "1", + "row_product_gap": "23971789/25", + "balanced_prefix_above_kappa": "5122866517862023505724960619093421545844111701898553134698525509504383311993872387184513125657251444712150871805627114225726283245038727038504547469670408073428467093191496467269437/3203590792640848445491703543825876833265929406878039545824846416475379732894772809977742515611517080909501045071102159581756447710037773116009799595458677227192704189383276235508408500000000000000000", + "coordinate_movement_above_kappa": "16099174487823595540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "compact_phase_layer_above_kappa": "3838551450442350120466514150535089425156364590041027177747358186058007158198199154413541220091468727605299653469049909287939671070001907844989495748423461692471525807616440463522057/6407181585281696890983407087651753666531858813756079091649692832950759465789545619955485031223034161819002090142204319163512895420075546232019599190917354454385408378766552471016817000000000000000000", + "bulk_exposure_above_kappa": "16099174487823595540516430294897054798660372747977408982986647014886397057213204999835240182750048003850764774138423033492369699369310106183121233447528983183/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "Gaussian_arithmetic_above_kappa": "49929956359383891636682334467235976400846493161596454696927943987316335662954230095174784854400852306299403498179012231794056054820241901455974763560139756902928431597231181121226907/51257452682253575127867256701214029332254870510048632733197542663606075726316364959643880249784273294552016721137634553308103163360604369856156793527338835635083267030132419768134536000000000000000000", + "scalar_work_above_kappa": "3022347308020427168024638512713719642678957136664830842541068612764774941044496502999868999171719558143016474349913180337924305460021763455362126412952366988818802604491895640211767/2050298107290143005114690268048561173290194820401945309327901706544243029052654598385755209991370931782080668845505382132324126534424174794246271741093553425403330681205296790725381440000000000000000", + "dimension_above_kappa": "3196409207359151553231162974036146672459031212215382000019265285423173401803752699526640796382355306275012080586149285130394424095589341109716483649580049811311843280287131837920058593191496467269437/3203590792640848445491703543825876833265929406878039545824846416475379732894772809977742515611517080909501045071102159581756447710037773116009799595458677227192704189383276235508408500000000000000000" + }, + "outer_controls": [ + "next_grid", + "zero_eta", + "zero_beta", + "unit_beta" + ], + "bootstrap": [ + { + "gap": "48640105104416009930955104551272628756769/40000000000000000000000000000000000000000000000", + "cutoff_log2": "24346328299693" + }, + { + "gap": "10916033216189494908506938862091413300675156484737667525550897/8000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "19335382939135799529" + }, + { + "gap": "2449825733746901655394438404809502019511708753179325050819248403056515410563319361/1600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "15355787073969246541017124" + }, + { + "gap": "549801013506219857550281901936704203615404924098069138182437287931091972275689180385852832590942771793/320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "12195269025875323655994833423982" + }, + { + "gap": "123388839576821941106964776874551364767558290306753584545234931806617408234472738882773008179061080923160999418343337504609/64000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "9685246734476302780854842486398253310" + }, + { + "gap": "27691483569705102945201339627252022591017013352985113602942786795000164759817249951996149235225861576966507630300630689893816878766552471016817/12800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "cutoff_log2": "7691835588756193183914168151850588989363719" + } + ], + "bit_template_sha256": "c40f89a2ae3c2c5635ddf8f18d74f24567ddf67fc8c8e93a1fc7a1a8098e857e", + "complex_template_sha256": "942d030fa43316c560c88d7d7d904583446e1a96945b3ebd37a91c88a192ab4f", + "scope": "Finite research composition with explicit changed words, exact local and global replay and incremental phase evidence. All-size correlated dirty-bank, compressed-window, compiler, restored-work, tape/common-grid, precision and analytic interfaces remain inherited assumptions. This certificate makes no unconditional integer-multiplication or Lean-kernel claim.", + "verification_steps": [ + "hamming_packets", + "complex_construct", + "complex_audit", + "complex_emit", + "complex_phases", + "bit_construct", + "bit_export", + "bit_global", + "bit_audit", + "bit_price", + "complex_integrate", + "complex_replay", + "combined" + ], + "phase_mode": "source-bound unchanged evidence" +} diff --git a/research/split-centres-kernel-r747/EXPECTED.json b/research/split-centres-kernel-r747/EXPECTED.json new file mode 100644 index 0000000000..06a6966a8d --- /dev/null +++ b/research/split-centres-kernel-r747/EXPECTED.json @@ -0,0 +1,9 @@ +{ + "kappa": "45340333148791/40000000000000000", + "kappa_decimal": "0.001133508328719775", + "bit_lower": "1134794627881866057683/1000000000000000000000000", + "complex_lower": "1183986549206329/1000000000000000000", + "binding_component": "bit", + "bit_template_sha256": "f5a618aec19371f8448b8096a701f190e2f20ca1334ce89ab7eede437ff0a5ea", + "complex_template_sha256": "942d030fa43316c560c88d7d7d904583446e1a96945b3ebd37a91c88a192ab4f" +} diff --git a/research/split-centres-kernel-r747/LICENSE b/research/split-centres-kernel-r747/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/split-centres-kernel-r747/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/split-centres-kernel-r747/MANIFEST.json b/research/split-centres-kernel-r747/MANIFEST.json new file mode 100644 index 0000000000..e7cb4bbdc6 --- /dev/null +++ b/research/split-centres-kernel-r747/MANIFEST.json @@ -0,0 +1,63 @@ +{ + "files": { + ".gitattributes": "2f9541c7c27f084baad73b4cd50ddaeb264cc3aa8dbf13ec21df5ab3f673ca7e", + "CERTIFICATE.json": "f71580f22193726fb582eae604807ff70a7302265e001d9484a718e63bbe14c4", + "EXPECTED.json": "1563715b7b1ba846ec9dfabf6badd61913269fc84dfb349299a73d530aaac4a9", + "LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "NOTICE.md": "36c3eedbed8c4d3201cb8045615baf9a42a8ccc9ed346e0439857fe1fedebad3", + "PROOF.md": "0f482e06aeda510e08055848bc2b68d30c93ed1722b9ed5e7613f96cf6346dde", + "README.md": "aebe7e50b25e43818f844886ae01c08c712b5453604fccac393631592fe9d0d2", + "SOURCES.json": "11aa666d678fed084b01d1e8e47239e1674eaedbc6fe0cee7edb2753477af9be", + "VALIDATION.json": "4957420a5a988e045537e31f79da7f8d35592185d45802c0ff4adfd0d97a772e", + "code/bit_audit.py": "b2b4b792f14ac9946bdcd1bf4c0d47c46fe05ff6ff9c5f0317037c9a1ee1e5fe", + "code/bit_construct.py": "a461e6c983531beb5c8ac82ff593f39ce4e056387d1d6061f6e6b294dde4395f", + "code/bit_global.py": "b3a486487e223ef0e2b4fd212063c1506740ba18765e99878e07d06968877eca", + "code/bit_kernel.py": "14f164fcc0674f73163808a9d9762eb439ea130895f593cb78a6cafaed2dfb11", + "code/bit_price.py": "36bf15803567a95b139a908461541bf19efe1f5b85fb31c270021833ab1393ee", + "code/bit_reset.py": "000983f6c09ba3baa90cdee69a03464680b6963cfd4f8f7b9301d4e0e6acd6f5", + "code/combined.py": "825c32a81529da35a347666468585c69d66c0ee161717f2994769782fb57e29e", + "code/complex_audit.py": "adeba5ea113652b60105db2e8719b18ffa292d3cc23730cca614b40272348330", + "code/complex_construct.py": "0f7f45b2333ec7daf4291e2bf675b49bc330b97fb5965dd27220ba353c291d6f", + "code/complex_emit.py": "f56d5f01f7c121741f175814138dca7190d769920f0a27e2d5b99c21aebed0f1", + "code/complex_integrate.py": "3792f41e409383e6989bda22801a4836a646a530f99e99bbd7244a8f3a1a8b4f", + "code/complex_phases.py": "3e2a52198475ee280a314895ab74df8437e3c0de0cad2d90baa370aa2a52c364", + "code/complex_phases_full.py": "0f2795aaffafe0c64d77f3748ef2109a3c42c58da867e4cf269a0a8cb6109466", + "code/complex_replay.py": "be2dccce2d1ad2c4f5c01a851c9c3896cc88236b5aeae706aad2ab16d6bfdad9", + "inputs/bit-geometry.json.gz": "5c980202227859e8bb9b863f94503930c2a59d460c0421356688e2b0d828b4a1", + "inputs/bit-r767.json.gz": "bd3b84244528767b85d8d7fe423b155630b5c659e21e51563674b1dcb6305ad7", + "inputs/complex-data-phases.json.gz": "c972b5b60649c2a52354f5160f69adc0f4a270fa09d32012beff9888774ab84f", + "inputs/complex-phase-receipt.json": "b7e9de8137ed1de3e72a94c3a11525a8ff3770c914a43e3c3b82fd5d75264b32", + "inputs/complex-phase-recipes.json.gz": "b5472bb1d3f9ff41b0819780a42886a7686b4caf3c0617bb1dc86158b3fb8671", + "inputs/complex-ports.json.gz": "77b0c0fa19ef3da1c7316010e13493aa5eea1a50c3506eddc08f7480e659878b", + "inputs/complex-template.json.gz": "1b84904a31a733aab9bfdda3f528c06719f590d2133a43687a8bded955dc991e", + "inputs/e8-r865.json.gz": "1fb726ea3818fe0837cceb0dd22a71a0814f064e5e781628104610d6468e0e55", + "notices/NOTICE-PR352.md": "967e6d7e76e216e4898cf543c75b527e8d397ec1ddba3800cb20701f24c89524", + "notices/NOTICE.md": "025773f32fb43667395e64c627a1752877bdc93afbfe01b106703eee438d21d3", + "notices/PR386.txt": "ae2241615a23063b18a04f1b7a88a52e62b3d7d42e333fbd21e3668567ab83d1", + "notices/PR426-SOURCE-PINS.json": "18ace817f2f9af22511bb303e99656ed114e534b87f3dd95a65ca4ca670baf2f", + "notices/PR426.md": "6a5593d0f284a2f0865037f5c5fa9e5f76f9e12cf50ec5284486d3b8137c89da", + "notices/SUSSMAN-NOTICE": "9419dd03a2f52cf8bdfc4d18216ce29f263ab583b27f01ced8e420985bcb7c81", + "proofs/INHERITED-COMPLEX-GEOMETRY.txt": "c1ff55536594222a8d2a30bc0e0956959774e1be2d5420b7838ad553ee556df2", + "proofs/PR386-BIT-GEOMETRY.txt": "c5f077b849e9add9957ab4ee36095dd47bc678dee7e09baa146dac4c0a0d66b2", + "proofs/PR425-COMPLEX.txt": "2cda27b9b9a1eb24127c38c2c7a6e085155a2472183e220189a3ea2c2b7720dc", + "proofs/PR426.md": "5787738ceb6faf14d3d96e8452592860a6c6a469733a9bcf196e8d1562ba1ffb", + "stages/kernel-selection.json": "4db07350804923c5c2bdb0aadb5dd4366f55b0e349dccad96d69a09feac9ad9e", + "vendor/clifford_exact.py": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962", + "vendor/engines/base_two_moment.py": "aee70c242a2f1d225528fabe2002e1564d1dc884797c07d28a831c7878ee9098", + "vendor/engines/moment.py": "81cbc864e106418fc7854322746f72180cb8110ff39f74450a3b8d55a82c1482", + "vendor/engines/outer.py": "c1ebb52163a7219504c728a5c2b098bf1e50bf20148a2879c5a74c3cadc7c03c", + "vendor/export_records.py": "8a5999601f917dbb492bb9ae9a344611f18cc7cedc53dc3c76496a369e530eb3", + "vendor/hamming_packets.py": "daa9301e2767a711cfe66c6bebaad68e1a3bdb97ec9e848c927527ab43b37ae5", + "vendor/kernel417/LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "vendor/kernel417/e8core.py": "3f4e25f700b7eb5821ab9cdfc65541f3f921baffeb8704beb21c6d7072052d29", + "vendor/kernel417/engines/base_two_moment.py": "aee70c242a2f1d225528fabe2002e1564d1dc884797c07d28a831c7878ee9098", + "vendor/kernel417/engines/moment.py": "81cbc864e106418fc7854322746f72180cb8110ff39f74450a3b8d55a82c1482", + "vendor/kernel417/engines/outer.py": "c1ebb52163a7219504c728a5c2b098bf1e50bf20148a2879c5a74c3cadc7c03c", + "vendor/kernel417/stages.py": "e73ab7836519510ed30dd7e3022dae557fa50fc513d723197929bff741859668", + "vendor/pr434/LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "vendor/pr434/SELECTION.json": "9d47ade3fb69b3ef62a1a3ae75cebdddd57d144923977c5f2a07848ab596ea32", + "vendor/pr434/replay.py": "e0782ba05dda36323500390349d1180f6117a9c6112b09b9e21e29f67c4e5f5f", + "verify.py": "46ed1039f35480fef612d54f12fd874e2266c0ce3baab692603886bc7aa4c58b" + }, + "format": "split-centres-global-manifest/1" +} diff --git a/research/split-centres-kernel-r747/NOTICE.md b/research/split-centres-kernel-r747/NOTICE.md new file mode 100644 index 0000000000..ee51ac2694 --- /dev/null +++ b/research/split-centres-kernel-r747/NOTICE.md @@ -0,0 +1,44 @@ +# Attribution + +Copyright 2026 icekylinx. New split-centre cancellation, reversible source-centre +composition, integration and verification changes were prepared by icekylinx +with substantial OpenAI Codex assistance. Apache-2.0 applies to these changes. +Earlier private Pro exploration used GPT-6 Astra; the new construction and +composition in this package were developed with Codex. + +## Direct sources + +- Zhihao Chen, with OpenAI Codex assistance: PR425's mutable-basis Hamming packet + producer, common-frame scalar interface, exact phase lowering and verification; + PR386's compressed nine-stage bit geometry, owner template, audit and finite + accounting. These supply the immediate complex and geometric baselines. +- ai-nanachi, with OpenAI Codex assistance: PR426's R767 bit word, including 55 + clean-reset helper reuses and 54 frame changes. The complete selected word is + imported unchanged before the nine source-centre replacements. +- Dylan Crow (utcorvusvolat-dotcom), with Anthropic Claude assistance: PR370's + Hamming E8 bit producer, root table, record exporter and local format. +- Jacob Sussman: the E8 family, complex unit and underlying interchange framework. +- applecrusher, Dugongue, eumemic, Rohan Arun, Chafik Boukhalfa, DaysSky, + DreamingOfClouds, Henry Grant, Evan McKinney, LJH-217 and other contributors: + the source, frame, compiler, rational-pricing and analytic lineage detailed + in the preserved original notices. + +The current value is computed from the two actual resulting programs. +Independently published improvements are not added numerically. `SOURCES.json` +records original commits and file hashes; `notices/` preserves source notices. +Files under `proofs/` describe their original packages and retain their original +scope and attribution; the current statement is in `PROOF.md`. + +## Earlier contributions by icekylinx + +The earlier #10, #18, #24, #32 and #36 contributions developed projector batching, +partial-swap frames, endpoint gauges and conditional analytic/tape integration. +The subsequent #104, #115, #130 and #144 contributions covered stopped-product +integration, partial gauges, three-stage covers and paired-cube/source chronology. +These provide historical context, not additional savings in this ledger. The +source-centre idea from the preceding local round is used here on PR426's bit +word. Unselected research experiments and superseded submission candidates are +not part of this package. + + +Kernel stage (this package): code/bit_kernel.py, the bank-tiling and audit changes in code/bit_global.py / code/bit_audit.py, stages/kernel-selection.json - rohanarun with Anthropic Claude assistance, Apache-2.0. vendor/kernel417/ is chafreaky's PR #417 code (e8core.py, stages.py, engines/), Apache-2.0, with two marked assertion relaxations. diff --git a/research/split-centres-kernel-r747/PROOF.md b/research/split-centres-kernel-r747/PROOF.md new file mode 100644 index 0000000000..9f0346913c --- /dev/null +++ b/research/split-centres-kernel-r747/PROOF.md @@ -0,0 +1,198 @@ +# Split centres and a joint conditional exponent + +The finite construction gives + +$$ +T(n)=O\!\left(n(\log n)^{1-\kappa}\right), +\qquad \kappa=0.001120864952258278, +$$ + +conditional on the retained all-size compiler, compressed-window, correlated +bank-dirt, restored-work, fixed-tape/common-grid, precision and analytic +interfaces. The changes below concern both finite suppliers. Original source +proofs and notices are retained; they do not replace the changed checks. + +## 1. Cancel coordinate terms before lifting the complex decoder + +Partition the 120 Hamming E8 root lines into the 112 code lines C and the eight +coordinate lines F, represented by 2e_i. Write r_s for a root representative and +G_ts = r_t · r_s / 2. The parent decoder is the rank-eight centre factorization +G/2 together with its negative off-diagonal entries. + +For each code target t, the coordinate-source centre contribution is +r_ti x_(2e_i)/2. Its side contribution is its negative. Cancel this pair before +constructing the lifted program. For code targets retain only + +$$ +Z_i=\sum_{s\in C}r_{si}x_s, +\qquad +\sum_i\frac{r_{ti}}4Z_i +-\sum_{\substack{s\in C\\s\ne t}}\frac{G_{ts}}2x_s=x_t. +$$ + +For coordinate targets, implement the identity x_(2e_i) directly. Thus the +entire 120-by-120 clean decoder is still the identity, including both cross +blocks between C and F. + +In the parent's binary address realization, + +$$ +p_s\cdot p_t=1+G_{st}\pmod2. +$$ + +Every code source contributing to Z_i is orthogonal to p_(2e_i), because its +ith root coordinate is ±1. The already constructed global sum Z_i lies in that +rank-eight hyperplane. Copy it there, lower the private copy to frame zero with +one rank-eight child, and scatter into the code targets. The eight coordinate +identities copy their source lines with one rank-one child each. Each private +copy has a sequential lifetime, and is erased before the next episode. + +The total copied rank is unchanged: + +$$ +8\cdot8+8\cdot1=72. +$$ + +The 112 coordinate-source helpers and eight dedicated full-centre helpers are +removed. Own-block corrections use their original source-copy rows directly; +all remaining signed packets and selected target butterflies are retained. +The actual helper count is 560. No rank-four recovered row is substituted for +a rank-three input. + +## 2. Arbitrary dirt and heterogeneous copy frames + +The explicit main word has block form z' = Uz and y' = Vy + x + Ks, where +z=(x,s), and U,V are invertible. No target feeds z. At the common initial frame, +apply V^-1 to the target basis and the literal correction -V^-1 Ks. Recompute K +from the new word. After all main gates and final climbs, apply the literal +inverse of the source/helper subword at the common full frame. This restores +all sources and arbitrary helpers while adding x to y. + +The parent common-frame proof applies to each copy separately. A private copy +created at label L(F) is lowered by the exact operator L(0)L(F)^-1, whether F +has rank one or eight. Scalar operations occur only at equal labels. Adding +the common exterior window to both labels cancels it exactly. The proof +therefore does not require a full-frame centre, or infer an operator from rank +alone. The inverse-transpose negates/transposes each scalar shear in the same +order and reverses each private gather/child/scatter operation as emitted. + +Both scalar orientations and the serialized private-work programs replay all +800 input columns. Both restore arbitrary source/helper inputs and erase private +work. The changed exact Gaussian recipes include the heterogeneous centre +transitions and their global phases. Of 2,918 selected directed pairs, 248 were +newly computed; 2,670 were unchanged source-bound exact pairs already checked in +the local phase run. The release optionally replays all selected pairs. + +The local paid profile is + +$$ +\{1:1912,\ 2:784,\ 3:168,\ 4:224,\ 5:392,\ 8:24\}. +$$ + +The compressed complex geometry uses m=73, eight replicas and nine stages. +There are 560 banks per stage, each holding eight whole rank-nine residuals and +one paid rank-one pad. Live width is 12,720; physical stock is 13,298, including +16 centre slots, the conservative 560-row tableau reserve and two coefficient +streams. The global rank deficit is 2,496. Explicit owner tables, padding, +terminal translations and the cover correction are independently decoded. +The largest child is 48; 73² > 2·48² gives two-level halving. + +The fresh invoice fits the retained 2^30000 router, 2^100000 literal and 2^210000 +precision reserves. Two exact rational engines certify + +$$ +b=0.001183986549206329. +$$ + +## 3. Source-centre bit composition + +Start with the exact R767 word from PR426. Its nine retained rows are written +only by original sources at the full frame and are not read by ordinary A/B +gates. Their nine independent binary forms have an invertible minor in source +columns 0,1,2,4,8,9,16,32,64. + +Replace those rows of the 120-dimensional identity by the nine retained forms. +Exact elimination produces an invertible source basis T, emitted as 559 XOR +additions. Delete the nine retained helper rows and their old-dirt columns. +After A apply T, perform the same nine sequential copies using the designated +source rows, and immediately apply T^-1 before B. The copies have unchanged +rank eight. All scalar operations of T and its inverse use the full frame. + +All 998 columns, arbitrary dirt, frame incidences and restoration pass. Omitting +T^-1 or the remaining old-dirt correction fails. The actual exported record +stream is reflected in reverse order with complementary frames. A reflected +ERASE becomes a fresh COPY at that chronological point; the original source +row remains unchanged within each copy episode. Both reflected programs and +all nine composed invocations are replayed, rather than assuming that mutable +source rows meet an old immutability restriction. + +Use the unchanged compressed bit windows in dimension 64: a local eight-space +and eight exterior seven-spaces. The root data, rational frame family, form, +port isometries and bank slots are source-bound to PR386. Every changed nested +pair is checked by exact rational spans; positive definiteness gives the +projector identity and its reflected version. There are 758 banks per stage, +each filled by eight rank-eight residuals, with no padding. Live width is 14,502 +and physical stock is 14,511. All 54,576 owner assignments are checked. The +unbanked global replay restores all 7,782 independent columns. + +The bit local profile is + +$$ +\{1:2367,\ 2:875,\ 3:475,\ 4:321,\ 5:164,\ 7:14,\ 8:9\}. +$$ + +Its global deficit is again 2,496. The maximum child is 42 and 64² > 2·42². +The actual cancellation-free prefix bound needs 223 bits; the new charge is +256 bits, replacing the parent's 192-bit allowance. The finite two-level +coefficient needs 483 bits and fits the retained 2^512 allowance. The row +coefficient is 18,355 < 20,161. These costs, including the basis operations, +are recomputed from the emitted word. Two exact rational moment engines give + +$$ +c=0.001122122700265139220566. +$$ + +## 4. Joint strict assembly + +Both moments include the inherited 10^-16 bad-branch allowance. The bit supplier +binds because c < b. Let eta=beta=10^-18 and + +$$ +s=\min\{c,(1-\beta)b\}-10^{-24}. +$$ + +Starting at a_0=384599/10^10, use six fixed ordinary bootstrap levels + +$$ +a_{j+1}=(1-s)s+sa_j. +$$ + +All bootstrap cutoff inequalities are checked with the actual charged finite +coefficient. With q=a_6(1-2eta), choose the greatest 10^-18 grid point strictly +below (1-eta)q/(1+q). It is + +$$ +\kappa=\frac{560432476129139}{500000000000000000} + =0.001120864952258278. +$$ + +All 47 retained strict outer inequalities pass. The next grid point, zero eta, +zero beta and unit beta are rejected. The candidate is computed from both +actual new templates; no independently reported savings are added together. + +The source-bound finite claims above do not discharge the inherited all-size +interfaces or establish unconditional integer-multiplication complexity. + + +## Addendum: shared-donor kernel entrances in the compressed bit geometry + +The kernel stage changes only helper chains: a pivot p starts at its entrance E (a root-closed frame inside the first frame +of p and of every donor) instead of the zero frame and drops its frame-0 completion reads; every donor d of E adds p at E +before the first A gate and again at FULL after the last C gate. Over F2 the completion responses satisfy +resp(p) = XOR resp(D), so every target column is unchanged and every helper column is restored (checked by the exact replay +on all 998 local columns, with arbitrary dirt, and by the global scalar replay). Frame nesting and the integer source-span +rule are rechecked. In the compressed nine-stage construction a helper's residual is its endpoint dimension minus its +entrance dimension; a helper of entrance rank e occupies a width-(8 − e) coordinate block of a 64-dimensional bank. The +tiling places 8 × 758 slots per stage into 733 banks with every coordinate used exactly once, so the injective-owner and +arbitrary-dirty-bank arguments apply with block isometries in place of whole rank-eight slots. The live stock drops by +9·(200/8) = 225 families while the paid mass drops by 72·200, keeping the rank deficit 64·W − mass = 2,496. diff --git a/research/split-centres-kernel-r747/README.md b/research/split-centres-kernel-r747/README.md new file mode 100644 index 0000000000..872109a08e --- /dev/null +++ b/research/split-centres-kernel-r747/README.md @@ -0,0 +1,75 @@ +# Kernel + early resets on #433's bit word: conditional κ = 0.001133508328719775 + +κ = 1133508328719775/10¹⁸ = 0.001133508328719775: **+0.414 % over #435** (0.001128832830332521, kernel on R758), +**+0.465 % over #434** (0.001128250848293019, resets), +1.13 % over #433. The bit supplier binds; #433's split-centre complex +supplier (b = 0.001183986549206329) is unchanged. + +Bit word: #433's R758 source-centre word → #434's eleven chronological clean resets (R747; #434's own reconstruction, +`vendor/pr434/`, `code/bit_reset.py`) → #417's shared-donor response kernel re-derived on the R747 word (118 entries, +total entrance rank 160, 119 donor slots, no new frames; `code/bit_kernel.py`, `stages/kernel-selection.json`) → #386's +compressed nine-stage geometry with exact mixed-width bank tiling (727 banks per stage; live stock 14,223; deficit 2,496). +Bit lower 0.001134794627881866 (R747 alone: 0.001129525236; R758 + kernel: 0.001130108534). + +Verify: `python3 -B research/split-centres-kernel-r747/verify.py /tmp/out` (~30 s) → `PASS conditional kappa 0.001133508328719775`. + +Credits: icekylinx (#433), rohanarun / OpenAI Codex (#434 resets), chafreaky (#417 kernel, vendored), ai-nanachi (#426), +Zhihao Chen / jacklightChen (#425, #386), Dylan Crow (#370), J. Sussman (E8); this composition rohanarun with Anthropic Claude. + +--- + +# Conditional κ = 0.001120864952258278 + +This package combines a split-centre Hamming complex construction with a +source-centre bit construction in compressed nine-stage windows. The resulting +conditional exponent saving is + +$$ +\kappa=\frac{560432476129139}{500000000000000000} + =0.001120864952258278. +$$ + +This is approximately **6.9522% above PR425**. Both components change: + +| Component | Helpers | Ambient width | Certified saving | +|---|---:|---:|---:| +| Complex | 560 | 73 | 0.001183986549206329 | +| Bit | 758 | 64 | 0.001122122700265139220566 | + +The bit component limits the final assembly. The complex construction removes +coordinate contributions that cancel in the decoder, replacing eight full +centres with eight rank-eight and eight rank-one copies. The bit construction +starts from PR426's R767 word, computes its nine retained forms reversibly in +source rows, and uses PR386's compressed windows. + +## Verification + +Python 3.11+ and its standard library suffice. Use a new output directory: + +```sh +python3 -B research/split-centres-global/verify.py /tmp/split-centres-check +``` + +The default replays both changed words, reflected/inverse-transpose programs, +bank ownership, costs, two rational moment engines and 47 strict outer +inequalities. Exact complex phase evidence is reused only when the regenerated +canonical word and complete recipe hashes match. To regenerate every selected +Gaussian phase pair as well: + +```sh +python3 -B research/split-centres-global/verify.py /tmp/split-centres-full-phases --replay-phases +``` + +The unchanged historical repository suite and PDF build are not required by +this package. `EXPECTED.json` binds the result to both emitted global templates; +`MANIFEST.json` binds the package files; `SOURCES.json` pins imported sources. + +## Scope + +[PROOF.md](PROOF.md) supplies the changed finite construction. The all-size +compressed-window and correlated dirty-bank semantics, recursive compiler, +restored-work/tape/common-grid precision, and analytic transfer interfaces remain +conditional. This does not claim unchanged legacy gx/gxcore acceptance, a new +Lean proof, or an unconditional multiplication theorem. + +Contributor history and AI assistance are recorded in [NOTICE.md](NOTICE.md). +Original notices and the inherited proofs are retained separately. diff --git a/research/split-centres-kernel-r747/SOURCES.json b/research/split-centres-kernel-r747/SOURCES.json new file mode 100644 index 0000000000..215f58a649 --- /dev/null +++ b/research/split-centres-kernel-r747/SOURCES.json @@ -0,0 +1,134 @@ +{ + "upstream_base": "12a4934d15006e8c10f9b2264f13f8f341be802b", + "pr425": "e11ccea1d092beb1b01b4ee4ce49da478234254c", + "pr426": "88d552526893cd15325948bb1487e9a4d4bf32f6", + "imported_files": [ + { + "path": "vendor/hamming_packets.py", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-network/hamming_packets.py", + "sha256": "daa9301e2767a711cfe66c6bebaad68e1a3bdb97ec9e848c927527ab43b37ae5" + }, + { + "path": "vendor/clifford_exact.py", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/odd-stages/clifford_exact.py", + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962" + }, + { + "path": "inputs/complex-ports.json.gz", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/higher-stage-e8/verified/gcert1-e8-retimed.json.gz", + "sha256": "77b0c0fa19ef3da1c7316010e13493aa5eea1a50c3506eddc08f7480e659878b" + }, + { + "path": "inputs/complex-template.json.gz", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-nine-native/GLOBAL-TEMPLATE.json.gz", + "sha256": "1b84904a31a733aab9bfdda3f528c06719f590d2133a43687a8bded955dc991e" + }, + { + "path": "inputs/complex-data-phases.json.gz", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-nine-native/DATA-PHASES.json", + "sha256": "c972b5b60649c2a52354f5160f69adc0f4a270fa09d32012beff9888774ab84f", + "source_sha256": "f621f6d4296cb215f334830356c5f79fe10d6d04d15b3ccda76ba0885ab67d0a", + "encoding": "gzip; decoded bytes identical to source" + }, + { + "path": "inputs/e8-r865.json.gz", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/pr370-source/research/e8-bit/data/bit/bitE8-r865.json.gz", + "sha256": "1fb726ea3818fe0837cceb0dd22a71a0814f064e5e781628104610d6468e0e55" + }, + { + "path": "proofs/PR425-COMPLEX.txt", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-network/hamming/PROOF.txt", + "sha256": "2cda27b9b9a1eb24127c38c2c7a6e085155a2472183e220189a3ea2c2b7720dc" + }, + { + "path": "proofs/INHERITED-COMPLEX-GEOMETRY.txt", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-nine-native/PROOF.txt", + "sha256": "c1ff55536594222a8d2a30bc0e0956959774e1be2d5420b7838ad553ee556df2" + }, + { + "path": "vendor/engines/moment.py", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/pr361/code/engines/moment.py", + "sha256": "81cbc864e106418fc7854322746f72180cb8110ff39f74450a3b8d55a82c1482" + }, + { + "path": "vendor/engines/base_two_moment.py", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/pr361/code/engines/base_two_moment.py", + "sha256": "aee70c242a2f1d225528fabe2002e1564d1dc884797c07d28a831c7878ee9098" + }, + { + "path": "vendor/engines/outer.py", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/pr361/code/engines/outer.py", + "sha256": "c1ebb52163a7219504c728a5c2b098bf1e50bf20148a2879c5a74c3cadc7c03c" + }, + { + "path": "vendor/export_records.py", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/e8-bit/code/bit/export_records.py", + "sha256": "8a5999601f917dbb492bb9ae9a344611f18cc7cedc53dc3c76496a369e530eb3" + }, + { + "path": "inputs/bit-geometry.json.gz", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/e8-bit-complex-nine-validation/GEOMETRY.json.gz", + "sha256": "5c980202227859e8bb9b863f94503930c2a59d460c0421356688e2b0d828b4a1" + }, + { + "path": "proofs/PR386-BIT-GEOMETRY.txt", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/e8-bit-complex-nine/PROOF.txt", + "sha256": "c5f077b849e9add9957ab4ee36095dd47bc678dee7e09baa146dac4c0a0d66b2" + }, + { + "path": "notices/PR386.txt", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/e8-bit-complex-nine/NOTICE.txt", + "sha256": "ae2241615a23063b18a04f1b7a88a52e62b3d7d42e333fbd21e3668567ab83d1" + }, + { + "path": "inputs/bit-r767.json.gz", + "source": "CrocSwap/integer-mult-bounds@88d552526893cd15325948bb1487e9a4d4bf32f6:research/e8-clean-reuse-extension/data/bit-candidate.json.gz", + "sha256": "bd3b84244528767b85d8d7fe423b155630b5c659e21e51563674b1dcb6305ad7" + }, + { + "path": "notices/PR426.md", + "source": "CrocSwap/integer-mult-bounds@88d552526893cd15325948bb1487e9a4d4bf32f6:research/e8-clean-reuse-extension/NOTICE.md", + "sha256": "6a5593d0f284a2f0865037f5c5fa9e5f76f9e12cf50ec5284486d3b8137c89da" + }, + { + "path": "proofs/PR426.md", + "source": "CrocSwap/integer-mult-bounds@88d552526893cd15325948bb1487e9a4d4bf32f6:research/e8-clean-reuse-extension/PROOF.md", + "sha256": "5787738ceb6faf14d3d96e8452592860a6c6a469733a9bcf196e8d1562ba1ffb" + }, + { + "path": "notices/PR426-SOURCE-PINS.json", + "source": "CrocSwap/integer-mult-bounds@88d552526893cd15325948bb1487e9a4d4bf32f6:research/e8-clean-reuse-extension/SOURCE-PINS.json", + "sha256": "18ace817f2f9af22511bb303e99656ed114e534b87f3dd95a65ca4ca670baf2f" + }, + { + "path": "notices/NOTICE-PR352.md", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/pr370-source/research/e8-bit/NOTICE-PR352.md", + "sha256": "967e6d7e76e216e4898cf543c75b527e8d397ec1ddba3800cb20701f24c89524" + }, + { + "path": "notices/NOTICE.md", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/pr370-source/research/e8-bit/NOTICE.md", + "sha256": "025773f32fb43667395e64c627a1752877bdc93afbfe01b106703eee438d21d3" + }, + { + "path": "LICENSE", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/pr370-source/research/e8-bit/LICENSE", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + }, + { + "path": "notices/SUSSMAN-NOTICE", + "source": "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/e8-bit/code/complex/inputs/complex/NOTICE", + "sha256": "9419dd03a2f52cf8bdfc4d18216ce29f263ab583b27f01ced8e420985bcb7c81" + } + ], + "adapted_sources": { + "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-network/hamming_full.py": "613796df039dfc08de708831582533e553316eaf157485531e4df2d897bdb3bb", + "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-network/audit_full.py": "fdc1da8fa95716d60076383e691a5be1bf8bec0b229b7582bc056afac28951d0", + "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-network/integrate.py": "eb5b427f2095578f28a1fb320b4694047e20abdbe0c8bcdc65b1e9e05ab90d01", + "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-network/phase_full.py": "5c2bd267cc3106c9eee8787132c460614fdde8177c0c2653435f8a7b110ebac1", + "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/hamming-mutable-basis-complex/work/complex-network/replay_ir.py": "f7a3829118581ee59fdeefc1f91166d8e7bb94686ea92e7743a2ef7d50139dcc", + "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/e8-bit-complex-nine/global_word.py": "2c438be46213e014170e607a745185e45e33c7b7240b833efc86a2330de0d1f6", + "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/e8-bit-complex-nine/audit.py": "75811327b0d6cbd56aae8e28d72abd42d57c7f3f3630781d045efee2d36446e9", + "CrocSwap/integer-mult-bounds@e11ccea1d092beb1b01b4ee4ce49da478234254c:research/e8-bit-complex-nine/certify.py": "550b1408fb3a581dd6b82c90e3f84ad7a9f78746d2be11ffa1cf543d719ae2d4" + } +} diff --git a/research/split-centres-kernel-r747/VALIDATION.json b/research/split-centres-kernel-r747/VALIDATION.json new file mode 100644 index 0000000000..da1036d471 --- /dev/null +++ b/research/split-centres-kernel-r747/VALIDATION.json @@ -0,0 +1,28 @@ +{ + "status": "PASS_CLEAN_DIRECTORY_INCREMENTAL_REPLAY", + "python": "3.14", + "tested_code_vendor_input_digest": "c15599626c4222a95ddb4f0a9da028cfce5c8636c7a737d6869155c2f33301ed", + "steps": [ + "hamming_packets", + "complex_construct", + "complex_audit", + "complex_emit", + "complex_phases", + "bit_construct", + "bit_export", + "bit_global", + "bit_audit", + "bit_price", + "complex_integrate", + "complex_replay", + "combined" + ], + "phase_mode": "source-bound unchanged evidence", + "new_complex_phase_pairs": 248, + "reused_verified_complex_phase_pairs": 2670, + "source_bound_bit_geometry": "PR386; exact unchanged root/frame/port/slot identities", + "historical_full_suite_rerun": false, + "pdf_built": false, + "ci_status": "Not yet run for this commit", + "post_replay_packaging": "Phase JSON gzip round-trip matched the verified decoded bytes; mathematical code and witnesses unchanged." +} diff --git a/research/split-centres-kernel-r747/code/bit_audit.py b/research/split-centres-kernel-r747/code/bit_audit.py new file mode 100644 index 0000000000..522d2b7f49 --- /dev/null +++ b/research/split-centres-kernel-r747/code/bit_audit.py @@ -0,0 +1,129 @@ +# Adapted with exact rational span checks by icekylinx; Codex assistance. +"""Independent audit of the emitted bit template, including mutation controls. +Prepared by Zhihao Chen with OpenAI Codex assistance; Apache-2.0. +""" +import argparse, copy, gzip, hashlib, json, struct, time +from collections import Counter, defaultdict +from pathlib import Path +from fractions import Fraction as Q + +def sha(p): return hashlib.sha256(p.read_bytes()).hexdigest() + +def main(): + ap=argparse.ArgumentParser(); ap.add_argument('--local-check',type=Path,required=True); ap.add_argument('--out',type=Path,required=True) + a=ap.parse_args(); start=time.monotonic(); out=a.out + blob=gzip.decompress((out/'GLOBAL-TEMPLATE.json.gz').read_bytes()); t=json.loads(blob) + g=json.loads((out/'GLOBAL.json').read_text()); geo=json.loads((out/'GEOMETRY.json').read_text()) + assert hashlib.sha256(blob).hexdigest()==g['template_sha256'] + assert t['geometry_sha256']==sha(out/'GEOMETRY.json') and t['source_record_sha256']==sha(a.local_check/'records/249-records.bin') + fs=json.loads((a.local_check/'records/frames.json').read_text())['frames'] + records=list(struct.iter_unpack('<6i',(a.local_check/'records/249-records.bin').read_bytes())) + word=json.loads((a.local_check/'bit-source-centres.json').read_text()) + assert g['word_sha256']==sha(a.local_check/'bit-source-centres.json') + def rank(rows): + piv={} + for rr in rows: + row=list(map(Q,rr)) + for k,b in sorted(piv.items()): + q=row[k] + if q:row=[x-q*y for x,y in zip(row,b)] + k=next((j for j,x in enumerate(row) if x),None) + if k is not None: + q=row[k];piv[k]=[x/q for x in row] + return len(piv) + dimensions={};proj={} + for key,f in fs.items(): + k=int(key);B=f['B'];roots=[word['lines'][j] for j in word['frames'][k]] + assert rank(B)==f['dim']==rank(B+roots)==rank(roots) + dimensions[k]=f['dim'];proj[k]=B + sets=[set(f) for f in word['frames']];pairs={} + for op,x,y,c,r,z in records: + if op==0: + assert sets[y]<=sets[c] and dimensions[c]-dimensions[y]==r + pairs[y,c]=r + # Positive definite rational form: exact inclusion implies commuting + # orthogonal projectors and rank(P_V-P_U)=dim(V)-dim(U), also in reflection. + assert len(proj)==len(word['frames']) + expected={} + for rev in (False,True): + es=[] + for op,x,y,c,f,z in (reversed(records) if rev else records): + if op==0: es.append([0,x,c if rev else y,y if rev else c,f,int(rev)]) + elif op==1: es.append([1,x,y,-c if rev else c,f,int(rev)]) + elif op==(3 if rev else 2): es.append([2,x,y,c,f,abs(dimensions[c]-dimensions[f]),int(rev)]) + else: es.append([3,x,y,c,f,z,int(rev)]) + expected['reverse' if rev else 'forward']=es + assert t['local_programs']==expected + + st=json.loads((a.local_check/'records/249-states.json').read_text()) + RR=st['n']-240; width=[8-dimensions[st['initial'][str(i)]] for i in range(240,240+RR)]; ENT=sum(8-x for x in width); assert ENT%8==0 + NB=(8*RR-ENT)//8; LIVE=7680+9*NB; assert g['live']==LIVE + def validate(q,check_profile=True): + assert (q['m'],q['live'],q['replicas'],q['stages'])==(64,LIVE,8,9) + assert q['bank_padding'] is None and q['local_programs']==expected + hist=Counter(); occupation=defaultdict(set); calls=set() + for c in q['calls']: + st,rep,p=c['stage'],c['replica'],c['pair']; rev=c['orientation']=='reverse' + assert 0<=st<9 and 0<=rep<8 and p==max(0,(st-1)//2) + assert rev==(st in (1,3,5,7)) and (st,rep) not in calls; calls.add((st,rep)) + own=c['owners']; assert len(own)==240+RR + assert len({(f,tuple(r)) for f,r in own})==240+RR + for i,(family,route) in enumerate(own): + assert 0<=family> p & 1: + row ^= q + assert row, 'Retained forms must be independent' + p = (row & -row).bit_length() - 1 + echelon[p] = row + pivots = sorted(echelon) + matrix = [1 << i for i in range(v)] + for p, row in zip(pivots, rows): + matrix[p] = row + target = matrix[:] + elimination = [] + def add(d, s): + matrix[d] ^= matrix[s] + elimination.append((d, s)) + for p in range(v): + q = next(i for i in range(p, v) if matrix[i] >> p & 1) + if q != p: + add(p, q); add(q, p); add(p, q) + for i in range(v): + if i != p and matrix[i] >> p & 1: + add(i, p) + assert matrix == [1 << i for i in range(v)] + forward = [[full, d, [s]] for d, s in reversed(elimination)] + inverse = list(reversed(forward)) + check = [1 << i for i in range(v)] + for f, d, ss in forward: + check[d] ^= check[ss[0]] + assert check == target + out = copy.deepcopy(old) + physical = [i for i in range(2*v+old['R']) if i not in retired] + index = {r: i for i, r in enumerate(physical)} + def remap(gs): + return [[f, index[d], [index[s] for s in ss if s not in retired]] + for f, d, ss in gs if d not in retired] + out['R'] -= len(retired) + out['ret'] = pivots + out['D'] = remap(old['D']) + out['A'] = remap(old['A']) + forward + out['B'] = inverse + remap(old['B']) + out['C'] = remap(old['C']) + out['start'] = [old['start'][i] for i in physical] + out['final'] = [old['final'][i] for i in physical] + out['source_basis_gates'] = len(forward) + assert replay(out), 'All independent source, target and dirty columns' + assert not replay(out, skip_inverse=True) + assert not replay(out, skip_dirt=True) + # Frame incidence inclusion uses the root-closed sets in this bit format. + frames = [set(f) for f in out['frames']] + cur = out['start'][:] + for phase in ['D', 'A', 'B', 'C']: + for f, d, ss in out[phase]: + for r in [d] + ss: + assert frames[cur[r]] <= frames[f], (phase, r, cur[r], f) + cur[r] = f + if phase == 'A': + assert all(cur[r] == full for r in out['ret']) + assert all(frames[f] <= frames[g] for f, g in zip(cur, out['final'])) + raw = json.dumps(out, sort_keys=True, separators=(',', ':')).encode() + (ROOT / 'bit-source-centres.json').write_bytes(raw) + result = dict(status='PASS_LOCAL_ALL_COLUMNS_AND_NESTED_FRAMES', + original_R=old['R'], new_R=out['R'], + removed_retained_helpers=sorted(retired), retained_source_rows=pivots, + formal_columns=2*v+out['R'], reversible_basis_gates_each_way=len(forward), + source_sha256=sha256(source.read_bytes()).hexdigest(), + output_sha256=sha256(raw).hexdigest(), + controls=['unmodified word passes', 'missing inverse rejected', 'missing dirt rejected'], + kappa_claimed=False, + remaining=['global ordinary-call and reflected integration', 'finite coefficient and tape invoice', 'exact priced component comparison']) + (ROOT / 'bit-source-centres-receipt.json').write_text(json.dumps(result, indent=2)+'\n') + print(json.dumps(result)) + + +if __name__ == '__main__': + main() diff --git a/research/split-centres-kernel-r747/code/bit_global.py b/research/split-centres-kernel-r747/code/bit_global.py new file mode 100644 index 0000000000..9c326d6629 --- /dev/null +++ b/research/split-centres-kernel-r747/code/bit_global.py @@ -0,0 +1,261 @@ +# Adapted for the PR426/source-centre composition by icekylinx with Codex assistance. +"""Source-bound compressed nine-stage bit template and exact scalar audits. + +Prepared by Zhihao Chen with OpenAI Codex assistance, Apache-2.0. +The local E8 bit word is Dylan Crow's pinned PR #370 contribution. +""" +import argparse, gzip, hashlib, json, struct, time +from collections import Counter +from pathlib import Path + +import sys as _sys +H,V,L,K,T,M=8,120,9,4,8,64 +R=json.loads((Path(_sys.argv[_sys.argv.index('--source')+1])/'bit-source-centres.json').read_bytes())['R'] +LOCAL=2*V+R; DATA=2*K*V*T + +def tile_banks(width): + """exact width-64 bank tiling of the per-stage helper slots (8 replicas x R helpers, slot width = 8 - entrance rank); + returns {(replica, helper): (bank, offset)} and the bank count; every bank is filled exactly (no padding).""" + slots=sorted(((width[h],rep,h) for rep in range(T) for h in range(R)),key=lambda x:(-x[0],x[1],x[2])) + bins=[]; place={} + by={} + for w_,rep,h in slots: by.setdefault(w_,[]).append((rep,h)) + def take(w_): + return by[w_].pop(0) if by.get(w_) else None + # deterministic exact packing: width-7 slots go eight to a bank with one width-8 slot; other widths fill banks alone + for w_ in sorted(by,reverse=True): + if w_==8: continue + while by.get(w_): + b=len(bins); off=0; cont=[] + if w_==7: + for _ in range(8): rep,h=take(7); cont.append((rep,h,off,7)); off+=7 + rep,h=take(8); cont.append((rep,h,off,8)); off+=8 + else: + assert 64%w_==0 + for _ in range(64//w_): rep,h=take(w_); cont.append((rep,h,off,w_)); off+=w_ + assert off==64; bins.append(cont) + while by.get(8): + cont=[]; off=0 + for _ in range(8): rep,h=take(8); cont.append((rep,h,off,8)); off+=8 + bins.append(cont) + for b,cont in enumerate(bins): + for rep,h,off,w_ in cont: place[rep,h]=(b,off,w_) + assert len(place)==T*R + return place,len(bins) + +def sha(p): return hashlib.sha256(p.read_bytes()).hexdigest() +def write(p,x): p.write_text(json.dumps(x,indent=2)+'\n') + +def recipe(): + out=[dict(kind='local',stage=0,pair=0,reverse=False)]; stage=1 + for j in range(K): + out.append(dict(kind='local',stage=stage,pair=j,reverse=True)); stage+=1 + if j=0 + cur[x]=newf + if f: hist[f]+=1 + events.append([0,x,oldf,newf,f,int(reverse)]) + elif op==1: + assert cur[x]==cur[y]==f and x!=y and x/2) a power +of two (no new bad primes), total entrance rank = 0 mod 8 (exact width-64 bank tiling, checked in bit_global/bit_audit). +rohanarun, with Anthropic Claude assistance; Apache-2.0.""" +import json, os, sys, hashlib +from fractions import Fraction as Q +from pathlib import Path +HERE = Path(__file__).resolve().parent.parent +sys.path.insert(0, str(HERE / 'vendor/kernel417')) +from stages import kernel, content_sha +from e8core import replay, Lat +D = Path(os.environ['E8_OUTPUT']) / 'bit426-source-centres' +src = D / 'bit-source-centres.json'; pre = D / 'bit-source-centres-prekernel.json' +c = json.loads(src.read_bytes()); pre.write_bytes(src.read_bytes()) +sel = json.loads((HERE / 'stages/kernel-selection.json').read_text()) +assert sel['input_sha256'] == content_sha(c), 'selection bound to a different input word' +w, ne, tot, nd = kernel(c, sel['entries']) +assert tot % 8 == 0 and tot == sel['total_entrance_rank'] +r = replay(w, span_mode='z'); assert not r['viol'], r['viol'][:5] +assert content_sha(w) == sel['output_sha256'], 'output differs from the frozen selection output' +L = Lat(w['lines']); n0 = len(c['frames']); newdets = [] +assert w['frames'][:n0] == c['frames'] +def det(M): + M = [[Q(x) for x in r] for r in M]; d = Q(1); k = len(M) + for i in range(k): + p = next((j for j in range(i, k) if M[j][i]), None) + if p is None: return Q(0) + if p != i: M[i], M[p] = M[p], M[i]; d = -d + d *= M[i][i] + for j in range(i + 1, k): + f = M[j][i] / M[i][i]; M[j] = [a - f * b for a, b in zip(M[j], M[i])] + return d +for fr in w['frames'][n0:]: + m = sum(1 << i for i in fr); assert L.close(m) == m, 'new frame not root-closed' + vs = [w['lines'][i] for i in fr] + # basis of the span: greedy independent roots + B = [] + for x in vs: + if len(B) < 8 and abs(det([[sum(a * b for a, b in zip(u, v)) for v in B + [x]] for u in B + [x]])) != 0: B.append(x) + G = [[Q(sum(a * b for a, b in zip(u, v)), 2) for v in B] for u in B]; g = det(G); assert g > 0 + num, den = g.numerator, g.denominator + for x in (num, den): + while x % 2 == 0: x //= 2 + assert x == 1, ('new frame Gram determinant has an odd prime factor', fr, g) + newdets.append(str(g)) +D.joinpath('bit-source-centres.json').write_bytes(json.dumps(w, sort_keys=True, separators=(',', ':')).encode()) +res = dict(status='PASS_KERNEL_STAGE', entries=ne, total_entrance_rank=tot, donor_slots=nd, new_frames=len(w['frames']) - n0, + new_frame_gram_determinants=sorted(set(newdets)), local_histogram=dict(sorted(r['H'].items())), columns=r['n'], + input_sha256=sel['input_sha256'], output_sha256=sel['output_sha256']) +(D / 'bit-kernel-receipt.json').write_text(json.dumps(res, indent=2) + '\n'); print(json.dumps(res)) diff --git a/research/split-centres-kernel-r747/code/bit_price.py b/research/split-centres-kernel-r747/code/bit_price.py new file mode 100644 index 0000000000..005da012a3 --- /dev/null +++ b/research/split-centres-kernel-r747/code/bit_price.py @@ -0,0 +1,18 @@ +"""Exact price of the emitted bit program; no histogram supplied by discovery.""" +import json,importlib.util +from fractions import Fraction as Q +from pathlib import Path + +def load(name): + p=Path('work/pr361/code/engines')/(name+'.py');sp=importlib.util.spec_from_file_location('price_'+name,p);m=importlib.util.module_from_spec(sp);sp.loader.exec_module(m);return m +p=Path('bit426-source-centres/global');g=json.loads((p/'GLOBAL.json').read_text());a=json.loads((p/'AUDIT.json').read_text()) +assert a['template_sha256']==g['template_sha256'] +H={int(r):n for r,n in a['profile'].items()};m,W=g['m'],g['live'] +M,B=load('moment'),load('base_two_moment');root=M.certify(H,m,W,True);lo,hi=Q(root['lower']),Q(root['upper']) +fb=32*m*m*sum(H.values()) +def other(x): + l,u=B.moment(m,W,list(H.items()),x);a,b=B.moment(m,W,[(1,fb)],x);return l+a/10**16,u+b/10**16 +assert other(lo)[1]<1 R747, applied with #434's own +reconstruction (vendor/pr434/replay.py and its frozen SELECTION.json) before the kernel stage.""" +import os, subprocess, sys +from pathlib import Path +HERE = Path(__file__).resolve().parent.parent +D = Path(os.environ['E8_OUTPUT']) / 'bit426-source-centres' +src = D / 'bit-source-centres.json'; pre = D / 'bit-source-centres-r758.json'; pre.write_bytes(src.read_bytes()) +r = subprocess.run([sys.executable, '-B', str(HERE / 'vendor/pr434/replay.py'), str(pre), str(src)], capture_output=True, text=True) +print(r.stdout); assert r.returncode == 0, r.stderr[-2000:] diff --git a/research/split-centres-kernel-r747/code/combined.py b/research/split-centres-kernel-r747/code/combined.py new file mode 100644 index 0000000000..49588892f2 --- /dev/null +++ b/research/split-centres-kernel-r747/code/combined.py @@ -0,0 +1,55 @@ +"""Fresh bit finite invoice and joint strict arithmetic for two changed suppliers. +icekylinx, with Codex assistance. Inherited all-size interfaces remain conditional. +""" +import json,hashlib,importlib.util +from pathlib import Path +from fractions import Fraction as Q +import os +ROOT=Path(os.environ['E8_OUTPUT']);D=ROOT/'bit426-source-centres/global';C=ROOT/'split-centres' +read=lambda p:json.loads(p.read_text()) +g=read(D/'GLOBAL.json');geo=read(D/'GEOMETRY.json');audit=read(D/'AUDIT.json') +cx=read(C/'INTEGRATION.json');ca=read(C/'INDEPENDENT-REPLAY.json') +assert audit['template_sha256']==g['template_sha256'] and ca['template_sha256']==cx['global_template_sha256'] +assert len(audit['mutations_rejected'])==8 and len(ca['mutation_controls_rejected'])==7 +P={int(r):z for r,z in audit['profile'].items()};m,W=64,g['live'];E=sum(P.values());T,L,R,V,K=8,9,g['R'],120,4 +mass=sum(r*z for r,z in P.items());assert m*W-mass==2496 and g['live']==W +physical=g['physical'];d=m*m;N=2*m +unit=L*T*g['local_additions']+g['bridge_additions'] +J=8*T*L*(2*V+R)+8*(2*K*V*T)+2*g['bank_assignments']+2*g['copy_erase_episodes'] +high=16*(d+1)**2;good=8*m*m+8;compiler=128*N**3 +selectors=2*L*T*((W-1)+R*m*(geo['max_route_factors']+(m-1)+m)) +prefix=int(g['global_prefix_bound']);assert prefix<1<<256 +coefficient=unit+J*high+J*physical+E*(good+compiler)+16*m**3+g['copy_erase_episodes']+selectors+prefix+1 +two=(coefficient+1)**2*(E+1)**2 +assert two<1<<512 and 2*max(P)**20 + cutoff=max(ceil(36/gap**2),ceil(2*(4+512)/gap)) + assert cutoff*gap**2>=36 and cutoff*gap>=2*(4+512) + cutoffs.append(dict(gap=str(gap),cutoff_log2=str(cutoff)));chain.append(a) +q=chain[-1]*(1-2*eta);margin=(1-eta)*q/(1+q);ticks=margin/grid;k=grid*((ticks.numerator-1)//ticks.denominator) +bridge={'semantic':{'C0':{'base':2,'exponent':210000},'strict_literal_gap':1},'rows':{'degree_gap':Q(10**6)-Q(51*20161,25)}} +a=Outer.assembly(chain[-1],b,bridge,k,eta=eta,beta=beta) +assert len(a['strict_constraints'])==47 and all(x>0 for x in a['strict_constraints'].values()) +controls=[] +for name,kk,ee,bb in [('next_grid',k+grid,eta,beta),('zero_eta',k,Q(0),beta),('zero_beta',k,eta,Q(0)),('unit_beta',k,eta,Q(1))]: + try:Outer.assembly(chain[-1],b,bridge,kk,eta=ee,beta=bb) + except AssertionError:controls.append(name) + else:raise AssertionError(name) +result=dict(status='PASS_CONDITIONAL_SPLIT_CENTRE_ASSEMBLY',kappa=str(k),kappa_decimal=format(float(k),'.18f'),bit_lower=str(c),complex_lower=str(b),binding_component='bit',gain_over_pr425_percent=float(100*(k/Q(1048005508028206,10**18)-1)),bit_invoice=dict(prefix_bits=prefix.bit_length(),charged_prefix_bits=256,coefficient_bits=coefficient.bit_length(),two_level_coefficient_bits=two.bit_length(),charged_two_level_coefficient_bits=512,row_coefficient=row,live=W,physical=physical),strict_outer_constraints={n:str(x) for n,x in a['strict_constraints'].items()},outer_controls=controls,bootstrap=cutoffs,bit_template_sha256=g['template_sha256'],complex_template_sha256=cx['global_template_sha256'],scope='Finite research composition with explicit changed words, exact local and global replay and incremental phase evidence. All-size correlated dirty-bank, compressed-window, compiler, restored-work, tape/common-grid, precision and analytic interfaces remain inherited assumptions. This certificate makes no unconditional integer-multiplication or Lean-kernel claim.') +(ROOT/'RESULT.json').write_text(json.dumps(result,indent=2)+'\n') +print(result['status'],result['kappa_decimal'],result['gain_over_pr425_percent'],result['bit_invoice']) diff --git a/research/split-centres-kernel-r747/code/complex_audit.py b/research/split-centres-kernel-r747/code/complex_audit.py new file mode 100644 index 0000000000..ba6789a3a6 --- /dev/null +++ b/research/split-centres-kernel-r747/code/complex_audit.py @@ -0,0 +1,168 @@ +# Modified from PR425 by icekylinx with Codex assistance. +"""Read-back audit, independent of the Hamming producer and its row state.""" +import copy,gzip,hashlib,importlib.util,json,math,time +from collections import Counter +from fractions import Fraction as Q +from pathlib import Path + +OUT=Path('split-centres');p=OUT/'FULL-WORD.json.gz' +word=json.load(gzip.open(p));v=120;n=240+word['report']['R'];start=time.monotonic() +def apply(e,rows): + if e[0]=='scale': + _,t,a,b,*_=e;q=Q(a,b);assert q + rows[t]={j:q*x for j,x in rows[t].items()} + else: + _,t,s,a,b,*_=e;q=Q(a,b);assert t!=s + for j,x in list(rows[s].items()): + z=rows[t].get(j,Q(0))+q*x + if z:rows[t][j]=z + else:rows[t].pop(j,None) +def ident():return [{r:Q(1)} for r in range(n)] +def inv(e): + e=copy.deepcopy(e) + if e[0]=='add':e[3]*=-1 + else:e[2],e[3]=e[3],e[2] + return e +def dual(e): + e=inv(e) + if e[0]=='add':e[1],e[2]=e[2],e[1] + return e + +main=word['A']+word['cut']+word['B'] +assert all(not 120<=e[2]<240 for e in word['A']+word['B'] if e[0]=='add' and not 120<=e[1]<240) +matrix=ident() +for e in main:apply(e,matrix) +print('full main columns',n,'replayed',flush=True) +# Compute -A_Y^-1 B_S using only rows of the explicit main operator. +dirty=[{} for r in range(n)] +for r in range(v,2*v):dirty[r]={j:x for j,x in matrix[r].items() if j>=2*v} +for e in word['precondition']:apply(e,dirty) +comp=[] +for r in range(v,2*v): + for j,q in sorted(dirty[r].items()):comp.append(['add',r,j,-q.numerator,q.denominator,[]]) + +cleanup=[inv(e) for e in reversed(word['A']+word['B']) if not v<=e[1]<2*v] +assert [e[:-1] for e in cleanup]==[e[:-1] for e in word['cleanup']] +program=word['precondition']+comp+main+cleanup +actual=ident() +for e in program:apply(e,actual) +expected=ident() +for t in range(v):expected[v+t][t]=Q(1) +assert actual==expected +print('PASS exact arbitrary dirt and restored sources/helpers',flush=True) +back=ident() +for e in program:apply(dual(e),back) +expected_back=ident() +for t in range(v):expected_back[t][v+t]=Q(-1) +assert back==expected_back +print('PASS exact inverse-transpose on every column',flush=True) +# Independent sparse vector controls avoid repeating a dense full replay. +def vector(es,x): + x=list(map(Q,x)) + for e in es: + if e[0]=='scale':x[e[1]]*=Q(e[2],e[3]) + else:x[e[1]]+=Q(e[3],e[4])*x[e[2]] + return x +sample=[((i*137+13)%101)-50 for i in range(n)] +want=vector(program,sample) +controls={ + 'missing_dirty_compensation':word['precondition']+main+cleanup, + 'missing_Y_inverse_basis':comp+main+cleanup, + 'missing_source_cleanup':word['precondition']+comp+main, + 'wrong_dual_event_order':[dual(e) for e in reversed(program)], +} +for name,es in controls.items(): + expected_sample=vector([dual(e) for e in program],sample) if name=='wrong_dual_event_order' else want + assert vector(es,sample)!=expected_sample,name + +# Orthogonal transvection and a port permutation bring the new geometry onto +# the already fixed 120-port routing family. Every incidence is transformed. +old=json.load(gzip.open('work/higher-stage-e8/verified/gcert1-e8-retimed.json.gz')) +def tau(x):return x^(43 if (x&43).bit_count()%2 else 0) +assert 43 .bit_count()%2==0 +assert set(map(tau,word['ports']))==set(old['ports']) +mapping={i:old['ports'].index(tau(q)) for i,q in enumerate(word['ports'])} +mapping.update({v+i:v+mapping[i] for i in range(v)}) +mapping.update({r:r for r in range(2*v,n)}) +def basis(vs): + b={} + for x in vs: + for k in sorted(b,reverse=True): + if x>>k&1:x^=b[k] + if x: + k=x.bit_length()-1 + for j in b: + if b[j]>>k&1:b[j]^=x + b[k]=x + return tuple(b[k] for k in sorted(b,reverse=True)) +def perp(x):return basis([z for z in range(1,512) if not (x&z).bit_count()%2]) +full=tuple(1<0 + edges.add((old,f));paid[delta]+=1;cur[r]=f +for part in ('A','B'): + if part=='B': + assert all(cur[r]==f for r,f in zip(can['centers'],can['center_frames'])) + assert all(cur[r]==0 for r in range(v,2*v)) + for f in can['center_frames']:paid[len(frames[f])]+=1 + for e in can[part]: + rs=[e[1]]+([e[2]] if e[0]=='add' else []) + for r in rs:climb(r,e[-1]);incidences+=1 +for r,f in enumerate(can['final']):climb(r,f) +assert dict(paid)=={int(r):x for r,x in word['report']['local_profile'].items()} +assert sum(r*x for r,x in paid.items())==9*can['R']+240*8+72 +can['local_profile']=dict(sorted(paid.items()));can['edges']=sorted(edges) +cp=OUT/'CANONICAL-WORD.json.gz';cp.write_bytes(gzip.compress(json.dumps(can,sort_keys=True,separators=(',',':')).encode(),mtime=0)) + +def engine(name): + p=Path('work/pr361/code/engines')/(name+'.py');s=importlib.util.spec_from_file_location('hamming_'+name,p) + m=importlib.util.module_from_spec(s);s.loader.exec_module(m);return m +M,M2=engine('moment'),engine('base_two_moment');m,W=73,12720 +HG={int(r):z for r,z in word['report']['global_profile'].items()} +root=M.certify(HG,m,W,True);b=Q(int(Q(root['lower'])*10**18),10**18);grid=Q(1,10**18) +assert M.moment(HG,m,W,b,True)[1]<1>p&1:x^=b[p] + if x: + p=x.bit_length()-1 + for q in b: + if b[q]>>p&1:b[q]^=x + b[p]=x + return tuple(b[p] for p in sorted(b,reverse=True)) +def inside(a,b):return basis(a+b)==b +def hyper(p):return basis([x for x in range(1,512) if (x&p).bit_count()%2==0]) +FULL=basis([1<>p&1:x^=b[p] + if x: + p=x.bit_length()-1 + for q in b: + if b[q]>>p&1:b[q]^=x + b[p]=x + return tuple(b[p] for p in sorted(b,reverse=True)) +def dual(e): + e=list(e) + if e[0]=='add':e[1],e[2]=e[2],e[1];e[3]*=-1 + else:e[2],e[3]=e[3],e[2] + return e +def scalar(e,back): + e=dual(e) if back else list(e) + if e[0]=='add':return ['add',['L',e[1]],['L',e[2]],e[3],e[4]] + return ['scale',['L',e[1]],e[2],e[3]] +def primitive_bound(e): + if e[0] in ('clear','copy'):return 1 + q=Q(e[3],e[4]) if e[0]=='add' else Q(e[2],e[3]) + a,b=abs(q.numerator),q.denominator + assert b&(b-1)==0 + if e[0]=='scale': + assert a&(a-1)==0 + return abs(a.bit_length()-b.bit_length())+int(q<0) + # Exact binary Horner multiplication on a cleared private stream, repeated + # halving, signed accumulation into the target, then clear the private stream. + return 3+(a.bit_length()-1)+a.bit_count()+(b.bit_length()-1) + +def emit(back): + out=[];cur=c['start'].copy() + def event(e):out.append(e) + def scal(e,f):event(['scalar',e,f]) + event(['phase','zero_frame_precondition']) + for e in c['precondition']+c['compensation']: + regs=[e[1]]+([e[2]] if e[0]=='add' else []) + assert all(c['start'][r]==0 for r in regs) + scal(scalar(e,back),0) + event(['phase','entry_adapters']) + for r,f in enumerate(c['start']):event(['adapter','old_to_new',r,f]) + def climb(r,f,part): + old=cur[r] + if old==f:return + assert basis(frames[old]+frames[f])==tuple(frames[f]) + rank=len(frames[f])-len(frames[old]);assert rank>0 + event(['climb',part,r,old,f,rank]);cur[r]=f + for part in ('A','centers','B','final'): + event(['phase',part]) + if part in ('A','B'): + for e in c[part]: + regs=[e[1]]+([e[2]] if e[0]=='add' else []) + for r in regs:climb(r,e[-1],part) + scal(scalar(e,back),e[-1]) + elif part=='centers': + assert all(cur[r]==0 for r in range(v,2*v)) + for k,r in enumerate(c['centers']): + cf=c['center_frames'][k];rank=len(frames[cf]);assert cur[r]==cf + C=['C',k];scal(['clear',C],0 if back else cf) + terms=[e for e in c['cut'] if e[2]==r] + if back: + for e in terms:scal(['add',C,['L',e[1]],e[3],e[4]],0) + else:scal(['copy',C,['L',r]],cf) + event(['center',k,0 if back else cf,cf if back else 0,rank]) + if back:scal(['add',['L',r],C,-1,1],cf) + else: + for e in terms:scal(['add',['L',e[1]],C,e[3],e[4]],0) + scal(['clear',C],cf if back else 0) + else: + for r,f in enumerate(c['final']):climb(r,f,part) + event(['phase','exit_adapters']) + for r,f in enumerate(c['final']):event(['adapter','new_to_old',r,f]) + event(['phase','full_frame_cleanup']) + for e in c['cleanup']: + regs=[e[1]]+([e[2]] if e[0]=='add' else []) + assert all(c['final'][r]==1 for r in regs) + scal(scalar(e,back),1) + event(['phase','done']) + return out + +def check_local(events,back): + # Literal scalar replay of the emitted stream, including center lifetimes. + state={('L',r):{r:Q(1)} for r in range(n)};live=[];paid=Counter();prims=0;macros=0 + for e in events: + if e[0]=='climb':assert not live;paid[e[5]]+=1 + elif e[0]=='center':assert live==[e[1]];paid[e[4]]+=1 + elif e[0]=='scalar': + op=e[1];tag=op[0];t=tuple(op[1]);macros+=1;prims+=2*primitive_bound(op) + if tag=='clear': + state[t]={} + if t[0]=='C' and t[1] in live:live.remove(t[1]) + elif tag=='copy':state[t]=dict(state.get(tuple(op[2]),{}));live.append(t[1]) + elif tag=='scale':state[t]={j:Q(op[2],op[3])*x for j,x in state[t].items()} + else: + s=tuple(op[2]);q=Q(op[3],op[4]);row=state.setdefault(t,{}) + if t[0]=='C' and t[1] not in live:live.append(t[1]) + for j,x in list(state.get(s,{}).items()): + z=row.get(j,Q(0))+q*x + if z:row[j]=z + else:row.pop(j,None) + assert not live and all(not row for r,row in state.items() if r[0]=='C') + for r in range(n): + expected={r:Q(1)} + if back and r2*maxchild**depth +assert local_bound<1<<48 and logical<1<<6050 and router0 + bound=max(math.ceil(36/gap**2),math.ceil(2*(4+512)/gap)) + assert bound*gap**2>=36 and bound*gap>=2*(4+512) + cutoffs.append(str(bound));chain.append(z) +bridge={'semantic':{'C0':{'base':2,'exponent':210000},'strict_literal_gap':1}, + 'rows':{'degree_gap':Q(10**6)-Q(51*20161,25)}} +q=chain[-1]*(1-2*eta);ticks=(1-eta)*q/(1+q)/grid;kap=Q((ticks.numerator-1)//ticks.denominator,10**18) +assembly=Outer.assembly(chain[-1],b,bridge,kap,eta=eta,beta=beta) +try:Outer.assembly(chain[-1],b,bridge,kap+grid,eta=eta,beta=beta) +except AssertionError:pass +else:raise AssertionError('next kappa grid accepted') +result={'status':'PASS_NEW_STRUCTURAL_PROGRAM_AND_FINITE_ASSEMBLY_PENDING_REPLAY', + 'canonical_word_sha256':sha(cp),'scalar_audit_sha256':sha(OUT/'SCALAR-FRAME-AUDIT.json'), + 'exact_phase_receipt_sha256':sha(OUT/'CLIFFORD-REVIEW.json'),'global_template_sha256':hashlib.sha256(blob).hexdigest(), + 'local_program_checks':checks,'R':R,'m':m,'live':W,'physical':physical, + 'bank_assignments':len(assignments),'rank_mass':mass,'deficit':2496, + 'global_profile':dict(sorted(paid.items())),'emitted_local_events_all_calls':event_count, + 'finite_invoice':{'local_primitive_bound':local_bound,'local_adapters':adapters, + 'pervertex':pervertex,'physical_stock_bits':stock.bit_length(), + 'router_bits':router.bit_length(),'literal_bits':literal.bit_length(), + 'physical_row_coefficient':row,'retained_row_coefficient':20161, + 'compiler':compiler,'G_exponent':30000,'E_exponent':100000,'C0_exponent':210000, + 'required_C0_bits':(32*m*BB*BB).bit_length(),'halving_degree':depth, + 'halving_integer_inequality':[m**depth,2*maxchild**depth]}, + 'complex_b':str(b),'bit_c':str(bit),'prospective_kappa':str(kap),'kappa_float':float(kap), + 'log2_kappa':math.log2(float(kap)), + 'kappa_gain_percent':float(100*(kap/Q(998390813251625,10**18)-1)), + 'strict_outer_constraints':{name:str(z) for name,z in assembly['strict_constraints'].items()}, + 'next_kappa_grid_rejected':True,'bootstrap_cutoffs_log2':cutoffs, + 'scope':'New finite scalar interface with a written conjugation proof, conditional on inherited all-size compiler, precision/tape and analytic transfer. Independent emitted-program replay and fresh package replay still required before final promotion.'} +(OUT/'INTEGRATION.json').write_text(json.dumps(result,indent=2)+'\n') +print('PASS prospective kappa',float(kap),'gain',result['kappa_gain_percent'],'percent',flush=True) diff --git a/research/split-centres-kernel-r747/code/complex_phases.py b/research/split-centres-kernel-r747/code/complex_phases.py new file mode 100644 index 0000000000..6f199bc139 --- /dev/null +++ b/research/split-centres-kernel-r747/code/complex_phases.py @@ -0,0 +1,22 @@ +"""Bind unchanged exact phase evidence, or regenerate all selected phase pairs.""" +import gzip,hashlib,json,os,subprocess,sys +from pathlib import Path +P=Path(__file__).resolve().parent.parent;O=Path('split-centres') +def sha(p):return hashlib.sha256(p.read_bytes()).hexdigest() +c=json.load(gzip.open(O/'CANONICAL-WORD.json.gz')) +r=json.loads((P/'inputs/complex-phase-receipt.json').read_text()) +raw=gzip.decompress((P/'inputs/complex-phase-recipes.json.gz').read_bytes());recipes=json.loads(raw) +assert sha(O/'CANONICAL-WORD.json.gz')==r['canonical_word_sha256'] +assert hashlib.sha256(raw).hexdigest()==r['recipe_sha256'] +edges=set(map(tuple,c['edges']))|{(a,b) for f in c['center_frames'] for a,b in ((f,0),(0,f))} +assert {(z['old'],z['new']) for z in recipes['children']}==edges +assert len(recipes['children'])==len(edges) and len(recipes['endpoint_adapters'])==240 +for z in recipes['children']:assert z['rank']==abs(len(c['frames'][z['old']])-len(c['frames'][z['new']])) +if os.environ.get('E8_REPLAY_PHASES')=='1': + subprocess.run([sys.executable,'-B',str(P/'code/complex_phases_full.py')],check=True) + assert (O/'CLIFFORD-RECIPES.json').read_bytes()==raw +else: + (O/'CLIFFORD-RECIPES.json').write_bytes(raw) + r['validation_mode']='Reuse exact phase evidence bound to the unchanged canonical word and recipe hashes' + (O/'CLIFFORD-REVIEW.json').write_text(json.dumps(r,indent=2)+'\n') +print('PASS source-bound phase recipes',len(edges)) diff --git a/research/split-centres-kernel-r747/code/complex_phases_full.py b/research/split-centres-kernel-r747/code/complex_phases_full.py new file mode 100644 index 0000000000..b5a5bd64b4 --- /dev/null +++ b/research/split-centres-kernel-r747/code/complex_phases_full.py @@ -0,0 +1,39 @@ +# Adapted from PR425 for heterogeneous centres by icekylinx with Codex assistance. +"""Exact phase-aware lowering of every used edge of the new structural word.""" +import gzip,hashlib,json,sys,time +from collections import Counter +from pathlib import Path +sys.path.insert(0,str(Path('work/odd-stages').resolve())) +from clifford_exact import * + +OUT=Path('split-centres');P=OUT/'CANONICAL-WORD.json.gz' +c=json.load(gzip.open(P));n=c['h'];frames=c['frames'];start=time.monotonic();ops=[] +for U in frames: + op=canonical_frame(n,U) + L=[u|(u<>(y.bit_length()-1)&1:x^=y + if x:return False + return True +def local(events,back): + rows={('L',r):{r:Q(1)} for r in range(n)} + norm={('L',r):Q(1) for r in range(n)};prefix=Q(1);cur=c['start'].copy();private={} + hist=Counter();phases=[];entry=[];exit=[];centers=[];matrix_hash=hashlib.sha256() + allowed=['zero_frame_precondition','entry_adapters','A','centers','B','final','exit_adapters','full_frame_cleanup','done'] + for event in events: + tag=event[0] + if tag=='phase': + phases.append(event[1]);assert phases==allowed[:len(phases)] + if event[1]=='A':assert entry==list(enumerate(c['start'])) + if event[1]=='centers':assert all(cur[r]==0 for r in range(v,2*v)) + if event[1]=='full_frame_cleanup':assert cur==c['final'] and exit==list(enumerate(c['final'])) + assert not private + elif tag=='adapter': + assert event[3]==(c['start'] if event[1]=='old_to_new' else c['final'])[event[2]] + (entry if event[1]=='old_to_new' else exit).append((event[2],event[3])) + elif tag=='climb': + _,part,r,a,b,rank=event + assert not private and phases[-1]==part and cur[r]==a + assert contains(frames[a],frames[b]) and rank==len(frames[b])-len(frames[a])>0 + hist[rank]+=1;cur[r]=b + elif tag=='center': + _,k,a,b,rank=event + assert phases[-1]=='centers' and private=={('C',k):a} + cf=c['center_frames'][k];cr=len(frames[cf]) + assert (a,b,rank)==((0,cf,cr) if back else (cf,0,cr)) + private['C',k]=b;hist[rank]+=1;centers.append(k) + elif tag=='scalar': + _,e,f=event;op=e[0];target=tuple(e[1]);source=tuple(e[2]) if op in ('copy','add') else None + if target[0]=='C' and op=='clear': + assert private.get(target,f)==f + private.pop(target,None) + else: + for r in (target,source): + if r is None:continue + if r[0]=='L':assert cur[r[1]]==f,('common frame',r,cur[r[1]],f) + else: + if r==target and r not in private:private[r]=f + assert private[r]==f + if op=='clear':rows[target]={};norm[target]=Q(0) + elif op=='copy':rows[target]=dict(rows[source]);norm[target]=norm[source] + elif op=='scale': + q=Q(e[2],e[3]);a,b=abs(q.numerator),q.denominator + assert a&(a-1)==0 and b&(b-1)==0 + rows[target]={j:q*x for j,x in rows[target].items()};norm[target]*=abs(q) + else: + q=Q(e[3],e[4]);a,b=abs(q.numerator),q.denominator + assert source!=target and b&(b-1)==0 + # Independent symbolic replay of the cleared coefficient work. + w=0 + for bit in bin(a)[2:]:w=2*w+int(bit) + assert Q(w,b)*(1 if q>0 else -1)==q + prefix=max(prefix,Q(a)*norm[source]) + norm[target]=norm.get(target,Q(0))+abs(q)*norm[source] + row=rows.setdefault(target,{}) + for j,x in list(rows[source].items()): + z=row.get(j,Q(0))+q*x + if z:row[j]=z + else:row.pop(j,None) + prefix=max(prefix,norm[target]) + else:raise AssertionError(tag) + assert phases==allowed and centers==list(range(len(c['centers']))) and not private + assert all(not row for reg,row in rows.items() if reg[0]=='C') + for r in range(n): + expected={r:Q(1)} + if back and r x + ((q+e_j).x)(q+e_j). Its remaining columns are an orthonormal basis +of q^perp. For s>0, rho_s,q exchanges that complement in the local block +with exterior block s and fixes q and all other exterior coordinates. +It is a symmetric orthogonal involution. The stage data owners are +g=d*rho_s,q, with rho_0,q=I, so the right factors are bijections of O(73,2). + +Use canonical data levels X_s=C_[0,9+8s), Y_s=X_s C_q^(-1), and initially +X_(-1)=C_q, Y_(-1)=I. The routed stage starts at level s-1 and ends at level s. +Their binary preimages agree with the window endpoints. Exact phase +polynomials determine the translation that reconciles each endpoint, and +the template applies that translation. There are 3840 nonzero such +translations across the 120 port types and nine stages, before replica +multiplicity. These operators are not silently identified from equal +binary matrices. + +Four-pair scalar chain and idle children + +Starting with F_0 (Y_0 += X_0), for j=0,1,2,3 apply B_j (X_j -= Y_j), +then for j<3 apply X_j += X_(j+1), Y_(j+1) -= Y_j, apply F_j, and undo +that bridge. The last pair has B_3,F_3 without a following bridge. +Afterwards apply, in descending j=2,1,0, X_(j+1)+=X_j and Y_j-=Y_(j+1). +Finally exchange each pair by newX=oldY, newY=-oldX. The complete signed +integer scalar matrix is the identity; omission of every bridge fails. + +Before a bridge, advance the idle pair to the active pair's level. The +two advances for the newly used pairs have ranks (16,8), (32,8), (48,8). +The final advances have ranks 48,32,16,0. Each rank occurs on both members +of the pair, each of 120 ports, and each of eight replicas. A nested idle +transition is factored in the explicit orthonormal basis U_q direct_sum I. +Its exact Z4 phase is reconciled by the stored translation after that child. + +The final Y endpoint is C_all C_q^(-1). A source began at C_q, so its +unadjusted exchange route would be C_all C_q^(-2)=C_all X_q. Applying the +literal X_q to each final Y before the signed exchange removes this factor. +The corresponding 120 omission controls fail. This correction is charged. + +Banks and arbitrary correlated dirt + +There are eight replicas of each of the four data pairs, hence 7680 data +families. Each stage has 783 independent bank families. Number a local +helper occurrence by z=783*replica+helper. It uses bank floor(z/8) and slot +z mod 8, with its nine-dimensional residual assigned to coordinates +[9*slot,9*slot+9). A paid coordinate C child at coordinate 72 completes +each bank. All eight whole residuals and this padding fill dimension 73. +Thus there are 9*783=7047 bank families and live stock 14727. + +Let Pi_slot swap the first nine coordinates with the assigned block. The +local invocation at class d uses the bank class g=d*Pi_slot^(-1). Its +residual at that owner is P_g C_block P_g^(-1). Right multiplication is a +bijection. Local helpers sharing one bank have distinct slots, hence +different right factors and different actual bank classes for every d. +All data and private families are disjoint from banks. The checker verifies +these injections for all 72 invocation/replica templates and 56376 residual +assignments. A complete cover sweep for one replica finishes before the +next begins. The local dirty invocation is block diagonal on helpers at +its endpoint and permits arbitrary correlated helper values. Therefore +overlap between different invocations does not impose a cleanliness or +independence assumption. At each bank class, the eight residuals and the +padding are coordinate factors in one common conjugated basis, and their +exact product is P_g C_all P_g^(-1). + +One more exact correction is essential. Orthogonality alone does not imply +that P_g commutes with C_all as an exact operator. In fact + P_g C_all P_g^(-1) = C_all X_delta(g), + delta(g)_i = (weight(row_i(g))-1)/2 mod 2. +The quadratic terms cancel by row orthogonality and the remaining even +linear terms give the displayed translation. Both sides fix the uniform +vector, fixing the global scalar. Apply X_delta(g) to EVERY final live +family in cover class g, after the bank padding and signed data exchange. +The template includes and charges all 14727 corrections per cover. This +identity is also checked on every orthogonal matrix in dimensions 1..5. + +Finite work and recurrence charges + +The source emitter is regenerated and revalidated in both orientations. +It accounts for 1242936 local events over 72 invocations, with all copied +center and dirty-tableau lifetimes intact. Forward and backward scalar +words freshly replay all 1023 independent dirty live columns. Only the +private work starts at zero. Work comprises 783 tableau streams, nine +reserved center streams (eight used), and one coefficient stream. Each +invocation completes and erases its private work before the next. Physical +stock is therefore 15520 per cover; scalar-only work is excluded from the +recursion-volume denominator. + +GLOBAL-REVIEW.json records the complete recomputed finite overcharge, with +64*(73+1)^3 compiler groups per rank-zero adapter, source-counted scalar +primitives, and overcharges for all data routes, bank selectors, phases, +padding, bridges, exchanges and cover corrections. The O(73,2) order is +2^(36^2)*product(2^(2i)-1,i=1..36); its bit length is 2628. The recomputed +router fits 2^30000, the literal charge fits 2^100000, and the precision +guard fits C0=2^210000. No even-dimensional orthogonal-order formula is used. + +Largest child 48 does not satisfy one-layer halving. Instead +73^2=5329>2*48^2=4608, so two nested children have width strictly below +half the parent, including floors. The general depth is bounded by +2*ceil(log2 e), with direct small leaves. For B=s+E the completed-child +semantic induction has 2B(73-48)-s-E=49B>0. The resulting conservative +complete-row coefficient is 2*2642+9909+252=15445<20161, retaining the +external bit/base-row allowance as an explicit interface assumption. +The inherited bad-branch envelope is priced conservatively as before. + +Two independent rational moment engines admit +b=999240641319551/10^18 and exclude b+10^-18 for the source-bound profile. +The rank mass is 1072575, and 73*14727-1072575=2496=8*(8*120-9*72). +This complex component exceeds 1/1024 but does not improve the current +bit bottleneck. No improved final kappa or completed PR milestone follows. diff --git a/research/split-centres-kernel-r747/proofs/PR386-BIT-GEOMETRY.txt b/research/split-centres-kernel-r747/proofs/PR386-BIT-GEOMETRY.txt new file mode 100644 index 0000000000..31efe31268 --- /dev/null +++ b/research/split-centres-kernel-r747/proofs/PR386-BIT-GEOMETRY.txt @@ -0,0 +1,191 @@ +Compressed nine-stage E8 bit supplier and combined conditional bound + +Claim and source assumptions + +The conditional combined value is + kappa = 998243154231047 / 10^18 = 0.000998243154231047 > 1/1024. +It is approximately 2^-9.9683211064. This is a conditional finite construction +in the inherited supplier framework, not a Lean proof of integer multiplication. +No priority claim is made. + +The E8 bit word, its 120 root lines, all 865 helpers, and nine retained totals +are taken without modification from Dylan Crow's PR #370, commit +b7fe9cdf2da009c947ff6b334c562bc190b30373. Its raw word has SHA256 +1fb726ea3818fe0837cceb0dd22a71a0814f064e5e781628104610d6468e0e55. +The original verification is rerun, including regeneration, independent +1105-column F2 checking, official record legality/formal columns, all-frame +Gram and prime witnesses, negative controls, and the original regression set. +Its five-stage c is 904072820242522/10^18, insufficient by itself for -10. + +The complex supplier is the separately reconstructed compressed nine-stage +component from PR #377, with b = 999240641319551/10^18. Its complete source, +notices, exact Clifford and Z4 phase checks, global template and finite bill +remain included. In particular, its terminal X_q and every-live-family +X_delta(g) corrections are retained; equality of binary matrices is not +substituted for equality of complex operators. + +The inherited all-size weighted bit compiler, tape/prime/precision and +analytic transfer interfaces remain conditional. PR #370's explicit admission +of nine copied totals at h=8 is retained. The complex local E8 theorem, +Clifford compiler, common fine-grid, restored-row and analytic interfaces +remain conditional exactly as stated in the companion component. The new +window, banking and two-level finite charges are described below rather +than inferred from a rank histogram. + +Exact bit operators and compressed ambient space + +Over an admitted odd address field, the E8 form is G=I_8/2. For a nondegenerate +subspace U, write P_U for its orthogonal projector. On the doubled address +space define + D_U = [[I-P_U, P_U], [P_U, I-P_U]]. +Thus D_U is an exact involution. If U is contained in V then +D_V D_U = D_(V intersect U-perp), with rank dim(V)-dim(U). Also + D_I D_P = D_(I-P). +These are literal address matrices. Unlike the complex C operators, they +have no hidden scalar phase. The auditor reconstructs all 944 rational +projectors and checks all 3289 used nested pairs, in both orientations. + +Set V_global = Q^8 direct_sum (Q^7)^8, m=64, with form I_64/2. +Let E_s be the first s exterior 7-blocks, s=0,...,8. At stage s lift the +entire local word by replacing U with U direct_sum E_s. Both ends of every +local transition contain the same E_s, so it cancels exactly; the child +projector and rank are unchanged. This holds for copied totals as well: +the temporary transforms between the source and scatter frames, whose +common E_s cancels. COPY/ERASE windows remain sequential and immutable. +No assumption that m is a multiple of 9h is used. + +Port routes + +The reference root is q*=2e_0. For every root q, the checked product g_q +of at most two E8 root reflections sends q* to plus or minus q. Let A_q be +its last seven columns. They form an orthonormal basis of q-perp: + A_q^T A_q=I_7, A_q A_q^T=I_8-P_q, P_q=q q^T/4. +For stage s>0 use, on the local block and exterior block s, + rho_(s,q) = [[P_q, A_q], [A_q^T, 0]], +and fix all other coordinates. For s=0 use the identity. These matrices +are orthogonal involutions. Conjugating the lifted endpoints gives + (P_q,E_s) -> (I_8,E_(s-1)), (I_8,E_s) -> (I_8,E_s), + (0,E_s) -> (I_8-P_q,E_(s-1)), + (I_8-P_q,E_s) -> (I_8-P_q,E_s). +These equalities are checked as exact rational matrices for every port. +Each nontrivial route has a replayed elementary factorization, at most +77 factors, with denominators 1,2,4. Omitting a factor fails. Thus all +routes remain defined at every odd address prime; there is no new odd +exceptional prime. The existing local prime witnesses are rerun separately. + +Nine-stage scalar recipe and deferred endpoint completion + +Use four data pairs (X_j,Y_j). Start with F_0: Y_0 += X_0. For j=0,...,3, +apply B_j: X_j -= Y_j; when j<3 insert the two shears + X_j += X_(j+1), Y_(j+1) -= Y_j; +apply F_j; then undo those two shears. After all stages, for j=2,1,0 apply + X_(j+1) += X_j, Y_j -= Y_(j+1). +Finally replace (X_j,Y_j) by (Y_j,-X_j). The complete signed integer +8-by-8 scalar matrix is the identity. Omitting any of the eighteen +individual bridge shears changes it. + +Each B_j is the reflected inverse of the actual local record stream: +reverse the order, negate ADD coefficients, replace U by U-perp, and +turn ERASE into a fresh COPY from the original unchanged center. No erase +is inverted. PR #370 stores zero in the ERASE rank field; the reflected +COPY rank is freshly derived from its two frames, giving rank 8. Both +oriented streams replay all 1105 independent input columns and close work. + +Before each bridge the newly used pair is advanced to the active level. +The two idle increments are (14,7), (28,7), (42,7). Endpoint completion of +the earlier pairs is deferred to the final stage, with ranks 42,28,14,0. +Every increment acts on both members of every port pair and every replica. +The schedule checker requires equal complete frames at every bridge. +The signed terminal exchange completes the data transform using the exact +identity D_I D_P=D_(I-P). Scalar replay on 8745 independent columns includes +960 data and 7785 separate stage-helper inputs. All are restored after +the exchange; the reflected copy work closes to zero. + +Whole-block banks and arbitrary correlated dirt + +Use eight replicas. There are 4*2*120*8=7680 data families. For each stage, +number a local helper occurrence by z=865*replica+helper, and assign it +to bank floor(z/8), slot z mod 8. There are 865 banks at each of nine +stages. Each slot is one whole 8-dimensional coordinate block in Q^64. +The eight slots are mutually perpendicular and fill the ambient space; +no padding child is needed. Live recursion stock is 7680+9*865=15465. +Nine private center slots are reserved and excluded from recursion volume, +so charged physical stock is 15474. Only one such slot is used at a time. + +Let Pi_slot exchange the first eight coordinates with its bank block. +For a cover class d in O(I_64/2,F_q), the helper owner is the bank class +g=d Pi_slot^-1, and a data owner is d rho_(s,q). Right multiplication is a +bijection of the finite cover. Within every local invocation, helpers in +the same bank have different slots, hence different actual cover classes; +all data and work families are disjoint from banks. All 62280 assignments +are checked, and every physical bank receives each of its eight slots once. + +The local all-column theorem permits arbitrary helper inputs, including +correlations created by earlier invocations. After its endpoint each helper +has only the known residual D_H. The common E_s cancels, so no cleanliness +assumption is imposed by a previous bank action. Complete cover sweeps run +sequentially. At a fixed bank owner g the residuals are D on the eight +orthogonal coordinate blocks conjugated by g. They commute and multiply +to D_I. Since diag(g,g) commutes with the literal head/tail exchange D_I, +no complex-style cover phase correction is needed on the bit side. +This is a symbolic finite cover proof, not an enumeration of O(64,F_q). + +Actual emitted ledger + +The source-bound template emits 72 local invocations and 1355328 events. +All local COPY/ERASE and helper lifetimes are rechecked. Its paid profile is + 1:149472, 2:67824, 3:32256, 4:30096, 5:22176, 6:144, + 7:5760, 8:1296, 14:3840, 28:3840, 42:3840. +There are 320544 paid children, rank mass 987264 and deficit + 64*15465-987264 = 2496 = 8*(8*120-9*72). +The independent auditor recomputes the profile from the emitted template +and rejects missing idle/bridge/exchange/invocation events, bank-slot aliasing, +understated stock, a missing local MOVE and a wrong reflected COPY charge. + +Finite cost, precision allowance and two-level halving + +The largest child is 42, so one-level halving is false. Two levels suffice: + 2*42^2=3528 < 64^2=4096. +Floors only reduce descendant widths. The exact one-level moment, including +the inherited 10^-16 bad-branch envelope, is strictly below one; composing +two levels squares this contraction. The finite composite may be used with +the inherited halving-based compiler and direct small leaves. + +The old five-stage 104-bit payload-prefix guard is not reused. Fresh local +cancellation-free row bounds are 742 forward and 6308 reverse. For five +forward calls, four reflected calls and eighteen bridge shears, the bound + 2^18 * 742^5 * 6308^4 +has 117 bits. We explicitly charge 192 bits per nine-stage block. The actual +source operations, copy episodes, 77-factor routes, selectors, all owner +adapters and this prefix bound enter certify.py's finite coefficient. It +has 117 bits; the charged two-level coefficient has 269 bits and is bounded +by 2^512. This deliberately increases the finite cutoff, rather than passing +the old 104-bit assertion. The exact three bootstrap cutoff inequalities +are checked using the changed coefficient. + +For cover/routing enumeration use the inherited coarse q^(m^2+1) bound; +two levels and the retained additive row charges give + 2*(64^2+1)+9909+252 = 18355 < 20161. +The explicit rational bit routes introduce only powers of two. The new +finite constants fit well below the companion bridge's 2^30000 reserve, +and the common external C0=2^210000 and row allowance 20161 are retained. +As for the companion complex component, the general compiler/common-grid +interfaces are assumptions; no new Lean formalization is asserted. + +Exact price and combined assembly + +Two independent rational moment engines, both with the 10^-16 envelope, +admit c=1057833103534317/10^18 and reject c+10^-18. The complex supplier +therefore binds. With eta=10^-12 and beta=10^-9 choose + s=999240640320309/10^18 < (1-beta)*b < c. +Start a0=384599/10^10 and apply a_(j+1)=(1-s)s+s*a_j three times. The retained +outer assembly at (a3,b) admits kappa=998243154231047/10^18. All 47 strict +constraints are positive; the next 10^-18 kappa grid point is rejected. +The strict excess over 1/1024 is 21680654231047/10^18. Final kappa is about +24.0286% above frozen #361, within the explicitly retained assumptions. + +Attribution: Dylan Crow / Anthropic Claude for PR #370's new local bit word; +Jacob Sussman for E8 and the complex unit; the inherited source527, PR234, +PR266, PR315, PR346, PR352 and PR363 contributors as listed in the preserved +notices; Zhihao Chen with OpenAI Codex assistance for this compressed bit +composition, its independent audit, and the combined nine-stage package. diff --git a/research/split-centres-kernel-r747/proofs/PR425-COMPLEX.txt b/research/split-centres-kernel-r747/proofs/PR425-COMPLEX.txt new file mode 100644 index 0000000000..41061757ce --- /dev/null +++ b/research/split-centres-kernel-r747/proofs/PR425-COMPLEX.txt @@ -0,0 +1,211 @@ +Hamming packets with mutable source and target bases +Conditional finite extension of the complex E8 supplier + +1. What is new + +The old r783 word keeps source values fixed and does not read target registers. +Those are sufficient restrictions on a scalar word, not necessary conditions +for a common-frame linear program. The new word uses 680 helper registers: + + * source registers themselves carry one branch of a simultaneous signed + packet computation; + * retired packet registers retain a full source basis, from which the eight + central coordinate sums are reconstructed; + * 56 pairs of targets carry a first two-output butterfly, with its input + basis explicitly compensated at frame zero and in the center decoder; + * an exact inverse on all source/helper registers is executed at their + common full frame after the last recursive climb. + +No recursive work is deleted from the ledger. A helper is counted for its +entire lifetime, including unused final climbs. All 120 sources and targets +retain their original line/full and zero/hyperplane endpoint ranks. + +The new local histogram is + {1:2248, 2:896, 3:168, 4:336, 5:392, 8:24, 9:8}. +Its rank mass is 9*680 + 240*8 + 72 = 8112. There are 4072 local children. +There are more local children than in the old r783 word, but substantially +less helper rank mass; the complete moment, not a count proxy, decides gain. + +2. Exact Hamming geometry and signed packet algebra + +Use the pinned PR370 table of 120 E8 root lines in Construction-A coordinates: +eight coordinate lines 2e_i and 112 sign lines on the 14 weight-four Hamming +blocks. For integer representatives r_s, let G_st = r_s dot r_t / 2. +The matrix C_st = 1 + G_st mod 2 has binary rank nine. The construction gives +an explicit orthonormal realization p_s in F_2^9 with + + p_s dot p_t = C_st, and p_s dot p_s = 1. + +Consequently the nonzero off-diagonal entries of G/2 occur only where a source +line lies in the target hyperplane. The rank-eight central factorization is + + (G/2)_ts = sum_i r_ti r_si / 4. + +For a source Hamming block d, a coordinate pair {i,j} in d, and epsilon=+-1, +define the signed face packet + + P(d,ij,epsilon) = sum_{s in d, r_si*r_sj=epsilon} r_si x_s. + +Each packet has four terms and its binary port span has rank three. Split +the eight sign lines of a block into its two parity tetrads. Each tetrad pair +occurs in two face packets with independent signed coefficient rows. The two +rows are formed simultaneously by two determinant-one shears, rather than +forming independent one-output sums. The packet factory uses its eight source +registers and sixteen additional helpers. Its twelve retired registers can +be oriented to retain a full rank-eight source basis. Exact elimination on +that stock produces four coordinate sums without allocating more helpers. + +This comparison of an individual factory is not a claim that the whole old +supplier used 48 helpers per block. The relevant complete counts are 783 and +680, both charged with their full actual profiles. + +For two target/source blocks whose intersection is {i,j}, the contribution +to target t is -r_ti P(d,ij,r_ti*r_tj)/2. The remaining within-block and +coordinate-line contributions are explicit four-output signed transforms. +Every one of the 14400 rational decoder entries is rechecked. Adding the +eight coordinate centers leaves precisely the identity matrix on sources. + +The binary transvection x -> x+(x dot 43)*43 is orthogonal because 43 has +even weight. It maps the constructed port set exactly to the old fixed E8 +port set. All frames and register indices are transported, so the old nine- +window data routes and their global phase correction apply to exactly the +same ordered ports, without introducing an unproved new covering geometry. + +3. General scalar-interface lemma + +Write z=(x,s) for the source and arbitrary dirty helper streams, and y for +the targets. Permit scalar additions and invertible dyadic scalings between +registers at the same current label. No target may feed a z register. The +raw A/center/B word therefore has block form + + z' = U z, + y' = V y + J x + K s, + +where U and V are invertible, and the retained-center operations are included +in J and K. The actual word has J=I after its adjusted center scatter. The +checks compute every coefficient over Q, rather than inferring it from a +desired sparsity pattern. + +At frame zero, before entry adapters or recursive children, execute + + y <- V^{-1} y - V^{-1} K s. + +Both y and s have label zero there. The code emits the literal inverse of +the 56 disjoint two-output target bases and a direct, charged dyadic old- +response matrix with 13216 additions. There is no uncharged oracle for K. +It is computed from the explicit scalar word and serialized. All coefficient +work is cleared immediately after its use. + +After the last main gate, finish every z register's climb to the full frame, +then execute U^{-1} by reversing and inverting the non-target gates. These +gates are legal at one common full frame, including helper-to-source gates. +The result is exactly + + (x,s,y) -> (x,s,y+x). + +The second orientation is the inverse transpose: negate and transpose every +addition and invert every scale in the SAME event order. Each retained +center is implemented by the transposed gather/child/scatter stream. The +result is (x,s,y) -> (x-y,s,y). Both orientations are replayed on all 920 +independent live columns, including all 680 arbitrary helper columns. +Missing compensation, missing output preconditioning, missing cleanup and +the wrong inverse-transpose order are rejected. + +Why the scalar argument lifts to exact complex labels: for each binary +subspace F use the exact canonical representative L(F). A climb from A to B +acts as L(B)L(A)^{-1}. If two registers share F, a scalar addition commutes +with their common L(F), as does a scalar scaling. Induction through the +actual stream therefore gives the block-diagonal conjugation of its scalar +matrix by the current labels. Center copies explicitly move from full to +zero, or zero to full in the other orientation. The preconditioner uses +only label-zero registers, and the z cleanup uses only full-label registers. +Thus the proof never moves a scalar operation across unequal labels or +identifies two frames merely because their ranks agree. + +Every used canonical frame, nested transition, center direction and endpoint +adapter is independently lowered by the exact Gaussian Clifford compiler. +Equalities include global phase. The old restricted gx gate-shape checker +is not used to admit this new interface; the stronger explicit matrix and +common-frame checks replace its source-immutability/target-read restrictions. +This is a written finite algebraic extension, not a new Lean theorem. + +4. Complete programs and work lifetimes + +Each orientation emits 27537 events, including startup, entry/exit adapters, +all recursive climbs, eight sequential center children, scalar operations +and final cleanup. Temporary centers are initialized, used and erased one +at a time. No center or coefficient work stream survives a live child. + +All added coefficients are dyadic. To apply a/2^j, compute |a| times the +source by binary Horner additions on a cleared private stream, halve j +times, accumulate with its sign, and clear the private stream. In-place +scales are signed powers of two. Every such primitive is charged. This +introduces no new denominator prime. Independent replay bounds the actual +cancellation-free prefix norms, including coefficient work; a 192-bit local +payload allowance is retained conservatively. + +5. Nine-window composition and finite bill + +Use the previously verified m=73 compressed nine-window geometry, four data +pairs, eight replicas, and the original signed bridges, idle children, +terminal exchange, terminal translations and full-cover phase correction. +The source scalar identity and its negative inverse-transpose are exactly +the two local interfaces consumed by that unchanged geometry. + +There are 680 whole-block banks per stage, each containing eight rank-nine +helper blocks plus one paid rank-one padding child. The live width is + + W = 240*4*8 + 9*680 = 13800. + +The conservative physical width is W+680+9+2=14491. The old-response matrix +uses no persistent tableau, but the old-size reserve is still charged. +The emitted owner table has 48960 distinct stage/replica/helper assignments. +The new global profile is + + {1:167976, 2:64512, 3:12096, 4:24192, 5:28224, + 8:7488, 9:576, 16:3840, 32:3840, 48:3840}. + +Its rank deficit is 73*13800 - sum(r*H_r) = 2496. The maximum child is 48, +and 73^2 > 2*48^2 supplies the same charged two-level halving argument. + +The finite bill is recomputed from the new scalar programs, bank owners, +work stock and adapter counts. It is not asserted unchanged. The local +primitive bound fits 2^48; the tape router fits 2^30000; the literal envelope +fits 2^100000; the precision envelope fits 2^210000. The physical row +coefficient is 15445, below the explicitly inherited external allowance +20161. Full-cover corrections apply to all 13800 live families. + +6. Conditional numerical conclusion and retained assumptions + +Two independent rational moment engines, with the inherited 10^-16 bad- +branch envelope, accept + + b = 1049104978040580 / 10^18 = 0.001049104978040580 + +and reject the next 10^-18 grid point. With the unchanged bit parameter +c=0.001057833103534317, three bootstrap steps and all 47 strict outer +conditions give the prospective finite-assembly value + + kappa = 1048005508028206 / 10^18 + = 0.001048005508028206, approximately 2^-9.898137985359. + +The finite statement is conditional on the same all-size weighted compiler, +common fine grid, restored-row/base allowance, tape/prime/precision and +analytic transfer interfaces as the retained nine-stage result. The new +scalar-interface lemma above and its serialized program are additional +reviewable material, not an appeal to gx accepting a program outside its +grammar. No unconditional integer-multiplication theorem is claimed. +The result is approximately +4.97% over the locally verified retimed bound, +and remains well short of 2^-9. A fresh extracted-package replay is required +by this research workflow before publication or final promotion. + +Attribution + +The root table and the motivation to use Hamming coordinates come from the +already pinned PR370 bit package (Dylan Crow, with Anthropic Claude assistance). +The E8 complex label family, original scalar word and gx interfaces are due +to Jacob Sussman. The retained complex admission, pricing and global analytic +interfaces are credited in the original package notices and PROOF.txt. +The mutable-basis packet word, transported geometry, expanded scalar proof, +new finite program and the present checks were developed in this local +research session by Zhihao Chen with OpenAI Codex assistance. diff --git a/research/split-centres-kernel-r747/proofs/PR426.md b/research/split-centres-kernel-r747/proofs/PR426.md new file mode 100644 index 0000000000..e589cfbf50 --- /dev/null +++ b/research/split-centres-kernel-r747/proofs/PR426.md @@ -0,0 +1,108 @@ +# Construction, dependencies and sufficient argument + +The fixed complex witness starts from Chafik Boukhalfa's far-retimed E8 word +and applecrusher's two equal-helper substitutions and two frame refinements. +It additionally replaces helper 556 by -2 times helpers 354 and 461, then +helper 576 by -2 times helpers 402 and 478 after compaction. Exact clean +linear forms agree at every substituted read. The backward upper-frame and +forward nested repairs retain copied-total pins and final address caps. +R is 779. The actual new dirty response and cleanup are regenerated: equality +on clean values alone is not the arbitrary-dirt proof. + +The signed prefix restoration is the PR390/395 bracket. For 25 disjoint +targets, subtract lambda times the donor before the prefix, emit the exact +source/write-version/frame difference, and restore lambda times that donor +at the common recovery frame. Lambda is +1 or -1. The full rational main +operator and all retained totals agree with the explicit same-width R779 +baseline on all 1,019 independent columns. Source/helper subwords agree +exactly, so the new baseline's explicit dirty response and cleanup remain +valid. The changed compiler permits a main Y read only when its target is Y; +helper-to-X remains forbidden. Both signed orientations and private lifetimes +are freshly admitted, with all actual Clifford phases and physical incidences. + +The shared entrance construction follows PR401/404. Each pivot p satisfies +K_p + sum_d a_pd K_d = 0 in the explicit baseline response. Four re-pivots +from PR412 replace the basis of these same relations, including the +half-valued donor that otherwise fails the original sixths-denominator +condition. PR410 enlarges eight entrance subspaces. Removed original helpers +556 and 577 are mapped explicitly onto our R779 word. The shared layer has +192 pivots, rank mass 350, and 496 literal unit shears. Its pivots and donors +are disjoint, so this layer alone has (S-I)^2=0. + +PR409's four ordered groups, with PR412's two additional re-pivots, prepend +55 more shears and admit ten further pivots. The combined word has 202 +gauges of rank mass 360 and 551 entrance shears. The complete chronological +prefix need not have (S-I)^2=0. We check its actual product M S, all retained +totals, and that every gauged target-response column is zero. Every entrance +source is read before any earlier entrance operation writes it. + +Every one of the 551 omission controls is recomputed from the suffix +response. If shear t += q s is removed, its suffix response is multiplied +by -q times the original independent s column: earlier operations leave s +unchanged by the read-before-write condition. A nonzero response is required +for each omission; the entire changed scalar schedule is also replayed for +sampled omissions. No global donor/pivot disjointness is assumed here. Both +unchanged original gx.check1 and gxcore.mirror checkers pass, including the +native denominator conditions. Every actual nested transition is charged. + +PR376's additional target201/helper491 frame change from rank eight to seven +is checked for full operator equality and nested paid paths before gauging. +PR404's target125/124 overlapping-prefix recovery requires a different +chronological input and is not imported. Its numerical gain is not included. + +Each entrance chart is normalized explicitly. Even and degenerate E_p use +the full two-sided exact Clifford factorization of F T_E inverse. The right +inverse adapter precedes the entire old-response invocation; the left inverse +adapter follows all main and helper cleanup. Both orientations retain every +unitary address operator in the inverse-adjoint chronology. Rank-zero adapters +are costed. All old/new/reflected Gaussian child pairs are recomputed, +including Pauli signs and global phase. Newly assigned mixed-bank coordinate +permutations and inverse owners are emitted and independently decoded. +Padding is an exact fixed integer witness, not a claim of solver optimality. + +The new bit operation differs from the preceding all-dirt reset: a retired +helper only needs its clean X-content zeroed before a new logical helper is +placed in the same slot. An arbitrary residual helper value is allowed. The +new helper basis determines a newly computed initial D compensation. C is +the reversed helper subword, restoring every physical helper, including its +original independent dirt. Each reset is checked exactly before reuse; the +retired slot has no later original use, the new helper has no earlier use, +and copied totals are protected. The combined word is checked over every +independent binary column. It uses 55 fewer helpers (822 to 767). The initial 27 reuses and 26 frame +moves are followed by two fixed rounds of 14 reuses and 14 frame moves. +The later resets use exact two- or three-parent clean forms; every parent +and all rebuilt dirty compensation are charged and independently checked. Integer signed-prefix bounds, lifting, +copied-center controls, routes and whole-bank packing are recomputed rather +than inferred from the clean calculation. + +The complex assembly has dimension 73, 14,286 live and +15,075 physical families, 734 banks per stage, deficit 2,496, +maximum child rank 48 and halving degree two. The bit assembly has dimension +56, 10,409 live families, deficit 1,512 and halving degree two. Actual row +coefficients fit the common 20,161 reserve. Both finite invoices and both +exact rational moment engines retain the positive 10^-16 fallback. Adjacent +10^-24 complex coarse grid points are rejected; the unchanged bit coarse +grid remains 10^-18. The exact outer assembly uses positive eta=10^-24, +beta=10^-18, eight finite bootstrap continuations and a 10^-27 grid; it +checks 47 strict constraints and invalid eta/beta/adjacent-point controls. + +The complex coefficient is 254951444354246755323/250000000000000000000000. The bit coefficient is +104575879789097/100000000000000000. The resulting conditional kappa is 40750673324589432209923/40000000000000000000000000. +Using the preceding unchanged bit supplier with this same complex coefficient +gives 203354853562950029967497/200000000000000000000000000, where the bit side +binds. The new clean-reuse bit supplier removes that bottleneck. Its exact +additional kappa contribution is recorded as the difference from this fair +control; the combined witness is limited by the new complex coefficient. + +All original files are manifest-bound and immutable. A copied supplier tree +is changed only through asserted literal edits. DERIVATION.json records every +old/new digest, changed pin and textual difference. Both full predecessor +supplier suites run before the changed admission. Expected records are checked +after recomputation, rather than used to obtain a PASS. + +This is a sufficient finite conditional construction. The inherited all-size +recursive suppliers, canonical/rank-zero compiler, compressed Clifford windows, +dirty banking/cover, routing, restored-row, fixed tape, common-grid, Gaussian +precision/recovery and analytic interfaces remain assumptions. No new full +Lean theorem or unconditional integer-multiplication exponent is asserted. +The target kappa > 0.002 is not attained by this witness. diff --git a/research/split-centres-kernel-r747/stages/kernel-selection.json b/research/split-centres-kernel-r747/stages/kernel-selection.json new file mode 100644 index 0000000000..b147658052 --- /dev/null +++ b/research/split-centres-kernel-r747/stages/kernel-selection.json @@ -0,0 +1,1402 @@ +{ +"stage": "kernel", +"input": "R758 source-centre word of #433 (bit-source-centres.json)", +"input_sha256": "98ffef9246c8bf6c537ab5e134321abea05cf0b7830c9e3fd92cbe4e88d8c308", +"output_sha256": "cc6242d90ccdd8477521ea16f35ee2667dbe6c48cc60c6e4e9bcf6460497b233", +"entries_count": 118, +"total_entrance_rank": 160, +"donor_slots": 119, +"provenance": "#417 discovery (ils.py, chi at m=64) on this word: res/k039.json", +"entries": [ +[ +[ +2 +], +738, +[ +257, +736 +] +], +[ +[ +2 +], +739, +[ +256, +737 +] +], +[ +[ +1 +], +741, +[ +250, +740 +] +], +[ +[ +1 +], +743, +[ +248, +742 +] +], +[ +[ +0 +], +745, +[ +244, +744 +] +], +[ +[ +0 +], +747, +[ +242, +746 +] +], +[ +[ +4 +], +751, +[ +779, +835 +] +], +[ +[ +4 +], +752, +[ +268, +750 +] +], +[ +[ +4 +], +753, +[ +269, +779, +835 +] +], +[ +[ +5 +], +755, +[ +272, +754 +] +], +[ +[ +1 +], +756, +[ +768, +860 +] +], +[ +[ +1 +], +757, +[ +248, +768, +860 +] +], +[ +[ +0 +], +761, +[ +242, +760 +] +], +[ +[ +6 +], +767, +[ +281, +765 +] +], +[ +[ +1 +], +769, +[ +248, +768 +] +], +[ +[ +0 +], +773, +[ +242, +772 +] +], +[ +[ +0 +], +777, +[ +762, +763, +776 +] +], +[ +[ +4 +], +780, +[ +267, +778 +] +], +[ +[ +4 +], +781, +[ +269, +779 +] +], +[ +[ +2 +], +783, +[ +257, +782 +] +], +[ +[ +2 +], +785, +[ +256, +784 +] +], +[ +[ +0 +], +787, +[ +241, +786 +] +], +[ +[ +0 +], +789, +[ +748, +749, +788 +] +], +[ +[ +0 +], +791, +[ +762, +763, +790 +] +], +[ +[ +5 +], +795, +[ +275, +793 +] +], +[ +[ +2 +], +797, +[ +257, +796 +] +], +[ +[ +2 +], +799, +[ +256, +798 +] +], +[ +[ +0 +], +801, +[ +748, +749, +800 +] +], +[ +[ +0 +], +803, +[ +241, +802 +] +], +[ +[ +0 +], +804, +[ +762, +776, +790 +] +], +[ +[ +0 +], +805, +[ +763, +776, +790 +] +], +[ +[ +7 +], +808, +[ +284, +806 +] +], +[ +[ +4 +], +809, +[ +269, +807 +] +], +[ +[ +3 +], +811, +[ +263, +810 +] +], +[ +[ +4 +], +813, +[ +268, +812 +] +], +[ +[ +0 +], +814, +[ +776, +790 +] +], +[ +[ +0 +], +815, +[ +762, +763, +776, +790 +] +], +[ +[ +0 +], +817, +[ +241, +816 +] +], +[ +[ +0 +], +818, +[ +748, +800 +] +], +[ +[ +0 +], +819, +[ +749, +800 +] +], +[ +[ +5 +], +822, +[ +272, +820 +] +], +[ +[ +5 +], +823, +[ +275, +821 +] +], +[ +[ +6 +], +825, +[ +764, +766, +824 +] +], +[ +[ +5 +], +827, +[ +274, +826 +] +], +[ +[ +0 +], +828, +[ +762, +790 +] +], +[ +[ +0 +], +829, +[ +763, +790 +] +], +[ +[ +0 +], +830, +[ +748, +788 +] +], +[ +[ +0 +], +831, +[ +749, +788 +] +], +[ +[ +0 +], +832, +[ +786, +802, +816 +] +], +[ +[ +0 +], +833, +[ +241, +786, +802, +816 +] +], +[ +[ +7 +], +836, +[ +283, +834 +] +], +[ +[ +4 +], +837, +[ +269, +835 +] +], +[ +[ +2 +], +838, +[ +736, +782 +] +], +[ +[ +2 +], +839, +[ +257, +736, +782 +] +], +[ +[ +2 +], +840, +[ +737, +798 +] +], +[ +[ +2 +], +841, +[ +256, +737, +798 +] +], +[ +[ +1 +], +845, +[ +250, +844 +] +], +[ +[ +5 +], +851, +[ +275, +849 +] +], +[ +[ +2 +], +852, +[ +736, +796 +] +], +[ +[ +2 +], +853, +[ +257, +736, +796 +] +], +[ +[ +2 +], +854, +[ +737, +784 +] +], +[ +[ +2 +], +855, +[ +256, +737, +784 +] +], +[ +[ +5 +], +857, +[ +792, +794, +856 +] +], +[ +[ +1 +], +859, +[ +250, +858 +] +], +[ +[ +1 +], +861, +[ +248, +860 +] +], +[ +[ +4 +], +863, +[ +779, +807, +835 +] +], +[ +[ +4 +], +865, +[ +269, +779, +807, +835 +] +], +[ +[ +6 +], +867, +[ +764, +766, +866 +] +], +[ +[ +4 +], +869, +[ +268, +868 +] +], +[ +[ +1 +], +873, +[ +249, +872 +] +], +[ +[ +1 +], +874, +[ +742, +768 +] +], +[ +[ +1 +], +875, +[ +248, +742, +768 +] +], +[ +[ +5 +], +877, +[ +793, +821, +849 +] +], +[ +[ +5 +], +879, +[ +275, +793, +821, +849 +] +], +[ +[ +3 +], +881, +[ +263, +880 +] +], +[ +[ +5 +], +883, +[ +274, +882 +] +], +[ +[ +1 +], +884, +[ +844, +858 +] +], +[ +[ +1 +], +885, +[ +250, +844, +858 +] +], +[ +[ +5 +], +887, +[ +272, +886 +] +], +[ +[ +1 +], +888, +[ +742, +768, +860 +] +], +[ +[ +1 +], +889, +[ +248, +742, +768, +860 +] +], +[ +[ +4 +], +891, +[ +779, +807 +] +], +[ +[ +4 +], +893, +[ +269, +779, +807 +] +], +[ +[ +2 +], +894, +[ +782, +796 +] +], +[ +[ +2 +], +895, +[ +257, +782, +796 +] +], +[ +[ +5 +], +897, +[ +792, +794, +896 +] +], +[ +[ +4 +], +899, +[ +267, +898 +] +], +[ +[ +5 +], +900, +[ +754, +820 +] +], +[ +[ +5 +], +901, +[ +272, +754, +820 +] +], +[ +[ +2 +], +903, +[ +254, +902 +] +], +[ +[ +2 +], +908, +[ +784, +798 +] +], +[ +[ +2 +], +909, +[ +256, +784, +798 +] +], +[ +[ +6 +], +913, +[ +279, +912 +] +], +[ +[ +2 +], +917, +[ +254, +916 +] +], +[ +[ +6 +], +919, +[ +764, +824, +866 +] +], +[ +[ +6 +], +921, +[ +766, +824, +866 +] +], +[ +[ +4 +], +922, +[ +750, +812, +868 +] +], +[ +[ +4 +], +923, +[ +268, +750, +812, +868 +] +], +[ +[ +5 +], +924, +[ +856, +896 +] +], +[ +[ +5 +], +925, +[ +792, +794, +856, +896 +] +], +[ +[ +4 +], +927, +[ +267, +926 +] +], +[ +[ +5 +], +928, +[ +754, +820, +886 +] +], +[ +[ +5 +], +929, +[ +272, +754, +820, +886 +] +], +[ +[ +7 +], +931, +[ +284, +930 +] +], +[ +[ +0, +3, +5, +6, +112, +113, +114, +115, +116, +117, +118, +119 +], +938, +[ +932, +933, +937 +] +], +[ +[ +0, +3, +4, +7, +72, +73, +74, +75, +76, +77, +78, +79 +], +940, +[ +934, +935, +939 +] +], +[ +[ +0, +1, +2, +3, +64, +65, +66, +67, +68, +69, +70, +71 +], +949, +[ +941 +] +], +[ +[ +0, +2, +5, +7, +40, +41, +42, +43, +44, +45, +46, +47 +], +953, +[ +942, +944, +951 +] +], +[ +[ +0, +2, +4, +6, +16, +17, +18, +19, +20, +21, +22, +23 +], +957, +[ +946, +947, +955 +] +], +[ +[ +0, +1, +6, +7, +24, +25, +26, +27, +28, +29, +30, +31 +], +958, +[ +943, +945, +956 +] +], +[ +[ +2, +3, +6, +7, +88, +89, +90, +91, +92, +93, +94, +95 +], +961, +[ +936 +] +], +[ +[ +2, +3, +6, +7, +88, +89, +90, +91, +92, +93, +94, +95 +], +970, +[ +936, +962, +969 +] +], +[ +[ +2, +3, +4, +5, +96, +97, +98, +99, +100, +101, +102, +103 +], +972, +[ +963, +964, +971 +] +], +[ +[ +1, +3, +5, +7, +104, +105, +106, +107, +108, +109, +110, +111 +], +974, +[ +965, +966, +973 +] +], +[ +[ +1, +3, +4, +6, +80, +81, +82, +83, +84, +85, +86, +87 +], +976, +[ +967, +968, +975 +] +], +[ +[ +4, +5, +6, +7, +56, +57, +58, +59, +60, +61, +62, +63 +], +978, +[ +959, +960, +977 +] +], +[ +[ +1, +2, +5, +6, +48, +49, +50, +51, +52, +53, +54, +55 +], +984, +[ +979, +980, +983 +] +], +[ +[ +1, +2, +4, +7, +8, +9, +10, +11, +12, +13, +14, +15 +], +986, +[ +981, +982, +985 +] +] +] +} \ No newline at end of file diff --git a/research/split-centres-kernel-r747/vendor/clifford_exact.py b/research/split-centres-kernel-r747/vendor/clifford_exact.py new file mode 100644 index 0000000000..166841a037 --- /dev/null +++ b/research/split-centres-kernel-r747/vendor/clifford_exact.py @@ -0,0 +1,149 @@ +"""Small exact Gaussian-dyadic Clifford compiler, independent of gx internals. +Paulis use i^p X^x Z^z. State vectors use integer Gaussian numerators / 2^d. +The tableau is supplemented by a literal circuit, so global phases are kept. +""" +from dataclasses import dataclass + +def parity(x):return x.bit_count()&1 +def rank(rows): + p={} + for x in rows: + while x: + b=x.bit_length()-1 + if b not in p:p[b]=x;break + x^=p[b] + return len(p) +def transpose(rows,n):return tuple(sum(((rows[j]>>i)&1)<>j&1);a[j],a[k]=a[k],a[j] + for i in range(n): + if i!=j and a[i]>>j&1:a[i]^=a[j] + assert [r&((1<>n for r in a) +def basis_extend(cols,n): + out=[] + for x in list(cols)+[1<len(out):out.append(x) + assert len(out)==n + return tuple(out) +def nullspace(rows,n): + a=list(rows);p=[];k=0 + for j in range(n): + t=next((i for i in range(k,len(a)) if a[i]>>j&1),None) + if t is None:continue + a[t],a[k]=a[k],a[t] + for i in range(len(a)): + if i!=k and a[i]>>j&1:a[i]^=a[k] + p.append(j);k+=1 + return tuple((1<>j)&1)<>i&1:out=pmul(out,T[i]) + for i in range(n): + if z>>i&1:out=pmul(out,T[n+i]) + return out +def compose(A,B):return tuple(apply(A,p) for p in B) +def inverse(T): + n=len(T)//2;cols=[x|(z<>n;u,v,p=apply(T,(x,z,0));assert (u,v)==identity(n)[j][:2];out.append((x,z,(-p)%4)) + return tuple(out) +def qvalue(Q,alpha,x,n): + return (sum(alpha[i] for i in range(n) if x>>i&1)+2*sum(parity((Q[i]>>(i+1))&(x>>(i+1))) for i in range(n) if x>>i&1))%4 +def mul_i(a,p): + x,y=a;p%=4 + return [(x,y),(-y,x),(-x,-y),(y,-x)][p] +@dataclass +class Op: + n:int + tab:tuple + circuit:list + def then(self,b): + assert self.n==b.n + return Op(self.n,compose(b.tab,self.tab),self.circuit+b.circuit) + def adjoint(self): + circ=[] + for e in reversed(self.circuit): + if e[0]=='P':circ.append(('P',inv(e[1],self.n))) + elif e[0]=='D':circ.append(('D',e[1],tuple((-x)%4 for x in e[2]))) + elif e[0]=='C':circ.append(('C',e[1],-e[2])) + elif e[0]=='phase':circ.append(('phase',(-e[1])%4)) + else:circ.append(e) + return Op(self.n,inverse(self.tab),circ) + def zero_state(self,basis=0): + N=1<>i)&1 for i in range(n)) + assert all(alpha[i]%2==(Q[i]>>i)&1 for i in range(n)) + return Op(n,tuple([(1<>i&1 else 0,1<>i&1 else 0) for i in range(n)]),[('C',q,sgn)]) +def xgate(n,b):return Op(n,tuple([(1<>i)&1)) for i in range(n)]),[('X',b)]) +def fourier(n,axes=None): + out=ident(n) + for i in range(n) if axes is None else axes:out=out.then(cgate(n,1<len(selected):picks.append(j);selected.append(x) + assert len(picks)==r and all(x>>r==0 for x in Bcols) + Br=transpose(selected,r);Bi=inv(Br,r);Dr=transpose([Dcols[j]&((1< 2: + x /= 2 + k += 1 + lo, hi = log_unit(x) + l2, u2 = log_unit(Q(2)) + lo, hi = lo+k*l2, hi+k*u2 + # Outward rational rounding keeps later certificates compact. + return Q((lo*GRID).__floor__(), GRID), Q((hi*GRID).__ceil__(), GRID) + + +def exp_bounds(x): + require(0 <= x < 1, "exponential range") + term = total = Q(1) + for j in range(1, 13): + term *= x/j + total += term + tail = term*x/13/(1-x/14) + return total, total+tail + + +def moment(m, W, entries, saving): + lo = hi = Q(0) + for t, count in entries: + t, count = int(t), int(count) + require(0 < t < m and count > 0, "improper child") + l, u = log_bounds(Q(m, t)) + lower = exp_bounds(saving*l)[0] + upper = exp_bounds(saving*u)[1] + lo += Q(t*count, m*W)*lower + hi += Q(t*count, m*W)*upper + return Q((lo*GRID).__floor__(), GRID), Q((hi*GRID).__ceil__(), GRID) + diff --git a/research/split-centres-kernel-r747/vendor/engines/moment.py b/research/split-centres-kernel-r747/vendor/engines/moment.py new file mode 100644 index 0000000000..7d697cb452 --- /dev/null +++ b/research/split-centres-kernel-r747/vendor/engines/moment.py @@ -0,0 +1,113 @@ +"""Independent prospective ordinary five-stage cost, never supplier admission. + +Consumes a raw one-invocation ledger made from the actual source/internal/target +paths. No packed profile is used as an input. Missing physical/finite/compiler +obligations must remain explicit in the accompanying report. +""" +from collections import Counter +from decimal import Decimal, localcontext, ROUND_FLOOR +from fractions import Fraction as F +from functools import lru_cache +from math import factorial +import hashlib, json, sys +from pathlib import Path + +DYAD = 1 << 224 + +def floor(x): return F(x.numerator*DYAD//x.denominator, DYAD) +def ceil(x): return -floor(-x) + +@lru_cache(None) +def logarithm(x): + """Mercator bounds after binary reduction; ln(2) via two Mercator sums. + + For 1 <= y < 2, log(y) is an alternating series in z=y-1. + We instead reduce to 1 <= y < 3/2, and bound log(3/2) and + log(2) by the same alternating series at z=1/2 and z=1/3, + using log(2)=log(3/2)+log(4/3). All sums are exact rationals. + """ + assert x >= 1 + k = 0 + while x >= 2: x /= 2; k += 1 + j = int(x >= F(3, 2)) + if j: x /= F(3, 2) + def mercator(y): + z=y-1 + assert 0 <= z <= F(1,2) + # An even partial sum is below log; the next term bounds its tail. + t=z; s=F(0) + for n in range(1, 225): + s += (t if n & 1 else -t)/n + t *= z + return s, s+t/225 + a,b=mercator(x); c,d=mercator(F(3,2)); e,f=mercator(F(4,3)) + return floor(a+(k+j)*c+k*e), ceil(b+(k+j)*d+k*f) + +def exponential(l,u): + assert 0 <= l <= u < F(1,10) + def poly(x): + s=t=F(1) + for j in range(1,25): t=t*x/j; s+=t + return s,t + lo,_=poly(l);hi,last=poly(u) + return floor(lo),ceil(hi+last*u/25/(1-u/26)) + +def moment(H,m,W,a,bad=False): + lo=hi=F(0) + for r,n in H.items(): + assert 0 < r < m and n > 0 + l,u=logarithm(F(m,r)); e,f=exponential(a*l,a*u) + p=F(r*n,m*W);lo+=p*e;hi+=p*f + if bad: + # Existing envelope shape, only conditionally portable to the new cover. + l,u=logarithm(F(m));e,f=exponential(a*l,a*u) + p=F(32*m*sum(H.values()),10**16*W) + lo+=p*e;hi+=p*f + return floor(lo),ceil(hi) + +def decimal(x): + with localcontext() as c: + c.prec=70 + return str(Decimal(x.numerator)/Decimal(x.denominator)) + +def certify(H,m,W,bad=False): + with localcontext() as c: + c.prec=70 + terms=[(Decimal(r*n)/Decimal(m*W),(Decimal(m)/Decimal(r)).ln()) for r,n in H.items()] + fallback=Decimal(32*m*sum(H.values()))/Decimal(10**16*W) if bad else Decimal(0) + lm=Decimal(m).ln();lo=Decimal(0);hi=Decimal('.003') + for _ in range(210): + a=(lo+hi)/2 + if sum(p*(a*l).exp() for p,l in terms)+fallback*(a*lm).exp()<1:lo=a + else:hi=a + q=int(((lo+hi)/2*10**24).to_integral_value(rounding=ROUND_FLOOR)) + lo=F(q,10**24);hi=lo+F(1,10**24) + lv=moment(H,m,W,lo,bad);hv=moment(H,m,W,hi,bad) + assert lv[1]<10 for v in slacks.values()),{k:str(v) for k,v in slacks.items() if v<=0} + assert min(margins.values())==minimum + assert margins['balanced_prefix']-minimum==eta and 1-eps-r==eta/2 + assert 1-eps*(1+c)==eta-eps*eta/4 + return dict(parameters=dict(a_bit=a,a_complex=b,tau=tau,sigma=sigma, + eta=eta,beta=beta,q=q,c=c,epsilon=eps,lambda_=lam, + lambda_prime=lp,alpha_squared_power=r,delta=delta, + C0=bridge['semantic']['C0'],C1=1,kappa=kappa), + strict_constraints=slacks,margins=margins,minimum_margin=minimum, + absorption_gap=minimum-kappa, + recurrence=dict(internal=internal,leaf=leaf,reservations=1-c)) diff --git a/research/split-centres-kernel-r747/vendor/export_records.py b/research/split-centres-kernel-r747/vendor/export_records.py new file mode 100644 index 0000000000..3632d37048 --- /dev/null +++ b/research/split-centres-kernel-r747/vendor/export_records.py @@ -0,0 +1,72 @@ +"""Export a bitE8/1 word to the PR249 record format read by PR #266's official cohort checkers and PR #315's engines. +usage: python3 export_records.py word.json[.gz] OUTDIR -> OUTDIR/{249-records.bin,249-states.json,frames.json} +Records are int32 six-tuples: MOVE(0,role,old,new,rank,0), ADD(1,dst,src,1,frame,phase), COPY(2,centre,temp,frame,ZERO,rank), +ERASE(3,centre,temp,frame,ZERO,0). A multi-source gate becomes one ADD per source, preceded by the MOVEs of every +register of the gate to the gate frame. Frames: integer basis rows B (label vectors of the frame's root lines in the +word's coordinates, a rational basis) and integer annihilator rows A (standard dot product), as PR #266 expects. +Dylan Crow, with Anthropic Claude assistance; Apache-2.0.""" +import sys, json, gzip, struct, os +from fractions import Fraction as Fr +from math import gcd +def load(p): + with (gzip.open(p,'rt') if p.endswith('.gz') else open(p)) as f: return json.load(f) +c=load(sys.argv[1]); out=sys.argv[2]; os.makedirs(out,exist_ok=True) +v,R,h=c['v'],c['R'],c['h']; n=2*v+R; lines=c['lines'] +def basis(idx): + rows=[]; piv=[]; B=[] + for i in idx: + x=[Fr(a) for a in lines[i]] + for p,r in zip(piv,rows): + if x[p]: f=x[p]/r[p]; x=[a-f*b for a,b in zip(x,r)] + nz=[k for k in range(h) if x[k]] + if nz: rows.append(x); piv.append(nz[0]); B.append(list(lines[i])) + return B,rows,piv +def annihilator(rows,piv): + # rows in echelon (pivot columns piv); free columns give the null space of the row space under the dot product + # reduce to RREF + R_=[r[:] for r in rows] + for i,(p,r) in enumerate(zip(piv,R_)): + R_[i]=[a/r[p] for a in r] + for i,p in enumerate(piv): + for j in range(len(R_)): + if j!=i and R_[j][p]: f=R_[j][p]; R_[j]=[a-f*b for a,b in zip(R_[j],R_[i])] + free=[k for k in range(h) if k not in piv]; A=[] + for f in free: + a=[Fr(0)]*h; a[f]=Fr(1) + for i,p in enumerate(piv): a[p]=-R_[i][f] + L=1 + for x in a: L=L*x.denominator//gcd(L,x.denominator) + ai=[int(x*L) for x in a]; g=0 + for x in ai: g=gcd(g,abs(x)) + A.append([x//g for x in ai]) + return A +frames={} +for k,idx in enumerate(c['frames']): + B,rows,piv=basis(idx); A=annihilator(rows,piv) if B else [[int(i==j) for j in range(h)] for i in range(h)] + assert all(sum(a*b for a,b in zip(x,y))==0 for x in A for y in B) and len(A)+len(B)==h + frames[str(k)]=dict(dim=len(B),B=B,A=A) +dim=[frames[str(k)]['dim'] for k in range(len(c['frames']))] +ZERO=[k for k in range(len(dim)) if dim[k]==0]; assert len(ZERO)==1; ZERO=ZERO[0] +cur=list(c['start']); rec=[] +def move(r,f): + if cur[r]!=f: rec.append((0,r,cur[r],f,dim[f]-dim[cur[r]],0)); cur[r]=f +def run(gates,ph): + for f,d,srcs in gates: + for r in [d]+srcs: move(r,f) + for s in srcs: rec.append((1,d,s,1,f,ph)) +run(c['D'],1); run(c['A'],2) +temp=n +for k,q in enumerate(c['ret']): + fq=cur[q]; rec.append((2,q,temp,fq,ZERO,dim[fq])) + for t,row in enumerate(c['scatter']): + if k in row: rec.append((1,v+t,temp,1,ZERO,3)) + rec.append((3,q,temp,fq,ZERO,0)) +run(c['B'],4); run(c['C'],5) +for r in range(n): move(r,c['final'][r]) +with open(out+'/249-records.bin','wb') as f: + for e in rec: f.write(struct.pack('<6i',*e)) +st=dict(n=n,v=v,h=h,R=R,ZERO=ZERO,initial={str(r):c['start'][r] for r in range(n)},final={str(r):c['final'][r] for r in range(n)}, + retained_totals=c['ret'],source_owned_roles=[],regs=[]) +json.dump(st,open(out+'/249-states.json','w'),sort_keys=True,separators=(',',':')) +json.dump(dict(frames=frames),open(out+'/frames.json','w'),sort_keys=True,separators=(',',':')) +print('exported',len(rec),'records,',len(frames),'frames, n',n,'ZERO',ZERO) diff --git a/research/split-centres-kernel-r747/vendor/hamming_packets.py b/research/split-centres-kernel-r747/vendor/hamming_packets.py new file mode 100644 index 0000000000..c129996656 --- /dev/null +++ b/research/split-centres-kernel-r747/vendor/hamming_packets.py @@ -0,0 +1,253 @@ +"""A structural prototype: mutable source bases and simultaneous signed packets. + +Input geometry is the pinned PR370 Hamming E8 root table. The binary realization, +packet construction, two-shear synthesis and arbitrary-dirt replay below are new +local experiments. This does NOT produce a complete improved E8 supplier. +""" +import gzip +import hashlib +import itertools as it +import json +import random +from collections import Counter,defaultdict +from fractions import Fraction as Q +from pathlib import Path + +OUT=Path('work/complex-network/hamming');OUT.mkdir(parents=True,exist_ok=True) +SRC=Path('work/pr370-source/research/e8-bit/data/bit/bitE8-r865.json.gz') +word=json.load(gzip.open(SRC));roots=word['lines'];v=len(roots) +G=[[sum(x*y for x,y in zip(a,b))//2 for b in roots] for a in roots] +C=[sum((1^(G[i][j]&1))<>p&1:x^=b[p] + if x: + p=x.bit_length()-1 + for q in b: + if b[q]>>p&1:b[q]^=x + b[p]=x + return tuple(b[p] for p in sorted(b,reverse=True)) + +def inside(a,b):return basis(a+b)==b + +indices=[] +for i,row in enumerate(C): + if len(basis([C[j] for j in indices]+[row]))>len(indices):indices.append(i) +assert len(indices)==9 +gram=[sum(((C[i]>>j)&1)<>i)&1)*((gram[i]&b).bit_count()&1) for i in range(9))&1 +orth=[] +for step in range(9): + choices=[x for x in range(1,512) if ip(x,x) and all(not ip(x,y) for y in orth)] + chosen=next(x for x in choices if step==8 or any(y!=x and not ip(x,y) for y in choices)) + orth.append(chosen) +assert all(ip(x,y)==int(i==j) for i,x in enumerate(orth) for j,y in enumerate(orth)) +ports=[] +for i in range(v): + row=sum(((C[i]>>j)&1)<>j)&1) for i in range(v) for j in range(v)) + +blocks=defaultdict(list);frame_lines={} +for i,r in enumerate(roots): + support=tuple(k for k,x in enumerate(r) if x) + if len(support)==4:blocks[support].append(i) + else:assert len(support)==1;frame_lines[support[0]]=i +assert len(blocks)==14 and all(len(xs)==8 for xs in blocks.values()) + +def sparse_add(rows,t,s,q): + for j,x in list(rows[s].items()): + z=rows[t].get(j,Q(0))+q*x + if z:rows[t][j]=z + else:rows[t].pop(j,None) + +def simulate(n,events): + rows=[{r:Q(1)} for r in range(n)] + for t,s,q in events:sparse_add(rows,t,s,q) + return rows + +def serialize(events):return [[t,s,q.numerator,q.denominator] for t,s,q in events] + +packet_table={};module_receipts=[];all_programs=[] +for block,ids in sorted(blocks.items()): + ids=sorted(ids);pos={s:i for i,s in enumerate(ids)} + tetrads=[sorted(s for s in ids if sum(roots[s][k]<0 for k in block)%2==p) for p in (0,1)] + assert all(len(t)==4 for t in tetrads) + faces=[] + for i,j in it.combinations(block,2): + for epsilon in (-1,1): + support=[s for s in ids if roots[s][i]*roots[s][j]==epsilon] + content={s:Q(roots[s][i]) for s in support} + frame=basis([ports[s] for s in support]);assert len(frame)==3 + key=(block,(i,j),epsilon);packet_table[key]=(content,frame) + faces.append((key,content,frame)) + pair_uses=defaultdict(list) + for f,(_,content,frame) in enumerate(faces): + for tet in tetrads: + pair=tuple(s for s in tet if s in content) + assert len(pair)==2 + pair_uses[pair].append(f) + assert len(pair_uses)==12 and all(len(fs)==2 for fs in pair_uses.values()) + bysource=defaultdict(list) + for pair in sorted(pair_uses): + for s in pair:bysource[s].append(pair) + # One of the three pair branches is carried by x itself, two by helpers. + regs={};nextreg=8;events=[];event_frames=[];cur=[basis([ports[s]]) for s in ids] + start=list(cur);dead=[] + def add(t,s,q,F): + assert t!=s and inside(cur[t],F) and inside(cur[s],F) + cur[t]=cur[s]=F;events.append((t,s,Q(q)));event_frames.append(F) + for s in ids: + for j,pair in enumerate(sorted(bysource[s])): + if j==0:reg=pos[s] + else: + reg=nextreg;nextreg+=1;cur.append(());start.append(()) + add(reg,pos[s],1,basis([ports[s]])) + regs[pair,s]=reg + assert nextreg==24 + partial={} + for pair,fs in sorted(pair_uses.items()): + s,t=pair;a,b=regs[pair,s],regs[pair,t];f,g=fs + alpha,beta=faces[f][1][s],faces[f][1][t] + gamma,delta=faces[g][1][s],faces[g][1][t] + assert alpha*delta-beta*gamma in (-2,2) + F=basis([ports[s],ports[t]]);assert len(F)==2 + add(a,b,beta/alpha,F) + k=gamma/(delta-gamma*beta/alpha) + add(b,a,k,F) + partial[f,pair]=(a,alpha) + partial[g,pair]=(b,delta-gamma*beta/alpha) + pre_packets=simulate(24,events) + def clean_rank(registers): + piv={} + for reg in registers: + row=[pre_packets[reg].get(i,Q(0)) for i in range(8)] + for j in sorted(piv): + q=row[j] + if q:row=[a-q*b for a,b in zip(row,piv[j])] + j=next((i for i,q in enumerate(row) if q),None) + if j is not None: + q=row[j];piv[j]=[a/q for a in row] + return len(piv) + choices=[[value for (ff,pair),value in partial.items() if ff==f] for f in range(12)] + rng=random.Random(38639);orientation=None + for trial in range(4096): + bits=rng.randrange(1<<12) + if clean_rank([pieces[1-((bits>>f)&1)][0] for f,pieces in enumerate(choices)])==8: + orientation=bits;break + assert orientation is not None + outputs=[] + for f,(key,content,F) in enumerate(faces): + pieces=[value for (ff,pair),value in partial.items() if ff==f] + assert len(pieces)==2 + if orientation>>f&1:pieces.reverse() + (a,alpha),(b,beta)=pieces + add(a,b,beta/alpha,F) + outputs.append((a,alpha));dead.append(b) + assert len(set(r for r,a in outputs))==12 and len(set(dead))==12 + assert not set(dead)&{r for r,a in outputs} + core=simulate(24,events) + for f,(reg,scale) in enumerate(outputs): + clean={ids[j]:scale*x for j,x in core[reg].items() if j<8 and x} + assert clean==faces[f][1] + + # Probe complete borrowing: output each packet, cancel its old dirt at label + # zero, then undo every source/helper operation at the full frame. + # Actual supplier consumers and their remaining chronology are NOT inferred. + n=36;main=events.copy();dirt=[];chosen_targets=[] + for f,(reg,scale) in enumerate(outputs): + main.append((24+f,reg,scale)) + for j,q in core[reg].items(): + if j>=8:dirt.append((24+f,j,-scale*q)) + valid=[t for t in range(v) if all((ports[t]&x).bit_count()%2==0 for x in faces[f][2])] + assert valid;chosen_targets.append(valid[0]) + cleanup=[(t,s,-q) for t,s,q in reversed(events)] + actual=simulate(n,dirt+main+cleanup) + for r in range(24):assert actual[r]=={r:Q(1)} + for f in range(12): + expected={24+f:Q(1)} + expected.update({pos[s]:q for s,q in faces[f][1].items()}) + assert actual[24+f]==expected + # A mutation of the compensator must corrupt at least one arbitrary dirt column. + wrong=simulate(n,main+cleanup) + assert any(wrong[r]!=actual[r] for r in range(24,36)) + # Inverse-transpose: transpose and negate each elementary shear in the SAME + # event order. Reversing as well would generally compute the wrong map. + dual=simulate(n,[(s,t,-q) for t,s,q in dirt+main+cleanup]) + for r in range(n): + expected={r:Q(1)} + if r<8: + expected.update({24+f:-content[ids[r]] for f,(_,content,F) in enumerate(faces) if ids[r] in content}) + assert dual[r]==expected + receipt={'block':block,'source_lines':ids,'packets':12,'pair_butterflies':12, + 'packet_additions':len(events),'live_source_registers_borrowed':8, + 'helper_registers':16,'total_source_and_helper_registers':24, + 'retired_register_clean_rank':8, + 'independent_pair_branch_comparison_helpers':48, + 'comparison_scope':'48 is a specified independent two-input-form implementation, not the helper count of the current r783 supplier.', + 'frame_rank_counts':dict(Counter(map(len,event_frames))), + 'all_dirty_columns_forward_and_inverse_transpose':n, + 'compensator_omission_rejected':True, + 'scope':'A 12-output packet factory and probe sinks. Not a complete 120-port supplier or global frame schedule.'} + module_receipts.append(receipt) + all_programs.append({'receipt':receipt,'start_frames':start,'events':serialize(events), + 'event_frames':event_frames,'outputs':[[r,str(q)] for r,q in outputs], + 'dead_registers':dead, + 'dirt':serialize(dirt),'cleanup':serialize(cleanup), + 'probe_target_ports':[ports[t] for t in chosen_targets]}) + +# Reconstruct the entire signed E8 neighbour correction from the packet family. +# This proves all 120 rational source columns of the abstract decomposition. +decomposition=[] +for target,r in enumerate(roots): + row=defaultdict(Q);terms=[];support=[i for i,x in enumerate(r) if x] + if len(support)==4: + c=tuple(support) + for d in blocks: + inter=tuple(sorted(set(c)&set(d))) + if len(inter)!=2:continue + i,j=inter;epsilon=r[i]*r[j];content,F=packet_table[d,inter,epsilon] + coefficient=-Q(r[i],2) + assert all((ports[target]&p).bit_count()%2==0 for p in F) + for s,a in content.items():row[s]+=coefficient*a + terms.append({'source_block':d,'pair':inter,'epsilon':epsilon,'coefficient':str(coefficient)}) + for s in blocks[c]+list(frame_lines.values()): + if s!=target and G[target][s]:row[s]-=Q(G[target][s],2) + else: + i=support[0] + for d in blocks: + if i in d: + for s in blocks[d]:row[s]-=Q(roots[s][i],2) + expected={s:-Q(G[target][s],2) for s in range(v) if s!=target and G[target][s]} + assert {s:a for s,a in row.items() if a}==expected + # Eight coordinate centers recover the diagonal after side corrections. + for s in range(v): + center=sum(Q(r[i]*roots[s][i],4) for i in range(8)) + assert center+row.get(s,Q(0))==int(s==target) + decomposition.append({'target':target,'cross_block_packets':terms,'side_support':len(expected)}) + +program_path=OUT/'PACKET-PROGRAMS.json.gz' +program_path.write_bytes(gzip.compress(json.dumps(all_programs,sort_keys=True,separators=(',',':')).encode(),mtime=0)) +report={'status':'PASS_STRUCTURAL_PACKET_PROTOTYPE_NOT_A_NEW_SUPPLIER', + 'source_sha256':hashlib.sha256(SRC.read_bytes()).hexdigest(), + 'binary_address_dimension':9,'binary_gram_rank':len(indices), + 'binary_ports':ports,'root_lines':roots, + 'binary_gram_identity':'p_s dot p_t = 1 + (root_s dot root_t / 2) mod 2', + 'modules':module_receipts,'signed_packets':len(packet_table), + 'full_target_decomposition_columns':120,'full_target_decomposition_entries':120*120, + 'program_sha256':hashlib.sha256(program_path.read_bytes()).hexdigest(), + 'decomposition':decomposition, + 'remaining':['Joint scheduling and charging of all packet fan-outs and target accumulations', + 'Forming all eight centers from the available mixed source basis without an uncharged restore', + 'Full 120-port arbitrary-dirt forward/backward program and restored work stocks', + 'Exact complex adapters and global phases; finite invoice; two independent prices and outer assembly'], + 'no_new_coarse_b_or_kappa_claim':True} +(OUT/'PROTOTYPE.json').write_text(json.dumps(report,indent=2)+'\n') +print('PASS: 14 factories, 168 signed packets; each factory uses 8 source + 16 helper registers') +print('PASS: exact dirty forward and inverse-transpose columns, omission controls, all 14400 decoder entries') +print('NOT A SUPPLIER: global scheduling, mixed-basis centers, phase and full price remain open') diff --git a/research/split-centres-kernel-r747/vendor/kernel417/LICENSE b/research/split-centres-kernel-r747/vendor/kernel417/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/split-centres-kernel-r747/vendor/kernel417/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/split-centres-kernel-r747/vendor/kernel417/e8core.py b/research/split-centres-kernel-r747/vendor/kernel417/e8core.py new file mode 100644 index 0000000000..f2874bae8e --- /dev/null +++ b/research/split-centres-kernel-r747/vendor/kernel417/e8core.py @@ -0,0 +1,203 @@ +"""Our own engine for bitE8/1 words (E8 root-line labels, h = 8): frame algebra over Q via root-line masks, +legality/F2 replay, five-stage histogram, exact bit coarse saving and PR #315 outer assembly (our engine copies). +Chafik Boukhalfa (chafreaky) with Anthropic Claude assistance; Apache-2.0.""" +import gzip, json, os, importlib.util +from fractions import Fraction as Q +from collections import Counter + +HERE = os.path.dirname(os.path.abspath(__file__)) +def _load(n): + s = importlib.util.spec_from_file_location('e8_' + n, os.path.join(HERE, "engines", n + ".py")) + m = importlib.util.module_from_spec(s); s.loader.exec_module(m); return m +moment = _load('moment'); other = _load('base_two_moment'); outer = _load('outer') + +B2 = Q(876248285600677, 10**18) # Sussman E8 five-stage (PR #352) +B3 = Q(932783231884153, 10**18) # DaysSky seven-stage B_3 (PR #363; no Lean proof) + + +def load_word(p): + with (gzip.open(p, 'rt') if p.endswith('.gz') else open(p)) as f: + return json.load(f) + + +def save_word(c, p): + with gzip.open(p, 'wt') as f: + json.dump(c, f, separators=(',', ':')) + + +def rank(vecs): + rows = [[Q(x) for x in r] for r in vecs]; rk = 0 + n = len(rows[0]) if rows else 0 + for col in range(n): + p = next((i for i in range(rk, len(rows)) if rows[i][col] != 0), None) + if p is None: continue + rows[rk], rows[p] = rows[p], rows[rk] + for i in range(len(rows)): + if i != rk and rows[i][col] != 0: + f = rows[i][col] / rows[rk][col]; rows[i] = [a - f * b for a, b in zip(rows[i], rows[rk])] + rk += 1 + return rk + + +class Lat: + """Root-spanned subspaces of Q^8 represented by the mask of root lines they contain.""" + def __init__(self, lines): + self.lines = [tuple(x) for x in lines]; self.v = len(lines) + self._dim = {0: 0}; self._close = {} + # Gram (form /2) for orthogonality + self.ip = [[sum(a * b for a, b in zip(x, y)) // 2 for y in self.lines] for x in self.lines] + + def close(self, mask): + """mask of all root lines in span(roots of mask)""" + if mask in self._close: return self._close[mask] + idx = [i for i in range(self.v) if mask >> i & 1] + basis = [] + for i in idx: + if rank([self.lines[j] for j in basis] + [self.lines[i]]) > len(basis): basis.append(i) + d = len(basis); out = 0 + if d == 8: out = (1 << self.v) - 1 + elif d: + B = [self.lines[j] for j in basis] + for i in range(self.v): + if rank(B + [self.lines[i]]) == d: out |= 1 << i + self._close[mask] = out; self._close[out] = out; self._dim[out] = d + return out + + def dim(self, mask): + if mask not in self._dim: self.close(mask) + return self._dim[mask] + + def basis(self, mask): + b = [] + for i in range(self.v): + if mask >> i & 1 and rank([self.lines[j] for j in b] + [self.lines[i]]) > len(b): b.append(i) + return b + + def perp(self, t): + return self.close(sum(1 << j for j in range(self.v) if self.ip[t][j] == 0)) + + +def to_masks(c, L): + return [L.close(sum(1 << i for i in fr)) for fr in c['frames']] + + +PHASES = ('D', 'A', 'B', 'C') + + +def replay(c, L=None, masks=None, check_f2=True, span=True, span_mode='z'): + """Exact legality + F2 replay + histogram of a bitE8/1 word. Returns dict(H_local, steps, ...). + Legality: each register's frames nested (mask inclusion = exact Q-subspace inclusion for root-spanned frames) and + strictly increasing at each move; every gate at one common frame; D compensation at frame 0; y at frame 0 at the + scatter; COPY of retained totals; final frames (x, helpers FULL; y_t at its cap t-perp). + Source-span: every non-target operand's x-support lies in the gate frame.""" + L = L or Lat(c['lines']); masks = masks or to_masks(c, L) + v, R, h = c['v'], c['R'], c['h']; n = 2 * v + R; FULL = (1 << v) - 1 + cur = [masks[f] for f in c['start']] + for r in range(v): assert cur[r] == L.close(1 << r), 'x start' + for r in range(v, 2 * v): assert cur[r] == 0, 'y start at 0' + sig = [L.dim(cur[r]) for r in range(n)] + H = Counter(); steps = 0; viol = [] + val = [1 << i for i in range(n)] + zsupp = [{i: 1} if i < v else {} for i in range(n)] # integer support of each register over the x columns (all ADDs are +1) + def climb(r, m): + nonlocal steps + if cur[r] == m: return + assert cur[r] & ~m == 0 and cur[r] != m, ('not nested', r) + H[L.dim(m) - L.dim(cur[r])] += 1; steps += 1; cur[r] = m + def run(gates, ph): + for k, (f, d, srcs) in enumerate(gates): + m = masks[f] + assert d not in srcs and len(set(srcs)) == len(srcs), (ph, k) # rohanarun: source destinations allowed (#433 source-basis gates); spans checked below + for x in [d] + srcs: climb(x, m) + for s in srcs: + val[d] ^= val[s] + if span: + if s < v or s >= 2 * v: + ms = sum(1 << i for i in zsupp[s]) + if ms & ~m: viol.append((ph, k, s)) + zd = zsupp[d] + for i, a in zsupp[s].items(): + w = zd.get(i, 0) + a + if w: zd[i] = w + else: zd.pop(i, None) + if span_mode == 'f2': + zsupp[d] = {i: 1 for i in range(v) if val[d] >> i & 1} + if span and (d >= 2 * v or d < v): + md = sum(1 << i for i in zsupp[d]) + if md & ~m: viol.append((ph, k, d)) + run(c['D'], 'D') + for r in range(v, n): assert cur[r] == masks[c['start'][r]], 'D compensation at frame 0 (helpers untouched otherwise)' + run(c['A'], 'A') + for t in range(v): assert cur[v + t] == 0, 'y at frame 0 at the scatter' + copies = [val[q] for q in c['ret']] + for q in c['ret']: + assert q >= 2 * v or q < v; H[L.dim(cur[q])] += 1 # rohanarun: #433 retains totals in source rows + for t, row in enumerate(c['scatter']): + for k in row: val[v + t] ^= copies[k] + run(c['B'], 'B'); run(c['C'], 'C') + for r in range(n): climb(r, masks[c['final'][r]]) + for r in range(v): assert cur[r] == FULL + for r in range(2 * v, n): assert cur[r] == FULL + for t in range(v): assert cur[v + t] == L.perp(t), 'y final at cap' + if check_f2: + for s in range(v): assert val[s] == 1 << s + for t in range(v): assert val[v + t] == (1 << (v + t)) | (1 << t), ('target', t) + for r in range(2 * v, n): assert val[r] == 1 << r, ('helper', r) + return dict(sig=sig, viol=viol, H=H, steps=steps, n=n, v=v, R=R, h=h, L=L, masks=masks, ncopy=len(c['ret'])) + + +def profile(H_local, v, h=8): + prof = Counter({j: 5 * c for j, c in H_local.items()}) + for j in (2 * h - 2, h - 1, 2 * h + 2, 4): prof[j] += 2 * v + return prof + + +def coarse(H, m, W): + grid = Q(1, 10**18) + root = moment.certify(dict(H), m, W, True); c = Q(int(Q(root['lower']) * 10**18), 10**18) + assert moment.moment(H, m, W, c, True)[1] < 1 < moment.moment(H, m, W, c + grid, True)[0] + fb = 32 * m * m * sum(H.values()) + _, up = other.moment(m, W, list(H.items()), c); _, bad = other.moment(m, W, [(1, fb)], c) + lo, _ = other.moment(m, W, list(H.items()), c + grid); blo, _ = other.moment(m, W, [(1, fb)], c + grid) + assert up + Q(1, 10**16) * bad < 1 < lo + Q(1, 10**16) * blo + return c + + +def kappa(c, b): + grid = Q(1, 10**18); eta = Q(1, 10**12); beta = Q(1, 10**9); cap = (1 - beta) * b + sv = min(c, Q(((cap - grid) * 10**18).__floor__(), 10**18)); binding = 'bit' if sv == c else 'complex' + chain = [Q(384599, 10**10)] + for _ in range(3): + a = (1 - sv) * sv + sv * chain[-1]; assert chain[-1] < a < sv < 1 - a; chain.append(a) + bit = chain[-1] + bridge = dict(proof='PROOF.md', representation='Exact powers with source-bound finite overcharges', + semantic=dict(G=dict(base=2, exponent=30000), E=dict(base=2, exponent=100000), B_upper=dict(base=2, exponent=100001), + C0=dict(base=2, exponent=210000), C1=1, strict_literal_gap=1, induction_gap_lower=1), + rows=dict(coefficient=20161, degree=10**6, suffix_slope=4 * 10**6, degree_gap=Q(10**6) - Q(51 * 20161, 25))) + q = bit * (1 - 2 * eta); mn = (1 - eta) * q / (1 + q); t = mn * 10**18; k = Q((t.numerator - 1) // t.denominator, 10**18) + asm = outer.assembly(bit, b, bridge, k, eta=eta, beta=beta) + assert len(asm['strict_constraints']) == 47 and min(asm['strict_constraints'].values()) > 0 + try: + outer.assembly(bit, b, bridge, k + grid, eta=eta, beta=beta); raise SystemExit('ADJACENT ADMITTED') + except AssertionError: pass + return k, binding + + +def price_word(c, **kw): + r = replay(c, **kw) + v, h, R = r['v'], r['h'], r['R']; m = 5 * h + resid = sum(h - r['sig'][x] for x in range(2 * v, 2 * v + R)) + T = 1 if resid % h == 0 else h + W = (4 * v * h + resid) * T // h; assert (4 * v * h + resid) * T % h == 0 + prof = Counter({j: T * k for j, k in profile(r['H'], v, h).items()}); mass = sum(a * b for a, b in prof.items()) + L_copy = h * r['ncopy'] + assert m * W - mass == T * (4 * v - 5 * L_copy), ('deficit', m * W - mass) + assert 2 * max(prof) < m + cc = coarse(prof, m, W) + return dict(c=cc, H=r['H'], prof=prof, W=W, T=T, resid=resid, m=m, deficit=m * W - mass, replay=r) + + +def phi_fn(m, W, a): + """linearized moment term per child of rank r (float), for search scoring""" + import math + return lambda r: r / (m * W) * math.exp(a * math.log(m / r)) diff --git a/research/split-centres-kernel-r747/vendor/kernel417/engines/base_two_moment.py b/research/split-centres-kernel-r747/vendor/kernel417/engines/base_two_moment.py new file mode 100644 index 0000000000..14a90fa0e7 --- /dev/null +++ b/research/split-centres-kernel-r747/vendor/kernel417/engines/base_two_moment.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python3 +"""Maintainer arithmetic cross-check of the pinned PR39 certificate. + +Uses no producer/checker imports. Counts are inputs, not proved by this script. +80-term rational logarithms and 12-term exponentials independently enclose +the two moments. The accompanying written review addresses their realization. +""" +import argparse +from fractions import Fraction as Q +from hashlib import sha256 +import json +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +GRID = 10**30 + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def log_unit(x): + require(1 <= x <= 2, "logarithm range") + z = (x-1)/(x+1) + lo = 2*sum((z**(2*j+1)/(2*j+1) for j in range(80)), Q(0)) + return lo, lo+2*z**161/(161*(1-z*z)) + + +def log_bounds(x): + k = 0 + while x > 2: + x /= 2 + k += 1 + lo, hi = log_unit(x) + l2, u2 = log_unit(Q(2)) + lo, hi = lo+k*l2, hi+k*u2 + # Outward rational rounding keeps later certificates compact. + return Q((lo*GRID).__floor__(), GRID), Q((hi*GRID).__ceil__(), GRID) + + +def exp_bounds(x): + require(0 <= x < 1, "exponential range") + term = total = Q(1) + for j in range(1, 13): + term *= x/j + total += term + tail = term*x/13/(1-x/14) + return total, total+tail + + +def moment(m, W, entries, saving): + lo = hi = Q(0) + for t, count in entries: + t, count = int(t), int(count) + require(0 < t < m and count > 0, "improper child") + l, u = log_bounds(Q(m, t)) + lower = exp_bounds(saving*l)[0] + upper = exp_bounds(saving*u)[1] + lo += Q(t*count, m*W)*lower + hi += Q(t*count, m*W)*upper + return Q((lo*GRID).__floor__(), GRID), Q((hi*GRID).__ceil__(), GRID) + diff --git a/research/split-centres-kernel-r747/vendor/kernel417/engines/moment.py b/research/split-centres-kernel-r747/vendor/kernel417/engines/moment.py new file mode 100644 index 0000000000..7d697cb452 --- /dev/null +++ b/research/split-centres-kernel-r747/vendor/kernel417/engines/moment.py @@ -0,0 +1,113 @@ +"""Independent prospective ordinary five-stage cost, never supplier admission. + +Consumes a raw one-invocation ledger made from the actual source/internal/target +paths. No packed profile is used as an input. Missing physical/finite/compiler +obligations must remain explicit in the accompanying report. +""" +from collections import Counter +from decimal import Decimal, localcontext, ROUND_FLOOR +from fractions import Fraction as F +from functools import lru_cache +from math import factorial +import hashlib, json, sys +from pathlib import Path + +DYAD = 1 << 224 + +def floor(x): return F(x.numerator*DYAD//x.denominator, DYAD) +def ceil(x): return -floor(-x) + +@lru_cache(None) +def logarithm(x): + """Mercator bounds after binary reduction; ln(2) via two Mercator sums. + + For 1 <= y < 2, log(y) is an alternating series in z=y-1. + We instead reduce to 1 <= y < 3/2, and bound log(3/2) and + log(2) by the same alternating series at z=1/2 and z=1/3, + using log(2)=log(3/2)+log(4/3). All sums are exact rationals. + """ + assert x >= 1 + k = 0 + while x >= 2: x /= 2; k += 1 + j = int(x >= F(3, 2)) + if j: x /= F(3, 2) + def mercator(y): + z=y-1 + assert 0 <= z <= F(1,2) + # An even partial sum is below log; the next term bounds its tail. + t=z; s=F(0) + for n in range(1, 225): + s += (t if n & 1 else -t)/n + t *= z + return s, s+t/225 + a,b=mercator(x); c,d=mercator(F(3,2)); e,f=mercator(F(4,3)) + return floor(a+(k+j)*c+k*e), ceil(b+(k+j)*d+k*f) + +def exponential(l,u): + assert 0 <= l <= u < F(1,10) + def poly(x): + s=t=F(1) + for j in range(1,25): t=t*x/j; s+=t + return s,t + lo,_=poly(l);hi,last=poly(u) + return floor(lo),ceil(hi+last*u/25/(1-u/26)) + +def moment(H,m,W,a,bad=False): + lo=hi=F(0) + for r,n in H.items(): + assert 0 < r < m and n > 0 + l,u=logarithm(F(m,r)); e,f=exponential(a*l,a*u) + p=F(r*n,m*W);lo+=p*e;hi+=p*f + if bad: + # Existing envelope shape, only conditionally portable to the new cover. + l,u=logarithm(F(m));e,f=exponential(a*l,a*u) + p=F(32*m*sum(H.values()),10**16*W) + lo+=p*e;hi+=p*f + return floor(lo),ceil(hi) + +def decimal(x): + with localcontext() as c: + c.prec=70 + return str(Decimal(x.numerator)/Decimal(x.denominator)) + +def certify(H,m,W,bad=False): + with localcontext() as c: + c.prec=70 + terms=[(Decimal(r*n)/Decimal(m*W),(Decimal(m)/Decimal(r)).ln()) for r,n in H.items()] + fallback=Decimal(32*m*sum(H.values()))/Decimal(10**16*W) if bad else Decimal(0) + lm=Decimal(m).ln();lo=Decimal(0);hi=Decimal('.003') + for _ in range(210): + a=(lo+hi)/2 + if sum(p*(a*l).exp() for p,l in terms)+fallback*(a*lm).exp()<1:lo=a + else:hi=a + q=int(((lo+hi)/2*10**24).to_integral_value(rounding=ROUND_FLOOR)) + lo=F(q,10**24);hi=lo+F(1,10**24) + lv=moment(H,m,W,lo,bad);hv=moment(H,m,W,hi,bad) + assert lv[1]<10 for v in slacks.values()),{k:str(v) for k,v in slacks.items() if v<=0} + assert min(margins.values())==minimum + assert margins['balanced_prefix']-minimum==eta and 1-eps-r==eta/2 + assert 1-eps*(1+c)==eta-eps*eta/4 + return dict(parameters=dict(a_bit=a,a_complex=b,tau=tau,sigma=sigma, + eta=eta,beta=beta,q=q,c=c,epsilon=eps,lambda_=lam, + lambda_prime=lp,alpha_squared_power=r,delta=delta, + C0=bridge['semantic']['C0'],C1=1,kappa=kappa), + strict_constraints=slacks,margins=margins,minimum_margin=minimum, + absorption_gap=minimum-kappa, + recurrence=dict(internal=internal,leaf=leaf,reservations=1-c)) diff --git a/research/split-centres-kernel-r747/vendor/kernel417/stages.py b/research/split-centres-kernel-r747/vendor/kernel417/stages.py new file mode 100644 index 0000000000..9ef95d52f4 --- /dev/null +++ b/research/split-centres-kernel-r747/vendor/kernel417/stages.py @@ -0,0 +1,143 @@ +"""Transcript stages on the E8 bit word (bitE8/1), applied from frozen selections, each bound to the exact input word. + +retime (our #329 descent2 / #287 concave retiming, ported to E8 frames): every selected gate g gets a new frame F with + close(LB_g + prev frames of its participants) <= F <= rootspan(AND of their next frames), where LB_g is the + x-support of the non-target operands (source-span rule); pinned: D gates (frame 0), y at frame 0 at the scatter, + retained totals at FULL at COPY, start and final frames. Checked on the joint retimed configuration. +kernel (our #320/#329 shared-donor response kernel; #272/#299/#319 lineage): entry = pivot p, entrance E, donors D with + resp(p) = XOR resp(D) over F2, where resp(h) = the targets whose frame-0 completion (D) gates read h; E inside the + first frame of p and of every donor. p starts at E and leaves the D gates; each donor climbs to E at the start of + A and pays d += (its pivots) at E; after C it pays d += (its pivots) again at FULL (F2: d -= p). + Exclusivity: pivots are never donors, a donor serves one entrance. Total entrance rank = 0 mod 8 (integral + B_4 width W; the residuals then tile width-72 banks with 9 replicas, checked separately). + +usage: stages.py retime|kernel IN.json.gz OUT.json.gz SELECTION.json +After applying, the full exact replay of e8core (legality, F2 on all columns, source spans) must pass and the output +must equal the frozen output content hash. (This package uses the kernel stage only: on PR #376's word our retiming +descent finds no move, before or after the kernel.) +Chafik Boukhalfa (chafreaky) with Anthropic Claude assistance; Apache-2.0.""" +import sys, os, json, hashlib +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from e8core import * + + +def content_sha(c): + return hashlib.sha256(json.dumps(c, sort_keys=True, separators=(',', ':')).encode()).hexdigest() + + +class Framer: + def __init__(self, c): + self.fl = c['frames']; self.key = {}; self.v = c['v'] + for k, fr in enumerate(self.fl): self.key.setdefault(sum(1 << i for i in fr), k) + def fid(self, m): + if m not in self.key: self.key[m] = len(self.fl); self.fl.append([i for i in range(self.v) if m >> i & 1]) + return self.key[m] + + +def mask_of(lines): return sum(1 << i for i in lines) + + +def occurrences(c, masks): + """per register: list of (kind, ref) with pins ('p', mask) and gates ('g', (phase, k)) in time order""" + v = c['v']; n = 2 * v + c['R']; FULL = (1 << v) - 1 + occ = [[('p', masks[c['start'][r]])] for r in range(n)] + for ph in ('D', 'A'): + for k, (f, d, s) in enumerate(c[ph]): + for x in [d] + s: occ[x].append(('g', (ph, k))) + for t in range(v): occ[v + t].append(('p', 0)) + for q in c['ret']: occ[q].append(('p', FULL)) + for ph in ('B', 'C'): + for k, (f, d, s) in enumerate(c[ph]): + for x in [d] + s: occ[x].append(('g', (ph, k))) + for r in range(n): occ[r].append(('p', masks[c['final'][r]])) + return occ + + +def lower_bounds(c, L): + v = c['v']; n = 2 * v + c['R']; sup = [1 << i if i < v else 0 for i in range(n)]; lb = {} + for ph in ('D', 'A', 'B', 'C'): + for k, (f, d, srcs) in enumerate(c[ph]): + need = 0 + for s in srcs: + sup[d] |= sup[s] + if s < v or s >= 2 * v: need |= sup[s] + if d >= 2 * v: need |= sup[d] + lb[(ph, k)] = L.close(need) if need else 0 + return lb + + +def retime(c, sel): + L = Lat(c['lines']); masks = to_masks(c, L); occ = occurrences(c, masks); lb = lower_bounds(c, L) + gm = {(ph, k): masks[g[0]] for ph in ('D', 'A', 'B', 'C') for k, g in enumerate(c[ph])} + pos = {} + for r, o in enumerate(occ): + for i, (kind, x) in enumerate(o): + if kind == 'g': pos.setdefault(x, []).append((r, i)) + def fr(r, i): + kind, x = occ[r][i]; return x if kind == 'p' else gm[x] + seen = set() + for ph, k, old_lines, new_lines in sel: + g = (ph, k); assert ph != 'D' and g not in seen; seen.add(g) + assert gm[g] == L.close(mask_of(old_lines)), ('selection not bound to this word', g) + F = L.close(mask_of(new_lines)); assert F == mask_of(new_lines), 'frame given as all its root lines' + gm[g] = F + for g in seen: # the joint retimed configuration: every moved gate inside its feasible interval + F = gm[g]; lo = lb[g]; hi = (1 << c['v']) - 1 + for r, i in pos[g]: lo |= fr(r, i - 1); hi &= fr(r, i + 1) + assert lo & ~F == 0 and F & ~hi == 0, ('outside the feasible interval', g) + out = json.loads(json.dumps(c)); fm = Framer(out) + for ph in ('D', 'A', 'B', 'C'): + out[ph] = [[fm.fid(gm[(ph, k)]), d, list(s)] for k, (f, d, s) in enumerate(c[ph])] + return out + + +def kernel(c, sel): + L = Lat(c['lines']); masks = to_masks(c, L); v = c['v']; n = 2 * v + c['R']; FULL = (1 << v) - 1 + occ = occurrences(c, masks) + gm = {(ph, k): masks[g[0]] for ph in ('D', 'A', 'B', 'C') for k, g in enumerate(c[ph])} + first = {} + for h in range(2 * v, n): + assert masks[c['start'][h]] == 0 + first[h] = next(x if kind == 'p' else gm[x] for kind, x in occ[h][1:] if (x if kind == 'p' else gm[x]) != 0) + resp = {} + for f, t, srcs in c['D']: + assert masks[f] == 0 + for s in srcs: resp[s] = resp.get(s, 0) ^ (1 << (t - v)) + ret = set(c['ret']); pivots = {}; donor_at = {}; tot = 0 + for E_lines, p, D in sel: + E = L.close(mask_of(E_lines)); assert E == mask_of(E_lines) and E != 0 + assert p not in ret and p not in pivots and p not in donor_at and 2 * v <= p < n + x = resp.get(p, 0) + for d in D: + assert d not in ret and d not in pivots and 2 * v <= d < n + assert donor_at.setdefault(d, E) == E, 'donor serves one entrance' + x ^= resp.get(d, 0) + assert x == 0, ('response relation fails', p) + for h in [p] + D: assert E & ~first[h] == 0, ('entrance not inside first frame', h) + pivots[p] = E; tot += L.dim(E) + assert not set(pivots) & set(donor_at) + assert tot % 8 == 0, 'total entrance rank 0 mod 8' + out = json.loads(json.dumps(c)); fm = Framer(out) + for p, E in pivots.items(): out['start'][p] = fm.fid(E) + out['D'] = [[f, t, [s for s in srcs if s not in pivots]] for f, t, srcs in c['D']] + byd = {} + for E_lines, p, D in sel: + for d in D: byd.setdefault((d, mask_of(E_lines)), []).append(p) + out['A'] = [[fm.fid(E), d, sorted(ps)] for (d, E), ps in sorted(byd.items())] + out['A'] + out['C'] = out['C'] + [[fm.fid(FULL), d, sorted(ps)] for (d, E), ps in sorted(byd.items())] + return out, len(sel), tot, len(byd) + + +if __name__ == '__main__': + st, inp, outp, selp = sys.argv[1:5] + c = load_word(inp); sel = json.load(open(selp)) + assert sel['input_sha256'] == content_sha(c), 'selection bound to a different input word' + if st == 'retime': + w = retime(c, sel['gates']); info = '%d gates retimed' % len(sel['gates']) + else: + w, ne, tot, nd = kernel(c, sel['entries']); info = '%d entries, total entrance rank %d, %d donor slots' % (ne, tot, nd) + r = replay(w, span_mode='z'); assert not r['viol'], r['viol'][:5] + assert content_sha(w) == sel['output_sha256'], 'output differs from the frozen stage output' + save_word(w, outp) + print(' stage %s: %s | exact replay PASS (legality, F2 on %d columns, source spans) | local histogram %s | output sha %s' + % (st, info, r['n'], dict(sorted(r['H'].items())), sel['output_sha256'][:16])) diff --git a/research/split-centres-kernel-r747/vendor/pr434/LICENSE b/research/split-centres-kernel-r747/vendor/pr434/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/split-centres-kernel-r747/vendor/pr434/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/split-centres-kernel-r747/vendor/pr434/SELECTION.json b/research/split-centres-kernel-r747/vendor/pr434/SELECTION.json new file mode 100644 index 0000000000..9df36fb9ef --- /dev/null +++ b/research/split-centres-kernel-r747/vendor/pr434/SELECTION.json @@ -0,0 +1,141 @@ +{ + "source_sha256": "015811014644ed62acba1da590d9cf6ebdfe834d89867f8ce2b68722609072ea", + "word_sha256": "98ffef9246c8bf6c537ab5e134321abea05cf0b7830c9e3fd92cbe4e88d8c308", + "R": 747, + "local_profile": { + "1": 2398, + "2": 865, + "3": 475, + "5": 153, + "4": 310, + "8": 9, + "7": 14 + }, + "global_profile": { + "1": 172656, + "2": 62280, + "3": 34200, + "5": 11016, + "4": 22320, + "8": 648, + "7": 6768, + "14": 3840, + "28": 3840, + "42": 3840 + }, + "live": 14403, + "entries": [ + { + "position": 1032, + "new_helper": 949, + "retired_helper": 406, + "parents": [ + 411, + 518 + ], + "frame": 458 + }, + { + "position": 1036, + "new_helper": 950, + "retired_helper": 252, + "parents": [ + 0, + 1, + 512, + 523 + ], + "frame": 458 + }, + { + "position": 1038, + "new_helper": 957, + "retired_helper": 532, + "parents": [ + 533, + 534 + ], + "frame": 459 + }, + { + "position": 1053, + "new_helper": 936, + "retired_helper": 310, + "parents": [ + 315, + 566 + ], + "frame": 461 + }, + { + "position": 1069, + "new_helper": 937, + "retired_helper": 422, + "parents": [ + 427, + 598 + ], + "frame": 463 + }, + { + "position": 1085, + "new_helper": 933, + "retired_helper": 294, + "parents": [ + 299, + 630 + ], + "frame": 465 + }, + { + "position": 1094, + "new_helper": 935, + "retired_helper": 374, + "parents": [ + 379, + 646 + ], + "frame": 466 + }, + { + "position": 1103, + "new_helper": 934, + "retired_helper": 444, + "parents": [ + 439, + 662 + ], + "frame": 467 + }, + { + "position": 1112, + "new_helper": 932, + "retired_helper": 492, + "parents": [ + 487, + 678 + ], + "frame": 468 + }, + { + "position": 1121, + "new_helper": 944, + "retired_helper": 476, + "parents": [ + 471, + 694 + ], + "frame": 469 + }, + { + "position": 1128, + "new_helper": 942, + "retired_helper": 710, + "parents": [ + 455, + 460 + ], + "frame": 470 + } + ] +} diff --git a/research/split-centres-kernel-r747/vendor/pr434/replay.py b/research/split-centres-kernel-r747/vendor/pr434/replay.py new file mode 100644 index 0000000000..84d4875764 --- /dev/null +++ b/research/split-centres-kernel-r747/vendor/pr434/replay.py @@ -0,0 +1,71 @@ +"""Reconstruct eleven chronological clean resets; regenerate arbitrary-dirt compensation. +Rohan Arun with OpenAI Codex assistance, using icekylinx's PR433 and ai-nanachi's PR426. +""" +import copy,hashlib,json,sys +from pathlib import Path +from collections import defaultdict +ROOT=Path(__file__).resolve().parent + +def reconstruct(raw,selection): + assert hashlib.sha256(raw).hexdigest()==selection['source_sha256'] + w=json.loads(raw);v=w['v'];n=2*v+w['R'];entries=selection['entries'];cut=len(w['A'])-w['source_basis_gates'];assert all(d>=2*v for f,d,ss in w['A'][:cut]) + removed={z['new_helper'] for z in entries};retired={z['retired_helper'] for z in entries} + assert len(removed)==len(retired)==len(entries) and not removed&retired + assert all(2*v<=x>i&1] + if ss:D.append([0,v+t,ss]) + c['D']=D;raw=json.dumps(c,sort_keys=True,separators=(',',':')).encode();assert hashlib.sha256(raw).hexdigest()==selection['word_sha256'];return raw + +def controls(raw,sel): + rejected=[] + cases=[] + for label in ('missing reset parent','wrong insertion time','duplicate physical reuse'): + s=copy.deepcopy(sel) + if label=='missing reset parent':s['entries'][0]['parents'].pop() + elif label=='wrong insertion time':s['entries'][0]['position']=0 + else:s['entries'][1]['new_helper']=s['entries'][0]['new_helper'] + cases.append((label,s)) + for label,s in cases: + try:reconstruct(raw,s) + except AssertionError:rejected.append(label) + else:raise AssertionError(label) + return rejected +if __name__=='__main__': + raw=Path(sys.argv[1]).read_bytes();s=json.loads((ROOT/'SELECTION.json').read_text());out=Path(sys.argv[2]);data=reconstruct(raw,s);out.write_bytes(data);print(json.dumps(dict(status='PASS_EXACT_CHRONOLOGICAL_RECONSTRUCTION',helpers_removed=len(s['entries']),R=s['R'],sha256=hashlib.sha256(data).hexdigest(),controls=controls(raw,s)))) diff --git a/research/split-centres-kernel-r747/verify.py b/research/split-centres-kernel-r747/verify.py new file mode 100644 index 0000000000..3e0ac605ec --- /dev/null +++ b/research/split-centres-kernel-r747/verify.py @@ -0,0 +1,49 @@ +"""Verify the selected two-supplier composition using Python's standard library.""" +import argparse,gzip,hashlib,json,os,shutil,subprocess,sys +from pathlib import Path +assert __debug__, 'Assertions must remain enabled' +ROOT=Path(__file__).resolve().parent +ap=argparse.ArgumentParser(description=__doc__) +ap.add_argument('output',type=Path,help='A new output directory outside this package') +ap.add_argument('--replay-phases',action='store_true',help='Recompute all selected Gaussian phase pairs instead of reusing their source-bound evidence') +a=ap.parse_args();out=a.output.resolve() +assert not out.exists() and not out.is_relative_to(ROOT) +def snapshot(): + return {p.relative_to(ROOT).as_posix():hashlib.sha256(p.read_bytes()).hexdigest() for p in ROOT.rglob('*') if p.is_file() and p.name!='MANIFEST.json'} +manifest=json.loads((ROOT/'MANIFEST.json').read_text());assert snapshot()==manifest['files'],'Source manifest mismatch' +sources=json.loads((ROOT/'SOURCES.json').read_text()) +for z in sources['imported_files']: + data=(ROOT/z['path']).read_bytes();assert hashlib.sha256(data).hexdigest()==z['sha256'] + if 'source_sha256' in z:assert hashlib.sha256(gzip.decompress(data)).hexdigest()==z['source_sha256'] +out.mkdir(parents=True) +def copy(src,dst): + p=out/dst;p.parent.mkdir(parents=True,exist_ok=True) + data=(ROOT/src).read_bytes();p.write_bytes(gzip.decompress(data) if src.endswith('.gz') and not dst.endswith('.gz') else data) +for src,dst in [ + ('inputs/e8-r865.json.gz','work/pr370-source/research/e8-bit/data/bit/bitE8-r865.json.gz'), + ('inputs/complex-ports.json.gz','work/higher-stage-e8/verified/gcert1-e8-retimed.json.gz'), + ('inputs/complex-template.json.gz','work/complex-nine-native/GLOBAL-TEMPLATE.json.gz'), + ('inputs/complex-data-phases.json.gz','work/complex-nine-native/DATA-PHASES.json'), + ('inputs/bit-geometry.json.gz','inherited/bit-geometry.json.gz'), + ('vendor/clifford_exact.py','work/odd-stages/clifford_exact.py')]:copy(src,dst) +for name in ('moment','base_two_moment','outer'):copy('vendor/engines/'+name+'.py','work/pr361/code/engines/'+name+'.py') +p=out/'bit426-source-centres';p.mkdir();(p/'bit-input.json').write_bytes(gzip.decompress((ROOT/'inputs/bit-r767.json.gz').read_bytes())) +env=dict(os.environ,E8_OUTPUT=str(out),E8_REPLAY_PHASES=str(int(a.replay_phases)),PYTHONDONTWRITEBYTECODE='1');env.pop('PYTHONOPTIMIZE',None) +steps=[] +def run(name,file,*args): + with (out/(name+'.log')).open('w') as log: + r=subprocess.run([sys.executable,'-B',str(ROOT/file),*map(str,args)],cwd=out,env=env,stdout=log,stderr=subprocess.STDOUT) + assert r.returncode==0,(name,str(out/(name+'.log'))) + steps.append(name);print('PASS',name,flush=True) +run('hamming_packets','vendor/hamming_packets.py') +for name in ('complex_construct','complex_audit','complex_emit','complex_phases','bit_construct','bit_reset','bit_kernel'):run(name,'code/'+name+'.py') +run('bit_export','vendor/export_records.py',p/'bit-source-centres.json',p/'records') +run('bit_global','code/bit_global.py','--source',p,'--local-check',p,'--out',p/'global') +run('bit_audit','code/bit_audit.py','--local-check',p,'--out',p/'global') +for name in ('bit_price','complex_integrate','complex_replay','combined'):run(name,'code/'+name+'.py') +assert snapshot()==manifest['files'],'Package modified during verification' +r=json.loads((out/'RESULT.json').read_text());expected=json.loads((ROOT/'EXPECTED.json').read_text()) +for key,value in expected.items():assert r[key]==value,(key,r[key],value) +r['verification_steps']=steps;r['phase_mode']='full replay' if a.replay_phases else 'source-bound unchanged evidence';r['manifest_sha256']=hashlib.sha256((ROOT/'MANIFEST.json').read_bytes()).hexdigest() +(out/'RESULT.json').write_text(json.dumps(r,indent=2)+'\n') +print('PASS conditional kappa',r['kappa_decimal'])