From 9a3ebd6265106602002cf5e3154e5aa04d5548de Mon Sep 17 00:00:00 2001 From: ross Date: Wed, 14 Oct 2026 04:38:42 +1100 Subject: [PATCH 1/5] Add exact cached XOR permutation replay for bounded cube screens --- .github/workflows/cube-xor-replay.yml | 27 + research/cube-xor-replay/BENCHMARK.json | 51 + research/cube-xor-replay/CLAIM.json | 30 + research/cube-xor-replay/EXPECTED-T6.json | 3102 +++++++++++++++++++++ research/cube-xor-replay/README.md | 193 ++ research/cube-xor-replay/SOURCES.json | 165 ++ research/cube-xor-replay/benchmark.py | 66 + research/cube-xor-replay/cached_xor.py | 35 + research/cube-xor-replay/replay.py | 111 + research/cube-xor-replay/test_replay.py | 217 ++ research/cube-xor-replay/verify.py | 31 + 11 files changed, 4028 insertions(+) create mode 100644 .github/workflows/cube-xor-replay.yml create mode 100644 research/cube-xor-replay/BENCHMARK.json create mode 100644 research/cube-xor-replay/CLAIM.json create mode 100644 research/cube-xor-replay/EXPECTED-T6.json create mode 100644 research/cube-xor-replay/README.md create mode 100644 research/cube-xor-replay/SOURCES.json create mode 100644 research/cube-xor-replay/benchmark.py create mode 100644 research/cube-xor-replay/cached_xor.py create mode 100644 research/cube-xor-replay/replay.py create mode 100644 research/cube-xor-replay/test_replay.py create mode 100644 research/cube-xor-replay/verify.py diff --git a/.github/workflows/cube-xor-replay.yml b/.github/workflows/cube-xor-replay.yml new file mode 100644 index 0000000000..ce2123103a --- /dev/null +++ b/.github/workflows/cube-xor-replay.yml @@ -0,0 +1,27 @@ +name: Exact cached cube XOR replay +on: + workflow_dispatch: + pull_request: + paths: + - 'research/cube-xor-replay/**' + - '.github/workflows/cube-xor-replay.yml' + push: + branches: [main] + paths: + - 'research/cube-xor-replay/**' + - '.github/workflows/cube-xor-replay.yml' +permissions: + contents: read +jobs: + exact: + runs-on: ubuntu-24.04 + timeout-minutes: 15 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 + with: + persist-credentials: false + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 + with: + python-version: '3.12' + - name: Every scheduled row and complete receipts + run: python -I -O -B research/cube-xor-replay/verify.py diff --git a/research/cube-xor-replay/BENCHMARK.json b/research/cube-xor-replay/BENCHMARK.json new file mode 100644 index 0000000000..ff234fcd63 --- /dev/null +++ b/research/cube-xor-replay/BENCHMARK.json @@ -0,0 +1,51 @@ +{ + "case": "t6", + "fresh_process_each_sample": true, + "measured_utc": "2026-10-13T17:38:00.253806+00:00", + "median_seconds": { + "cached": 18.35716083389707, + "original": 87.66262483294122 + }, + "platform": "macOS-26.5.2-arm64-arm-64bit-Mach-O", + "python": "3.14.6 (main, Jun 10 2026, 10:03:53) [Clang 21.0.0 (clang-2100.0.123.102)]", + "samples": [ + { + "backend": "original", + "pair": 0, + "receipt_sha256": "1c790023631dc5390ed599f499b0d660d5099ee20427aadb894087163dba9186", + "seconds": 87.68134720891248 + }, + { + "backend": "cached", + "pair": 0, + "receipt_sha256": "1c790023631dc5390ed599f499b0d660d5099ee20427aadb894087163dba9186", + "seconds": 18.35716083389707 + }, + { + "backend": "cached", + "pair": 1, + "receipt_sha256": "1c790023631dc5390ed599f499b0d660d5099ee20427aadb894087163dba9186", + "seconds": 18.350820249994285 + }, + { + "backend": "original", + "pair": 1, + "receipt_sha256": "1c790023631dc5390ed599f499b0d660d5099ee20427aadb894087163dba9186", + "seconds": 87.66262483294122 + }, + { + "backend": "original", + "pair": 2, + "receipt_sha256": "1c790023631dc5390ed599f499b0d660d5099ee20427aadb894087163dba9186", + "seconds": 87.64076658303384 + }, + { + "backend": "cached", + "pair": 2, + "receipt_sha256": "1c790023631dc5390ed599f499b0d660d5099ee20427aadb894087163dba9186", + "seconds": 18.381115874974057 + } + ], + "scope": "Wall time includes imports, all source checks, base generation, every scheduled row, ordered elimination, complete receipt check and write; mask cache starts empty each sample. No concurrent replay launched by this harness.", + "speedup": 4.775391228858738 +} diff --git a/research/cube-xor-replay/CLAIM.json b/research/cube-xor-replay/CLAIM.json new file mode 100644 index 0000000000..a28a6a2d9f --- /dev/null +++ b/research/cube-xor-replay/CLAIM.json @@ -0,0 +1,30 @@ +{ + "status": "claimed locally; no pinned sprint coordination issue", + "track": "verification engineering", + "assignment_seed": 94, + "randomness": "Python secrets.randbelow(100), operating-system randomness", + "base_commit": "2921874911956718fcaaaf9396fe8267b3cfa9f0", + "started_utc": "2026-10-13T17:24:36Z", + "claimed_utc": "2026-10-13T17:28:07.922857Z", + "expected_finish_utc": "2026-10-13T17:56:36Z", + "verification_reserved_from_utc": "2026-10-13T17:48:36Z", + "candidates": [ + { + "object": "historical block-label atanh interval evaluation", + "decision": "Not chosen: PR667 already supplies the same integer-Horner mechanism." + }, + { + "object": "quadratic-code XOR row permutations in scripts/experiments/cube_core_family.py", + "decision": "Chosen: eliminate repeated mask construction while preserving every generated row and ordered elimination. Largest admitted t=6, default 4096-row cap; t=3,4,5 full historical certificate as regressions." + }, + { + "object": "historical additive-label modular elimination", + "decision": "Not chosen: small workload and adjacent modular-rank tooling PR976; prefer a distinct kernel." + } + ], + "method": "Precompute immutable exact adjacent-block swap masks per replay; compare complete original and accelerated receipts and every generated row. Alternating same-input fresh-process benchmarks. No result caching or row omission.", + "expected_deliverable": "One opt-in source-pinned replay adapter, exact-equivalence argument, reproducible before/after benchmark and corruption controls; no kappa or new impossibility claim.", + "overlap_checked": "757 open PRs through #1060; exact xor_permute search empty; cube_core search only broad encoding PR946. PR752 quadratic-affine dot-product packing, PR898 Leech minors, PR667 logarithms and PR976 joint-frame rank concern different kernels.", + "negative_results": "Historical cube note excludes specified full-support quadratic cores t=3,4,5, not all supported matrices/subcodes. This does not rerun discovery or claim t=6 exclusion.", + "attribution": "Ross Richardson with substantial OpenAI Codex assistance; original cube audit by Douglas R. Colkitt. Apache-2.0." +} diff --git a/research/cube-xor-replay/EXPECTED-T6.json b/research/cube-xor-replay/EXPECTED-T6.json new file mode 100644 index 0000000000..78a4883e3e --- /dev/null +++ b/research/cube-xor-replay/EXPECTED-T6.json @@ -0,0 +1,3102 @@ +{ + "base_sha256": "d827dc1177f1fb5ad20593cc2615777a4919cf634a06ede0ec85bb672c3855a3", + "binary_rank_lower_bound": 3088, + "independent_row_indices": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 56, + 57, + 58, + 60, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 96, + 97, + 98, + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 120, + 121, + 122, + 124, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135, + 136, + 137, + 138, + 139, + 140, + 141, + 142, + 143, + 144, + 145, + 146, + 147, + 148, + 149, + 150, + 151, + 152, + 153, + 154, + 155, + 156, + 157, + 158, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 174, + 176, + 177, + 178, + 179, + 180, + 181, + 182, + 184, + 185, + 186, + 188, + 192, + 193, + 194, + 195, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 210, + 211, + 212, + 213, + 214, + 215, + 216, + 217, + 218, + 219, + 220, + 221, + 222, + 224, + 225, + 226, + 227, + 228, + 229, + 230, + 231, + 232, + 233, + 234, + 235, + 236, + 237, + 238, + 240, + 241, + 242, + 243, + 244, + 245, + 246, + 248, + 249, + 250, + 252, + 256, + 257, + 258, + 259, + 260, + 261, + 262, + 263, + 264, + 265, + 266, + 267, + 268, + 269, + 270, + 271, + 272, + 273, + 274, + 275, + 276, + 277, + 278, + 279, + 280, + 281, + 282, + 283, + 284, + 285, + 286, + 288, + 289, + 290, + 291, + 292, + 293, + 294, + 295, + 296, + 297, + 298, + 299, + 300, + 301, + 302, + 304, + 305, + 306, + 307, + 308, + 309, + 310, + 312, + 313, + 314, + 316, + 320, + 321, + 322, + 323, + 324, + 325, + 326, + 327, + 328, + 329, + 330, + 331, + 332, + 333, + 334, + 335, + 336, + 337, + 338, + 339, + 340, + 341, + 342, + 343, + 344, + 345, + 346, + 347, + 348, + 349, + 350, + 352, + 353, + 354, + 355, + 356, + 357, + 358, + 359, + 360, + 361, + 362, + 363, + 364, + 365, + 366, + 368, + 369, + 370, + 371, + 372, + 373, + 374, + 376, + 377, + 378, + 380, + 384, + 385, + 386, + 387, + 388, + 389, + 390, + 391, + 392, + 393, + 394, + 395, + 396, + 397, + 398, + 399, + 400, + 401, + 402, + 403, + 404, + 405, + 406, + 407, + 408, + 409, + 410, + 411, + 412, + 413, + 414, + 416, + 417, + 418, + 419, + 420, + 421, + 422, + 423, + 424, + 425, + 426, + 427, + 428, + 429, + 430, + 432, + 433, + 434, + 435, + 436, + 437, + 438, + 440, + 441, + 442, + 444, + 448, + 449, + 450, + 451, + 452, + 453, + 454, + 455, + 456, + 457, + 458, + 459, + 460, + 461, + 462, + 463, + 464, + 465, + 466, + 467, + 468, + 469, + 470, + 471, + 472, + 473, + 474, + 475, + 476, + 477, + 478, + 480, + 481, + 482, + 483, + 484, + 485, + 486, + 487, + 488, + 489, + 490, + 491, + 492, + 493, + 494, + 496, + 497, + 498, + 499, + 500, + 501, + 502, + 504, + 505, + 506, + 508, + 512, + 513, + 514, + 515, + 516, + 517, + 518, + 519, + 520, + 521, + 522, + 523, + 524, + 525, + 526, + 527, + 528, + 529, + 530, + 531, + 532, + 533, + 534, + 535, + 536, + 537, + 538, + 539, + 540, + 541, + 542, + 544, + 545, + 546, + 547, + 548, + 549, + 550, + 551, + 552, + 553, + 554, + 555, + 556, + 557, + 558, + 560, + 561, + 562, + 563, + 564, + 565, + 566, + 568, + 569, + 570, + 572, + 576, + 577, + 578, + 579, + 580, + 581, + 582, + 583, + 584, + 585, + 586, + 587, + 588, + 589, + 590, + 591, + 592, + 593, + 594, + 595, + 596, + 597, + 598, + 599, + 600, + 601, + 602, + 603, + 604, + 605, + 606, + 608, + 609, + 610, + 611, + 612, + 613, + 614, + 615, + 616, + 617, + 618, + 619, + 620, + 621, + 622, + 624, + 625, + 626, + 627, + 628, + 629, + 630, + 632, + 633, + 634, + 636, + 640, + 641, + 642, + 643, + 644, + 645, + 646, + 647, + 648, + 649, + 650, + 651, + 652, + 653, + 654, + 655, + 656, + 657, + 658, + 659, + 660, + 661, + 662, + 663, + 664, + 665, + 666, + 667, + 668, + 669, + 670, + 672, + 673, + 674, + 675, + 676, + 677, + 678, + 679, + 680, + 681, + 682, + 683, + 684, + 685, + 686, + 688, + 689, + 690, + 691, + 692, + 693, + 694, + 696, + 697, + 698, + 700, + 704, + 705, + 706, + 707, + 708, + 709, + 710, + 711, + 712, + 713, + 714, + 715, + 716, + 717, + 718, + 720, + 721, + 722, + 723, + 724, + 725, + 726, + 727, + 728, + 729, + 730, + 731, + 732, + 733, + 734, + 736, + 737, + 738, + 739, + 740, + 741, + 742, + 743, + 744, + 745, + 746, + 747, + 748, + 749, + 750, + 752, + 753, + 754, + 755, + 756, + 757, + 758, + 760, + 761, + 762, + 764, + 768, + 769, + 770, + 771, + 772, + 773, + 774, + 775, + 776, + 777, + 778, + 779, + 780, + 781, + 782, + 783, + 784, + 785, + 786, + 787, + 788, + 789, + 790, + 791, + 792, + 793, + 794, + 795, + 796, + 797, + 798, + 800, + 801, + 802, + 803, + 804, + 805, + 806, + 807, + 808, + 809, + 810, + 811, + 812, + 813, + 814, + 816, + 817, + 818, + 819, + 820, + 821, + 822, + 824, + 825, + 826, + 828, + 832, + 833, + 834, + 835, + 836, + 837, + 838, + 840, + 841, + 842, + 843, + 844, + 845, + 846, + 848, + 849, + 850, + 851, + 852, + 853, + 854, + 856, + 857, + 858, + 859, + 860, + 861, + 862, + 864, + 865, + 866, + 867, + 868, + 869, + 870, + 872, + 873, + 874, + 875, + 876, + 877, + 878, + 880, + 881, + 882, + 883, + 884, + 885, + 886, + 888, + 889, + 890, + 892, + 896, + 897, + 898, + 900, + 901, + 902, + 904, + 905, + 906, + 908, + 909, + 910, + 912, + 913, + 914, + 916, + 917, + 918, + 920, + 921, + 922, + 924, + 925, + 926, + 928, + 929, + 930, + 932, + 933, + 934, + 936, + 937, + 938, + 940, + 941, + 942, + 944, + 945, + 946, + 948, + 949, + 950, + 952, + 953, + 954, + 956, + 960, + 962, + 964, + 966, + 968, + 970, + 972, + 974, + 976, + 978, + 980, + 982, + 984, + 986, + 988, + 992, + 994, + 996, + 998, + 1000, + 1002, + 1004, + 1008, + 1010, + 1012, + 1016, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1040, + 1041, + 1042, + 1043, + 1044, + 1045, + 1046, + 1047, + 1048, + 1049, + 1050, + 1051, + 1052, + 1053, + 1054, + 1056, + 1057, + 1058, + 1059, + 1060, + 1061, + 1062, + 1063, + 1064, + 1065, + 1066, + 1067, + 1068, + 1069, + 1070, + 1072, + 1073, + 1074, + 1075, + 1076, + 1077, + 1078, + 1080, + 1081, + 1082, + 1084, + 1088, + 1089, + 1090, + 1091, + 1092, + 1093, + 1094, + 1095, + 1096, + 1097, + 1098, + 1099, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1107, + 1108, + 1109, + 1110, + 1111, + 1112, + 1113, + 1114, + 1115, + 1116, + 1117, + 1118, + 1120, + 1121, + 1122, + 1123, + 1124, + 1125, + 1126, + 1127, + 1128, + 1129, + 1130, + 1131, + 1132, + 1133, + 1134, + 1136, + 1137, + 1138, + 1139, + 1140, + 1141, + 1142, + 1144, + 1145, + 1146, + 1148, + 1152, + 1153, + 1154, + 1155, + 1156, + 1157, + 1158, + 1159, + 1160, + 1161, + 1162, + 1163, + 1164, + 1165, + 1166, + 1167, + 1168, + 1169, + 1170, + 1171, + 1172, + 1173, + 1174, + 1175, + 1176, + 1177, + 1178, + 1179, + 1180, + 1181, + 1182, + 1184, + 1185, + 1186, + 1187, + 1188, + 1189, + 1190, + 1191, + 1192, + 1193, + 1194, + 1195, + 1196, + 1197, + 1198, + 1200, + 1201, + 1202, + 1203, + 1204, + 1205, + 1206, + 1208, + 1209, + 1210, + 1212, + 1216, + 1217, + 1218, + 1219, + 1220, + 1221, + 1222, + 1223, + 1224, + 1225, + 1226, + 1227, + 1228, + 1229, + 1230, + 1232, + 1233, + 1234, + 1235, + 1236, + 1237, + 1238, + 1240, + 1241, + 1242, + 1244, + 1246, + 1248, + 1249, + 1250, + 1251, + 1252, + 1253, + 1254, + 1255, + 1256, + 1257, + 1258, + 1259, + 1260, + 1261, + 1262, + 1264, + 1265, + 1266, + 1267, + 1268, + 1269, + 1270, + 1272, + 1273, + 1274, + 1276, + 1280, + 1281, + 1282, + 1283, + 1284, + 1285, + 1286, + 1287, + 1288, + 1289, + 1290, + 1291, + 1292, + 1293, + 1294, + 1295, + 1296, + 1297, + 1298, + 1299, + 1300, + 1301, + 1302, + 1303, + 1304, + 1305, + 1306, + 1307, + 1308, + 1309, + 1310, + 1312, + 1313, + 1314, + 1315, + 1316, + 1317, + 1318, + 1319, + 1320, + 1321, + 1322, + 1323, + 1324, + 1325, + 1326, + 1328, + 1329, + 1330, + 1331, + 1332, + 1333, + 1334, + 1336, + 1337, + 1338, + 1340, + 1344, + 1345, + 1346, + 1347, + 1348, + 1349, + 1350, + 1352, + 1353, + 1354, + 1355, + 1356, + 1357, + 1358, + 1360, + 1361, + 1362, + 1363, + 1364, + 1365, + 1366, + 1368, + 1369, + 1370, + 1372, + 1374, + 1376, + 1377, + 1378, + 1379, + 1380, + 1381, + 1382, + 1384, + 1385, + 1386, + 1387, + 1388, + 1389, + 1390, + 1392, + 1393, + 1394, + 1395, + 1396, + 1397, + 1398, + 1400, + 1401, + 1402, + 1404, + 1408, + 1409, + 1410, + 1412, + 1413, + 1414, + 1416, + 1417, + 1418, + 1420, + 1421, + 1422, + 1424, + 1425, + 1426, + 1428, + 1429, + 1430, + 1432, + 1433, + 1434, + 1436, + 1438, + 1440, + 1441, + 1442, + 1444, + 1445, + 1446, + 1448, + 1449, + 1450, + 1452, + 1453, + 1454, + 1456, + 1457, + 1458, + 1460, + 1461, + 1462, + 1464, + 1465, + 1466, + 1468, + 1472, + 1474, + 1476, + 1478, + 1480, + 1482, + 1484, + 1486, + 1488, + 1490, + 1492, + 1494, + 1496, + 1498, + 1500, + 1504, + 1506, + 1508, + 1510, + 1512, + 1514, + 1516, + 1520, + 1522, + 1524, + 1528, + 1536, + 1537, + 1538, + 1539, + 1540, + 1541, + 1542, + 1543, + 1544, + 1545, + 1546, + 1547, + 1548, + 1549, + 1550, + 1552, + 1553, + 1554, + 1555, + 1556, + 1557, + 1558, + 1559, + 1560, + 1561, + 1562, + 1563, + 1564, + 1565, + 1566, + 1568, + 1569, + 1570, + 1571, + 1572, + 1573, + 1574, + 1575, + 1576, + 1577, + 1578, + 1579, + 1580, + 1581, + 1582, + 1584, + 1585, + 1586, + 1587, + 1588, + 1589, + 1590, + 1592, + 1593, + 1594, + 1596, + 1600, + 1601, + 1602, + 1603, + 1604, + 1605, + 1606, + 1608, + 1609, + 1610, + 1612, + 1614, + 1616, + 1617, + 1618, + 1619, + 1620, + 1621, + 1622, + 1624, + 1625, + 1626, + 1628, + 1630, + 1632, + 1633, + 1634, + 1635, + 1636, + 1637, + 1638, + 1640, + 1641, + 1642, + 1644, + 1646, + 1648, + 1649, + 1650, + 1651, + 1652, + 1653, + 1654, + 1656, + 1657, + 1658, + 1660, + 1664, + 1665, + 1666, + 1668, + 1669, + 1670, + 1672, + 1673, + 1674, + 1676, + 1678, + 1680, + 1681, + 1682, + 1684, + 1685, + 1686, + 1688, + 1689, + 1690, + 1692, + 1694, + 1696, + 1697, + 1698, + 1700, + 1701, + 1702, + 1704, + 1705, + 1706, + 1708, + 1710, + 1712, + 1713, + 1714, + 1716, + 1717, + 1718, + 1720, + 1721, + 1722, + 1724, + 1728, + 1730, + 1732, + 1734, + 1736, + 1738, + 1740, + 1742, + 1744, + 1746, + 1748, + 1750, + 1752, + 1754, + 1756, + 1760, + 1762, + 1764, + 1766, + 1768, + 1770, + 1772, + 1776, + 1778, + 1780, + 1784, + 1792, + 1793, + 1794, + 1796, + 1798, + 1800, + 1801, + 1802, + 1804, + 1806, + 1808, + 1809, + 1810, + 1812, + 1814, + 1816, + 1817, + 1818, + 1820, + 1822, + 1824, + 1825, + 1826, + 1828, + 1830, + 1832, + 1833, + 1834, + 1836, + 1838, + 1840, + 1841, + 1842, + 1844, + 1846, + 1848, + 1849, + 1850, + 1852, + 1856, + 1858, + 1860, + 1862, + 1864, + 1866, + 1868, + 1870, + 1872, + 1874, + 1876, + 1878, + 1880, + 1882, + 1884, + 1888, + 1890, + 1892, + 1894, + 1896, + 1898, + 1900, + 1904, + 1906, + 1908, + 1912, + 1920, + 1922, + 1924, + 1926, + 1928, + 1930, + 1932, + 1934, + 1936, + 1938, + 1940, + 1942, + 1944, + 1946, + 1948, + 1952, + 1954, + 1956, + 1958, + 1960, + 1962, + 1964, + 1968, + 1970, + 1972, + 1976, + 1984, + 1986, + 1988, + 1990, + 1992, + 1994, + 1996, + 2000, + 2002, + 2004, + 2008, + 2016, + 2018, + 2020, + 2024, + 2032, + 2048, + 2049, + 2050, + 2051, + 2052, + 2053, + 2054, + 2055, + 2056, + 2057, + 2058, + 2059, + 2060, + 2061, + 2062, + 2063, + 2064, + 2065, + 2066, + 2067, + 2068, + 2069, + 2070, + 2071, + 2072, + 2073, + 2074, + 2075, + 2076, + 2077, + 2078, + 2080, + 2081, + 2082, + 2083, + 2084, + 2085, + 2086, + 2087, + 2088, + 2089, + 2090, + 2091, + 2092, + 2093, + 2094, + 2096, + 2097, + 2098, + 2099, + 2100, + 2101, + 2102, + 2104, + 2105, + 2106, + 2108, + 2112, + 2113, + 2114, + 2115, + 2116, + 2117, + 2118, + 2119, + 2120, + 2121, + 2122, + 2123, + 2124, + 2125, + 2126, + 2127, + 2128, + 2129, + 2130, + 2131, + 2132, + 2133, + 2134, + 2135, + 2136, + 2137, + 2138, + 2139, + 2140, + 2141, + 2142, + 2144, + 2145, + 2146, + 2147, + 2148, + 2149, + 2150, + 2151, + 2152, + 2153, + 2154, + 2155, + 2156, + 2157, + 2158, + 2160, + 2161, + 2162, + 2163, + 2164, + 2165, + 2166, + 2168, + 2169, + 2170, + 2172, + 2176, + 2177, + 2178, + 2179, + 2180, + 2181, + 2182, + 2183, + 2184, + 2185, + 2186, + 2187, + 2188, + 2189, + 2190, + 2191, + 2192, + 2193, + 2194, + 2195, + 2196, + 2197, + 2198, + 2199, + 2200, + 2201, + 2202, + 2203, + 2204, + 2205, + 2206, + 2208, + 2209, + 2210, + 2211, + 2212, + 2213, + 2214, + 2215, + 2216, + 2217, + 2218, + 2219, + 2220, + 2221, + 2222, + 2224, + 2225, + 2226, + 2227, + 2228, + 2229, + 2230, + 2232, + 2233, + 2234, + 2236, + 2240, + 2241, + 2242, + 2243, + 2244, + 2245, + 2246, + 2247, + 2248, + 2249, + 2250, + 2251, + 2252, + 2253, + 2254, + 2255, + 2256, + 2257, + 2258, + 2259, + 2260, + 2261, + 2262, + 2263, + 2264, + 2265, + 2266, + 2267, + 2268, + 2269, + 2270, + 2272, + 2273, + 2274, + 2275, + 2276, + 2277, + 2278, + 2279, + 2280, + 2281, + 2282, + 2283, + 2284, + 2285, + 2286, + 2288, + 2289, + 2290, + 2291, + 2292, + 2293, + 2294, + 2296, + 2297, + 2298, + 2300, + 2304, + 2305, + 2306, + 2307, + 2308, + 2309, + 2310, + 2311, + 2312, + 2313, + 2314, + 2315, + 2316, + 2317, + 2318, + 2319, + 2320, + 2321, + 2322, + 2323, + 2324, + 2325, + 2326, + 2327, + 2328, + 2329, + 2330, + 2331, + 2332, + 2333, + 2334, + 2336, + 2337, + 2338, + 2339, + 2340, + 2341, + 2342, + 2343, + 2344, + 2345, + 2346, + 2347, + 2348, + 2349, + 2350, + 2352, + 2353, + 2354, + 2355, + 2356, + 2357, + 2358, + 2360, + 2361, + 2362, + 2364, + 2368, + 2369, + 2370, + 2371, + 2372, + 2373, + 2374, + 2375, + 2376, + 2377, + 2378, + 2379, + 2380, + 2381, + 2382, + 2383, + 2384, + 2385, + 2386, + 2387, + 2388, + 2389, + 2390, + 2391, + 2392, + 2393, + 2394, + 2395, + 2396, + 2397, + 2398, + 2400, + 2401, + 2402, + 2403, + 2404, + 2405, + 2406, + 2407, + 2408, + 2409, + 2410, + 2411, + 2412, + 2413, + 2414, + 2416, + 2417, + 2418, + 2419, + 2420, + 2421, + 2422, + 2424, + 2425, + 2426, + 2428, + 2432, + 2433, + 2434, + 2435, + 2436, + 2437, + 2438, + 2439, + 2440, + 2441, + 2442, + 2443, + 2444, + 2445, + 2446, + 2447, + 2448, + 2449, + 2450, + 2451, + 2452, + 2453, + 2454, + 2455, + 2456, + 2457, + 2458, + 2459, + 2460, + 2461, + 2462, + 2464, + 2465, + 2466, + 2467, + 2468, + 2469, + 2470, + 2471, + 2472, + 2473, + 2474, + 2475, + 2476, + 2477, + 2478, + 2480, + 2481, + 2482, + 2483, + 2484, + 2485, + 2486, + 2488, + 2489, + 2490, + 2492, + 2496, + 2497, + 2498, + 2499, + 2500, + 2501, + 2502, + 2503, + 2504, + 2505, + 2506, + 2507, + 2508, + 2509, + 2510, + 2511, + 2512, + 2513, + 2514, + 2515, + 2516, + 2517, + 2518, + 2519, + 2520, + 2521, + 2522, + 2523, + 2524, + 2525, + 2526, + 2528, + 2529, + 2530, + 2531, + 2532, + 2533, + 2534, + 2535, + 2536, + 2537, + 2538, + 2539, + 2540, + 2541, + 2542, + 2544, + 2545, + 2546, + 2547, + 2548, + 2549, + 2550, + 2552, + 2553, + 2554, + 2556, + 2560, + 2561, + 2562, + 2563, + 2564, + 2565, + 2566, + 2567, + 2568, + 2569, + 2570, + 2571, + 2572, + 2573, + 2574, + 2575, + 2576, + 2577, + 2578, + 2579, + 2580, + 2581, + 2582, + 2583, + 2584, + 2585, + 2586, + 2587, + 2588, + 2589, + 2590, + 2592, + 2593, + 2594, + 2595, + 2596, + 2597, + 2598, + 2599, + 2600, + 2601, + 2602, + 2603, + 2604, + 2605, + 2606, + 2608, + 2609, + 2610, + 2611, + 2612, + 2613, + 2614, + 2616, + 2617, + 2618, + 2620, + 2624, + 2625, + 2626, + 2627, + 2628, + 2629, + 2630, + 2631, + 2632, + 2633, + 2634, + 2635, + 2636, + 2637, + 2638, + 2639, + 2640, + 2641, + 2642, + 2643, + 2644, + 2645, + 2646, + 2647, + 2648, + 2649, + 2650, + 2651, + 2652, + 2653, + 2654, + 2656, + 2657, + 2658, + 2659, + 2660, + 2661, + 2662, + 2663, + 2664, + 2665, + 2666, + 2667, + 2668, + 2669, + 2670, + 2672, + 2673, + 2674, + 2675, + 2676, + 2677, + 2678, + 2680, + 2681, + 2682, + 2684, + 2688, + 2689, + 2690, + 2691, + 2692, + 2693, + 2694, + 2695, + 2696, + 2697, + 2698, + 2699, + 2700, + 2701, + 2702, + 2703, + 2704, + 2705, + 2706, + 2707, + 2708, + 2709, + 2710, + 2711, + 2712, + 2713, + 2714, + 2715, + 2716, + 2717, + 2718, + 2720, + 2721, + 2722, + 2723, + 2724, + 2725, + 2726, + 2727, + 2728, + 2729, + 2730, + 2731, + 2732, + 2733, + 2734, + 2736, + 2737, + 2738, + 2739, + 2740, + 2741, + 2742, + 2744, + 2745, + 2746, + 2748, + 2752, + 2753, + 2754, + 2755, + 2756, + 2757, + 2758, + 2759, + 2760, + 2761, + 2762, + 2763, + 2764, + 2765, + 2766, + 2768, + 2769, + 2770, + 2771, + 2772, + 2773, + 2774, + 2775, + 2776, + 2777, + 2778, + 2779, + 2780, + 2781, + 2782, + 2784, + 2785, + 2786, + 2787, + 2788, + 2789, + 2790, + 2791, + 2792, + 2793, + 2794, + 2795, + 2796, + 2797, + 2798, + 2800, + 2801, + 2802, + 2803, + 2804, + 2805, + 2806, + 2808, + 2809, + 2810, + 2812, + 2816, + 2817, + 2818, + 2819, + 2820, + 2821, + 2822, + 2823, + 2824, + 2825, + 2826, + 2827, + 2828, + 2829, + 2830, + 2831, + 2832, + 2833, + 2834, + 2835, + 2836, + 2837, + 2838, + 2839, + 2840, + 2841, + 2842, + 2843, + 2844, + 2845, + 2846, + 2848, + 2849, + 2850, + 2851, + 2852, + 2853, + 2854, + 2855, + 2856, + 2857, + 2858, + 2859, + 2860, + 2861, + 2862, + 2864, + 2865, + 2866, + 2867, + 2868, + 2869, + 2870, + 2872, + 2873, + 2874, + 2876, + 2880, + 2881, + 2882, + 2883, + 2884, + 2885, + 2886, + 2888, + 2889, + 2890, + 2891, + 2892, + 2893, + 2894, + 2896, + 2897, + 2898, + 2899, + 2900, + 2901, + 2902, + 2904, + 2905, + 2906, + 2908, + 2909, + 2910, + 2912, + 2913, + 2914, + 2915, + 2916, + 2917, + 2918, + 2920, + 2921, + 2922, + 2923, + 2924, + 2925, + 2926, + 2928, + 2929, + 2930, + 2931, + 2932, + 2933, + 2934, + 2936, + 2937, + 2938, + 2940, + 2944, + 2945, + 2946, + 2948, + 2949, + 2950, + 2952, + 2953, + 2954, + 2956, + 2957, + 2958, + 2960, + 2961, + 2962, + 2964, + 2965, + 2966, + 2968, + 2969, + 2970, + 2972, + 2974, + 2976, + 2977, + 2978, + 2980, + 2981, + 2982, + 2984, + 2985, + 2986, + 2988, + 2989, + 2990, + 2992, + 2993, + 2994, + 2996, + 2997, + 2998, + 3000, + 3001, + 3002, + 3004, + 3008, + 3010, + 3012, + 3014, + 3016, + 3018, + 3020, + 3022, + 3024, + 3026, + 3028, + 3030, + 3032, + 3034, + 3036, + 3040, + 3042, + 3044, + 3046, + 3048, + 3050, + 3052, + 3056, + 3058, + 3060, + 3064, + 3072, + 3073, + 3074, + 3075, + 3076, + 3077, + 3078, + 3079, + 3080, + 3081, + 3082, + 3083, + 3084, + 3085, + 3086, + 3087, + 3088, + 3089, + 3090, + 3091, + 3092, + 3093, + 3094, + 3095, + 3096, + 3097, + 3098, + 3099, + 3100, + 3101, + 3102, + 3104, + 3105, + 3106, + 3107, + 3108, + 3109, + 3110, + 3111, + 3112, + 3113, + 3114, + 3115, + 3116, + 3117, + 3118, + 3120, + 3121, + 3122, + 3123, + 3124, + 3125, + 3126, + 3128, + 3129, + 3130, + 3132, + 3136, + 3137, + 3138, + 3139, + 3140, + 3141, + 3142, + 3143, + 3144, + 3145, + 3146, + 3147, + 3148, + 3149, + 3150, + 3151, + 3152, + 3153, + 3154, + 3155, + 3156, + 3157, + 3158, + 3159, + 3160, + 3161, + 3162, + 3163, + 3164, + 3165, + 3166, + 3168, + 3169, + 3170, + 3171, + 3172, + 3173, + 3174, + 3175, + 3176, + 3177, + 3178, + 3179, + 3180, + 3181, + 3182, + 3184, + 3185, + 3186, + 3187, + 3188, + 3189, + 3190, + 3192, + 3193, + 3194, + 3196, + 3200, + 3201, + 3202, + 3203, + 3204, + 3205, + 3206, + 3207, + 3208, + 3209, + 3210, + 3211, + 3212, + 3213, + 3214, + 3215, + 3216, + 3217, + 3218, + 3219, + 3220, + 3221, + 3222, + 3223, + 3224, + 3225, + 3226, + 3227, + 3228, + 3229, + 3230, + 3232, + 3233, + 3234, + 3235, + 3236, + 3237, + 3238, + 3239, + 3240, + 3241, + 3242, + 3243, + 3244, + 3245, + 3246, + 3248, + 3249, + 3250, + 3251, + 3252, + 3253, + 3254, + 3256, + 3257, + 3258, + 3260, + 3264, + 3265, + 3266, + 3267, + 3268, + 3269, + 3270, + 3271, + 3272, + 3273, + 3274, + 3275, + 3276, + 3277, + 3278, + 3280, + 3281, + 3282, + 3283, + 3284, + 3285, + 3286, + 3288, + 3289, + 3290, + 3292, + 3294, + 3296, + 3297, + 3298, + 3299, + 3300, + 3301, + 3302, + 3303, + 3304, + 3305, + 3306, + 3307, + 3308, + 3309, + 3310, + 3312, + 3313, + 3314, + 3315, + 3316, + 3317, + 3318, + 3320, + 3321, + 3322, + 3324, + 3328, + 3329, + 3330, + 3331, + 3332, + 3333, + 3334, + 3335, + 3336, + 3337, + 3338, + 3339, + 3340, + 3341, + 3342, + 3343, + 3344, + 3345, + 3346, + 3347, + 3348, + 3349, + 3350, + 3351, + 3352, + 3353, + 3354, + 3355, + 3356, + 3357, + 3358, + 3360, + 3361, + 3362, + 3363, + 3364, + 3365, + 3366, + 3367, + 3368, + 3369, + 3370, + 3371, + 3372, + 3373, + 3374, + 3376, + 3377, + 3378, + 3379, + 3380, + 3381, + 3382, + 3384, + 3385, + 3386, + 3388, + 3392, + 3393, + 3394, + 3395, + 3396, + 3397, + 3398, + 3400, + 3401, + 3402, + 3403, + 3404, + 3405, + 3406, + 3408, + 3409, + 3410, + 3411, + 3412, + 3413, + 3414, + 3416, + 3417, + 3418, + 3420, + 3422, + 3424, + 3425, + 3426, + 3427, + 3428, + 3429, + 3430, + 3432, + 3433, + 3434, + 3436, + 3437, + 3438, + 3440, + 3441, + 3442, + 3443, + 3444, + 3445, + 3446, + 3448, + 3449, + 3450, + 3452, + 3456, + 3457, + 3458, + 3460, + 3461, + 3462, + 3464, + 3465, + 3466, + 3468, + 3469, + 3470, + 3472, + 3473, + 3474, + 3476, + 3477, + 3478, + 3480, + 3481, + 3482, + 3484, + 3486, + 3488, + 3489, + 3490, + 3492, + 3493, + 3494, + 3496, + 3497, + 3498, + 3500, + 3502, + 3504, + 3505, + 3506, + 3508, + 3509, + 3510, + 3512, + 3513, + 3514, + 3516, + 3520, + 3522, + 3524, + 3526, + 3528, + 3530, + 3532, + 3534, + 3536, + 3538, + 3540, + 3542, + 3544, + 3546, + 3548, + 3552, + 3554, + 3556, + 3558, + 3560, + 3562, + 3564, + 3568, + 3570, + 3572, + 3576, + 3584, + 3585, + 3586, + 3587, + 3588, + 3589, + 3590, + 3591, + 3592, + 3593, + 3594, + 3595, + 3596, + 3597, + 3598, + 3600, + 3601, + 3602, + 3603, + 3604, + 3605, + 3606, + 3607, + 3608, + 3609, + 3610, + 3611, + 3612, + 3613, + 3614, + 3616, + 3617, + 3618, + 3619, + 3620, + 3621, + 3622, + 3623, + 3624, + 3625, + 3626, + 3627, + 3628, + 3629, + 3630, + 3632, + 3633, + 3634, + 3635, + 3636, + 3637, + 3638, + 3640, + 3641, + 3642, + 3644, + 3648, + 3649, + 3650, + 3651, + 3652, + 3653, + 3654, + 3656, + 3657, + 3658, + 3660, + 3662, + 3664, + 3665, + 3666, + 3667, + 3668, + 3669, + 3670, + 3672, + 3673, + 3674, + 3676, + 3678, + 3680, + 3681, + 3682, + 3683, + 3684, + 3685, + 3686, + 3688, + 3689, + 3690, + 3692, + 3694, + 3696, + 3697, + 3698, + 3700, + 3701, + 3702, + 3704, + 3705, + 3706, + 3708, + 3712, + 3713, + 3714, + 3716, + 3717, + 3718, + 3720, + 3721, + 3722, + 3724, + 3726, + 3728, + 3729, + 3730, + 3732, + 3733, + 3734, + 3736, + 3737, + 3738, + 3740, + 3742, + 3744, + 3745, + 3746, + 3748, + 3749, + 3750, + 3752, + 3753, + 3754, + 3756, + 3758, + 3760, + 3761, + 3762, + 3764, + 3766, + 3768, + 3769, + 3770, + 3772, + 3776, + 3778, + 3780, + 3782, + 3784, + 3786, + 3788, + 3790, + 3792, + 3794, + 3796, + 3798, + 3800, + 3802, + 3804, + 3808, + 3810, + 3812, + 3814, + 3816, + 3818, + 3820, + 3824, + 3826, + 3828, + 3832, + 3840, + 3841, + 3842, + 3844, + 3846, + 3848, + 3849, + 3850, + 3852, + 3854, + 3856, + 3857, + 3858, + 3860, + 3862, + 3864, + 3865, + 3866, + 3868, + 3870, + 3872, + 3873, + 3874, + 3876, + 3878, + 3880, + 3881, + 3882, + 3884, + 3886, + 3888, + 3889, + 3890, + 3892, + 3894, + 3896, + 3897, + 3898, + 3900, + 3904, + 3906, + 3908, + 3910, + 3912, + 3914, + 3916, + 3918, + 3920, + 3922, + 3924, + 3926, + 3928, + 3930, + 3932, + 3936, + 3938, + 3940, + 3942, + 3944, + 3946, + 3948, + 3952, + 3954, + 3956, + 3960, + 3968, + 3970, + 3972, + 3974, + 3976, + 3978, + 3980, + 3982, + 3984, + 3986, + 3988, + 3990, + 3992, + 3994, + 3996, + 4000, + 4002, + 4004, + 4006, + 4008, + 4010, + 4012, + 4016, + 4018, + 4020, + 4024, + 4032, + 4034, + 4036, + 4038, + 4040, + 4042, + 4044, + 4048, + 4050, + 4052, + 4056, + 4064, + 4066, + 4068, + 4072, + 4080 + ], + "independent_row_sha256": "97651a704aa273443d6f3168a93b57de2e70a551ed4de487db7c2d42c4f43c8d", + "maximum_rows": 4096, + "n": 2097152, + "rational_dimension": 64, + "rows_checked": 4096, + "scope": "Only C=I plus every orthogonality edge on the specified quadratic code. No exclusion of other supported binary matrices or subcodes.", + "specified_core_positive_deficit_excluded": false, + "t": 6 +} diff --git a/research/cube-xor-replay/README.md b/research/cube-xor-replay/README.md new file mode 100644 index 0000000000..a332a4eb28 --- /dev/null +++ b/research/cube-xor-replay/README.md @@ -0,0 +1,193 @@ +# Exact cached XOR permutations for quadratic-code replay + +**Tooling improvement; no new kappa or impossibility result.** This opt-in +adapter makes the existing bounded quadratic-code rank screen cheaper by +constructing each permutation mask once per replay. It preserves the complete +original receipt, all scheduled rows, ordered binary elimination, witness +indices and hashes, and the existing stopping rule. Original generators, +certificates, source pins, `upstream/`, and the selected frontier are untouched. + +The target is the largest input already admitted by +`scripts/experiments/cube_core_family.py`: `quadratic_rank_screen(6)` with its +unchanged default `maximum_rows=4096`. This is a verification workload, not a +new search for a construction. The historical integrated audit uses only +`t=3,4,5`; its entire certificate is also reproduced byte for byte. + +## Reproduce + +Python **3.10+**, standard library only, from a full repository checkout: + +```sh +python3 -I -O -B research/cube-xor-replay/verify.py +``` + +Expected final marker: + +```text +PASS_CUBE_XOR_VERIFICATION rows=4324 coefficients=8596927616 t6_rank=3088 t6_excluded=false +``` + +The default verification compares every row generated by the retained and +cached implementations, including rows that elimination finds dependent. +It reconstructs the complete historical certificate, the full bounded `t=6` +receipt, and runs the local controls. The original implementation is deliberately +included here, so this differential verification is slower than an accelerated +replay alone. Neither command expands the entire square matrix. + +For the accelerated replay, with all original rank checks and a frozen complete +receipt comparison: + +```sh +python3 -I -B research/cube-xor-replay/replay.py --case t6 +python3 -I -O -B research/cube-xor-replay/test_replay.py +``` + +Expected replay receipt SHA256: +`1c790023631dc5390ed599f499b0d660d5099ee20427aadb894087163dba9186`. +The `--backend original` option runs the unmodified source. Optional +`--output PATH` creates a new file only after validation and refuses to replace +an existing file. No tracked artifact is regenerated by default. + +## Equivalence argument + +Let the row contain `n=2^k` bits, indexed by `j=0,...,n-1`. For one set bit +`b` of the XOR index, write `s=2^b`. The retained mask is + +```text +M(n,s) = ((2^n - 1) / (2^(2s) - 1)) * (2^s - 1). +``` + +Since `2s` divides `n`, the quotient is the exact finite geometric sum +`sum(2^(2s*r), r=0,...,n/(2s)-1)`. Multiplication by `2^s-1` selects precisely +the low `s` positions of every `2s`-bit block, with no carries between blocks. +Thus + +```text +((bits & M) << s) | ((bits >> s) & M) +``` + +swaps the two halves of every block. Their destinations are disjoint, so the +OR is exact. The position map is `j -> j xor 2^b`. Composing these swaps in +the original increasing-bit order gives `j -> j xor index`. For `index=0` +(including `n=1`) the empty composition returns the row unchanged. + +`CachedXorPermuter` uses **the identical integer mask expression** and stores +only its value under `(n,s)`. The mask depends on neither the row nor any rank +decision. The original input guard still runs on every call, including warm +cache hits. The replay creates a new cache for each invocation and restores +the source module's function in a `finally` block. No source file is edited. +The adapter is intended for its standalone process; its temporary module-level +substitution is not a concurrent/thread-safe public API. + +For the measured workload only 12 masks are needed, at most about 3 MiB of +integer payload beyond the original rows and pivot basis. The cache is discarded +after the replay. The implementation does not cache rows, eliminate fewer rows, +change a rank method, or substitute a probabilistic equality test. + +This algebraic identity supplies the equivalence argument for the valid +permutation domain. Finite differential tests corroborate its implementation; +they are not a formal proof of the multiplication theorem. + +## Coverage and limits + +The original `t=6` result is: + +| Field | Value | +| --- | ---: | +| Code coefficient dimension | 21 | +| Columns / labels | 2,097,152 | +| Rational label dimension | 64 | +| Scheduled and checked rows | 4,096 | +| Certified binary rank lower bound | 3,088 | +| Rank needed to exclude positive deficit | 5,462 | +| Positive deficit excluded | **false** | + +Every one of its **8,589,934,592** binary coefficient positions is covered by +direct equality of the 4,096 complete packed rows. Historical screens add 228 +complete rows / 6,993,024 coefficients. The row cap itself is below the exclusion +threshold at `t=6`; this run makes no new rejection claim, no exact full-rank +claim, and no claim about other supported matrices or subcodes. + +The complete `EXPECTED-T6.json` was produced by the unmodified source before +the adapter's first large replay. Its base-row and independent-row-stream +digests are, respectively: + +```text +d827dc1177f1fb5ad20593cc2615777a4919cf634a06ede0ec85bb672c3855a3 +97651a704aa273443d6f3168a93b57de2e70a551ed4de487db7c2d42c4f43c8d +``` + +Controls cover all 2,122 small `(row,index)` combinations for `n=1,2,4,8`, +all 21,760 basis/index pairs for `n=16,32,64,128`, seeded dense rows, involution +and composition, high coordinates through `n=2^21`, mixed-width cache keys, +invalid input before and after cache warming, incomplete screens, and source/ +fixture/manifest corruption. A common column permutation preserves every rank +but changes the witness hash; full receipt comparison rejects it. A dropped +row and a corrupt cached mask are also detected. Replays work under `-O` and +from an offline minimal checkout in a path containing spaces. + +This package does not accelerate the selected U8/T37 supplier replay, change +the historical negative results, certify new physical/compiler interfaces, or +discharge any all-size, hosting, precision/tape, bit-interface or analytic +assumptions. No full `make verify`, native cold replay, Lean, or multiplication +runtime improvement is claimed. + +## Benchmark + +Three alternating fresh-process pairs on macOS arm64 / CPython 3.14.6 gave: + +| Complete bounded `t=6` replay | Median wall time | +| --- | ---: | +| Original | 87.6626 s | +| Cached masks | 18.3572 s | +| Speedup | **4.7754x** | + +All six complete receipts are byte-identical. This measures the named bounded +rank replay, not the historical default audit or the selected frontier. + +```sh +python3 -I -B research/cube-xor-replay/benchmark.py \ + --case t6 --pairs 3 --output /tmp/cube-xor-benchmark.json +``` + +Use a new output path. Each of the six samples starts a fresh process and an +empty mask cache, regenerates the same base, processes the same 4,096 rows, +performs unchanged ordered elimination, and checks and writes the complete +receipt. The order alternates by pair. The harness compares full output bytes +after every sample and launches no overlapping replay. Wall time includes +imports, source checks, computation, receipt validation and output. Background +system load and interpreter/hardware differences can affect the measurements. +`BENCHMARK.json` records all samples and environment; the preliminary probe +(87.561 s original, 18.39 s cached) is excluded from those samples. + +## Pins, coordination and credit + +Exact research base: `2921874911956718fcaaaf9396fe8267b3cfa9f0`. +Submission refresh: `abdc6a7002abdbcd9e21bfc5e1a795784deacfdf`; all 38 pinned +Git blobs and the selected frontier are unchanged at that refresh. +Historical cube source: `d55bcd62ceb8f322bcf311a5a66e94c3ac7724f0`. +Retained upstream: `adc7f1241b42e322a6451854ab7e4b4c146bf78a`. +`SOURCES.json` pins 38 existing files by SHA256 and Git blob, including the +complete local import closure, original certificate and upstream content read +by the audit. Its digest is checked before importing original code. The new +`t=6` fixture is separately pinned there. The selected conditional frontier at +the research base is PR942's `1661960547713947/10^18`; it is context only. + +The OS assignment seed is **94**, verification-engineering track. `CLAIM.json` +records three candidates, rejected overlap, bounded scope and timing. No pinned +sprint coordination issue existed. The seed chooses a different kernel and +determines the small randomized control corpus; the large measured workload +is the unchanged historical default, not a seed-selected easier input. + +Credit **Douglas R. Colkitt** for the original cube family, exact permutation, +rank screen, historical proof note and certificate. Related pending work is +distinct: Tuomo Kiiskinen's PR667 uses integer Horner logarithms; Curtis +Dransfield's PR752 packs quadratic-affine dot products; PR898 packs Leech +minor lanes; PR976 optimizes historical joint-frame rank. PR946's broad encoding +proposal illustrates why this adapter leaves historical source pins intact. +No pending code is imported and no priority claim is made for mask caching. + +Prepared by **Ross Richardson with substantial OpenAI Codex assistance**, which +included implementation, testing, analysis and documentation. No independent +human review is claimed. Apache-2.0 under the repository [LICENSE](../../LICENSE); +inherited upstream notices are unchanged. diff --git a/research/cube-xor-replay/SOURCES.json b/research/cube-xor-replay/SOURCES.json new file mode 100644 index 0000000000..0871a94a32 --- /dev/null +++ b/research/cube-xor-replay/SOURCES.json @@ -0,0 +1,165 @@ +{ + "base_commit": "2921874911956718fcaaaf9396fe8267b3cfa9f0", + "files": { + "certificates/cube-core-family.json": { + "git_blob": "2e78dffcd381968341172601c7c85a651538863e", + "sha256": "8ad9595c400048dacf294a5fac41d86bde98ab8b7fd9fb0221fd6e74c0513ce2" + }, + "docs/research/cube-core-family.md": { + "git_blob": "f95aa1af51a060261b6e2b72c65d7ecbb73eff7a", + "sha256": "f16140c5ad963d7d3ca8f95a9b54d3d5b0e9da577091862522cd6176cd2da7bb" + }, + "scripts/audit_cancellation.py": { + "git_blob": "bc3900f5903337d91a94f28d51429754c4c4b417", + "sha256": "508934ee4d9514a5519813603b6192a0d53103b6e30d65b8d53a1a774de244b6" + }, + "scripts/audit_cube_cores.py": { + "git_blob": "c3a92b6616566b26c1fd477c48793d3064988d17", + "sha256": "eaf815316abe1a55b43a62e71252243562486248f3275f4a28ee286a34c5cb07" + }, + "scripts/audit_fused_block.py": { + "git_blob": "c63869d22c6454cf6989bb6e70d41f0571eef985", + "sha256": "2afb83ca8e5f193ca8a4c242becf267ad1d9dc2578ba238b820e98d5185f6288" + }, + "scripts/audit_joint_frames.py": { + "git_blob": "913be4a1f0a651f3aaf7b4ed1901916918ba2cef", + "sha256": "3df8061392ce0ba42bbde8c02f2a30c8141145e70e9a48c18da73d3aafb14423" + }, + "scripts/certify.py": { + "git_blob": "a773311b726fd1ef98a056f6f76010e872d7908a", + "sha256": "2348d95008276c5d5764f7e028c3918e484582cd589bd4d9b82919161745e53e" + }, + "scripts/exclusion_circuit.py": { + "git_blob": "aaa99986c4b81c5d4fbe016fd216a4818940bb95", + "sha256": "b253f9d7318becda1c1f3b24e2287ed44a9c27fcea00cf9d531afb950d0457a0" + }, + "scripts/experiments/cube_core_family.py": { + "git_blob": "16f4d56790b2c5f710497b086a8bc8d48057d366", + "sha256": "e58f1f4067bda2d4838343f42ec2505316f006561f0702e869847d88b85413a8" + }, + "scripts/experiments/rank_product_core.py": { + "git_blob": "e5c093f467aa1edf1fea0e058ccc88806fbc09a1", + "sha256": "7a91c1188c5d42e864a5d2e42397b09c435b526ae4f4210c44bf615de488708e" + }, + "scripts/paired_exclusion_circuit.py": { + "git_blob": "36d1fa2c0235b9b307243a8735e38a3fbf957113", + "sha256": "8f05f04cf06217befd6d0ee0f2d7d0c5c5eb32cfab8c9a8ca7917fd6d620b7d2" + }, + "scripts/paired_network.py": { + "git_blob": "910449dd510c89ca24aa56904d225b86abfb3be7", + "sha256": "991223dc3c1374284c361ed017e42bf732dd971fa0bea2be2282cfb18257b3f7" + }, + "scripts/prepare_layers.py": { + "git_blob": "8e17b52f9573135426d7ba6865c8c9bc8da8639a", + "sha256": "a6e2adc612f264b1c0e51d18ce6315de9ae5e2ae2420aa22e99a22d8bf304947" + }, + "scripts/rational_tensor.py": { + "git_blob": "383bad4ac7546877717fce402fbb3650f8cfd796", + "sha256": "629b3f00a1aaab32fe908a73ca8f8412918209a300e6b1e5afe6325b9cfed3c3" + }, + "scripts/search_network.py": { + "git_blob": "f03d5c1b2c81afd6c2f1d3ba9e17d4e7bcd31b9b", + "sha256": "3a4faa5037d9b8e7ca5828afac193a96b6966a8b114f14937921795b24ec4f6a" + }, + "scripts/shared_point_circuit.py": { + "git_blob": "8347a0bda63fbfb51b86c6c6d10a7bf541816308", + "sha256": "c9bb7a5df92d260a4e3ad532b53e26936730d7c93f7facfb0784957c1e81c8ba" + }, + "scripts/shared_point_network.py": { + "git_blob": "0ec7e75046fe714968c49178cd7f83e80e9f9d94", + "sha256": "a85e7f0d8c42d6a27e3846308571ca324a1824ac5c2d59e4daa5c7673c33c697" + }, + "tests/test_cube_core_family.py": { + "git_blob": "f26644f70008e927aa3f880907e469c3f04ce418", + "sha256": "0132d3e29d9352cb9fe7e870c5cca14167cfd2ca87b92b8bfef48a3a8f8130d2" + }, + "upstream/LICENSE": { + "git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + }, + "upstream/README.md": { + "git_blob": "c8cb3c3857907bf3465017b9f7ef1add4df5c29b", + "sha256": "8d1ceff898a4e0e681679f91c4def485820be9e99f04e4861f2ce601a364723e" + }, + "upstream/build/figures/multiplication-flow.tex": { + "git_blob": "f0297c9cb841ad74a7cee4b541e302073d913236", + "sha256": "3654d2728b0c98919d61760e1802804ed616546a747f9167a93e17bb8697f320" + }, + "upstream/build/figures/proof-map.tex": { + "git_blob": "a2d539e5a794eb8d679c6cad68c6b8d12b0fc880", + "sha256": "76d4deacf07bea355412abcfd798c7cbe6dcccef29a4a420a9e2a7b158f23848" + }, + "upstream/build/main.tex": { + "git_blob": "0b11a3feb14714253c1ca06ee561a31dd2fe8662", + "sha256": "42f0f506976bc2084374a71e97edc1549689a7accf35dda4db2a18af4f13c1aa" + }, + "upstream/build/references.bib": { + "git_blob": "bf01cae12597f2777199c8ee74ee9f6933a1b56e", + "sha256": "33cc2df13ccf85330849e8fb34d4ac7613b23f625787457a5b7b9aa6d7369476" + }, + "upstream/build/sections/00-introduction.tex": { + "git_blob": "aa9048eef857c3e694989f5bb5020109e6422502", + "sha256": "98721f03682ccf1cc7d0850b07adabaa2d8f3afe552e3861753eba9d284d0da0" + }, + "upstream/build/sections/01-history.tex": { + "git_blob": "7c6f033138f97315c80e64afb6cc446a1d590538", + "sha256": "798956c8150c31e3e2f5f29c47110d25ce619faad1374f4d3a0f15fa3ee33ead" + }, + "upstream/build/sections/02-streams.tex": { + "git_blob": "088fceea1867abc76271d7efe7532b779fee9039", + "sha256": "606c80db61cad13aa0c3b6060dc4b88dbbe7ac60cdd831aa93f28d908fd09dab" + }, + "upstream/build/sections/03-motifs.tex": { + "git_blob": "cdb0ba527aa8df5d57c151183fd3893c1a7e21ab", + "sha256": "ed76761194988a01af77ead0ea6469cb5dcd29690ab985a0b5a4006b0f2b69bb" + }, + "upstream/build/sections/04-swap.tex": { + "git_blob": "951e792b1768e6509561380b8bbfb1d1ccb64c08", + "sha256": "412b170ccaab38dba96e95e3cbfae09f4876a9818f8d278776a746b0f8044906" + }, + "upstream/build/sections/05-layers.tex": { + "git_blob": "5ce8b3c83c455f221bb84858a97230b0285644aa", + "sha256": "20cfc8d12099d4e4ed9e3e7eeb6162edd9b6e0e076f24693364cd24377252594" + }, + "upstream/build/sections/06-transforms.tex": { + "git_blob": "de073e9292d58573f7065a3cd4f214e0d05f3444", + "sha256": "924316e4bc905066281d8f9e8746a49d8829aeb393688608deb1e61c3c87853c" + }, + "upstream/build/sections/07-resampling.tex": { + "git_blob": "256243bf9416baefb82bf9203f80215b9ebe28f2", + "sha256": "8a6b91670f9163afb54892489fa2210c77fe1b058f0325ec7d18b44b94be6e2c" + }, + "upstream/build/sections/08-assembly.tex": { + "git_blob": "337810a1d9a58a2ecf14123420923c039ba322a6", + "sha256": "763d7945b1e1ec4ebae9b799bcefcc45fa9bae6e2ffad799868a9c3d513dbd4a" + }, + "upstream/build/sections/09-exact-arithmetic.tex": { + "git_blob": "4c7a1d63c912d081f70f5b166e9cab92d7774ee6", + "sha256": "5714e5d0656c78c6a1fde8d01fd11f1ba856a7ea94149b283bd9a50fdbf516c3" + }, + "upstream/build/sections/10-transposition.tex": { + "git_blob": "e69cc8276220edb8617a371ae9044a911fbc0767", + "sha256": "c14ad8d56112f6578678a58211bc8d63c3a4b60e55078ac73bc38f7348e713cb" + }, + "upstream/build/sections/11-grouped-rectangles.tex": { + "git_blob": "44439c716c6290cd6e512ffac91253443b37d3ab", + "sha256": "6525cd0a01980e56accfeaf06e9d875bc699197ba42c6e22b69435e352275174" + }, + "upstream/formalization.yaml": { + "git_blob": "e0584d4993df01ec08233ab344ebc1b1039bf7f7", + "sha256": "2dcbd0d6e6a22475f53d49bfdfcac9b6d2b470653c332a9f56522f5be166edb9" + }, + "upstream/manifest.json": { + "git_blob": "01c309e34d36cf3669c43d89c5dfb25cdc31b8af", + "sha256": "16ab13971694cabab09440c47ebf2fc0496a9d35fc3af33950fda3498f8e2392" + } + }, + "fixtures": { + "EXPECTED-T6.json": { + "provenance": "Generated by unmodified quadratic_rank_screen(6, maximum_rows=4096) at the exact base; preliminary reference time 87.56125395896379 seconds. Not an exclusion certificate.", + "sha256": "1c790023631dc5390ed599f499b0d660d5099ee20427aadb894087163dba9186" + } + }, + "historical_source_commit": "d55bcd62ceb8f322bcf311a5a66e94c3ac7724f0", + "upstream_commit": "adc7f1241b42e322a6451854ab7e4b4c146bf78a" +} diff --git a/research/cube-xor-replay/benchmark.py b/research/cube-xor-replay/benchmark.py new file mode 100644 index 0000000000..f4269dcf8b --- /dev/null +++ b/research/cube-xor-replay/benchmark.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python3 +"""Alternating fresh-process benchmark with exact receipts on each sample.""" +import argparse +from datetime import datetime, timezone +from hashlib import sha256 +import json +from pathlib import Path +import platform +import statistics +import subprocess +import sys +import tempfile +import time + +HERE = Path(__file__).resolve().parent + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--pairs", type=int, default=3) + parser.add_argument("--case", choices=("historical", "t6"), default="t6") + parser.add_argument("--output", type=Path, required=True) + args = parser.parse_args() + if args.pairs < 3: + parser.error("At least three alternating pairs required") + if args.output.exists(): + parser.error("Output already exists") + samples = [] + expected = None + with tempfile.TemporaryDirectory(prefix="cube-xor-benchmark-") as tmp: + for pair in range(args.pairs): + order = ("original", "cached") if pair % 2 == 0 else ("cached", "original") + for name in order: + output = Path(tmp) / f"{pair}-{name}.json" + command = [sys.executable, "-I", "-B", str(HERE / "replay.py"), + "--case", args.case, "--backend", name, + "--output", str(output)] + start = time.perf_counter() + result = subprocess.run(command, capture_output=True, text=True) + seconds = time.perf_counter() - start + if result.returncode: + raise RuntimeError(result.stderr) + payload = output.read_bytes() + if expected is None: + expected = payload + if payload != expected: + raise ValueError("Benchmark complete receipts differ") + samples.append({"pair": pair, "backend": name, "seconds": seconds, + "receipt_sha256": sha256(payload).hexdigest()}) + print(json.dumps(samples[-1], sort_keys=True), flush=True) + medians = {name: statistics.median(s["seconds"] for s in samples if s["backend"] == name) + for name in ("original", "cached")} + result = {"measured_utc": datetime.now(timezone.utc).isoformat(), + "python": sys.version, "platform": platform.platform(), + "case": args.case, "fresh_process_each_sample": True, + "scope": "Wall time includes imports, all source checks, base generation, every scheduled row, ordered elimination, complete receipt check and write; mask cache starts empty each sample. No concurrent replay launched by this harness.", + "samples": samples, "median_seconds": medians, + "speedup": medians["original"] / medians["cached"]} + with args.output.open("x", encoding="utf-8") as stream: + json.dump(result, stream, indent=2, sort_keys=True) + stream.write("\n") + print("PASS_CUBE_XOR_BENCHMARK " + json.dumps(medians, sort_keys=True), flush=True) + + +if __name__ == "__main__": + main() diff --git a/research/cube-xor-replay/cached_xor.py b/research/cube-xor-replay/cached_xor.py new file mode 100644 index 0000000000..6c99b98e23 --- /dev/null +++ b/research/cube-xor-replay/cached_xor.py @@ -0,0 +1,35 @@ +"""Exact XOR-index permutations, caching geometry rather than input rows. + +Original permutation and cube screen: Douglas R. Colkitt. +Adapter: Ross Richardson, with substantial OpenAI Codex assistance. +Apache-2.0; see the repository LICENSE. +""" + + +class CachedXorPermuter: + """One replay's lazy masks; no row, rank, or admission result is cached.""" + + def __init__(self): + self._masks = {} + + def __call__(self, bits, index, n): + # Keep the original domain check on EVERY call, including warm hits. + if not (type(n) is int and n > 0 and n & (n - 1) == 0 + and type(index) is int and 0 <= index < n + and type(bits) is int and 0 <= bits < 1 << n): + raise ValueError("Invalid packed row or XOR permutation") + b = 0 + while index: + if index & 1: + stride = 1 << b + key = (n, stride) + mask = self._masks.get(key) + if mask is None: + # Exactly the retained finite geometric-series mask. + mask = ((1 << n) - 1) // ((1 << (2 * stride)) - 1) + mask *= (1 << stride) - 1 + self._masks[key] = mask + bits = ((bits & mask) << stride) | ((bits >> stride) & mask) + index >>= 1 + b += 1 + return bits diff --git a/research/cube-xor-replay/replay.py b/research/cube-xor-replay/replay.py new file mode 100644 index 0000000000..15f2b1d399 --- /dev/null +++ b/research/cube-xor-replay/replay.py @@ -0,0 +1,111 @@ +#!/usr/bin/env python3 +"""Opt-in source-bound replay; leave all original generators untouched.""" +import argparse +from contextlib import contextmanager +from hashlib import sha256 +import importlib +import json +from pathlib import Path +import sys + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +MANIFEST_SHA256 = "e2be1e7c88e7a6814ec726bd5cd397af261514edac960d1d8ae6590c39c9e608" +sys.path.insert(0, str(HERE)) +from cached_xor import CachedXorPermuter + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def canonical(value): + return (json.dumps(value, sort_keys=True, indent=2) + "\n").encode("utf-8") + + +def check_sources(): + data = (HERE / "SOURCES.json").read_bytes() + require(sha256(data).hexdigest() == MANIFEST_SHA256, "Source manifest mismatch") + manifest = json.loads(data) + require(manifest["base_commit"] == "2921874911956718fcaaaf9396fe8267b3cfa9f0", + "Unexpected research base") + for relative, record in manifest["files"].items(): + path = (ROOT / relative).resolve() + require(path.is_relative_to(ROOT), "Source escapes repository") + require(sha256(path.read_bytes()).hexdigest() == record["sha256"], + "Source pin mismatch: " + relative) + for relative, record in manifest["fixtures"].items(): + require(sha256((HERE / relative).read_bytes()).hexdigest() == record["sha256"], + "Fixture pin mismatch: " + relative) + return manifest + + +def load_original(): + check_sources() # Reject changed source before importing it. + sys.path.insert(0, str(ROOT / "scripts")) + audit = importlib.import_module("audit_cube_cores") + core = importlib.import_module("experiments.cube_core_family") + return audit, core + + +@contextmanager +def backend(core, name, coverage=None): + original = core.xor_permute + fast = CachedXorPermuter() # Fresh bounded lifetime for each replay. + require(name in ("original", "cached", "differential"), "Unknown backend") + + def differential(bits, index, n): + expected = original(bits, index, n) + actual = fast(bits, index, n) + require(actual == expected, f"Row mismatch: n={n}, index={index}") + if coverage is not None: + coverage["rows"] += 1 + coverage["coefficients"] += n + return actual + + if name != "original": + core.xor_permute = fast if name == "cached" else differential + try: + yield + finally: + core.xor_permute = original + + +def run(case, name, coverage=None): + audit, core = load_original() + with backend(core, name, coverage): + if case == "historical": + value = audit.serializable(audit.certificate()) + expected = ROOT / "certificates/cube-core-family.json" + elif case == "t6": + # Supported historical input and UNCHANGED default stopping rule. + value = core.quadratic_rank_screen(6, maximum_rows=4096) + expected = HERE / "EXPECTED-T6.json" + else: + raise ValueError("Unknown case") + payload = canonical(value) + require(payload == expected.read_bytes(), "Complete receipt mismatch: " + case) + return payload + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--case", choices=("historical", "t6"), default="historical") + parser.add_argument("--backend", choices=("original", "cached", "differential"), + default="cached") + parser.add_argument("--output", type=Path) + args = parser.parse_args() + coverage = {"rows": 0, "coefficients": 0} + payload = run(args.case, args.backend, coverage) + if args.output: + with args.output.open("xb") as stream: + stream.write(payload) + print(f"PASS_CUBE_XOR_REPLAY case={args.case} backend={args.backend} " + f"receipt_sha256={sha256(payload).hexdigest()}") + if args.backend == "differential": + print(json.dumps(coverage, sort_keys=True)) + + +if __name__ == "__main__": + main() diff --git a/research/cube-xor-replay/test_replay.py b/research/cube-xor-replay/test_replay.py new file mode 100644 index 0000000000..74f94acd04 --- /dev/null +++ b/research/cube-xor-replay/test_replay.py @@ -0,0 +1,217 @@ +#!/usr/bin/env python3 +"""Independent permutation checks, mathematical controls, package guards.""" +from pathlib import Path +import random +import shutil +import subprocess +import sys +import tempfile +import unittest +from unittest.mock import patch + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) +import replay +from cached_xor import CachedXorPermuter + + +def bit_loop(bits, index, n): + # Deliberately avoid block masks and shifts of entire blocks. + return sum(1 << (j ^ index) for j in range(n) if bits >> j & 1) + + +class PermutationTests(unittest.TestCase): + def test_exhaustive_small_rows(self): + fast = CachedXorPermuter() + for n in (1, 2, 4, 8): + for bits in range(1 << n): + for index in range(n): + self.assertEqual(fast(bits, index, n), bit_loop(bits, index, n)) + + def test_every_basis_and_index(self): + fast = CachedXorPermuter() + for n in (16, 32, 64, 128): + for bit in range(n): + for index in range(n): + self.assertEqual(fast(1 << bit, index, n), 1 << (bit ^ index)) + + def test_seeded_dense_rows_and_group_law(self): + rng = random.Random(94) + fast = CachedXorPermuter() + for n in (16, 32, 64, 128, 256, 512, 1024, 2048): + for _ in range(12): + bits, i, j = rng.getrandbits(n), rng.randrange(n), rng.randrange(n) + self.assertEqual(fast(bits, i, n), bit_loop(bits, i, n)) + self.assertEqual(fast(fast(bits, i, n), j, n), fast(bits, i ^ j, n)) + self.assertEqual(fast(fast(bits, i, n), i, n), bits) + + def test_high_coordinates_and_mixed_width_cache_keys(self): + fast = CachedXorPermuter() + for n in (1 << 21, 8, 1 << 15, 1 << 21): + for b in range(n.bit_length() - 1): + for j in (0, n // 2 - 1, n // 2, n - 1): + self.assertEqual(fast(1 << j, 1 << b, n), 1 << (j ^ (1 << b))) + # A changed input row at an already used shift must be recomputed. + self.assertEqual(fast(1, 1, 8), 2) + self.assertEqual(fast(128, 1, 8), 64) + + def test_reject_invalid_inputs_on_cold_and_warm_calls(self): + _, core = replay.load_original() + bad = [(0, 0, 0), (0, 0, 3), (0, 0, -2), (0, 0, True), + (0, 0, 8.0), (0, -1, 8), (0, 8, 8), (0, True, 8), + (0, 1.0, 8), (-1, 0, 8), (256, 0, 8), (True, 0, 8), + (1.0, 0, 8)] + for args in bad: + for warmed in (False, True): + fast = CachedXorPermuter() + if warmed: + fast(93, 7, 8) + for fn in (core.xor_permute, fast): + with self.assertRaisesRegex(ValueError, "Invalid packed row"): + fn(*args) + + def test_mutated_mask_detected_even_when_rank_is_preserved(self): + fast = CachedXorPermuter() + fast(1, 1, 8) + fast._masks[(8, 1)] ^= 1 + self.assertNotEqual(fast(1, 1, 8), bit_loop(1, 1, 8)) + # Dropping an index bit is still a permutation, hence preserves rank. + _, core = replay.load_original() + row = core.quadratic_code_base(3)["base"] + self.assertNotEqual(core.xor_permute(row, 1, 64), row) + + def test_no_input_results_are_cached(self): + fast = CachedXorPermuter() + for bits in range(256): + fast(bits, 7, 8) + self.assertEqual(set(fast._masks), {(8, 1), (8, 2), (8, 4)}) + + +class ReplayTests(unittest.TestCase): + def test_complete_historical_receipt_and_row_coverage(self): + coverage = {"rows": 0, "coefficients": 0} + expected = (replay.ROOT / "certificates/cube-core-family.json").read_bytes() + self.assertEqual(replay.run("historical", "original"), expected) + self.assertEqual(replay.run("historical", "cached"), expected) + self.assertEqual(replay.run("historical", "differential", coverage), expected) + self.assertEqual(coverage, {"rows": 228, "coefficients": 6993024}) + + def test_zero_budget_and_incomplete_screen_preserved(self): + _, core = replay.load_original() + with replay.backend(core, "cached"): + with self.assertRaisesRegex(ValueError, "Positive row budget"): + core.quadratic_rank_screen(3, maximum_rows=0) + limited = core.quadratic_rank_screen(5, maximum_rows=1) + self.assertEqual(limited["rows_checked"], 1) + self.assertFalse(limited["specified_core_positive_deficit_excluded"]) + + def test_adapter_restores_original_after_failure(self): + _, core = replay.load_original() + original = core.xor_permute + with self.assertRaisesRegex(RuntimeError, "test failure"): + with replay.backend(core, "cached"): + raise RuntimeError("test failure") + self.assertIs(core.xor_permute, original) + + def test_omitted_shift_is_detected_by_full_replay(self): + # Using j -> j xor (index xor 1) retains every rank by a common + # invertible column permutation, but changes the witness stream. + original = CachedXorPermuter.__call__ + def shifted(self, bits, index, n): + return original(self, bits, index ^ 1, n) + _, core = replay.load_original() + baseline = {t: core.quadratic_rank_screen(t) for t in (3, 4, 5)} + with patch.object(CachedXorPermuter, "__call__", shifted): + with replay.backend(core, "cached"): + for t, before in baseline.items(): + after = core.quadratic_rank_screen(t) + for field in ("binary_rank_lower_bound", "independent_row_indices", + "rows_checked", "specified_core_positive_deficit_excluded"): + self.assertEqual(after[field], before[field]) + self.assertNotEqual(after["independent_row_sha256"], + before["independent_row_sha256"]) + with self.assertRaisesRegex(ValueError, "Complete receipt mismatch"): + replay.run("historical", "cached") + + def test_no_row_can_be_skipped(self): + original = CachedXorPermuter.__call__ + def missing(self, bits, index, n): + return 0 if index == 0 else original(self, bits, index, n) + with patch.object(CachedXorPermuter, "__call__", missing): + with self.assertRaises(ValueError): + replay.run("historical", "cached") + + +class PackageTests(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.temporary = tempfile.TemporaryDirectory(prefix="cube xor minimal ") + cls.root = Path(cls.temporary.name) + manifest = replay.check_sources() + for relative in manifest["files"]: + target = cls.root / relative + target.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(replay.ROOT / relative, target) + cls.package = cls.root / "research/cube-xor-replay" + cls.package.mkdir(parents=True, exist_ok=True) + for path in HERE.iterdir(): + if path.is_file(): + shutil.copyfile(path, cls.package / path.name) + + @classmethod + def tearDownClass(cls): + cls.temporary.cleanup() + + def launch(self, *extra): + return subprocess.run([sys.executable, "-I", "-O", "-B", + str(self.package / "replay.py"), *extra], + cwd=self.root.parent, capture_output=True, text=True) + + def test_offline_relocated_optimized_replay(self): + result = self.launch() + self.assertEqual(result.returncode, 0, result.stderr) + self.assertIn("PASS_CUBE_XOR_REPLAY", result.stdout) + + def test_changed_source_and_expected_certificate_rejected(self): + for relative in ("scripts/experiments/cube_core_family.py", + "certificates/cube-core-family.json", "upstream/README.md"): + path = self.root / relative + original = path.read_bytes() + try: + path.write_bytes(original + b"\n") + result = self.launch() + self.assertNotEqual(result.returncode, 0) + self.assertIn("Source pin mismatch", result.stderr) + self.assertNotIn("PASS_CUBE_XOR_REPLAY", result.stdout) + finally: + path.write_bytes(original) + + def test_existing_output_is_not_overwritten(self): + output = self.root / "already exists.json" + output.write_bytes(b"keep me") + result = self.launch("--output", str(output)) + self.assertNotEqual(result.returncode, 0) + self.assertEqual(output.read_bytes(), b"keep me") + + def test_unknown_backend_rejected(self): + result = self.launch("--backend", "guess") + self.assertNotEqual(result.returncode, 0) + self.assertNotIn("PASS_CUBE_XOR_REPLAY", result.stdout) + + def test_manifest_and_t6_fixture_changes_rejected(self): + for name, message in (("SOURCES.json", "Source manifest mismatch"), + ("EXPECTED-T6.json", "Fixture pin mismatch")): + path = self.package / name + original = path.read_bytes() + try: + path.write_bytes(original + b"\n") + result = self.launch() + self.assertNotEqual(result.returncode, 0) + self.assertIn(message, result.stderr) + self.assertNotIn("PASS_CUBE_XOR_REPLAY", result.stdout) + finally: + path.write_bytes(original) + + +if __name__ == "__main__": + unittest.main() diff --git a/research/cube-xor-replay/verify.py b/research/cube-xor-replay/verify.py new file mode 100644 index 0000000000..afd3560642 --- /dev/null +++ b/research/cube-xor-replay/verify.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 +"""Full bounded row equality plus complete receipts and local controls.""" +import json +from pathlib import Path +import subprocess +import sys + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) +import replay + + +def main(): + coverage = {"rows": 0, "coefficients": 0} + for case in ("historical", "t6"): + value = replay.run(case, "differential", coverage) + print(f"PASS_CUBE_XOR_DIFFERENTIAL case={case}", flush=True) + expected = {"rows": 4324, "coefficients": 8596927616} + replay.require(coverage == expected, "Incomplete differential coverage") + t6 = json.loads(value) + replay.require(t6["binary_rank_lower_bound"] == 3088 + and t6["specified_core_positive_deficit_excluded"] is False, + "Wrong bounded screen result") + subprocess.run([sys.executable, "-I", "-O", "-B", str(HERE / "test_replay.py")], + check=True) + print("PASS_CUBE_XOR_VERIFICATION rows=4324 coefficients=8596927616 " + "t6_rank=3088 t6_excluded=false", flush=True) + + +if __name__ == "__main__": + main() From 7933c097382e8a3d28983be8354fb37763446ada Mon Sep 17 00:00:00 2001 From: ross Date: Wed, 14 Oct 2026 04:42:17 +1100 Subject: [PATCH 2/5] Record complete cube replay validation and measured speedup --- research/cube-xor-replay/README.md | 4 +- research/cube-xor-replay/VALIDATION.json | 70 ++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 research/cube-xor-replay/VALIDATION.json diff --git a/research/cube-xor-replay/README.md b/research/cube-xor-replay/README.md index a332a4eb28..c2596454aa 100644 --- a/research/cube-xor-replay/README.md +++ b/research/cube-xor-replay/README.md @@ -180,12 +180,12 @@ determines the small randomized control corpus; the large measured workload is the unchanged historical default, not a seed-selected easier input. Credit **Douglas R. Colkitt** for the original cube family, exact permutation, -rank screen, historical proof note and certificate. Related pending work is +rank screen, historical proof note and certificate. Related work is distinct: Tuomo Kiiskinen's PR667 uses integer Horner logarithms; Curtis Dransfield's PR752 packs quadratic-affine dot products; PR898 packs Leech minor lanes; PR976 optimizes historical joint-frame rank. PR946's broad encoding proposal illustrates why this adapter leaves historical source pins intact. -No pending code is imported and no priority claim is made for mask caching. +No code from those PRs is imported and no priority claim is made for mask caching. Prepared by **Ross Richardson with substantial OpenAI Codex assistance**, which included implementation, testing, analysis and documentation. No independent diff --git a/research/cube-xor-replay/VALIDATION.json b/research/cube-xor-replay/VALIDATION.json new file mode 100644 index 0000000000..d5fa1aded9 --- /dev/null +++ b/research/cube-xor-replay/VALIDATION.json @@ -0,0 +1,70 @@ +{ + "benchmark": { + "all_six_receipts_identical": true, + "median_seconds": { + "cached": 18.35716083389707, + "original": 87.66262483294122 + }, + "pairs": 3, + "receipt": "BENCHMARK.json", + "speedup": 4.775391228858738 + }, + "checks": [ + { + "command": "python3 -I -O -B research/cube-xor-replay/verify.py", + "result": "PASS_CUBE_XOR_DIFFERENTIAL case=historical\nPASS_CUBE_XOR_DIFFERENTIAL case=t6\n.................\n----------------------------------------------------------------------\nRan 17 tests in 1.358s\n\nOK\nPASS_CUBE_XOR_VERIFICATION rows=4324 coefficients=8596927616 t6_rank=3088 t6_excluded=false" + }, + { + "command": "python3.12 -I -O -B research/cube-xor-replay/replay.py --case t6; python3.12 -I -O -B research/cube-xor-replay/test_replay.py", + "python": "3.12.12", + "result": "PASS_CUBE_XOR_REPLAY case=t6 backend=cached receipt_sha256=1c790023631dc5390ed599f499b0d660d5099ee20427aadb894087163dba9186\n.................\n----------------------------------------------------------------------\nRan 17 tests in 1.051s\n\nOK" + }, + { + "command": "unchanged tests/test_cube_core_family.py loaded inside replay.backend(core, cached)", + "result": "9 tests pass under CPython 3.14.6 -I -O -B; direct imported permutation bound to cached backend" + }, + { + "command": "python3 -I -B scripts/verify_selected_result.py; python3 -B -m unittest discover -s tests -p test_selected_result.py", + "result": "Selected record integrity PASS, unchanged 1661960547713947/10^18; 5 tests pass" + }, + { + "command": "compare all SOURCES.json file Git blobs and SHA256 at submission base", + "result": "38 of 38 exact matches" + }, + { + "command": "git diff --check", + "result": "PASS" + } + ], + "code_sha256": { + "benchmark.py": "57e72922da6893ec89a13c4de6e0a3fd8f5b23b73b27f52a0fda311246d711af", + "cached_xor.py": "fbeba8e3a0a5d7663ce5cf8086a9137853e7adcb6565b780b54765a2f8dd4fd3", + "replay.py": "c45faa8af1bb34574686605b6601760efaec5dbfd622074632e823329037cc19", + "test_replay.py": "49d2bb41ba48e9dfbc626bd35a94644c7be3b7299e13e1cf03d0ad84a31ee9ec", + "verify.py": "c2d9cedb9df1b2fef3dc3fecd3aa429bbc41927fed02e3bc029bd85d1bdf5df5" + }, + "complete_comparison": { + "binary_coefficients": 8596927616, + "historical_rows": 228, + "rows": 4324, + "t6_rows": 4096 + }, + "credit": "Douglas R. Colkitt original cube family/audit; Ross Richardson contribution with substantial OpenAI Codex assistance; Apache-2.0.", + "hosted_ci": "Not claimed; new focused workflow supplied. Check GitHub for current status.", + "implementation_commit": "9a3ebd6265106602002cf5e3154e5aa04d5548de", + "not_run": [ + "full make verify", + "native selected supplier cold replay", + "Lean" + ], + "overlap_refresh": "Open queue through PR1072; exact cached XOR and xor_permute searches empty, cube_core_family search only PR946 broad encoding. All pinned source blobs unchanged on refreshed main.", + "platform": "macOS-26.5.2-arm64-arm-64bit-Mach-O", + "python": "3.14.6 (main, Jun 10 2026, 10:03:53) [Clang 21.0.0 (clang-2100.0.123.102)]", + "recorded_utc": "2026-10-13T17:42:17.712771+00:00", + "research_base": "2921874911956718fcaaaf9396fe8267b3cfa9f0", + "selected_frontier_changed": false, + "status": "PASS scoped exact tooling verification; no new kappa", + "submission_base": "abdc6a7002abdbcd9e21bfc5e1a795784deacfdf", + "upstream_changed": false, + "verification_started_utc": "2026-10-14T04:38:42+11:00" +} From baf686cf93a24e3ee1c3f78e2abc6d595a55f6cd Mon Sep 17 00:00:00 2001 From: ross Date: Wed, 14 Oct 2026 04:43:20 +1100 Subject: [PATCH 3/5] Close local seed94 sprint claim with PR1075 handoff --- research/cube-xor-replay/CLAIM.json | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/research/cube-xor-replay/CLAIM.json b/research/cube-xor-replay/CLAIM.json index a28a6a2d9f..b2c5436b75 100644 --- a/research/cube-xor-replay/CLAIM.json +++ b/research/cube-xor-replay/CLAIM.json @@ -1,5 +1,5 @@ { - "status": "claimed locally; no pinned sprint coordination issue", + "status": "completed; one open tooling-improvement PR submitted for review", "track": "verification engineering", "assignment_seed": 94, "randomness": "Python secrets.randbelow(100), operating-system randomness", @@ -26,5 +26,13 @@ "expected_deliverable": "One opt-in source-pinned replay adapter, exact-equivalence argument, reproducible before/after benchmark and corruption controls; no kappa or new impossibility claim.", "overlap_checked": "757 open PRs through #1060; exact xor_permute search empty; cube_core search only broad encoding PR946. PR752 quadratic-affine dot-product packing, PR898 Leech minors, PR667 logarithms and PR976 joint-frame rank concern different kernels.", "negative_results": "Historical cube note excludes specified full-support quadratic cores t=3,4,5, not all supported matrices/subcodes. This does not rerun discovery or claim t=6 exclusion.", - "attribution": "Ross Richardson with substantial OpenAI Codex assistance; original cube audit by Douglas R. Colkitt. Apache-2.0." + "attribution": "Ross Richardson with substantial OpenAI Codex assistance; original cube audit by Douglas R. Colkitt. Apache-2.0.", + "result_utc": "2026-10-13T17:43:20.653820+00:00", + "pull_request": "https://github.com/CrocSwap/integer-mult-bounds/pull/1075", + "submission_base": "abdc6a7002abdbcd9e21bfc5e1a795784deacfdf", + "verification_started_utc": "2026-10-13T17:38:39Z", + "result": "Exact cached mask replay: median 87.6626 -> 18.3572 seconds (4.7754x), three alternating fresh-process pairs with identical complete receipts. Full differential comparison covers 4324 rows / 8596927616 coefficients. 17 package tests, 9 inherited tests, Python 3.12 replay, 38 source pins and selected integrity pass. t=6 rank lower bound 3088; no exclusion and no new kappa.", + "final_overlap": "Refreshed open queue through PR1072 immediately before submission; exact cached XOR/xor_permute searches empty; cube_core_family search only PR946. No pinned coordination issue still exists.", + "labels": "Neither codex nor codex-automation is available in the repository; no new labels created.", + "remaining": "Independent review and hosted Linux CI. No full repository suite, native cold replay, Lean or all-size/compiler/analytic proof claimed." } From d84d3b950127ff9252e5c059a629bb654500192a Mon Sep 17 00:00:00 2001 From: ross Date: Wed, 14 Oct 2026 04:44:02 +1100 Subject: [PATCH 4/5] Normalize verification start to the recorded UTC commit time --- research/cube-xor-replay/CLAIM.json | 2 +- research/cube-xor-replay/VALIDATION.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/research/cube-xor-replay/CLAIM.json b/research/cube-xor-replay/CLAIM.json index b2c5436b75..2557c69c8d 100644 --- a/research/cube-xor-replay/CLAIM.json +++ b/research/cube-xor-replay/CLAIM.json @@ -30,7 +30,7 @@ "result_utc": "2026-10-13T17:43:20.653820+00:00", "pull_request": "https://github.com/CrocSwap/integer-mult-bounds/pull/1075", "submission_base": "abdc6a7002abdbcd9e21bfc5e1a795784deacfdf", - "verification_started_utc": "2026-10-13T17:38:39Z", + "verification_started_utc": "2026-10-13T17:38:42+00:00", "result": "Exact cached mask replay: median 87.6626 -> 18.3572 seconds (4.7754x), three alternating fresh-process pairs with identical complete receipts. Full differential comparison covers 4324 rows / 8596927616 coefficients. 17 package tests, 9 inherited tests, Python 3.12 replay, 38 source pins and selected integrity pass. t=6 rank lower bound 3088; no exclusion and no new kappa.", "final_overlap": "Refreshed open queue through PR1072 immediately before submission; exact cached XOR/xor_permute searches empty; cube_core_family search only PR946. No pinned coordination issue still exists.", "labels": "Neither codex nor codex-automation is available in the repository; no new labels created.", diff --git a/research/cube-xor-replay/VALIDATION.json b/research/cube-xor-replay/VALIDATION.json index d5fa1aded9..8b33d1c7b7 100644 --- a/research/cube-xor-replay/VALIDATION.json +++ b/research/cube-xor-replay/VALIDATION.json @@ -66,5 +66,5 @@ "status": "PASS scoped exact tooling verification; no new kappa", "submission_base": "abdc6a7002abdbcd9e21bfc5e1a795784deacfdf", "upstream_changed": false, - "verification_started_utc": "2026-10-14T04:38:42+11:00" + "verification_started_utc": "2026-10-13T17:38:42+00:00" } From 4ba229532a76516e5f6f5befc1d6d9dc4834f6f9 Mon Sep 17 00:00:00 2001 From: ross Date: Fri, 16 Oct 2026 18:20:49 +1100 Subject: [PATCH 5/5] Preserve cube replay pins across current-main import updates --- research/cube-xor-replay/COMPATIBILITY.json | 37 ++++++++ research/cube-xor-replay/FOLLOWUP.md | 97 +++++++++++++++++++++ research/cube-xor-replay/README.md | 10 +++ research/cube-xor-replay/replay.py | 20 +++++ research/cube-xor-replay/test_replay.py | 4 + 5 files changed, 168 insertions(+) create mode 100644 research/cube-xor-replay/COMPATIBILITY.json create mode 100644 research/cube-xor-replay/FOLLOWUP.md diff --git a/research/cube-xor-replay/COMPATIBILITY.json b/research/cube-xor-replay/COMPATIBILITY.json new file mode 100644 index 0000000000..7184c174be --- /dev/null +++ b/research/cube-xor-replay/COMPATIBILITY.json @@ -0,0 +1,37 @@ +{ + "files": { + "scripts/audit_fused_block.py": { + "current": { + "git_blob": "41221dadc99d80952a000ab166ed3471df610405", + "sha256": "6fe64f886309d9154e33a3d67a16e8714cebc424a7a248b3080f8cab7d94179b" + }, + "original": { + "git_blob": "c63869d22c6454cf6989bb6e70d41f0571eef985", + "sha256": "2afb83ca8e5f193ca8a4c242becf267ad1d9dc2578ba238b820e98d5185f6288" + } + }, + "scripts/exclusion_circuit.py": { + "current": { + "git_blob": "b0e2f3e03d7de791ca936dfd92cee2134c7dd4f5", + "sha256": "f9fbcd6e85e442cbd0926ac0887414e20735b2dc923d2d5822c803ceb46726d3" + }, + "original": { + "git_blob": "aaa99986c4b81c5d4fbe016fd216a4818940bb95", + "sha256": "b253f9d7318becda1c1f3b24e2287ed44a9c27fcea00cf9d531afb950d0457a0" + } + }, + "scripts/shared_point_circuit.py": { + "current": { + "git_blob": "d0864271884398d44ee1fc70f0d99bb982418156", + "sha256": "360d9bffc0f55315fe294789b72c71c79e0991524555b3a5f42a2ca504d7da95" + }, + "original": { + "git_blob": "8347a0bda63fbfb51b86c6c6d10a7bf541816308", + "sha256": "c9bb7a5df92d260a4e3ad532b53e26936730d7c93f7facfb0784957c1e81c8ba" + } + } + }, + "original_manifest_sha256": "e2be1e7c88e7a6814ec726bd5cd397af261514edac960d1d8ae6590c39c9e608", + "scope": "Three transitive import dependencies changed on canonical main. Their changed methods are not called by the cube replay. Core, row schedule, elimination, certificates, fixture and original source manifest remain frozen.", + "upstream_commit": "ffbd90dd90dbe0055464f3a1411b25a3a4fdc6b8" +} diff --git a/research/cube-xor-replay/FOLLOWUP.md b/research/cube-xor-replay/FOLLOWUP.md new file mode 100644 index 0000000000..69a4491ca9 --- /dev/null +++ b/research/cube-xor-replay/FOLLOWUP.md @@ -0,0 +1,97 @@ +# PR1075 review continuation and current-main compatibility + +The review at `d84d3b950127ff9252e5c059a629bb654500192a` stopped the +complete command at 180 seconds after its historical case passed. The unchanged +reviewed head has now completed both differential cases and all 17 tests on +macOS arm64 / CPython 3.12.12, in 118.575 seconds: + +```text +PASS_CUBE_XOR_DIFFERENTIAL case=historical +PASS_CUBE_XOR_DIFFERENTIAL case=t6 +Ran 17 tests in 1.226s +OK +PASS_CUBE_XOR_VERIFICATION rows=4324 coefficients=8596927616 t6_rank=3088 t6_excluded=false +``` + +Command: `python3.12 -I -O -B research/cube-xor-replay/verify.py`. +The fresh process had no preexisting bytecode caches. The complete local log +SHA256 is `2673a033caa449e61e7013040d09aa3a84db0ddfb74c83ac6a3239c87954de3d`. +This is execution time for differential verification, not a new benchmark of +the accelerated workload. + +The existing [focused Linux CI job](https://github.com/CrocSwap/integer-mult-bounds/actions/runs/38441043779/job/115447388058) +also contains both differential cases, 17 passing tests and the identical final +marker. It used Ubuntu 24.04.5 / CPython 3.12.15 and PR merge ref +`74be1199fb224e0ed24f3a9713e771f976066721`, combining reviewed head +`d84d3b950127ff9252e5c059a629bb654500192a` with then-base +`abdc6a7002abdbcd9e21bfc5e1a795784deacfdf`. This receipt concerns that historical +merge ref; it is separate from CI on the current follow-up head. + +## Compatibility delta + +Canonical main `ffbd90dd90dbe0055464f3a1411b25a3a4fdc6b8` (priority revision 5) +changes three transitively imported files, causing the original source guard +to reject an integration with current main: + +| File | Changed code, outside the cube replay's called path | +| --- | --- | +| `scripts/audit_fused_block.py` | Fraction reuse in `rational_rank` | +| `scripts/exclusion_circuit.py` | Equivalent expected-support masks in circuit verification | +| `scripts/shared_point_circuit.py` | Shared-point circuit construction, support, digest and frame routines | + +`COMPATIBILITY.json` binds each original Git blob/SHA256 to the corresponding +current-main Git blob/SHA256. The replay authenticates both manifests and +requires exactly this three-path allowlist before applying the overrides to +an in-memory copy. The original `SOURCES.json` remains byte-for-byte intact. +No core, certificate, fixture, row generation, elimination, cap or rank decision +is overridden. Changes to any effective source, either manifest or the fixture +still fail closed; the existing relocated package controls exercise those cases. + +A separate AI-assisted source/profile check observed only import/module and +class definitions from these changed files during the complete historical +differential case and a one-row t=6 probe. Their changed functions/methods were +not called. The full differential command below remains the acceptance check +for the integrated snapshot; the cheap profile does not substitute for it. + +```sh +python3.12 -I -O -B research/cube-xor-replay/verify.py +``` + +The expected domain remains 228 historical rows / 6,993,024 coefficients plus +4,096 t=6 rows / 8,589,934,592 coefficients. Every complete packed row is +compared, including dependent rows. Both complete canonical receipts remain +the fixed oracles; rank equality alone is insufficient. + +## Evidence and remaining scope + +Current-head receipts and review handoff are linked from +[PR1075](https://github.com/CrocSwap/integer-mult-bounds/pull/1075) and +[the canonical continuation](https://github.com/CrocSwap/integer-mult-bounds/discussions/2884). +Historical `BENCHMARK.json`, `VALIDATION.json`, `CLAIM.json`, `SOURCES.json` +and `EXPECTED-T6.json` are preserved. Their original-head timing and selected +frontier context are historical, not measurements of this refreshed closure. + +This follow-up establishes finite tooling equivalence. At t=6 the certified +rank lower bound is still 3,088 and positive deficit is not excluded. There is +no new kappa, exact full-rank result, supplier admission, selected-frontier +change, full multiplication theorem, or formal-kernel proof. No new performance +comparison or full selected cold replay is supplied. + +## Open next questions + +The loader uses ordinary Python imports after authenticating source. Reproduce +in a fresh process/checkout without `.pyc` files; `-B` prevents writes but does +not disable cache reads or existing `sys.modules`. A separate source-loader +hardening contribution could compile the authenticated bytes and test poisoned +timestamp/unchecked-hash caches. That broader loader contract is outside this +three-file compatibility refresh. + +Maintainer incorporation and review-ledger reconciliation remain separate from +these author checks. A useful next action is to inspect the linked complete +current-head receipt and decide the stated tooling scope; this note does not +edit the maintainer's historical disposition. + +Original cube family, permutation, rank screen and certificate: Douglas R. +Colkitt. Adapter and follow-up: Ross Richardson with substantial OpenAI Codex +assistance, including a separate AI-assisted mathematical/source audit. No +independent human review is claimed. Apache-2.0; all predecessor notices remain. diff --git a/research/cube-xor-replay/README.md b/research/cube-xor-replay/README.md index c2596454aa..1fb34b299f 100644 --- a/research/cube-xor-replay/README.md +++ b/research/cube-xor-replay/README.md @@ -1,5 +1,11 @@ # Exact cached XOR permutations for quadratic-code replay +The [2026-10-16 review follow-up](FOLLOWUP.md) completes the reviewed-head +verification and records a three-file transitive-import compatibility refresh +against canonical main. Historical source manifests, fixtures and benchmark +receipts below are retained unchanged; the current command additionally +authenticates `COMPATIBILITY.json`. + **Tooling improvement; no new kappa or impossibility result.** This opt-in adapter makes the existing bounded quadratic-code rank screen cheaper by constructing each permutation mask once per replay. It preserves the complete @@ -173,6 +179,10 @@ by the audit. Its digest is checked before importing original code. The new `t=6` fixture is separately pinned there. The selected conditional frontier at the research base is PR942's `1661960547713947/10^18`; it is context only. +The current effective closure overlays exactly three transitive imports with +their separately pinned canonical-main versions; see `FOLLOWUP.md`. The +original `SOURCES.json` and all core/certificate/fixture pins remain unchanged. + The OS assignment seed is **94**, verification-engineering track. `CLAIM.json` records three candidates, rejected overlap, bounded scope and timing. No pinned sprint coordination issue existed. The seed chooses a different kernel and diff --git a/research/cube-xor-replay/replay.py b/research/cube-xor-replay/replay.py index 15f2b1d399..e124ef0f14 100644 --- a/research/cube-xor-replay/replay.py +++ b/research/cube-xor-replay/replay.py @@ -11,6 +11,11 @@ HERE = Path(__file__).resolve().parent ROOT = HERE.parents[1] MANIFEST_SHA256 = "e2be1e7c88e7a6814ec726bd5cd397af261514edac960d1d8ae6590c39c9e608" +COMPATIBILITY_SHA256 = "a5f102c0b90783698d2912fed9ddeb3a6987fd414fb7c7adffbe638cd98bde7a" +COMPATIBILITY_UPSTREAM = "ffbd90dd90dbe0055464f3a1411b25a3a4fdc6b8" +COMPATIBILITY_PATHS = frozenset(("scripts/audit_fused_block.py", + "scripts/exclusion_circuit.py", + "scripts/shared_point_circuit.py")) sys.path.insert(0, str(HERE)) from cached_xor import CachedXorPermuter @@ -30,6 +35,21 @@ def check_sources(): manifest = json.loads(data) require(manifest["base_commit"] == "2921874911956718fcaaaf9396fe8267b3cfa9f0", "Unexpected research base") + # Preserve the original scientific manifest. Only these three transitive + # imports use explicitly reviewed current-main bytes; no core/fixture override. + data = (HERE / "COMPATIBILITY.json").read_bytes() + require(sha256(data).hexdigest() == COMPATIBILITY_SHA256, + "Compatibility manifest mismatch") + compatibility = json.loads(data) + require(compatibility["upstream_commit"] == COMPATIBILITY_UPSTREAM + and compatibility["original_manifest_sha256"] == MANIFEST_SHA256, + "Unexpected compatibility baseline") + require(set(compatibility["files"]) == COMPATIBILITY_PATHS, + "Unexpected compatibility paths") + for relative, record in compatibility["files"].items(): + require(record["original"] == manifest["files"][relative], + "Compatibility predecessor mismatch: " + relative) + manifest["files"][relative] = record["current"] for relative, record in manifest["files"].items(): path = (ROOT / relative).resolve() require(path.is_relative_to(ROOT), "Source escapes repository") diff --git a/research/cube-xor-replay/test_replay.py b/research/cube-xor-replay/test_replay.py index 74f94acd04..f97e7ca1c5 100644 --- a/research/cube-xor-replay/test_replay.py +++ b/research/cube-xor-replay/test_replay.py @@ -174,6 +174,9 @@ def test_offline_relocated_optimized_replay(self): def test_changed_source_and_expected_certificate_rejected(self): for relative in ("scripts/experiments/cube_core_family.py", + "scripts/audit_fused_block.py", + "scripts/exclusion_circuit.py", + "scripts/shared_point_circuit.py", "certificates/cube-core-family.json", "upstream/README.md"): path = self.root / relative original = path.read_bytes() @@ -200,6 +203,7 @@ def test_unknown_backend_rejected(self): def test_manifest_and_t6_fixture_changes_rejected(self): for name, message in (("SOURCES.json", "Source manifest mismatch"), + ("COMPATIBILITY.json", "Compatibility manifest mismatch"), ("EXPECTED-T6.json", "Fixture pin mismatch")): path = self.package / name original = path.read_bytes()