diff --git a/research/p112-shared-correction-cost-audit/NOTICE.md b/research/p112-shared-correction-cost-audit/NOTICE.md new file mode 100644 index 0000000000..6c7b49341f --- /dev/null +++ b/research/p112-shared-correction-cost-audit/NOTICE.md @@ -0,0 +1,12 @@ +SPDX-License-Identifier: Apache-2.0 + +PR2308-CERTIFICATE.json is copied byte for byte from Cinna Davis (1337isnot1337), +with substantial OpenAI Codex assistance, PR #2308 at commit +7653e0cc72527c1e7fc02499122d383713ee9d54, path +research/cycle47-shared-frame-correction/CERTIFICATE.json. +Git blob: 1aa8ddab0e0cd9e4e91da414a107ade54c2cba28. +The rational sharing construction and label map remain the predecessor's work. +Repository and retained-source licenses remain applicable. + +The new audit is prepared for commdata2338 (@commdata2338), with substantial +OpenAI Codex assistance. See README.md for the broader predecessor credits. diff --git a/research/p112-shared-correction-cost-audit/PR2308-CERTIFICATE.json b/research/p112-shared-correction-cost-audit/PR2308-CERTIFICATE.json new file mode 100644 index 0000000000..1aa8ddab0e --- /dev/null +++ b/research/p112-shared-correction-cost-audit/PR2308-CERTIFICATE.json @@ -0,0 +1,486 @@ +{ + "q_to_line": [ + { + "q": 11, + "line": 2 + }, + { + "q": 13, + "line": 6 + }, + { + "q": 14, + "line": 56 + }, + { + "q": 19, + "line": 7 + }, + { + "q": 21, + "line": 3 + }, + { + "q": 22, + "line": 76 + }, + { + "q": 26, + "line": 92 + }, + { + "q": 28, + "line": 104 + }, + { + "q": 35, + "line": 63 + }, + { + "q": 37, + "line": 75 + }, + { + "q": 38, + "line": 16 + }, + { + "q": 41, + "line": 91 + }, + { + "q": 44, + "line": 36 + }, + { + "q": 49, + "line": 111 + }, + { + "q": 50, + "line": 37 + }, + { + "q": 56, + "line": 17 + }, + { + "q": 67, + "line": 69 + }, + { + "q": 69, + "line": 81 + }, + { + "q": 70, + "line": 20 + }, + { + "q": 73, + "line": 97 + }, + { + "q": 74, + "line": 30 + }, + { + "q": 81, + "line": 117 + }, + { + "q": 84, + "line": 31 + }, + { + "q": 88, + "line": 21 + }, + { + "q": 98, + "line": 114 + }, + { + "q": 100, + "line": 102 + }, + { + "q": 104, + "line": 86 + }, + { + "q": 112, + "line": 66 + }, + { + "q": 131, + "line": 70 + }, + { + "q": 133, + "line": 82 + }, + { + "q": 134, + "line": 22 + }, + { + "q": 137, + "line": 98 + }, + { + "q": 138, + "line": 32 + }, + { + "q": 140, + "line": 46 + }, + { + "q": 145, + "line": 118 + }, + { + "q": 146, + "line": 47 + }, + { + "q": 148, + "line": 33 + }, + { + "q": 152, + "line": 23 + }, + { + "q": 161, + "line": 52 + }, + { + "q": 162, + "line": 113 + }, + { + "q": 164, + "line": 101 + }, + { + "q": 168, + "line": 85 + }, + { + "q": 176, + "line": 65 + }, + { + "q": 191, + "line": 53 + }, + { + "q": 193, + "line": 42 + }, + { + "q": 194, + "line": 107 + }, + { + "q": 196, + "line": 95 + }, + { + "q": 200, + "line": 79 + }, + { + "q": 208, + "line": 59 + }, + { + "q": 223, + "line": 43 + }, + { + "q": 224, + "line": 12 + }, + { + "q": 239, + "line": 108 + }, + { + "q": 247, + "line": 88 + }, + { + "q": 251, + "line": 72 + }, + { + "q": 253, + "line": 60 + }, + { + "q": 254, + "line": 13 + }, + { + "q": 259, + "line": 71 + }, + { + "q": 261, + "line": 83 + }, + { + "q": 262, + "line": 24 + }, + { + "q": 265, + "line": 99 + }, + { + "q": 266, + "line": 34 + }, + { + "q": 268, + "line": 48 + }, + { + "q": 273, + "line": 119 + }, + { + "q": 274, + "line": 49 + }, + { + "q": 276, + "line": 35 + }, + { + "q": 280, + "line": 25 + }, + { + "q": 289, + "line": 50 + }, + { + "q": 290, + "line": 112 + }, + { + "q": 292, + "line": 100 + }, + { + "q": 296, + "line": 84 + }, + { + "q": 304, + "line": 64 + }, + { + "q": 319, + "line": 51 + }, + { + "q": 321, + "line": 40 + }, + { + "q": 322, + "line": 106 + }, + { + "q": 324, + "line": 94 + }, + { + "q": 328, + "line": 78 + }, + { + "q": 336, + "line": 58 + }, + { + "q": 351, + "line": 41 + }, + { + "q": 352, + "line": 10 + }, + { + "q": 367, + "line": 109 + }, + { + "q": 375, + "line": 89 + }, + { + "q": 379, + "line": 73 + }, + { + "q": 381, + "line": 61 + }, + { + "q": 382, + "line": 11 + }, + { + "q": 385, + "line": 38 + }, + { + "q": 386, + "line": 105 + }, + { + "q": 388, + "line": 93 + }, + { + "q": 392, + "line": 77 + }, + { + "q": 400, + "line": 57 + }, + { + "q": 415, + "line": 39 + }, + { + "q": 416, + "line": 8 + }, + { + "q": 431, + "line": 110 + }, + { + "q": 439, + "line": 90 + }, + { + "q": 443, + "line": 74 + }, + { + "q": 445, + "line": 62 + }, + { + "q": 446, + "line": 9 + }, + { + "q": 448, + "line": 4 + }, + { + "q": 463, + "line": 116 + }, + { + "q": 471, + "line": 96 + }, + { + "q": 475, + "line": 80 + }, + { + "q": 477, + "line": 68 + }, + { + "q": 478, + "line": 5 + }, + { + "q": 487, + "line": 28 + }, + { + "q": 491, + "line": 18 + }, + { + "q": 493, + "line": 14 + }, + { + "q": 494, + "line": 67 + }, + { + "q": 499, + "line": 15 + }, + { + "q": 501, + "line": 19 + }, + { + "q": 502, + "line": 87 + }, + { + "q": 505, + "line": 29 + }, + { + "q": 506, + "line": 103 + }, + { + "q": 508, + "line": 115 + } + ], + "witness": { + "r_bits": [ + 0, + 0, + 1, + 0, + 0, + 0, + 1, + 0 + ], + "frames": [ + [ + 2, + 3, + 16, + 17, + 46, + 47, + 52, + 53 + ], + [ + 2, + 3, + 20, + 21, + 42, + 43, + 46, + 47 + ] + ] + } +} diff --git a/research/p112-shared-correction-cost-audit/README.md b/research/p112-shared-correction-cost-audit/README.md new file mode 100644 index 0000000000..995496988a --- /dev/null +++ b/research/p112-shared-correction-cost-audit/README.md @@ -0,0 +1,248 @@ +# P112 shared correction: scalar endpoint and COPY-cost audit + +**PR #2308's named frame pair needs at least 12 added COPY rank units in the +additive scalar model. Its fixed-profile 5% screen permits at most 8.** The +shared rational row-space identity remains valid; it does not by itself supply +the advertised +8 correction interface. + +This is a scoped proof and exact finite audit of +[Cinna Davis's PR #2308](https://github.com/CrocSwap/integer-mult-bounds/pull/2308), +head `7653e0cc72527c1e7fc02499122d383713ee9d54`, answering its open complete-charge +question. Evidence is author-checked, with two separately implemented finite +arithmetic routes, both written with AI assistance. No independent human review, +proof assistant, supplier or new kappa is claimed. + +## Exact object and results + +The unchanged [predecessor certificate](PR2308-CERTIFICATE.json) names these +orthogonal frames in its E8 line order: + +``` +S1 = [2,3,16,17,46,47,52,53] +S2 = [2,3,20,21,42,43,46,47] +S1 intersection S2 = [2,3,46,47] +``` + +Thus `U = S1 union S2` contains **12**, not 16, distinct ports. The selected-label +map and E8 lattice direction bind the physical shared vector to **r = 234** in +`F2^9`, with self-pairing one. Upgraded ports are orthonormal planes +`E_a = span(q_a,r)`; other ports remain lines. There are 52 complementary ports +`T = {b : r dot q_b = 1}`. + +The primary checker reconstructs 120 doubled E8 root representatives, checks all +112-by-112 selected binary pairings and the deleted-frame signatures, and checks +that S1 is the lexicographically first frame for this direction, as in PR #2308. +It derives the rational factorization from orthogonality without importing the +predecessor's solver. + +| Checked quantity | Exact value | +| --- | ---: | +| Distinct upgraded ports | 12 | +| Common rational correction-basis rank | 8 | +| Coefficient matrix rank modulo 2 | 1 | +| Support COPY ranks, one direction | 1, 1, 4, 4, 1, 1, 4, 4 | +| Both directions' COPY rank sum | **40** | +| Forbidden nonzero entries left by these corrections | **32** | +| Missing within-U block rank | 8 | +| Any additive scalar correction's COPY-rank floor | **12** | +| Formal source/dirty-target columns checked | 224 | + +The natural eight-term decoder using the *deleted* orthogonal frame costs 64 +on the line ports and 68 on these mixed ports. With the displayed correction it +costs **108 before the missing within-U repair**. This is a separate-term +algebraic invoice, not a native program or an optimum over other bases. The +ordinary Euclidean coordinate factorization is a different representation and +is not substituted for that decoder. + +[RESULT.json](RESULT.json) contains complete supports, rank witnesses, all bad +entries, exact rational moment intervals and controls. + +## Scalar model and rational sharing + +Let `G_ab = ` for roots of squared norm two. The normalized +original scalar map is `K0 = G/2`. For source port E_b and target endpoint +E_a-perp, a free endpoint correction requires orthogonal port subspaces. +Accordingly a fitting matrix satisfies + +``` +K_aa = 1; +K_ab = 0 for a != b whenever E_a and E_b are not orthogonal. +``` + +This is the mixed-port version of the condition in the retained +[paired-plane scalar audit](../paired-plane-scalar-mask-obstruction/README.md). +A scalar term `u v^T` costs the binary pairing rank between the spans of all +E_a with u_a nonzero and all E_b with v_b nonzero. Concatenated port bases give +this rank; repeats do not alter it. The primary compares bit and Boolean +elimination; the second checker explicitly enumerates the binary row span. + +These are scalar factors with ordinary transpose over Q or C. Sharing physical +children across terms, bundled operator maps, a different tariff or replacing +the original scalar decoder requires a different interface theorem. + +For the reference frame S0=S1, put + +``` +D[a,k] = , a in U; +B[k,b] = /2 if b in T, else 0. +``` + +Orthogonality gives `D B = G[U,T]`, with zeros outside T. The rank-eight common +basis identity is correct. We deduplicate shared rows, giving the mechanism +the favorable interpretation in which each physical port is used only once. + +The ordinary scalar correction suggested by these blocks is `-D B/2` on +U-by-T, and its transpose on T-by-U, eight terms per direction. Their support +ranks cost 20 per direction, hence 40. Coefficient-parity rank one is not this +tariff: `(D,B) -> (2D,B/2)` preserves the exact map and all nonzero supports, +but changes coefficient-parity rank from one to zero. A separate implementation +theorem is necessary to turn coefficient sharing into physical COPY sharing. + +## A missing cross-frame block + +All upgraded planes contain the same anisotropic r, so **every pair of upgraded +planes is nonorthogonal**, including pairs in different frames. Hence K[U,U] +must be the identity. The displayed corrections leave K0[U,U] unchanged, with +32 forbidden off-diagonal entries. The required within-U correction +`I_U-G[U,U]/2` has rank eight. + +For example, E8 lines 16 and 20 have selected labels 38 and 70. Their line +pairing is zero, but their planes share r with `r dot r=1`. The partial map has +`K[16,20]=1/2`. Source 20 equal to one, other sources zero, and target 16 initially +11 produce **23/2 instead of 11**. No free endpoint cross-addition can remove +this coefficient. All 112 source columns and 112 independent dirty-target +columns are checked. Setting the within-U block to the identity yields a valid +*scalar fitting-matrix* control, without claiming an implementation or price. + +## Proof: any additive scalar correction costs at least 12 + +Allow any number of added scalar terms, arbitrary complex coefficients, +cancellations and arbitrary choices on free entries. Retain K0 and write the +final map as `K0 + Delta`. Every pair in `U x (U union T)` is nonorthogonal: +columns in U contain r, and columns in T pair to one with r. Thus Delta has +the fixed restriction + +``` +A = [ I_U-G[U,U]/2 | -G[U,T]/2 ]. +``` + +This 12-by-64 matrix has full row rank. Write R_U and R_T for doubled-root row +matrices, so `G[U,T]=R_U R_T^T/4`. The T roots span dimension eight. If zA=0, +the second block forces zR_U=0; the first then forces z=0. This works over C +as well as Q and uses ordinary transpose, without a positivity assumption. + +Eight T roots have integer determinant **1024**. A separate 12-by-12 minor of +**2A** has determinant **2048**. The second checker reconstructs both integer +matrices and verifies nonzero determinants modulo 101 (14 and 28). Nonzero +integer minors modulo a prime certify characteristic-zero nonvanishing; no +finite-field equality substitutes for the rational identity. + +Restrict each added outer product to this rectangle. A nonzero restriction +has rank at most one and touches a nonorthogonal port pair, so its COPY rank +is at least one. A zero-charge term vanishes on the rectangle. Consequently + +``` +12 = rank(A) <= number of nonzero restricted terms <= sum of COPY ranks. +``` + +This excludes a complete +8 additive scalar correction for the named pair, +including a re-choice of the common correction basis. It does not claim that +12 is attainable. The rank argument is general under its stated hypotheses; +the finite source-bound application here is only this named pair. + +## Correctly bound favorable screen + +Retain PR #2308's local profile, width 73, 896 families, nine stages and center +charge 64. The unchanged authenticated `ceiling.relax` grants extra correction +rank the favorable idle rank 51. Access, restoration, hosting, precision and +even the natural base decoder's four extra COPY units are omitted. This is the +predecessor's fixed-profile model, not every possible plane-port redesign. + +At target `35491136290869/20000000000000000`, 1.05 times the incumbent +packing-ceiling endpoint, the correct unpaid amount is `1+12/112 = 31/28`. +Exact outward intervals establish: + +| Assumption | Upgraded ports | Added charge | Moment at target | +| --- | ---: | ---: | ---: | +| Predecessor's hypothetical screen | 16 | 8 | 0.999388703606489 < 1 | +| Correct port count alone | 12 | 8 | 0.999878251854348 < 1 | +| First rejected integer charge | 12 | 9 | 1.000015937299059 > 1 | +| Proved additive floor | 12 | 12 | **1.000428993633190 > 1** | +| Displayed cross-block factors | 12 | 40 | 1.004284186085082 > 1 | + +The formula increases with added charge, so at most eight integer units fit; +the unavoidable twelve fail. Port overlap alone does **not** refute the 5% +screen. Redesigned local children, physical tariffs or a whole replacement +decoder require their own complete profile and coverage calculation. + +## Reproduce and controls + +Python 3.12, standard library only, from the repository root: + +```sh +python3 -I -O -B research/p112-shared-correction-cost-audit/verify.py +python3 -I -O -B research/p112-shared-correction-cost-audit/check_certificate.py +python3 scripts/research_package.py --package research/p112-shared-correction-cost-audit --check-only +python3 scripts/research_package.py --package research/p112-shared-correction-cost-audit +``` + +Expected primary output: + +``` +PASS_P112_SHARED_CORRECTION_COST_AUDIT union=12 parity_rank=1 correction_COPY=40 forbidden_entries=32 additive_COPY_floor=12 five_percent_screen=FAIL controls=10 no_new_kappa +``` + +Both mathematical checkers are read-only, need no network or Git, and accept +optimized Python. `verify.py --out NEW.json` writes only to an unoccupied path. +The package runner separately checks Git provenance. The primary replay took +about one second in the preparation environment; no speed claim is made. + +Ten control groups cover coefficient gauge, omitted factor, changed coefficient, +line-only mask, double-counted ports, a valid repaired scalar matrix, the dirty +counterexample, all formal input columns, a dependent minor and a wrong label +map. Source pins and the entire deterministic receipt are checked. The second +implementation reconstructs the rectangle, uses modular minors and enumerated +binary spans, and checks wrong-mask/dependent-minor boundaries independently +of the primary executable. This is not independent human review. + +Not checked: the predecessor's full 20,160-block census, another pair, optimal +additive COPY cost, a different full decoder or operator interface, native phases, +chronology, dirty helper restoration, global owners/idle profiles, precision, +all-size admission, hosted CI or the selected supplier's cold replay. The finite +dirty-target check is not the missing native/helper-boundary verification. + +## Open next questions + +1. Can a redesigned whole scalar decoder satisfy this mixed plane mask with an + affordable bill? Start with the forced rectangle and solve the full fitting + equations before pricing actual supports. The lower bound fixes the original + map and counts additive corrections; a nonadditive decoder remains open. + Stop if its complete favorable profile fails the desired moment. +2. Can an explicit block/operator interface realize physical sharing of the + rational basis? Supply its arbitrary-dirty endpoint and complete tariff, + then test the `(16,20)` counterexample. The missing interface theorem is + the blocker; coefficient parity alone cannot supply the price. + +Structured questions and task provenance are in [TASK.json](TASK.json). + +## Credit and provenance + +Cinna Davis (`1337isnot1337`) / PR #2308 owns the rational sharing identity, +frame census, label map and hypothetical screen. Philippe Van Velzen +(`philippeVV`) / [Discussion #2278](https://github.com/CrocSwap/integer-mult-bounds/discussions/2278) +supplied the plane-upgrade question and additive-class screens. This is a new +explicit check of the named pair's pending scalar/cost interface, without a +priority claim over those screens. Adam Gall's retained paired-plane audit +supplies the endpoint distinction. `themilkman216` / PR #968, DreamingOfClouds +and the retained E8 lineage supply the root/decoder model; Douglas Colkitt +supplies the interval engine. Rohan Arun, Jeremy Kothe and Hao Yan retain +selected-source credit. The foreign certificate is unchanged; see [NOTICE.md](NOTICE.md). + +Base `0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2`, priority revision 4; +coordination in Discussion #2278. [SOURCES.json](SOURCES.json) pins the input +bytes, Git blobs, predecessor head and certificate origin. Only this new +package changes; all predecessor inputs and the selected record are preserved. + +Prepared for commdata2338 (@commdata2338), with substantial OpenAI Codex assistance. +Apache-2.0. Derivation, implementation, checking and writing were AI-assisted; +no independent human review is claimed. diff --git a/research/p112-shared-correction-cost-audit/RESULT.json b/research/p112-shared-correction-cost-audit/RESULT.json new file mode 100644 index 0000000000..aff38407a3 --- /dev/null +++ b/research/p112-shared-correction-cost-audit/RESULT.json @@ -0,0 +1,1591 @@ +{ + "schema_version": 1, + "kind": "scoped scalar-factor pricing audit and proof", + "source_pr": 2308, + "source_head": "7653e0cc72527c1e7fc02499122d383713ee9d54", + "physical_shared_direction": 234, + "frames": [ + [ + 2, + 3, + 16, + 17, + 46, + 47, + 52, + 53 + ], + [ + 2, + 3, + 20, + 21, + 42, + 43, + 46, + 47 + ] + ], + "union": [ + 2, + 3, + 16, + 17, + 20, + 21, + 42, + 43, + 46, + 47, + 52, + 53 + ], + "intersection": [ + 2, + 3, + 46, + 47 + ], + "complement_ports": [ + 6, + 7, + 12, + 13, + 18, + 19, + 24, + 25, + 30, + 31, + 32, + 33, + 38, + 39, + 40, + 41, + 48, + 49, + 50, + 51, + 57, + 58, + 61, + 62, + 64, + 67, + 68, + 71, + 72, + 75, + 76, + 79, + 81, + 82, + 85, + 86, + 89, + 90, + 93, + 94, + 96, + 99, + 100, + 103, + 104, + 107, + 108, + 111, + 113, + 114, + 117, + 118 + ], + "complement_rank_witness": { + "line_ids": [ + 6, + 7, + 12, + 18, + 30, + 31, + 32, + 38 + ], + "doubled_root_determinant": 1024 + }, + "coefficient_parity_rank": 1, + "rescaled_coefficient_parity_rank": 0, + "correction_terms": [ + { + "column": 0, + "row_support": [ + 2 + ], + "column_support": [ + 6, + 7, + 12, + 13, + 30, + 31, + 32, + 33, + 57, + 58, + 61, + 62, + 64, + 67, + 68, + 71, + 89, + 90, + 93, + 94, + 96, + 99, + 100, + 103 + ], + "pairing_rank_per_direction": 1 + }, + { + "column": 1, + "row_support": [ + 3 + ], + "column_support": [ + 6, + 7, + 12, + 13, + 30, + 31, + 32, + 33, + 72, + 75, + 76, + 79, + 81, + 82, + 85, + 86, + 104, + 107, + 108, + 111, + 113, + 114, + 117, + 118 + ], + "pairing_rank_per_direction": 1 + }, + { + "column": 2, + "row_support": [ + 16, + 20, + 21, + 42, + 43 + ], + "column_support": [ + 18, + 19, + 24, + 25, + 38, + 39, + 40, + 41, + 57, + 58, + 61, + 62, + 72, + 75, + 76, + 79, + 96, + 99, + 100, + 103, + 113, + 114, + 117, + 118 + ], + "pairing_rank_per_direction": 4 + }, + { + "column": 3, + "row_support": [ + 17, + 20, + 21, + 42, + 43 + ], + "column_support": [ + 18, + 19, + 24, + 25, + 38, + 39, + 40, + 41, + 64, + 67, + 68, + 71, + 81, + 82, + 85, + 86, + 89, + 90, + 93, + 94, + 104, + 107, + 108, + 111 + ], + "pairing_rank_per_direction": 4 + }, + { + "column": 4, + "row_support": [ + 46 + ], + "column_support": [ + 6, + 7, + 18, + 19, + 32, + 33, + 40, + 41, + 48, + 49, + 50, + 51, + 58, + 61, + 64, + 71, + 72, + 79, + 82, + 85, + 90, + 93, + 96, + 103, + 104, + 111, + 114, + 117 + ], + "pairing_rank_per_direction": 1 + }, + { + "column": 5, + "row_support": [ + 47 + ], + "column_support": [ + 6, + 7, + 18, + 19, + 32, + 33, + 40, + 41, + 48, + 49, + 50, + 51, + 57, + 62, + 67, + 68, + 75, + 76, + 81, + 86, + 89, + 94, + 99, + 100, + 107, + 108, + 113, + 118 + ], + "pairing_rank_per_direction": 1 + }, + { + "column": 6, + "row_support": [ + 20, + 21, + 42, + 43, + 52 + ], + "column_support": [ + 12, + 13, + 24, + 25, + 30, + 31, + 38, + 39, + 48, + 49, + 50, + 51, + 58, + 61, + 67, + 68, + 75, + 76, + 82, + 85, + 89, + 94, + 96, + 103, + 104, + 111, + 113, + 118 + ], + "pairing_rank_per_direction": 4 + }, + { + "column": 7, + "row_support": [ + 20, + 21, + 42, + 43, + 53 + ], + "column_support": [ + 12, + 13, + 24, + 25, + 30, + 31, + 38, + 39, + 48, + 49, + 50, + 51, + 57, + 62, + 64, + 71, + 72, + 79, + 81, + 86, + 90, + 93, + 99, + 100, + 107, + 108, + 114, + 117 + ], + "pairing_rank_per_direction": 4 + } + ], + "correction_COPY_cost": 40, + "deleted_frame_decoder_basis": [ + 0, + 1, + 26, + 27, + 44, + 45, + 54, + 55 + ], + "original_deleted_frame_COPY_ranks": [ + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8 + ], + "plane_deleted_frame_COPY_ranks": [ + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 8 + ], + "literal_total_COPY_cost_before_missing_repair": 108, + "forbidden_nonzero_entries": [ + [ + 16, + 20, + "1/2" + ], + [ + 16, + 21, + "1/2" + ], + [ + 16, + 42, + "1/2" + ], + [ + 16, + 43, + "1/2" + ], + [ + 17, + 20, + "1/2" + ], + [ + 17, + 21, + "1/2" + ], + [ + 17, + 42, + "-1/2" + ], + [ + 17, + 43, + "-1/2" + ], + [ + 20, + 16, + "1/2" + ], + [ + 20, + 17, + "1/2" + ], + [ + 20, + 52, + "1/2" + ], + [ + 20, + 53, + "1/2" + ], + [ + 21, + 16, + "1/2" + ], + [ + 21, + 17, + "1/2" + ], + [ + 21, + 52, + "-1/2" + ], + [ + 21, + 53, + "-1/2" + ], + [ + 42, + 16, + "1/2" + ], + [ + 42, + 17, + "-1/2" + ], + [ + 42, + 52, + "1/2" + ], + [ + 42, + 53, + "-1/2" + ], + [ + 43, + 16, + "1/2" + ], + [ + 43, + 17, + "-1/2" + ], + [ + 43, + 52, + "-1/2" + ], + [ + 43, + 53, + "1/2" + ], + [ + 52, + 20, + "1/2" + ], + [ + 52, + 21, + "-1/2" + ], + [ + 52, + 42, + "1/2" + ], + [ + 52, + 43, + "-1/2" + ], + [ + 53, + 20, + "1/2" + ], + [ + 53, + 21, + "-1/2" + ], + [ + 53, + 42, + "-1/2" + ], + [ + 53, + 43, + "1/2" + ] + ], + "missing_union_block_rank": 8, + "forced_rectangle": { + "rows": [ + 2, + 3, + 16, + 17, + 20, + 21, + 42, + 43, + 46, + 47, + 52, + 53 + ], + "columns": [ + 2, + 3, + 16, + 17, + 20, + 21, + 42, + 43, + 46, + 47, + 52, + 53, + 6, + 7, + 12, + 13, + 18, + 19, + 24, + 25, + 30, + 31, + 32, + 33, + 38, + 39, + 40, + 41, + 48, + 49, + 50, + 51, + 57, + 58, + 61, + 62, + 64, + 67, + 68, + 71, + 72, + 75, + 76, + 79, + 81, + 82, + 85, + 86, + 89, + 90, + 93, + 94, + 96, + 99, + 100, + 103, + 104, + 107, + 108, + 111, + 113, + 114, + 117, + 118 + ], + "twice_entries": [ + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -1, + -1, + -1, + -1, + 0, + 0, + 0, + 0, + -1, + -1, + -1, + -1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -1, + -1, + -1, + -1, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1 + ], + [ + 0, + 0, + 0, + 0, + -1, + -1, + -1, + -1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -1, + -1, + -1, + -1, + 0, + 0, + 0, + 0, + -1, + -1, + -1, + -1, + 0, + 0, + 0, + 0, + -1, + -1, + -1, + -1, + 0, + 0, + 0, + 0, + -1, + -1, + -1, + -1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ], + [ + 0, + 0, + 0, + 0, + -1, + -1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -1, + -1, + -1, + -1, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -1, + -1, + -1, + -1, + 0, + 0, + 0, + 0, + -1, + -1, + -1, + -1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + -1, + -1, + 0, + 0, + 0, + 0, + 0, + 0, + -1, + -1, + 0, + 0, + 0, + 0, + -1, + -1, + -1, + -1, + -1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 0, + 0, + -1, + -1, + -1, + 0, + -1, + 0, + -1, + 0, + -1, + 0, + -1, + 0, + -1, + 0, + -1, + 0, + -1, + 0, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1 + ], + [ + 0, + 0, + -1, + -1, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 0, + 0, + 0, + 0, + -1, + -1, + -1, + -1, + 1, + -1, + 0, + 0, + 1, + -1, + 0, + 0, + 0, + 0, + 1, + 1, + 0, + -1, + 0, + -1, + 0, + -1, + 0, + -1, + 0, + -1, + 0, + -1, + 0, + -1, + 0, + -1, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0 + ], + [ + 0, + 0, + -1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + -1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 0, + 0, + -1, + -1, + -1, + -1, + -1, + 1, + 0, + 0, + 0, + 0, + -1, + -1, + 1, + 1, + 0, + 0, + 0, + 0, + -1, + -1, + 1, + 1, + 0, + 0, + -1, + -1, + 0, + 0, + 0, + 0, + 1, + 1, + -1, + -1, + 0, + 0, + 0, + 0, + 1, + 1 + ], + [ + 0, + 0, + -1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + -1, + 0, + 0, + 1, + -1, + 0, + 0, + 1, + -1, + 0, + 0, + 0, + 0, + -1, + -1, + -1, + -1, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + 0, + 0, + 1, + 1, + -1, + -1, + 0, + 0, + 0, + 0, + 1, + 1, + 0, + 0, + -1, + -1, + 1, + 1, + 0, + 0, + 0, + 0, + -1, + -1, + 1, + 1, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 0, + 0, + -1, + 1, + 0, + 0, + -1, + 1, + -1, + -1, + -1, + 1, + 0, + -1, + 1, + 0, + -1, + 0, + 0, + 1, + -1, + 0, + 0, + 1, + 0, + -1, + 1, + 0, + 0, + -1, + 1, + 0, + -1, + 0, + 0, + 1, + -1, + 0, + 0, + 1, + 0, + -1, + 1, + 0 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 0, + 0, + 1, + -1, + 0, + 0, + 1, + -1, + -1, + -1, + 1, + -1, + -1, + 0, + 0, + 1, + 0, + -1, + 1, + 0, + 0, + -1, + 1, + 0, + -1, + 0, + 0, + 1, + -1, + 0, + 0, + 1, + 0, + -1, + 1, + 0, + 0, + -1, + 1, + 0, + -1, + 0, + 0, + 1 + ], + [ + 0, + 0, + 0, + 0, + -1, + 1, + -1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + -1, + 1, + 0, + 0, + -1, + 1, + -1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + -1, + 1, + -1, + -1, + 0, + 1, + -1, + 0, + 0, + 1, + -1, + 0, + 0, + 1, + -1, + 0, + 0, + 1, + -1, + 0, + -1, + 0, + 0, + 1, + -1, + 0, + 0, + 1, + -1, + 0, + 0, + 1, + -1, + 0, + 0, + 1 + ], + [ + 0, + 0, + 0, + 0, + -1, + 1, + 1, + -1, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + -1, + 0, + 0, + 1, + -1, + -1, + 1, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + -1, + -1, + -1, + -1, + 0, + 0, + 1, + -1, + 0, + 0, + 1, + -1, + 0, + 0, + 1, + -1, + 0, + 0, + 1, + 0, + 1, + -1, + 0, + 0, + 1, + -1, + 0, + 0, + 1, + -1, + 0, + 0, + 1, + -1, + 0 + ] + ], + "rank": 12, + "minor_column_positions": [ + 2, + 3, + 4, + 5, + 6, + 7, + 10, + 11, + 12, + 13, + 20, + 22 + ], + "minor_determinant": 2048, + "any_additive_scalar_correction_COPY_floor": 12 + }, + "dirty_counterexample": { + "target_line": 16, + "source_line": 20, + "target_q": 38, + "source_q": 70, + "initial_target": "11", + "output_target": "23/2", + "required_target": "11" + }, + "scalar_columns_checked": 224, + "controls": [ + "coefficient_gauge_changes_parity_not_map_or_support", + "omitted_scalar_factor", + "wrong_coefficient", + "line_mask_misses_plane_faults", + "duplicate_port_count", + "repaired_scalar_fitting_positive", + "dirty_wrong_source_counterexample", + "all_224_formal_input_columns", + "dependent_rank_certificate", + "wrong_label_map" + ], + "screens": { + "predecessor_hypothesis": { + "upgraded_ports": 16, + "extra_centre_charge": 8, + "unpaid": "8/7", + "saving": "35491136290869/20000000000000000", + "moment_interval": [ + "57860652975384160456394321003827593613130850325220449487422954276318920692921/57896044618658097711785492504343953926634992332820282019728792003956564819968", + "115721305950768320912788642007655187226261700650440898974845908552637841385879/115792089237316195423570985008687907853269984665640564039457584007913129639936" + ], + "decision": "passes" + }, + "actual_union_only": { + "upgraded_ports": 12, + "extra_centre_charge": 8, + "unpaid": "31/28", + "saving": "35491136290869/20000000000000000", + "moment_interval": [ + "3618062242661575398653748997750446258919095872543004620474680006814606555949/3618502788666131106986593281521497120414687020801267626233049500247285301248", + "115777991765170412756919967928014280285411067921376147855189760218067409790405/115792089237316195423570985008687907853269984665640564039457584007913129639936" + ], + "decision": "passes" + }, + "actual_union_first_rejected_integer_charge": { + "upgraded_ports": 12, + "extra_centre_charge": 9, + "unpaid": "31/28", + "saving": "35491136290869/20000000000000000", + "moment_interval": [ + "115793934650471001088081903343115275208296827466326686602786468498969475904141/115792089237316195423570985008687907853269984665640564039457584007913129639936", + "57896967325235500544040951671557637604148413733163343301393234249484737952089/57896044618658097711785492504343953926634992332820282019728792003956564819968" + ], + "decision": "fails" + }, + "forced_rectangle_floor": { + "upgraded_ports": 12, + "extra_centre_charge": 12, + "unpaid": "31/28", + "saving": "35491136290869/20000000000000000", + "moment_interval": [ + "28960440826593191520391927397104564994238526525294575711394148335418918561365/28948022309329048855892746252171976963317496166410141009864396001978282409984", + "115841763306372766081567709588418259976954106101178302845576593341675674245497/115792089237316195423570985008687907853269984665640564039457584007913129639936" + ], + "decision": "fails" + }, + "literal_correction": { + "upgraded_ports": 12, + "extra_centre_charge": 40, + "unpaid": "31/28", + "saving": "35491136290869/20000000000000000", + "moment_interval": [ + "116288164094789239354101901211246117817755373359793387778284425206933525431103/115792089237316195423570985008687907853269984665640564039457584007913129639936", + "29072041023697309838525475302811529454438843339948346944571106301733381357785/28948022309329048855892746252171976963317496166410141009864396001978282409984" + ], + "decision": "fails" + } + }, + "limits": [ + "one named pair; no all-pair census", + "additive scalar factors retain G/2", + "no global COPY optimum or operator-valued lower bound", + "no native or chronological realization", + "screen keeps predecessor local profile; changed profiles require repricing", + "no supplier admission, selected cold replay, or new kappa" + ] +} diff --git a/research/p112-shared-correction-cost-audit/SOURCES.json b/research/p112-shared-correction-cost-audit/SOURCES.json new file mode 100644 index 0000000000..db130a6dab --- /dev/null +++ b/research/p112-shared-correction-cost-audit/SOURCES.json @@ -0,0 +1,53 @@ +{ + "schema_version": 1, + "base_commit": "0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "ae6a99f28aa468649eb66a361e764d769363bf11", + "sha256": "10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "e8870e5917057d59b730eb14721a778639eca050", + "sha256": "d46eb6d5b3e279428753d770653663fbdf1063e55c255ea073d768f344927ef7" + }, + { + "path": "research/community-frontier1094-audit/selected-replay.tar.gz", + "usage": "input", + "git_blob": "c24daf067f9c543421d89ca2eeaa4eb78a57fb6f", + "sha256": "f1da80610bf33c58527f18ad63b4350d0b864e1d4486141ee17ac9bed4d529d6" + }, + { + "path": "research/complex-frame-pair-decoders/verify.py", + "usage": "input", + "git_blob": "57dd8993e8ac016e8a92a9a885392b58014137bb", + "sha256": "bdf7ee497dc04dfc634ee5b7848f6a2b39b0169668fb1a60a9715111dbd15395" + }, + { + "path": "research/complex-local-word-ceiling/ceiling.py", + "usage": "input", + "git_blob": "6c0f54527d879396f689523bfde19928a9b6157c", + "sha256": "86a1432870b3b21d8454106ec9162fddc0471472d9214c590a1420f2426cedfc" + }, + { + "path": "research/paired-plane-scalar-mask-obstruction/README.md", + "usage": "input", + "git_blob": "51f197c73d9c8110341e1928aabb1965f63a2bf9", + "sha256": "355f6e6b61a858c75143f0ac2c2338af089e2e9390c8caa7ecd4ebc71dd4019c" + } + ], + "external_files": [ + { + "path": "research/p112-shared-correction-cost-audit/PR2308-CERTIFICATE.json", + "source_repository": "https://github.com/CrocSwap/integer-mult-bounds", + "source_pr": 2308, + "source_commit": "7653e0cc72527c1e7fc02499122d383713ee9d54", + "source_path": "research/cycle47-shared-frame-correction/CERTIFICATE.json", + "git_blob": "1aa8ddab0e0cd9e4e91da414a107ade54c2cba28", + "sha256": "696669c7fc9f369220ac951217429ad245ce40f5e2adf9b5bcea124d9eaaba78" + } + ] +} diff --git a/research/p112-shared-correction-cost-audit/TASK.json b/research/p112-shared-correction-cost-audit/TASK.json new file mode 100644 index 0000000000..a0f4369cec --- /dev/null +++ b/research/p112-shared-correction-cost-audit/TASK.json @@ -0,0 +1,139 @@ +{ + "schema_version": 1, + "task_id": "complex-rank-shape-decoder", + "priority_revision": 4, + "base_commit": "0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2", + "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": [ + "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.", + "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." + ], + "overlap_terms": [ + "rank shape", + "block climb", + "masked decoder", + "overcomplete", + "effective rank" + ] + }, + "scope_status": "changed", + "actual_scope": "Source-bound audit of PR2308 named P112 frame pair: scalar endpoint mask, separate COPY support tariff, and additive correction lower bound.", + "scope_change_reason": "Take the original rank-shape suggestion as an independent audit of PR2308 Open next question 2 before implementing its favorable hypothetical screen; no new full local profile is synthesized. The forced rectangle also supplies a basis-independent lower bound for additive corrections to this same named pair with G/2 fixed; it is not a lower bound for whole-decoder redesigns.", + "bottleneck_link": "A rational common basis needs a physical COPY tariff before a plane-port supplier can be implemented.", + "budget_minutes": 60, + "stop_rule": "Stop after the named-pair scalar interface and declared five-percent fixed-profile screen are decided; no all-pair or replacement-decoder search.", + "outcome": "negative-result", + "evidence": "RESULT.json: union12, rational rank8 basis, correction COPY40,32 forbidden entries, rank12 forced rectangle with determinant2048; additive COPY floor12 exceeds fixed-profile budget8;10 controls and second certificate checker.", + "author": "commdata2338", + "ai_assistance": "Prepared for commdata2338 (@commdata2338), with substantial OpenAI Codex assistance. Derivation, implementation, checking and writing were AI-assisted. No independent human review claimed.", + "open_questions": [ + { + "question": "Can a redesigned whole scalar decoder realize this mixed plane mask affordably?", + "why_it_matters": "The additive lower bound fixes the original scalar map.", + "first_step": "Solve full fitting equations using the forced rectangle, price actual supports and test a complete favorable profile.", + "blocked_by": "No such full decoder or realized profile is supplied; stop if its complete budget fails." + }, + { + "question": "Can a block or operator interface implement physical sharing of the rational basis?", + "why_it_matters": "Coefficient parity alone is not a COPY tariff.", + "first_step": "Specify arbitrary-dirty endpoint and tariff; test the line16/source20 counterexample before native synthesis.", + "blocked_by": "No interface theorem or complete physical program is supplied." + } + ], + "assignment_nonce": "6ba173a193cdec68f20ebb9c9c8c8073", + "track": "complex-mechanisms", + "scope_key": "02b31ebd160542c86299/PR2308/named-pair/scalar-support-cost-interface", + "dependency_heads": { + "PR2308": "7653e0cc72527c1e7fc02499122d383713ee9d54" + }, + "canonical_discussion": "https://github.com/CrocSwap/integer-mult-bounds/discussions/2278", + "overlap": { + "checked_at": "2026-10-15T06:43:54Z", + "open_prs_fetched_at": "2026-10-15T06:43:17.659075+00:00", + "open_prs_records": 574, + "discussions_fetched_at": "2026-10-15T06:31:18.032505+00:00", + "discussions_records": 1082, + "complete_pagination": true, + "mode": "cached offline; no novelty guarantee", + "nearest": [ + "PR2308 rational sharing; complete charge left open", + "paired-plane-scalar-mask-obstruction audits PR1825 binary factors", + "PR2321 concerns a different two-column completion" + ] + }, + "local_task_card": { + "object": "PR2308 witness S1/S2 mixed-port correction and support tariff", + "changed_hypothesis": "Audit rational-factorization-to-physical-cost implication; retain original G/2 for additive lower bound", + "method_domain": "120roots,112labels,one pair,16 directional scalar factors; exact rational and binary arithmetic; arbitrary complex additive factors in written proof", + "budget": "Declared target35491136290869/20000000000000000 and unchanged local profile; unpaid31/28; extra COPY floor12", + "success_falsification": "Complete scalar and support checks, rank certificate and interval verdict", + "artifact": "research/p112-shared-correction-cost-audit/", + "reproduce": "python3 -I -O -B research/p112-shared-correction-cost-audit/verify.py" + }, + "final_upstream_checkpoint": { + "utc": "2026-10-15T07:13:27.677745+00:00", + "main_commit": "0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2", + "scientific_base": "0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2", + "priority_revision": 4, + "relevant_changed_paths": [], + "all_changed_paths": [], + "PR2308_current_head": "7653e0cc72527c1e7fc02499122d383713ee9d54", + "PR2308_scientific_head": "7653e0cc72527c1e7fc02499122d383713ee9d54", + "decision": "continue same source-bound audit; relevant guidance and scientific inputs unchanged" + }, + "canonical_claim": "https://github.com/CrocSwap/integer-mult-bounds/discussions/2278#discussioncomment-18942819", + "final_overlap": { + "checked_at": "2026-10-15T07:14:30.329512+00:00", + "coverage": { + "open_prs": { + "fetched_at": "2026-10-15T07:07:38.026722+00:00", + "complete_pagination": true, + "records": 587 + }, + "discussions": { + "fetched_at": "2026-10-15T07:09:50.407275+00:00", + "complete_pagination": true, + "records": 1116 + } + }, + "warnings": [ + "open_prs: offline; cached data may miss current changes", + "discussions: offline; cached data may miss current changes" + ], + "canonical_claim": "https://github.com/CrocSwap/integer-mult-bounds/discussions/2278#discussioncomment-18942819", + "conclusion": "Only own claim and PR2308 match this named-pair scalar-cost interface; related predecessor work is credited. Cached metadata is not a novelty guarantee." + } +} diff --git a/research/p112-shared-correction-cost-audit/VERIFY.json b/research/p112-shared-correction-cost-audit/VERIFY.json new file mode 100644 index 0000000000..b018a5458f --- /dev/null +++ b/research/p112-shared-correction-cost-audit/VERIFY.json @@ -0,0 +1,36 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/community-frontier1094-audit/selected-replay.tar.gz", + "research/complex-frame-pair-decoders/verify.py", + "research/complex-local-word-ceiling/ceiling.py", + "research/paired-plane-scalar-mask-obstruction/README.md" + ], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Authenticated exact geometry, scalar columns, support costs, forced rectangle,10 semantic controls,complete receipt" + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/check_certificate.py" + ], + "timeout_seconds": 60, + "checks": "Separate reconstruction, binary span enumeration and nonzero integer minors modulo101" + } + ] +} diff --git a/research/p112-shared-correction-cost-audit/check_certificate.py b/research/p112-shared-correction-cost-audit/check_certificate.py new file mode 100644 index 0000000000..e61364c7a0 --- /dev/null +++ b/research/p112-shared-correction-cost-audit/check_certificate.py @@ -0,0 +1,114 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Second check: source reconstruction, explicit binary spans, modular minors. + +Does not import verify.py, PR2308 code, or any numerical package. A nonzero +integer minor modulo 101 certifies its nonvanishing in characteristic zero; +no finite-field equality is substituted for a rational identity. +""" +from hashlib import sha256 +from itertools import combinations, product +import json +from pathlib import Path + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parent.parent + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +def moddet(matrix, p=101): + a = [[x % p for x in row] for row in matrix] + answer = 1 + for c in range(len(a)): + row = next((i for i in range(c, len(a)) if a[i][c]), None) + if row is None: + return 0 + if row != c: + a[c], a[row] = a[row], a[c] + answer = -answer + answer = answer * a[c][c] % p + inverse = pow(a[c][c], -1, p) + for i in range(c + 1, len(a)): + factor = a[i][c] * inverse % p + a[i] = [(x - factor * y) % p for x, y in zip(a[i], a[c])] + return answer % p + + +def span_rank(rows): + space = {0} + for v in rows: + space |= {x ^ v for x in tuple(space)} + need(len(space) & (len(space) - 1) == 0, "binary span size") + return len(space).bit_length() - 1 + + +def main(): + pins = json.loads((HERE / "SOURCES.json").read_text()) + for pin in pins["files"] + pins["external_files"]: + if pin.get("usage") == "provenance": + continue + need(sha256((ROOT / pin["path"]).read_bytes()).hexdigest() == pin["sha256"], "source drift") + cert = json.loads((HERE / "PR2308-CERTIFICATE.json").read_text()) + result = json.loads((HERE / "RESULT.json").read_text()) + roots = [] + for a, b in combinations(range(8), 2): + for sign in (1, -1): + v = [0] * 8 + v[a], v[b] = 2, 2 * sign + roots.append(v) + roots += [[1, *v] for v in product((1, -1), repeat=7) if sum(x < 0 for x in v) % 2 == 0] + gram = [[sum(x*y for x,y in zip(a,b)) // 4 for b in roots] for a in roots] + labels = {x["line"]: x["q"] for x in cert["q_to_line"]} + frames = cert["witness"]["frames"] + union = sorted(set(frames[0]) | set(frames[1])) + r = 234 + need(result["physical_shared_direction"] == r and r.bit_count() % 2 == 1, "shared r") + need(all((labels[a] & r).bit_count() % 2 == 0 for a in union), "upgrade orthogonality") + complement = [a for a in sorted(labels) if (labels[a] & r).bit_count() % 2] + need(union == result["union"] and len(union) == 12 and complement == result["complement_ports"], "port sets") + cols = union + complement + twice_rectangle = [[2 * int(a == b) - gram[a][b] for b in cols] for a in union] + receipt = result["forced_rectangle"] + need(receipt["rank"] == receipt["any_additive_scalar_correction_COPY_floor"] == 12, + "rank-to-cost claim") + need(twice_rectangle == receipt["twice_entries"], "forced rectangle source binding") + positions = receipt["minor_column_positions"] + need(len(set(positions)) == 12 and all(0 <= p < len(cols) for p in positions), "minor columns") + minor = [[row[p] for p in positions] for row in twice_rectangle] + residue = moddet(minor) + need(residue != 0 and residue == receipt["minor_determinant"] % 101 == 2048 % 101, "rank12 minor") + rt = result["complement_rank_witness"] + need(len(rt["line_ids"]) == 8 and set(rt["line_ids"]) <= set(complement), "rank8 domain") + need(moddet([roots[a] for a in rt["line_ids"]]) == 1024 % 101 != 0, "rank8 root minor") + + charges = [] + for k, s in enumerate(frames[0]): + rows = [a for a in union if gram[a][s]] + columns = [b for b in complement if gram[s][b]] + left = [v for a in rows for v in [labels[a], r]] + right = [labels[b] for b in columns] + masks = [sum(((a & b).bit_count() & 1) << j for j, b in enumerate(right)) for a in left] + charge = span_rank(masks) + recorded = result["correction_terms"][k] + need(recorded == {"column": k, "row_support": rows, "column_support": columns, + "pairing_rank_per_direction": charge}, "literal support charge") + charges.append(charge) + need(charges == [1,1,4,4,1,1,4,4] and 2 * sum(charges) == 40, "rank invoice") + missing = [[a, b, str(gram[a][b]) + "/2"] for a in union for b in union if a != b and gram[a][b]] + need(missing == result["forbidden_nonzero_entries"] and len(missing) == 32, "missing plane coefficients") + need(gram[16][20] == 1 and labels[16] == 38 and labels[20] == 70, "counterexample binding") + # Changed hypotheses are real: omitting the shared r removes this constraint. + need((38 & 70).bit_count() % 2 == 0 and r.bit_count() % 2 == 1, "line/plane boundary control") + bad_minor = [row[:] for row in minor] + bad_minor[-1] = bad_minor[0][:] + need(moddet(bad_minor) == 0, "dependent-minor control") + print("PASS_P112_SHARED_CORRECTION_SECOND_CHECK rank12_minor_mod101=" + str(residue) + + " support_COPY=40 forbidden_entries=32 no_new_kappa") + + +if __name__ == "__main__": + main() diff --git a/research/p112-shared-correction-cost-audit/verify.py b/research/p112-shared-correction-cost-audit/verify.py new file mode 100644 index 0000000000..7414901156 --- /dev/null +++ b/research/p112-shared-correction-cost-audit/verify.py @@ -0,0 +1,436 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Exact scalar/support audit of PR2308's named P112 frame pair. + +Prepared for commdata2338 with substantial OpenAI Codex assistance. +No predecessor executable is imported except the authenticated interval engine. +""" +import argparse +from fractions import Fraction as Q +from hashlib import sha1, sha256 +import importlib.util +from itertools import combinations, product +import json +from pathlib import Path +import tarfile + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parent.parent +ARCHIVE = "research/community-frontier1094-audit/selected-replay.tar.gz" +MEMBER = "candidate/strict/global/base/work/complex-nine-native/DATA-PHASES.json" +CEILING = "research/complex-local-word-ceiling/ceiling.py" + + +class Invalid(ValueError): + pass + + +def require(ok, message): + if not ok: + raise Invalid(message) + + +def canonical(value): + return json.dumps(value, sort_keys=True, separators=(",", ":")) + + +def authenticate(raw, pin): + require(sha256(raw).hexdigest() == pin["sha256"], "source SHA256 mismatch") + blob = sha1(b"blob " + str(len(raw)).encode() + b"\0" + raw).hexdigest() + require(blob == pin["git_blob"], "source Git blob mismatch") + + +def load_sources(): + pins = json.loads((HERE / "SOURCES.json").read_text()) + for pin in pins["files"]: + if pin["usage"] == "input": + authenticate((ROOT / pin["path"]).read_bytes(), pin) + require(len(pins["external_files"]) == 1, "external input inventory") + pin = pins["external_files"][0] + raw = (ROOT / pin["path"]).read_bytes() + authenticate(raw, pin) + return json.loads(raw), pin + + +def dot(a, b): + return sum(x * y for x, y in zip(a, b)) + + +def inner(a, b): + z = dot(a, b) + require(z % 4 == 0, "nonintegral E8 inner product") + return z // 4 + + +def roots(): + # PR968's root-line order, reconstructed without importing its executable. + out = [] + for i, j in combinations(range(8), 2): + for sign in (1, -1): + v = [0] * 8 + v[i], v[j] = 2, 2 * sign + out.append(tuple(v)) + out += [(1, *s) for s in product((1, -1), repeat=7) if s.count(-1) % 2 == 0] + require(len(out) == 120 and len(set(out)) == 120, "root-line enumeration") + require(all(dot(v, v) == 8 for v in out), "root normalization") + return out + + +def f2_rank(masks): + pivots = {} + for v in masks: + while v: + p = v.bit_length() - 1 + if p in pivots: + v ^= pivots[p] + else: + pivots[p] = v + break + return len(pivots) + + +def dense_binary_rank(matrix): + """Second arithmetic route: explicit Boolean row elimination.""" + a = [row[:] for row in matrix] + if not a: + return 0 + rank = 0 + for col in range(len(a[0])): + p = next((i for i in range(rank, len(a)) if a[i][col]), None) + if p is None: + continue + a[rank], a[p] = a[p], a[rank] + for i in range(rank + 1, len(a)): + if a[i][col]: + a[i] = [x ^ y for x, y in zip(a[i], a[rank])] + rank += 1 + if rank == len(a): + break + return rank + + +def pivot_columns(matrix): + a = [[Q(x) for x in row] for row in matrix] + pivots = [] + for col in range(len(a[0])): + rank = len(pivots) + p = next((i for i in range(rank, len(a)) if a[i][col]), None) + if p is None: + continue + a[rank], a[p] = a[p], a[rank] + v = a[rank][col] + a[rank] = [x / v for x in a[rank]] + for i in range(rank + 1, len(a)): + v = a[i][col] + a[i] = [x - v * y for x, y in zip(a[i], a[rank])] + pivots.append(col) + if len(pivots) == len(a): + break + return pivots + + +def determinant(matrix): + """Independent fraction-free determinant for an integer square minor.""" + a = [row[:] for row in matrix] + n, previous, sign = len(a), 1, 1 + require(n and all(len(row) == n for row in a), "square determinant input") + for k in range(n - 1): + p = next((i for i in range(k, n) if a[i][k]), None) + if p is None: + return 0 + if p != k: + a[k], a[p], sign = a[p], a[k], -sign + pivot = a[k][k] + for i in range(k + 1, n): + for j in range(k + 1, n): + numerator = pivot * a[i][j] - a[i][k] * a[k][j] + require(numerator % previous == 0, "Bareiss divisibility") + a[i][j] = numerator // previous + a[i][k] = 0 + previous = pivot + return sign * a[-1][-1] + + +def geometry(cert): + lines = roots() + gram = [[inner(a, b) for b in lines] for a in lines] + rows = cert["q_to_line"] + mapping = {row["line"]: row["q"] for row in rows} + live = sorted(mapping) + require(len(rows) == len(mapping) == len(set(mapping.values())) == 112, "map is not a bijection") + frame0 = [] + for i in range(4): + for sign in (1, -1): + v = [0] * 8 + v[2 * i], v[2 * i + 1] = 2, 2 * sign + frame0.append(lines.index(tuple(v))) + require(set(live) == set(range(120)) - set(frame0), "wrong P112 puncture") + with tarfile.open(ROOT / ARCHIVE, "r:gz") as tf: + data = json.load(tf.extractfile(MEMBER)) + qlabels = sorted(int(row["q"]) for row in data["recipes"]) + require(sorted(mapping.values()) == qlabels, "selected port binding") + require(all(((mapping[a] & mapping[b]).bit_count() & 1) == ((gram[a][b] + 1) & 1) + for a in live for b in live), "selected label pairing mismatch") + deleted = sorted({q for q in range(512) if q.bit_count() in (3, 7)} - set(qlabels)) + require(len(deleted) == 8, "deleted labels") + require(all(((mapping[a] & q).bit_count() & 1) == ((gram[a][b] + 1) & 1) + for a in live for q, b in zip(deleted, frame0)), "deleted-frame signatures") + require(f2_rank(qlabels) == 9, "selected labels do not span ambient space") + lattice_basis = [(2,-2,0,0,0,0,0,0), (0,2,-2,0,0,0,0,0), + (0,0,2,-2,0,0,0,0), (0,0,0,2,-2,0,0,0), + (0,0,0,0,2,-2,0,0), (0,0,0,0,0,2,-2,0), + (0,0,0,0,0,2,2,0), (-1,)*8] + rbits = cert["witness"]["r_bits"] + require(len(rbits) == 8 and all(type(v) is int and v in (0, 1) for v in rbits), "r bits") + rroot = [sum(rbits[k] * lattice_basis[k][j] for k in range(8)) for j in range(8)] + beta = {a: inner(rroot, lines[a]) & 1 for a in live} + choices = [r for r in range(512) if all(((r & mapping[a]).bit_count() & 1) + == 1 - beta[a] for a in live)] + require(len(choices) == 1, "physical shared direction not uniquely bound") + r = choices[0] + require(r.bit_count() & 1, "shared direction is not anisotropic") + frames = cert["witness"]["frames"] + require(len(frames) == 2 and frames[0] != frames[1], "two distinct frames required") + for frame in frames: + require(len(frame) == len(set(frame)) == 8 and set(frame) <= set(live), "frame inventory") + require(all(gram[a][b] == 0 for a, b in combinations(frame, 2)), "nonorthogonal frame") + require(all(beta[a] == 1 for a in frame), "frame incompatible with direction") + union = sorted(set(frames[0]) | set(frames[1])) + targets = [a for a in live if beta[a] == 0] + planes = {a: [mapping[a], r] if a in union else [mapping[a]] for a in live} + require(all(f2_rank(planes[a]) == 2 and (mapping[a] & r).bit_count() % 2 == 0 + for a in union), "invalid plane port") + return lines, gram, mapping, live, frames, union, targets, r, planes + + +def pairing_rank(rows, cols, planes): + left = [q for a in rows for q in planes[a]] + right = [q for b in cols for q in planes[b]] + matrix = [[(a & b).bit_count() & 1 for b in right] for a in left] + rank = f2_rank([sum(v << j for j, v in enumerate(row)) for row in matrix]) + require(rank == dense_binary_rank(matrix), "binary rank engines disagree") + return rank + + +def outer_sum(terms, n): + out = [[Q(0) for _ in range(n)] for _ in range(n)] + for u, v in terms: + for i, x in enumerate(u): + if x: + for j, y in enumerate(v): + if y: + out[i][j] += x * y + return out + + +def fitting_faults(matrix, live, planes): + faults = [] + for i, a in enumerate(live): + for j, b in enumerate(live): + if i == j: + if matrix[i][j] != 1: + faults.append([a, b, str(matrix[i][j])]) + elif matrix[i][j] and pairing_rank([a], [b], planes): + faults.append([a, b, str(matrix[i][j])]) + return faults + + +def cost_screen(union_size, extra): + spec = importlib.util.spec_from_file_location("p112_audit_ceiling", ROOT / CEILING) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + local = {1: 2412, 2: 418, 3: 432, 4: 142, 5: 82, 8: 8} + saving = Q(35491136290869, 20000000000000000) + interval = module.relax(local, 73, 896, 9, 64 + extra, saving, unpaid=1 + Q(union_size, 112)) + return {"upgraded_ports": union_size, "extra_centre_charge": extra, + "unpaid": str(1 + Q(union_size, 112)), "saving": str(saving), + "moment_interval": list(map(str, interval)), + "decision": "passes" if interval[1] < 1 else "fails" if interval[0] > 1 else "unresolved"} + + +def compute(cert): + lines, g, mapping, live, frames, union, targets, r, planes = geometry(cert) + n = len(live) + index = {a: i for i, a in enumerate(live)} + baseline = [[Q(g[a][b], 2) for b in live] for a in live] + reference = frames[0] + def first_frame(prefix, candidates): + if len(prefix) == 8: + return prefix + for i, a in enumerate(candidates): + found = first_frame(prefix + [a], [b for b in candidates[i + 1:] if g[a][b] == 0]) + if found is not None: + return found + return None + require(first_frame([], [a for a in live if a not in targets]) == reference, + "reference is not PR2308's lexicographically first frame in this family") + # a = sum_s /2 * s in the first orthogonal root frame. + # Thus M = D B, D[a,s]=, B[s,b]=/2 on the beta-zero set. + d = [[g[a][s] for s in reference] for a in union] + bmat = [[Q(g[s][b], 2) if b in targets else Q(0) for b in live] for s in reference] + require(all(sum(d[i][k] * bmat[k][j] for k in range(8)) == + (g[a][b] if b in targets else 0) + for i, a in enumerate(union) for j, b in enumerate(live)), "shared factorization") + require(len(pivot_columns(bmat)) == 8, "reference correction basis rank") + correction_terms, term_receipts = [], [] + for k in range(8): + u = [Q(0)] * n + for i, a in enumerate(union): + u[index[a]] = -Q(d[i][k], 2) + v = bmat[k] + rows = [a for a in live if u[index[a]]] + cols = [b for b in live if v[index[b]]] + charge = pairing_rank(rows, cols, planes) + correction_terms += [(u, v), (v, u)] + term_receipts.append({"column": k, "row_support": rows, "column_support": cols, + "pairing_rank_per_direction": charge}) + # The natural eight-term P112 decoder uses the deleted orthogonal frame, + # not the ordinary coordinate axes of this doubled-root presentation. + deleted_frame = sorted(set(range(120)) - set(live)) + base_terms = [([Q(g[a][s]) for a in live], [Q(g[b][s], 4) for b in live]) + for s in deleted_frame] + require(outer_sum(base_terms, n) == baseline, "coordinate decoder identity") + correction = outer_sum(correction_terms, n) + partial = [[baseline[i][j] + correction[i][j] for j in range(n)] for i in range(n)] + expected = [[Q(0) if ((a in union and b in targets) or (b in union and a in targets)) + else baseline[i][j] for j, b in enumerate(live)] for i, a in enumerate(live)] + require(partial == expected, "literal bidirectional correction map") + faults = fitting_faults(partial, live, planes) + require(len(faults) == 32 and all(a in union and b in union for a, b, _ in faults), + "unexpected partial endpoint faults") + rectangle_columns = union + targets + rect2 = [[2 * int(a == b) - g[a][b] for b in rectangle_columns] for a in union] + require(all(pairing_rank([a], [b], planes) > 0 for a in union for b in rectangle_columns), + "rectangle is not fully constrained") + pivots = pivot_columns(rect2) + require(len(pivots) == len(union), "forced correction rectangle lacks full row rank") + minor = [[row[j] for j in pivots] for row in rect2] + det = determinant(minor) + require(det != 0, "integer rectangle minor is singular") + trows = [lines[a] for a in targets] + tpivots = pivot_columns(list(map(list, zip(*trows)))) + require(len(tpivots) == 8, "complement roots do not span rank eight") + tdet = determinant([list(trows[i]) for i in tpivots]) + require(tdet != 0, "complement root determinant") + missing = [[2 * int(a == b) - g[a][b] for b in union] for a in union] + missing_rank = len(pivot_columns(missing)) + require(missing_rank == 8, "missing within-union block rank") + base_supports = [[a for a in live if g[a][s]] for s in deleted_frame] + base_costs = [pairing_rank(support, support, planes) for support in base_supports] + old_planes = {a: [mapping[a]] for a in live} + old_costs = [pairing_rank(support, support, old_planes) for support in base_supports] + correction_cost = 2 * sum(t["pairing_rank_per_direction"] for t in term_receipts) + parity_rank = f2_rank([sum((v & 1) << j for j, v in enumerate(row)) for row in d]) + require(parity_rank == 1 and correction_cost == 40, "named witness invoices changed") + require(old_costs == [8] * 8 and base_costs == [9] * 4 + [8] * 4, "coordinate decoder cost binding") + controls = [] + def passed(name, ok): + require(ok, "control failed: " + name) + controls.append(name) + doubled = [[2 * v for v in row] for row in d] + halved = [[v / 2 for v in row] for row in bmat] + passed("coefficient_gauge_changes_parity_not_map_or_support", + f2_rank([sum((v & 1) << j for j, v in enumerate(row)) for row in doubled]) == 0 + and all((d[i][k] != 0) == (doubled[i][k] != 0) for i in range(len(union)) for k in range(8)) + and all(sum(doubled[i][k] * halved[k][j] for k in range(8)) == + sum(d[i][k] * bmat[k][j] for k in range(8)) for i in range(len(union)) for j in range(n))) + passed("omitted_scalar_factor", outer_sum(correction_terms[1:], n) != correction) + bad_d = [row[:] for row in d] + bad_d[0][0] += 1 + passed("wrong_coefficient", any(sum(bad_d[0][k] * bmat[k][j] for k in range(8)) != + sum(d[0][k] * bmat[k][j] for k in range(8)) for j in range(n))) + passed("line_mask_misses_plane_faults", not fitting_faults(partial, live, old_planes) and bool(faults)) + passed("duplicate_port_count", len(frames[0]) + len(frames[1]) == 16 and len(union) == 12) + fixed = [row[:] for row in partial] + for a in union: + for b in union: + fixed[index[a]][index[b]] = Q(a == b) + passed("repaired_scalar_fitting_positive", not fitting_faults(fixed, live, planes) + and any(fixed[i][j] != 0 for i in range(n) for j in range(n) if i != j)) + a, b, value = faults[0] + x, y = [Q(0)] * n, [Q(0)] * n + x[index[b]], y[index[a]] = Q(1), Q(11) + after = y[:] + for u, v in base_terms + correction_terms: + total = dot(v, x) + after = [z + c * total for z, c in zip(after, u)] + passed("dirty_wrong_source_counterexample", after[index[a]] == 11 + Q(value) + and after[index[a]] != 11 and x[index[b]] == 1) + for source in range(n): + for target in range(n): + require(sum(u[target] * v[source] for u, v in base_terms + correction_terms) + == partial[target][source], "formal scalar source column") + # ADDs are only Y <- Y + u*(v^T X); verify all target-dirt basis columns too. + for target in range(n): + dirt = [Q(i == target) for i in range(n)] + actual = dirt[:] + for u, v in base_terms + correction_terms: + total = dot(v, [Q(0)] * n) + actual = [z + c * total for z, c in zip(actual, u)] + require(actual == dirt, "formal target-dirt column") + controls.append("all_224_formal_input_columns") + corrupt = [row[:] for row in minor] + corrupt[-1] = corrupt[0][:] + passed("dependent_rank_certificate", determinant(corrupt) == 0) + wrong_cert = json.loads(json.dumps(cert)) + wrong_cert["q_to_line"][0]["q"], wrong_cert["q_to_line"][1]["q"] = ( + wrong_cert["q_to_line"][1]["q"], wrong_cert["q_to_line"][0]["q"]) + try: + geometry(wrong_cert) + except Invalid: + controls.append("wrong_label_map") + else: + raise Invalid("control failed: wrong_label_map") + screens = {"predecessor_hypothesis": cost_screen(16, 8), + "actual_union_only": cost_screen(12, 8), + "actual_union_first_rejected_integer_charge": cost_screen(12, 9), + "forced_rectangle_floor": cost_screen(12, 12), + "literal_correction": cost_screen(12, 40)} + require(screens["predecessor_hypothesis"]["decision"] == "passes" and + screens["actual_union_only"]["decision"] == "passes" and + screens["actual_union_first_rejected_integer_charge"]["decision"] == "fails" and + screens["forced_rectangle_floor"]["decision"] == "fails", "budget verdict") + return {"schema_version": 1, "kind": "scoped scalar-factor pricing audit and proof", + "source_pr": 2308, "source_head": "7653e0cc72527c1e7fc02499122d383713ee9d54", + "physical_shared_direction": r, "frames": frames, + "union": union, "intersection": sorted(set(frames[0]) & set(frames[1])), + "complement_ports": targets, "complement_rank_witness": { + "line_ids": [targets[i] for i in tpivots], "doubled_root_determinant": tdet}, + "coefficient_parity_rank": parity_rank, "rescaled_coefficient_parity_rank": 0, + "correction_terms": term_receipts, "correction_COPY_cost": correction_cost, + "deleted_frame_decoder_basis": deleted_frame, + "original_deleted_frame_COPY_ranks": old_costs, "plane_deleted_frame_COPY_ranks": base_costs, + "literal_total_COPY_cost_before_missing_repair": sum(base_costs) + correction_cost, + "forbidden_nonzero_entries": faults, "missing_union_block_rank": missing_rank, + "forced_rectangle": {"rows": union, "columns": rectangle_columns, + "twice_entries": rect2, "rank": len(pivots), "minor_column_positions": pivots, + "minor_determinant": det, "any_additive_scalar_correction_COPY_floor": len(union)}, + "dirty_counterexample": {"target_line": a, "source_line": b, + "target_q": mapping[a], "source_q": mapping[b], "initial_target": "11", + "output_target": str(after[index[a]]), "required_target": "11"}, + "scalar_columns_checked": 224, "controls": controls, "screens": screens, + "limits": ["one named pair; no all-pair census", "additive scalar factors retain G/2", + "no global COPY optimum or operator-valued lower bound", "no native or chronological realization", + "screen keeps predecessor local profile; changed profiles require repricing", + "no supplier admission, selected cold replay, or new kappa"]} + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--out", type=Path, help="also write verified receipt to a new file exclusively") + args = parser.parse_args() + cert, _ = load_sources() + result = compute(cert) + expected = json.loads((HERE / "RESULT.json").read_text()) + require(canonical(result) == canonical(expected), "receipt mismatch") + if args.out: + with args.out.open("x") as f: + json.dump(result, f, indent=2) + f.write("\n") + print("PASS_P112_SHARED_CORRECTION_COST_AUDIT union=12 parity_rank=1 correction_COPY=40 " + "forbidden_entries=32 additive_COPY_floor=12 five_percent_screen=FAIL controls=" + + str(len(result["controls"])) + " no_new_kappa") + + +if __name__ == "__main__": + main()