From e6a8003673d55929be6925b22f9ee645d03c33c3 Mon Sep 17 00:00:00 2001 From: Ali Romman <226877337+aliromman@users.noreply.github.com> Date: Tue, 13 Oct 2026 13:51:36 -0500 Subject: [PATCH] Research: prove native-query encoding boundary and two-block theorem --- .../native-query-boundary/CERTIFICATE.json | 574 ++++++++++++++++ research/native-query-boundary/CLAIM.md | 98 +++ research/native-query-boundary/LICENSE | 201 ++++++ research/native-query-boundary/NOTICE.md | 41 ++ research/native-query-boundary/PROOF.md | 411 ++++++++++++ research/native-query-boundary/README.md | 161 +++++ research/native-query-boundary/SOURCES.json | 109 ++++ research/native-query-boundary/VALIDATION.md | 109 ++++ .../native-query-boundary/check_package.py | 72 ++ .../vendor/pr521-proof.md | 183 ++++++ .../vendor/pr677-notice.md | 39 ++ .../vendor/pr677-proof.md | 383 +++++++++++ .../vendor/pr840-notice.md | 52 ++ .../vendor/pr840-program.py | 131 ++++ .../vendor/pr840-proof.md | 204 ++++++ .../vendor/pr990-notice.md | 13 + .../vendor/pr990-readme.md | 133 ++++ .../vendor/selected-result.json | 177 +++++ .../vendor/upstream-LICENSE | 201 ++++++ .../vendor/upstream-swap.tex | 416 ++++++++++++ research/native-query-boundary/verify.py | 614 ++++++++++++++++++ 21 files changed, 4322 insertions(+) create mode 100644 research/native-query-boundary/CERTIFICATE.json create mode 100644 research/native-query-boundary/CLAIM.md create mode 100644 research/native-query-boundary/LICENSE create mode 100644 research/native-query-boundary/NOTICE.md create mode 100644 research/native-query-boundary/PROOF.md create mode 100644 research/native-query-boundary/README.md create mode 100644 research/native-query-boundary/SOURCES.json create mode 100644 research/native-query-boundary/VALIDATION.md create mode 100644 research/native-query-boundary/check_package.py create mode 100644 research/native-query-boundary/vendor/pr521-proof.md create mode 100644 research/native-query-boundary/vendor/pr677-notice.md create mode 100644 research/native-query-boundary/vendor/pr677-proof.md create mode 100644 research/native-query-boundary/vendor/pr840-notice.md create mode 100644 research/native-query-boundary/vendor/pr840-program.py create mode 100644 research/native-query-boundary/vendor/pr840-proof.md create mode 100644 research/native-query-boundary/vendor/pr990-notice.md create mode 100644 research/native-query-boundary/vendor/pr990-readme.md create mode 100644 research/native-query-boundary/vendor/selected-result.json create mode 100644 research/native-query-boundary/vendor/upstream-LICENSE create mode 100644 research/native-query-boundary/vendor/upstream-swap.tex create mode 100644 research/native-query-boundary/verify.py diff --git a/research/native-query-boundary/CERTIFICATE.json b/research/native-query-boundary/CERTIFICATE.json new file mode 100644 index 0000000000..f602acf498 --- /dev/null +++ b/research/native-query-boundary/CERTIFICATE.json @@ -0,0 +1,574 @@ +{ + "base": "abdc6a7002abdbcd9e21bfc5e1a795784deacfdf", + "checked_sources": [ + "vendor/pr840-proof.md", + "vendor/pr840-program.py", + "vendor/pr840-notice.md", + "vendor/pr521-proof.md", + "vendor/pr677-proof.md", + "vendor/pr990-readme.md", + "vendor/upstream-swap.tex", + "vendor/selected-result.json", + "vendor/pr677-notice.md", + "vendor/pr990-notice.md", + "vendor/upstream-LICENSE" + ], + "classification": "scoped obstruction, constructive encoding theorem, and exact finite paid escape", + "full_domain": [ + { + "addresses": 729, + "centered_rank": 324, + "fixed_interchange_orbits": 27, + "modulus": 3, + "orbit_lengths": { + "1": 243, + "3": 162 + }, + "orbit_quotient_rank_three_rows": 567, + "orbits": 405, + "ordinary_rank_one_row": 351 + }, + { + "addresses": 15625, + "centered_rank": 10000, + "fixed_interchange_orbits": 125, + "modulus": 5, + "orbit_lengths": { + "1": 3125, + "5": 2500 + }, + "orbit_quotient_rank_three_rows": 8250, + "orbits": 5625, + "ordinary_rank_one_row": 7750 + }, + { + "addresses": 117649, + "centered_rank": 86436, + "fixed_interchange_orbits": 343, + "modulus": 7, + "orbit_lengths": { + "1": 16807, + "7": 14406 + }, + "orbit_quotient_rank_three_rows": 46305, + "orbits": 31213, + "ordinary_rank_one_row": 58653 + }, + { + "addresses": 531441, + "centered_rank": 393660, + "fixed_interchange_orbits": 729, + "modulus": 9, + "orbit_lengths": { + "1": 59049, + "3": 39366, + "9": 39366 + }, + "orbit_quotient_rank_three_rows": 205578, + "orbits": 137781, + "ordinary_rank_one_row": 265356 + } + ], + "no_new_kappa": true, + "prime_power_cases": [ + { + "centered_rank": 324, + "minimum_blocks_for_three_rows_by_rank": 4, + "modulus": 3, + "orbit_quotient_rank_three_rows": 567, + "orbits": 405, + "ordinary_rank_one_row": 351, + "prime": 3, + "spectators": 1, + "two_coordinate_orbit_lengths": { + "1": 3, + "3": 2 + }, + "volume_per_row": 729, + "width": 1 + }, + { + "centered_rank": 393660, + "minimum_blocks_for_three_rows_by_rank": 3, + "modulus": 9, + "orbit_quotient_rank_three_rows": 205578, + "orbits": 137781, + "ordinary_rank_one_row": 265356, + "prime": 3, + "spectators": 1, + "two_coordinate_orbit_lengths": { + "1": 9, + "3": 6, + "9": 6 + }, + "volume_per_row": 531441, + "width": 2 + }, + { + "centered_rank": 344373768, + "minimum_blocks_for_three_rows_by_rank": 2, + "modulus": 27, + "orbit_quotient_rank_three_rows": 64540557, + "orbits": 43046721, + "ordinary_rank_one_row": 193700403, + "prime": 3, + "spectators": 1, + "two_coordinate_orbit_lengths": { + "1": 27, + "27": 18, + "3": 18, + "9": 18 + }, + "volume_per_row": 387420489, + "width": 3 + }, + { + "centered_rank": 269644660344, + "minimum_blocks_for_three_rows_by_rank": 2, + "modulus": 81, + "orbit_quotient_rank_three_rows": 19176517044, + "orbits": 12784876137, + "ordinary_rank_one_row": 141214502520, + "prime": 3, + "spectators": 1, + "two_coordinate_orbit_lengths": { + "1": 81, + "27": 54, + "3": 54, + "81": 54, + "9": 54 + }, + "volume_per_row": 282429536481, + "width": 4 + }, + { + "centered_rank": 202219548120396, + "minimum_blocks_for_three_rows_by_rank": 2, + "modulus": 243, + "orbit_quotient_rank_three_rows": 5507354438019, + "orbits": 3671583974253, + "ordinary_rank_one_row": 102945558872871, + "prime": 3, + "spectators": 1, + "two_coordinate_orbit_lengths": { + "1": 243, + "243": 162, + "27": 162, + "3": 162, + "81": 162, + "9": 162 + }, + "volume_per_row": 205891132094649, + "width": 5 + }, + { + "centered_rank": 10000, + "minimum_blocks_for_three_rows_by_rank": 3, + "modulus": 5, + "orbit_quotient_rank_three_rows": 8250, + "orbits": 5625, + "ordinary_rank_one_row": 7750, + "prime": 5, + "spectators": 1, + "two_coordinate_orbit_lengths": { + "1": 5, + "5": 4 + }, + "volume_per_row": 15625, + "width": 1 + }, + { + "centered_rank": 218750000, + "minimum_blocks_for_three_rows_by_rank": 2, + "modulus": 25, + "orbit_quotient_rank_three_rows": 38062500, + "orbits": 25390625, + "ordinary_rank_one_row": 122062500, + "prime": 5, + "spectators": 1, + "two_coordinate_orbit_lengths": { + "1": 25, + "25": 20, + "5": 20 + }, + "volume_per_row": 244140625, + "width": 2 + }, + { + "centered_rank": 3710937500000, + "minimum_blocks_for_three_rows_by_rank": 2, + "modulus": 125, + "orbit_quotient_rank_three_rows": 155636718750, + "orbits": 103759765625, + "ordinary_rank_one_row": 1907347656250, + "prime": 5, + "spectators": 1, + "two_coordinate_orbit_lengths": { + "1": 125, + "125": 100, + "25": 100, + "5": 100 + }, + "volume_per_row": 3814697265625, + "width": 3 + }, + { + "centered_rank": 86436, + "minimum_blocks_for_three_rows_by_rank": 3, + "modulus": 7, + "orbit_quotient_rank_three_rows": 46305, + "orbits": 31213, + "ordinary_rank_one_row": 58653, + "prime": 7, + "spectators": 1, + "two_coordinate_orbit_lengths": { + "1": 7, + "7": 6 + }, + "volume_per_row": 117649, + "width": 1 + }, + { + "centered_rank": 13074568668, + "minimum_blocks_for_three_rows_by_rank": 2, + "modulus": 49, + "orbit_quotient_rank_three_rows": 1149901326, + "orbits": 766718533, + "ordinary_rank_one_row": 6920584776, + "prime": 7, + "spectators": 1, + "two_coordinate_orbit_lengths": { + "1": 49, + "49": 42, + "7": 42 + }, + "volume_per_row": 13841287201, + "width": 2 + }, + { + "centered_rank": 1611458021089224, + "minimum_blocks_for_three_rows_by_rank": 2, + "modulus": 343, + "orbit_quotient_rank_three_rows": 25433304701427, + "orbits": 16955576821225, + "ordinary_rank_one_row": 814206778778421, + "prime": 7, + "spectators": 1, + "two_coordinate_orbit_lengths": { + "1": 343, + "343": 294, + "49": 294, + "7": 294 + }, + "volume_per_row": 1628413597910449, + "width": 3 + }, + { + "centered_rank": 1464100, + "minimum_blocks_for_three_rows_by_rank": 2, + "modulus": 11, + "orbit_quotient_rank_three_rows": 459195, + "orbits": 307461, + "ordinary_rank_one_row": 885115, + "prime": 11, + "spectators": 1, + "two_coordinate_orbit_lengths": { + "1": 11, + "11": 10 + }, + "volume_per_row": 1771561, + "width": 1 + }, + { + "centered_rank": 4112784, + "minimum_blocks_for_three_rows_by_rank": 2, + "modulus": 13, + "orbit_quotient_rank_three_rows": 1067742, + "orbits": 714025, + "ordinary_rank_one_row": 2412306, + "prime": 13, + "spectators": 1, + "two_coordinate_orbit_lengths": { + "1": 13, + "13": 12 + }, + "volume_per_row": 4826809, + "width": 1 + } + ], + "rational_query_powers": [ + -18014398509481984, + -4, + -1, + 1, + 2, + 18014398509481984 + ], + "scope_controls": [ + "short_prime_power_orbits", + "spectator_volume", + "even_orbit", + "nonunit_power", + "one_block_rank" + ], + "search": { + "full_moduli": [ + 3, + 5, + 7, + 9 + ], + "prime_power_cases": 13, + "randomness": null, + "stopping_rule": "complete fixed coverage" + }, + "source_manifest_sha256": "d5b31ad74f3bf81ce21f8a913a3587a06141c187984477b8859ac244146ab6f9", + "spectator_cases": [ + { + "centered_rank": 393660, + "minimum_blocks_for_three_rows_by_rank": 3, + "modulus": 9, + "orbit_quotient_rank_three_rows": 205578, + "orbits": 137781, + "ordinary_rank_one_row": 265356, + "prime": 3, + "spectators": 1, + "volume_per_row": 531441, + "width": 2 + }, + { + "centered_rank": 787320, + "minimum_blocks_for_three_rows_by_rank": 3, + "modulus": 9, + "orbit_quotient_rank_three_rows": 411156, + "orbits": 275562, + "ordinary_rank_one_row": 530712, + "prime": 3, + "spectators": 2, + "volume_per_row": 1062882, + "width": 2 + }, + { + "centered_rank": 2755620, + "minimum_blocks_for_three_rows_by_rank": 3, + "modulus": 9, + "orbit_quotient_rank_three_rows": 1439046, + "orbits": 964467, + "ordinary_rank_one_row": 1857492, + "prime": 3, + "spectators": 7, + "volume_per_row": 3720087, + "width": 2 + } + ], + "status": "PASS_NATIVE_QUERY_BOUNDARY", + "three_genuine_row_construction": { + "cases": [ + { + "child_volume_each": "V/3", + "child_width_each": "N/3", + "core_size": 107646327, + "fused_rank": 344373768, + "modulus": 27, + "normalized_child_coefficient": 2, + "ordinary_children": 6, + "prime": 3, + "target_rank": 581101209, + "three_dimensional_blocks": 1, + "two_dimensional_blocks": 53823162, + "width": 3, + "zero_and_identity_size": 236727441 + }, + { + "child_volume_each": "V/3", + "child_width_each": "N/3", + "core_size": 115645813128, + "fused_rank": 269644660344, + "modulus": 81, + "normalized_child_coefficient": 2, + "ordinary_children": 6, + "prime": 3, + "target_rank": 423643507560, + "three_dimensional_blocks": 0, + "two_dimensional_blocks": 57822906564, + "width": 4, + "zero_and_identity_size": 153998847216 + }, + { + "child_volume_each": "V/3", + "child_width_each": "N/3", + "core_size": 95602419622179, + "fused_rank": 202219548120396, + "modulus": 243, + "normalized_child_coefficient": 2, + "ordinary_children": 6, + "prime": 3, + "target_rank": 308836676618613, + "three_dimensional_blocks": 1, + "two_dimensional_blocks": 47801209811088, + "width": 5, + "zero_and_identity_size": 106617128498217 + }, + { + "child_volume_each": "V/3", + "child_width_each": "N/3", + "core_size": 71312500, + "fused_rank": 218750000, + "modulus": 25, + "normalized_child_coefficient": 2, + "ordinary_children": 6, + "prime": 5, + "target_rank": 366187500, + "three_dimensional_blocks": 0, + "two_dimensional_blocks": 35656250, + "width": 2, + "zero_and_identity_size": 147437500 + }, + { + "child_volume_each": "V/3", + "child_width_each": "N/3", + "core_size": 1699832031250, + "fused_rank": 3710937500000, + "modulus": 125, + "normalized_child_coefficient": 2, + "ordinary_children": 6, + "prime": 5, + "target_rank": 5722042968750, + "three_dimensional_blocks": 0, + "two_dimensional_blocks": 849916015625, + "width": 3, + "zero_and_identity_size": 2011105468750 + }, + { + "child_volume_each": "V/3", + "child_width_each": "N/3", + "core_size": 5387383008, + "fused_rank": 13074568668, + "modulus": 49, + "normalized_child_coefficient": 2, + "ordinary_children": 6, + "prime": 7, + "target_rank": 20761754328, + "three_dimensional_blocks": 0, + "two_dimensional_blocks": 2693691504, + "width": 2, + "zero_and_identity_size": 7687185660 + }, + { + "child_volume_each": "V/3", + "child_width_each": "N/3", + "core_size": 780295705843185, + "fused_rank": 1611458021089224, + "modulus": 343, + "normalized_child_coefficient": 2, + "ordinary_children": 6, + "prime": 7, + "target_rank": 2442620336335263, + "three_dimensional_blocks": 1, + "two_dimensional_blocks": 390147852921591, + "width": 3, + "zero_and_identity_size": 831162315246039 + }, + { + "child_volume_each": "V/3", + "child_width_each": "N/3", + "core_size": 272855, + "fused_rank": 1464100, + "modulus": 11, + "normalized_child_coefficient": 2, + "ordinary_children": 6, + "prime": 11, + "target_rank": 2655345, + "three_dimensional_blocks": 1, + "two_dimensional_blocks": 136426, + "width": 1, + "zero_and_identity_size": 1191245 + }, + { + "child_volume_each": "V/3", + "child_width_each": "N/3", + "core_size": 988650, + "fused_rank": 4112784, + "modulus": 13, + "normalized_child_coefficient": 2, + "ordinary_children": 6, + "prime": 13, + "target_rank": 7236918, + "three_dimensional_blocks": 0, + "two_dimensional_blocks": 494325, + "width": 1, + "zero_and_identity_size": 3124134 + } + ], + "minimum_complete_blocks": 2, + "scope": "constructive direct-sum proof; no full large-domain encoder replay", + "small_blocks": [ + { + "columns": [ + 2, + 3 + ], + "size": 2 + }, + { + "columns": [ + 2, + 4, + 3 + ], + "size": 3 + } + ] + }, + "two_block_escape": { + "bits": 2187, + "child_volume_per_call": "V", + "child_width_per_call": "N/3", + "controls": [ + "omit_ordinary_child", + "omit_full_row_xor", + "omit_final_decoder_transfer", + "dirty_helper_not_restored" + ], + "counts": { + "affine": 36, + "bit_xor": 21606, + "child": 6, + "row_xor": 4 + }, + "data_volume": 729, + "dirty_helper_volume": 1458, + "encoders": [ + { + "decode_xor_transfers": 5397, + "encode_xor_transfers": 5397, + "encoder_columns_sha256": "e1192d13b16043e57d9d640f21d44c628b79ced181edebb2994f8b95ae5cf709", + "inverse_columns_sha256": "0149dcf8d534db4637ceb2d92d2a42a3a7ebcf6dc0efa9a49cd969e32bc5d22d" + }, + { + "decode_xor_transfers": 5406, + "encode_xor_transfers": 5406, + "encoder_columns_sha256": "08a329baf21930dd04f36206c920538bc55d511c81da67cb6b29366dedb20118", + "inverse_columns_sha256": "3f5b83442fd409e29a8a71078b512edab6a9b57e7a62bba15cfd7f578e883779" + } + ], + "forward_and_inverse": true, + "full_input_columns": 2187, + "genuine_rows": 1, + "modulus": 3, + "native_rank": 324, + "normalized_recursive_coefficient": 6, + "restored_dirty_rows": 2, + "spectator_lift": { + "child_volume_per_call": 1458, + "control": "child_lost_spectator_fiber", + "forward_and_inverse": true, + "full_input_columns": 4374, + "spectators": 2, + "word_sha256": "b64661246c27dc55b3ff10755d2f15e0aac6c3a84d1e3f65b4660e00a0cba465" + }, + "target_rank": 351, + "width": 1, + "word_sha256": "ced6e4781d7c97769125beb006c590440f5c638f4d67d54e819dfd17a3d69a63" + } +} diff --git a/research/native-query-boundary/CLAIM.md b/research/native-query-boundary/CLAIM.md new file mode 100644 index 0000000000..f69ffe2683 --- /dev/null +++ b/research/native-query-boundary/CLAIM.md @@ -0,0 +1,98 @@ +# Local research claim + +Route 6: native fused DATA queries and the ordinary BIT supplier boundary. + +Base: `abdc6a7002abdbcd9e21bfc5e1a795784deacfdf`. +Branch: `codex/k9-native-query`. +Claim time: 2026-10-13 18:08 UTC. Expected finish: 2026-10-13 20:15 UTC. +No fixed user time limit applies. This time is a work estimate. + +A fresh GraphQL check found no pinned issue. The shared open-PR list and a +fresh 40-PR update list through PR1099 were checked before this claim. No +matching native boundary result was found in those lists. + +## Three candidate tasks + +1. Use the PR840 centered DATA shear in a direct ordinary-interchange word. + First test the ADDRESS orbit action on every genuine DATA role. +2. Convert one completed fused block by a paid binary linear encoding. + First test exact conjugacy invariants on the complete ADDRESS domain. +3. Prove a uniform obstruction for the conversion classes in items 1 and 2. + Count native orbits over all odd prime powers, derive full-array ranks, + and compare them with the exact ordinary supplier boundary. + +The first two tests fail in their stated classes. The native powers preserve +separate ADDRESS orbits. The ordinary endpoint exchanges some of those +orbits. One centered block has a binary rank that differs from any positive +number of full ordinary-interchange rows. This comparison holds under an +encoding and its inverse. Different entry and exit adapters are not covered +by that conjugacy statement. Item 3 is the selected task. + +## Exact object and method + +Use PR840 at `da2cd0dd2229e08b61b174a8835a2c2bb99d2230`, with its unchanged +PR521 and PR677 inputs. Use the actual six-field ADDRESS push map on +`(Z/p^b)^6`, every odd prime p, every b >= 1, and every spectator volume. +Do not infer full-array rank from rational ADDRESS rank. Compute the orbit +quotient, prove its count, and test the formulas with independent full-domain +and binary-matrix checks. Also price complete fused blocks after arbitrary +separate conjugations. + +A second-block escape will be constructed on the complete order-three domain. +It implements one ordinary DATA-row interchange with two restored dirty helper +rows. The favorable bill is six full-volume children at one-third width. This +already fails the positive-saving test, before the encoders are charged. + +Expected deliverable: a scoped negative theorem, an exact finite escape, +standalone checks, rejection controls, and complete typed costs. No new kappa +or selected-supplier change is planned. A later extension below resolves +the algebraic two-block question for three genuine rows. Cheap paid encoders +that mix native orbits remain open. + +## Predecessors and overlap + +PR521 gives the native map. PR677 gives restored DATA boundaries. PR840 gives +the three-child centered shear. PR990 uses the same map in a private batch; +its full endpoint was read. Its lifetime and batching result stay valid. +PR955 closes fixed complex register words. PR720 concerns an abelian formal +rational model. PR836 concerns complex unitary mixing. None supplies this +full finite ADDRESS-domain rank comparison. + +The earlier private archive fixes a seven-map core plus an eighth rank-one +map. Its one-negative and mod-4 results were read. This task does not repeat +that screen. The present conversion class differs. + +This work uses one CPU thread. It uses no solver, random search, large install, +or new agent. It leaves `upstream/` and the selected frontier unchanged. + +## Completed result and final overlap check + +At 2026-10-13 18:46 UTC, the final read found no pinned coordination issue. +The 45 most recently updated open PRs, through PR1125, had no matching +native-query boundary result. This is the inspected metadata scope, not a +claim to have read every concurrent submission. PR840 and PR990 are still +open at the exact heads above. Main is +`ba82555c64e1879e4b7decce28186f208fcb8262`; its selected PR1042 differs from +the stated base. The base and all construction pins remain unchanged. + +The one-block full-domain rank obstruction and the same-h orbit-quotient +obstruction are proved. The exact two-block construction on one genuine row +and two restored dirty rows is emitted and checked on all input columns, +with an actual two-fiber spectator lift. Its six full-volume children fail +the positive-saving recurrence even before its encoders are charged. + +The second-block experiment suggested a stronger extension. For three genuine +rows and every odd prime power m>=11, complementary square-zero factors give +exactly two complete fused blocks under free arbitrary binary encodings. +This is a constructive proof, not a failed search or a conjecture. Its six +children each retain one-third of the total DATA volume. The favorable child +coefficient is two. The supplied scan-per-bit encoder still fails the full +tape budget. The orbit quotient gives a quantitative lower charge for that +specific emission. Structured encoders that group transfers remain open. + +The work stopped at that explicit implementation boundary. A large dense +encoder replay would not remove its proved time cost, so no such enumeration +was run. The completed package gives the universal algebra, full-domain +obstructions, exact finite escape, all cost terms, and executable controls. +It claims neither a new supplier nor a new kappa. The final quarter of this +session was reserved for proof review, source/receipt checks and handoff. diff --git a/research/native-query-boundary/LICENSE b/research/native-query-boundary/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/native-query-boundary/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/native-query-boundary/NOTICE.md b/research/native-query-boundary/NOTICE.md new file mode 100644 index 0000000000..00687b44fe --- /dev/null +++ b/research/native-query-boundary/NOTICE.md @@ -0,0 +1,41 @@ +# Attribution and scope + +Contributed by Ali Romman. Substantial AI assistance from OpenAI Codex was +used for research, mathematics, implementation, verification and writing. +No independent human review or full formal verification is claimed. +New code and prose are under the repository's Apache-2.0 license. + +- Karl Appel / @applecrusher, PR521 at + `a190fdb39f31647fc6f651625353710624627348`, supplies the native unipotent + ADDRESS map and the seven-event lowering. `query_events` is an attributed + transcription of that lowering. Its rational matrix is checked separately. +- @commdata2338, PR677 at `613c02b8b4411f991f108dcc1481b3f9100b996f`, + supplies restored DATA-shear contracts, query-model distinctions and typed + costs. Its source notice and AI-assistance disclosure are retained. +- Wentao Li / @VictorLiwentao, PR840 at + `da2cd0dd2229e08b61b174a8835a2c2bb99d2230`, supplies the centered dyadic + fused block with three ordinary children. `fused_events` transcribes its + event order. This work addresses the ordinary boundary left open there. +- Sagar Thakrar / @thakrarsagar, PR990 at + `1c3ddf6bbbe1d8f0227de6726bb8273b2cb03711`, supplies the private native + batch and its distinct lifetime contract. Its source notice is retained. +- OpenAI #109 and the upstream contributors supply the ordinary interchange, + stream, tape, restoration and head-return contracts. Their copied source + and license are unchanged. Those contracts remain premises. +- Jonathan Capalbo's selected PR942 assembly, the later PR1042 assembly, + their complex lineage, and DreamingOfClouds' PR589 on eumemic's PR555 BIT + supplier retain their existing attribution. No selected artifact is changed. +- The archived native-fusion521 application screens and PR955, PR720 and + PR836 were checked for overlap. Their narrower negative results retain + their stated scopes. This package does not rerun those searches. + +Exact copied bytes, source paths, Git blobs and hashes are in SOURCES.json. +The vendor files preserve predecessor text and notices without edits. +The full-domain orbit/rank argument, adapter charge, complementary-factor +construction, literal encoder emission, independent complete VALUE replay, +and cost comparison are the new contribution. + +No priority is claimed for binary Jordan form, Gaussian elimination, rank +subadditivity, or the elementary complementary companion blocks. Their use +here closes a specific native-query encoding question. A fast uniform tape +encoder and a complete recursive supplier remain open. diff --git a/research/native-query-boundary/PROOF.md b/research/native-query-boundary/PROOF.md new file mode 100644 index 0000000000..3baef7e5ed --- /dev/null +++ b/research/native-query-boundary/PROOF.md @@ -0,0 +1,411 @@ +# Native queries at the ordinary BIT boundary + +This note gives a scoped obstruction, an abstract two-block encoding theorem, +and a finite construction that escapes the obstruction. It does not give a +new supplier or a new kappa. All ranks below are ranks of actual binary VALUE +operators. They are not ranks of rational ADDRESS +matrices. The proofs apply to arbitrary input bits. + +## 1. Complete domains and endpoints + +Let p be an odd prime, b >= 1, and m = p^b. Put A = Z/m and let Sigma be a +spectator set of size S >= 1. One complete row has ADDRESS domain + + Omega = A^6 x Sigma, U = S m^6. + +The six fields are `(H0,H1,H2,D0,D1,D2)`. Every field has b radix-p digits. +The native push map from Karl Appel's PR521 is + + h(z) = z + (r^T z / 4) s, + s = (1,0,1,-1,0,-1)^T, + r = (1,0,-1,-1,0,1)^T. + +It acts as the identity on Sigma. Since r^T s = 0, its kth power replaces +1/4 by k/4. The map is defined on every odd prime-power ring. Write h also +for its binary permutation operator on a complete row. + +For any signed dyadic unit a = +/-2^j, PR840 implements + + F_a = I + E_xy tensor (h^a + h^-a) + +on three complete rows. Here E_xy sends row y to row x and is zero on the +other rows. Thus E_xy^2 = 0. Every other dirty row is unchanged. PR840 lowers +this operation to three ordinary children, eighteen ordered affine events, +and two full-row XOR scans. Its middle native query has power 2a. + +Let Z interchange the two complete three-field banks. It sends `(H,D)` to +`(D,H)` and preserves Sigma. An ordinary completed boundary on q genuine +rows, with restored dirty helpers, is + + T_q = diag(Z,...,Z,I,...,I), q >= 1. + +A weighted or reversed ordinary bank interchange has the same rank as Z. +Its ADDRESS form is `(H,D) -> (A J D, J A^-1 H)`, where J reverses the three +atom positions and A is an invertible diagonal unit matrix. Each D determines +exactly one fixed H. Thus it has S m^3 fixed addresses. The weights can vary +with Sigma and with the role. This does not change that count. + +**Frame normalization is a premise.** In a caller, a dirty helper can have +physical endpoint `B_out h_in` instead of literal `h_in`. Remove the declared +entry and exit frames before applying a theorem about restored helpers. +Those removals are mathematical comparisons; they are not free tape passes. +The rank theorem below applies when the resulting normalized program is a +conjugate `E^-1 F_a E`. It does not follow merely because the physical word +has that form. If normalization gives different adapters, use Section 5. +A helper whose required physical endpoint is itself an ordinary interchange +can instead be counted among the q ordinary rows. + +## 2. Exact native orbit count + +Put lambda = r^T z / 4. This is a surjective map A^6 -> A. Each fiber has +m^5 points. The value lambda stays constant under h, and h adds lambda s. +The first coordinate of s is 1. Therefore an address with value lambda has +orbit length + + L(lambda) = m / gcd(m,lambda). + +For lambda = 0 this length is 1. The other possible lengths are p^j, +1 <= j <= b. There are phi(p^j) values of lambda of order p^j. Hence the +number of h-orbits, with every spectator included, is + + K = S m^5 sum_lambda 1/L(lambda) + = S m^5 [1 + b(1 - 1/p)]. (1) + +Equivalently, K = S m^4 sum_lambda gcd(m,lambda). The term for every j is +necessary. Treating all nonfixed orbits as length m is false when b > 1. +For m=9, the complete six-field domain has 59,049 fixed orbits, 39,366 orbits +of length 3, and 39,366 orbits of length 9. + +A separate coordinate description checks the count. Set + + u = H0, lambda = (H0-H2-D0+D2)/4, + v1 = H1, v2 = D1, v3 = H0+D0, v4 = H0-H2. + +This is invertible over A. Its inverse is + + H0=u, H1=v1, H2=u-v4, D0=v3-u, D1=v2, + D2=4 lambda-v4+v3-u. + +In these coordinates h is `(u,lambda,v) -> (u+lambda,lambda,v)`. +This is an algebraic change of coordinates for the proof. No tape cost or +free implementation of that change is asserted. + +## 3. No single-block conjugacy to whole ordinary rows + +On one h-orbit of odd length L, the kernel of `h^a+h^-a` is the kernel of +`h^(2a)+I`. Since gcd(2a,L)=1, that kernel consists exactly of the constant +vectors on the orbit. It has dimension one over F2. Thus + + rank(F_a-I) = rank(h^a+h^-a) = U-K =: r. (2) + +A binary permutation involution has one rank-one difference block for each +pair of exchanged addresses. Its fixed addresses give zero blocks. Therefore + + rank(Z-I) = S(m^6-m^3)/2 =: t, + rank(T_q-I) = q t. (3) + +For m=3, equations (1)--(3) give r=324S and t=351S, so `0 S m^3. To prove the lower inequality, +write d=1+b(1-1/p). It is enough that d=5,b=1 and at +p=3,b=2. On increasing b by one, d increases by less than 1 and m is +multiplied by p>=3. Thus it continues to hold by induction. This covers all +remaining odd prime powers. + +No positive integer q has r=q t. Appending identity helpers does not change +either rank. Conjugation by any invertible binary linear map preserves the +rank of an operator minus I. Consequently: + +> One PR840 fused block cannot be converted into any positive number of +> whole ordinary three-field interchange rows by an arbitrary invertible +> binary linear encoding and its inverse, with any number of restored dirty +> helper rows. The statement includes weighted and reversed ordinary rows. + +The encoding can mix all VALUE positions, all roles and all spectator +coordinates. It need not be an ADDRESS permutation. This is a full-domain +rank obstruction, not a bounded word search. It does not exclude different +entry and exit adapters, several fused blocks, or another required helper +endpoint before frame normalization. + +For a product of k separately conjugated complete fused blocks, rank +subadditivity gives the necessary condition + + k >= ceil(q t/r). (5) + +Indeed, `AB-I=(A-I)B+(B-I)`, so ranks add as an upper bound. For q=3 and +S=1, the bound gives k>=4 at m=3, k>=3 at m=5,7,9, and k>=2 at m=11,27. +These small-width restrictions do not by themselves rule out an asymptotic +construction that stops recursion above those widths. + +## 4. The native orbit quotient is still missing + +This section concerns the unweighted bank swap Z. It commutes with h: +bank interchange sends both s and r to their negatives. It therefore induces +an involution Zbar on the set of native orbits. + +Exactly S m^3 native orbits are fixed by Zbar. To prove this, use the sum +H+D and difference v=H-D. The sum is fixed by both maps. On v, the native +map is `v -> v+(1/2)u(t0^T v)`, with `u=(1,0,1)` and `t0=(1,0,-1)`. +If -v is in the orbit of v, then for some k, + + -v = v+(k/2)u(t0^T v). + +Apply t0^T. Since t0^T u=0 and 2 is a unit, t0^T v=0. The displayed equation +then gives v=0. Conversely, v=0 is a fixed point. The sum has m^3 possible +values. This proves the claim, including rings with zero divisors. + +Let pi sum the VALUE bits on each native orbit. For every integer e, +`pi h^e=pi`. Every completed centered shear has identity action after pi. +The PR677 first-difference shears and the complete PR990 batch also have +identity action there. Constant XOR maps can mix roles at one orbit; they +cannot move a value to another orbit. + +Thus no circuit of same-h power queries and address-independent role XORs +can realize T_q, regardless of length or dirty-helper count. The stronger +class of all linear operations confined to individual native orbits also +fails. A fixed encoding that only permutes these orbit subspaces does not +remove the obstruction when it is decoded by its inverse. + +A concrete failure witness is a bit at address e_H1. Both e_H1 and e_D1 are +separate fixed h-orbits. Z sends the first address to the second. A program +confined to native orbits cannot do so. + +There is also an exact charge for new linear adapters. Suppose a circuit +adds arbitrary linear maps A_1,...,A_j to the same-h/XOR class. Delete those +maps, leaving a map P0. On the orbit quotient P0 acts as `B tensor I_K` for +one constant role matrix B. For the desired endpoint T_q, select one input +orbit and the opposite output orbit from each nonfixed Zbar pair. On the +q genuine rows this submatrix of `pi(T_q-P0)` is the identity. Hence + + rank(pi(T_q-P0)) >= q(K-S m^3)/2. + +A telescoping product difference gives + + sum_i rank(A_i-I) >= q(K-S m^3)/2. (6) + +The pi map cannot increase rank. The adapters may be interleaved, and they +need not preserve native orbits. Equation (6) identifies actual transport +that a conversion must supply. It is not a lower bound on tape time or on +recursive children. A high-rank map can still have a cheap streaming rule. + +## 5. Different entry and exit maps + +Let A_in and A_out be arbitrary invertible binary linear adapters. Do not +assume that they are inverses. If + + T = A_out F_a A_in, + +then `T-A_out A_in = A_out(F_a-I)A_in` has rank r. In particular, + + rank(A_out A_in-I) >= rank(T-I)-r. (7) + +For T=T_3 the right side is positive for every odd prime power. This shows +why the single-block result cannot be carried over to different boundary +frames without accounting for their product. It does not claim that this +rank forces an expensive adapter. + +As a simple paid possibility, an arbitrary adapter can already contain the +required interchange. That is not an improvement. A less circular escape +uses two completed fused blocks and inverse adapter pairs. Section 6 gives +that construction and its literal all-input replay. + +## 6. A complete two-block escape and its price + +Use one genuine DATA row and two arbitrary dirty helper rows, each of full +volume U. The desired boundary is T_1. The helper rows must be restored in +the normalized physical coordinates used here. Let N=T_1-I, with rank t. +Let J be a binary basis in which N sends t basis vectors w_i to t independent +vectors v_i and is zero on all remaining basis vectors. Such a basis exists +because N^2=0. The verifier constructs the basis and checks every column. + +At m=3, r=324 and t=351. On the t-dimensional map from w to v, put + + A = diag(0_27, I_27, C_297), B=I_351+A. + +Choose C_297 as a direct sum of one 3 by 3 companion block for `x^3+x+1` +and 147 two-dimensional companion blocks for `x^2+x+1`. Both C_297 and +I+C_297 are invertible. Thus A and B both have rank 324. Let N1,N2 have these +w-to-v blocks and be zero elsewhere. Then + + N1^2=N2^2=N1 N2=N2 N1=0, + N1+N2=N, (I+N2)(I+N1)=T_1. (8) + +Both I+N_i are conjugate to F_a: in characteristic two, a square-zero +operator is determined up to similarity by its rank and ambient dimension. +The verifier does not just assume this classification. It builds a complete +basis of image/preimage pairs for each map, constructs the encoder E_i, and +checks `F_a E_i = E_i(I+N_i)` on every binary column. + +Each block runs `E_i`, the literal PR840 lowering, then `E_i^-1`. Gaussian +row elimination emits each encoder as a list of individual bit-XOR transfers. +The full order-three execution checks all 2,187 independent input columns. +It also runs the literal inverse. No row is initialized, copied or cleared. +The two helper outputs equal their arbitrary inputs on every column. +A second execution lifts every encoder and child to two complete spectator +fibers and checks all 4,374 columns in both directions. + +The same algebra gives a finite construction for every odd prime power. +For m>=5, r>t. Choose C_t and I+C_t invertible on the t target pairs. Put +that pair of complementary maps on those pairs. Add r-t equal nilpotent pairs +in helper coordinates to both factors. Their extra actions cancel in (8). +Both factors then have rank r. There is space: 2r<2U<3U. Every integer t>=2 +can be split into blocks of sizes 2 and 3. This proves existence; only the +m=3 literal program and its two-fiber lift are executed in this package. + +For that literal program the exact counts are: + +| Item | Count | +|---|---:| +| Ordinary full-row children | 6 | +| Ordered affine events | 36 | +| Full-row XOR scans | 4 | +| Individual bit-XOR transfers in all encoders and decoders | 21,606 | +| Full dirty helper rows | 2 | + +Let V denote the genuine DATA volume here, so V=U, not 3U. Let C(V,b) pay +one ordinary child and its restored work. Let L_k(V,b) pay the six ordered +affine events for native power k. It includes their source access, table +preparation, temporary tapes, counters and head returns. Let X(V) pay one +full-row XOR scan. Let Q(3V) pay a transfer of one selected bit to another +by complete scans of the three-row storage. The source bit is held in one +private zero cell; a later scan updates the target. Another source scan clears +that cell. All scans and head returns are paid by Q. The source is retained. +This gives a +finite, exact tape implementation without a constant-time random-access +premise. Let P(m,S) pay generation and storage of the encoder instructions, +and R(3V,b) pay routing, descriptors, parking and all remaining head returns. +The complete bill for this order-three escape is + + B_two(V,3b) <= 6 C(V,b) + 4 L_-1(V,b) + 2 L_2(V,b) + + 4 X(V) + 21606 Q(3V) + P(3,1) + R(3V,b). (9) + +The two-fiber lift has 43,212 bit transfers, while every one of its six +children acts on the complete doubled row. Larger domains require their +own encoder bill G(m,S) in place of 21,606. Gaussian elimination is a finite +algorithm, but its growing instruction table is not a fixed all-size +linear-time stream contract. No such contract is claimed. + +Persistent row storage is 3V. A safe peak bound also includes the encoder +table, its generation work, one bit for a transfer, primitive temporary tapes, +parking/descriptors and the restored child workspace. Calls are sequential. +No copy, clear or free recovery step is omitted. + +Even with free encoders, this route cannot yield a positive BIT saving. It +would give recursive coefficient 6 with width reduction 3: + + B(V,3b)/V <= 6 C(V,b)/V + lower-order work. + +For the trial bound C(V,n) proportional to V n^(1-c), its child moment is +`6/3^(1-c)=2*3^c`, which is greater than one for every c>=0. The two helper +rows are not productive DATA volume. Counting them as three productive rows +would falsely replace coefficient 6 by 2. The width remains b; retaining a +full spectator volume does not divide that width a second time. + +For a different construction with three genuine output rows, k complete +fused blocks would instead cost `3k C(V/3,b)` plus every adapter and scan. +Its favorable normalized coefficient would be k. Section 7 proves the +abstract k=2 construction for m>=11 and identifies its encoder cost. Cheap +uniform encoders and recursive hosting are still open. The present result +does not prove that native fusion cannot help a supplier. + +## 7. Two fused blocks suffice abstractly for three genuine rows + +The three-genuine-row case has a stronger positive result. Let m>=11 be an +odd prime power. Put t3=3t. Equations (1)--(3) give + + r=2. + +For the second inequality it is enough that d=1+b(1-1/p)=11,b=1; at p=5 or 7,b=2; and at p=3,b=3. It persists when b increases, +as in Section 3. These base cases cover all odd prime powers m>=11. In fact +`e=S m^6/2 - 2K + 3S m^3/2 > 3S m^3/2` under this sufficient inequality. + +In a Jordan basis for T_3-I, use + + A=diag(0_(t3-r), I_(t3-r), C_e), B=I_t3+A. + +Both A and B have rank r. Here C_e and I+C_e are invertible direct sums of +the same two- and three-dimensional blocks used in Section 6. The associated +square-zero maps N1,N2 have zero product in both orders and sum to T_3-I. +Thus two conjugates of F_a implement T_3 exactly. The Jordan bases need +2t3 coordinates, and 2t3=3S(m^6-m^3)<3U. No extra helper row is needed. +The remaining coordinates are fixed. Section 3 excludes one block, so: + +> For every odd prime power m>=11, exactly two complete PR840 fused blocks +> suffice for three genuine ordinary-interchange rows when arbitrary binary +> linear encoders and their inverses are free. + +This is a constructive algebraic theorem. It is not a search result or a +claim that its encoders are free on tape. The general encoder procedure in +`two_block_encoders` accepts the number of genuine rows. Its proof uses the +same image/preimage construction already executed for one genuine row. +The certificate checks the complementary two- and three-dimensional blocks +and all dimension/rank counts for nine specified prime powers with m>=11. +It does not allocate or replay the full m=11 matrix. The universal statement +follows from the displayed direct sums and the written rank inequalities. + +Let V=3U now denote three genuine DATA rows. The complete typed invoice is + + B_three(V,3b) <= 6 C(V/3,b) + + 4 L_-1(V/3,b) + 2 L_2(V/3,b) + 4 X(V/3) + + G(m,S) Q(V) + P(m,S) + R(V,b). (10) + +All six children retain all spectator fields. A binary n by n encoder can +be reduced to the identity with at most n(n-1) row additions and n swaps; +each swap uses three XOR transfers. With n=V, the two encoders and their two +inverses therefore have the safe bound `G<=4V^2+8V`. Their instruction table +and its generation are included in P. Dense binary matrices and instructions +require additional storage; they are not stored in arbitrary dirty DATA. +A safe peak bill is V plus generation/table storage, transfer/counter work, +primitive scratch, routing/parking/descriptors, and the child workspace. + +The child-only coefficient is 2, and its moment is `2/3^(1-c)`. For example, +the child-only moment at c=1/3 is less than one because 8<9 after cubing. +This is a favorable budget for a cheap encoder, not a certified exponent. +The current encoder implementation cannot discard its other terms. + +There is a useful lower bound for its stated tape implementation. Every +individual bit-XOR adapter has rank one after subtracting I. Equation (6) +therefore requires + + G >= 3(K-S m^3)/2. (11) + +The specified Q implementation makes a full V-cell scan for each transfer. +Its cost is at least a fixed positive multiple of + + V * 3(K-S m^3)/2. + +At S=1 and fixed p, K has order `b m^5` while V=3m^6. Thus this work has +order at least `b m^11`. It cannot be absorbed in `O(V (3b)^(1-c))` for any +fixed c. This excludes the explicit unbatched scan-per-bit-transfer emission +from the required supplier time bound. It does not exclude a structured +encoder that groups many transfers in one scan or uses a different layout. +The dense gate bound is an upper bound, not a general circuit lower bound. + +The remaining constructive objective is precise: give encoders for these +rank-r factors with the retained tape/row contract and a paid overhead small +enough for (10), then supply arbitrary widths, routing, hosting and recursive +admission. The abstract two-block theorem is useful evidence for that route. +It does not establish those missing interfaces. The one-genuine-row failure +in Section 6 must not be applied to this three-genuine-row construction. + +## 8. Evidence and connection to kappa + +The written proofs establish the quantified statements. The finite checker +checks their formulas and the new construction. It uses a six-coordinate +permutation census, a separate two-coordinate orbit census, exact binary +elimination, full symbolic VALUE execution, literal inverse execution, and +corruption controls. It does not import predecessor code or a search solver. +The checker uses no random choices. Its domains and stopping rule are fixed +in CERTIFICATE.json. It is not a proof-assistant formalization. + +At the pinned base the selected PR942 assembly has complex b equal to +0.001664727258740678855772 and BIT c equal to 0.001733427039589844234749. +The complex side binds. Even a valid improvement to this BIT route would +not alone increase that selected kappa. This package changes neither +supplier, neither invoice, nor the selected record. It retains the all-size, +common-label, mutable-source, hosting, precision/tape and analytic obligations +of any later supplier adoption. diff --git a/research/native-query-boundary/README.md b/research/native-query-boundary/README.md new file mode 100644 index 0000000000..b7258d1b29 --- /dev/null +++ b/research/native-query-boundary/README.md @@ -0,0 +1,161 @@ +# Native fused queries at the ordinary BIT boundary + +This package gives an enabling algebraic theorem and scoped obstructions. +For every odd prime-power modulus m>=11, exactly two separately encoded +PR840 fused DATA blocks suffice for three genuine ordinary-interchange rows +if arbitrary binary linear encoders and their inverses are free. The proof +constructs the factors. It does not supply cheap uniform tape encoders, an +admitted BIT supplier, or a new kappa. + +A single fused block cannot give any positive number of whole ordinary rows +under this encoding contract, even with arbitrary restored dirty helpers. +The comparison uses full binary VALUE operators. It includes short orbits +of prime-power order and all spectator coordinates. Physical helper frames +must first be normalized. Different entry and exit adapters need a separate +cost and rank analysis. + +[PROOF.md](PROOF.md) gives the quantified proofs and all cost terms. +[CERTIFICATE.json](CERTIFICATE.json) records the exact finite evidence. +[SOURCES.json](SOURCES.json) pins the copied source bytes. +[NOTICE.md](NOTICE.md) gives attribution and the AI-assistance disclosure. + +## Main results + +Let one complete row have U=S m^6 bits, with m=p^b for an odd prime p. +Let h be the six-field native ADDRESS map of PR521. Its exact orbit count is + + K = S m^5 [1+b(1-1/p)]. + +The PR840 centered shear has difference rank r=U-K. One ordinary three-field +bank interchange has difference rank t=S(m^6-m^3)/2. At m=3, r=11, put +`t3=3t`, `z=t3-r`, and `e=2r-t3`. Then z>=0 and e>=2. In a Jordan basis of +the ordinary endpoint minus I, use the complementary blocks + + A=diag(0_z,I_z,C_e), B=I+A. + +Choose C_e and I+C_e invertible by direct sums of blocks of sizes two and +three. Both factors have rank r. They give square-zero maps with zero mutual +products and the required sum. Thus both factors are conjugate to the native +fused block. No extra helper row is needed. One block is impossible, so two +is the exact optimum in this model with free encoders. + +The native orbit quotient also gives a separate obstruction. Same-h power +queries and constant role XORs cannot transport bits between native orbits. +The ordinary endpoint must do so. For q genuine rows, arbitrary added linear +adapters A_i must satisfy + + sum_i rank(A_i-I) >= q(K-S m^3)/2. + +This is a rank charge, not a general time lower bound. It gives a time +obstruction for the explicit implementation that uses a complete tape scan +for each individual bit-XOR transfer. A structured encoder could group many +transfers in a scan. That route remains open. + +## Literal construction and complete cost + +The checker constructs two encoders at m=3 for one genuine DATA row and two +arbitrary dirty helper rows. It lowers both fused blocks to actual ordinary +children and ordered-affine events. It executes every independent VALUE +column, checks both helper endpoints, and executes the literal inverse. +It then repeats the program on two full spectator fibers. No row is copied, +cleared or initialized. + +| Program | Genuine bits | Dirty bits | Input columns checked | Ordinary children | +|---|---:|---:|---:|---:| +| m=3, S=1 | 729 | 1,458 | 2,187 | 6, each of volume 729 | +| m=3, S=2 | 1,458 | 2,916 | 4,374 | 6, each of volume 1,458 | + +For S=1 the literal word has 36 affine events, four full-row XOR scans, and +21,606 individual bit-XOR transfers. The transfer count doubles at S=2. +Each recursive child retains the full spectator volume. The complete cost +also includes source access, encoder generation and storage, primitive +scratch, routing, parking, counters, head returns and restored child work. +Equations (9) and (10) in the proof state these costs. + +For one genuine row, the six children each have volume V and width N/3. +Their moment is `6/3^(1-c)>1` for every c>=0. This rules out only that +one-genuine-row construction with two restored helper rows. Those helpers +cannot be counted as productive DATA volume. + +For three genuine rows, the abstract two-block construction has six children +each of volume V/3 and width N/3. Its child-only moment is `2/3^(1-c)`. +This is favorable for some positive c, before encoder costs. The supplied +Gaussian encoder emission uses individual bit transfers. A complete scan +per transfer costs at least `V * 3(K-S m^3)/2`. For S=1 and fixed p, this has +order at least `b m^11`. It fails the required time bound. Cheap uniform +encoders, arbitrary widths, routing, hosting and recursive admission remain +unresolved. No new c or kappa is asserted. + +## Reproduce + +Use Python 3.10 or later and its standard library. No network, Git metadata, +solver, predecessor import, or package install is needed after checkout. +From the repository root run: + +```sh +python3 -I -O -B research/native-query-boundary/verify.py +``` + +Expected result: + +```text +PASS_NATIVE_QUERY_BOUNDARY full_addresses=665444 prime_power_cases=13 dirty_columns=2187 escape_children=6 no_new_kappa +``` + +The command compares the complete canonical receipt with the committed +certificate. It checks copied-source hashes before the mathematical replay. +It rejects a missing certificate or a changed field, including an integer +replaced by a Boolean. To emit the complete literal program for inspection, +use a new output path: + +```sh +python3 -I -O -B research/native-query-boundary/verify.py --emit-word /tmp/native-boundary-word.json +``` + +`--emit` can write a fresh receipt to a new path. It does not overwrite the +committed certificate. The ordinary command does not write any files. +[VALIDATION.md](VALIDATION.md) records the checks and their limits. + +The finite domain is fixed in the certificate. Full six-coordinate census +uses m=3,5,7,9 and covers 665,444 addresses. A separate two-coordinate census +uses 13 specified prime powers, including widths through five and short +orbits. The three-row theorem has exact two- and three-dimensional block +checks and dimension/rank checks for nine moduli at least 11. The full m=11 +encoder matrix is not allocated or replayed. The universal theorem follows +from the written construction; a finite replay is not its formal proof. +There are no random choices or unreported search cutoffs. + +## Base, current context, and prior attempts + +Exact base: `abdc6a7002abdbcd9e21bfc5e1a795784deacfdf`. +Its selected record names Jonathan Capalbo's PR942 assembly with +`kappa=1661960547713947/1000000000000000000`. The complex exponent is +0.001664727258740678855772; the BIT exponent is 0.001733427039589844234749. +The complex side binds. The copied selected record is a base reference. + +A later live read at main `ba82555c64e1879e4b7decce28186f208fcb8262` selected +PR1042, with `kappa=1672188119205421/1000000000000000000` and complex exponent +0.001674989015937672328468. Its BIT exponent is unchanged. This package uses +the stated base and source pins. It does not change the selected construction. +A BIT improvement alone would not raise either selected kappa. + +[CLAIM.md](CLAIM.md) records the three candidate approaches, local claim, +prior negative results, and overlap review. The direct same-h word fails on +the orbit quotient. The one-block encoder fails on full-domain rank. A second +block gives a complete one-genuine-row escape, but its child bill fails. The +three-genuine-row extension removes that child-volume penalty algebraically; +the supplied encoder still fails the tape budget. This is why the result is +an enabling proof with scoped obstructions, not an installed supplier. + +PR521 supplies the native map. PR677 supplies restored DATA-shear contracts. +PR840 supplies the fused three-query word and its explicit unresolved ordinary +boundary. PR990 changes the private batching hypothesis but still uses the +same native map. Their source pins and notices are retained. The earlier +seven-map and eighth rank-one archive screens, PR955's fixed complex words, +PR720's abelian formal model, and PR836's complex unitary model are different +classes. This work does not repeat those searches or claim to supersede them. diff --git a/research/native-query-boundary/SOURCES.json b/research/native-query-boundary/SOURCES.json new file mode 100644 index 0000000000..c3eb3f0268 --- /dev/null +++ b/research/native-query-boundary/SOURCES.json @@ -0,0 +1,109 @@ +{ + "base": "abdc6a7002abdbcd9e21bfc5e1a795784deacfdf", + "sources": [ + { + "local": "vendor/pr840-proof.md", + "commit": "da2cd0dd2229e08b61b174a8835a2c2bb99d2230", + "path": "research/dyadic-query-pair/PROOF.md", + "author": "Wentao Li", + "sha256": "9a5ce93b866371189c797fbe8837c6a0bd22c5cf71ed84d60b9ae1c22a5ec83a", + "git_blob": "aaba3e501de1f761c783ec7f0dc9307ef45ab5d7", + "url": "https://github.com/CrocSwap/integer-mult-bounds/blob/da2cd0dd2229e08b61b174a8835a2c2bb99d2230/research/dyadic-query-pair/PROOF.md" + }, + { + "local": "vendor/pr840-program.py", + "commit": "da2cd0dd2229e08b61b174a8835a2c2bb99d2230", + "path": "research/dyadic-query-pair/program.py", + "author": "Wentao Li", + "sha256": "9398e9f0f1cfe53e8e586f2f63920c0342df54bc47f7f1156cc977f54ba0e11c", + "git_blob": "7db5972e269268d7f3bad7be61fe92dbd1ce88bc", + "url": "https://github.com/CrocSwap/integer-mult-bounds/blob/da2cd0dd2229e08b61b174a8835a2c2bb99d2230/research/dyadic-query-pair/program.py" + }, + { + "local": "vendor/pr840-notice.md", + "commit": "da2cd0dd2229e08b61b174a8835a2c2bb99d2230", + "path": "research/dyadic-query-pair/NOTICE.md", + "author": "Wentao Li", + "sha256": "7fe86c785bc9862577ee1cc359096bc8c2606c1d70c357a46339eee28c89643e", + "git_blob": "d58769de46f8580697b2d079bc7368789101ee21", + "url": "https://github.com/CrocSwap/integer-mult-bounds/blob/da2cd0dd2229e08b61b174a8835a2c2bb99d2230/research/dyadic-query-pair/NOTICE.md" + }, + { + "local": "vendor/pr521-proof.md", + "commit": "a190fdb39f31647fc6f651625353710624627348", + "path": "research/native-unipotent-fusion/PROOF.md", + "author": "Karl Appel / applecrusher", + "sha256": "320ce5529c1543f9e6fceb9e7f8b563ed332f13923229e38d4e7edac98f30283", + "git_blob": "c3f67fc807aa3bf32ba559d51ea0b7e7a424229d", + "url": "https://github.com/CrocSwap/integer-mult-bounds/blob/a190fdb39f31647fc6f651625353710624627348/research/native-unipotent-fusion/PROOF.md" + }, + { + "local": "vendor/pr677-proof.md", + "commit": "613c02b8b4411f991f108dcc1481b3f9100b996f", + "path": "research/native-fusion-restored-shear/PROOF.md", + "author": "commdata2338", + "sha256": "4f281eb48b9662c03269717b3919b45b27f7c2655abb185249a1eea2a03af186", + "git_blob": "47d9bf59a3e0d85bcc4930cd76a3d21a1e43c2fc", + "url": "https://github.com/CrocSwap/integer-mult-bounds/blob/613c02b8b4411f991f108dcc1481b3f9100b996f/research/native-fusion-restored-shear/PROOF.md" + }, + { + "local": "vendor/pr990-readme.md", + "commit": "1c3ddf6bbbe1d8f0227de6726bb8273b2cb03711", + "path": "research/native-shear-batch/README.md", + "author": "Sagar Thakrar / thakrarsagar", + "sha256": "4bd73deef6840cf01aeb65d1c79ff693d087e43ae0cde4379edfc9d988a8c38b", + "git_blob": "5b77631c5f3633d9a5e33142b12e22dcb7600281", + "url": "https://github.com/CrocSwap/integer-mult-bounds/blob/1c3ddf6bbbe1d8f0227de6726bb8273b2cb03711/research/native-shear-batch/README.md" + }, + { + "local": "vendor/upstream-swap.tex", + "commit": "abdc6a7002abdbcd9e21bfc5e1a795784deacfdf", + "path": "upstream/build/sections/04-swap.tex", + "author": "OpenAI #109 and repository contributors", + "sha256": "412b170ccaab38dba96e95e3cbfae09f4876a9818f8d278776a746b0f8044906", + "git_blob": "951e792b1768e6509561380b8bbfb1d1ccb64c08", + "url": "https://github.com/CrocSwap/integer-mult-bounds/blob/abdc6a7002abdbcd9e21bfc5e1a795784deacfdf/upstream/build/sections/04-swap.tex" + }, + { + "local": "vendor/selected-result.json", + "commit": "abdc6a7002abdbcd9e21bfc5e1a795784deacfdf", + "path": "certificates/selected-result.json", + "author": "Repository maintainers and credited contributors", + "sha256": "1d35283cb0ce3f8db1f285683933517f9e87475d295e2b6316399ad9928c81c3", + "git_blob": "3d7529d77a5f22d8c6f64f98bd5a0e71b8eee892", + "url": "https://github.com/CrocSwap/integer-mult-bounds/blob/abdc6a7002abdbcd9e21bfc5e1a795784deacfdf/certificates/selected-result.json" + }, + { + "local": "vendor/pr677-notice.md", + "commit": "613c02b8b4411f991f108dcc1481b3f9100b996f", + "path": "research/native-fusion-restored-shear/NOTICE.md", + "author": "commdata2338", + "sha256": "d79071e9dda5edc60305f80910572c1a61daf0b4601f5673b5ff874a6d487742", + "git_blob": "bbd90a76bb1f3c55393367e24afd9970b796dba2", + "url": "https://github.com/CrocSwap/integer-mult-bounds/blob/613c02b8b4411f991f108dcc1481b3f9100b996f/research/native-fusion-restored-shear/NOTICE.md" + }, + { + "local": "vendor/pr990-notice.md", + "commit": "1c3ddf6bbbe1d8f0227de6726bb8273b2cb03711", + "path": "research/native-shear-batch/NOTICE.md", + "author": "Sagar Thakrar / thakrarsagar", + "sha256": "4e29d55e3db2688f6169b2fcd136fac2e0287da1b76763631491c1a933a7e628", + "git_blob": "8d954efe1daf39f9395d61e7c3d1fce99f514afc", + "url": "https://github.com/CrocSwap/integer-mult-bounds/blob/1c3ddf6bbbe1d8f0227de6726bb8273b2cb03711/research/native-shear-batch/NOTICE.md" + }, + { + "local": "vendor/upstream-LICENSE", + "commit": "abdc6a7002abdbcd9e21bfc5e1a795784deacfdf", + "path": "upstream/LICENSE", + "author": "OpenAI #109 and repository contributors", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64", + "url": "https://github.com/CrocSwap/integer-mult-bounds/blob/abdc6a7002abdbcd9e21bfc5e1a795784deacfdf/upstream/LICENSE" + } + ], + "context_only": { + "pr955": "df668be6f75e76e12d25da5e03eb22ff656aaf86", + "pr720": "a942c0ae1b463710ca535c1fba1b07b6431b5a86", + "pr836": "7ae9124f59694bb1e5acf2ae99c65e63c115b2f4" + } +} diff --git a/research/native-query-boundary/VALIDATION.md b/research/native-query-boundary/VALIDATION.md new file mode 100644 index 0000000000..acc9924734 --- /dev/null +++ b/research/native-query-boundary/VALIDATION.md @@ -0,0 +1,109 @@ +# Validation record + +Environment: macOS, Python 3.14.7, one CPU thread. No solver, external Python +package, predecessor import or network call is used by the checker. The +package copies its required source files. All Python checks use explicit +exceptions, so Python optimization does not remove the checks. + +## Test value and scope + +The test-audit authoring gate was applied before this checker was added. +Each check has an independent mathematical or package contract: + +| Check owner | Contract | Failure detected | +|---|---|---| +| Full six-field census | Native orbits and ordinary endpoint on all addresses | Wrong push direction, lost short orbit, wrong fixed-address count | +| Separate reduced census | Closed orbit formula over prime powers | A prime-only formula used for a composite power | +| Rational lowering | Seven literal events equal the pinned native matrix | Wrong coefficient, event order or ADDRESS child | +| Complete symbolic VALUE execution | Actual DATA and all arbitrary dirty helper outputs | A correct rank comparison with an incorrect word or encoder | +| Literal inverse execution | Exact restoration through reverse execution | An incorrect affine inverse or decode order | +| Two-fiber execution | Every child retains every spectator address | Correct first fiber but an omitted second fiber | +| Complementary small blocks | Algebraic factors have full required rank, zero product and correct sum | A one-dimensional or singular core | +| Package command | Copied, isolated, optimized replay uses the complete exact receipt | Hidden imports, changed source bytes or identity, wrong child volume, Boolean/integer coercion | + +The full VALUE execution checks each input bit as an independent binary +column. It covers all VALUE assignments by linearity. It does not enumerate +those assignments. The two-fiber execution adds a real spectator dimension; +it is not a multiplication of a scalar count. The package command adds a +separate distribution and receipt contract. No production API or test-only +injection hook was added to support these tests. + +The primary endpoint owner rejects four modified literal words: omit an +ordinary child, omit a full-row XOR, omit a final decoder transfer, and corrupt +a dirty helper. The spectator check rejects a child restricted to its first +fiber. Separate scope controls use an actual two-cycle, a nonunit power at +m=9, and the wrong full-order-only orbit count. These checks do not establish +statements outside the written theorem's hypotheses. + +## Commands + +Run the standalone exact replay from the repository root: + +```sh +python3 -I -O -B research/native-query-boundary/verify.py +``` + +Run the relocation and certificate rejection checks: + +```sh +python3 -I -O -B research/native-query-boundary/check_package.py +``` + +The package check creates one temporary directory, copies this package, and +runs from outside the copied directory. It first requires a valid optimized +replay. It then requires the correct rejection guard for each mutation. It +restores copied inputs between cases and removes only its own temporary files. +The source checkout is not changed. + +Expected markers: + +```text +PASS_NATIVE_QUERY_BOUNDARY full_addresses=665444 prime_power_cases=13 dirty_columns=2187 escape_children=6 no_new_kappa +PASS_NATIVE_QUERY_PACKAGE relocated_optimized_replay changed_pinned_source_rejected changed_source_identity_rejected child_volume_rejected boolean_count_rejected +``` + +The certificate was emitted from a normal isolated Python run. The committed +certificate is then checked without emission by optimized Python. All source +copies have exact byte hashes and Git blob pins in SOURCES.json. The receipt +binds the complete source manifest by SHA-256. Thus a changed source identity +is rejected even when the copied bytes stay unchanged. + +## Evidence limits + +The written proof covers all odd prime powers, all spectator volumes, the +stated conjugacy class, and the constructive two-block theorem. Finite +execution covers only the listed domains. Large three-genuine-row encoders +are not instantiated. The small direct-sum templates check their exact +algebra and dimensions; they are not a large-domain tape replay. + +The literal program is an exact binary VALUE execution. Its complete-scan +bit-transfer implementation is described and priced in the proof. It is not +a benchmark of a Turing machine, a fast encoder, or an admitted recursive +supplier. No practical multiplication performance was measured. + +The selected-record gate checks the selected frozen files at the base. It is +not the selected construction's cold replay. No selected artifact or existing +code is changed, so this contribution does not regenerate that construction. +The full repository `make verify` and selected cold replay were not run for +this isolated package. Their scope includes unrelated large regenerations. + +## Recorded results + +On 2026-10-13, the normal isolated receipt emission passed. The first frozen +optimized comparison then rejected the receipt. The cause was JSON key +normalization: internal integer orbit lengths became string keys on loading, +and the two key types had different sort orders. The two receipt histogram +fields now use JSON string keys at their output boundary. The optimized +relocated replay and all rejection controls then passed. The final rerun +also binds the complete source identity manifest. + +`make selected-record-check` passed at the exact base in the complete lane01 +checkout. Its marker was: + +```text +PASS selected record, exact kappa, original source inventory and proof supplement: 1661960547713947/1000000000000000000 +``` + +No mathematical check was bypassed after a failure. No failed receipt was +changed to record success. The final certificate was generated from the +checker and then checked through the normal command. diff --git a/research/native-query-boundary/check_package.py b/research/native-query-boundary/check_package.py new file mode 100644 index 0000000000..d36e809eac --- /dev/null +++ b/research/native-query-boundary/check_package.py @@ -0,0 +1,72 @@ +"""Check the standalone receipt interface in a new directory with no Git data.""" +from pathlib import Path +from tempfile import TemporaryDirectory +import json +import shutil +import subprocess +import sys + +ROOT = Path(__file__).resolve().parent + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def run(package, cwd): + return subprocess.run([sys.executable, "-I", "-O", "-B", str(package / "verify.py")], + cwd=cwd, capture_output=True, text=True, check=False) + + +def main(): + checked = [] + with TemporaryDirectory(prefix="native boundary package ") as folder: + base = Path(folder) + package = base / "copied package" + shutil.copytree(ROOT, package) + result = run(package, base) + require(result.returncode == 0 and result.stdout.startswith("PASS_NATIVE_QUERY_BOUNDARY "), + "standalone optimized replay failed: " + result.stderr) + checked.append("relocated_optimized_replay") + + source = package / "vendor/pr840-proof.md" + original_source = source.read_bytes() + source.write_bytes(original_source + b"\nChanged source.\n") + result = run(package, base) + require(result.returncode != 0 and "source hash: vendor/pr840-proof.md" in result.stderr, + "changed pinned source was not rejected by its hash guard") + source.write_bytes(original_source) + checked.append("changed_pinned_source_rejected") + + manifest = package / "SOURCES.json" + original_manifest = manifest.read_bytes() + changed = json.loads(original_manifest) + changed["sources"][0]["commit"] = "0" * 40 + manifest.write_text(json.dumps(changed)) + result = run(package, base) + require(result.returncode != 0 + and "certificate does not match exact replay" in result.stderr, + "changed source identity was not rejected by the receipt") + manifest.write_bytes(original_manifest) + checked.append("changed_source_identity_rejected") + + certificate = package / "CERTIFICATE.json" + original_certificate = certificate.read_bytes() + mutations = (("child_volume_rejected", "child_volume_per_call", "V/3"), + ("boolean_count_rejected", "genuine_rows", True)) + for name, key, value in mutations: + changed = json.loads(original_certificate) + changed["two_block_escape"][key] = value + certificate.write_text(json.dumps(changed)) + result = run(package, base) + require(result.returncode != 0 + and "certificate does not match exact replay" in result.stderr, + "changed receipt was not rejected by exact replay: " + name) + checked.append(name) + certificate.write_bytes(original_certificate) + print("PASS_NATIVE_QUERY_PACKAGE " + " ".join(checked)) + + +if __name__ == "__main__": + main() diff --git a/research/native-query-boundary/vendor/pr521-proof.md b/research/native-query-boundary/vendor/pr521-proof.md new file mode 100644 index 0000000000..c3f67fc807 --- /dev/null +++ b/research/native-query-boundary/vendor/pr521-proof.md @@ -0,0 +1,183 @@ +# Exact local fusion and paid implementation + +The tape-operation premises come from the original +[ordered affine streams lemma](https://github.com/CrocSwap/integer-mult-bounds/blob/5996e33ecad6a0ccd578aec58831457829d75575/upstream/build/sections/02-streams.tex) +and [address interchange construction](https://github.com/CrocSwap/integer-mult-bounds/blob/5996e33ecad6a0ccd578aec58831457829d75575/upstream/build/sections/04-swap.tex) +of CrocSwap/integer-mult-bounds, pinned at the displayed revision. +The general rank-one lowering, selected unipotent operator and dirty +shared-chart fusion in this packet are a separate contribution. +Source pins distinguish that contribution from the borrowed tape contracts. + +## ADDRESS operator + +Use six physically ordered fields `(H0,H1,H2,D0,D1,D2)`, each of width +`b=N/3`. Each coordinate lies in the true residue ring `Z/(ell^b)`, where +ell is any odd prime. Unnamed ADDRESS fields may occur between or outside +these fields and remain spectators. Set + +``` +u = (1,0,1), t = (1,0,-1), t^T u = 0, +g = I3 + (1/2) u t^T, +g^-1 = I3 - (1/2) u t^T, +s = (u,-u), r = (t,-t), +Phi(g) = I6 + (1/4) s r^T. +``` + +The lift preserves H+D and applies g to H-D; H1 and D1 are fixed. +Since `(u t^T)^2=0`, the displayed inverse is exact. The map is not an +involution over the rationals or any odd residue ring. These are rational +ADDRESS operations specializing to residue rings, not signed arithmetic +on stored VALUE bits. + +The following chronological seven-event word equals Phi(g): + +``` +z2 <- z2-z0 +z3 <- z3+z0 +z5 <- (z5+5*z0-z2-z3)/4 +CHILD_C(0,5) +z2 <- z2+z0 +z3 <- z3-z0 +z5 <- -4*z5+3*z0+z2+z3 +``` + +Every affine control precedes its target. `CHILD_C(0,5)` is one ordinary +recursive interchange of the selected equal-width fields on the COMPLETE +private BIT stream; it preserves all other ADDRESS fields. It is a +contract invocation, not an implementation of the recursive supplier in +this packet. The affine operations use the original ordered-stream +contract, including its work tapes and head returns. Subject to those +contracts and their row/stack hypotheses, this is a fixed all-b local +implementation with six affine scans, one child and O(V) additional work. +There is no exponential array enumeration in the implementation. + +For completeness, the lowering formula is independently checked. For +`M=I+s v^T`, let `D=1+v^T s` and `a=s0*vlast`, both nonzero. Subtract +`(si/s0)z0` from each middle coordinate. Then set + +``` +zlast <- a*zlast+(D-slast*vlast)*z0+sum_middle s0*vi*zi, +swap(z0,zlast), +zi <- zi+(si/s0)*z0 for each middle coordinate, +zlast <- (-D/a)*zlast+((D-s0*v0)/a)*z0 + -sum_middle (vi/vlast)*zi. +``` + +Substitution gives M on every input coordinate. Here `v=r/4`, D=1 and +a=1/4, and only middle indices 2 and 3 need updates. Thus the formula +emits exactly the word above. The checker derives it afresh and verifies +its rational matrix. The literal reverse inverts each affine unit and +uses the same involutive child; its matrix is Phi(g^-1), not Phi(g). + +The denominators and affine diagonal numerators exclude only prime 2. +For example, a control coefficient vanishing modulo 5 does not make a +diagonal singular. This proves specialization for every odd ell and b, +including composite rings such as Z/25 and Z/49. Removing only the child +while retaining the affine wrappers changes the operator. + +## Exact comparison and native dirty chart + +Let `P=u*(1/2,0,1/2)` and `Q=u*(3/4,0,1/4)` denote outer products. +Both row pairings with u are 1, so P and Q are idempotents; Q need not be +orthogonal. Write `R_P=I-2P` and `R_Q=I-2Q`. Since PQ=Q, + +``` +R_P R_Q = I+2(Q-P) = g. +``` + +Chronologically apply Q first, then P. `PROGRAM.json` gives a separate +six-affine/one-child word for each lifted reflection. Their full matrix +product, including spectator coordinates, equals the fused word. + +For three genuine BIT DATA rows `(x1,x2,x3)` and retained private row q, +all with the same full ADDRESS domain, use this fixed chart: + +``` +q XOR= x2 +x1 XOR= q +h(q) # array permutation induced by Phi(h) +x1 XOR= q +q XOR= x2 +``` + +Write its complete linear BIT operator as H(h). Its endpoint on arbitrary +dirty inputs is + +``` +x1' = x1 XOR q XOR x2 XOR h(q) XOR h(x2), +q' = h(q) XOR x2 XOR h(x2), +x2' = x2, x3' = x3. +``` + +Equivalently, with `E=(e1+eq)(e2^T+eq^T)` over F2, E^2=E and +`H(h)=I+E tensor(h-I)`. Hence H(h2)H(h1)=H(h2 h1) for arbitrary arrays, +and in particular `H(R_P)H(R_Q)=H(g)`, including arbitrary initial q. +This proof does not assume a clean private row. There is no F9 codec, +padding promise or signed integer VALUE lift. + +The adjacent decoder and encoder in the specified two-reflection baseline +cancel exactly. That baseline already has FOUR XOR scans around its two +ADDRESS queries. The fused word also has four. The verified improvement +is two specified recursive children reduced to one; there is no separate +XOR saving. Twelve baseline affine events is its literal serialized +count before possible affine simplification. Neither affine nor child +optimality is claimed against other possible implementations. + +## Orientation, spectators and recovery controls + +For modulus m=ell^b and seed e_H0, the orbit is +`z_k=e_H0+(k/4)s`, indexed by Z/m. It has exactly m points because 1/4 +and a component of s are units. Phi(g) pushes address index k to k+1; +its array permutation reads old VALUE index k-1. The inverse reads k+1. +The reflection address maps are Q: `k -> -3-k` and P: `k -> -2-k`. +Their chronological composition pushes k to k+1, as required. + +The checker applies the actual words to these actual addresses at m=5, +25,7,49. It verifies all six ADDRESS basis columns and unchanged exterior +spectators, as well as H1/D1. On these orbits it checks all 4m dirty BIT +basis columns, 344 total, plus m VALUE spectator columns, 86 total. Each +dirty column agrees with the formula, the full two-stage word and the +chart-cancelled baseline; the literal inverse restores its input. +BIT linearity gives all assignments on each tested orbit, while the +algebraic operator identity above covers arbitrary arrays on the full +ADDRESS domain. Fixed points and their 16 four-role BIT assignments are +also checked. Replacing the WHOLE query by identity gives H(I)=I; +this differs from removing only the recursive child. + +At m=5 start with x2 a delta at index 0 and x1=x3=q=0. The forward module +gives `x1=q=[1,1,0,0,0]`. Its proper retained-q inverse restores all rows. +If q is wiped first, that inverse instead gives +`x1=[0,1,0,0,1]`, `q=[1,0,0,0,1]`: DATA is lost. Using g again as the +inverse also fails. These are explicit negative controls, not a claim +that private state can be reset between uses. + +## Paid state and limits + +Take V as the productive volume of the three genuine DATA streams. +Private q has full volume V/3, including all spectator ADDRESS ranges. +Persistent stock is 4V/3 before evaluator routing, parking, work-tape or +recursion scratch. Initially zeroing fresh q costs V/3. Each fused module +pays one separate child of actual volume V/3 and width N/3, six ordered +ADDRESS affine events, four native XOR scans, setup and head-return work. +The specified cancelled baseline pays two such children and the same +four XOR scans. Each actual separate child call must remain separately +charged in a future supplier recurrence. + +The component identity is valid with dirty q, but an enclosing DATA +construction starting from clean q must allocate and initialize it. +Its state is retained through every future use and recovery. A once-only +final wipe costs V/3 and is eligible only after a separately verified +completed DATA endpoint and the last read of q. This unfinished module +boundary does not license that wipe. No DATA row is cleared for free. + +The half-integral g is outside an odd-denominator mod-4 generator grammar; +the old rho4 construction is undefined on it. This does not invalidate +that construction on its own alphabet and cannot be priced by extending +it without a new proof. + +The packet supplies one exact local query fusion. It does not produce a +complete three-DATA cyclic-interchange c word, a complex C supplier, a +common cover/owner schedule or an all-size weighted-row compiler. Those +missing endpoints and schedules, both suppliers, all separate calls, +movement, dirty recovery and paid stock must be verified before deriving +an integer-multiplication exponent. No kappa improvement is asserted. diff --git a/research/native-query-boundary/vendor/pr677-notice.md b/research/native-query-boundary/vendor/pr677-notice.md new file mode 100644 index 0000000000..bbd90a76bb --- /dev/null +++ b/research/native-query-boundary/vendor/pr677-notice.md @@ -0,0 +1,39 @@ +# Attribution, license, and scope + +New prose and checker code in this packet are contributed under the +repository's Apache-2.0 license. The repository's LICENSE and NOTICE remain +unchanged. Submitted by @commdata2338. Prepared with substantial AI assistance: +OpenAI Codex (GPT-6-Astra) wrote the analysis, proof and checker, and +Claude Code (Claude Opus 5.5) packaged the submission. No independent +human peer review is claimed. + +- **Karl Appel / applecrusher, PR #521**, head + `a190fdb39f31647fc6f651625353710624627348`: the rank-one unipotent ADDRESS + map, its seven-event lowering, the reflected-query comparison, and the + dirty shared-chart operator. The ADDRESS word in PROGRAM.json is an + attributed transcription. The completed shear contracts, two-query + classification, cost comparison and fresh checker are this contribution. +- **OpenAI #109 / the imported upstream framework**: ordered-affine streams, + complete-range ordinary ADDRESS interchange, tape/stack and head-return + contracts. The two original sources at revision + `5996e33ecad6a0ccd578aec58831457829d75575` match the files in this base; + exact URLs and SHA-256 values are recorded in SOURCES.json. Their licenses + and repository notices are retained, and their interfaces remain premises. +- **eumemic, PR #288**, head + `475a088b5862f75f0b10596cfd6842d19531a5ec`, and **Ali Romman, PR #468**, + the in-tree `research/bit-three-register-lower-bound` package: the binary + scalar-projector/group-algebra model used for other interchange targets. + This packet credits that model and does not repeat the nine-call search. +- **Joseph Demarest, PR #83**, head + `183077b7b3ae12e96eb3a87c1dc08023e6494dca`: the scoped fixed-menu adaptive + recursion barrier, inspected when selecting this task. We do not claim + that rescheduling complete supplier profiles changes their best exponent. +- The selected #626/#622/#623 construction, #543 bit supplier, and cumulative + community authors retain their attribution. Their selected artifacts are + neither changed nor re-certified by this local note. + +No priority claim is made for the elementary compute/uncompute identities, +matrix determinant lemma, or Laurent-polynomial methods. The useful output +is the pinned component's explicit restored-boundary alternatives, their +precise model restrictions and paid recurrence, and exact reproducible +evidence for review. diff --git a/research/native-query-boundary/vendor/pr677-proof.md b/research/native-query-boundary/vendor/pr677-proof.md new file mode 100644 index 0000000000..47d9bf59a3 --- /dev/null +++ b/research/native-query-boundary/vendor/pr677-proof.md @@ -0,0 +1,383 @@ +# Restored boundaries for one native unipotent BIT query + +This is a local interface result, conditional on the cited ordinary ADDRESS +interchange and ordered-stream primitives. It supplies no complete interchange +supplier and no multiplication exponent. The algebra below proves the stated +identities and scoped query bounds; the finite checker is corroboration, not a +formal proof of a full multiplication theorem. + +## 1. Object, predecessor, and boundary contracts + +Karl Appel / applecrusher's [PR #521](https://github.com/CrocSwap/integer-mult-bounds/pull/521), +pinned at `a190fdb39f31647fc6f651625353710624627348`, replaces two particular +reflected queries by one unipotent query. Its complete dirty operator retains +a private BIT row. It explicitly does not complete a DATA interchange or +authorize erasure of that row at an unfinished boundary. Its result is not +contradicted here. + +We choose a different, modest completed endpoint. For three genuine DATA rows +`(x,y,z)` and one fixed ADDRESS permutation `h`, let + + S_h(x,y,z) = (x + (h+I)y, y, z). (1) + +All VALUE additions in this note are XOR, over F2. ADDRESS arithmetic below +is rational arithmetic specialized to odd prime-power residue rings; these +two coefficient systems must not be conflated. Equation (1) is a shear, +not the three-DATA interchange. It satisfies `S_h^2 = I`, even though +`h^2 != I`. + +The contribution is an explicit comparison of three ways to complete (1): + +| Contract | Queries `h` or `h^-1` | Additional full row | Endpoint for that row | +|---|---:|---:|---| +| Query the DATA target | 2 | none | All other dirty rows untouched | +| Queries remain on one private row, with triangular source/target XORs | 4 | one | Arbitrary initial private contents restored | +| Caller owns disposable private storage | 1 | one | Explicit copy initialization and final zeroing | + +The first count is optimal in the fixed-`h` query/XOR model of section 4. +The second is optimal in the narrower private-row model of section 5 for +a uniform all-width program. These are **not** lower bounds for arbitrary +ordinary-interchange programs with different free ADDRESS operations. +The third changes the workspace contract: discarding someone else's dirty +row is not allowed. Its successful DATA endpoint makes its *own* final clear +legitimate. It is not evidence that clearing PR #521's private row is safe +inside an arbitrary surrounding construction. + +## 2. The retained query, with its actual recursive child + +Fix an odd prime `ell`, `b >= 1`, and `m = ell^b`. Use six ordered ADDRESS +fields `(H0,H1,H2,D0,D1,D2)`, all of width `b`, and all complete spectator +ranges. Define + + s = (1,0,1,-1,0,-1)^T, + r = (1,0,-1,-1,0,1)^T, + M = I6 + s r^T / 4, M^-1 = I6 - s r^T / 4. + +Here `r^T s = 0`. The permutation `h` moves the BIT at ADDRESS `a` to `M a`; +its action on values reads the inverse ADDRESS image. PR #521's literal +lowering, transcribed in `PROGRAM.json`, is + + a2 -= a0 + a3 += a0 + a5 = (a5 + 5*a0 - a2 - a3)/4 + CHILD_C(a0,a5) + a2 += a0 + a3 -= a0 + a5 = -4*a5 + 3*a0 + a2 + a3. (2) + +Substitution gives `M`. Reversing (2) and inverting each scalar event gives +`M^-1`. The child is an ordinary interchange of two `b`-digit ADDRESS fields +on the **entire selected BIT row**, including all other ADDRESS fields. +It is not a pointwise VALUE swap or an uncharged oracle. + +All six affine events read only earlier fields. Their diagonal numerators +and denominators are powers of two up to sign; denominators of controls are +also powers of two. Thus every event is well defined for every odd `ell`. +The cited ordered-stream lemma pays the finite coefficient preparation, +counter work, complete spectator scans, temporary work and head returns. +It does not assume unit-cost arithmetic on growing integers. + +The same implementation works on a DATA row or a private row: the ADDRESS +primitive's contract is for arbitrary BIT contents and is insensitive to +the role's name. Calls must be sequential and have exclusive access to the +queried row until its completed boundary. No source chart or current supplier +schedule is asserted to provide that permission automatically. + +For `a0 = e_H0`, the addresses `a_k = e_H0 + k*s/4`, `k in Z/m`, are distinct +and satisfy `M a_k = a_(k+1)`. Hence on their VALUE array, `(h y)_k = y_(k-1)`. +This supplies a nontrivial orbit of order `m`, as well as a direct finite +check on push/read orientation. There are also fixed points and shorter +orbits at nonunit initial scales; these are included in the replay. + +## 3. Three complete programs + +### 3.1 No full private row + +Apply, chronologically, + + x <- h^-1 x + x += y + x <- h x + x += y. (3) + +The output is `x + h y + y`; `y,z` and every unrelated row are untouched. +No row is assumed zero, copied, or erased. A pre-existing private row is +an untouched spectator. Source `y` is never modified, even temporarily. +The queried target may be permuted temporarily, so callers may not inspect +it between events. This is a restored boundary, not a concurrently readable +intermediate representation. + +### 3.2 Queries only on a restored dirty private row + +For arbitrary initial `q=q0`, use + + q += y + q <- h q + x += q + q <- h^-1 q + q += y + q <- h q + x += q + q <- h^-1 q + x += y. (4) + +The two contributions read into `x` are `h(q0+y)` and `h q0`. Their sum is +`h y`. The last XOR supplies `y`; both query/inverse pairs restore their +own input, and the two source XORs restore `q0`. Thus (4) implements (1) +on DATA and the identity on arbitrary private input. It has four queries +and five XORs, not four queries plus an implicit cleanup. + +### 3.3 An owned, disposable private row + +Allocate or reserve one owned full row `q`, whose incoming contents may be +discarded, and use + + q <- copy(y) + x += y + q <- h q + x += q + q <- 0. (5) + +The copy overwrites every private cell and pays source access and +initialization in one scan. Just before the last line, DATA already equals +(1), and `q=h y` is redundant with retained `y`. No later step reads `q`. +The final full-row clear therefore returns owned work storage to zero. +All five events are charged. There is no assumption that unknown dirty +caller state can be thrown away. + +Reapplying the *completed* program (5) implements `S_h^2=I` on DATA. This is +different from applying the inverse of PR #521's unfinished dirty module +after clearing its private row; that inverse generally fails. Both facts +are checked, including arbitrary DATA inputs and explicit private-input +rejection when (5) is falsely labeled a dirty-restoring program. + +The normal form of PR #521's dirty module is +`H(h)=I+E(h-I)`, `E=(e_x+e_q)(e_y+e_q)^T`. It directly explains the +tradeoff: for initial `q=0`, its DATA output is already (1), but its private +output is `(h+I)y`. Once (1) is declared and verified as the desired complete +endpoint, terminal operations needed solely for later dirty-module recovery +can be removed. Program (5) is the simpler paid copy implementation of that +completed endpoint. It changes neither the predecessor's two-reflection +identity nor its warning about other unfinished endpoints. + +## 4. Sharp two-query classification with arbitrary dirty spectators + +The model permits any number `d >= 2` of arbitrary dirty rows. Free algebraic +operations are invertible, address-independent XOR maps of the row roles; +actual implementations still pay for these scans. A query applies `h` or +`h^-1` to one row. No other nontrivial ADDRESS map, copying into clean storage, +or erasure is free in this lower-bound model. + +Represent `h` by `t`. Work over `F2[t,t^-1]`, or over +`F2[t,t^-1]/(t^m-1)` for an odd orbit length `m >= 3`. In the latter ring, +zero divisors cause no problem: the proof uses determinants and comparison +of distinct basis coefficients, not division or a fraction field. + +On an `m`-cycle, identify a BIT row with `sum_k value_k t^k`. The query is +multiplication by `t` on the regular module of the cyclic ring. Thus equality +of these row operators is equivalent to entrywise equality of their matrices +over that ring. The determinant below is taken **in this ring**, not the +ordinary F2 determinant of the expanded bit matrix. Restricting a complete +array to the full-order orbit in section 2 gives a necessary condition for +any claimed full-array identity. + +After conjugation by an invertible binary row map, one query is + + D_P(t^e) = I + (t^e-1) P, e in {+1,-1}, + P = u v^T, v^T u = 1. (6) + +These are precisely binary rank-one idempotents. Any arbitrary interleaving +of free XOR maps normalizes to a product of such factors: commute the +constant maps to the left, conjugating each projector as they pass. +At `t=1`, the desired endpoint is `I`, so the remaining constant factor +must be `I`. Thus allowing arbitrary endpoint XOR maps does not omit a +one-query or two-query solution from this model. + +Let `N=a b^T` be a nonzero rank-one nilpotent, `b^T a=0`; the desired shear is + + T_N(t) = I + (t-1) N. (7) + +The determinant lemma, valid over each stated commutative ring, gives +`det D_P(t^e)=t^e` and `det T_N(t)=1`. Zero queries cannot give the nonconstant +(7). One query has the wrong determinant. Two queries of the same sign also +have the wrong determinant, since `t^2 != 1` on an odd orbit of length at +least three. Therefore any two-query solution has opposite signs. + +For left sign `+1`, expand the product *in operator order*: + + D_P(t) D_Q(t^-1) + = I+P+Q + t(P+PQ) + t^-1(Q+PQ). (8) + +The coefficients of `1,t,t^-1` are independent in either ring, so (8) +equals (7) **if and only if** + + PQ=Q, P+Q=N. (9) + +For the other sign order the exact conditions are + + PQ=P, P+Q=N. (10) + +This is an exhaustive classification, not just a necessary filter. In (9), +the two rank-one images coincide and equal the image of `N`. Consequently + + P=a c^T, Q=a(c+b)^T, c^T a=1. (11) + +In (10), the two row spaces coincide and equal the row space of `N`, giving + + P=(c+a)b^T, Q=c b^T, b^T c=1. (12) + +Conversely, (11) or (12) directly verifies the corresponding conditions. +Over F2 there is no nontrivial scalar rescaling of a rank-one decomposition. +Each family has `2^(d-1)` choices, so every nonzero rank-one nilpotent target +has exactly `2^d` ordered, signed two-query factorizations. Program (3) +realizes one of them for `N=e_x e_y^T`, proving the two-query minimum. + +For any private index `q` distinct from `x,y`, all these factorizations have +`P_qq=Q_qq=0`: in (11) the image is `e_x`, and in (12) the row space is +`e_y^T`. This observation separates the unrestricted dirty-row model from +the private-only contract below. + +The scalar-projector/group-algebra method is established predecessor work: +eumemic's PR #288 and Ali Romman's in-tree `bit-three-register-lower-bound` +package (PR #468) use it for different diagonal interchange targets. We do +not claim that method as new. The present two-query classification targets +one off-diagonal restored shear and includes finite cyclic rings explicitly. + +## 5. Why the private-only dirty boundary costs four queries + +Here queries are restricted to `q`; the allowed pointwise gates are +`q += y`, `x += q`, and `x += y`. Source `y` and spectator rows remain +unchanged. A free-gate prefix has the triangular form + + K(x,y,q) = (x + a q + b y, y, q + c y). + +Both `K` and `K^-1` have `qq` entry one. A normalized query projector +`K^-1 e_q e_q^T K` therefore has `P_qq=1`. Section 4 shows that no +two-query factorization of (1) can have that property. A one-query program +is already excluded. A three-query program has determinant `t^j` for +`j in {-3,-1,1,3}`, so cannot have determinant one in the Laurent model, +or on an odd orbit of length at least five. Thus a uniform all-width +program needs at least four queries. Program (4) attains four. + +This proof does not assert a separate three-query exclusion for one isolated +order-three quotient from the determinant alone. The formal finite-word +check below is over Laurent coefficients, not modulo three. The uniform +claim has no gap: for example the actual order-eleven orbit already gives +the stated lower bound, and the program must work at that width too. + +Arbitrary XOR maps that swap a DATA role with `q`, arbitrary alternate +ADDRESS maps, non-restored private state, and clean/disposable storage are +outside this private-only restriction. Removing any of those restrictions +requires a new analysis; program (3) deliberately changes the first one. + +## 6. Complete typed costs and workspace + +Let each genuine DATA row have logical BIT volume `U`, including the full +ADDRESS domain and all spectators. Productive volume is `V=3U`, and nominal +chunk width is `N=3b`. Let: + +- `C(U,b)` be the cost of one ordinary interchange of the selected two + `b`-digit fields on a complete row of volume `U`, with restored child work; +- `A(U,b)` bound each fixed ordered-affine event of (2), including coefficient + preparation, its source access, temporary work, and head returns; +- `X(U)`, `P(U)`, and `Z(U)` bound one aligned XOR, full copy, and full clear; +- `R_j(V,b)` include row split/merge, routing to the fixed evaluator tapes, + descriptor setup, parking and recovery, allocation if needed, and head + returns not already charged in a primitive. Each `R_j=O(V)` under the + inherited complete-range, fixed-number-of-rows, and stack contract. + +The complete local recurrences/charges are + + S_data(V,3b) <= 2 C(U,b) + 12 A(U,b) + 2 X(U) + R_data(V,b), + S_dirty(V,3b) <= 4 C(U,b) + 24 A(U,b) + 5 X(U) + R_dirty(V,b), + S_owned(V,3b) <= C(U,b) + 6 A(U,b) + 2 X(U) + + P(U) + Z(U) + R_owned(V,b). (13) + +Every query is lowered using (2), so there are exactly 2, 4, and 1 ordinary +recursive children respectively, all of actual volume `V/3` and width `N/3`. +There is no dropped recovery child, additional live query, or implicit +source-copy oracle. All children run sequentially and reuse restored child +workspace. Primitive affine work may itself use temporary streams; those +are covered by `A`, not claimed absent by the phrase "no private row." + +Under the cited streaming contracts, the non-child terms of (13) are `O(V)`. +If `c(b)` uniformly bounds `C(U,b)/U`, then + + s_data(3b) <= (2/3)c(b) + O(1), + s_dirty(3b) <= (4/3)c(b) + O(1), + s_owned(3b) <= (1/3)c(b) + O(1). (14) + +The constants are independent of `b,U`, for a fixed permitted radix and +the fixed literal program. Fractions count the **actual child stream +volumes**, not the persistent stock. Persistent role storage is `V` for +(3), and `4V/3` for (4) and (5), before primitive/evaluator/recursive scratch. +For peak workspace, let `B_j(V,b)` include the fixed streaming and parking +workspace and `W_C(U,b)` child workspace. A safe bound is + + W_j(V,3b) <= persistent_j(V) + B_j(V,b) + W_C(U,b), + persistent_data=V, persistent_dirty=persistent_owned=4V/3. + +`B_j=O(V)` under the same tape primitives; the bound pays their temporary +streams and does not claim an exact number of physical tapes or total cells. +Private-row allocation is not normalized away. In the owned case the initial +copy and final clear are charged on every invocation, even if a later caller +could establish safe reuse. + +These are **typed** recurrences: the left side is a DATA shear and `C` is +ordinary ADDRESS interchange. Substituting `S_data` for `C` and solving a +self-recursion would be circular without a separate compiler. No such +compiler, arbitrary-width padding, common-frame schedule, or assembled +supplier is provided. For `N` not divisible by three this packet specifies +no reduction. The old all-size, row/stack, precision and analytic assumptions +are not discharged. In particular none of (13) or (14) is a new κ certificate. + +## 7. Reproducible evidence and exact limits + +`check.py --check` uses only Python's standard library and this directory. +It does not import the predecessor's checker or any supplier implementation. + +1. Enumerate all binary matrices at dimensions 2, 3 and 4; select rank-one + idempotents by independent rank and square tests; compare against the + outer-product catalogue. The sizes are 6, 28 and 120. +2. Multiply all **60,880 ordered signed pairs** as matrix Laurent polynomials. + Check (9)/(10) against the literal polynomial result for every pair and + every nonzero rank-one nilpotent target encountered. Every target has + `2^d` factorizations; none for a DATA coordinate shear has both private + diagonals one. +3. Exhaust all four native triangular charts + `(e_q+a e_x)(e_q+b e_y)^T`, `a,b in F2`, with both query signs, through + length four. The full **4,681-word** domain is completed: counts of + successes by length are `0,0,0,0,24`. This is a finite corroboration of + the specified model, not a search over arbitrary circuits or frames. +4. Verify (2) and its inverse on all rational ADDRESS basis columns and + modulo `3,9,27,11,121`, including two additional ADDRESS spectators. + Check full and shorter orbits from nonunit initial scales, plus fixed + points. These rings differ from PR #521's `5,25,7,49` replay. +5. Propagate all independent BIT basis columns simultaneously as distinct + integer bits, so every XOR-column cancellation is exact. Check all three + literal programs, their completed DATA involution, and the separate + owned-versus-dirty workspace contracts. No VALUE assignment is sampled. +6. Reject omissions of every recursive query, a wrong inverse, missing XORs, + missing owned initialization or clear, unpaid ADDRESS children, and the + false inference that owned clearing restores arbitrary dirty state. + A concrete order-two, same-sign factorization rejects extending the + opposite-sign classification to a domain where `t=t^-1`. + +The separate `full_domain_check.py` imports no main-checker code. It applies +the literal ADDRESS program to all **729 addresses in `(Z/3)^6`**, including +all 243 fixed addresses, and compares a separately written coordinate +formula. It then tracks individual sparse sets of nonzero BIT positions, +rather than packed symbolic columns, for **2,916 independent inputs per +program**. This covers every row and every address, not just a selected +orbit. Endpoints and completed inverses give **17,496 cases** across the +three programs. The private input is discarded only in the explicitly +owned-storage contract. This second finite method is included in the +single reproduction command. + +Assignment seed 57 selects candidate `57 mod 3 = 0` in `CLAIM.md`. The +algebraic domains and stopping rule above were fixed before implementing +the verifier; there is no random search whose losing trials are omitted. +The source pins and original attribution are in `SOURCES.json` and +`NOTICE.md`. `EXPECTED.json` records deterministic finite evidence. The +universal proof in sections 3–5 is a written argument open to review; +neither the exhaustive small-dimensional checks nor a PASS string replace it. diff --git a/research/native-query-boundary/vendor/pr840-notice.md b/research/native-query-boundary/vendor/pr840-notice.md new file mode 100644 index 0000000000..d58769de46 --- /dev/null +++ b/research/native-query-boundary/vendor/pr840-notice.md @@ -0,0 +1,52 @@ +# Attribution, license and scope + +New compiler, checker, proof, certificate and documentation prepared for +**Wentao Li**, with substantial **OpenAI Codex (GPT-6.1 Sol) assistance** in +analysis, derivation, implementation, testing and writing. Contributor profiles: +[GitHub: VictorLiwentao](https://github.com/VictorLiwentao) and +[X: @Is__Victor](https://x.com/Is__Victor). Apache-2.0; the repository license +is copied unchanged to LICENSE. No sub-agents, independent human peer review, +proof-assistant verification or literature-priority claim. + +- **Karl Appel / applecrusher, PR521**, exact head + `a190fdb39f31647fc6f651625353710624627348`: native rank-one unipotent ADDRESS + map, one-child ordered lowering at k=1, shared-chart comparison and stated + tape premises. His proof and source-pin record are retained unchanged. +- **commdata2338, PR677**, exact head + `613c02b8b4411f991f108dcc1481b3f9100b996f`: completed first-difference DATA + shear, DATA-target querying permission, two-query model/classification, + private-storage distinctions and typed costs. The original proof and full + notice remain unchanged in vendor/. That notice retains the disclosed + OpenAI Codex / Claude Code assistance and predecessor attribution. Its + two-query first-difference theorem is preserved. +- **OpenAI, Integer multiplication below n log n, September 23, 2026**: + ordered affine streams, ordinary equal-width ADDRESS interchange, + complete spectators, tape/stack and head-return contracts. The two full + source sections and their Apache-2.0 license are copied byte for byte from + CrocSwap/integer-mult-bounds revision + `5996e33ecad6a0ccd578aec58831457829d75575`. Their source identity and the + imported framework maintained by **Douglas Colkitt** remain credited. +- The binary projector / group-algebra lineage is credited through PR677's + retained notice to **eumemic (PR288)** and **Ali Romman (PR468)**. No code + or nine-call search from those packages is imported here. +- Concurrent dirty/clean echo work by **FanPUYen, Sagar Thakrar, Ali Romman, + Koroffstrogov, Alexander Schwartzman and nightangelflowerwin-ops** was + inspected to avoid overlap. It is context, not a dependency. PR481's + Gaussian boundary batching by **Chafik Boukhalfa / chafreaky** was also + inspected and supplies no code or analytic claim here. +- Later context checks read **Jeremy Diviney / PR800** (formal Clifford + path valuations), **shhxera / PR822** (dirty connector reuse) and + **Paul Chan / PR829** (two clean checkpoints). Those objects and query/ + storage alphabets differ from this centered native ADDRESS shear. No + code, certificate or theorem from these three PRs is consumed. +- PR741 at the task base and the refreshed PR799 construction retain + their existing repository attribution. Their certificates, suppliers and + inherited conditions are not changed or re-certified by this local result. + +This package adds the dyadic lowering extension, fusion of the completed +centered shear pair, precise three-query bound and new finite evidence relative +to the pinned repository context. Elementary compute/uncompute, determinant +and Laurent methods are not claimed as new literature discoveries. PR756 and +PR805 are explicitly excluded from the consumed construction and verification. +This is not an official OpenAI release or endorsement. Exact source hashes and +inspected context heads are in SOURCES.json. diff --git a/research/native-query-boundary/vendor/pr840-program.py b/research/native-query-boundary/vendor/pr840-program.py new file mode 100644 index 0000000000..7db5972e26 --- /dev/null +++ b/research/native-query-boundary/vendor/pr840-program.py @@ -0,0 +1,131 @@ +"""Literal native BIT query-pair compiler; all VALUE additions are XOR. + +ADDRESS scalings use exact rationals, specialized only to odd residue rings. +The child event denotes one full-row ordinary ADDRESS interchange. This +reference compiler does not implement or time the inherited tape primitive. +""" +from fractions import Fraction + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def power(j, sign=1): + require(type(j) is int and j >= 0, "nonnegative integer dyadic index") + require(type(sign) is int and sign in (-1, 1), "integer sign") + return sign * (1 << j) + + +def address_word(k): + """Seven events for M(k)=I+(k/4)s r^T; k is a signed power of two.""" + require(type(k) is int and k != 0 and abs(k) & (abs(k) - 1) == 0, + "nonzero signed dyadic power") + a = Fraction(k, 4) + return ( + ("affine", 2, Fraction(1), ((0, Fraction(-1)),)), + ("affine", 3, Fraction(1), ((0, Fraction(1)),)), + ("affine", 5, a, ((0, 1 + a), (2, -a), (3, -a))), + ("child", 0, 5), + ("affine", 2, Fraction(1), ((0, Fraction(1)),)), + ("affine", 3, Fraction(1), ((0, Fraction(-1)),)), + ("affine", 5, -1 / a, ((0, 1 / a - 1), (2, Fraction(1)), + (3, Fraction(1)))), + ) + + +def inverse_word(word): + result = [] + for event in reversed(word): + if event[0] == "child": + result.append(event) + else: + _, target, diagonal, controls = event + result.append(("affine", target, 1 / diagonal, + tuple((i, -c / diagonal) for i, c in controls))) + return tuple(result) + + +def run_address(address, word, modulus=None): + """Execute the literal events, with optional full spectator coordinates.""" + require(len(address) >= 6, "six ADDRESS fields") + if modulus is None: + reduce = Fraction + state = list(map(Fraction, address)) + else: + require(type(modulus) is int and modulus >= 3 and modulus % 2 == 1, + "odd residue modulus at least three") + require(all(type(x) is int for x in address), "integer residue coordinates") + + def reduce(value): + value = Fraction(value) + return value.numerator * pow(value.denominator, -1, modulus) % modulus + + state = [x % modulus for x in address] + for event in word: + if event[0] == "child": + _, first, last = event + state[first], state[last] = state[last], state[first] + else: + _, target, diagonal, controls = event + state[target] = reduce(diagonal) * state[target] + sum( + reduce(c) * state[i] for i, c in controls) + if modulus is not None: + state[target] %= modulus + return tuple(state) + + +def fused_program(j, sign=1): + a = power(j, sign) + return (("query", 0, -a), ("xor", 0, 1), ("query", 0, 2 * a), + ("xor", 0, 1), ("query", 0, -a)) + + +def baseline_program(j, sign=1): + a = power(j, sign) + return (("query", 0, -a), ("xor", 0, 1), ("query", 0, a), + ("xor", 0, 1), ("query", 0, a), ("xor", 0, 1), + ("query", 0, -a), ("xor", 0, 1)) + + +def inverse_program(program): + return tuple(("query", event[1], -event[2]) if event[0] == "query" + else event for event in reversed(program)) + + +def invoice(program): + queries = [event[2] for event in program if event[0] == "query"] + words = [address_word(k) for k in queries] + return {"ordinary_children": len(queries), + "ordered_affine_events": sum(sum(e[0] == "affine" for e in w) + for w in words), + "aligned_xor_scans": sum(e[0] == "xor" for e in program), + "persistent_private_rows": 0, + "query_powers": queries, + "child_volume_fraction_each": "1/3", + "child_width_fraction_each": "1/3"} + + +def run_bits(rows, program, permutations): + """Sparse exact finite-array evaluator, mutating distinct dirty row sets. + + permutations[k][i] is the literal ADDRESS push map for the entire finite + domain. No copying, erasure, or clean-row initialization is a program event. + Python's simulator storage is not a physical tape/workspace measurement. + """ + require(type(rows) is list and len(rows) >= 3, "three DATA rows") + require(all(type(row) is set for row in rows), "mutable BIT position sets") + require(len({id(row) for row in rows}) == len(rows), "distinct physical rows") + for event in program: + if event[0] == "query": + _, row, k = event + permutation = permutations[k] + replacement = {permutation[i] for i in rows[row]} + rows[row].clear() + rows[row].update(replacement) + else: + _, target, source = event + require(target != source, "distinct XOR source and target") + rows[target].symmetric_difference_update(rows[source]) + return rows diff --git a/research/native-query-boundary/vendor/pr840-proof.md b/research/native-query-boundary/vendor/pr840-proof.md new file mode 100644 index 0000000000..aaba3e501d --- /dev/null +++ b/research/native-query-boundary/vendor/pr840-proof.md @@ -0,0 +1,204 @@ +# Three queries for a centered dyadic native BIT shear + +This is a local recursive-interface construction and a scoped query lower +bound. Ordinary ADDRESS interchange and ordered affine tape streams remain +premises. There is no new supplier, kappa, or formal multiplication proof. + +## Object and predecessor contracts + +Karl Appel / applecrusher's PR521 gives the native unipotent query below and +its one-child lowering at `k=1`. PR677 by commdata2338 completes the shear +`S_h(x,y,z)=(x+(h+I)y,y,z)` using two queries on the DATA target. Its source +remains untouched, and no full private row is required. VALUE addition is +over F2; ADDRESS arithmetic is rational arithmetic specialized to an odd +residue ring. The contribution here combines **two completed shears**, +extends the literal lowering to signed dyadic powers, and changes the +intermediate query to `h^(2a)`. It is not PR521's unfinished dirty chart. + +Use six physically ordered equal-width ADDRESS fields +`(H0,H1,H2,D0,D1,D2)`, each ranging over `Z/(ell^b)`, `b>=1`, `ell` odd. +Arbitrary intervening/exterior spectator fields and suffix VALUE records +are retained. Define column vectors + + s=(1,0,1,-1,0,-1)^T, r=(1,0,-1,-1,0,1)^T, + M(k)=I6+(k/4)s r^T. + +Since `r^T s=0`, `M(k)M(l)=M(k+l)` and `M(k)^-1=M(-k)`. +Let `h` be the array permutation induced by the ADDRESS **push** map `M(1)`. +Thus a VALUE moves from address `z` to `M(1)z`, and the value at a new address +is read from its inverse image. The full-array operator for `M(k)` is `h^k`. + +For each fixed integer `j>=0`, let `a=+/-2^j`. The desired completed endpoint is + + F_a(x,y,z)=(x+(h^a+h^-a)y,y,z). (1) + +Every additional arbitrary dirty row is unchanged. Source `y` is never +modified. The target requires exclusive access until the completed boundary; +the caller may not read its temporarily permuted representation mid-program. +This is the same target permission needed by PR677's DATA-target program. + +## One-child lowering of every signed dyadic power + +Put `c=k/4`, for `k=+/-2^j`. Apply, chronologically, + + z2 <- z2-z0 + z3 <- z3+z0 + z5 <- c*z5+(1+c)*z0-c*z2-c*z3 + CHILD_C(0,5) + z2 <- z2+z0 + z3 <- z3-z0 + z5 <- -(1/c)*z5+(1/c-1)*z0+z2+z3. (2) + +Every control precedes its target. The child swaps exactly two `b`-digit +fields on the complete queried BIT row, preserving every spectator. All six +affine events are charged, including their preparation, temporary tapes, +source access, counter work and head returns. The child uses its own restored +workspace; it is not an uncharged VALUE swap. + +To check (2), write incoming coordinates as `A,B,C,D,E,F` and +`d=A-C-D+F`. Just before the child, the later field is `A+c*d`, and the +middle fields are `C-A,D+A`. After the child and the next two events, +the first field is `A+c*d`, and the middle fields are `C+c*d,D-c*d`. +The final line gives `F-c*d`. Coordinates 1 and 4 stay fixed. This is +exactly `z+(k/4)s(r^T z)=M(k)z`. The literal reverse of (2), inverting +each affine event and using the same involutive child, implements `M(-k)`. + +The only diagonal units are `1,c,-1/c`. All numerator and denominator +factors of these units are powers of two, up to sign. Every control +denominator is also a power of two. Therefore (2) and its inverse +specialize to **every odd modulus**, including every odd prime-power +width. A control numerator may vanish modulo ell without invalidating a +diagonal. An arbitrary non-dyadic k would introduce prime exclusions into +this particular lowering; no such all-odd-radix claim is made. + +At k=1 this is exactly PR521's attributed word. The extension changes its +coefficients, not its tape/child contracts. For a fixed j, the finite +coefficient table is compiled into the machine description. Its size and +streaming constants depend on j. A growing j is separately priced below. + +## Completed pair fusion + +Two successive applications of PR677's completed DATA-target program, +for `h^a` and `h^-a`, produce (1): the two identity contributions cancel +over F2. This literal baseline has four queries and four XOR scans. + +Instead apply, chronologically, + + x <- h^-a x + x += y + x <- h^(2a) x + x += y + x <- h^-a x. (3) + +Following x gives `h^-a x+y`, then `h^a x+h^(2a)y`, then +`h^a x+h^(2a)y+y`, finally `x+h^a y+h^-a y`. The three target +permutations multiply to the identity. The unchanged source and spectators +can be arbitrarily dirty. No private row is initialized, borrowed, copied +or cleared. Because (1) is a VALUE shear, `F_a^2=I` despite `h^a` being +noninvolutive. Reversing and inverting the literal events restores all data. + +Lowering all queries by (2) gives **three separately paid ordinary children, +eighteen affine events and two XOR scans**, versus four children, +twenty-four affine events and four XOR scans for the completed pair. +This is a count comparison for this baseline; physical speed is not measured. + +## Three queries are necessary in the stated model + +Allow d>=2 arbitrary dirty F2-valued rows, invertible address-independent +linear XOR maps between row roles, and queries `h^e` on one row for any +integer e. All other ADDRESS maps, clean/disposable storage, erasure, +nonlinear VALUE gates and intermediate observations lie outside this model. +The lower bound counts queries, even when a non-dyadic power would need a +different physical lowering. It is not a lower bound on all tape programs. + +Restrict the complete ADDRESS domain to the orbit of `e_H0` under h. +Its addresses are `e_H0+k*s/4`, indexed by `Z/m`, `m=ell^b`. They are +distinct because a component of s and 1/4 are units. Hence h is multiplication +by t on the regular module of `R=F2[t,t^-1]/(t^m-1)`. Basis monomials +`1,t,...,t^(m-1)` are independent; zero divisors in R do not affect the +following determinant and coefficient arguments. The same proof works +over the Laurent ring for a uniform symbolic identity. +The determinants are those of d-by-d row matrices over R, not of the +expanded F2 matrix of all individual BIT positions. + +Move all constant row maps to the left, conjugating queries. At t=1, +the target `I+(t^a+t^-a)N`, `N=e_x e_y^T`, is I, so the remaining +constant map is I. A normalized query has the form + + D_P(t^e)=I+(t^e+1)P, P=u v^T, v^T u=1, + det D_P(t^e)=t^e. (4) + +The determinant of the target is one. Zero queries cannot produce its +nonzero off-diagonal entry: a is a unit modulo odd m and `t^a!=t^-a`. +One query either is the identity (e=0 modulo m) or has the wrong determinant. +For two queries, the determinant forces opposite exponents modulo m, +and their product is + + I+P+Q+t^e(P+PQ)+t^-e(Q+PQ). (5) + +If e=0 modulo m, both are identity. Otherwise, as m is odd, `1,t^e,t^-e` +are distinct basis monomials. The target's constant coefficient is I. +Comparing constant coefficients in (5) therefore forces P=Q. Then +`P^2=P` cancels both other coefficients and (5) is I, a contradiction. +Thus no two-query program implements (1), even with arbitrary dirty +spectator rows and arbitrary integer-power queries. Program (3) attains +three. This is a written algebraic proof, not an inference from finite tests. + +PR677's different first-difference target has constant coefficient `I+N` +and attains two queries. Its theorem is preserved. Allowing `h^(2a)` here +changes the physical query alphabet: substituting two `h^a` calls would +restore the four-child bill. At an even orbit a centered target can vanish; +the odd full-order hypothesis is necessary for this formulation. + +## Complete typed costs and workspace + +Let each genuine DATA row have full logical BIT volume U, including every +spectator range; V=3U and N=3b. Let C(U,b) pay one ordinary ADDRESS +interchange with restored child workspace. Let L_k(U,b) be the sum of the +six actual ordered-affine charges in (2), **including** finite coefficient +preparation, source access, counter work, temporary tapes and their returns. +Let X(U) pay one aligned XOR scan. Let R_f,R_b pay row split/merge, evaluator +routing, descriptors, parking and all additional head returns. Then + + B_a(V,3b) <= 4 C(U,b)+2 L_a(U,b)+2 L_-a(U,b)+4 X(U)+R_b, + F_a(V,3b) <= 3 C(U,b)+2 L_-a(U,b)+L_2a(U,b)+2 X(U)+R_f. (6) + +The new middle lowering has a different coefficient table. Equation (6) +does not assume equal costs for it. Relative to these literal invoices, +the saving is `C+2 L_a-L_2a+2 X+R_b-R_f`; this is not asserted positive +for every finite implementation. Under the retained tape contracts and +**fixed j**, L_k, X and R are O_j(V), giving normalized recursive-child +coefficients 4/3 and 1 respectively. The three children are sequential, +each on actual volume V/3 and width N/3. Persistent genuine-role storage is +V in both programs, with no additional full private role. A safe peak bound is + + W_f(V,3b) <= V+B_f(V,b,j)+W_C(U,b), + +where B_f pays streaming, counter/coefficient and evaluator parking workspace. +No exact physical tape count or scratch-cell saving is claimed. + +For growing j, table entries have O(j+1) numerator/denominator bits and +modular preparations and all primitive costs must retain their j dependence. +In particular the original direct multiplication stream can have a number +of pieces depending on a fixed large integer. No polynomial-in-j runtime +or uniform O(V) constant is inferred from (2). The `j=54` fixture is exact +coefficient evidence, not a practical performance demonstration. + +The left sides of (6) are a centered DATA shear; C is ordinary ADDRESS +interchange. Replacing C by F_a and solving a self-recursion would require +a separate compiler and would be circular here. Arbitrary-width padding, +common-label construction, scalar/frame/owner schedules, both supplier +invoices, precision/tape/hosting and analytic transfer remain obligations. +No supplier or assembly constraint is changed, so no new kappa follows. + +## Evidence boundary + +The checker compares (2) to an independently derived rational matrix and +modular formula, checks the VALUE endpoint over exact Laurent matrices, +and uses a separate sparse-set full-domain replay. Negative controls remove +children, change powers/directions, omit scans, destroy a dirty spectator, +and demonstrate the first-difference/even-orbit scope boundaries. +The recorded finite domains, fixed seed-selected coefficient and source pins +are in CERTIFICATE.json and SOURCES.json. No search outside those domains, +proof-assistant verification, complete supplier replay or runtime benchmark +is claimed. The universal argument above remains open to mathematical review. diff --git a/research/native-query-boundary/vendor/pr990-notice.md b/research/native-query-boundary/vendor/pr990-notice.md new file mode 100644 index 0000000000..8d954efe1d --- /dev/null +++ b/research/native-query-boundary/vendor/pr990-notice.md @@ -0,0 +1,13 @@ +# Attribution and scope + +Contributed by Sagar Thakrar / @thakrarsagar with substantial OpenAI Codex assistance in task selection, mathematics, implementation, verification and writing. New code and prose are under the repository's Apache-2.0 license. No independent human review or official OpenAI endorsement is claimed. + +- Karl Appel / @applecrusher, PR #521 at `a190fdb39f31647fc6f651625353710624627348`, supplies the native unipotent ADDRESS map and seven-event lowering. The lowering in `verify.py` is an attributed transcription, checked against an independently written direct map. +- @commdata2338, PR #677 at `613c02b8b4411f991f108dcc1481b3f9100b996f`, supplies the completed DATA-shear contracts, single-shear private-only construction, query-model distinctions and typed cost accounting used here. Its notice discloses OpenAI Codex and Claude Code assistance. +- @CubeJerry, PR #889 at `e2021d1c9e06948528cbc0a8fd7079b671da981d`, supplies related common-factor multi-output dirty correction sharing. We claim no priority for that mechanism. Ross Richardson's PR #938 independently audits the corresponding star-word minima; our census concerns native-query excursions and their scalar scan costs, not that star language. +- PR #822 studies connector reuse in recursive product trees. PR #974 studies optimistic budgets for the selected T21/T37 interfaces. They are distinct concurrent work, credited and excluded from this packet's claims. +- Concurrent PR #982 at `5eca5b435d2ce172edf6ffb85694c7efa31bf114` borrows an output in place of a dedicated connector for common-factor batches. This packet keeps a dedicated private row and forbids DATA queries; no priority or dominance over that different contract is claimed. +- OpenAI #109 and the retained upstream stream/interchange sources supply the ordered-affine, complete-range, tape and restoration contracts. Those contracts remain premises. The original source and license notices in `upstream/` are unchanged. +- Jonathan Capalbo's selected PR942 T37 composition, its complex lineage and DreamingOfClouds' PR589 on eumemic's PR555 bit supplier retain their existing attribution and selected status. Their full proof and validation are not rerun or replaced here. + +The contribution is the explicit private-only batch boundary, paid recurrence and finite affine-state scheduling evidence. It does not claim a new kappa, an installed supplier, a general optimum, a practical multiplication speedup or a full formal multiplication theorem. diff --git a/research/native-query-boundary/vendor/pr990-readme.md b/research/native-query-boundary/vendor/pr990-readme.md new file mode 100644 index 0000000000..5b77631c5f --- /dev/null +++ b/research/native-query-boundary/vendor/pr990-readme.md @@ -0,0 +1,133 @@ +# Batch restored native DATA shears through one dirty private row + +**Research construction with a scoped finite optimum. No new kappa.** + +This extends the private-only boundary of [PR #677](https://github.com/CrocSwap/integer-mult-bounds/pull/677), using Karl Appel's native ADDRESS query from [PR #521](https://github.com/CrocSwap/integer-mult-bounds/pull/521). Four DATA targets receive a rank-three combination of five immutable DATA sources. Sharing the correction for the arbitrary private input reduces twelve complete recursive queries to eight. The best schedule in the class below also reduces 36 aligned XOR scans to 30. + +The elementary sharing idea is related to @CubeJerry's [PR #889](https://github.com/CrocSwap/integer-mult-bounds/pull/889), which batches common-factor product shears. This contribution supplies a different, fully specified native-query boundary, its complete child/affine/scan bill, and an exhaustive affine-state schedule census. It does not claim priority for compute/uncompute or general dirty correction sharing. + +## Reproduce + +From the repository root, with Python 3.10 or later and no external packages: + +```sh +python3 -I -B research/native-shear-batch/verify.py +``` + +Expected: + +```text +PASS_NATIVE_SHEAR_BATCH schedules=5376 queries=12->8 xor_scans=36->30 columns=7290 negative_controls=8 no_new_kappa +``` + +`CERTIFICATE.json` contains the complete 38-event program. Rows 0 through 3 are targets, rows 4 through 8 are sources, and row 9 is the dirty private row. `query` acts only on row 9. Its last field is the signed direction of the native query. `xor` gives destination and source row numbers. The checker emits the schedule afresh and compares the entire certificate, then executes it symbolically and on the complete order-three ADDRESS domain. Optimized Python is supported; checks do not depend on `assert`. + +Exact base: `bbc600db2fc15007b7c914f4f2b2ed55fa909c87`. Source commits and SHA-256 values are in `SOURCES.json`. The selected result at that base is PR942's conditional `1661960547713947/1000000000000000000`. Neither it nor `upstream/` is modified. + +## Endpoint and schedule + +All VALUE arithmetic is XOR over F2. Every row has the same complete ADDRESS domain and volume U. Let h be PR521's invertible ADDRESS permutation acting linearly on VALUE arrays. The endpoint is + +```text +X' = X + (I+h) M Y, Y' = Y, q' = q. + +M = [1 0 1 0 0] + [0 1 1 1 1] + [1 1 0 1 0] + [0 1 1 1 0] +``` + +The private input q=d is arbitrary, including values unrelated to every DATA row. No row is copied, cleared or assumed zero. Source rows never change. Targets and private q are exclusively owned for the duration of the complete batch; intermediate states are not completed DATA interfaces. + +A source mask b represents the XOR of selected Y rows, with source zero in its low bit. The program visits the following four private states. Each visit applies h to q, adds that row to the indicated targets, then applies h inverse to q. Between visits it toggles the individual source rows needed to change b. Finally it restores b to zero and adds M Y directly to the targets. + +| b before query | Targets reading h q | Source scans from previous b | +|---:|---|---:| +| 0 | X0, X2 | 0 | +| 5 | X0, X1, X3 | 2 | +| 11 | X2, X3 | 3 | +| 27 | X1 | 1 | +| Return to 0 | None | 4 | + +There are ten source-to-q scans, eight q-to-target scans and twelve direct source-to-target scans. Four forward/inverse query pairs give eight recursive children and 48 affine events. + +For a general list of sample masks b_j and target-column masks a_j, the sampled target addition is + +```text +sum_j a_j h(d + b_j Y) + = (sum_j a_j) h(d) + h(sum_j a_j b_j Y). +``` + +Here the four target masks are `5, 11, 12, 2`. Their XOR is zero. Their outer products with the four source masks sum to M: the target rows are `5`, `5 XOR 27 = 30`, `0 XOR 11 = 11`, and `5 XOR 11 = 14`. Thus arbitrary dirt cancels, the sampled contribution is h M Y, and the direct scans finish the claimed endpoint. The final source toggles restore q=d. The inverse reverses every event and reverses each query direction. The endpoint itself is an involution. + +This is a written identity for arbitrary arrays and any invertible linear h. The finite tests below check its implementation, not the full multiplication theorem. + +## Exactly what was optimized + +An **excursion** in this note is one h query on q, any set of direct q-to-target reads, and one h-inverse query returning q to the unpermuted source chart. Source toggles happen only outside excursions. The allowed remaining operations are individual source-to-q and source-to-target XOR scans. Target-to-target and source-to-source mixing, extra private rows, negative-height excursions, adjacent queries without return, and alternative ADDRESS primitives are outside this optimization class. + +On arbitrary complete arrays, h and I are linearly independent over F2: PR521's h has a nontrivial odd-order ADDRESS orbit. With k sampled states, arbitrary-dirt restoration requires `sum a_j=0`, and matching the h coefficient requires `sum a_j b_j=M`. Consequently + +```text +M = sum_(j=1..k-1) a_j (b_j + b_0), +rank(M) <= k-1. +``` + +The fixture has rank three, so at least four excursions, hence eight queries, are necessary **in this class**. Four suffice. This does not generalize PR677's one-shear private-only lower bound to every multi-shear query word. + +At this minimum, the four b values must be affinely independent and their differences must span the three-dimensional row space +`{0,5,11,14,16,21,27,30}`. The checker considers all `choose(32,4)=35,960` four-element subsets of F2^5, retains exactly 224 valid sample sets, and evaluates all 24 orders of each. This includes offsets outside the row space. For each set, the even-parity coordinates of each M row uniquely determine all target reads. The minimum transitions between fixed source states cost their Hamming distance. Direct M Y costs twelve scans in this class. + +All 5,376 schedules were completed, with no timeout or early stopping. Their XOR cost histogram is in the certificate. A second enumeration starts with the 168 ordered bases of the target column space and solves source coordinates for each of 32 offsets; it produces the same full histogram. The minimum is 30, attained by 232 schedules. The certificate chooses the lexicographically first minimizing tuple of source states, then target masks. Longer source paths, repeated cancelling reads and extra direct scans cannot lower the count for any fixed schedule. + +The comparison is stronger than applying the four-query single-edge program twelve times. It considers all 28 unordered bases of the row space and uses the unique rank-three factorization `M=A B` for each. Each factor gets its own complete PR677 dirty restoration. Even allowing all final direct terms to cancel globally into M Y, this comparison needs twelve queries and at least + +```text +2 sum_j weight(B_j) + 2 sum_j weight(A_j) + weight(M) = 36 +``` + +XOR scans. The minimizing basis is `5,14,16`, with target masks `5,14,2`. This baseline optimum is also scoped to those separately completed rank factors. A DATA-query contract can instead use PR677's two-query shears; the present result is useful only when queries must stay private. + +Assignment seed 52 was drawn with operating-system randomness. The fixture uses `random.Random(52).getrandbits(5)` for four rows, rejecting zero rows, missing source columns and ranks other than three. The stopping rule is the first accepted matrix within 1,000 attempts. It is accepted at attempt six. Randomness selects the object; the subsequent schedule census is exhaustive. No closed global search or fixed-menu exponent barrier is reopened. + +## Complete local recurrence + +For odd prime ell and b at least one, retain PR521's six ordered ADDRESS fields `(H0,H1,H2,D0,D1,D2)`, each of width b. Its map is + +```text +h_address = I6 + s r^T / 4, +s = (1,0,1,-1,0,-1)^T, r = (1,0,-1,-1,0,1)^T. +``` + +Its seven chronological events are `a2-=a0`, `a3+=a0`, `a5=(a5+5a0-a2-a3)/4`, a complete recursive ordinary interchange of fields 0 and 5, `a2+=a0`, `a3-=a0`, and `a5=-4a5+3a0+a2+a3`. The reverse inverts every event. Every affine control precedes its target. Denominators and diagonal coefficients are units for every odd ell. Complete spectator ranges remain present in each child. + +Let C(U,b) bound a complete ordinary interchange child on the queried row, including its restored recursive workspace. Let A(U,b) bound one retained ordered-affine event, including coefficient preparation, source access, temporary streams, arithmetic and head returns. Let X(U) bound an aligned native XOR scan, including both source/target access and head returns. Let R(V,b) pay row routing, split/merge if needed, descriptors, parking/recovery and any fixed evaluator setup not already in C, A or X. These are the inherited streaming contracts, not unit-cost arithmetic assumptions. + +There are nine genuine DATA rows, so V=9U; the dirty private row adds U persistent storage. The paid local recurrence is + +```text +B_batch(V,3b) <= 8 C(V/9,b) + 48 A(V/9,b) + + 30 X(V/9) + R(V,b). +``` + +Every one of the eight children acts on the entire private row of actual volume V/9 and width b, including all spectators. The parent ADDRESS width is 3b in each H/D group. V/9 follows from this nine-row input contract; it is not borrowed from PR677's three-row V/3 normalization. For independent batches, sum this entire bill at every invocation. No child is omitted as a recovery step, and no cached h(d) row is retained between batches. + +For this fixed row count and fixed literal schedule, the non-child terms are O(V) under the inherited stream contracts. Therefore, if `C(U,b) <= U c(b)`, the conditional local normalization is `B_batch(V,3b)/V <= (8/9)c(b)+O(1)`. This is a typed reduction from B_batch to C, **not** a self-recursion for ordinary multiplication or a new exponent. The separately completed comparison has `12 C + 72 A + 36 X + R_sep`, with the same persistent rows. No measured runtime comparison is asserted, and the routing constants may differ. + +Persistent row storage is `10U = 10V/9`. A safe total peak bound is `10U + W_local(V,b) + W_C(U,b)`, where W_local includes affine evaluator, routing and parking scratch. Calls run sequentially and reuse restored child workspace. There are no new full helper rows, source copies, zeroing or erasure operations. Internal scratch, precision for address counters and tape work remain in A, C and W_local. VALUE arithmetic itself is exact XOR. + +## Verification and remaining obligations + +The checker compares the complete emitted word and both census formulations to the certificate. It checks the endpoint and literal inverse as Laurent polynomials over F2 with one arbitrary input symbol per row. Independently, a bitset matrix interpreter checks all 7,290 input columns over all 729 addresses in `(Z/3)^6`, including every private and source column, and then reverses the whole program. The direct ADDRESS map and chronological affine/child lowering agree on all six rational columns, every order-three address and every one of the 15,625 order-five addresses. The literal reversed affine/child lowering is also checked on every rational basis column. + +Eight negative controls reject omitted dirt compensation, omitted private restoration, an omitted direct term, a wrong query direction, a query on a DATA row, a wrong source, removal of the recursive child from its affine wrappers, and an underpriced certificate. A positive control adds two cancelling XORs and requires both to remain charged. + +Validation on 2026-10-13, macOS 26.5.2 arm64 with Python 3.14.8: normal and isolated optimized runs passed, including a two-file copy executed from outside the repository. Four additional actual-certificate mutations were rejected by the command-line verifier at their intended guards: query underpricing, a missing event, a histogram change preserving the schedule total, and a changed target matrix. All nine Git source hashes matched. `make selected-record-check` and all 17 `test_selected*.py` tests passed. No repository-wide `make verify`, cold supplier reconstruction, hosted CI or Lean build was run; this package changes no existing generator or selected supplier artifact. + +The rank argument is a written scoped proof. The 30-scan optimality is a complete finite census in its stated class, not a formal proof of an unrestricted circuit lower bound. The exact identities and finite replays do not instantiate a supplier or prove the complete multiplication theorem. + +Still required before any exponent claim: identify actual supplier calls with this common h and source/target incidence, authorize their private-only batch lifetime, admit their complete row stock and routes, compose the full bit and complex profiles, and check the assembly inequalities. All-size compilation, common-label realization, whole-call hosting and the inherited tape/analytic interfaces remain obligations. This packet does not change either supplier, so it makes no claim about which assembly constraint would bind after integration. It is not an inference from PR974's optimistic budget relaxations. + +The final overlap review also found [PR #982](https://github.com/CrocSwap/integer-mult-bounds/pull/982), which removes a dedicated connector by borrowing an output in a product-shear batch. That changes the scratch and permitted-query contract. This package retains one dedicated private row and never queries DATA; it does not compete with or supersede that result. + +Attribution, licensing and substantial AI assistance are disclosed in `NOTICE.md`. Session selection and overlap checks are recorded in `CLAIM.md`. diff --git a/research/native-query-boundary/vendor/selected-result.json b/research/native-query-boundary/vendor/selected-result.json new file mode 100644 index 0000000000..3d7529d77a --- /dev/null +++ b/research/native-query-boundary/vendor/selected-result.json @@ -0,0 +1,177 @@ +{ + "status": "Maintainer-reviewed conditional finite construction; see the integration receipt for publication and PR resolution status", + "kappa": "1661960547713947/1000000000000000000", + "decimal": "0.001661960547713947", + "source_prs": [ + 942, + 890, + 870, + 869, + 858, + 799, + 741, + 699, + 685, + 676, + 664, + 660, + 659, + 656, + 655, + 653, + 658, + 649, + 645, + 635, + 589, + 555, + 545, + 626, + 623, + 622, + 620, + 617, + 615, + 604, + 601, + 596, + 592, + 591, + 593, + 599, + 588, + 543, + 584, + 586, + 583, + 582, + 579, + 576, + 575, + 574, + 571, + 569, + 568, + 567, + 564, + 562, + 561, + 559, + 558, + 552, + 550, + 548, + 541, + 535, + 510, + 503, + 531, + 523, + 493, + 514, + 507, + 484, + 496, + 505, + 522, + 520, + 472, + 458, + 445, + 442, + 425, + 433, + 370, + 361, + 315 + ], + "source_manifest": "research/community-frontier942-audit/SELECTED-SOURCE.json", + "certificate": "research/community-frontier942-audit/ASSEMBLY.json", + "certificate_sha256": "4b2894956e594e408e111d806c842f2ed2c32aefcadff93fad69ff0b46f1991a", + "proof": "docs/research/community-batch952-review.md", + "proof_supplements": { + "research/e8-bit-r420/README.md": "9807be57c6adf26b30e4f54e2f8160075bbc05091f1a6d157e43d2a4620c1c9f", + "research/complex-571-free4fc8/NOTICE.md": "a4c084abdc1c7a9ac683eeb11124335d51cff8a6deba6ee92ba5a12bceaa2c97", + "research/complex-multicold/proof/CONSTRUCTION.md": "27ece5e1c11b90d97a808b56eff897b998c10e61016db95867f84e6e6aef132f", + "research/complex-multicold/vendor/pr559/PROOF.md": "d5d498edc56fdef8c5798af7f5ec66948bd2f66c553b9efe366cdaab01bd3453", + "research/structural-gain/frontier-composition/README.md": "70f0f791cbe3b2603f85d85bb9055aa0ee1df6dc06ba82fc1921356948312887", + "research/complex-joint-prefix/proof/CONSTRUCTION.md": "a92e610e7a598d99c612d1b63d1a03a49c0cd1e15ddd29fa55c465ddd8c18105", + "research/kernel-frame-coalescing/PROOF.md": "fa8b2f36b9590ee80ff45d3f7724f8c7de8ad29a29f366d5133010c77e41fe1b", + "research/complex-571-hpeq5/README.md": "4000b37f6c07c09d971dc4010ceb137c13340f3a8809d3272046ccaf746c3e2b", + "research/hyperplane-end-lean/PROOF.md": "1cbce5cf0ff0152f71e8ae7bef25841d1ce13010af248ff7209182d2328c21c9", + "docs/research/community-hyperplane599-review.md": "3298cd0d451541508af232cac72efbd7c10580e6c6ad493a855ab0faa01ade8c", + "research/complex-571-cold14-b3/README.md": "1945785785c153c7d0e8d4c071adabe626c1091b71721ff85d2d67191b376b96", + "research/complex-571-cold14-b3/PROOF-NOTE.md": "1cf592cbc8ab8e21d2dd8c1e945a5c64c6d5cde1216fb06e05a36c1c6ec6613d", + "scripts/verify_cold617_interface.py": "95d7a9094c05ad975fb72f5ab7605593003245a503c8456764987e512028fa6a", + "docs/research/community-cold617-review.md": "b3f2bcbae1249f1f651032022ce1e6e2bfb3f563ce580bf53671f50a074d7046", + "research/complex-k492-owner-repair/README.md": "ee5a1ace4828f7a073be97e95c2d931988774dd3a29a877e65abdf429aeec902", + "research/complex-k492-owner-repair/PROOF-NOTE.md": "337d70fe7abd9afca1d90954c23bde87f4dc27888cc1a6b4bb80506fd6fbf8c5", + "research/complex-k492-owner-repair/PROOF-NOTE-R.md": "22312bb347bdf159e6a01a45c47675e6170d33b258e2fd9ed52aee88fb92c0ed", + "docs/research/community-k492-review.md": "3b731d30e80010b15408a289b0b32192700885474c8b36d48ee3320a7a8c5c47", + "scripts/verify_frontier626.py": "2207bd0ef04a19ef276869085afdedad80a0938fa75db5e1aa7ab73fd3429444", + "scripts/verify_frontier626_bindings.py": "cda63ff41c6d6e2e352c7bf75b84e690c0ce57e4ec6c0355573bb5d9b1f98280", + "scripts/verify_frontier588_bindings.py": "6d1932eea7b1936598118ea8e607b09c29b6e31b749ec41bbe0744ea4f0b606d", + "scripts/verify_hpe_lean_binding.py": "52aa1d23641e4c716b43c98f6b883ad042087dd03a9d01369e8e6a735b07aa03", + "research/hyperplane-end-lean/HyperplaneEnd/Exact.lean": "eebf3a3982af7ab9be45777b272a6aaa523206fa7667ceb6df63ad6589fd8183", + "docs/research/community-frontier741-review.md": "4634694fa75ea9e749ecf19d3db3e4d82effe3b61a2efdf08ac5a97275fb676a", + "research/complex-sw4-frame8/PROVENANCE.md": "c7648719b01dd93af2c3a2c6e951a54711d13892dc4bd4339d16edb4c37c9bf0", + "research/e8-bit-p111-tuned/tune/README.md": "46c7917fb252949f38b7bcd88cf568efc282e3ea065b61d11e457e41673d0b2d", + "scripts/verify_frontier741.py": "215ee6a12de8dc2392e6811a1b8f2140035f6b2d2a0d2100ff4bd2fdcb8bb39b", + "scripts/verify_frontier741_bindings.py": "eff455167e2fd0bc9a67d35241d0e69d8edc58f3a23e776dcfe8f500ca8e8d67", + "docs/research/community-frontier799-review.md": "bd91c10c67f2a873fd456b95cbb43f715a43dac0e0a66938737d591c6b754052", + "scripts/verify_frontier799.py": "19fe1b32079095160dc00fe2f7df75e0fcbc82cff37f7159b755c8a63bd5ce99", + "scripts/verify_frontier799_bindings.py": "43897b3c99212d6134870898a1840f32898aa1b3679b299e654901568ad7e19b", + "research/gauge44-frames-x/PROOF-NOTE-FRAMES-X4.md": "39c50420ebb6e8813706a49b2cf759f277c4afac9f6780fc0a7ac6a5fb86e036", + "docs/research/community-frontier890-review.md": "cd03b7c2c6c09db2cfa89ae40133ae44e1deb6e32ec5ddd23aacecc9c50f2fea", + "scripts/verify_frontier890.py": "88ea38dbef62dd7c0dd46e212618520cc89213edddb2032800e5509993958175", + "scripts/verify_replay_coverage.py": "babe5941d7e6dac4248613ef01f950ee7bb6199e7355021aea4cf854fd1b91c5", + "scripts/verify_frontier741_bridge_coverage.py": "9a14f26762b6126eb54ed43db90371773374fe98733ada80ee871a74afa3b836", + "certificates/replay-coverage/pr741-sw4-v1.json": "7acd5033bc78e3f473718269edaa267c2785d84fbe95ccf6815a33dcf58c2756", + "research/complex-t21-owners/PROOF.md": "78721b32fceb34b21b8e77c95381c38c60276e72e6d9c2e9c6262cb347457def", + "research/complex-t21-owner-bound/PROOF.md": "2aa0aa6ec1d87402138564c38749b5ca0f058c16817efdf58a2685d2d90cb417", + "research/gauge44-barch/PROOF-NOTE-BARCH.md": "c24f211b09358b25d6cf47dd18e4bbd8bcf4ecf279e6f1c6c90613cfa230818d", + "research/complex-double-replica-owners/PROOF.md": "db99599e3966bec253c577c23915e2a2899c4c4e8568044efc11c7918b137bbc", + "docs/research/community-batch952-review.md": "04db59dfc2c31453229b6061bbf59547e71ce3abdc0ce0f6779144bb0dde127b", + "scripts/verify_frontier942.py": "27c6713532d9f53f55dfff4884d55a2d9ae74b68156e37a44596c0418fbed5b7", + "research/complex-t37-owners/PROOF.md": "09b39ad0d5f1f59f54dcff15c16640f7a7acf27e6597660acaf957b95c7e8510", + "research/complex-t37-owners/ALL-T-PROOF.md": "4c0c71ccd0afb850538af1b467e5208b7eb3edd0260fded84e02a8c01dfc868b", + ".github/workflows/t37-owners.yml": "c13acc2902c007237103072b7ec10caf5ca21c1b319d27934f194af2f7d87026" + }, + "review": "docs/research/community-batch952-review.md", + "validation": "docs/research/community-batch952-integration.json", + "reproduce": "make frontier942-verify", + "scope": "U8/T37 finite composition with 1024-bit complex prefix allowance and complete source-bound baseline coverage; explicit reused ancestry recorded. Inherited all-size/compiler, common-label/mutable-source, whole-call hosting, precision/tape, analytic and bit H1-H5 obligations remain. Not a full Lean multiplication theorem; Linux integration CI tracked separately.", + "previous_kappa": "1661957774647029/1000000000000000000", + "previous_record": "certificates/checkpoints/frontier890.json", + "audited_source_head": "1960cfa919a0945d0ca4cb14ea96237000037903", + "reviewed_dependency_heads": { + "588": "6d0e53b66c29abd17981881a09eaff41ac862d85", + "543": "2065fe4f72a914d907f1046603f5a36f17018535", + "568": "71c99ac935a33bb7b59a1b4a7af8725a939b0b90", + "569": "1424da81263a5305b35e4cf74ef686c275f03f3f", + "571": "b7bdc5a8de18fcf418cfb9c7d83a2b1097a5e4a3", + "575": "eac6f7e378ab622dac50a2fd4b7ef6eab014de44", + "583": "89be768f0157f5a3d8e4db69cf1748768605eac9", + "586": "4846fee5b06af770e9b3a10c36200f673d656725", + "591": "f622547244bf6d895a571a7b035142ba66279806", + "592": "1f471c445c06a45a32e2c47e8d74c8264b68356b", + "593": "fdb6dcc6d7bc29764c5b6b4d32b7fa050acf74a4", + "596": "7732dd5e46863ff294b5e443661cb9d99abf4e01", + "599": "bc13c8a3e000442606bd2dbe8583a17649ba6c32", + "601": "529ab7dcb59d5ea7a5798e9e06cf5b3aee8a1550", + "604": "1b795c5d7dea746ba310572585c0ef067574b4a6", + "615": "bf8a49a34350599763cced8592db81dc62c2c1c0", + "617": "904d62855723c00f8acef9a287a10768598fdeb2", + "622": "f69477f4f6d3c7eb1f740b166881bffed4ffa9f6", + "623": "e39a615ca601ce5d62abeb24f3fcdb8644ca1005", + "626": "660de893d27bb7abd1d5b01b1640207528a5c851", + "589": "a5afc8c6169ea61ba7c51dfd3cade02cc7b13b46", + "741": "e516b1463606840a15f80aac1995d64ce0092e89", + "799": "80e6463157cfc80b85af09e7e2f14748fe2dac60", + "858": "ae2e25fee91540c83ceee5a60e3b07422ce21c7d", + "869": "73e86f69bf9a391e3c334999f7bbe3825dc42759", + "870": "b734850dc348800942f0ffd1f0723fdec7539b2b", + "890": "4b3bd8cbe8e3e81c44161017c9b72c905a8040a8", + "942": "1960cfa919a0945d0ca4cb14ea96237000037903" + } +} diff --git a/research/native-query-boundary/vendor/upstream-LICENSE b/research/native-query-boundary/vendor/upstream-LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/native-query-boundary/vendor/upstream-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/native-query-boundary/vendor/upstream-swap.tex b/research/native-query-boundary/vendor/upstream-swap.tex new file mode 100644 index 0000000000..951e792b17 --- /dev/null +++ b/research/native-query-boundary/vendor/upstream-swap.tex @@ -0,0 +1,416 @@ +\section{Faster interchange of address chunks} +\label{sec:tape-interchange} + +We use the bit network to interchange two equal address chunks on tape. +An edge matrix of rank $a$ will require $a$ smaller interchanges. +Because the sum of these ranks is less than the number of wires times +$m$, the resulting recurrence saves a power of the chunk width. + +\subsection{A matrix decomposition adapted to tape order} + +Lemma~\ref{lem:ordered-affine-streams} updates a later field using +earlier fields in linear time. Lower triangular changes of coordinates +can be performed entirely in this direction. The required factorization +is the Bruhat factorization for arbitrary matrices, with coordinate order +reversed; see Grigor'ev~\cite[Appendix~A.2, Proposition~14(c)]{Grigoriev1982}. +We give its elementary elimination proof in this order. + +\begin{lemma}[Lower triangular factorization] +\label{lem:lower-lower} +Every rational $m\times m$ matrix $A$ of rank $a$ has a factorization +\[ + A=E_1\Pi E_2, +\] +where $E_1,E_2$ are invertible lower triangular rational matrices and +$\Pi$ has exactly $a$ entries equal to one, with at most one in each row +and column, and all remaining entries zero. +\end{lemma} + +\begin{proof} +If $A=0$, take $E_1=E_2=I$ and $\Pi=0$. Otherwise choose the topmost +nonzero row and its rightmost nonzero entry. Use that pivot column to +clear entries to its left by right multiplication by lower triangular +elementary matrices. There are no nonzero entries to its right in the +pivot row. Clear entries below the pivot by left multiplication by +lower triangular elementary matrices, and scale the pivot to one. +All rows above the chosen row were zero in the still active columns. + +Delete the pivot row and column from the active index sets, retaining +their original orders, and repeat. Elementary operations on the active +indices are still lower triangular in the original order. They do not +change any earlier pivot row or column, whose other entries have already +been cleared. Each step isolates a rank-one block and leaves the +remaining rank in the active submatrix. Thus the final partial +permutation matrix has exactly $a$ ones. If $LAR=\Pi$ is the resulting +identity, then $E_1=L^{-1}$ and $E_2=R^{-1}$ have the required form. +\end{proof} + +\begin{lemma}[The cost of a rational matrix shear] +\label{lem:matrix-shear} +Let $\mathcal A$ be a fixed finite collection of rational $m\times m$ +matrices. There is a fixed odd prime $q$ such that the following holds. +Let $H=(H_1,\ldots,H_m)$ and $D=(D_1,\ldots,D_m)$ be two ordered +groups of fields, every field ranging over $[q^b]$, with every $H_i$ +before every $D_j$. For $A\in\mathcal A$ of rational rank $a$, the +permutation +\[ + (H,D)\longmapsto(H+AD,D) + \quad\text{over }\mathbb Z/q^b\mathbb Z +\] +can be performed with exactly $a$ interchanges of pairs of $b$-digit +fields and $O(V)$ further work. Every interchange is between an $H$ +field and a $D$ field. Spectators between any of the formal fields are +allowed. +\end{lemma} + +\begin{proof} +Choose the factorizations of Lemma~\ref{lem:lower-lower} for all matrices +in $\mathcal A$ once and for all. Include their factors and inverses in +a finite rational table. Choose an odd prime avoiding every denominator +in the table and every numerator of a diagonal entry of an invertible +factor. For example, a prime exceeding the absolute values of all its +nonzero numerators and denominators suffices. Rational elimination and +trial division construct this finite table and a suitable prime in a +finite computation independent of $b$. They may therefore be compiled +into one fixed machine description. All these +rational identities then specialize to $\mathbb Z/q^b\mathbb Z$, and +the triangular factors remain invertible there. + +A lower triangular transformation of $H$, or of $D$, costs $O(V)$: +update coordinates in descending physical order. At coordinate $i$, +multiply by its diagonal unit and add a fixed linear combination of +earlier coordinates. These earlier coordinates still have their original +values. Apply Lemma~\ref{lem:ordered-affine-streams}; the number of +coordinates is the fixed number $m$. Inverses are also lower triangular. + +For $A=E_1\Pi E_2$, first transform $D$ by $E_2$ and $H$ by $E_1^{-1}$, +then add $\Pi D$ to $H$, and finally transform $H$ by $E_1$ and $D$ by +$E_2^{-1}$. Each one in position $(i,j)$ of $\Pi$ calls for +$H_i\leftarrow H_i+D_j$. Implement it by +\[ + D_j\leftarrow D_j+H_i,\qquad + (H_i,D_j)\leftarrow(D_j,H_i),\qquad + D_j\leftarrow H_i-D_j. +\] +The first and last updates target a later field controlled by an earlier +field. On an initial pair $(h,d)$ this sequence yields $(h+d,d)$. +It uses just one interchange. There are $a$ ones, which proves the +claim. In particular, the number of recursive calls is the rational +rank $a$; temporary tapes used for the other operations do not multiply +that count. +\end{proof} + +\subsection{Transferring a finite circuit to address permutations} + +Fix integers $m,W\ge2$. The circuit has $W$ wires, including its +scratch wires, with separate input and output terminals. Its fixed, +pointwise bit gates induce a permutation $\rho$ of the $W$ scalar inputs +at completion: the input value at role $w$ appears at output role +$\rho(w)$. Assign a +rational $m\times m$ matrix to each terminal and to each gate, the latter +assignment being common to every wire at that gate. A wire segment +between consecutive assigned vertices is called an edge. For an edge +$e$ put +\[ + A_e=M_{\mathrm{head}(e)}-M_{\mathrm{tail}(e)}, + \qquad s=\sum_e\operatorname{rank}_{\mathbb Q}A_e. +\] +The required conditions are +\begin{equation} +\label{eq:finite-shear-contract} + M_{\mathrm{out}(\rho(w))}-M_{\mathrm{in}(w)}=I_m + \quad(1\le w\le W),\qquad s0$, write each chunk as $m$ +consecutive $b=e/m$ digit fields, giving vectors $H,D$ over +$\mathbb Z/q^b\mathbb Z$. We first construct the shear $H\leftarrow H+D$. + +Split whole rows cyclically into $W$ role streams within each prefix +preceding the row field. Write the original row number as +$r=Wg+(w-1)$ with $1\le w\le W$; stream $w$ has row number $g$. +These streams have exactly the same remaining shape, including the +full ranges of $H$ and $D$. Each has +logical volume $V/W$, and its row count is divisible by $W^{k-1}$. + +For a rational matrix $M$, let $\Phi_M$ act on an array by moving its +entry at address $(H,D)$ to $(H+MD,D)$, with every spectator unchanged. +Thus $\Phi_M$ is the array permutation induced by that address map. +Its inverse is $\Phi_{-M}$ and +$\Phi_{M'}\Phi_M=\Phi_{M'+M}$. On every circuit edge apply +$\Phi_{A_e}$ to that role stream; implement it by +Lemma~\ref{lem:matrix-shear}, recursively interchanging each pivot pair +of $b$-digit fields. Execute each circuit gate pointwise at matching +addresses of its role streams. + +The row split supplies the common address set used in the +frame identity~\eqref{eq:common-frame-identity}. Here the frame at a +vertex with matrix $M$ is the address permutation $\Phi_M$, and every +edge changes it by $\Phi_{M'-M}$. The same invariant proof applies +because a common address permutation commutes with every pointwise +bit gate. For the physical input arrays $f_w$, the logical arrays are +$g_w=\Phi_{-M_{\mathrm{in}(w)}}f_w$; this only specifies their +interpretation, with no initial tape operation. The logical circuit +routes $g_w$ to role $\rho(w)$. Thus its physical output satisfies +\[ + f'_{\rho(w)} + =\Phi_{M_{\mathrm{out}(\rho(w))}} + \Phi_{-M_{\mathrm{in}(w)}}f_w + =\Phi_{I_m}f_w, +\] +by~\eqref{eq:finite-shear-contract}. Merge by returning row $g$ of +output role $\rho(w)$ to the original row $Wg+(w-1)$ within the same +preceding prefix. This undoes $\rho$ and restores row order. The result +is $H\leftarrow H+D$ on every original row, including rows assigned +to scratch roles, whose initial values were arbitrary. + +To interchange the two full chunks, perform +\[ + D\leftarrow D-H,\qquad H\leftarrow H+D,\qquad D\leftarrow H-D, +\] +componentwise. Only the middle shear uses the circuit. The other two +updates target the later group and have linear cost. The transformation +sends $(H,D)$ to $(D,H)$. + +The number of recursive calls is the sum of the edge ranks, exactly $s$. +Each acts on one role stream of volume $V/W$, retaining all other +fields as spectators. Splitting, +merging, gates, and triangular operations have total cost $O(V)$ because +their number is fixed. Below we verify that scheduling the recursive +calls on fixed tapes also costs $O(V)$ at this node. Thus if $F_k$ is a +uniform upper bound for time divided by logical volume, then +\begin{equation} +\label{eq:swap-recurrence} + F_0=O(1),\qquad F_k\le(s/W)F_{k-1}+O(1). +\end{equation} +For $a=s/W1$, it is $O(a^k)$. +Hence $F_k=O(e^\tau)$. + +\paragraph{A fixed-tape depth-first schedule.} +Here we complete the implementation assertion used in +\eqref{eq:swap-recurrence}. Reserve $W$ role tapes, a fixed set of +I/O and elementary-operation work tapes, one parking stack tape, and a +separate descriptor stack. Although $W$ is large, it is fixed. +At a call boundary all reusable work tapes, other than the current I/O +and local descriptor, are empty and their heads are at their origins. +The parking and descriptor heads are at the tops of their stacks. + +Before a recursive call, append the $W-1$ inactive role streams to the +parking stack in a fixed order, with separators. Copy the active stream +to the child I/O area, and erase the parent role tapes while traversing +their current contents. Push the parent descriptor and its finite +program counter to the descriptor stack. The role and work tapes are +now available to the child, using the same tapes at every depth. +On return, copy the child output into the designated active role. +Pop the inactive streams in reverse order. To recover a stream in its +original direction, prepare its destination to the known length and +write the popped symbols from the destination's right end toward its +left end. Erase the popped stack cells as they are left. This uses +linear time and ends with the parking head at the previously saved top. +No scan passes through a parked ancestor. Cleanup is always limited to +the region visited by the current call; a reused tape is not swept to +the largest position ever visited by an ancestor. + +Each push, pop, copy, positioning operation, or erasure moves $O(V)$ +symbols at a parent node. There are only the fixed number $s$ of child +calls. This gives precisely the additional $O(V)$ term claimed above, +even though each child itself has volume $V/W$. Temporary storage is +therefore not substituted for logical volume in the factor $s/W$. + +For completeness, descriptor processing also fits this term when the +payload is one bit. Let $V_0$ be the volume at the root of one +power-width call with width $e_0=m^{k_0}$, and $V_j=V_0/W^j$ the volume +of any depth-$j$ child. Here $j\le k_0=\log_m e_0$. The root row +count is at least $W^{k_0}$, so at depth $j$ it is still at least one. +Both original chunk ranges remain present: digits outside the current +subchunks become spectators rather than being removed. Hence +\[ + V_j\ge q^{2e_0},\qquad + j\log W\le(\log_m e_0)\log W=O(e_0)=O(\log V_j). +\] +It follows that +$\log V_0=\log V_j+j\log W=O(\log(2V_j))$. +A local descriptor lists the row field, at most the current $m+m$ +fields, and a fixed number of intervals formed from intervening +spectator fields. Computing products of their lengths, subdividing +target fields, copying lengths, and storing the current instruction take +$(\log(2V_0))^{O(1)}=O(V_j)$ time at that child, since every fixed +power of $\log(2V_j)$ is $O(V_j)$. Before descending, +construct the child's descriptor by retaining its two target fields and +combining each consecutive group of spectator fields into one interval. +The ancestor's subdivision need not remain active in the child. Stack entries contain +finite instructions and binary integers, not new alphabet symbols. +These observations establish one finite machine for every recursion +depth and every choice of spectator lengths. + +\end{proof} + + +We use the rational value $\tau=1-2^{-50}$ established in +\eqref{eq:explicit-motif-exponents}. Its verification uses fixed integer +comparisons and the displayed exponential inequality; it needs no +real-arithmetic oracle. + + +\subsection{Removing width and row restrictions} + +We have proved the fast operation for power widths with enough rows. +Rows for a general array can be supplied by a few of its own high digits. +Their movement will cost less than the final bound. + +\begin{lemma}[Arbitrary-width interchange] +\label{lem:chunk-swap} +There exist fixed $0<\tau<1$ and one fixed finite-alphabet multitape +procedure with the following property. For positive integers $P,G,B$ +and $u\ge1$, it transforms an arbitrary bit array on +\[ + [P]\times[2^u]\times[G]\times[2^u]\times[B] +\] +by the address permutation +\[ + (p,h,g,d,z)\longmapsto(p,d,g,h,z) +\] +in $O(Vu^\tau)$ steps, where $V=PG B\,2^{2u}$. +The integers specifying the shape are part of the input. The time +includes their processing, all padding and unpadding, and fixed-tape +workspace cleanup. In particular, $B=1$ is allowed. +\end{lemma} + +\begin{proof} +First suppose the two ranges are $[q^e]$, where $q$ is the fixed prime +already chosen. Set +\[ + k=\lceil\log_m e\rceil,\qquad + \rho=\left\lceil\frac{k\log W}{2\log q}\right\rceil. +\] +For all sufficiently large $e$, $1\le\rho= 2.""" + require(n >= 2, "one-dimensional complementary factor is unavailable") + columns, offset = [], 0 + if n % 2: + columns.extend((2, 4, 3)) + offset = 3 + while offset < n: + columns.extend((1 << (offset + 1), 3 << offset)) + offset += 2 + require(column_rank(columns) == n, "singular factor C") + require(column_rank([c ^ (1 << i) for i, c in enumerate(columns)]) == n, + "singular factor I+C") + return columns + + +def native_difference(h): + u = len(h) + inverse = [0] * u + for i, image in enumerate(h): + inverse[image] = i + return [0] * u + [(1 << h[i]) ^ (1 << inverse[i]) for i in range(u)] + [0] * u + + +def target_difference(z, genuine_rows=1): + u = len(z) + require(genuine_rows in (1, 2, 3), "one to three genuine rows") + return [((1 << (role * u + i)) ^ (1 << (role * u + z[i]))) + if role < genuine_rows else 0 for role in range(3) for i in range(u)] + + +def two_block_encoders(h, z, genuine_rows=1): + u, n = len(h), 3 * len(h) + native_n, target_n = native_difference(h), target_difference(z, genuine_rows) + r, t = column_rank(native_n), column_rank(target_n) + native_basis, _ = jordan_basis(native_n) + target_basis, target_inverse = jordan_basis(target_n) + first, second = [0] * n, [0] * n + if r < t: + zero_size, core_size = t - r, 2 * r - t + core = irreducible_blocks(core_size) + for i in range(zero_size, 2 * zero_size): + first[t + i] = 1 << i + for i, column in enumerate(core): + first[t + 2 * zero_size + i] = column << (2 * zero_size) + for i in range(t): + second[t + i] = first[t + i] ^ (1 << i) + else: + core = irreducible_blocks(t) + for i, column in enumerate(core): + first[t + i] = column + second[t + i] = column ^ (1 << i) + extra = r - t + require(2 * t + 2 * extra <= n, "insufficient dirty helper capacity") + for i in range(extra): + first[2 * t + extra + i] = 1 << (2 * t + i) + second[2 * t + extra + i] = 1 << (2 * t + i) + require(column_rank(first) == r and column_rank(second) == r, + "factor ranks") + require(all(apply_columns(first, c) == 0 for c in second), "factor product") + encoders, metadata = [], [] + for factor in (first, second): + physical = [apply_columns(target_basis, apply_columns(factor, c)) + for c in target_inverse] + _, factor_inverse = jordan_basis(physical) + encoding = [apply_columns(native_basis, c) for c in factor_inverse] + inverse_encoding, inverse_gates = invert_and_compile(encoding) + for i, column in enumerate(encoding): + left = apply_columns(native_n, column) + right = apply_columns(encoding, physical[i]) + require(left == right, "encoder intertwining equation") + encoders.append((list(reversed(inverse_gates)), inverse_gates)) + metadata.append({"encode_xor_transfers": len(inverse_gates), + "decode_xor_transfers": len(inverse_gates), + "encoder_columns_sha256": digest(encoding), + "inverse_columns_sha256": digest(inverse_encoding)}) + require(all((a ^ b) == (1 << (i - t) if t <= i < 2 * t else 0) + for i, (a, b) in enumerate(zip(first, second))), "factor sum") + return encoders, {"bits": n, "data_volume": genuine_rows * u, + "dirty_helper_volume": (3 - genuine_rows) * u, + "native_rank": r, "target_rank": t, "encoders": metadata} + + +def query_events(k): + c = Fraction(k, 4) + return [("affine", 2, Fraction(1), ((0, Fraction(-1)),)), + ("affine", 3, Fraction(1), ((0, Fraction(1)),)), + ("affine", 5, c, ((0, 1 + c), (2, -c), (3, -c))), + ("child", 0, 5), + ("affine", 2, Fraction(1), ((0, Fraction(1)),)), + ("affine", 3, Fraction(1), ((0, Fraction(-1)),)), + ("affine", 5, -1 / c, ((0, 1 / c - 1), (2, Fraction(1)), + (3, Fraction(1))))] + + +def inverse_event(event): + if event[0] != "affine": + return event + _, target, diagonal, controls = event + return ("affine", target, 1 / diagonal, + tuple((i, -coefficient / diagonal) for i, coefficient in controls)) + + +def event_permutation(event, m, spectators=1): + result = array("I") + + def residue(value): + value = Fraction(value) + return value.numerator * pow(value.denominator, -1, m) % m + + for index in range(m ** 6): + point = coordinates(index, m) + if event[0] == "child": + _, a, b = event + point[a], point[b] = point[b], point[a] + else: + _, target, diagonal, controls = event + point[target] = (residue(diagonal) * point[target] + sum( + residue(c) * point[i] for i, c in controls)) % m + result.append(index_of(point, m)) + one = result[:] + for spectator in range(1, spectators): + result.extend(spectator * m ** 6 + i for i in one) + return result + + +def fused_events(): + return query_events(-1) + [("row_xor", 0, 1)] + query_events(2) + [ + ("row_xor", 0, 1)] + query_events(-1) + + +def run_word(word, m, cache, state=None, spectators=1): + u = spectators * m ** 6 + if state is None: + state = [1 << i for i in range(3 * u)] + else: + state = state.copy() + for event in word: + if event[0] == "bit_xor": + _, target, source = event + state[target] ^= state[source] + elif event[0] == "row_xor": + _, target, source = event + for i in range(u): + state[target * u + i] ^= state[source * u + i] + else: + if event not in cache: + cache[event] = event_permutation(event, m, spectators) + incoming = state[:u] + for old, new in enumerate(cache[event]): + state[new] = incoming[old] + return state + + +def word_json(word): + return [[event[0], *([str(x) if isinstance(x, Fraction) else x for x in event[1:]])] + if event[0] != "affine" else + ["affine", event[1], str(event[2]), [[i, str(c)] for i, c in event[3]]] + for event in word] + + +def escape_check(h, z): + encoders, result = two_block_encoders(h, z) + word = [] + for encoding, decoding in encoders: + word.extend(("bit_xor", *gate) for gate in encoding) + word.extend(fused_events()) + word.extend(("bit_xor", *gate) for gate in decoding) + cache = {} + actual = run_word(word, 3, cache) + u = len(h) + expected = [1 << z[i] for i in range(u)] + [1 << i for i in range(u, 3 * u)] + require(actual == expected, "complete two-block DATA/helper boundary") + inverse = [inverse_event(event) for event in reversed(word)] + require(run_word(inverse, 3, cache, actual) == [1 << i for i in range(3 * u)], + "complete literal inverse") + child_at = next(i for i, event in enumerate(word) if event[0] == "child") + row_at = next(i for i, event in enumerate(word) if event[0] == "row_xor") + mutants = { + "omit_ordinary_child": word[:child_at] + word[child_at + 1:], + "omit_full_row_xor": word[:row_at] + word[row_at + 1:], + "omit_final_decoder_transfer": word[:-1], + "dirty_helper_not_restored": word + [("bit_xor", 3 * u - 1, 0)], + } + controls = [] + for name, mutant in mutants.items(): + require(run_word(mutant, 3, cache) != expected, "accepted bad word: " + name) + controls.append(name) + counts = Counter(event[0] for event in word) + require(counts["child"] == 6 and counts["affine"] == 36, + "complete ordinary-child invoice") + require(counts["row_xor"] == 4, "complete row-XOR invoice") + result.update({"modulus": 3, "width": 1, "genuine_rows": 1, + "restored_dirty_rows": 2, "full_input_columns": 3 * u, + "forward_and_inverse": True, "counts": dict(sorted(counts.items())), + "word_sha256": digest(word_json(word)), + "child_volume_per_call": "V", "child_width_per_call": "N/3", + "normalized_recursive_coefficient": 6, + "controls": controls}) + lifted = [] + for event in word: + if event[0] == "bit_xor": + _, target, source = event + tr, ta = divmod(target, u) + sr, sa = divmod(source, u) + for spectator in range(2): + lifted.append(("bit_xor", tr * 2 * u + spectator * u + ta, + sr * 2 * u + spectator * u + sa)) + else: + lifted.append(event) + lifted_expected = [1 << (spectator * u + z[i]) + for spectator in range(2) for i in range(u)] + lifted_expected += [1 << i for i in range(2 * u, 6 * u)] + lifted_cache = {} + require(run_word(lifted, 3, lifted_cache, spectators=2) == lifted_expected, + "complete spectator lift") + require(run_word([inverse_event(e) for e in reversed(lifted)], 3, + lifted_cache, lifted_expected, spectators=2) + == [1 << i for i in range(6 * u)], "spectator literal inverse") + child = next(e for e in lifted if e[0] == "child") + bad_cache = dict(lifted_cache) + bad_cache[child] = array("I", list(lifted_cache[child][:u]) + list(range(u, 2 * u))) + require(run_word(lifted, 3, bad_cache, spectators=2) != lifted_expected, + "child lost a spectator fiber") + result["spectator_lift"] = {"spectators": 2, "full_input_columns": 6 * u, + "child_volume_per_call": 2 * u, + "forward_and_inverse": True, + "word_sha256": digest(word_json(lifted)), + "control": "child_lost_spectator_fiber"} + return result, word + + +def rational_lowering_check(): + checked = [] + s, r = (1, 0, 1, -1, 0, -1), (1, 0, -1, -1, 0, 1) + for k in (-2 ** 54, -4, -1, 1, 2, 2 ** 54): + for j in range(6): + point = [Fraction(i == j) for i in range(6)] + for event in query_events(k): + if event[0] == "child": + _, a, b = event + point[a], point[b] = point[b], point[a] + else: + _, target, diagonal, controls = event + point[target] = diagonal * point[target] + sum(c * point[i] for i, c in controls) + require(point == [Fraction(i == j) + Fraction(k, 4) * s[i] * r[j] + for i in range(6)], "rational native lowering") + checked.append(k) + return checked + + +def three_row_templates(): + checked_blocks = [] + for size in (2, 3): + c = irreducible_blocks(size) + a = [0] * size + c + b = [0] * size + [column ^ (1 << i) for i, column in enumerate(c)] + require(column_rank(a) == size and column_rank(b) == size, + "complementary block ranks") + require(all(apply_columns(a, v) == 0 and apply_columns(b, u) == 0 + for u, v in zip(a, b)), "complementary block product") + require([u ^ v for u, v in zip(a, b)] + == [0] * size + [1 << i for i in range(size)], + "complementary block sum") + checked_blocks.append({"size": size, "columns": c}) + cases = [] + for p, b in POWER_CASES: + if p ** b < 11: + continue + f = rank_formula(p, b) + r, t = f["centered_rank"], 3 * f["ordinary_rank_one_row"] + zero, core = t - r, 2 * r - t + require(zero >= 0 and core >= 2, "three-row template domain") + threes = core % 2 + twos = (core - 3 * threes) // 2 + require(2 * twos + 3 * threes == core, "template block coverage") + require(zero + core == r and 2 * zero + core == t, + "template exact ranks") + require(2 * t <= 3 * f["volume_per_row"], "template ambient dimension") + cases.append({"prime": p, "width": b, "modulus": p ** b, + "fused_rank": r, "target_rank": t, "zero_and_identity_size": zero, + "core_size": core, "two_dimensional_blocks": twos, + "three_dimensional_blocks": threes, + "ordinary_children": 6, "child_volume_each": "V/3", + "child_width_each": "N/3", "normalized_child_coefficient": 2}) + return {"scope": "constructive direct-sum proof; no full large-domain encoder replay", + "minimum_complete_blocks": 2, "small_blocks": checked_blocks, "cases": cases} + + +def build_receipt(): + sources = source_check() + full, small_h, small_z = [], None, None + for m in FULL_MODULI: + item, h, z = full_census(m) + full.append(item) + if m == 3: + small_h, small_z = h, z + reduced = [reduced_census(p, b) for p, b in POWER_CASES] + spectators = [rank_formula(3, 2, s) for s in (1, 2, 7)] + require(spectators[2]["centered_rank"] == 7 * spectators[0]["centered_rank"], + "spectator volume was lost") + require(full[-1]["orbits"] != 9 ** 5 + (9 ** 6 - 9 ** 5) // 9, + "short prime-power orbit control") + even_cycle = (1, 0) + even_inverse = [even_cycle.index(i) for i in range(2)] + even_centered = [(1 << even_cycle[i]) ^ (1 << even_inverse[i]) for i in range(2)] + odd_formula_on_even_cycle = 2 - len(cycle_data(even_cycle)[1]) + require(column_rank(even_centered) == 0 and odd_formula_on_even_cycle == 1, + "even two-cycle scope control") + m = 9 + one = array("I", ((x + d) % m * m + d for x in range(m) for d in range(m))) + three = array("I", ((x + 3 * d) % m * m + d for x in range(m) for d in range(m))) + require(len(cycle_data(three)[1]) > len(cycle_data(one)[1]), "nonunit-power scope control") + escape, word = escape_check(small_h, small_z) + require(escape["native_rank"] != escape["target_rank"], "single-block control") + return {"status": "PASS_NATIVE_QUERY_BOUNDARY", "base": BASE, + "classification": "scoped obstruction, constructive encoding theorem, and exact finite paid escape", + "no_new_kappa": True, "checked_sources": sources, + "source_manifest_sha256": sha256((ROOT / "SOURCES.json").read_bytes()).hexdigest(), + "full_domain": full, "prime_power_cases": reduced, + "spectator_cases": spectators, "rational_query_powers": rational_lowering_check(), + "two_block_escape": escape, "three_genuine_row_construction": three_row_templates(), + "scope_controls": ["short_prime_power_orbits", "spectator_volume", + "even_orbit", "nonunit_power", "one_block_rank"], + "search": {"randomness": None, "stopping_rule": "complete fixed coverage", + "full_moduli": list(FULL_MODULI), "prime_power_cases": len(POWER_CASES)}}, word + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--emit", type=Path, help="Write a new receipt; do not overwrite a file.") + parser.add_argument("--emit-word", type=Path, help="Write the literal escape word to a new file.") + args = parser.parse_args() + receipt, word = build_receipt() + if args.emit: + with args.emit.open("x") as out: + json.dump(receipt, out, indent=2, sort_keys=True) + out.write("\n") + else: + expected = json.loads((ROOT / "CERTIFICATE.json").read_text()) + require(canonical(expected) == canonical(receipt), "certificate does not match exact replay") + if args.emit_word: + with args.emit_word.open("x") as out: + json.dump(word_json(word), out, separators=(",", ":")) + out.write("\n") + escape = receipt["two_block_escape"] + print("PASS_NATIVE_QUERY_BOUNDARY full_addresses=" + str(sum(x["addresses"] for x in receipt["full_domain"])) + + " prime_power_cases=" + str(len(POWER_CASES)) + " dirty_columns=" + str(escape["full_input_columns"]) + + " escape_children=6 no_new_kappa") + + +if __name__ == "__main__": + main()