From bd31251149dd5305c203064dd4627a3334ec1b57 Mon Sep 17 00:00:00 2001 From: Nick Petalas Date: Fri, 13 Nov 2026 22:47:11 +0000 Subject: [PATCH] feat(research): add a 54-batch phase-B packing certificate --- research/phase-b-54-batches/CERTIFICATE.json | 1141 ++++++++++++++++++ research/phase-b-54-batches/README.md | 186 +++ research/phase-b-54-batches/SOURCES.json | 42 + research/phase-b-54-batches/TASK.json | 100 ++ research/phase-b-54-batches/VERIFY.json | 37 + research/phase-b-54-batches/verify.py | 328 +++++ 6 files changed, 1834 insertions(+) create mode 100644 research/phase-b-54-batches/CERTIFICATE.json create mode 100644 research/phase-b-54-batches/README.md create mode 100644 research/phase-b-54-batches/SOURCES.json create mode 100644 research/phase-b-54-batches/TASK.json create mode 100644 research/phase-b-54-batches/VERIFY.json create mode 100644 research/phase-b-54-batches/verify.py diff --git a/research/phase-b-54-batches/CERTIFICATE.json b/research/phase-b-54-batches/CERTIFICATE.json new file mode 100644 index 0000000000..7b04dda07c --- /dev/null +++ b/research/phase-b-54-batches/CERTIFICATE.json @@ -0,0 +1,1141 @@ +{ + "schema_version": 1, + "phase": "B", + "batch_size": 16, + "batches": [ + { + "gap": 0, + "event_ids": [ + 12760, + 12762, + 12764, + 12766, + 12768, + 12770, + 12772, + 12774, + 12776, + 12778, + 12780, + 12782, + 12784, + 12786, + 12788, + 12790 + ] + }, + { + "gap": 0, + "event_ids": [ + 12792, + 12794, + 12798, + 12800, + 12804, + 12806, + 12810, + 12812, + 12816, + 12818, + 12820, + 12822, + 12824, + 12827, + 12829, + 12831 + ] + }, + { + "gap": 1387, + "event_ids": [ + 14555, + 14552, + 14556, + 14553, + 14549, + 14546, + 14550, + 14547, + 14543, + 14540, + 14544, + 14541, + 14537, + 14534, + 14538, + 14535 + ] + }, + { + "gap": 0, + "event_ids": [ + 12833, + 12836, + 12838, + 12840, + 12842, + 12844, + 12846, + 12848, + 12850, + 12852, + 12854, + 12856, + 12858, + 12872, + 12874, + 12876 + ] + }, + { + "gap": 0, + "event_ids": [ + 12878, + 12892, + 12894, + 12896, + 12898, + 12928, + 12948, + 12966, + 12968, + 12989, + 13003, + 13007, + 13022, + 13025, + 13039, + 13041 + ] + }, + { + "gap": 1309, + "event_ids": [ + 14439, + 14442, + 14427, + 14430, + 14514, + 14511, + 14466, + 14472, + 14451, + 14457, + 14526, + 14481, + 14523, + 14478, + 14448, + 14496 + ] + }, + { + "gap": 2200, + "event_ids": [ + 15531, + 15534, + 15530, + 15533, + 15540, + 15543, + 15566, + 15569, + 15576, + 15579, + 15602, + 15605, + 15612, + 15615, + 15638, + 15641 + ] + }, + { + "gap": 2150, + "event_ids": [ + 15458, + 15461, + 15468, + 15471, + 15494, + 15497, + 15504, + 15507, + 15648, + 15651, + 15674, + 15677, + 15684, + 15687, + 15710, + 15713 + ] + }, + { + "gap": 2204, + "event_ids": [ + 15541, + 15544, + 15720, + 15723, + 15746, + 15749, + 15756, + 15759, + 15782, + 15785, + 15792, + 15795, + 15818, + 15821, + 15828, + 15831 + ] + }, + { + "gap": 600, + "event_ids": [ + 13503, + 13507, + 13506, + 13501, + 13504, + 13500, + 13553, + 13549, + 13610, + 13606, + 13993, + 13992, + 13998, + 14002, + 14001, + 13996 + ] + }, + { + "gap": 185, + "event_ids": [ + 13044, + 13060, + 13062, + 13064, + 13066, + 13080, + 13082, + 13084, + 13086, + 13100, + 13102, + 13104, + 13106, + 13352, + 13354, + 13360 + ] + }, + { + "gap": 2208, + "event_ids": [ + 15550, + 15552, + 15854, + 15857, + 15864, + 15867, + 15890, + 15893, + 15900, + 15903, + 15926, + 15929, + 15936, + 15939, + 15962, + 15965 + ] + }, + { + "gap": 639, + "event_ids": [ + 13560, + 13564, + 13563, + 13558, + 13561, + 13557, + 13999, + 13995, + 13667, + 13663, + 14037, + 14042, + 14046, + 14036, + 14045, + 14040 + ] + }, + { + "gap": 678, + "event_ids": [ + 13617, + 13621, + 13620, + 13615, + 13618, + 13614, + 14043, + 14039, + 14083, + 14082, + 14088, + 14092, + 14091, + 14086, + 14089, + 14129 + ] + }, + { + "gap": 717, + "event_ids": [ + 13674, + 13678, + 13677, + 13672, + 13675, + 13671, + 14085, + 14134, + 14138, + 14128, + 13724, + 14137, + 14132, + 14135, + 14131, + 13720 + ] + }, + { + "gap": 2212, + "event_ids": [ + 15558, + 15560, + 15972, + 15975, + 15998, + 16001, + 16008, + 16011, + 16034, + 16037, + 16044, + 16047, + 16070, + 16073, + 16080, + 16083 + ] + }, + { + "gap": 1128, + "event_ids": [ + 14445, + 14493, + 14499, + 14505, + 14484, + 14490, + 14463, + 14460, + 14424, + 14421, + 14436, + 14433, + 14532, + 14529, + 14520, + 14517 + ] + }, + { + "gap": 2216, + "event_ids": [ + 15567, + 15570, + 16106, + 16109, + 16116, + 16119, + 16142, + 16145, + 16152, + 16155, + 16178, + 16181, + 16188, + 16191, + 16214, + 16217 + ] + }, + { + "gap": 516, + "event_ids": [ + 13358, + 13366, + 13458, + 13462, + 13456, + 13404, + 13406, + 13468, + 13411, + 13438, + 13440, + 13417, + 13446, + 13452, + 13389, + 13387 + ] + }, + { + "gap": 1390, + "event_ids": [ + 14867, + 14864, + 14849, + 14846, + 14861, + 14858, + 14855, + 14852, + 14862, + 14859, + 14856, + 14853, + 14868, + 14865, + 14850, + 14847 + ] + }, + { + "gap": 2220, + "event_ids": [ + 15577, + 15580, + 16224, + 16227, + 16250, + 16253, + 16260, + 16263, + 16286, + 16289, + 16296, + 16299, + 16322, + 16325, + 16332, + 16335 + ] + }, + { + "gap": 756, + "event_ids": [ + 13731, + 13735, + 13734, + 13729, + 13732, + 13728, + 13838, + 14175, + 14180, + 14184, + 14174, + 13834, + 14217, + 14222, + 14226, + 14183 + ] + }, + { + "gap": 619, + "event_ids": [ + 13527, + 13533, + 13530, + 13539, + 13536, + 13542, + 13547, + 14178, + 14181, + 14216, + 14177, + 14225, + 14220, + 14223, + 14219, + 13604 + ] + }, + { + "gap": 795, + "event_ids": [ + 13788, + 13792, + 13791, + 13786, + 13789, + 13785, + 13895, + 14259, + 14264, + 14268, + 14258, + 14267, + 14262, + 14265, + 14261, + 13891 + ] + }, + { + "gap": 658, + "event_ids": [ + 13584, + 13590, + 13587, + 13593, + 13596, + 13599, + 13661, + 14301, + 14306, + 14310, + 14300, + 14304, + 14307, + 14309, + 14303, + 13718 + ] + }, + { + "gap": 2224, + "event_ids": [ + 15586, + 15588, + 16358, + 16361, + 16368, + 16371, + 16394, + 16397, + 16404, + 16407, + 16430, + 16433, + 16440, + 16443, + 15599, + 15609 + ] + }, + { + "gap": 526, + "event_ids": [ + 13375, + 13394, + 13423, + 13400, + 13421, + 13428, + 13434, + 13377, + 13383, + 13472, + 13474, + 13480, + 13486, + 13398, + 13381, + 13496 + ] + }, + { + "gap": 2228, + "event_ids": [ + 15594, + 15596, + 15598, + 15608, + 15619, + 15618, + 15627, + 15626, + 15635, + 15645, + 15634, + 15671, + 15644, + 15655, + 15681, + 15654 + ] + }, + { + "gap": 1710, + "event_ids": [ + 15455, + 15465, + 15454, + 15464, + 15475, + 15474, + 15483, + 15482, + 15491, + 15490, + 15501, + 15500, + 15511, + 15510, + 15527, + 15537 + ] + }, + { + "gap": 2232, + "event_ids": [ + 15603, + 15606, + 15663, + 15670, + 15662, + 15680, + 15691, + 15690, + 15699, + 15698, + 15707, + 15717, + 15706, + 15743, + 15716, + 15727 + ] + }, + { + "gap": 115, + "event_ids": [ + 13184, + 13370, + 13372, + 13350, + 13368, + 13362, + 13385, + 13492, + 13356, + 13402, + 13432, + 13460, + 13379, + 13419, + 13436, + 13490 + ] + }, + { + "gap": 2236, + "event_ids": [ + 15613, + 15616, + 15753, + 15726, + 15735, + 15742, + 15734, + 15752, + 15763, + 15762, + 15771, + 15770, + 15779, + 15789, + 15778, + 15815 + ] + }, + { + "gap": 1710, + "event_ids": [ + 15519, + 15518, + 15526, + 15536, + 15547, + 15546, + 15555, + 15554, + 15563, + 15573, + 15562, + 15572, + 15583, + 15582, + 15591, + 15590 + ] + }, + { + "gap": 2240, + "event_ids": [ + 15622, + 15624, + 15788, + 15799, + 15825, + 15798, + 15807, + 15814, + 15806, + 15824, + 15835, + 15834, + 15843, + 15842, + 15851, + 15887 + ] + }, + { + "gap": 2244, + "event_ids": [ + 15630, + 15632, + 15897, + 15861, + 15850, + 15860, + 15871, + 15870, + 15886, + 15907, + 15879, + 15878, + 15896, + 15915, + 15923, + 15906 + ] + }, + { + "gap": 2248, + "event_ids": [ + 15639, + 15642, + 15914, + 15933, + 15959, + 15943, + 15969, + 15922, + 15958, + 15932, + 15942, + 15951, + 15968, + 15979, + 15950, + 15978 + ] + }, + { + "gap": 775, + "event_ids": [ + 13755, + 13761, + 13758, + 13764, + 13767, + 13770, + 13781, + 13777, + 13775, + 13832, + 13889, + 14032, + 14074, + 14078, + 14120, + 14124 + ] + }, + { + "gap": 2252, + "event_ids": [ + 15649, + 15652, + 15987, + 15986, + 15995, + 16031, + 16041, + 16005, + 15994, + 16004, + 16015, + 16014, + 16030, + 16051, + 16023, + 16022 + ] + }, + { + "gap": 1375, + "event_ids": [ + 15155, + 15185, + 15179, + 15157, + 15187, + 15181, + 15205, + 15235, + 15229, + 15137, + 15140, + 15131, + 15134, + 15113, + 15116, + 15203 + ] + }, + { + "gap": 2256, + "event_ids": [ + 15658, + 15660, + 16040, + 16059, + 16067, + 16050, + 16103, + 16058, + 16113, + 16077, + 16087, + 16066, + 16102, + 16123, + 16076, + 16112 + ] + }, + { + "gap": 2260, + "event_ids": [ + 15666, + 15668, + 16131, + 16139, + 16086, + 16095, + 16122, + 16175, + 16094, + 16130, + 16185, + 16149, + 16159, + 16138, + 16174, + 16195 + ] + }, + { + "gap": 2264, + "event_ids": [ + 15675, + 15678, + 16148, + 16184, + 16203, + 16211, + 16158, + 16167, + 16194, + 16247, + 16166, + 16202, + 16257, + 16221, + 16231, + 16210 + ] + }, + { + "gap": 2268, + "event_ids": [ + 15685, + 15688, + 16246, + 16267, + 16220, + 16256, + 16275, + 16283, + 16230, + 16239, + 16266, + 16319, + 16238, + 16274, + 16329, + 16293 + ] + }, + { + "gap": 2272, + "event_ids": [ + 15694, + 15696, + 16303, + 16282, + 16318, + 16339, + 16292, + 16328, + 16347, + 16355, + 16302, + 16311, + 16338, + 16310, + 16346, + 16365 + ] + }, + { + "gap": 2276, + "event_ids": [ + 15702, + 15704, + 16391, + 16375, + 16354, + 16401, + 16390, + 16364, + 16374, + 16383, + 16382, + 16400, + 16411, + 16410, + 16419, + 16418 + ] + }, + { + "gap": 1350, + "event_ids": [ + 15107, + 15110, + 15233, + 15227, + 15161, + 15164, + 15209, + 15212, + 15281, + 15284, + 15275, + 15278, + 15257, + 15260, + 15251, + 15254 + ] + }, + { + "gap": 834, + "event_ids": [ + 13845, + 13849, + 13848, + 13843, + 13846, + 13842, + 14166, + 14170, + 14920, + 14922, + 14926, + 14918, + 14932, + 14930, + 14872, + 14874 + ] + }, + { + "gap": 1855, + "event_ids": [ + 15245, + 15239, + 15248, + 15242, + 16427, + 16426, + 16437, + 16436, + 16447, + 16446, + 16455, + 16454, + 15197, + 15191, + 15200, + 15194 + ] + }, + { + "gap": 873, + "event_ids": [ + 13902, + 13906, + 13905, + 13900, + 13903, + 13899, + 14928, + 14878, + 14870, + 14924, + 14884, + 14882, + 14880, + 14876, + 14904, + 14906 + ] + }, + { + "gap": 814, + "event_ids": [ + 13812, + 13818, + 13815, + 13821, + 13824, + 13827, + 14910, + 14902, + 14916, + 14914, + 14888, + 14890, + 14912, + 14894, + 14886, + 14908 + ] + }, + { + "gap": 697, + "event_ids": [ + 13641, + 13647, + 13644, + 13653, + 13650, + 13656, + 14900, + 14898, + 14896, + 14984, + 14986, + 14990, + 14892, + 14982, + 14996, + 14994 + ] + }, + { + "gap": 736, + "event_ids": [ + 13698, + 13704, + 13701, + 13710, + 13707, + 13713, + 14992, + 14988, + 14936, + 14938, + 14942, + 14934, + 14948, + 14946, + 14944, + 14940 + ] + }, + { + "gap": 1196, + "event_ids": [ + 15269, + 15263, + 15272, + 15266, + 15149, + 15143, + 15152, + 15146, + 15221, + 15215, + 15224, + 15218, + 15101, + 15095, + 15104, + 15098 + ] + }, + { + "gap": 853, + "event_ids": [ + 13869, + 13875, + 13872, + 13881, + 13878, + 13884, + 14952, + 14954, + 14958, + 14950, + 14964, + 14962, + 14960, + 14956, + 15080, + 15082 + ] + } + ] +} diff --git a/research/phase-b-54-batches/README.md b/research/phase-b-54-batches/README.md new file mode 100644 index 0000000000..11c2f207d0 --- /dev/null +++ b/research/phase-b-54-batches/README.md @@ -0,0 +1,186 @@ +# A 54-batch phase-B witness for the fixed gauge44 word + +This construction and verifier were produced by Nick Petalas. Apache-2.0. + +Claim type: **finite certificate with a scoped substitution proof**. Each of +both frozen gauge44 orientations admits 54 disjoint batches of sixteen +rank-one climbs in phase B. This raises the known feasible count from the +52 batches reported by Josie Elliston's [PR #1817](https://github.com/CrocSwap/integer-mult-bounds/pull/1817) +to 54. The exact maximum remains in **[54, 67]**. + +The new witness uses 864 of the 1,072 phase-B rank-one climbs. Its reordered +word preserves every original event, the non-rank-one skeleton and all 712 +shared-role occurrence traces of each 24,767-event orientation. The two new +word hashes are generated by the verifier. No physical rank-16 child, +recursive saving, new kappa or selected-frontier change is claimed. + +## Contract + +The input is the historical #1094 gauge44 provider retained in +`research/community-frontier1094-audit/selected-replay.tar.gz`, member +`candidate/strict/global/base/providers/gauge44/LOCAL-PROGRAMS.json.gz`. +The archive and member SHA256 values are hard-pinned in `verify.py`. +`SOURCES.json` pins the archive and the predecessor documentation/code. + +Only rank-one climb occurrences may move. They stay in phase B and may +cross only events that touch no register of their own. All other events +retain their order. Each batch has sixteen different destinations and no +climb belongs to two batches. The witness groups the original climbs; it +does not replace them with a native rank-16 operation. + +`CERTIFICATE.json` gives the skeleton gap and sixteen original global event +indices for each batch. Gap zero precedes the first non-rank-one event of +phase B. Gap g follows exactly g such events. Indices refer to the original +whole program, starting at zero. One table works for both orientations; +the verifier checks each orientation separately. + +## Construction and proof + +Delete the rank-one climbs from phase B to obtain the fixed skeleton. For +a climb at original gap g on register r, its legal interval begins just +after the last skeleton event touching r before g. It ends just before the +first skeleton event touching r at or after g. Both endpoints are legal +gaps. These are the legal windows introduced by #1817. + +The new deterministic pass considers every original right endpoint. At each +endpoint, it selects the sixteen available climbs with shortest window +width, then earliest right endpoint, then original event index. It chooses +the candidate group with least total window width, breaking ties by gap, +and removes those climbs. It repeats until no group remains. The first pass +produced 54 groups. No further search was made for a larger result. + +The verifier's default path checks the committed certificate without +running this heuristic. It reconstructs all legal windows from source +bytes, checks event uniqueness, window membership and distinct +destinations, emits batches before unbatched climbs at each gap, and checks +that every batch is contiguous in the resulting word. Unbatched climbs +retain their original gaps and order. The phase-B skeleton has 2,630 events. +Exactly 208 rank-one climbs remain unbatched. + +The checker then compares the complete ordered list of original occurrence +indices touching each role, including scalar reads and writes, all adapters +and centre roles. It also checks the whole event permutation, skeleton and +unchanged events outside phase B. Equality of these traces proves that the +new word is a linear extension of the original shared-role dependency order. +To transform one order into the other, move each next desired event left +across intervening events. None can share a role with it, since that would +reverse their common-role trace. Thus each swap commutes as a complete +logical operation on disjoint registers. Induction proves the same map on +arbitrary inputs under the retained logical operation semantics. + +This substitution criterion also appears in ToikY's +[PR #1833](https://github.com/CrocSwap/integer-mult-bounds/pull/1833). +Here it is applied only to the new witness. The predecessor's hosting +projection result is not extended or replayed. Shared physical scratch, +native compilation and tape behavior require their own implementation +contracts. + +The cardinality bound is floor(1072/16)=67. The certificate supplies the +lower bound 54. No optimum or exclusion of counts 55 through 67 is claimed. + +## Reproduce + +From the repository root, with CPython 3.12 and its standard library: + +```sh +/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -I -W error -B research/phase-b-54-batches/verify.py --check-discovery +/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -I -O -W error -B research/phase-b-54-batches/verify.py +/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/research_package.py --package research/phase-b-54-batches +/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/check_research_commit.py --package research/phase-b-54-batches --check-source-history +``` + +Another CPython 3.12 executable may replace the absolute path. The direct +marker is `PASS_PHASE_B_54_BATCHES`; the package marker is +`PASS_REGISTERED_RESEARCH_PACKAGE`. The generated stdout receipt binds every +package file, the frozen archive/member and both new logical word hashes. +Default verification writes no files. `--check-discovery` additionally +reconstructs the deterministic witness and compares it to the certificate. +`--write-certificate /external/scratch/NEW.json` regenerates the certificate +at an unoccupied path and refuses to overwrite an existing file. + +Eight rejection controls run on each orientation: a short batch, reused +climb, out-of-range gap, non-rank-one event, cross-phase climb, a gap outside +a climb's legal window, repeated destination and a climb swapped across its own preceding +operation. Checks use explicit exceptions and remain active under `-O`. + +## Scope and engineering notes + +This is a historical scheduling side result under a changed +`complex-rank-shape-decoder` scope. Current selected #7000 at +kappa 0.00363005817 is unchanged. The actual paid profile is unchanged because +all original climbs remain. A batching invoice would require a legal new +child and a complete bill. No old zero-charge ceiling is transferred to the +current supplier. The advance exact-optimum goal was narrowed in the +[scope update](https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19601520) +after this first improvement. + +No predecessor scientific verifier, native or selected cold replay, physical +hosting/precision/compiler check, Lean or Docker build was run. The complete +multiplication theorem, five inherited assumptions, independent human review +and formal proof-kernel review remain outside the result. + +New functions are shorter than sixty lines and use bounded nonrecursive +loops. Source inputs are authenticated before parsing. Archive and payload +sizes are capped at eight MiB, the compressed member at one MiB, the +certificate at 64 KiB, and each orientation at 25,000 events. Discovery has +at most floor(N/16) rounds, N candidate endpoints and N interval tests per +endpoint, for N phase-B climbs. All direct check failures raise exceptions; +file handles close on every exit. Warning-strict normal and optimized runs +supply the available Python diagnostics. No optional linter or static type +checker is installed in the reproduction interpreter. + +Power of Ten rule 3 requires a managed-runtime deviation: Python and its +standard JSON, tar and gzip readers allocate dynamically. This is confined +to the authenticated fixed input and bounded witness above; no service loop +or unbounded queue exists. Fixed-capacity buffers would require replacing +those standard readers and are outside this research package. The finite +input/loop bounds and replay are the compensating controls. A future +untrusted or variable-size interface must revisit that allocation contract. + +## Open next questions + +1. What is the exact phase-B maximum in [54,67]? An exact interval-packing + optimization with an independently checkable upper-bound witness is the + first step. No such upper-bound certificate is supplied here. +2. Can a changed native/encoding contract realize one batch with a favorable + complete bill? #1833 already points to a separate support/volume obstruction + for the proposed monomial child. State the changed hypothesis first, then + charge native realization, gathering, owned storage, precision and dirty + restoration for one exact batch. That child and a complete caller remain + missing. + +## Credit and related work + +Josie Elliston / JosieElliston #1817 supplied the legal retiming model, +window construction, original 52-batch phase-B lower bound and exact-maximum +question. Her head is `ac3a759e874e8e526bc884fc2cb8eb114695b063`. +The new contribution is the 54-group witness, its deterministic discovery +pass and its source-bound checker. Classical interval heuristics and +shared-role dependency arguments are not claimed as new general theorems. + +Credit Jose Manuel / jmbarrancoml, published through 1337isnot1337 #1779, +for the diagonal batching proposal; ToikY #1833 for the retained substitution +and hosting-boundary discussion; Arham Tahir #1605 for the charge model; +Douglas Colkitt #1240 for the historical ceiling; Sagar Thakrar #1012 for the +coverage law; and the icekylinx / #514 / #433, Rohan Arun / #1094 and retained +geometry, native, controller and supplier contributors. Ross Richardson and Greer Guthrie / #679 retain credit for the separate +native support/volume obstruction referenced by #1833. No predecessor source +or credit line is changed. + +Related open work: + +- [#1836](https://github.com/CrocSwap/integer-mult-bounds/pull/1836) studies + higher-rank pairs at one ADD on the same historical word. This certificate + groups rank-one climbs and does not combine its proposed profile. +- [#1865](https://github.com/CrocSwap/integer-mult-bounds/pull/1865) schedules + nonconsecutive commuting C3 fanouts on that word. Its three-destination + shear groups differ from the sixteen climb occurrences here. + +Canonical base is `e54523517d0f03e58352e647c403a5af3e525a57`. +Live open PRs and Discussion claims, targeted merged searches, recent +account work and main README searches were checked. The overlap cache +covered 846 open PRs, 7,478 Discussion records and all 10,178 main note paths. +The bulk closed-PR refresh timed out; targeted merged queries and main +searches were used separately. Unpublished work and arbitrary historical +diffs remain coverage limits. These searches do not establish universal +novelty. diff --git a/research/phase-b-54-batches/SOURCES.json b/research/phase-b-54-batches/SOURCES.json new file mode 100644 index 0000000000..b00d8362b5 --- /dev/null +++ b/research/phase-b-54-batches/SOURCES.json @@ -0,0 +1,42 @@ +{ + "schema_version": 1, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "75d77b328ea02ded535e7f23aee5b1e55d0bb1a8", + "sha256": "154c3d30455d778fd3343b6b4851f0fa4665f0f7625b0adb3675e2bafbbf6bf1" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81" + }, + { + "path": "research/community-frontier1094-audit/selected-replay.tar.gz", + "usage": "input", + "git_blob": "c24daf067f9c543421d89ca2eeaa4eb78a57fb6f", + "sha256": "f1da80610bf33c58527f18ad63b4350d0b864e1d4486141ee17ac9bed4d529d6" + }, + { + "path": "research/diagonal-batch-commutation/README.md", + "usage": "provenance", + "git_blob": "f5e00678bdbe42a52229d2243392c52fae79bf17", + "sha256": "1d62404d271b93db056ca4104436cec239bb64f32197b5c7a8c96cea68ab0083" + }, + { + "path": "research/diagonal-batch-commutation/batch.py", + "usage": "provenance", + "git_blob": "e8c7c25d1a200aabdcb707fb800e579c93046dd8", + "sha256": "c9f0cbe4337e9c443ac2a10512111f60ab8d0459d2aae9de5176305d3a3bddc5" + }, + { + "path": "research/diagonal-retiming-host-boundary/README.md", + "usage": "provenance", + "git_blob": "af5fa5c62a5f177e9fdf0d3e83c8d0b864f9d365", + "sha256": "9f482b63fab85bd2baaf4168f806620a6e02914c669a8aa6d6fe32ac344d2951" + } + ] +} diff --git a/research/phase-b-54-batches/TASK.json b/research/phase-b-54-batches/TASK.json new file mode 100644 index 0000000000..8f49076bb7 --- /dev/null +++ b/research/phase-b-54-batches/TASK.json @@ -0,0 +1,100 @@ +{ + "schema_version": 1, + "task_id": "complex-rank-shape-decoder", + "priority_revision": 8, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "original_card": { + "id": "complex-rank-shape-decoder", + "question": "Can a legal decoder or coframe change improve the full signed moment, including changed helper targets?", + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "docs/research/recursive-invoice-preflight.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "acceptance_gate": "A source-bound arbitrary-input identity and legal producer/consumer boundary with the complete paid and productive target invoice, including restoration, ownership, native alignment and extra charges. Price under the actual current model; historical ceiling.py assumptions must be established before use. A favorable optimistic relaxation keeps a route open but is not a completed supplier. A scoped local result remains useful; expansion requires the family-level budget gate.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "Price one complete changed itinerary with both paid and productive histograms. Check #5693/#5698 for overlap and their exact hypotheses before another coframe search. Use the signed invoice preflight where its boundary contract agrees; an inconclusive concave comparison is not a power crossing. Stop if an optimistic complete budget fails at the chosen target or native delivery remains unspecified.", + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "overlap_terms": [ + "coframe", + "signed moment", + "5693", + "5698" + ], + "existing_checks": [ + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + }, + "scope_status": "changed", + "actual_scope": "Construct a new finite phase-B packing for the historical gauge44 local programs under the fixed non-rank-one skeleton and shared-role dependency order; improve the cited 52-batch witness without claiming the optimum.", + "scope_change_reason": "The current card seeks a completed signed-moment decoder improvement. This explicitly open historical scheduling subproblem is a bounded side result. The first new 54-batch witness is packaged before attempting an exact optimum; no current supplier budget is inferred.", + "bottleneck_link": "Local batch availability is one prerequisite for a changed recursive delivery contract. This certificate improves that availability bound, but gives no physical delivery, favorable invoice or current kappa gain.", + "budget_minutes": 60, + "stop_rule": "Stop at the first verified original improvement; do not continue searching for an optimum or compose an invoice.", + "outcome": "completed", + "evidence": "CERTIFICATE.json and verify.py certify 54 disjoint batches of 16 on each orientation, with 864 distinct climbs, legal windows, preserved skeleton and all 712 complete shared-role traces of each 24767-event word. Eight rejecting controls are checked on each orientation. The optional deterministic generator reproduces the witness.", + "author": "Nick Petalas", + "ai_assistance": "Independent human and formal proof-kernel review are unclaimed.", + "open_questions": [ + { + "question": "What is the exact phase-B maximum between 54 and 67?", + "why_it_matters": "The new certificate leaves thirteen possible additional batches unresolved.", + "first_step": "Build an exact interval-packing optimization and an independently checkable upper-bound witness for these fixed legal windows.", + "blocked_by": "No optimality certificate or better packing is supplied." + }, + { + "question": "Can a changed native/encoding contract realize one batch with a favorable complete bill?", + "why_it_matters": "Logical co-location of climbs alone provides no recursive saving.", + "first_step": "Name the hypothesis changed from the monomial-child support/volume obstruction referenced by #1833; then price native realization, gathering, owned storage, precision and dirty restoration for one exact batch.", + "blocked_by": "No legal physical rank-16 implementation or compatible complete caller is supplied." + } + ], + "claim_type": "finite_certificate", + "claim_url": "https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19601500", + "scope_update_url": "https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19601520", + "environment": { + "python": "CPython 3.12.15", + "implementation": "standard library only", + "platform": "macOS 27.0.1 arm64" + }, + "overlap": { + "canonical_main": "e54523517d0f03e58352e647c403a5af3e525a57", + "open_prs": 846, + "discussion_records": 7478, + "head_note_paths": 10178, + "complete_open_pr_pagination": true, + "complete_discussion_pagination": true, + "limits": "Closed-PR bulk refresh timed out; targeted merged searches, exact main README searches and the account recent-PR list were checked separately. Unpublished work and arbitrary historical diffs are not covered.", + "open_pr_snapshot_utc": "2026-11-13T22:35:58.937004+00:00", + "discussion_snapshot_utc": "2026-11-13T22:37:28.824015+00:00" + } +} diff --git a/research/phase-b-54-batches/VERIFY.json b/research/phase-b-54-batches/VERIFY.json new file mode 100644 index 0000000000..d111d3934b --- /dev/null +++ b/research/phase-b-54-batches/VERIFY.json @@ -0,0 +1,37 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/community-frontier1094-audit/selected-replay.tar.gz" + ], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "{package}/verify.py", + "--check-discovery" + ], + "timeout_seconds": 120, + "checks": "Regenerate the new witness, authenticate the frozen input, and verify each complete event trace and sixteen rejection controls." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-W", + "error", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Check the committed witness and all controls with Python assertions disabled." + } + ] +} diff --git a/research/phase-b-54-batches/verify.py b/research/phase-b-54-batches/verify.py new file mode 100644 index 0000000000..f6f626cee1 --- /dev/null +++ b/research/phase-b-54-batches/verify.py @@ -0,0 +1,328 @@ +#!/usr/bin/env python3 +"""Check the new 54-batch phase-B witness without importing a search engine.""" +from __future__ import annotations + +import argparse +import bisect +import collections +import copy +import gzip +import hashlib +import io +import json +import tarfile +from pathlib import Path + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +ARCHIVE = ROOT / "research/community-frontier1094-audit/selected-replay.tar.gz" +ARCHIVE_SHA = "f1da80610bf33c58527f18ad63b4350d0b864e1d4486141ee17ac9bed4d529d6" +MEMBER = "candidate/strict/global/base/providers/gauge44/LOCAL-PROGRAMS.json.gz" +MEMBER_SHA = "241fde27d4e43f5a9cb6b128f9f76c5131a53d09f0371676163f914d0b0fef3a" +PACKAGE_FILES = ("README.md", "TASK.json", "SOURCES.json", "VERIFY.json", + "CERTIFICATE.json", "verify.py") +BATCH_SIZE = 16 +BATCH_COUNT = 54 +MAX_EVENTS = 25000 + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def bounded_read(path, limit): + require(path.stat().st_size <= limit, "input size limit") + with path.open("rb") as stream: + data = stream.read(limit + 1) + require(len(data) <= limit, "input size limit") + return data + + +def digest(data): + return hashlib.sha256(data).hexdigest() + + +def canonical(value): + return json.dumps(value, sort_keys=True, separators=(",", ":")).encode() + + +def load_programs(): + raw = bounded_read(ARCHIVE, 8 * 1024 * 1024) + require(digest(raw) == ARCHIVE_SHA, "archive hash") + with tarfile.open(fileobj=io.BytesIO(raw), mode="r:gz") as archive: + member = archive.getmember(MEMBER) + require(member.isfile() and member.size <= 1024 * 1024, "member size/type") + stream = archive.extractfile(member) + require(stream is not None, "member absent") + with stream: + data = stream.read(member.size + 1) + require(len(data) == member.size and digest(data) == MEMBER_SHA, "member hash") + payload = gzip.decompress(data) + require(len(payload) <= 8 * 1024 * 1024, "program payload size") + programs = json.loads(payload) + require(set(programs) == {"forward", "backward"}, "orientations") + for events in programs.values(): + require(type(events) is list and len(events) <= MAX_EVENTS, "event bound") + return programs + + +def roles(event): + tag = event[0] + if tag in ("climb", "adapter", "residual_adapter"): + return {("L", event[2])} + if tag == "center": + return {("C", event[1])} + if tag == "scalar": + operation = event[1] + require(operation[0] in {"scale", "copy", "add", "clear"}, "scalar tag") + result = {tuple(operation[1])} + if operation[0] in {"copy", "add"}: + result.add(tuple(operation[2])) + return result + require(tag == "phase", "unknown event tag") + return set() + + +def is_rank_one(event): + return event[0] == "climb" and event[5] == 1 + + +def phase_span(events): + starts = [i + 1 for i, event in enumerate(events) if event == ["phase", "B"]] + require(len(starts) == 1, "unique phase B") + start = starts[0] + stops = [i for i in range(start, len(events)) if events[i][0] == "phase"] + require(bool(stops), "phase B terminal marker") + return start, stops[0] + + +def windows(events): + start, stop = phase_span(events) + skeleton = [i for i in range(start, stop) if not is_rank_one(events[i])] + touch_positions = collections.defaultdict(list) + for position, event_id in enumerate(skeleton): + for role in roles(events[event_id]): + touch_positions[role].append(position) + result = {} + gap = 0 + for event_id in range(start, stop): + event = events[event_id] + if not is_rank_one(event): + gap += 1 + continue + require(event[1] == "B", "climb phase") + positions = touch_positions[("L", event[2])] + j = bisect.bisect_left(positions, gap) + lower = positions[j - 1] + 1 if j else 0 + upper = positions[j] if j < len(positions) else len(skeleton) + require(lower <= gap <= upper, "original interval membership") + result[event_id] = (lower, upper, event[2], gap) + require(gap == len(skeleton), "skeleton length") + return result, skeleton, start, stop + + +def check_batches(certificate, table, skeleton_size): + require(set(certificate) == {"schema_version", "phase", "batch_size", "batches"}, + "certificate keys") + require(certificate["schema_version"] == 1 and certificate["phase"] == "B", + "certificate scope") + require(certificate["batch_size"] == BATCH_SIZE, "batch size field") + batches = certificate["batches"] + require(type(batches) is list and len(batches) == BATCH_COUNT, "batch count") + used = set() + for batch in batches: + require(set(batch) == {"gap", "event_ids"}, "batch keys") + gap, ids = batch["gap"], batch["event_ids"] + require(type(gap) is int and 0 <= gap <= skeleton_size, "gap range") + require(type(ids) is list and len(ids) == BATCH_SIZE, "batch cardinality") + require(all(type(i) is int and i in table for i in ids), "phase-B rank-one ids") + require(len(set(ids)) == BATCH_SIZE and not used.intersection(ids), + "disjoint event ids") + require(len({table[i][2] for i in ids}) == BATCH_SIZE, "distinct destinations") + require(all(table[i][0] <= gap <= table[i][1] for i in ids), "legal window") + used.update(ids) + return used + + +def reordered_ids(events, certificate, table, skeleton, start, stop, used): + batches_at = collections.defaultdict(list) + for batch in certificate["batches"]: + batches_at[batch["gap"]].extend(batch["event_ids"]) + stay_at = collections.defaultdict(list) + for event_id, (_, _, _, gap) in table.items(): + if event_id not in used: + stay_at[gap].append(event_id) + order = list(range(start)) + for gap in range(len(skeleton) + 1): + order.extend(batches_at[gap]) + order.extend(stay_at[gap]) + if gap < len(skeleton): + order.append(skeleton[gap]) + order.extend(range(stop, len(events))) + require(sorted(order) == list(range(len(events))), "event permutation") + require(order[:start] == list(range(start)) and + order[stop:] == list(range(stop, len(events))), "outside phase unchanged") + require([i for i in order[start:stop] if not is_rank_one(events[i])] == skeleton, + "skeleton order") + return order + + +def role_traces(events, order): + traces = collections.defaultdict(list) + for event_id in order: + for role in roles(events[event_id]): + traces[role].append(event_id) + return dict(traces) + + +def check_trace_order(events, order): + original = role_traces(events, range(len(events))) + require(role_traces(events, order) == original, "complete shared-role traces") + return len(original) + + +def check_contiguous_batches(order, certificate): + positions = {event_id: i for i, event_id in enumerate(order)} + for batch in certificate["batches"]: + ids = batch["event_ids"] + start = positions[ids[0]] + require(order[start:start + BATCH_SIZE] == ids, "contiguous batch") + + +def check_orientation(events, certificate): + table, skeleton, start, stop = windows(events) + used = check_batches(certificate, table, len(skeleton)) + order = reordered_ids(events, certificate, table, skeleton, start, stop, used) + role_count = check_trace_order(events, order) + check_contiguous_batches(order, certificate) + return { + "events": len(events), "roles": role_count, "phase_B_climbs": len(table), + "phase_B_skeleton": len(skeleton), "batches": len(certificate["batches"]), + "batched_climbs": len(used), "unbatched_climbs": len(table) - len(used), + "cardinality_upper_bound": len(table) // BATCH_SIZE, + "changed_positions": sum(i != event_id for i, event_id in enumerate(order)), + "original_word_sha256": digest(canonical(events)), + "reordered_word_sha256": digest(canonical([events[i] for i in order])), + } + + +def discover(table): + """Reproduce the first witness, with no attempt to improve it further.""" + remaining = set(table) + endpoints = sorted({upper for _, upper, _, _ in table.values()}) + batches = [] + for _ in range(len(table) // BATCH_SIZE): + choices = [] + for gap in endpoints: + available = [i for i in remaining if table[i][0] <= gap <= table[i][1]] + if len(available) < BATCH_SIZE: + continue + available.sort(key=lambda i: (table[i][1] - table[i][0], table[i][1], i)) + take = available[:BATCH_SIZE] + require(len({table[i][2] for i in take}) == BATCH_SIZE, + "discovery requires distinct active destinations") + width_sum = sum(table[i][1] - table[i][0] for i in take) + choices.append((width_sum, gap, take)) + if not choices: + break + _, gap, take = min(choices) + batches.append({"gap": gap, "event_ids": take}) + remaining.difference_update(take) + return {"schema_version": 1, "phase": "B", "batch_size": BATCH_SIZE, + "batches": batches} + + +def expect_rejection(events, certificate, message): + try: + check_orientation(events, certificate) + except ValueError as error: + require(str(error) == message, "unexpected rejection: " + str(error)) + else: + raise ValueError("accepted faulty witness: " + message) + + +def negative_controls(events, certificate): + controls = [] + changed = copy.deepcopy(certificate) + changed["batches"][0]["event_ids"].pop() + controls.append((changed, "batch cardinality")) + changed = copy.deepcopy(certificate) + changed["batches"][1]["event_ids"][0] = changed["batches"][0]["event_ids"][0] + controls.append((changed, "disjoint event ids")) + changed = copy.deepcopy(certificate) + changed["batches"][0]["gap"] = -1 + controls.append((changed, "gap range")) + table, skeleton, _, _ = windows(events) + changed = copy.deepcopy(certificate) + changed["batches"][0]["event_ids"][0] = skeleton[0] + controls.append((changed, "phase-B rank-one ids")) + changed = copy.deepcopy(certificate) + changed["batches"][0]["event_ids"][0] = next( + i for i, event in enumerate(events) if is_rank_one(event) and event[1] == "A") + controls.append((changed, "phase-B rank-one ids")) + changed = copy.deepcopy(certificate) + first = changed["batches"][0] + illegal = next(g for g in range(len(skeleton) + 1) + if any(not table[i][0] <= g <= table[i][1] for i in first["event_ids"])) + first["gap"] = illegal + controls.append((changed, "legal window")) + changed = copy.deepcopy(certificate) + first_ids = changed["batches"][0]["event_ids"] + same_register = next(i for i in table if i not in first_ids and + table[i][2] == table[first_ids[0]][2]) + first_ids[1] = same_register + controls.append((changed, "distinct destinations")) + for faulty, message in controls: + expect_rejection(events, faulty, message) + check_forbidden_swap(events) + return len(controls) + 1 + + +def check_forbidden_swap(events): + start, stop = phase_span(events) + site = next(i for i in range(start + 1, stop) if is_rank_one(events[i]) and + roles(events[i]).intersection(roles(events[i - 1]))) + order = list(range(len(events))) + order[site - 1], order[site] = order[site], order[site - 1] + try: + check_trace_order(events, order) + except ValueError as error: + require(str(error) == "complete shared-role traces", "wrong swap rejection") + else: + raise ValueError("accepted climb crossing its own preceding operation") + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--check-discovery", action="store_true") + parser.add_argument("--write-certificate", type=Path) + args = parser.parse_args() + programs = load_programs() + if args.write_certificate: + candidate = discover(windows(programs["forward"])[0]) + for events in programs.values(): + check_orientation(events, candidate) + with args.write_certificate.open("x", encoding="utf-8") as stream: + stream.write(json.dumps(candidate, indent=2) + "\n") + certificate = json.loads(bounded_read(HERE / "CERTIFICATE.json", 64 * 1024)) + if args.check_discovery: + require(discover(windows(programs["forward"])[0]) == certificate, + "deterministic discovery equality") + summaries = {} + controls = 0 + for orientation, events in sorted(programs.items()): + summaries[orientation] = check_orientation(events, certificate) + controls += negative_controls(events, certificate) + receipt = { + "status": "PASS_PHASE_B_54_BATCHES", "claim_type": "finite_certificate", + "orientations": summaries, "rejected_controls": controls, + "archive_sha256": ARCHIVE_SHA, "member_sha256": MEMBER_SHA, + "package_sha256": {name: digest(bounded_read(HERE / name, 512 * 1024)) + for name in PACKAGE_FILES}, + } + print(json.dumps(receipt, indent=2, sort_keys=True)) + + +if __name__ == "__main__": + main()