diff --git a/research/sol1337-global-centre-cut/.gitattributes b/research/sol1337-global-centre-cut/.gitattributes new file mode 100644 index 0000000000..6e0139e02d --- /dev/null +++ b/research/sol1337-global-centre-cut/.gitattributes @@ -0,0 +1,3 @@ +# Preserve authenticated predecessor bytes, including their CRLF line endings. +vendor/dynamic_neighbors.cpp -text +vendor/neighbors.hpp -text diff --git a/research/sol1337-global-centre-cut/BUDGET.md b/research/sol1337-global-centre-cut/BUDGET.md new file mode 100644 index 0000000000..55c69b7a81 --- /dev/null +++ b/research/sol1337-global-centre-cut/BUDGET.md @@ -0,0 +1,37 @@ +# Research decision and optimistic bill + +The assigned changed premise was coordinated retagging across different original +chart groups of the actual retained640 centre contact graph. PR4867 had closed +single, adjacent coherent pair and arbitrary-subset/single-original-group moves; +it had not permitted all 184 choices simultaneously across original groups. +The prospective scope and fixed invoice were sent to the parent before the sweep. +A public claim was not posted before the sweep finished; this file is retained +local decision evidence, not a retrospective public claim. + +The paid-only optimistic test keeps `{1:2201,2:412,3:510,4:127,5:40,8:8}` and +all helper targets `{4:28,7:7,8:47,9:326}` until actual edge repricing. It retains +all 640 original boundary charts, every native map and scalar operation, and +zero independent centre reward. Only 184 actual contact charts are variable. +Each chooses old or T_a(old), with one common declared ambient nonzero axis a. +There are 262143 such axes; the nine-chart common intersection is zero. + +The potentially problematic eight rank-eight edges are all singleton leaves, +so conditional leaf elimination exactly reduces every tariff to a cut on 176 +empty-chart contacts. A 4096-axis benchmark found only 145 distinct rank-energy +configurations and finished 1450 cuts in 0.15s. This justified all nine integer +prefix tariffs in the complete domain: the final 419 configurations and 4190 +cuts finish in a few seconds. No search seeds, random restarts or unbounded +expansion were used. + +Result: every prefix optimum is zero, hence no strict paid-moment improvement +for any 0= 2` for `0<=theta<=1`. + +For different hyperplanes, the new charts have distance two. The inherited +single-contact loss and a simple shared-edge census give + +``` +Delta >= 2*(1+7^theta-8^theta) - 2 + 2^theta + >= 2 - 2^theta > 0 (0<=theta<1). +``` + +The eight rank-eight edges have degree-four endpoints and no parallel shared +edge. At each endpoint, at least two external edges originally have rank zero; +the remaining external edge has rank at most two. Both changed endpoints +therefore cost at least two jointly outside the shared edge, whose rank remains +at least six. Even granting independent best cases for all these obligations, + +``` +Delta >= 2 + 6^theta - 8^theta >= 2 - 2^theta > 0 + (0<=theta<1). +``` + +Their full nominal 8,355,872 independent-neighbour assignments were **not +scanned**: this complete optimistic bill stops the route analytically. The +actual eight edge inventories are regenerated and compared exactly against +pairs/RANK8-CENSUS.json. The written proof supplies the metric/concavity +implications; the finite screen and census provide their source-specific data. +Thus every nontrivial independent-neighbour move on any one actual adjacent +internal pair strictly loses for `0<=theta<1`. No strict endpoint claim at +theta=1, changed word/target, larger independent block or new kappa is supplied. + +Direct replay, requiring Python3 and C++20 g++: + +``` +python3 -I -W error -B research/sol1337-global-centre-cut/verify_pairs.py +python3 -I -O -W error -B research/sol1337-global-centre-cut/verify_pairs.py +``` + +Expected output is `PASS_INDEPENDENT_ADJACENT_PAIRS opposite_cases=261632 +profiles=44 rank0_edges=256 rank8_edges=8 graph_controls=3`. The wrapper also +checks the actual C++ entry point rejects a negative paid sign, nonidentity +shared map and an inconsistent simple-edge domain. The original Python's +same/opposite-neighbour and unsupported rank-inventory controls remain active. + +Credit PR4867's Cinna Davis/Cao Yifan/David Ganz lineage, the separate producer +agent's exact screen and analytic extension, and Nick Petalas PR4864's general +tuple/cycle geometry. Source attribution and substantial OpenAI Codex assistance +are retained. No predecessor scientific source or original common-axis result +was edited. Primary research toward higher kappa proceeds through a different +changed-operation/complete-invoice gate; no further graph search is proposed. diff --git a/research/sol1337-global-centre-cut/PROOF.md b/research/sol1337-global-centre-cut/PROOF.md new file mode 100644 index 0000000000..1fc4ecbe6a --- /dev/null +++ b/research/sol1337-global-centre-cut/PROOF.md @@ -0,0 +1,73 @@ +# Exact conditional-leaf cut + +Fix a nonzero ambient axis a, and let x_v choose between L_v and T_a L_v. +Every internal map is identity. Simultaneously transforming both charts preserves +their distance, so an internal edge of old rank r has ranks + +``` +r00=r11=r, r10=r01=r+d, d in {-1,0,1}. +``` + +The r10=r01 equality also follows by applying the symplectic involution T_a to +both sides. The imported local rank-change formula computes d; each of the 419 +retained complete rank configurations is independently checked by binary row +elimination, including both one-endpoint ranks and the two-endpoint invariant. +External mapped neighbours are pulled back to the variable's chart coordinates; +their actual changed ranks are also checked by row elimination. + +For any tariff h with h(0)=0, the changed invoice is + +``` +E(x) = sum_v D_v x_v + sum_internal uv w_uv |x_u-x_v|, +w_uv = h(r+d)-h(r). +``` + +D_v is the sum of every incident external changed-edge charge. Fixed-fixed +edges cancel. Exact graph checks find 256 internal rank-zero edges among 176 +empty-chart contacts and eight rank-eight edges. Each rank-eight edge joins +one empty-chart contact u to a distinct nonempty-chart contact v, and each such +v has internal degree 1. There are no other nonempty-chart contacts. + +For h_j(r)=min(r,j), rank-zero edge weights are 0 or1. A rank-eight weight may +be negative; no direct submodularity assumption is made. Eliminate its leaf v +conditionally on x_u. Its exact contribution is + +``` +A=min(0,D_v+w) if x_u=0, +B=min(w,D_v) if x_u=1. +``` + +Thus add A to the offset and B-A to D_u. This removes every potentially +negative internal edge, preserving the exact optimum. It is equivalent to +flipping a singleton bit on each antiferromagnetic edge; leaf topology prevents +any frustrated signed cycle. The remaining 176-variable energy has nonnegative +pair weights and arbitrary integer unaries, and therefore is an ordinary s-t +cut. For each cut, the implementation lifts the original leaf choices and +recounts the complete 184-variable rank histogram; its integer tariff agrees +exactly with the computed optimum. Feasible conserved flow and an equal-capacity +attaining cut prove optimality without a numerical solver tolerance. + +Every nonzero18-bit axis is enumerated literally. A configuration signature +retains the changed rank of every external incident edge and the one-endpoint +rank of every internal edge. These data fully determine E, since internal00 +and11 ranks remain old and 01 equals 10. Equal signatures therefore permit exact +reuse of all tariff optima; they do not equate charts. The complete 262143-axis +domain yields 419 such configurations. All 419*9 integer prefix minima are 0. +The unchanged choice directly attains 0. + +For any candidate rank change d_r, let q_j=j^theta-(j-1)^theta. Finite summation +by parts gives + +``` +sum_r d_r r^theta + = sum_(j=1)^8 S_j(d) (q_j-q_(j+1)) + S_9(d) q_9. +``` + +For 0= 0. +``` + +The summation identity in PROOF.md implies nonnegative paid-moment change for +every `0=2`. Different-hyperplane geometry, transferred +PR4867 single/coherent-pair bounds and the exact eight rank-eight edge inventories +close **every independent adjacent pair**, with strict loss for `0<=theta<1`. +The nominal 8,355,872 rank-eight assignments were not scanned; their complete +optimistic bill already gives `2+6^theta-8^theta>=2-2^theta>0`. + +``` +python3 -I -W error -B research/sol1337-global-centre-cut/verify_pairs.py +python3 -I -O -W error -B research/sol1337-global-centre-cut/verify_pairs.py +``` + +The pair wrapper is additionally registered alongside the unchanged original +commands. It regenerates exact graph bytes, runs producer code only in scratch, +checks source hashes and exact receipts, and rejects three actual malformed +input graphs. Producer provenance and credit are retained in pairs/ORIGIN.json, +pairs/SOURCES.json and the top-level source manifest. No extra PR, changed graph +search, native witness or new kappa is supplied. The smallest useful next step +is the changed central function/consumer complete-invoice gate in TASK.json. diff --git a/research/sol1337-global-centre-cut/SCREEN.json b/research/sol1337-global-centre-cut/SCREEN.json new file mode 100644 index 0000000000..e6338cf76f --- /dev/null +++ b/research/sol1337-global-centre-cut/SCREEN.json @@ -0,0 +1 @@ +{"axis_limit":262143,"complete_axis_domain":true,"distinct_rank_configurations":419,"cut_cases":4190,"independent_rank_configuration_checks":419,"moment_theta":"0.9969782242","moment_scale":10000000000,"results":[{"tariff":0,"negative_configurations":0,"minimum_integer_delta":0,"best_axis":0,"best_delta":[0,0,0,0,0,0,0,0,0,0],"best_selected":[]},{"tariff":1,"negative_configurations":0,"minimum_integer_delta":0,"best_axis":0,"best_delta":[0,0,0,0,0,0,0,0,0,0],"best_selected":[]},{"tariff":2,"negative_configurations":0,"minimum_integer_delta":0,"best_axis":0,"best_delta":[0,0,0,0,0,0,0,0,0,0],"best_selected":[]},{"tariff":3,"negative_configurations":0,"minimum_integer_delta":0,"best_axis":0,"best_delta":[0,0,0,0,0,0,0,0,0,0],"best_selected":[]},{"tariff":4,"negative_configurations":0,"minimum_integer_delta":0,"best_axis":0,"best_delta":[0,0,0,0,0,0,0,0,0,0],"best_selected":[]},{"tariff":5,"negative_configurations":0,"minimum_integer_delta":0,"best_axis":0,"best_delta":[0,0,0,0,0,0,0,0,0,0],"best_selected":[]},{"tariff":6,"negative_configurations":0,"minimum_integer_delta":0,"best_axis":0,"best_delta":[0,0,0,0,0,0,0,0,0,0],"best_selected":[]},{"tariff":7,"negative_configurations":0,"minimum_integer_delta":0,"best_axis":0,"best_delta":[0,0,0,0,0,0,0,0,0,0],"best_selected":[]},{"tariff":8,"negative_configurations":0,"minimum_integer_delta":0,"best_axis":0,"best_delta":[0,0,0,0,0,0,0,0,0,0],"best_selected":[]},{"tariff":9,"negative_configurations":0,"minimum_integer_delta":0,"best_axis":0,"best_delta":[0,0,0,0,0,0,0,0,0,0],"best_selected":[]}]} diff --git a/research/sol1337-global-centre-cut/SOURCES.json b/research/sol1337-global-centre-cut/SOURCES.json new file mode 100644 index 0000000000..5c7281a69f --- /dev/null +++ b/research/sol1337-global-centre-cut/SOURCES.json @@ -0,0 +1,250 @@ +{ + "schema_version": 1, + "base_commit": "624de9dc66858af0945e5f8a0942488d62280d43", + "files": [ + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "f126dd2e2dad2b669e75d1d0d0bd05c600725602", + "sha256": "f7a48bfa2659b88378282a8eee7d9fe52cdf505594124c4d1686b58510fffd72" + }, + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "c35482cd9035843b15a634cc8276a7e1e40e8395", + "sha256": "6fe0a099b89aa2aed796a13c3a21dafc63f3388ebf397464e44e0451893b9375" + }, + { + "path": "research/sol1337-contact-frontier/build_graph.py", + "usage": "provenance", + "git_blob": "f68c8ea2e6139b02cdc91afd60bae52f9c9d695c", + "sha256": "f21740584ee9f6351f7b7ab175960b6489596a41781d9cc601c6420570b27378", + "pin": "head:5e4cce12a9851fbb46cd7c32cc8177e983771539:research/sol1337-contact-frontier/build_graph.py" + }, + { + "path": "research/sol1337-global-centre-cut/build_graph.py", + "usage": "input", + "git_blob": "f68c8ea2e6139b02cdc91afd60bae52f9c9d695c", + "sha256": "f21740584ee9f6351f7b7ab175960b6489596a41781d9cc601c6420570b27378", + "pin": "head:159eb73dd70ccdb03af6f61435135c026cf9886a:research/sol1337-global-centre-cut/build_graph.py" + }, + { + "path": "research/sol1337-contact-frontier/vendor/dynamic_neighbors.cpp", + "usage": "provenance", + "git_blob": "9869fb978b6ef16c76fefecb402def44505d066c", + "sha256": "86985b01679acc3d2acefe084d14e94e2e2d1013357265b19512867049d7acec", + "pin": "head:5e4cce12a9851fbb46cd7c32cc8177e983771539:research/sol1337-contact-frontier/vendor/dynamic_neighbors.cpp" + }, + { + "path": "research/sol1337-global-centre-cut/vendor/dynamic_neighbors.cpp", + "usage": "input", + "git_blob": "9869fb978b6ef16c76fefecb402def44505d066c", + "sha256": "86985b01679acc3d2acefe084d14e94e2e2d1013357265b19512867049d7acec", + "pin": "head:159eb73dd70ccdb03af6f61435135c026cf9886a:research/sol1337-global-centre-cut/vendor/dynamic_neighbors.cpp" + }, + { + "path": "research/sol1337-contact-frontier/vendor/neighbors.hpp", + "usage": "provenance", + "git_blob": "140c4affb5aacde5d7c9a304698944018b137c37", + "sha256": "30ff3162c5f6ad4cf212c6b2775f871c1b8f587c027c83fcbfd87b66bbff65cf", + "pin": "head:5e4cce12a9851fbb46cd7c32cc8177e983771539:research/sol1337-contact-frontier/vendor/neighbors.hpp" + }, + { + "path": "research/sol1337-global-centre-cut/vendor/neighbors.hpp", + "usage": "input", + "git_blob": "140c4affb5aacde5d7c9a304698944018b137c37", + "sha256": "30ff3162c5f6ad4cf212c6b2775f871c1b8f587c027c83fcbfd87b66bbff65cf", + "pin": "head:159eb73dd70ccdb03af6f61435135c026cf9886a:research/sol1337-global-centre-cut/vendor/neighbors.hpp" + }, + { + "path": "research/sol1337-contact-frontier/vendor/model.py", + "usage": "provenance", + "git_blob": "a69138e4014424235345f3301fbe6b097caa1b8c", + "sha256": "7cc29edccb3679b2a5c9defeeb0a2ec6bcef9b01b97c2390bebc48f366395f1f", + "pin": "head:5e4cce12a9851fbb46cd7c32cc8177e983771539:research/sol1337-contact-frontier/vendor/model.py" + }, + { + "path": "research/sol1337-global-centre-cut/vendor/model.py", + "usage": "input", + "git_blob": "a69138e4014424235345f3301fbe6b097caa1b8c", + "sha256": "7cc29edccb3679b2a5c9defeeb0a2ec6bcef9b01b97c2390bebc48f366395f1f", + "pin": "head:159eb73dd70ccdb03af6f61435135c026cf9886a:research/sol1337-global-centre-cut/vendor/model.py" + }, + { + "path": "research/sol1337-contact-frontier/vendor/retained_verify.py", + "usage": "provenance", + "git_blob": "357cbff9874ce920c5b5ad839fd47d3f9c728bcb", + "sha256": "f5a67954f19dddc688460b91e5c1729d7820755c53313159ed136e4447021214", + "pin": "head:5e4cce12a9851fbb46cd7c32cc8177e983771539:research/sol1337-contact-frontier/vendor/retained_verify.py" + }, + { + "path": "research/sol1337-global-centre-cut/vendor/retained_verify.py", + "usage": "input", + "git_blob": "357cbff9874ce920c5b5ad839fd47d3f9c728bcb", + "sha256": "f5a67954f19dddc688460b91e5c1729d7820755c53313159ed136e4447021214", + "pin": "head:159eb73dd70ccdb03af6f61435135c026cf9886a:research/sol1337-global-centre-cut/vendor/retained_verify.py" + }, + { + "path": "research/sol1337-contact-frontier/inputs/round3-native.json.gz", + "usage": "provenance", + "git_blob": "46d929df83817b85a5387bcdb9745e0627d6366e", + "sha256": "7679daa4ec6a40f56fc7f0202379a6f454310e94945aba4f48beaaaafb838d05", + "pin": "head:5e4cce12a9851fbb46cd7c32cc8177e983771539:research/sol1337-contact-frontier/inputs/round3-native.json.gz" + }, + { + "path": "research/sol1337-global-centre-cut/inputs/round3-native.json.gz", + "usage": "input", + "git_blob": "46d929df83817b85a5387bcdb9745e0627d6366e", + "sha256": "7679daa4ec6a40f56fc7f0202379a6f454310e94945aba4f48beaaaafb838d05", + "pin": "head:159eb73dd70ccdb03af6f61435135c026cf9886a:research/sol1337-global-centre-cut/inputs/round3-native.json.gz" + }, + { + "path": "research/sol1337-contact-frontier/LICENSE", + "usage": "provenance", + "git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "pin": "head:5e4cce12a9851fbb46cd7c32cc8177e983771539:research/sol1337-contact-frontier/LICENSE" + }, + { + "path": "research/sol1337-global-centre-cut/LICENSE", + "usage": "input", + "git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "pin": "head:159eb73dd70ccdb03af6f61435135c026cf9886a:research/sol1337-global-centre-cut/LICENSE" + }, + { + "path": "research/sol1337-contact-frontier/NOTICE.md", + "usage": "provenance", + "git_blob": "e258d3d8c7fdf2f88c671e0acd12080584b2dd69", + "sha256": "7b57d9de52da092e2133d8e4cfdef72938b50dc5640334cc616107b053fcbfc7", + "pin": "head:5e4cce12a9851fbb46cd7c32cc8177e983771539:research/sol1337-contact-frontier/NOTICE.md" + }, + { + "path": "research/sol1337-global-centre-cut/NOTICE.md", + "usage": "input", + "git_blob": "e258d3d8c7fdf2f88c671e0acd12080584b2dd69", + "sha256": "7b57d9de52da092e2133d8e4cfdef72938b50dc5640334cc616107b053fcbfc7", + "pin": "head:159eb73dd70ccdb03af6f61435135c026cf9886a:research/sol1337-global-centre-cut/NOTICE.md" + }, + { + "path": "research/sol1337-contact-frontier/tools/scan_block_prefix.cpp", + "usage": "provenance", + "git_blob": "deb0219e6acfd68059919877a0ca1cd73344e6f2", + "sha256": "3905261cd35215dec6b88c15f5a48cdeb1431129271fc75915e692724c4bad09", + "pin": "head:5e4cce12a9851fbb46cd7c32cc8177e983771539:research/sol1337-contact-frontier/tools/scan_block_prefix.cpp" + }, + { + "path": "research/sol1337-global-centre-cut/pairs/HANDOFF.md", + "usage": "input", + "pin": "head:acabfdfe148fedc4d683cc7630209e0640aa3896:research/sol1337-global-centre-cut/pairs/HANDOFF.md", + "git_blob": "818479f6e6745e9cc5181f43ee0c6a4f976ccb0f", + "sha256": "19a16056c651de93846d989050a21df74fd6c06b6fc0e314861c2be807585d38" + }, + { + "path": "research/sol1337-global-centre-cut/pairs/ORIGIN.json", + "usage": "input", + "pin": "head:acabfdfe148fedc4d683cc7630209e0640aa3896:research/sol1337-global-centre-cut/pairs/ORIGIN.json", + "git_blob": "059bfe46db0cebb2e98f87889c0f9f81142088e8", + "sha256": "450aea1064edf19cc7e99ffa65d559435d3f1f7d8a0fcb515beed64eededb098" + }, + { + "path": "research/sol1337-global-centre-cut/pairs/PROOF.md", + "usage": "input", + "pin": "head:acabfdfe148fedc4d683cc7630209e0640aa3896:research/sol1337-global-centre-cut/pairs/PROOF.md", + "git_blob": "3fb0936a756b0f019a2f0c481b2d1a9899050e17", + "sha256": "6c2f23f489e3699676a45dde4a95d9ca54cd0d81ef272899c84545eb24c2dd4e" + }, + { + "path": "research/sol1337-global-centre-cut/pairs/RANK8-CENSUS.json", + "usage": "input", + "pin": "head:acabfdfe148fedc4d683cc7630209e0640aa3896:research/sol1337-global-centre-cut/pairs/RANK8-CENSUS.json", + "git_blob": "479a7919f78529e6c8969e0695ec671c27198bec", + "sha256": "be56fadef96a5b78e1822dd8b5e8f43ca197fc41e9a31c71cc8f8b1b7c69c0b9" + }, + { + "path": "research/sol1337-global-centre-cut/pairs/SCREEN.json", + "usage": "input", + "pin": "head:acabfdfe148fedc4d683cc7630209e0640aa3896:research/sol1337-global-centre-cut/pairs/SCREEN.json", + "git_blob": "897d1c9d926f67dd176735c956fe6704c3d05d95", + "sha256": "41db057ba61fa47d4f0682fb81ccd33c76b1623fc5dfd3f7dc2b4940e57afc47" + }, + { + "path": "research/sol1337-global-centre-cut/pairs/SOURCES.json", + "usage": "input", + "pin": "head:acabfdfe148fedc4d683cc7630209e0640aa3896:research/sol1337-global-centre-cut/pairs/SOURCES.json", + "git_blob": "50bdddde11417a73d3e67ba178005c4b79d85cca", + "sha256": "d486993ac7c11b96d716d18c04dd7c52c40a14f9e0f5c67bc1239f0e4dca8cad" + }, + { + "path": "research/sol1337-global-centre-cut/pairs/VERIFY.json", + "usage": "input", + "pin": "head:acabfdfe148fedc4d683cc7630209e0640aa3896:research/sol1337-global-centre-cut/pairs/VERIFY.json", + "git_blob": "5131c06bf62b49c9f4e8b71e2a6928f3dad39161", + "sha256": "24925961940639163898092043bffba1341c041b46bd4f8880d79fcf66b71bf9" + }, + { + "path": "research/sol1337-global-centre-cut/pairs/paired-contact-screen.json", + "usage": "input", + "pin": "head:acabfdfe148fedc4d683cc7630209e0640aa3896:research/sol1337-global-centre-cut/pairs/paired-contact-screen.json", + "git_blob": "31526472b84d6b76847879192f31f801afb0fbe7", + "sha256": "0108a1b8ad8196c5ecee18d5252bbe4f798a94d7e011b3549204bc2d1ac2a7b8" + }, + { + "path": "research/sol1337-global-centre-cut/pairs/scan.cpp", + "usage": "input", + "pin": "head:acabfdfe148fedc4d683cc7630209e0640aa3896:research/sol1337-global-centre-cut/pairs/scan.cpp", + "git_blob": "12c78e6b06e7fa5632578c63c2b50e0aa2502e8b", + "sha256": "83d4c15fef56988620e1f474f7662863b87ced5e133dd40a36fd56dfec49516a" + }, + { + "path": "research/sol1337-global-centre-cut/pairs/single-contact-screen.json", + "usage": "input", + "pin": "head:acabfdfe148fedc4d683cc7630209e0640aa3896:research/sol1337-global-centre-cut/pairs/single-contact-screen.json", + "git_blob": "df49c9d3a07a739b62266fece2cdfd1a8fa10493", + "sha256": "7c31e2436f8206da384b6d2b917d79f4cb0f62065880eb6d60ccf477e50e21fe" + }, + { + "path": "research/sol1337-global-centre-cut/pairs/verify.py", + "usage": "input", + "pin": "head:acabfdfe148fedc4d683cc7630209e0640aa3896:research/sol1337-global-centre-cut/pairs/verify.py", + "git_blob": "c3540735a9183e20f280e82f993d549236c1b3ed", + "sha256": "60f71618f13fa8c144ec0865155db255738187c8b86af2bd4824b62320db5123" + }, + { + "path": "research/sol1337-contact-frontier/single-contact-screen.json", + "usage": "provenance", + "pin": "head:5e4cce12a9851fbb46cd7c32cc8177e983771539:research/sol1337-contact-frontier/single-contact-screen.json", + "git_blob": "df49c9d3a07a739b62266fece2cdfd1a8fa10493", + "sha256": "7c31e2436f8206da384b6d2b917d79f4cb0f62065880eb6d60ccf477e50e21fe" + }, + { + "path": "research/sol1337-contact-frontier/paired-contact-screen.json", + "usage": "provenance", + "pin": "head:5e4cce12a9851fbb46cd7c32cc8177e983771539:research/sol1337-contact-frontier/paired-contact-screen.json", + "git_blob": "31526472b84d6b76847879192f31f801afb0fbe7", + "sha256": "0108a1b8ad8196c5ecee18d5252bbe4f798a94d7e011b3549204bc2d1ac2a7b8" + }, + { + "path": "research/sol1337-contact-frontier/PROOF.md", + "usage": "provenance", + "pin": "head:5e4cce12a9851fbb46cd7c32cc8177e983771539:research/sol1337-contact-frontier/PROOF.md", + "git_blob": "a075a7ac0a9ad8bfbb5bd2087d69898ff0cc163e", + "sha256": "b8cf0a690ccf14add88ae488433ab60a80fc1aebdff59d2885252b7d36aa6507" + } + ], + "citation_only": [ + { + "pr": 4864, + "author": "Nick Petalas", + "head": "eac6ce76eeabdd027b6cb5cbedd0e006e784bfce", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/4864", + "usage": "General tuple/cycle neighborhood geometry; not imported or executed. Present sweep literally enumerates ambient nonzero axes." + } + ], + "producer_addendum": { + "retained_scientific_commit": "acabfdfe148fedc4d683cc7630209e0640aa3896", + "origin_receipt": "research/sol1337-global-centre-cut/pairs/ORIGIN.json", + "origin_directory": "dyadic-full-controller-20261023/outputs/opposite-neighbour-pairs", + "status": "Producer files authenticated by SHA256 and retained byte-for-byte; original common-axis science unchanged. Runtime wrapper builds graph and executes output-writing producer replay only in scratch." + } +} diff --git a/research/sol1337-global-centre-cut/SOURCES.local.json b/research/sol1337-global-centre-cut/SOURCES.local.json new file mode 100644 index 0000000000..4bebfa69a1 --- /dev/null +++ b/research/sol1337-global-centre-cut/SOURCES.local.json @@ -0,0 +1,50 @@ +[ + { + "path": "build_graph.py", + "source_commit": "5e4cce12a9851fbb46cd7c32cc8177e983771539", + "source_path": "research/sol1337-contact-frontier/build_graph.py", + "sha256": "f21740584ee9f6351f7b7ab175960b6489596a41781d9cc601c6420570b27378" + }, + { + "path": "vendor/dynamic_neighbors.cpp", + "source_commit": "5e4cce12a9851fbb46cd7c32cc8177e983771539", + "source_path": "research/sol1337-contact-frontier/vendor/dynamic_neighbors.cpp", + "sha256": "86985b01679acc3d2acefe084d14e94e2e2d1013357265b19512867049d7acec" + }, + { + "path": "vendor/neighbors.hpp", + "source_commit": "5e4cce12a9851fbb46cd7c32cc8177e983771539", + "source_path": "research/sol1337-contact-frontier/vendor/neighbors.hpp", + "sha256": "30ff3162c5f6ad4cf212c6b2775f871c1b8f587c027c83fcbfd87b66bbff65cf" + }, + { + "path": "vendor/model.py", + "source_commit": "5e4cce12a9851fbb46cd7c32cc8177e983771539", + "source_path": "research/sol1337-contact-frontier/vendor/model.py", + "sha256": "7cc29edccb3679b2a5c9defeeb0a2ec6bcef9b01b97c2390bebc48f366395f1f" + }, + { + "path": "vendor/retained_verify.py", + "source_commit": "5e4cce12a9851fbb46cd7c32cc8177e983771539", + "source_path": "research/sol1337-contact-frontier/vendor/retained_verify.py", + "sha256": "f5a67954f19dddc688460b91e5c1729d7820755c53313159ed136e4447021214" + }, + { + "path": "inputs/round3-native.json.gz", + "source_commit": "5e4cce12a9851fbb46cd7c32cc8177e983771539", + "source_path": "research/sol1337-contact-frontier/inputs/round3-native.json.gz", + "sha256": "7679daa4ec6a40f56fc7f0202379a6f454310e94945aba4f48beaaaafb838d05" + }, + { + "path": "LICENSE", + "source_commit": "5e4cce12a9851fbb46cd7c32cc8177e983771539", + "source_path": "research/sol1337-contact-frontier/LICENSE", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + }, + { + "path": "NOTICE.md", + "source_commit": "5e4cce12a9851fbb46cd7c32cc8177e983771539", + "source_path": "research/sol1337-contact-frontier/NOTICE.md", + "sha256": "7b57d9de52da092e2133d8e4cfdef72938b50dc5640334cc616107b053fcbfc7" + } +] diff --git a/research/sol1337-global-centre-cut/TASK.json b/research/sol1337-global-centre-cut/TASK.json new file mode 100644 index 0000000000..da839c0eee --- /dev/null +++ b/research/sol1337-global-centre-cut/TASK.json @@ -0,0 +1,72 @@ +{ + "schema_version": 1, + "task_id": "complex-rank-shape-decoder", + "priority_revision": 7, + "base_commit": "624de9dc66858af0945e5f8a0942488d62280d43", + "original_card": { + "id": "complex-rank-shape-decoder", + "question": "Can a decoder deliver the local paid mass in fewer, larger-rank children (block frame climbs instead of rank-1 to rank-3 steps)?", + "starting_points": [ + "docs/research/research-family-status.md", + "research/complex-local-word-ceiling/README.md", + "research/complex-decoder-field-extension-seed44/README.md", + "research/complex-frame-pair-decoders/README.md", + "research/selected-k8-unrestricted-ends/README.md", + "research/eisenstein-reduction-copy-floor/README.md" + ], + "methods": [ + "Find one exact small decoding identity whose frame path climbs in blocks, and price its complete per-call profile.", + "Bound the best effective child rank achievable for one fixed support alphabet, including copies, frames and restoration." + ], + "acceptance_gate": "A per-call local profile, with all copied information, frames and restoration counted, whose ceiling exceeds the selected word's by at least 5%; masked or overcomplete supports must change an assumption of the eight-term all-pairs bound. A scoped local result may be retained without a complete supplier. Expanding it into further construction rounds requires the family-level budget and obligation gate in research-family-status.md; an optimistic passing relaxation alone is not acceptance.", + "first_step": { + "command": [ + "python3", + "-B", + "research/complex-local-word-ceiling/verify.py" + ], + "expected": "PASS_COMPLEX_LOCAL_WORD_CEILING", + "inspect": "Read the selected word's per-call local profile, its packing ceiling and the lever table; run levers.py for the ideal budget of the lever you target.", + "scope": "Positive control and planning budget only; this is not a new construction or full cold replay." + }, + "first_experiment": "Before any synthesis, write the candidate per-call local profile (and centre charge / unpaid coordinates if changed) and screen it with ceiling.ceiling(); reject it if even the ideal ceiling does not beat the selected word's by your stated margin. Ideal budget: rank-16 delivery is 2.31x (levers.py).", + "bottleneck_link": "Rank-1 children are about half of recursive cost; the selected word's effective child rank is about 3.9. Larger-rank delivery lowers recursive cost per unit of paid mass.", + "allowed_variations": [ + "One masked, overcomplete or block decoder family with exact labels and supports.", + "A scoped lower bound on effective rank for one alphabet.", + "If the coverage law, template or guard changes, derive an applicable fully charged replacement bound instead of applying the incumbent ceiling outside its scope." + ], + "scope_change_triggers": [ + "Repacking idle remainders of an unchanged word (covered by the packing ceiling).", + "Repeating the eight-term all-pairs search inside its proved scope.", + "Only changing helper terminal subspaces and monotone frames within the fixed scalar word, entrances and cleanup contract already covered by #1995/#2013.", + "Searching below C=40 in the #2017 Eisenstein binary scalar-rectangle or fixed-support block-linear additive pairing model; specify a changed premise instead. This bound does not cover every complex decoder.", + "Continuing a partial cost improvement while leaving the same unpriced consumer, restoration or central-readout obligation unresolved; refresh the family expansion decision first. Local product-retiming evidence has a narrow scope and is not a ban on changed graphs or contracts." + ], + "overlap_terms": [ + "rank shape", + "block climb", + "masked decoder", + "overcomplete", + "effective rank" + ] + }, + "scope_status": "changed", + "actual_scope": "Two exact source-bound retained640 paid ceilings: every subset of184 new centre contacts under one common nonzero18-bit transvection; and arbitrary independent nontrivial distance-one neighbours at both endpoints of any of264 adjacent internal edges.", + "scope_change_reason": "The assigned original scope removed PR4867 single-original-group restriction. A separately claimed additive pair direction now also removes its coherent-axis restriction at one adjacent pair. The common-axis scientific files are frozen unchanged; exact opposite-neighbour screening and analytic source-census bounds close every independent adjacent-pair assignment. The original card remains a changed-scope paid-invoice ceiling rather than a proposed profitable rank-shape construction.", + "bottleneck_link": "A real profitable change in the complete centre/incident recursive paid profile would be a necessary first gate toward a higher kappa. This complete common-axis grammar fails that optimistic gate, preventing unsupported downstream compiler expansion.", + "budget_minutes": 60, + "stop_rule": "Stop after the complete common-axis result and the one additive independent adjacent-pair result. No larger independent block, new graph search, changed operation, caller, compiler, root or seed expansion is part of this archival package.", + "outcome": "negative-result", + "evidence": "Original262143-axis/419-configuration result:3771 exact integer-prefix cuts show nonimprovement for every0=2. Independent Python exactly matches C++ counts; exact transferred PR4867 single/pair receipts and source-specific simple-edge/rank8 census analytically close every independent adjacent pair with strict loss for0<=theta<1. Nominal8355872 rank8 assignments were not scanned. Actual graph mutation controls reject; no floating moment is a proof premise.", + "author": "Prepared for Chris R", + "ai_assistance": "Substantial OpenAI Codex assistance; dedicated user-authorized gpt-6.1-sol HIGH research agent, followed by separate read-only agent audit and parent replay.", + "open_questions": [ + { + "question": "Can one literal changed central source function or changed actual consumer remove paid work under a complete chronological invoice?", + "why_it_matters": "The complete common-axis and all independent adjacent-pair grammars now fail the optimistic fixed-word paid gate. A higher kappa requires a changed mechanism with actual eliminated work.", + "first_step": "Specify one changed operation/function and source/caller boundary, with all640 arbitrary inputs,408 helper obligations and full completion charges. Price its complete optimistic invoice before implementation or further search.", + "blocked_by": "No profitable replacement or complete owned-caller, compiler, precision and outer funding is supplied by either ceiling." + } + ] +} diff --git a/research/sol1337-global-centre-cut/VERIFY.json b/research/sol1337-global-centre-cut/VERIFY.json new file mode 100644 index 0000000000..54d89c9f8d --- /dev/null +++ b/research/sol1337-global-centre-cut/VERIFY.json @@ -0,0 +1,67 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/sol1337-global-centre-cut/build_graph.py", + "research/sol1337-global-centre-cut/vendor/dynamic_neighbors.cpp", + "research/sol1337-global-centre-cut/vendor/neighbors.hpp", + "research/sol1337-global-centre-cut/vendor/model.py", + "research/sol1337-global-centre-cut/vendor/retained_verify.py", + "research/sol1337-global-centre-cut/inputs/round3-native.json.gz", + "research/sol1337-global-centre-cut/LICENSE", + "research/sol1337-global-centre-cut/NOTICE.md", + "research/sol1337-global-centre-cut/pairs/HANDOFF.md", + "research/sol1337-global-centre-cut/pairs/ORIGIN.json", + "research/sol1337-global-centre-cut/pairs/PROOF.md", + "research/sol1337-global-centre-cut/pairs/RANK8-CENSUS.json", + "research/sol1337-global-centre-cut/pairs/SCREEN.json", + "research/sol1337-global-centre-cut/pairs/SOURCES.json", + "research/sol1337-global-centre-cut/pairs/VERIFY.json", + "research/sol1337-global-centre-cut/pairs/paired-contact-screen.json", + "research/sol1337-global-centre-cut/pairs/scan.cpp", + "research/sol1337-global-centre-cut/pairs/single-contact-screen.json", + "research/sol1337-global-centre-cut/pairs/verify.py" + ], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 180, + "checks": "Authenticates retained640 sources; all262143 axes,419 complete rank configurations,3771 exact integer-prefix cuts plus rounded diagnostic; three invoice/topology rejection controls. Requires C++20 g++ on PATH. No native/phase/caller/outer/Lean replay." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-W", + "error", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 180, + "checks": "Same exact bounded verifier under optimized Python; explicit exceptions and C++ checks remain active." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-W", + "error", + "-B", + "{package}/verify_pairs.py" + ], + "timeout_seconds": 180, + "checks": "Additive all-adjacent-independent-neighbour ceiling: authenticates producer sources, full261632-case opposite-neighbour C++ scan and independent Python replay,44 histogram counts, transferred exact PR4867 bounds, all8 rank8 incidence records and3 actual graph controls. Analytic bounds close unscanned rank8/different-hyperplane domains. Requires C++20 g++; no new graph search or native/caller/outer/Lean replay." + } + ] +} diff --git a/research/sol1337-global-centre-cut/build_graph.py b/research/sol1337-global-centre-cut/build_graph.py new file mode 100644 index 0000000000..f68c8ea2e6 --- /dev/null +++ b/research/sol1337-global-centre-cut/build_graph.py @@ -0,0 +1,118 @@ +#!/usr/bin/env python3 +"""Expose retained arbitrary centers to phase-exact contact compilation. + +Apache-2.0. Substantial OpenAI Codex assistance. Credit Cinna Davis #4694, +Cao Yifan #4610, and Dugongue #4841's inverse-image chart convention. +This emits discovery constraints, not a physical supplier certificate. +""" +from collections import Counter +from hashlib import sha256 +from pathlib import Path +import argparse +import gzip +import json +import sys + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parent.parent +sys.path.insert(0, str(HERE / 'vendor')) +import model as M +import retained_verify as R + + +def build(output): + raw = (HERE / 'inputs/round3-native.json.gz').read_bytes() + M.need(sha256(raw).hexdigest() == R.SOURCE_HASH, 'exact retained native bytes') + p = json.loads(gzip.decompress(raw)) + c = p['canonical'] + frames = c['frames'] + starts, centers, events = R.emit(p) + nodes, labels, edges = [], [], [] + selected = [] + + def new(f, label): + n = len(nodes) + nodes.append(f) + labels.append(label) + return n + + cur = [new(f, ['entry', r]) for r, f in enumerate(starts)] + maps = {w['op']: w['G_columns'] for w in c['warps']} + maps.update({-op: M.inv(g) for op, g in list(maps.items())}) + matrices = [[1 << i for i in range(18)]] + map_ids = {} + for op, g in maps.items(): + gi = M.inv(g) + git = [sum(((gi[j] >> i) & 1) << j for j in range(9)) for i in range(9)] + + def symplectic(v): + x, z = v & 511, v >> 9 + gx = M.mv(g, x) + return gx | ((M.mv(git, x ^ z) ^ gx) << 9) + + map_ids[op] = len(matrices) + matrices.append([symplectic(1 << i) for i in range(18)]) + + lags = [M.lagrangian(f, 9) for f in frames] + + def add_edge(a, b, mp=0): + left = [M.mv(matrices[mp], v) for v in lags[nodes[a]]] + rank = M.lagrangian_distance(left, lags[nodes[b]], 9) + edges.append((a, b, rank, 1, mp)) + + def move(r, f, dst=None): + a = cur[r] + b = new(f, ['transition', r]) if dst is None else dst + add_edge(a, b) + cur[r] = b + + # Explicit source transports are combined only into their next actual contact. + # Every omitted intermediate frame is a source gauge with no logical work. + # This is exactly #4841's edge model, now applied to all 640 retained roles. + for i, e in enumerate(events): + op = e[0] + if op in ('add', 'scale'): + refs = e[1:3] if op == 'add' else e[1:2] + f = e[-1] + node = new(f, ['contact', i, list(refs)]) + if any(r >= 632 for r in refs): + selected.append(node) + for r in refs: + move(r, f, node) + elif op == 'warp': + _, r, symbol, a, b = e + move(r, a) + dst = new(b, ['warp', i, r]) + add_edge(cur[r], dst, map_ids[symbol]) + cur[r] = dst + else: + M.need(op == 'transport', 'known retained event') + + for r, f in enumerate(c['final'] + [0] * 8): + move(r, f, new(f, ['exit', r])) + paid = Counter(rank for a, b, rank, sign, mp in edges if rank) + M.need(dict(paid) == R.PAID, 'all paid calls including eight center calls') + helper = Counter(len(frames[c['final'][r]]) - len(frames[c['start'][r]]) + for r in range(224, 632)) + M.need(dict(helper) == {4: 28, 7: 7, 8: 47, 9: 326}, 'all independent helper targets') + M.need(len(starts) == 640 and len(centers) == 8, 'all arbitrary persistent inputs') + selected_set = set(selected) + lines = [f'{len(nodes)} {len(lags)} {len(matrices)} {len(edges)}'] + lines += [f'{f} {int(n not in selected_set)}' for n, f in enumerate(nodes)] + lines += [' '.join(map(str, row)) for row in lags + matrices + edges] + output.mkdir(parents=True, exist_ok=True) + (output / 'center-contact-graph.txt').write_text('\n'.join(lines) + '\n') + metadata = dict(source_sha256=sha256(raw).hexdigest(), inputs=640, + nodes=len(nodes), edges=len(edges), fixed_nodes=len(nodes)-len(selected), + newly_variable_center_contacts=len(selected), selected=selected, + paid=dict(sorted(paid.items())), helpers=dict(sorted(helper.items())), + independent_center_reward=0, labels=labels) + (output / 'graph-metadata.json').write_text(json.dumps(metadata, indent=2) + '\n') + return {k:v for k,v in metadata.items() if k not in ('labels','selected')} + + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument('output', type=Path) + args = parser.parse_args() + print(json.dumps(build(args.output), sort_keys=True)) diff --git a/research/sol1337-global-centre-cut/cut.hpp b/research/sol1337-global-centre-cut/cut.hpp new file mode 100644 index 0000000000..c8fb704688 --- /dev/null +++ b/research/sol1337-global-centre-cut/cut.hpp @@ -0,0 +1,12 @@ +// Exact integer flow routines retained from PR4867, substantial OpenAI Codex assistance. Apache-2.0. +struct FlowEdge {int to,rev;long long cap,initial;bool forward;}; +struct Flow{ + int n;std::vector> g;std::vector level,it; + Flow(int n):n(n),g(n),level(n),it(n){} + void add(int a,int b,long long c){FlowEdge x{b,(int)g[b].size(),c,c,true},y{a,(int)g[a].size(),0,0,false};g[a].push_back(x);g[b].push_back(y);} + long long dfs(int u,int t,long long f){if(u==t)return f;for(int&i=it[u];i<(int)g[u].size();i++){auto&e=g[u][i];if(e.cap>0&&level[e.to]==level[u]+1){long long z=dfs(e.to,t,std::min(f,e.cap));if(z>0){e.cap-=z;g[e.to][e.rev].cap+=z;return z;}}}return 0;} + long long maxflow(int s,int t){long long total=0;for(;;){std::fill(level.begin(),level.end(),-1);std::queueq;q.push(s);level[s]=0;while(!q.empty()){int u=q.front();q.pop();for(auto&e:g[u])if(e.cap>0&&level[e.to]<0){level[e.to]=level[u]+1;q.push(e.to);}}if(level[t]<0)break;std::fill(it.begin(),it.end(),0);while(long long z=dfs(s,t,1000000000000000LL))total+=z;}return total;} + void check(int s,int t,long long value){std::vectorbalance(n);for(int u=0;ue.initial)throw 21;balance[u]-=f;balance[e.to]+=f;}for(int i=0;i>rev(n);for(int u=0;u0)rev[e.to].push_back(u);std::vectorseen(n);seen[sink]=1;std::queueq;q.push(sink);while(!q.empty()){int u=q.front();q.pop();for(auto v:rev[u])if(!seen[v]){seen[v]=1;q.push(v);}}for(int i=0;i chosen(int s){std::vectorseen(n);seen[s]=1;std::queueq;q.push(s);while(!q.empty()){int u=q.front();q.pop();for(auto&e:g[u])if(e.cap>0&&!seen[e.to]){seen[e.to]=1;q.push(e.to);}}return seen;} +}; diff --git a/research/sol1337-global-centre-cut/inputs/round3-native.json.gz b/research/sol1337-global-centre-cut/inputs/round3-native.json.gz new file mode 100644 index 0000000000..46d929df83 Binary files /dev/null and b/research/sol1337-global-centre-cut/inputs/round3-native.json.gz differ diff --git a/research/sol1337-global-centre-cut/pairs/HANDOFF.md b/research/sol1337-global-centre-cut/pairs/HANDOFF.md new file mode 100644 index 0000000000..818479f6e6 --- /dev/null +++ b/research/sol1337-global-centre-cut/pairs/HANDOFF.md @@ -0,0 +1,55 @@ +# Bounded independent-neighbour pair handoff + +Status: negative under the complete optimistic fixed-graph invoice. No +profitable physical candidate was found or claimed, and no kappa is claimed. +No remote mutation was made by this agent. + +Public prospective claim: +https://github.com/CrocSwap/integer-mult-bounds/pull/4867#issuecomment-6353171449 + +* Exact geometry: 511 empty-chart hyperplanes, two distinct neighbours each. + Opposite neighbours above one hyperplane have mutual distance one. +* Actual domain: 256 distinct original rank-zero internal pairs, both opposite + assignments: 261632 cases; 1831424 actual incident rank calculations. +* Result: 44 histograms, all dominated in the nine exact min-rank tariffs by + `3H1+H7-H8`. Cost is at least `3+7^theta-8^theta >= 2` for + `0<=theta<=1`. Best developed-C value is approximately 2.0090712929448316. +* Independent replay: Python imports no predecessor rank engine, combines + independently recomputed single-endpoint invoices and shared-edge correction, + and exactly matches all C++ histogram counts. It also checks geometry, + helper/paid inventory, changed-graph controls, and every rank-eight edge. +* Analytic completion: #4867's single/common-axis theorems plus the new + opposite-neighbour screen close every independent one-neighbour assignment + on every rank-zero internal edge. Different hyperplanes have shared rank two + and cost at least `2-2^theta>0` for theta below one. +* Rank-eight gate: all eight remaining internal edges have degree-four + endpoints, each with two external rank-zero edges and one external edge of + rank at most two. External changes cost at least two jointly; shared rank + stays at least six. Therefore cost is at least + `2+6^theta-8^theta >= 2-2^theta>0`. The nominal 8355872 rank-eight pair + choices were not scanned because this complete optimistic gate rejects them. + +The conclusion retains all 640 arbitrary owners, the original scalar/native +word, endpoints, all 408 helper jobs and zero extra centre reward. It does not +close three or more independently changed contacts, changed scalar words, +changed demand, native intermediate reuse, or a different caller contract. + +Science inputs are frozen at global-centre-cut commit +`159eb73dd70ccdb03af6f61435135c026cf9886a`; final metadata is +`673b1f38379ee88513dfbe2d828845afa7c2f9ec`. `SOURCES.json` hashes the exact +source/graph files. The worktree remains at base +`624de9dc66858af0945e5f8a0942488d62280d43`; all new files are under this +outputs directory, and no predecessor package was edited. + +Reproduce from the project root: + +```sh +python3 sol1337-global-centre-cut/research/sol1337-global-centre-cut/build_graph.py dyadic-full-controller-20261023/outputs/opposite-neighbour-pairs +g++ -std=c++20 -O3 -Wall -Wextra -Werror -I sol1337-global-centre-cut/research/sol1337-global-centre-cut/vendor dyadic-full-controller-20261023/outputs/opposite-neighbour-pairs/scan.cpp -o dyadic-full-controller-20261023/outputs/opposite-neighbour-pairs/scan +dyadic-full-controller-20261023/outputs/opposite-neighbour-pairs/scan dyadic-full-controller-20261023/outputs/opposite-neighbour-pairs/center-contact-graph.txt dyadic-full-controller-20261023/outputs/opposite-neighbour-pairs/SCREEN.json +python3 -O -W error dyadic-full-controller-20261023/outputs/opposite-neighbour-pairs/verify.py +``` + +`PROOF.md` contains the exact bill identities and analytic extensions. +`SCREEN.json` stores every histogram. `VERIFY.json` records the independent +replay. `RANK8-CENSUS.json` records all eight analytic-gate edge inventories. diff --git a/research/sol1337-global-centre-cut/pairs/ORIGIN.json b/research/sol1337-global-centre-cut/pairs/ORIGIN.json new file mode 100644 index 0000000000..059bfe46db --- /dev/null +++ b/research/sol1337-global-centre-cut/pairs/ORIGIN.json @@ -0,0 +1,52 @@ +{ + "producer": "Prepared for Chris R; independent-neighbour pair work by the user-authorized shared-producer agent with substantial OpenAI Codex assistance.", + "producer_directory": "dyadic-full-controller-20261023/outputs/opposite-neighbour-pairs", + "producer_sources_sha256": "d486993ac7c11b96d716d18c04dd7c52c40a14f9e0f5c67bc1239f0e4dca8cad", + "copied_files": [ + { + "path": "PROOF.md", + "sha256": "6c2f23f489e3699676a45dde4a95d9ca54cd0d81ef272899c84545eb24c2dd4e" + }, + { + "path": "HANDOFF.md", + "sha256": "19a16056c651de93846d989050a21df74fd6c06b6fc0e314861c2be807585d38" + }, + { + "path": "SOURCES.json", + "sha256": "d486993ac7c11b96d716d18c04dd7c52c40a14f9e0f5c67bc1239f0e4dca8cad" + }, + { + "path": "scan.cpp", + "sha256": "83d4c15fef56988620e1f474f7662863b87ced5e133dd40a36fd56dfec49516a" + }, + { + "path": "verify.py", + "sha256": "60f71618f13fa8c144ec0865155db255738187c8b86af2bd4824b62320db5123" + }, + { + "path": "SCREEN.json", + "sha256": "41db057ba61fa47d4f0682fb81ccd33c76b1623fc5dfd3f7dc2b4940e57afc47" + }, + { + "path": "RANK8-CENSUS.json", + "sha256": "be56fadef96a5b78e1822dd8b5e8f43ca197fc41e9a31c71cc8f8b1b7c69c0b9" + }, + { + "path": "VERIFY.json", + "sha256": "24925961940639163898092043bffba1341c041b46bd4f8880d79fcf66b71bf9" + } + ], + "predecessor_single_screen": { + "path": "single-contact-screen.json", + "source_commit": "5e4cce12a9851fbb46cd7c32cc8177e983771539", + "source_path": "research/sol1337-contact-frontier/single-contact-screen.json", + "sha256": "7c31e2436f8206da384b6d2b917d79f4cb0f62065880eb6d60ccf477e50e21fe" + }, + "adaptation": "Producer scientific files are copied byte-for-byte. The additive package wrapper regenerates graph inputs and runs the original mutating verifier only in scratch space; no producer file is rewritten.", + "predecessor_pair_screen": { + "path": "paired-contact-screen.json", + "source_commit": "5e4cce12a9851fbb46cd7c32cc8177e983771539", + "source_path": "research/sol1337-contact-frontier/paired-contact-screen.json", + "sha256": "0108a1b8ad8196c5ecee18d5252bbe4f798a94d7e011b3549204bc2d1ac2a7b8" + } +} diff --git a/research/sol1337-global-centre-cut/pairs/PROOF.md b/research/sol1337-global-centre-cut/pairs/PROOF.md new file mode 100644 index 0000000000..3fb0936a75 --- /dev/null +++ b/research/sol1337-global-centre-cut/pairs/PROOF.md @@ -0,0 +1,109 @@ +# Independent one-neighbour pairs on the retained contact graph + +This is a source-bound paid-cost ceiling. It uses the fixed graph of #4867, +with all 640 arbitrary input owners, all 408 helper targets, all endpoints, +native logical maps, and scalar operations fixed. It awards no independent +centre job. The only changed objects are the charts at two adjacent variable +contacts. Each is changed to a distance-one Lagrangian neighbour. Rank-zero +edges have zero recursive charge; every other incident edge is recounted. +It is not a ceiling on changed scalar words, changed targets, larger +independently retagged blocks, paid-intermediate reuse, or arbitrary callers. + +## Prospective contract and neighbour geometry + +The public prospective claim is +https://github.com/CrocSwap/integer-mult-bounds/pull/4867#issuecomment-6353171449. +The frozen graph science is `159eb73dd70ccdb03af6f61435135c026cf9886a`, +final metadata `673b1f38379ee88513dfbe2d828845afa7c2f9ec`. +The source payload SHA256 is +`7679daa4ec6a40f56fc7f0202379a6f454310e94945aba4f48beaaaafb838d05`. + +Write symplectic coordinates as `(x,z)` and the empty chart as +`L0={(0,z):z in F2^9}`. For nonzero x define +`Hx={(0,v):x.v=0}`. A transvection with axis `(x,z)` takes L0 to a +neighbour depending precisely on x and the bit `x.z`. The two neighbours +above Hx are represented by axes `(x,0)` and `(x,e_j)` for any j with +`x_j=1`. Both contain Hx and have dimension nine. They are distinct, so +their intersection is exactly Hx and their mutual distance is one. + +Different nonzero x give different Hx. For neighbours above different Hx, +Hy, any common vector has X-coordinate in both lines `` and ``, +and hence has X-coordinate zero. Their intersection is exactly Hx intersect +Hy, of dimension seven, so their distance is two. There are therefore 511 +hyperplanes and 1022 neighbours, agreeing with #4841's neighbour enumeration. + +The actual graph has 176 variable empty contacts and 256 distinct rank-zero +edges between them, with no parallel edge between a tested endpoint pair. +The bounded opposite-neighbour domain is exactly `256*511*2=261632`. + +## Complete invoice for the bounded screen + +For a changed paid histogram d, define `S_j(d)=sum_r d_r min(r,j)`. +All 261632 cases were evaluated by direct binary row elimination on each +actual incident edge: 1831424 rank checks, 44 distinct histograms. The +original full bill is `{1:2201,2:412,3:510,4:127,5:40,8:8}`; unchanged +helpers are `{4:28,7:7,8:47,9:326}`. No old or new paid call is dropped. + +An independent Python replay computes each endpoint's complete single-change +invoice, then replaces the two singly-changed shared-edge bills with the one +jointly-changed bill. It obtains exactly the same 44 histograms and counts. +Every histogram satisfies, simultaneously, + + (S_1,...,S_9) >= (3,3,3,3,3,3,3,2,2). + +The lower vector is attained by `d*={1:+3,7:+1,8:-1}` (and rank-zero +bookkeeping -3), in four cases. For any increasing concave tariff h with +h(0)=0, the finite decomposition into `min(r,j)` tariffs therefore gives + + sum_r d_r h(r) >= 3h(1)+h(7)-h(8). + +For `h(r)=r^theta`, `0<=theta<=1`, with h(0)=0 also at theta=0, this is +`3+7^theta-8^theta >= 2`. At the developed comparison +`C=.0030217758`, theta=1-C, its floating value is about 2.0090712929448316. +The exact prefix certificate, not this floating number, closes the family. + +## Analytic closure of every rank-zero adjacent pair + +This transfers #4867's exact complete single-contact bound +`epsilon=1+7^theta-8^theta` and its common-axis subset ceiling; it does not +claim those predecessor results as new. If both neighbours are identical, +the pair is an old/common-axis subset already covered by #4867. +Opposite neighbours above one hyperplane are the bounded screen above. +For different hyperplanes the shared edge has rank two. Each isolated +single change paid rank one there. With the simple-edge census checked, + + Delta_pair = Delta_single_u + Delta_single_v - 2 + 2^theta + >= 2*7^theta - 2*8^theta + 2^theta + >= 2 - 2^theta > 0 (0<=theta<1). + +The last inequality is concavity: +`8^theta-7^theta <= 2^theta-1`. This closes all 1022 squared independent +neighbour assignments on each rank-zero internal edge without expanding +the benchmark domain. At theta=1 the lower bound is nonnegative. + +## Rank-eight internal edges: stop at the complete optimistic bill + +The only other internal edges are eight rank-eight edges. Each joins an +empty contact to a distinct original rank-eight chart group. Both endpoints +have degree four. Apart from the shared edge, each has two rank-zero edges +and one edge of original rank at most two. All these incident native maps +are identity, and there is no parallel shared edge. `RANK8-CENSUS.json` +records every actual endpoint and incident edge. + +A nontrivial distance-one neighbour makes each original rank-zero external +edge rank one, paying two units per endpoint. The third external edge can +decrease rank by at most one. For rank at most two and any `0<=theta<=1`, +that saves at most one unit. Thus each endpoint's entire external paid +change is at least one, jointly at least two. The shared rank can decrease +by at most two, so its new rank is at least six. Even granting the best +possible joint rank and the best external changes independently, + + Delta_pair >= 2 + 6^theta - 8^theta + >= 2 - 2^theta > 0 (0<=theta<1). + +Subadditivity gives `8^theta-6^theta <= 2^theta`; strictness holds in the +interior. At theta=1 the bound is nonnegative. Consequently the proposed +8355872 independent-neighbour rank-eight pair scan has no profitable case +under its complete optimistic bill, and was not run. This is a graph and +rank-metric argument, not a full physical compiler witness or a general +obstruction to independent retags on larger contact sets. diff --git a/research/sol1337-global-centre-cut/pairs/RANK8-CENSUS.json b/research/sol1337-global-centre-cut/pairs/RANK8-CENSUS.json new file mode 100644 index 0000000000..479a7919f7 --- /dev/null +++ b/research/sol1337-global-centre-cut/pairs/RANK8-CENSUS.json @@ -0,0 +1,529 @@ +{ + "edges": [ + { + "edge": 19679, + "endpoints": [ + 10851, + 10852 + ], + "external": [ + { + "node": 10851, + "external_rank_multiset": [ + 0, + 0, + 1 + ], + "edges": [ + [ + 19676, + 632, + 0, + 0 + ], + [ + 19677, + 10808, + 0, + 0 + ], + [ + 24215, + 13235, + 1, + 0 + ] + ] + }, + { + "node": 10852, + "external_rank_multiset": [ + 0, + 0, + 0 + ], + "edges": [ + [ + 19678, + 6220, + 0, + 0 + ], + [ + 19681, + 10853, + 0, + 0 + ], + [ + 19778, + 10902, + 0, + 0 + ] + ] + } + ] + }, + { + "edge": 19725, + "endpoints": [ + 10874, + 10875 + ], + "external": [ + { + "node": 10874, + "external_rank_multiset": [ + 0, + 0, + 1 + ], + "edges": [ + [ + 19722, + 633, + 0, + 0 + ], + [ + 19723, + 10814, + 0, + 0 + ], + [ + 26360, + 14396, + 1, + 0 + ] + ] + }, + { + "node": 10875, + "external_rank_multiset": [ + 0, + 0, + 0 + ], + "edges": [ + [ + 19724, + 6733, + 0, + 0 + ], + [ + 19727, + 10876, + 0, + 0 + ], + [ + 19770, + 10898, + 0, + 0 + ] + ] + } + ] + }, + { + "edge": 19771, + "endpoints": [ + 10897, + 10898 + ], + "external": [ + { + "node": 10897, + "external_rank_multiset": [ + 0, + 0, + 1 + ], + "edges": [ + [ + 19768, + 634, + 0, + 0 + ], + [ + 19769, + 10820, + 0, + 0 + ], + [ + 26348, + 14390, + 1, + 0 + ] + ] + }, + { + "node": 10898, + "external_rank_multiset": [ + 0, + 0, + 1 + ], + "edges": [ + [ + 19770, + 10875, + 0, + 0 + ], + [ + 19773, + 10899, + 0, + 0 + ], + [ + 20094, + 11060, + 1, + 0 + ] + ] + } + ] + }, + { + "edge": 19817, + "endpoints": [ + 10920, + 10921 + ], + "external": [ + { + "node": 10920, + "external_rank_multiset": [ + 0, + 0, + 1 + ], + "edges": [ + [ + 19814, + 635, + 0, + 0 + ], + [ + 19815, + 10826, + 0, + 0 + ], + [ + 27179, + 14846, + 1, + 0 + ] + ] + }, + { + "node": 10921, + "external_rank_multiset": [ + 0, + 0, + 2 + ], + "edges": [ + [ + 19816, + 10914, + 0, + 0 + ], + [ + 19819, + 10922, + 0, + 0 + ], + [ + 20736, + 11383, + 2, + 0 + ] + ] + } + ] + }, + { + "edge": 19863, + "endpoints": [ + 10943, + 10944 + ], + "external": [ + { + "node": 10943, + "external_rank_multiset": [ + 0, + 0, + 1 + ], + "edges": [ + [ + 19860, + 636, + 0, + 0 + ], + [ + 19861, + 10832, + 0, + 0 + ], + [ + 24294, + 13278, + 1, + 0 + ] + ] + }, + { + "node": 10944, + "external_rank_multiset": [ + 0, + 0, + 0 + ], + "edges": [ + [ + 19862, + 6736, + 0, + 0 + ], + [ + 19865, + 10945, + 0, + 0 + ], + [ + 20000, + 11013, + 0, + 0 + ] + ] + } + ] + }, + { + "edge": 19909, + "endpoints": [ + 10966, + 10967 + ], + "external": [ + { + "node": 10966, + "external_rank_multiset": [ + 0, + 0, + 1 + ], + "edges": [ + [ + 19906, + 637, + 0, + 0 + ], + [ + 19907, + 10838, + 0, + 0 + ], + [ + 26332, + 14382, + 1, + 0 + ] + ] + }, + { + "node": 10967, + "external_rank_multiset": [ + 0, + 0, + 2 + ], + "edges": [ + [ + 19908, + 10952, + 0, + 0 + ], + [ + 19911, + 10968, + 0, + 0 + ], + [ + 20778, + 11404, + 2, + 0 + ] + ] + } + ] + }, + { + "edge": 19955, + "endpoints": [ + 10989, + 10990 + ], + "external": [ + { + "node": 10989, + "external_rank_multiset": [ + 0, + 0, + 1 + ], + "edges": [ + [ + 19952, + 638, + 0, + 0 + ], + [ + 19953, + 10844, + 0, + 0 + ], + [ + 24291, + 13276, + 1, + 0 + ] + ] + }, + { + "node": 10990, + "external_rank_multiset": [ + 0, + 0, + 1 + ], + "edges": [ + [ + 19954, + 10948, + 0, + 0 + ], + [ + 19957, + 10991, + 0, + 0 + ], + [ + 20060, + 11043, + 1, + 0 + ] + ] + } + ] + }, + { + "edge": 20001, + "endpoints": [ + 11012, + 11013 + ], + "external": [ + { + "node": 11012, + "external_rank_multiset": [ + 0, + 0, + 0 + ], + "edges": [ + [ + 19998, + 639, + 0, + 0 + ], + [ + 19999, + 10850, + 0, + 0 + ], + [ + 26318, + 14375, + 0, + 0 + ] + ] + }, + { + "node": 11013, + "external_rank_multiset": [ + 0, + 0, + 1 + ], + "edges": [ + [ + 20000, + 10944, + 0, + 0 + ], + [ + 20003, + 11014, + 0, + 0 + ], + [ + 20058, + 11042, + 1, + 0 + ] + ] + } + ] + } + ], + "nominal_independent_neighbour_cases": 8355872, + "actual_pair_cases_evaluated": 0, + "complete_paid_lower_bound": "2 + 6^theta - 8^theta >= 2 - 2^theta", + "power_interval": "0 <= theta < 1", + "status": "ANALYTIC_STOP_BEFORE_PAIR_SCAN" +} diff --git a/research/sol1337-global-centre-cut/pairs/SCREEN.json b/research/sol1337-global-centre-cut/pairs/SCREEN.json new file mode 100644 index 0000000000..897d1c9d92 --- /dev/null +++ b/research/sol1337-global-centre-cut/pairs/SCREEN.json @@ -0,0 +1 @@ +{"cases":261632,"hyperplane_groups":511,"distinct_neighbours":1022,"distinct_internal_pairs":256,"exact_incident_rank_checks":1831424,"theta":"0.9969782242","floating_discovery_minimum_paid_delta":2.0090712929448316,"best_edge":19770,"best_endpoints":[10875,10898],"best_x":30,"best_order":0,"best_delta":[-3,3,0,0,0,0,0,1,-1,0],"minimum_prefix_deltas":[3,3,3,3,3,3,3,2,2],"negative_prefix_cases":[0,0,0,0,0,0,0,0,0],"profiles":[{"count":123662,"delta":[-7,7,0,0,0,0,0,0,0,0]},{"count":37740,"delta":[-6,5,1,0,0,0,0,0,0,0]},{"count":52832,"delta":[-6,6,-1,1,0,0,0,0,0,0]},{"count":1536,"delta":[-6,6,0,0,0,0,0,0,-1,1]},{"count":958,"delta":[-6,6,0,0,0,0,0,0,0,0]},{"count":765,"delta":[-6,6,0,0,0,0,0,1,-1,0]},{"count":156,"delta":[-6,7,-1,0,0,0,0,0,0,0]},{"count":7140,"delta":[-5,3,2,0,0,0,0,0,0,0]},{"count":10154,"delta":[-5,4,0,1,0,0,0,0,0,0]},{"count":1536,"delta":[-5,4,1,0,0,0,0,0,-1,1]},{"count":785,"delta":[-5,4,1,0,0,0,0,0,0,0]},{"count":762,"delta":[-5,4,1,0,0,0,0,1,-1,0]},{"count":15180,"delta":[-5,5,-2,2,0,0,0,0,0,0]},{"count":1024,"delta":[-5,5,-1,1,0,0,0,0,-1,1]},{"count":567,"delta":[-5,5,-1,1,0,0,0,0,0,0]},{"count":504,"delta":[-5,5,-1,1,0,0,0,1,-1,0]},{"count":68,"delta":[-5,5,0,0,0,0,0,0,0,0]},{"count":1,"delta":[-5,5,0,0,0,0,0,1,-1,0]},{"count":60,"delta":[-5,6,-2,1,0,0,0,0,0,0]},{"count":37,"delta":[-5,6,-1,0,0,0,0,0,0,0]},{"count":6,"delta":[-5,6,-1,0,0,0,0,1,-1,0]},{"count":512,"delta":[-4,2,2,0,0,0,0,0,-1,1]},{"count":254,"delta":[-4,2,2,0,0,0,0,0,0,0]},{"count":254,"delta":[-4,2,2,0,0,0,0,1,-1,0]},{"count":512,"delta":[-4,3,0,1,0,0,0,0,-1,1]},{"count":252,"delta":[-4,3,0,1,0,0,0,0,0,0]},{"count":252,"delta":[-4,3,0,1,0,0,0,1,-1,0]},{"count":512,"delta":[-4,3,1,0,0,0,0,0,-2,2]},{"count":512,"delta":[-4,3,1,0,0,0,0,0,-1,1]},{"count":512,"delta":[-4,3,1,0,0,0,0,1,-2,1]},{"count":506,"delta":[-4,3,1,0,0,0,0,1,-1,0]},{"count":1024,"delta":[-4,4,-2,2,0,0,0,0,-1,1]},{"count":500,"delta":[-4,4,-2,2,0,0,0,0,0,0]},{"count":500,"delta":[-4,4,-2,2,0,0,0,1,-1,0]},{"count":7,"delta":[-4,4,-1,1,0,0,0,0,0,0]},{"count":4,"delta":[-4,4,-1,1,0,0,0,1,-1,0]},{"count":24,"delta":[-4,4,0,0,0,0,0,0,0,0]},{"count":4,"delta":[-4,4,0,0,0,0,0,1,-1,0]},{"count":4,"delta":[-4,5,-2,1,0,0,0,0,0,0]},{"count":4,"delta":[-4,5,-2,1,0,0,0,1,-1,0]},{"count":3,"delta":[-4,5,-1,0,0,0,0,0,0,0]},{"count":2,"delta":[-4,5,-1,0,0,0,0,1,-1,0]},{"count":1,"delta":[-3,3,0,0,0,0,0,0,0,0]},{"count":4,"delta":[-3,3,0,0,0,0,0,1,-1,0]}]} diff --git a/research/sol1337-global-centre-cut/pairs/SOURCES.json b/research/sol1337-global-centre-cut/pairs/SOURCES.json new file mode 100644 index 0000000000..50bdddde11 --- /dev/null +++ b/research/sol1337-global-centre-cut/pairs/SOURCES.json @@ -0,0 +1,86 @@ +{ + "base_commit": "624de9dc66858af0945e5f8a0942488d62280d43", + "graph_science_commit": "159eb73dd70ccdb03af6f61435135c026cf9886a", + "graph_final_metadata_commit": "673b1f38379ee88513dfbe2d828845afa7c2f9ec", + "public_prospective_claim": "https://github.com/CrocSwap/integer-mult-bounds/pull/4867#issuecomment-6353171449", + "files": [ + { + "path": "sol1337-global-centre-cut/research/sol1337-global-centre-cut/build_graph.py", + "sha256": "f21740584ee9f6351f7b7ab175960b6489596a41781d9cc601c6420570b27378", + "science_commit": "159eb73dd70ccdb03af6f61435135c026cf9886a" + }, + { + "path": "sol1337-global-centre-cut/research/sol1337-global-centre-cut/vendor/model.py", + "sha256": "7cc29edccb3679b2a5c9defeeb0a2ec6bcef9b01b97c2390bebc48f366395f1f", + "science_commit": "159eb73dd70ccdb03af6f61435135c026cf9886a" + }, + { + "path": "sol1337-global-centre-cut/research/sol1337-global-centre-cut/vendor/retained_verify.py", + "sha256": "f5a67954f19dddc688460b91e5c1729d7820755c53313159ed136e4447021214", + "science_commit": "159eb73dd70ccdb03af6f61435135c026cf9886a" + }, + { + "path": "sol1337-global-centre-cut/research/sol1337-global-centre-cut/vendor/dynamic_neighbors.cpp", + "sha256": "86985b01679acc3d2acefe084d14e94e2e2d1013357265b19512867049d7acec", + "science_commit": "159eb73dd70ccdb03af6f61435135c026cf9886a" + }, + { + "path": "sol1337-global-centre-cut/research/sol1337-global-centre-cut/vendor/neighbors.hpp", + "sha256": "30ff3162c5f6ad4cf212c6b2775f871c1b8f587c027c83fcbfd87b66bbff65cf", + "science_commit": "159eb73dd70ccdb03af6f61435135c026cf9886a" + }, + { + "path": "sol1337-global-centre-cut/research/sol1337-global-centre-cut/inputs/round3-native.json.gz", + "sha256": "7679daa4ec6a40f56fc7f0202379a6f454310e94945aba4f48beaaaafb838d05", + "science_commit": "159eb73dd70ccdb03af6f61435135c026cf9886a" + }, + { + "path": "sol1337-contact-frontier/research/sol1337-contact-frontier/single-contact-screen.json", + "sha256": "7c31e2436f8206da384b6d2b917d79f4cb0f62065880eb6d60ccf477e50e21fe", + "usage": "predecessor exact single/contact theorem" + }, + { + "path": "sol1337-contact-frontier/research/sol1337-contact-frontier/PROOF.md", + "sha256": "b8cf0a690ccf14add88ae488433ab60a80fc1aebdff59d2885252b7d36aa6507", + "usage": "predecessor exact single/contact theorem" + } + ], + "own_files": [ + { + "path": "HANDOFF.md", + "sha256": "19a16056c651de93846d989050a21df74fd6c06b6fc0e314861c2be807585d38" + }, + { + "path": "PROOF.md", + "sha256": "6c2f23f489e3699676a45dde4a95d9ca54cd0d81ef272899c84545eb24c2dd4e" + }, + { + "path": "RANK8-CENSUS.json", + "sha256": "be56fadef96a5b78e1822dd8b5e8f43ca197fc41e9a31c71cc8f8b1b7c69c0b9" + }, + { + "path": "SCREEN.json", + "sha256": "41db057ba61fa47d4f0682fb81ccd33c76b1623fc5dfd3f7dc2b4940e57afc47" + }, + { + "path": "VERIFY.json", + "sha256": "24925961940639163898092043bffba1341c041b46bd4f8880d79fcf66b71bf9" + }, + { + "path": "center-contact-graph.txt", + "sha256": "d8cad371bcbfae54c36654b656b32ecd7d7a7c5e131936afdf9a041f8ee277ea" + }, + { + "path": "graph-metadata.json", + "sha256": "e2f605c88a3fc523af0d39da1ff05ddbe335d06b2cb182a09428a6c348d6016c" + }, + { + "path": "scan.cpp", + "sha256": "83d4c15fef56988620e1f474f7662863b87ced5e133dd40a36fd56dfec49516a" + }, + { + "path": "verify.py", + "sha256": "60f71618f13fa8c144ec0865155db255738187c8b86af2bd4824b62320db5123" + } + ] +} diff --git a/research/sol1337-global-centre-cut/pairs/VERIFY.json b/research/sol1337-global-centre-cut/pairs/VERIFY.json new file mode 100644 index 0000000000..5131c06bf6 --- /dev/null +++ b/research/sol1337-global-centre-cut/pairs/VERIFY.json @@ -0,0 +1,37 @@ +{ + "status": "PASS", + "cases": 261632, + "distinct_profiles": 44, + "hyperplane_groups": 511, + "distinct_neighbours": 1022, + "prefix_minima": [ + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2 + ], + "sharp_lower_paid_delta": [ + -3, + 3, + 0, + 0, + 0, + 0, + 0, + 1, + -1, + 0 + ], + "full_power_interval": "0 <= theta <= 1", + "exact_uniform_paid_loss_lower_bound": 2, + "helpers_unchanged": 408, + "independent_center_reward": 0, + "graph_sha256": "d8cad371bcbfae54c36654b656b32ecd7d7a7c5e131936afdf9a041f8ee277ea", + "rank8_pair_domain_closed_analytically": 8355872, + "scope": "fixed graph, two adjacent empty contacts, opposite neighbours of one common hyperplane; rank-eight pair analytic gate" +} diff --git a/research/sol1337-global-centre-cut/pairs/paired-contact-screen.json b/research/sol1337-global-centre-cut/pairs/paired-contact-screen.json new file mode 100644 index 0000000000..31526472b8 --- /dev/null +++ b/research/sol1337-global-centre-cut/pairs/paired-contact-screen.json @@ -0,0 +1 @@ +{"scope":"complete simultaneous-transvection neighbors at all adjacent newly-variable retained-center contacts; every other node fixed","cases":1834488,"negative_float_screen":0,"neutral_float_screen":0,"best_float_delta":0.0090712930943235293,"best_node":10898,"best_second":10899,"best_axis":1054,"rank_delta_classes":[{"count":123662,"delta":[-6,6,0,0,0,0,0,0,0,0]},{"count":820337,"delta":[-5,4,1,0,0,0,0,0,0,0]},{"count":52832,"delta":[-5,5,-1,1,0,0,0,0,0,0]},{"count":1536,"delta":[-5,5,0,0,0,0,0,0,-1,1]},{"count":1853,"delta":[-5,5,0,0,0,0,0,0,0,0]},{"count":765,"delta":[-5,5,0,0,0,0,0,1,-1,0]},{"count":156,"delta":[-5,6,-1,0,0,0,0,0,0,0]},{"count":397800,"delta":[-4,2,2,0,0,0,0,0,0,0]},{"count":399794,"delta":[-4,3,0,1,0,0,0,0,0,0]},{"count":1536,"delta":[-4,3,1,0,0,0,0,0,-1,1]},{"count":2313,"delta":[-4,3,1,0,0,0,0,0,0,0]},{"count":762,"delta":[-4,3,1,0,0,0,0,1,-1,0]},{"count":15180,"delta":[-4,4,-2,2,0,0,0,0,0,0]},{"count":1024,"delta":[-4,4,-1,1,0,0,0,0,-1,1]},{"count":1079,"delta":[-4,4,-1,1,0,0,0,0,0,0]},{"count":504,"delta":[-4,4,-1,1,0,0,0,1,-1,0]},{"count":1762,"delta":[-4,4,0,0,0,0,0,0,0,0]},{"count":60,"delta":[-4,5,-2,1,0,0,0,0,0,0]},{"count":6,"delta":[-4,5,-1,0,0,0,0,1,-1,0]},{"count":15,"delta":[-4,6,-2,0,0,0,0,0,0,0]},{"count":512,"delta":[-3,1,2,0,0,0,0,0,-1,1]},{"count":254,"delta":[-3,1,2,0,0,0,0,0,0,0]},{"count":254,"delta":[-3,1,2,0,0,0,0,1,-1,0]},{"count":512,"delta":[-3,2,0,1,0,0,0,0,-1,1]},{"count":252,"delta":[-3,2,0,1,0,0,0,0,0,0]},{"count":252,"delta":[-3,2,0,1,0,0,0,1,-1,0]},{"count":512,"delta":[-3,2,1,0,0,0,0,0,-2,2]},{"count":512,"delta":[-3,2,1,0,0,0,0,0,-1,1]},{"count":1022,"delta":[-3,2,1,0,0,0,0,0,0,0]},{"count":512,"delta":[-3,2,1,0,0,0,0,1,-2,1]},{"count":252,"delta":[-3,2,1,0,0,0,0,2,-2,0]},{"count":1024,"delta":[-3,3,-2,2,0,0,0,0,-1,1]},{"count":500,"delta":[-3,3,-2,2,0,0,0,0,0,0]},{"count":500,"delta":[-3,3,-2,2,0,0,0,1,-1,0]},{"count":523,"delta":[-3,3,-1,1,0,0,0,0,0,0]},{"count":1026,"delta":[-3,3,0,0,0,0,0,0,0,0]},{"count":5,"delta":[-3,3,0,0,0,0,0,1,-1,0]},{"count":8,"delta":[-3,4,-2,1,0,0,0,1,-1,0]},{"count":7,"delta":[-3,4,-1,0,0,0,0,0,0,0]},{"count":2,"delta":[-3,5,-2,0,0,0,0,1,-1,0]},{"count":2547,"delta":[-2,1,1,0,0,0,0,0,0,0]},{"count":504,"delta":[-2,2,-1,1,0,0,0,0,0,0]},{"count":16,"delta":[-2,2,0,0,0,0,0,0,0,0]},{"count":2,"delta":[-2,2,0,0,0,0,0,2,-2,0]},{"count":1,"delta":[-2,3,-1,0,0,0,0,1,-1,0]},{"count":1,"delta":[-1,1,0,0,0,0,0,1,-1,0]}]} diff --git a/research/sol1337-global-centre-cut/pairs/scan.cpp b/research/sol1337-global-centre-cut/pairs/scan.cpp new file mode 100644 index 0000000000..12c78e6b06 --- /dev/null +++ b/research/sol1337-global-centre-cut/pairs/scan.cpp @@ -0,0 +1,56 @@ +// Apache-2.0. Substantial OpenAI Codex assistance. +// Bounded opposite-neighbour pair grammar; no physical supplier admission. +#define main predecessor_discovery_main +#include "dynamic_neighbors.cpp" +#undef main +#include +#include +#include +int run_pair(int argc,char**argv){ + if(argc!=3)return 2; + std::ifstream in(argv[1]);int n,f,m,e;in>>n>>f>>m>>e; + std::vectorframes(n),fixed(n);for(int i=0;i>frames[i]>>fixed[i]; + std::vectorfs(f,V(9)),maps(m,V(18));for(auto&v:fs)for(auto&x:v)in>>x;for(auto&v:maps)for(auto&x:v)in>>x; + std::vectoredges(e);std::vector>adj(n);std::vectorpairs;std::set>distinct; + std::arraybaseline{}; + for(int i=0;i>t.a>>t.b>>t.r>>t.sign>>t.map;if(t.sign!=1)throw 10;baseline[t.r]++;adj[t.a].push_back(i);adj[t.b].push_back(i); + if(!fixed[t.a]&&!fixed[t.b]&&frames[t.a]==0&&frames[t.b]==0){if(t.r||t.map)throw 11;pairs.push_back(i);distinct.insert(std::minmax(t.a,t.b));}} + if(!in||pairs.size()!=256||distinct.size()!=256)throw 12; + for(int r=1;r<=9;r++){int expected[10]={0,2201,412,510,127,40,0,0,8,0};if(baseline[r]!=expected[r])throw 13;} + for(int i=0;i<9;i++)if(fs[0][i]!=(1u<<(9+i)))throw 14; + std::mapneighbor_keys;int geometry=0; + auto key=[](V v){v=basis(v);std::string s;for(auto x:v){s+=std::to_string(x);s+=',';}return s;}; + auto rank=[](V left,const V&right){left.insert(left.end(),right.begin(),right.end());return int(basis(left).size())-9;}; + std::map,int>profiles; + long long count=0,edge_checks=0;double best=1e100;int best_pair=-1,best_x=0,best_order=0;std::arraybest_d{}; + std::arraymin_prefix;min_prefix.fill(1000000000);std::arrayprefix_negative{}; + for(unsigned x=1;x<512;x++){ + unsigned z=1u<incident=adj[p.a];incident.insert(incident.end(),adj[p.b].begin(),adj[p.b].end());std::sort(incident.begin(),incident.end());incident.erase(std::unique(incident.begin(),incident.end()),incident.end()); + for(int order=0;order<2;order++){ + std::arrayd{}; + for(int ei:incident){const auto&t=edges[ei];V left=t.a==p.a?alt[order]:t.a==p.b?alt[1-order]:fs[frames[t.a]]; + V right=t.b==p.a?alt[order]:t.b==p.b?alt[1-order]:fs[frames[t.b]]; + int r=rank(map(maps[t.map],left),right);if(r<0||r>9)throw 19;d[t.r]--;d[r]++;edge_checks++; + } + long long mass=0;double value=0;for(int r=0;r<=9;r++){mass+=r*d[r];if(r)value+=d[r]*std::pow(r,1-.0030217758);} + if(value1?",":"")<1?",":"")<> bit & 1),None) + if j is None: + continue + rows[k],rows[j] = rows[j],rows[k] + for i in range(len(rows)): + if i != k and rows[i] >> bit & 1: + rows[i] ^= rows[k] + k += 1 + return tuple(sorted(rows[:k])) + +def distance(a,b): + return rank(list(a)+list(b))-9 + +def neighbour(x,phase): + z = (x & -x) if phase else 0 + axis = x | (z << 9) + return [v ^ (axis if ((v >> 9) & x).bit_count() % 2 else 0) + for v in ZERO] + +raw = (HERE/'center-contact-graph.txt').read_bytes() +it = iter(map(int,raw.split())) +n,f,m,e = [next(it) for _ in range(4)] +nodes = [(next(it),next(it)) for _ in range(n)] +frames = [[next(it) for _ in range(9)] for _ in range(f)] +maps = [[next(it) for _ in range(18)] for _ in range(m)] +edges = [tuple(next(it) for _ in range(5)) for _ in range(e)] +need(next(it,None) is None,'no trailing graph words') +ZERO = [1 << (9+j) for j in range(9)] +need(frames[0] == ZERO,'empty chart convention') +metadata=json.loads((HERE/'graph-metadata.json').read_text()) +need(metadata['inputs']==640 and metadata['helpers']=={'4':28,'7':7,'8':47,'9':326},'full retained interface') +need(metadata['independent_center_reward']==0,'no independent centre credit') +empty = {i for i,(frame,fixed) in enumerate(nodes) if frame==0 and not fixed} +need(len(empty)==176,'empty contact inventory') +pairs=[]; neighbours=defaultdict(Counter) +for a,b,r,sign,mp in edges: + need(sign==1,'all graph edges are paid') + if a in empty or b in empty: + need(mp==0,'selected contact incident edges have identity native map') + for own,other in ((a,b),(b,a)): + if own in empty: + neighbours[own][(nodes[other][0],r)] += 1 + if a in empty and b in empty: + need(r==0,'original shared edge rank zero') + pairs.append(tuple(sorted((a,b)))) +need(len(pairs)==len(set(pairs))==256,'distinct internal pair census') +need(dict(Counter(r for a,b,r,s,mp in edges if r))=={1:2201,2:412,3:510,4:127,5:40,8:8},'complete original paid bill') + +# Distinct code path: each endpoint is changed alone against original neighbours. +# Combining two changes removes the two singly-paid rank-one shared-edge changes +# and inserts its actual opposite-neighbour distance-one bill exactly once. +profiles=Counter(); seen=set(); distance_cache={}; geometries=0 +for x in range(1,512): + alternatives=[neighbour(x,phase) for phase in (0,1)] + need(distance(ZERO,alternatives[0])==distance(ZERO,alternatives[1])==1,'neighbour distance') + need(distance(*alternatives)==1,'opposite pair distance') + kernel=[v<<9 for v in range(1,512) if (v&x).bit_count()%2==0] + need(rank(kernel)==8,'shared hyperplane dimension') + for alt in alternatives: + need(rank(alt+kernel)==9,'same hyperplane in both neighbours') + key=canon(alt);need(key not in seen,'distinct neighbour');seen.add(key) + for phase,alt in enumerate(alternatives): + for frame,_ in set(k for values in neighbours.values() for k in values): + distance_cache[phase,frame]=distance(alt,frames[frame]) + unary={} + for node in empty: + for phase in (0,1): + d=[0]*10 + for (frame,old),multiplicity in neighbours[node].items(): + new=distance_cache[phase,frame] + d[old]-=multiplicity;d[new]+=multiplicity + unary[node,phase]=d + for a,b in pairs: + for order in (0,1): + d=[u+v for u,v in zip(unary[a,order],unary[b,1-order])] + d[0]+=1;d[1]-=1 + profiles[tuple(d)]+=1 + geometries+=1 +need(geometries==511 and len(seen)==1022,'complete hyperplane grouping') +screen=json.loads((HERE/'SCREEN.json').read_text()) +observed=Counter({tuple(row['delta']):row['count'] for row in screen['profiles']}) +need(profiles==observed,'independent exact full-domain histogram equality') +need(sum(profiles.values())==261632,'all ordered endpoint choices') +expected=[3,3,3,3,3,3,3,2,2] +prefix=[min(sum(d[r]*min(r,j) for r in range(10)) for d in profiles) for j in range(1,10)] +need(prefix==expected==screen['minimum_prefix_deltas'],'exact prefix certificate') +best=(-3,3,0,0,0,0,0,1,-1,0) +need(profiles[best]==4,'sharp common lower profile') + +# Controls: same neighbour on both ends makes the edge rank zero, unlike +# opposite neighbours. Omitting the second endpoint correction changes the bill. +need(distance(neighbour(30,0),neighbour(30,0))==0,'same-neighbour control') +need(distance(neighbour(30,0),neighbour(30,1))==1,'opposite-neighbour control') +def rejected(call): + try: + call() + except ValueError: + return True + return False +need(rejected(lambda: need(distance(neighbour(30,0),neighbour(30,0))==1, + 'same-neighbour incorrectly billed as opposite')), + 'wrong shared-edge control must reject') + +# A new prospective full rank-eight pair scan is unnecessary: exact incidence +# alone funds at least two units outside the shared edge, whose rank stays >=6. +adj=defaultdict(list) +for i,(a,b,r,sign,mp) in enumerate(edges): + adj[a].append((i,b,r,mp));adj[b].append((i,a,r,mp)) +rank8=[] +for i,(a,b,r,sign,mp) in enumerate(edges): + if nodes[a][1] or nodes[b][1] or r!=8: + continue + need({nodes[a][0]==0,nodes[b][0]==0}=={True,False},'empty/high rank-eight endpoints') + external=[] + for node,other in ((a,b),(b,a)): + need(len(adj[node])==4,'rank-eight endpoint has degree four') + need(sum(v==other for _,v,_,_ in adj[node])==1,'no parallel shared edge') + ext=[row for row in adj[node] if row[0]!=i] + need(len(ext)==3 and all(mp==0 for _,_,_,mp in ext),'three native-identity external edges') + ranks=sorted(r for _,_,r,_ in ext) + need(ranks[:2]==[0,0] and ranks[2]<=2,'two empty-cost edges and one rank-at-most-two edge') + external.append(dict(node=node,external_rank_multiset=ranks,edges=ext)) + rank8.append(dict(edge=i,endpoints=[a,b],external=external)) +need(len(rank8)==8,'all eight rank-eight internal edges') +need(rejected(lambda:need([0,0,3][2]<=2,'unsupported external-rank inventory')), + 'changed-graph rank inventory control must reject') +(HERE/'RANK8-CENSUS.json').write_text(json.dumps(dict(edges=rank8, + nominal_independent_neighbour_cases=8*1022**2,actual_pair_cases_evaluated=0, + complete_paid_lower_bound='2 + 6^theta - 8^theta >= 2 - 2^theta', + power_interval='0 <= theta < 1',status='ANALYTIC_STOP_BEFORE_PAIR_SCAN'),indent=2)+'\n') +result=dict(status='PASS',cases=261632,distinct_profiles=len(profiles),hyperplane_groups=511, + distinct_neighbours=1022,prefix_minima=prefix,sharp_lower_paid_delta=list(best), + full_power_interval='0 <= theta <= 1',exact_uniform_paid_loss_lower_bound=2, + helpers_unchanged=408,independent_center_reward=0, + graph_sha256=sha256(raw).hexdigest(), + rank8_pair_domain_closed_analytically=8*1022**2, + scope='fixed graph, two adjacent empty contacts, opposite neighbours of one common hyperplane; rank-eight pair analytic gate') +(HERE/'VERIFY.json').write_text(json.dumps(result,indent=2)+'\n') +print(json.dumps(result,sort_keys=True)) diff --git a/research/sol1337-global-centre-cut/scan.cpp b/research/sol1337-global-centre-cut/scan.cpp new file mode 100644 index 0000000000..23be808f80 --- /dev/null +++ b/research/sol1337-global-centre-cut/scan.cpp @@ -0,0 +1,83 @@ +// Apache-2.0. Substantial OpenAI Codex assistance. +// Source-bound mixed-original-group binary move screen; no supplier admission. +#define main retained_discovery_main +#include "vendor/dynamic_neighbors.cpp" +#undef main +#include +#include +#include +#include +#include +#include "cut.hpp" +struct External {int node,rank;Local local;V own,neighbor;}; +struct Internal {int a,b,rank;Local local;}; +int run(int argc,char**argv){ + if(argc!=4)return 2; + int limit=std::stoi(argv[3]);if(limit<1||limit>262143)return 3; + std::ifstream in(argv[1]);int n,f,m,e;in>>n>>f>>m>>e; + std::vectorframe(n),fixed(n),index(n,-1),original; + for(int i=0;i>frame[i]>>fixed[i];if(!fixed[i]){index[i]=original.size();original.push_back(i);}} + std::vectorfs(f,V(9)),maps(m,V(18)),invs; + for(auto&b:fs)for(auto&x:b)in>>x; + for(auto&b:maps){for(auto&x:b)in>>x;invs.push_back(inverse(b));} + std::vectoredges(e);std::vectorext;std::vectorinternal; + const int k=original.size();if(k!=184)throw 30; + std::vectordegree(k),leaf(k),nonleaf; + std::array baseline{}; + for(auto&t:edges){in>>t.a>>t.b>>t.r>>t.sign>>t.map;if(t.sign!=1)throw 31; + if(t.r<0||t.r>9)throw 45; + baseline[t.r]++; + int a=index[t.a],b=index[t.b];if(a<0&&b<0)continue; + if(a>=0&&b>=0){if(t.map)throw 32;internal.push_back({a,b,t.r,make_local(fs[frame[t.a]],fs[frame[t.b]],t.r,1)});degree[a]++;degree[b]++;} + else {int node=a>=0?a:b;V neighbor=a>=0?map(invs[t.map],fs[frame[t.b]]):map(maps[t.map],fs[frame[t.a]]);ext.push_back({node,t.r,make_local(fs[frame[original[node]]],neighbor,t.r,1),fs[frame[original[node]]],neighbor});} + } + if(!in)return 4; + for(int r=1;r<=9;r++){int expected[10]={0,2201,412,510,127,40,0,0,8,0};if(baseline[r]!=expected[r])throw 46;} + int leaves=0,rank0=0,rank8=0; + for(int i=0;i reduced(k,-1);for(unsigned i=0;iseen;std::vectornegative(10),minima(10),nonempty(10);long long weights[10][10]{}; + for(int j=1;j<=9;j++)for(int r=0;r<=9;r++)weights[j][r]=std::min(j,r); + const long long scale=10000000000LL;for(int r=1;r<=9;r++)weights[0][r]=llround(scale*std::pow(r,1-.0030217758)); + long long minimum[10]{};unsigned bestaxis[10]{};std::vector>bestdelta(10);std::vectorbestselected(10); + auto start=std::chrono::steady_clock::now();int cases=0,checks=0; + for(unsigned axis=1;axis<=unsigned(limit);axis++){ + std::string signature;signature.reserve(ext.size()+internal.size());std::vectored,td;std::vector>delta(k); + for(const auto&t:ext){int d=change(t.local,axis);signature+=char(d+1);ed.push_back(d);delta[t.node][t.rank+d]++;delta[t.node][t.rank]--;} + for(const auto&t:internal){int d=change(t.local,axis);signature+=char(d+1);td.push_back(d);} + if(!seen.insert(signature).second)continue; + for(int j=0;j<=9;j++){ + std::vectorunary(k);for(int v=0;vx(k);for(int v:nonleaf)x[v]=chosen[reduced[v]]; + for(unsigned ei=0;eiactual{};for(int v=0;v +#include +#include +#include +#include +#include +#include +#include +#include +using V=std::vector; +V basis(V a){V b(18);for(auto x:a){while(x){int j=31-std::countl_zero(x);if(b[j])x^=b[j];else{b[j]=x;break;}}}V r;for(auto x:b)if(x)r.push_back(x);return r;} +V ann(V a){a=basis(a);int k=0;V piv;for(int j=0;j<18;j++){int z=k;while(z<(int)a.size()&&!(a[z]>>j&1))z++;if(z==(int)a.size())continue;std::swap(a[k],a[z]);for(int i=0;i<(int)a.size();i++)if(i!=k&&(a[i]>>j&1))a[i]^=a[k];piv.push_back(j);k++;}V out;for(int j=0;j<18;j++)if(std::find(piv.begin(),piv.end(),j)==piv.end()){unsigned v=1u<>j&1)v|=1u< rows(18);for(int i=0;i<18;i++){unsigned long long x=1ull<<(18+i);for(int j=0;j<18;j++)if(a[j]>>i&1)x|=1u<>j&1))k++;if(k==18)throw 1;std::swap(rows[k],rows[j]);for(int i=0;i<18;i++)if(i!=j&&(rows[i]>>j&1))rows[i]^=rows[j];}V out(18);for(int j=0;j<18;j++)for(int i=0;i<18;i++)if(rows[i]>>(18+j)&1)out[j]|=1u<>9))+std::popcount((a>>9)&(b&511)))&1;} +void turn(V& lag,unsigned axis){for(auto& x:lag)if(symp(x,axis))x^=axis;} +struct Edge{int a,b,r,sign,map;}; +struct Local{V neighbor,sum;int r,sign;std::array base{},part{};}; +Local make_local(V u,V v,int r,int sign){V both=u;both.insert(both.end(),v.begin(),v.end());Local t{ann(v),ann(both),r,sign};for(int group=0;group<2;group++)for(auto z:(group?v:u)){unsigned x=z,p=group?0:z;while(x){int j=31-std::countl_zero(x);if(t.base[j]){x^=t.base[j];p^=t.part[j];}else{t.base[j]=x;t.part[j]=p;break;}}}return t;} +int change(const Local& t,unsigned axis){if(contains(t.neighbor,axis))return 0;if(!contains(t.sum,axis))return 1;unsigned x=axis,u=0;while(x){int j=31-std::countl_zero(x);u^=t.part[j];x^=t.base[j];}return symp(u,axis)?-1:0;} +int main(int argc,char**argv){if(argc!=5&&argc!=6)return 2;double temperature=argc==6?std::stod(argv[5]):0;if(temperature<0)return 2;std::ifstream in(argv[1]);int n,f,m,e;in>>n>>f>>m>>e;std::vector frame(n),fixed(n);for(int i=0;i>frame[i]>>fixed[i];std::vector fs(f,V(9)),maps(m,V(18)),inv;for(auto& b:fs)for(auto& x:b)in>>x;for(auto& b:maps){for(auto& x:b)in>>x;inv.push_back(inverse(b));}std::vector edges(e);std::vector lags;for(auto x:frame)lags.push_back(fs[x]);std::vector> adj(n);for(int i=0;i>t.a>>t.b>>t.r>>t.sign>>t.map;adj[t.a].push_back(i);adj[t.b].push_back(i);}if(!in)return 3; + double pw[11];for(int r=0;r<=10;r++)pw[r]=std::pow(r,1-.00302177585);std::mt19937 rng(std::stoul(argv[3]));int passes=std::stoi(argv[4]);std::vector> moves;double total=0;std::vector order;for(int i=2;i local;auto own=ann(lags[node]);for(int ei:adj[node]){auto& t=edges[ei];auto other=t.a==node?map(inv[t.map],lags[t.b]):map(maps[t.map],lags[t.a]);auto both=other;both.insert(both.end(),lags[node].begin(),lags[node].end());int r=(int)basis(both).size()-9;local.push_back(make_local(lags[node],other,r,t.sign));} + double best=temp>0?std::numeric_limits::infinity():0;unsigned axisbest=0;unsigned zeros=0; + for(unsigned axis:canonical_transvection_axes(lags[node])){ + double delta=0;bool valid=true;for(const auto& t:local){int d=change(t,axis);int r=t.r+d;if(r<0||r>9||(t.sign<0&&r<2)){valid=false;break;}delta+=t.sign*(pw[r]-pw[t.r]);} + if(!valid)continue; + if(delta0||rng()%3==0))||(temp>0&&best>0&&std::uniform_real_distribution(0,1)(rng)1e-8){std::cerr<<"INDEPENDENT LOCAL RANK MISMATCH "< paid{},helper{},oldpaid{},oldhelper{};for(auto& t:edges){V both=map(maps[t.map],lags[t.a]);both.insert(both.end(),lags[t.b].begin(),lags[t.b].end());int r=(int)basis(both).size()-9;(t.sign>0?paid:helper)[r]++;(t.sign>0?oldpaid:oldhelper)[t.r]++;} + double delta=0;for(int r=0;r<=9;r++)delta+=pw[r]*(paid[r]-oldpaid[r]-helper[r]+oldhelper[r]); + std::ofstream out(argv[2]);out.precision(17);out<<"{\"scope\":\"floating coordinated Clifford contact discovery; no acceptance\",\"delta\":"<>i&1:y^=a + return y + +def inv(cols): + values={mv(cols,x):x for x in range(512)} + need(len(values)==512,'invertible G') + return [values[1<{f}') + b=new(f) if dst is None else dst + edges.append(('paid',a,b,len(frames[f])-len(frames[old]),tuple(frames[old]))) + cur[r]=b + maps={x['op']:x['G_columns'] for x in c['warps']} + maps.update({-op:inv(cols) for op,cols in list(maps.items())}) + for e in payload['programs']['forward']: + if e[0]=='climb': + _,_,r,a,b,width=e + need(sp[a]=224: + a,b=c['start'][r],f;need(sp[a]<=sp[b],'nested helper boundary') + rewards.append((entry[r] if mode=='entrances' else dst, + len(frames[b])-len(frames[a]),tuple(frames[a]))) + return nodes,edges,fixed,rewards + +def mask(space): + return sum(1 << x for x in space) + +def dimension(bits): + n = bits.bit_count() + need(n > 0 and n & (n-1) == 0, 'binary subspace size') + return n.bit_length()-1 + +def fourier_rank(a, b): + return dimension(a)+dimension(b)-2*dimension(a & b) + +def load(path): + raw = Path(path).read_bytes() + return json.loads(gzip.decompress(raw) if str(path).endswith('.gz') else raw) + +def build(payload, functionals): + """All paid edges, including old zero edges, and both helper endpoints.""" + nodes, edges, fixed, _ = graph(payload, 'free') + frames = payload['canonical']['frames'] + old = [mask(span(b)) for b in frames] + kernel = mask(x for x in range(512) + if all((l & x).bit_count() % 2 == 0 for l in functionals)) + new = [s & kernel for s in old] + tables = [] + for kind, a, b, x, y in edges: + left = (old[nodes[a]], new[nodes[a]]) + right = (old[nodes[b]], new[nodes[b]]) + if kind == 'warp': + image = {0: 0} + for u, v in zip(x, y): + image.update({z ^ u: w ^ v for z, w in list(image.items())}) + left = tuple(mask(image[z] for z in image if s >> z & 1) for s in left) + ranks = [fourier_rank(left[i], right[j]) for i,j in ((0,0),(1,0),(0,1),(1,1))] + if kind == 'warp': need(ranks[0] == 0, 'original native warp is monomial') + tables.append((kind, a, b, ranks)) + helpers = [] + for r in range(224, 632): + a, b = 2+r, len(nodes)-632+r + left = (old[nodes[a]], new[nodes[a]]) + right = (old[nodes[b]], new[nodes[b]]) + ranks = [fourier_rank(left[i], right[j]) for i,j in ((0,0),(1,0),(0,1),(1,1))] + helpers.append((r, a, b, ranks)) + centers = Counter(e[4] for e in payload['programs']['forward'] if e[0] == 'center') + source_paid = Counter(e[5] for e in payload['programs']['forward'] if e[0] == 'climb') + centers + result = dict(nodes=nodes, fixed=sorted(fixed), edges=tables, helpers=helpers, + centers=dict(centers), old_spaces=old, new_spaces=new) + p,h = invoice(result, []) + need(p == source_paid, 'reconstructed baseline invoice') + return result + +def invoice(model, selected): + chosen = set(selected) + need(not chosen.intersection(model['fixed']), 'main, adapter and owned boundaries frozen') + need(all(2 <= n < len(model['nodes']) for n in chosen), 'valid selected contact') + paid = Counter(model['centers']) + helper = Counter() + def rank_at(a, b, ranks): + return ranks[(a in chosen)+2*(b in chosen)] + for _,a,b,ranks in model['edges']: + r=rank_at(a,b,ranks) + if r: paid[r] += 1 + for _,a,b,ranks in model['helpers']: + r=rank_at(a,b,ranks) + need(r > 0, 'strict productive helper') + helper[r] += 1 + return paid, helper + + +def binary_rank(rows): + pivots = {} + for x in rows: + while x: + i = x.bit_length()-1 + if i not in pivots: + pivots[i] = x + break + x ^= pivots[i] + return len(pivots) + +def phase_matrix(functionals): + rows = [0]*9 + for functional in functionals: + for i in range(9): + if functional >> i & 1: + rows[i] ^= functional + return rows + +def restrict_form(rows, basis): + def value(x, y): + return sum((x >> i & 1)*((rows[i] & y).bit_count() % 2) + for i in range(9)) % 2 + return [sum(value(x,y) << j for j,y in enumerate(basis)) for x in basis] + +def build_phase(payload, functionals): + """Binary gauges b_U=0 or Q|U, Q=sum lambda*lambda^T over F2. + + Subspaces and logical G maps stay fixed. All changed paid and warp + Gaussian ranks are charged. Both helper boundaries can change. + """ + nodes, edges, fixed, _ = graph(payload, 'free') + frames = payload['canonical']['frames'] + q = phase_matrix(functionals) + matrices = [restrict_form(q, b) for b in frames] + active = [bool(binary_rank(s)) for s in matrices] + tables = [] + for kind,a,b,x,y in edges: + if kind == 'paid': + extra = binary_rank(matrices[nodes[a]]) + ranks = [x, x+extra, x+extra, x] + else: + source, target = restrict_form(q,x), restrict_form(q,y) + ranks = [0, binary_rank(source), binary_rank(target), + binary_rank([u^v for u,v in zip(source,target)])] + need(max(ranks) <= 9, 'valid physical phase rank') + tables.append((kind,a,b,ranks)) + helpers = [] + for r in range(224,632): + a,b = 2+r,len(nodes)-632+r + h = len(frames[nodes[b]])-len(frames[nodes[a]]) + extra = binary_rank(matrices[nodes[a]]) + helpers.append((r,a,b,[h,h+extra,h+extra,h])) + centers = Counter(e[4] for e in payload['programs']['forward'] if e[0]=='center') + expected = Counter(e[5] for e in payload['programs']['forward'] if e[0]=='climb')+centers + # Discovery only compares these tokens for whether a node has an alternative. + m = dict(nodes=nodes, fixed=sorted(fixed), edges=tables, helpers=helpers, + centers=dict(centers), old_spaces=list(range(len(frames))), + new_spaces=[i+len(frames) if active[i] else i for i in range(len(frames))]) + paid,_ = invoice(m, []) + need(paid == expected, 'reconstructed paid-phase baseline') + return m + +def nullspace(rows, width): + rows=list(rows);pivots=[];k=0 + for j in range(width): + found=next((i for i in range(k,len(rows)) if rows[i]>>j&1),None) + if found is None:continue + rows[k],rows[found]=rows[found],rows[k] + for i in range(len(rows)): + if i!=k and rows[i]>>j&1:rows[i]^=rows[k] + pivots.append(j);k+=1 + return [(1<>j)&1)<>width)).bit_count()+ + ((x>>width)&(axis&low)).bit_count())%2 + return [x^(axis if pairing(x) else 0) for x in basis] + +def lagrangian_distance(a,b,width): + return binary_rank(a+b)-width + +def build_pauli(payload, coordinates): + """Gauge C_U or C_U S_P for one common Hermitian Pauli quarter turn. + + The chosen axis is (X mask, Z mask); this can change both the chart + subspace and its symmetric form. All changed physical edges are paid. + """ + x,z=coordinates;axis=x|(z<<9) + need(0<=x<512 and 0<=z<512 and axis,'nonzero nine-bit Pauli axis') + nodes,edges,fixed,_=graph(payload,'free');c=payload['canonical'];frames=c['frames'] + old=[lagrangian(b,9) for b in frames] + new=[transvection(b,axis,9) for b in old] + active=[bool(lagrangian_distance(a,b,9)) for a,b in zip(old,new)] + maps={w['op']:w['G_columns'] for w in c['warps']} + maps.update({-op:inv(g) for op,g in list(maps.items())}) + warp_ops=iter(e[2] for e in payload['programs']['forward'] if e[0]=='warp') + cache={};tables=[] + for kind,a,b,r,image in edges: + fa,fb=nodes[a],nodes[b] + if kind=='paid': + if (fa,fb) not in cache: + need(lagrangian_distance(old[fa],old[fb],9)==r,'old chart rank') + changed=lagrangian_distance(new[fa],old[fb],9) + cache[fa,fb]=[r,changed,changed,r] + ranks=cache[fa,fb] + else: + g=maps[next(warp_ops)];gi=inv(g) + git=[sum(((gi[j]>>i)&1)< +#include +#include +#include +#include + +// Exact neighbor enumeration; coordinates are x | (z << n). +inline std::vector canonical_transvection_axes(const std::vector& lag, unsigned n=9) { + if (lag.size()!=n || n==0 || n>15) throw std::invalid_argument("Lagrangian dimension"); + const unsigned mask=(1u< rows(n); + for(unsigned i=0;i>n)|((lag[i]&mask)< piv; + unsigned k=0; + for(unsigned j=0;j<2*n && k>j&1)) z++; + if(z==n) continue; + std::swap(rows[k],rows[z]); + for(unsigned i=0;i>j&1)) rows[i]^=rows[k]; + piv.push_back(j); k++; + } + if(k!=n) throw std::invalid_argument("Dependent Lagrangian basis"); + std::vector dual(n); + for(unsigned j=0;j>(2*n+j)&1) dual[j]|=1u< base(1u< 0 else -1) * (abs(op) + (1000000 if dual else 0)) + events.append(('warp', r[1], symbol, a, b)) + else: + need(kind in ('phase', 'adapter'), 'known native marker') + need(center == 7 and len(starts) == N, 'eight distinct arbitrary center inputs') + return starts, centers, events + + +def span(basis): + out = {0} + for v in basis: + out |= {x ^ v for x in tuple(out)} + need(len(out) == 2 ** len(basis), 'independent chart basis') + return out + + +def replay(payload, starts, events, baseline=False): + rows = [{(i, ()): Q(1)} for i in range(N)] + current = starts[:] + frames = payload['canonical']['frames'] + spaces = list(map(span, frames)) + paid = Counter() + for e in events: + op, r = e[:2] + if op in ('add', 'copy'): + _, _, s, a, frame = e + need(r != s and current[r] == current[s] == frame, 'actual scalar common chart') + if op == 'copy': + need(baseline and r >= 632, 'only baseline owned copy') + rows[r] = dict(rows[s]) + else: + plus(rows[r], rows[s], a) + elif op == 'scale': + _, _, a, frame = e + need(current[r] == frame and a != 0, 'scale chart and invertibility') + rows[r] = {k: a * v for k, v in rows[r].items()} + elif op == 'transport': + _, _, a, b, width = e + need(current[r] == a, 'actual paid source chart') + need(spaces[a] < spaces[b] or spaces[b] < spaces[a], 'strictly nested transport') + need(width == abs(len(frames[a]) - len(frames[b])), 'rank derived from geometry') + paid[width] += 1 + current[r] = b + else: + _, _, symbol, a, b = e + need(op == 'warp' and current[r] == a, 'native warp source chart') + out = {} + for (variable, word), value in rows[r].items(): + word = word[1:] if word and word[0] == -symbol else (symbol,) + word + plus(out, {(variable, word): value}) + rows[r] = out + current[r] = b + need(dict(paid) == PAID, 'complete emitted recursive invoice') + need(current == payload['canonical']['final'] + [0] * 8, 'all 640 output charts') + need(all(not word for row in rows for _, word in row), 'all free warp words cancel') + return [{i: v for (i, _), v in row.items()} for row in rows] + + +def product(a, b): + out = [] + for row in a: + new = {} + for j, v in row.items(): + plus(new, b[j], v) + out.append(new) + return out + + +def transpose(a): + out = [{} for _ in a] + for i, row in enumerate(a): + for j, v in row.items(): + out[j][i] = v + return out + + +def encoded(a): + return [[[j, str(v)] for j, v in sorted(row.items())] for row in a] + + +def matrix_rank(rows): + pivots = {} + for old in rows: + row = dict(old) + while row: + p = min(row) + if p not in pivots: + q = row[p] + pivots[p] = {j: v / q for j, v in row.items()} + break + plus(row, pivots[p], -row[p]) + return len(pivots) + + +def run(): + payload = load() + starts, centers, events = emit(payload) + actual = replay(payload, starts, events) + _, _, old_events = emit(payload, baseline=True) + old = replay(payload, starts, old_events, baseline=True) + identity = [{i: Q(1)} for i in range(N)] + a = [dict(row) for row in identity] + for i in range(112): + a[112 + i][i] = Q(1) + need(old[:632] == a[:632], 'source all-632-column native identity ABI') + b = [{j: v for j, v in row.items() if j >= 632} for row in actual[:632]] + r = [{j: v for j, v in row.items() if j < 632} for row in actual[632:]] + need(all(actual[i] == a[i] | b[i] for i in range(632)), 'unchanged old-input columns') + need(all(actual[632 + i] == r[i] | {632 + i: Q(1)} for i in range(8)), 'center residual ABI') + need(all(not b[i] for i in list(range(112)) + list(range(224, 632))), 'noise only in Y outputs') + need(all(all(j < 112 or 224 <= j < 632 for j in row) for row in r), 'center reads only X/helper inputs') + need(matrix_rank(b) == matrix_rank(r) == 8, 'two actual rank-eight coupling maps') + k = [dict(row) for row in actual] + for i in range(N): + plus(k[i], identity[i], -1) + k2 = product(k, k) + need(any(k2) and not any(product(k2, k)), 'K squared nonzero and K cubed zero') + inverse = [dict(row) for row in identity] + for i in range(N): + plus(inverse[i], k[i], -1) + plus(inverse[i], k2[i]) + need(product(inverse, actual) == product(actual, inverse) == identity, 'exact two-sided inverse') + _, _, dual_events = emit(payload, dual=True) + dual = replay(payload, starts, dual_events) + need(dual == transpose(inverse), 'all-640-column raw inverse transpose with the same bill') + need(product(transpose(dual), actual) == identity, 'exact primal/dual pairing') + # Controls retain the same source/invoice but falsify actual operator claims. + bad = list(events) + i = next(i for i, e in enumerate(bad) if e[0] == 'add' and e[1] == 632) + e = bad[i] + bad[i] = (*e[:3], -e[3], e[4]) + need(replay(payload, starts, bad) != actual, 'changed center injection rejected') + bad = list(dual_events) + i = next(i for i, e in enumerate(bad) if e[0] == 'add' and e[2] == 632) + e = bad[i] + bad[i] = (*e[:3], -e[3], e[4]) + need(replay(payload, starts, bad) != transpose(inverse), 'wrong inverse-transpose sign rejected') + bad = list(events) + i = next(i for i, e in enumerate(bad) if e[0] == 'transport' and e[1] == 632) + e = bad[i] + bad[i] = (*e[:4], e[4] - 1) + rejected = False + try: + replay(payload, starts, bad) + except ValueError: + rejected = True + need(rejected, 'false center rank rejected from actual charts') + # Independent Gram and support facts expose actual arbitrary-input leakage. + gram = [[sum(b[i].get(632 + u, 0) * b[i].get(632 + v, 0) for i in range(632)) + for v in range(8)] for u in range(8)] + need(gram == [[Q(7, 2) * (u == v) for v in range(8)] for u in range(8)], 'B transpose B = 7/2 I') + # The zero-center source contract cannot certify eight independent new jobs. + need(any(b), 'nonzero incoming center changes original target outputs') + need(all(r), 'new center outputs are contaminated by original arbitrary inputs') + abi = {'schema': 'retained-center-extension/1', 'source_sha256': SOURCE_HASH, + 'centers': centers, 'B_rows': encoded(b), 'R_rows': encoded(r)} + result = {'status': 'EXACT_REVERSIBLE_640_FIELD_EXTENSION_NO_NEW_KAPPA', + 'source_inputs': 632, 'new_arbitrary_inputs': 8, 'outputs': N, + 'paid': PAID, 'new_recursive_calls': 0, 'owned_erase_or_copy_operations': 0, + 'B_rank': 8, 'R_rank': 8, 'nilpotence_index': 3, + 'noisy_old_outputs': sum(bool(row) for row in b), + 'old_input_terms_in_center_outputs': [len(row) for row in r], + 'center_residual_ranks_without_decoupling_credit': [8] * 8, + 'primal_and_raw_inverse_transpose_checked': True, + 'controls': ['center injection sign', 'dual sign', 'false center rank', + 'new-input leakage', 'old-input contamination'], + 'independent_new_productive_jobs_certified': False, + 'abi_sha256': sha256((json.dumps(abi, sort_keys=True) + '\n').encode()).hexdigest()} + return abi, result + + +if __name__ == '__main__': + abi, result = run() + if sys.argv[1:] == ['--write']: + for name, value in [('ABI.json', abi), ('RESULT.json', result)]: + (HERE / name).write_text(json.dumps(value, indent=2, sort_keys=True) + '\n') + else: + need(not sys.argv[1:], 'known command arguments') + for name, value in [('ABI.json', abi), ('RESULT.json', result)]: + need(json.loads(json.dumps(value)) == json.loads((HERE / name).read_text()), 'exact receipt ' + name) + print(json.dumps(result, sort_keys=True)) diff --git a/research/sol1337-global-centre-cut/verify.py b/research/sol1337-global-centre-cut/verify.py new file mode 100644 index 0000000000..b2da703f43 --- /dev/null +++ b/research/sol1337-global-centre-cut/verify.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python3 +"""Source-pinned complete common-axis paid-profile replay. Apache-2.0.""" +import hashlib +import importlib.util +import json +from pathlib import Path +import subprocess +import tempfile + +HERE = Path(__file__).resolve().parent + + +def need(value, message): + if not value: + raise RuntimeError(message) + + +def main(): + for item in json.loads((HERE / 'SOURCES.local.json').read_text()): + need(hashlib.sha256((HERE / item['path']).read_bytes()).hexdigest() + == item['sha256'], 'retained source bytes: ' + item['path']) + spec = importlib.util.spec_from_file_location('build_graph', HERE / 'build_graph.py') + builder = importlib.util.module_from_spec(spec) + spec.loader.exec_module(builder) + with tempfile.TemporaryDirectory(prefix='sol1337-global-centre-') as scratch: + work = Path(scratch) + meta = builder.build(work) + need(meta['newly_variable_center_contacts'] == 184 and meta['inputs'] == 640, + 'retained640 variable boundary') + rows = (work / 'center-contact-graph.txt').read_text().splitlines() + n, f, m, e = map(int, rows[0].split()) + need((n, e) == (19197, 34830), 'actual graph dimensions') + nodes = [tuple(map(int, row.split())) for row in rows[1:1+n]] + charts = [list(map(int, row.split())) for row in rows[1+n:1+n+f]] + groups = {fi for fi, fixed in nodes if not fixed} + need(len(groups) == 9, 'nine original chart groups') + common = None + for fi in groups: + span = {0} + for x in charts[fi]: + span |= {v ^ x for v in list(span)} + common = span if common is None else common & span + need(common == {0}, 'complete literal ambient axis domain') + binary = work / 'scan' + subprocess.run(['g++', '-std=c++20', '-O3', '-Wall', '-Wextra', '-Werror', + str(HERE / 'scan.cpp'), '-o', str(binary)], check=True) + result = work / 'screen.json' + subprocess.run([str(binary), str(work / 'center-contact-graph.txt'), + str(result), '262143'], check=True) + expected = json.loads((HERE / 'SCREEN.json').read_text()) + need(json.loads(result.read_text()) == expected, 'complete screen receipt') + need(expected['distinct_rank_configurations'] == 419 + and expected['independent_rank_configuration_checks'] == 419, + 'all retained rank configurations checked') + need(all(r['minimum_integer_delta'] == 0 and r['negative_configurations'] == 0 + for r in expected['results']), 'all integer prefix optima zero') + edge_start = 1+n+f+m + edges = [list(map(int, row.split())) for row in rows[edge_start:]] + internal = next(i for i, t in enumerate(edges) + if not nodes[t[0]][1] and not nodes[t[1]][1] and t[2] == 8) + for name, field, value in [('negative-sign', 3, -1), + ('nonidentity-internal-map', 4, 1), + ('changed-old-invoice', 2, 7)]: + mutated = rows.copy() + edge = edges[internal].copy() + edge[field] = value + mutated[edge_start+internal] = ' '.join(map(str, edge)) + path = work / (name + '.txt') + path.write_text('\n'.join(mutated) + '\n') + check = subprocess.run([str(binary), str(path), str(work/'bad.json'), '1'], + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + need(check.returncode != 0, 'mutation rejects: ' + name) + print('PASS_GLOBAL_CENTRE_CUT axes=262143 configurations=419 exact_prefix_cuts=3771 controls=3') + + +if __name__ == '__main__': + main() diff --git a/research/sol1337-global-centre-cut/verify_pairs.py b/research/sol1337-global-centre-cut/verify_pairs.py new file mode 100644 index 0000000000..5969b9aa4a --- /dev/null +++ b/research/sol1337-global-centre-cut/verify_pairs.py @@ -0,0 +1,111 @@ +#!/usr/bin/env python3 +"""Additive adjacent-pair ceiling replay. Apache-2.0; Codex assisted. + +Keeps the original common-axis science and producer pair files unchanged. +All generated files and the producer's mutating replay execute in scratch. +""" +import hashlib +import importlib.util +import json +from pathlib import Path +import shutil +import subprocess +import sys +import tempfile + +HERE = Path(__file__).resolve().parent +PAIRS = HERE / 'pairs' + + +def need(value, message): + if not value: + raise RuntimeError(message) + + +def digest(path): + return hashlib.sha256(path.read_bytes()).hexdigest() + + +def main(): + origin = json.loads((PAIRS / 'ORIGIN.json').read_text()) + for item in origin['copied_files']: + need(digest(PAIRS / item['path']) == item['sha256'], + 'unchanged authenticated producer bytes: ' + item['path']) + original = json.loads((PAIRS / 'SOURCES.json').read_text()) + need(digest(PAIRS / 'SOURCES.json') == origin['producer_sources_sha256'], + 'original producer source receipt') + for item in json.loads((HERE / 'SOURCES.local.json').read_text()): + need(digest(HERE / item['path']) == item['sha256'], + 'unchanged retained640 source bytes: ' + item['path']) + lower = [1, 1, 1, 1, 1, 1, 1, 0, 0] + for key, cases, classes in [('predecessor_single_screen', 188048, 18), + ('predecessor_pair_screen', 1834488, 46)]: + predecessor = origin[key] + need(digest(PAIRS / predecessor['path']) == predecessor['sha256'], + 'exact PR4867 receipt: ' + key) + receipt = json.loads((PAIRS / predecessor['path']).read_text()) + need(receipt['cases'] == cases and len(receipt['rank_delta_classes']) == classes, + 'complete predecessor neighbourhood: ' + key) + for row in receipt['rank_delta_classes']: + delta = row['delta'] + prefix = [sum(delta[r] * min(r, j) for r in range(10)) for j in range(1, 10)] + need(all(a >= b for a, b in zip(prefix, lower)), + 'inherited complete concave bound: ' + key) + spec = importlib.util.spec_from_file_location('pair_graph_builder', HERE / 'build_graph.py') + builder = importlib.util.module_from_spec(spec) + spec.loader.exec_module(builder) + with tempfile.TemporaryDirectory(prefix='sol1337-independent-pairs-') as scratch: + work = Path(scratch) + builder.build(work) + expected = {row['path']: row['sha256'] for row in original['own_files']} + for name in ['center-contact-graph.txt', 'graph-metadata.json']: + need(digest(work / name) == expected[name], 'exact producer generated graph: ' + name) + for name in ['verify.py', 'SCREEN.json']: + shutil.copyfile(PAIRS / name, work / name) + binary = work / 'scan' + subprocess.run(['g++', '-std=c++20', '-O3', '-Wall', '-Wextra', '-Werror', + '-I', str(HERE / 'vendor'), str(PAIRS / 'scan.cpp'), + '-o', str(binary)], check=True) + cxx_receipt = work / 'cxx-screen.json' + subprocess.run([str(binary), str(work / 'center-contact-graph.txt'), + str(cxx_receipt)], check=True) + actual = json.loads(cxx_receipt.read_text()) + saved = json.loads((PAIRS / 'SCREEN.json').read_text()) + float_key = 'floating_discovery_minimum_paid_delta' + need(abs(actual.pop(float_key) - saved.pop(float_key)) < 1e-12, + 'separate floating diagnostic agrees') + need(actual == saved, 'complete C++ pair histogram/count receipt') + # The producer code imports no predecessor rank engine and independently + # combines complete single-endpoint invoices plus shared-edge correction. + subprocess.run([sys.executable, '-I', '-O', '-W', 'error', '-B', + str(work / 'verify.py')], cwd=work, check=True) + for name in ['RANK8-CENSUS.json', 'VERIFY.json']: + need((work / name).read_bytes() == (PAIRS / name).read_bytes(), + 'independent exact producer receipt: ' + name) + # Test source-graph rejection through the actual C++ entry point. + lines = (work / 'center-contact-graph.txt').read_text().splitlines() + n, f, m, e = map(int, lines[0].split()) + start = 1 + n + f + m + variables = [int(line.split()[1]) == 0 for line in lines[1:1+n]] + edge_index = next(i for i in range(start, start+e) + if variables[int(lines[i].split()[0])] + and variables[int(lines[i].split()[1])] + and int(lines[i].split()[2]) == 0) + for name, field, value in [('negative-paid-sign', 3, -1), + ('nonidentity-shared-map', 4, 1), + ('missing-simple-edge-domain', 2, 1)]: + mutated = lines.copy() + edge = mutated[edge_index].split() + edge[field] = str(value) + mutated[edge_index] = ' '.join(edge) + path = work / (name + '.txt') + path.write_text('\n'.join(mutated) + '\n') + result = subprocess.run([str(binary), str(path), str(work / 'bad.json')], + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + need(result.returncode != 0, 'actual pair graph control rejects: ' + name) + print('PASS_INDEPENDENT_ADJACENT_PAIRS opposite_cases=261632 profiles=44 ' + 'rank0_edges=256 rank8_edges=8 graph_controls=3') + + +if __name__ == '__main__': + main()