diff --git a/research/scalable-dirty-connectors/CENSUS.json b/research/scalable-dirty-connectors/CENSUS.json new file mode 100644 index 0000000000..71e70ab3b3 --- /dev/null +++ b/research/scalable-dirty-connectors/CENSUS.json @@ -0,0 +1,133 @@ +{ + "claim": "With all B and A child calls fixed at physical z0, six bidirectional root shears do not suffice for the universal five-source paired-readout connector; an explicit eight-shear fixed-port word covers all 31 nonzero masks.", + "model": { + "field": "F2", + "sources": 5, + "source_calls": 10, + "source_calls_per_label": 2, + "readout_labels": 31, + "readout_calls_per_label": 2, + "physical_B_port": "z0 for every call", + "physical_A_port": "z0 for every call", + "dirty_roots": 2, + "root_transfers": [ + "S01: z0 += z1", + "S10: z1 += z0" + ], + "readout_pair_condition": "The two A calls for one output must have the same current dirty-root covector; their source-coefficient difference is the XOR of projected source states at those boundaries." + }, + "six_transfer_census": { + "transfers": 6, + "identity_direction_words": 22, + "transfer_placements_per_direction_word": 8008, + "canonical_source_pairings_per_frame": 945, + "full_schedules": 166486320, + "legal_fixed_port_schedules": 34977960, + "maximum_covered_masks_including_zero": 31, + "universal_schedule_found": false, + "coverage_histogram": { + "8": 3872, + "9": 6800, + "10": 96944, + "11": 147136, + "12": 188768, + "13": 519200, + "14": 680400, + "15": 1081536, + "16": 2488152, + "17": 1994240, + "18": 1653088, + "19": 4298968, + "20": 2104216, + "21": 4848184, + "22": 2417920, + "23": 2271608, + "24": 4468720, + "25": 879248, + "26": 2250328, + "27": 297016, + "28": 1960400, + "29": 71600, + "30": 19280, + "31": 230336 + }, + "best_schedule": { + "directions": [0, 0, 0, 0, 0, 0], + "transfer_slots_zero_based_among_16_events": [0, 1, 2, 3, 4, 5], + "canonical_source_word": [0, 1, 2, 0, 3, 1, 4, 2, 3, 4], + "normalized_source_axes": [1, 1, 1, 1, 1], + "covered_mask_bitset_hex": "ffdfffff", + "missing_mask_decimal": 21 + } + }, + "eight_transfer_positive_control": { + "transfers": 8, + "directions": [1, 1, 0, 0, 1, 1, 0, 0], + "transfer_slots_zero_based_among_18_events": [0, 2, 3, 5, 8, 10, 11, 13], + "event_word": [ + "S10", "B0", "S10", "S01", "B1", "S01", "B2", "B3", + "S10", "B0", "S10", "S01", "B4", "S01", "B3", "B1", + "B4", "B2" + ], + "canonical_source_word": [0, 1, 2, 3, 0, 4, 3, 1, 4, 2], + "normalized_source_axes": [3, 1, 1, 1, 1], + "root_product_identity": true, + "every_source_restored": true, + "readout_pair_count": 31, + "readout_call_count": 62, + "boundary_convention": "Boundary 0 is before the first event; boundary k+1 is after event k.", + "readout_pairs": [ + {"mask": "00001", "boundaries": [0, 2], "row0": "01"}, + {"mask": "00010", "boundaries": [2, 6], "row0": "01"}, + {"mask": "00011", "boundaries": [0, 6], "row0": "01"}, + {"mask": "00100", "boundaries": [0, 17], "row0": "01"}, + {"mask": "00101", "boundaries": [2, 17], "row0": "01"}, + {"mask": "00110", "boundaries": [2, 7], "row0": "01"}, + {"mask": "00111", "boundaries": [0, 7], "row0": "01"}, + {"mask": "01000", "boundaries": [7, 8], "row0": "01"}, + {"mask": "01001", "boundaries": [7, 10], "row0": "01"}, + {"mask": "01010", "boundaries": [10, 17], "row0": "01"}, + {"mask": "01011", "boundaries": [8, 17], "row0": "01"}, + {"mask": "01100", "boundaries": [5, 12], "row0": "11"}, + {"mask": "01101", "boundaries": [6, 10], "row0": "01"}, + {"mask": "01110", "boundaries": [0, 10], "row0": "01"}, + {"mask": "01111", "boundaries": [0, 8], "row0": "01"}, + {"mask": "10000", "boundaries": [10, 14], "row0": "01"}, + {"mask": "10001", "boundaries": [7, 15], "row0": "01"}, + {"mask": "10010", "boundaries": [15, 17], "row0": "01"}, + {"mask": "10011", "boundaries": [7, 16], "row0": "01"}, + {"mask": "10100", "boundaries": [0, 16], "row0": "01"}, + {"mask": "10101", "boundaries": [2, 16], "row0": "01"}, + {"mask": "10110", "boundaries": [0, 15], "row0": "01"}, + {"mask": "10111", "boundaries": [2, 15], "row0": "01"}, + {"mask": "11000", "boundaries": [10, 15], "row0": "01"}, + {"mask": "11001", "boundaries": [7, 14], "row0": "01"}, + {"mask": "11010", "boundaries": [10, 16], "row0": "01"}, + {"mask": "11011", "boundaries": [8, 16], "row0": "01"}, + {"mask": "11100", "boundaries": [5, 13], "row0": "11"}, + {"mask": "11101", "boundaries": [6, 14], "row0": "01"}, + {"mask": "11110", "boundaries": [0, 14], "row0": "01"}, + {"mask": "11111", "boundaries": [2, 14], "row0": "01"} + ], + "engine_control": { + "frame_patterns": 1, + "legal_pairings": 105, + "universal_pairings": 1, + "method": "visit_frame -> pair_calls_by_axis -> evaluate_pair_word -> difference_cover; same engine as six-transfer enumeration", + "exhaustive_eight_transfer_domain": false + }, + "budget": { + "source_calls": 10, + "readout_calls": 62, + "total_child_calls": 72, + "paid_full_row_xors": 8, + "saving_vs_PR1887_pinned_schedule": 2, + "relative_transfer_count_reduction": "20%" + } + }, + "validation": { + "six_transfer_histogram_source": "Completed exact local census with 22 identity direction words, 8,008 transfer placements, and 945 canonical pairings per frame.", + "eight_transfer_source": "Literal witness replay plus the bounded actual census-engine path on its frame; every source/root restores,all31 equal-covector output pairs validate, and the core engine detects1 universal among105 legal pairings.", + "limits": "The eight-transfer search is a positive control, not an exhaustive eight-transfer census. No upstream submission or remote post is included." + } +} diff --git a/research/scalable-dirty-connectors/EXPECTED.json b/research/scalable-dirty-connectors/EXPECTED.json new file mode 100644 index 0000000000..3cd1c7637b --- /dev/null +++ b/research/scalable-dirty-connectors/EXPECTED.json @@ -0,0 +1,1061 @@ +{ + "star": [ + { + "sources": 4, + "roots": 1, + "source_calls": 8, + "readouts": 30, + "transfers": 0, + "instructions": 38, + "source_multiplicities": [ + 2, + 2, + 2, + 2 + ], + "source_ports": [ + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ] + ], + "readout_multiplicity_histogram": { + "2": 15 + }, + "program_sha256": "bdc40946303e36148d688f4e4134d2b77964526ebb2e2dc4008ecd41be19801e" + }, + { + "sources": 5, + "roots": 2, + "source_calls": 10, + "readouts": 62, + "transfers": 8, + "instructions": 80, + "source_multiplicities": [ + 2, + 2, + 2, + 2, + 2 + ], + "source_ports": [ + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 1 + ] + ], + "readout_multiplicity_histogram": { + "2": 31 + }, + "program_sha256": "04e36888712f9cb1b80d34196ed8153a30c92795fb01caedcaf4639e6af4010b" + }, + { + "sources": 6, + "roots": 3, + "source_calls": 12, + "readouts": 126, + "transfers": 24, + "instructions": 162, + "source_multiplicities": [ + 2, + 2, + 2, + 2, + 2, + 2 + ], + "source_ports": [ + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 1 + ], + [ + 2 + ] + ], + "readout_multiplicity_histogram": { + "2": 63 + }, + "program_sha256": "836d70bdb7fa966a02fe44c4dfa13d1199dbd06acf1345d73296fb399c46c994" + }, + { + "sources": 7, + "roots": 4, + "source_calls": 14, + "readouts": 254, + "transfers": 56, + "instructions": 324, + "source_multiplicities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ], + "source_ports": [ + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 1 + ], + [ + 2 + ], + [ + 3 + ] + ], + "readout_multiplicity_histogram": { + "2": 127 + }, + "program_sha256": "6af8b1c177c63f6f3148b814281bdbbfadc097cd9cef85e88d630434df1c3fa8" + }, + { + "sources": 8, + "roots": 5, + "source_calls": 16, + "readouts": 510, + "transfers": 120, + "instructions": 646, + "source_multiplicities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ], + "source_ports": [ + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 1 + ], + [ + 2 + ], + [ + 3 + ], + [ + 4 + ] + ], + "readout_multiplicity_histogram": { + "2": 255 + }, + "program_sha256": "d5383d4b9ae0290b47359fae81112ed01ccac41e38d40ba131bf30d519dd9109" + }, + { + "sources": 9, + "roots": 6, + "source_calls": 18, + "readouts": 1022, + "transfers": 248, + "instructions": 1288, + "source_multiplicities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ], + "source_ports": [ + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 1 + ], + [ + 2 + ], + [ + 3 + ], + [ + 4 + ], + [ + 5 + ] + ], + "readout_multiplicity_histogram": { + "2": 511 + }, + "program_sha256": "cb903e6412c31409a18a5efc1f7770df8d734817d323f3fc0db22ce9942c2016" + }, + { + "sources": 10, + "roots": 7, + "source_calls": 20, + "readouts": 2046, + "transfers": 504, + "instructions": 2570, + "source_multiplicities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ], + "source_ports": [ + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 1 + ], + [ + 2 + ], + [ + 3 + ], + [ + 4 + ], + [ + 5 + ], + [ + 6 + ] + ], + "readout_multiplicity_histogram": { + "2": 1023 + }, + "program_sha256": "3b085e2866e4fcd9b93761ccefa265ad4cac76ed73ee7448cb4442b30f80d90d" + } + ], + "gray": [ + { + "sources": 4, + "roots": 1, + "source_calls": 8, + "readouts": 30, + "transfers": 0, + "instructions": 38, + "source_multiplicities": [ + 2, + 2, + 2, + 2 + ], + "source_ports": [ + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ] + ], + "readout_multiplicity_histogram": { + "2": 15 + }, + "program_sha256": "bdc40946303e36148d688f4e4134d2b77964526ebb2e2dc4008ecd41be19801e" + }, + { + "sources": 5, + "roots": 1, + "source_calls": 12, + "readouts": 62, + "transfers": 0, + "instructions": 74, + "source_multiplicities": [ + 2, + 2, + 4, + 2, + 2 + ], + "source_ports": [ + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ] + ], + "readout_multiplicity_histogram": { + "2": 31 + }, + "program_sha256": "1cf5ded5f8325c9e9448e429d8eb7d9e5a437980ede664bb5d54f93a70401539" + }, + { + "sources": 6, + "roots": 1, + "source_calls": 16, + "readouts": 126, + "transfers": 0, + "instructions": 142, + "source_multiplicities": [ + 4, + 2, + 2, + 4, + 2, + 2 + ], + "source_ports": [ + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ] + ], + "readout_multiplicity_histogram": { + "2": 63 + }, + "program_sha256": "7d843bada128f273f17a4519d648e5149d0158e2f44b1b193da416ad5594f5fe" + }, + { + "sources": 7, + "roots": 1, + "source_calls": 24, + "readouts": 254, + "transfers": 0, + "instructions": 278, + "source_multiplicities": [ + 4, + 2, + 2, + 8, + 4, + 2, + 2 + ], + "source_ports": [ + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ] + ], + "readout_multiplicity_histogram": { + "2": 127 + }, + "program_sha256": "eabaa6bd0c2e9148a5164102d869a4b7b47866468e94654e3ef84008f2251d56" + }, + { + "sources": 8, + "roots": 1, + "source_calls": 32, + "readouts": 510, + "transfers": 0, + "instructions": 542, + "source_multiplicities": [ + 8, + 4, + 2, + 2, + 8, + 4, + 2, + 2 + ], + "source_ports": [ + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ] + ], + "readout_multiplicity_histogram": { + "2": 255 + }, + "program_sha256": "8b8a2b6bdda3bf491cf4f633be9114a381dcd9181ad775fe1655ee7aedabfe82" + }, + { + "sources": 9, + "roots": 1, + "source_calls": 48, + "readouts": 1022, + "transfers": 0, + "instructions": 1070, + "source_multiplicities": [ + 8, + 4, + 2, + 2, + 16, + 8, + 4, + 2, + 2 + ], + "source_ports": [ + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ] + ], + "readout_multiplicity_histogram": { + "2": 511 + }, + "program_sha256": "330bc30a2ae9c743107cd0e91da467fa9cf7dbac926f7a4ffab8b7ced9bb7690" + }, + { + "sources": 10, + "roots": 1, + "source_calls": 64, + "readouts": 2046, + "transfers": 0, + "instructions": 2110, + "source_multiplicities": [ + 16, + 8, + 4, + 2, + 2, + 16, + 8, + 4, + 2, + 2 + ], + "source_ports": [ + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ] + ], + "readout_multiplicity_histogram": { + "2": 1023 + }, + "program_sha256": "378d2de3b63ca2aebcf33684eb84267f94a67b32e9f6d3361de524c5dacb2114" + } + ], + "extra_readout": [ + { + "sources": 4, + "roots": 1, + "source_calls": 8, + "readouts": 30, + "transfers": 0, + "instructions": 38, + "source_multiplicities": [ + 2, + 2, + 2, + 2 + ], + "source_ports": [ + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ] + ], + "readout_multiplicity_histogram": { + "2": 15 + }, + "program_sha256": "5def7159a98d16ab5ef566aa2694f8ca6153e3dec7cf66162ba17ac6e8a1d544" + }, + { + "sources": 5, + "roots": 1, + "source_calls": 10, + "readouts": 64, + "transfers": 0, + "instructions": 74, + "source_multiplicities": [ + 2, + 2, + 2, + 2, + 2 + ], + "source_ports": [ + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ] + ], + "readout_multiplicity_histogram": { + "2": 30, + "4": 1 + }, + "program_sha256": "be5179e54bb37eaf8d7c7ad1d7009dffadb42f0527234b49803849fe604f329c" + }, + { + "sources": 6, + "roots": 1, + "source_calls": 12, + "readouts": 156, + "transfers": 0, + "instructions": 168, + "source_multiplicities": [ + 2, + 2, + 2, + 2, + 2, + 2 + ], + "source_ports": [ + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ] + ], + "readout_multiplicity_histogram": { + "2": 48, + "4": 15 + }, + "program_sha256": "13c90f7b99b4533f615bd22cf0ad335a7e3000d50ff1c51cf20bd67e69f424e5" + }, + { + "sources": 7, + "roots": 1, + "source_calls": 14, + "readouts": 368, + "transfers": 0, + "instructions": 382, + "source_multiplicities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ], + "source_ports": [ + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ] + ], + "readout_multiplicity_histogram": { + "2": 70, + "4": 57 + }, + "program_sha256": "d0f3e76f23fb9c3fc5043939a2fb10c66394acfcb3992f8518a4fda00cb51da4" + }, + { + "sources": 8, + "roots": 1, + "source_calls": 16, + "readouts": 828, + "transfers": 0, + "instructions": 844, + "source_multiplicities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ], + "source_ports": [ + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ] + ], + "readout_multiplicity_histogram": { + "2": 96, + "4": 159 + }, + "program_sha256": "fdacd332f19fdda91d2d5a468b150d4ad02d89a67e8763596c2f7e62c20269a3" + }, + { + "sources": 9, + "roots": 1, + "source_calls": 18, + "readouts": 1794, + "transfers": 0, + "instructions": 1812, + "source_multiplicities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ], + "source_ports": [ + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ] + ], + "readout_multiplicity_histogram": { + "2": 126, + "4": 384, + "6": 1 + }, + "program_sha256": "2f299d0257d73d55aba8e8d25b456bbdf4945e644aab9854a6a144434b65e67c" + }, + { + "sources": 10, + "roots": 1, + "source_calls": 20, + "readouts": 3814, + "transfers": 0, + "instructions": 3834, + "source_multiplicities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ], + "source_ports": [ + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ] + ], + "readout_multiplicity_histogram": { + "2": 160, + "4": 842, + "6": 21 + }, + "program_sha256": "6b7aaf2f56b7d2717408b329a63f4384fc009eaf9a52166759dca5a0f17f6ea0" + } + ], + "fixed_port_five": { + "sources": 5, + "roots": 2, + "source_calls": 10, + "readouts": 62, + "transfers": 8, + "instructions": 80, + "source_multiplicities": [ + 2, + 2, + 2, + 2, + 2 + ], + "source_ports": [ + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ] + ], + "readout_multiplicity_histogram": { + "2": 31 + }, + "program_sha256": "b745e588ec6c46d59a469674c202bc1d9b7c0dc7296c04fd0457aedf625be351" + }, + "odd_source_positive_control": { + "sources": 5, + "roots": 2, + "source_calls": 13, + "readouts": 62, + "transfers": 14, + "instructions": 89, + "source_multiplicities": [ + 5, + 2, + 2, + 2, + 2 + ], + "source_ports": [ + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 1 + ] + ], + "readout_multiplicity_histogram": { + "2": 31 + }, + "program_sha256": "a34eb4480693be8bd9b5efcaf28f1548462daf1368c1bce259104f309367e5b8" + }, + "dense_cases": 460, + "rejected_mutations": 704, + "extra_readout_rejected_mutations": 336, + "readout_bound_controls": { + "n_min": 4, + "n_max": 64, + "exact_cases": 61 + }, + "closed_word_census": { + "5": { + "words": 945, + "max_coverage": 31, + "maximizers": 22, + "histogram": { + "16": 42, + "19": 120, + "21": 180, + "22": 56, + "23": 45, + "24": 220, + "26": 110, + "28": 150, + "31": 22 + } + }, + "6": { + "words": 10395, + "max_coverage": 49, + "maximizers": 186, + "histogram": { + "22": 132, + "26": 495, + "29": 880, + "31": 660, + "32": 79, + "33": 1452, + "35": 528, + "36": 840, + "37": 22, + "38": 1962, + "40": 414, + "41": 264, + "42": 807, + "44": 1146, + "47": 528, + "49": 186 + } + } + } +} diff --git a/research/scalable-dirty-connectors/README.md b/research/scalable-dirty-connectors/README.md new file mode 100644 index 0000000000..dc3f920273 --- /dev/null +++ b/research/scalable-dirty-connectors/README.md @@ -0,0 +1,366 @@ +# Sharp dirty-connector boundaries and a scalable attaining family + +This package establishes two optimality results for the universal arbitrary-dirty +F2 connector with **two calls to each source map and two calls to each output map**: + +- **Fixed-z0 five-source optimum:** eight paid bidirectional root transfers are + necessary and sufficient when every source and output call uses physical z0. + The attaining word improves PR1887's ten-transfer construction by 20% in + transfer count, changing the source word as well as its readout boundary pairs. +- **Two-root scalability boundary:** two roots cannot realize every nonzero + source mask for `n >= 6`, even with arbitrary invertible root-frame changes + and any physical port on each call. Three roots are optimal at six sources. + +An attaining family for every `n >= 4` uses `n-3` arbitrary dirty root rows and +pays `8(2^(n-4)-1)` full-row XORs. Each source keeps one physical port; every +output reads root zero. The source and output lower bounds are attained +**simultaneously**, with root rows and transfers explicitly added to the bill. +Root-count optimality for n>=7 remains open. + +The attaining family supplies the three-root six-source upper bound. This +package reports scoped optimality results and exact invoices; it makes no +measured-runtime claim. + +There is **no new integer-multiplication exponent or selected-supplier claim**. +The construction changes the interface by admitting more dirty roots and +paid star transfers. Its profitability depends on complete child, port, +transfer, hosting and preparation costs. + +## Exact interface and invoice + +The source rows `x_j`, target rows `y_m`, and roots `z_i` are distinct and +arbitrarily dirty arrays over `F2`. For every nonzero `n`-bit mask `m`, perform + +```text +y_m += A_m( XOR_{j: m_j=1} B_j(x_j) ). +``` + +Sources, coefficient tables and all roots must be unchanged afterward. +The maps are arbitrary compatible linear maps, including rectangular, +singular, nonsymmetric and noncommuting maps. The schedule depends on the +target masks, not data values. The only data operations are complete additive +calls `B_j: z_p += B_j(x_j)`, `A_m: y_m += A_m(z_p)`, and paid root shears +`z_p += z_q`. A complete child restores private scratch and any agreed frames +and head positions. Its private scratch excludes every data/root row. Targets +remain unobserved until the batch completes. No clean full row is supplied. + +The scalable family needs only shears `z_0 += z_i`, for `i > 0`. The separate +fixed-port five-source result below uses both shear directions. + +| Sources | Star roots | B, star / extra | B, Gray | A, star / Gray | A, extra | Star XORs | +|---:|---:|---:|---:|---:|---:|---:| +| 4 | 1 | 8 | 8 | 30 | 30 | 0 | +| 5 | 2 | 10 | 12 | 62 | 64 | 8 | +| 6 | 3 | 12 | 16 | 126 | 156 | 24 | +| 7 | 4 | 14 | 24 | 254 | 368 | 56 | +| 8 | 5 | 16 | 32 | 510 | 828 | 120 | +| 9 | 6 | 18 | 48 | 1,022 | 1,794 | 248 | +| 10 | 7 | 20 | 64 | 2,046 | 3,814 | 504 | + +Both one-root comparators use one dirty root and zero transfers. The extra- +readout family fixes a restored `2n`-call interleave source word and chooses a +minimum-cardinality **even** subset of source-prefix boundaries for each +output. A subset DP emits the calls; an independent pair-difference BFS checks +every output's minimum on that fixed word. PR943's five-source extra-readout +repair and PR1185's six-source `12+126+30=168` query floor already establish +this tradeoff. The later review supplies attaining interleave words at n=6..8; +we verify their invoices, not a new global word-optimality census. + +The n=4 core and n=5 one-way savings are prior work. The one-root six-source +value 16 is optimal **when every output is restricted to two readouts**; +it is not a lower bound when more A calls are allowed. Beyond n=6 the Gray +count is an achieving upper bound. All schedules have exponential instruction +counts because there are `2^n-1` distinct outputs. + +For complete prices, let `g_j` be the actual B multiplicity in the one-root +Gray word, and `r_m` the extra-readout multiplicity; `p_j=0` for `j<4`, otherwise `p_j=j-3`. Let `H` pay initial +admission/layout, root reservation, reusable coefficient preparation, schedule +generation, instruction storage/reads/dispatch, and all costs omitted from the +complete child and shear prices. Then + +```text +C_star = H_star + 2 sum_j c_Bj(p_j) + 2 sum_m c_Am(0) + + 8 sum_{i=1}^{n-4} 2^(n-4-i) c_X(0,i). +C_gray = H_gray + sum_j g_j c_Bj(0) + 2 sum_m c_Am(0). +C_extra = H_extra + 2 sum_j c_Bj(0) + sum_m r_m c_Am(0). +``` + +The adoption test against these comparators is `C_star < min(C_gray,C_extra)`. +Port independence and equal B prices require justification by an actual caller. +Against Gray, with equal B prices and equal shear prices it becomes +`(G(n)-2n)c_B > T(n)c_X + H_star-H_gray`, where +`G(n)=2^floor(n/2)+2^ceil(n/2)` and `T(n)=8(2^(n-4)-1)`. +Against the stronger minimum-B baseline with no port premium, adoption needs +`sum_m (r_m-2)c_Am > T(n)c_X + H_star-H_extra`; there is no B-call saving. +At n=6 this trades 30 A calls for 24 shears and two extra roots; at n=8, 318 A +calls for 120 shears and four extra roots. Other schedules may offer a better +weighted bill, so beating these two comparators is not a global cost optimum. +Recursive depth-five B calls use 28 dense leaves and three private dirty rows; +the star needs `n-3+3=n` borrowed rows versus four for either one-root baseline. +All input/output rows remain reserved too. + +## Construction and all-n proof + +Put `s=n-4`. Reserve center `z_0` and leaves `z_1,...,z_s`. Write +`h_j=B_j(x_j)` and initial dirty roots `d_i`. A frame indexed by +`u in F2^s` has center dirty covector + +```text +d_0 + sum_i u_i d_(i+1). +``` + +One Gray edge toggles one `u_i` by a paid `z_0 += z_(i+1)`. Other physical +roots are unchanged. Center injections have normalized axis `e_0` at every +frame. + +First run the closed two-source cycle `B0 B1 B0 B1`, whose prefix states are +`0,1,3,2,0`. At each of its four distinct prefix states, tour every `u` using +a reflected Gray path; alternate forward/reverse paths so consecutive tours +share endpoints. Four tours finish at `u=0`. Next inject each `B_j`, `j>=4`, +**once** into leaf `z_(j-3)` at that zero frame. Each leaf now contains +`d_(j-3)+h_j`. + +Run the second cycle `B2 B3 B2 B3` with the same four alternating frame tours. +It also finishes at `u=0`. Finally call each extra B again at its same leaf +port. Thus all bulk source responses and extra leaf responses cancel, and +all arbitrary dirty roots are restored. + +Write a requested mask uniquely as `m=a | (b<<2) | (c<<4)`, with `a,b` two-bit +masks and `c` an s-bit mask. Read `A_m` at first-phase bulk prefix `a`, frame +`u=c`, and at second-phase prefix `b`, the **same** frame. The two center rows +are respectively + +```text +d_0 + sum_i c_i d_(i+1) + sum_{j<2} a_j h_j, +d_0 + sum_i c_i d_(i+1) + sum_{2<=j<4} b_(j-2) h_j + + sum_{j>=4} c_(j-4) h_j. +``` + +Their XOR is exactly the desired source sum, and linearity of `A_m` cancels +all dirt. The variable `b` in the second expression is the two-bit mask; +`h_j` denotes the map response. Each requested mask is read once in each +phase. Skip mask zero. `connector.py` emits every readout as a paid operation. + +There are eight tours of `2^s-1` edges and no setup/teardown bridges, giving +exactly `T(n)`. Each source occurs twice; each of `2^n-1` outputs twice. +The proof uses no invertibility or commutativity of the maps. + +These map-call counts are optimal in this alphabet, independently of root +count. A generic active source needs a B call to affect its outputs. One B +call injects a nonzero root coefficient vector; later invertible root shears +cannot erase it, and A calls leave roots alone, so at least two are necessary. +One A call sees a nonzero dirty covector because the root frame is invertible; +it cannot cancel arbitrary dirt, so every active output also needs at least +two. **Even B multiplicity is not generally necessary with several roots**: +three distinct injection axes can sum to zero. The verifier includes a +restoring three-call excursion as a positive control for this distinction. +Adam Gall's [PR1915](https://github.com/CrocSwap/integer-mult-bounds/pull/1915) +already uses phase normalization and an order-three odd-parity control for +paid invertible frames on one connector. The new obstruction below extends +the normalized-axis argument to the two-root, n>=6 paired-call model. + +## Why two roots stop at five sources + +This obstruction assumes exactly two B calls per source, exactly two A calls +per output, arbitrary invertible root frame changes and restoration. It allows +any physical port on each occurrence and places no bound on frame-change cost. + +Normalize a source injection by the current root frame `R`: its nonzero axis +is `R^-1 e_p`. Restoration forces its two normalized axes to agree, say `v_j`. +For chronological source prefix parity `q_t`, a physical root with dirty +covector `r` has source coefficient `(r dot v_j)q_t[j]`. A paired output must +use equal dirty covectors, hence realizes + +```text +(r dot v_0,...,r dot v_(n-1)) AND (q_a XOR q_b). +``` + +The all-ones mask requires a covector responding to every occupied source +axis. In `F2^2`, any nonzero covector responds to only two of the three nonzero +axes. Thus a universal two-root schedule has at most two source-axis classes. +Let `D(w)` contain all differences of source prefixes, even at boundaries where +the favorable covector is not actually available. This gives an upper bound. + +The complete closed-word censuses give `max |D|=31` for five sources and 49 +for six. `obstruction.py` compares two independent word generators and two +difference engines **for every word**: 945 and 10,395 classes. These maxima +are already known from PR943/PR1185; the new step is applying them to arbitrary +two-root frame itineraries. + +At six sources, a one-axis schedule covers at most 49/64 masks. With two +classes of sizes `a,b`, one covector sees both classes and the other two see +one each. Their union covers at most +`|D| + (2^a+2^b-1) - 7`, since zero and all six unit masks lie in both sets. +The `2+4` and `3+3` splits therefore cover at most 61 and 57 masks. For `1+5`, +all 31 masks with the singleton and a nonzero five-bit bulk mask are mixed: +only the common covector can see them. Deleting singleton calls projects `D` +to a closed ten-call five-source word, whose maximum 31 includes zero, leaving +at most 30 nonzero bulk masks. Contradiction. + +For larger n, specialize other B maps to zero, discard their calls and unused +output targets, and obtain a forbidden six-source schedule. Hence **two roots +cannot attain the minimum map-call counts for n>=6**, however many frame +changes are allowed. The earlier six-transfer five-source witness establishes +the sharp attainability boundary at five. For six, the new star uses three +roots and therefore minimizes root count as well: a one-root schedule embeds +in the forbidden two-root model by leaving a second dirty root untouched. +Root-count optimality for +larger n is not established. + +## Fixed-z0 five-source endpoint + +The literal word below uses **every B and A at physical z0**, rather than just +one stable port per source: + +```text +S10 B0 S10 S01 B1 S01 B2 B3 S10 B0 S10 S01 B4 S01 B3 B1 B4 B2 +``` + +Here `S01` is `z0 += z1` and `S10` is `z1 += z0`. All roots and sources +restore. `fixed_port_five()` inserts all 62 paid readouts at literal boundary +pairs; polynomial/dense replay verifies them. It improves PR1887's pinned +ten-transfer schedule to eight (20% fewer transfers), with identical child +ports and the same 72 child calls. Its leaf count is shared prior work. This settles the broader fixed-port +improvement sought by PR1887's alternative-boundary-pair question. The witness +changes both the source word and readout table; it does not prove that +PR1887's original source word attains eight transfers. + +Eight is optimal in this fixed-port, paired-call model. The complete six-X +census has 22 identity direction words, 8,008 placements and 945 pairings per +frame: 166,486,320 skeletons, 34,977,960 legal schedules, maximum 31/32 masks. +Each shear permutes the three nonzero two-bit vectors by a transposition, so +odd-length words cannot restore. Pad a shorter even word with adjacent equal +shears at a boundary; restoration and all old readouts survive. Thus the +six-X exclusion covers every smaller count. The eight-X command replays the literal word and passes its frame through the +same census pairing/coverage engine: 105 legal pairings, one universal. It is +bounded to that frame, **not** an exhaustive eight-X search. The later review +independently reports an exhaustive eight-X physical census with 464,969,376 +legal schedules and 828 universal; that run is separate local evidence. + +`fixed_port_census.cpp` generates pairings of equal normalized axes; its domain +reduction is the restoration argument above. Its histogram agrees with the +earlier full-pairing search and a separate local physical-row review adapter +that enumerates all directions and filters restoration directly. The adapter +is extra local evidence, not a shipped third engine. `CENSUS.json` records the +complete six-X histogram and the positive fixture. + +## Reproduce and verification limits + +Standard-library Python 3.12; checks stay active under optimization: + +```sh +python3 -I -O -B research/scalable-dirty-connectors/verify.py +``` + +Expected: `PASS_SCALABLE_DIRTY_CONNECTORS n=4..10 dense=460 rejected=704 extra_rejected=336 fixed_port=8`. +This checks the literal programs and invoices through n=10, 460 rectangular/singular-map forward/inverse cases, all original 704 +omission/port/direction/label/schema controls, 336 additional extra-readout +omission/label controls, neutral-extra-pair and odd-source positive controls, +both closed-word censuses, and the independent subset-DP/BFS comparison. +The star/fixed-port paired checks remain strict; only the explicitly selected +extra-readout baseline admits larger even A multiplicities. +The all-n theorem is the proof above; finite replay is corroboration. +`EXPECTED.json` is generated by this checker and guards regressions rather +than furnishing independent mathematical evidence. It deliberately binds +exact serialization. `--write-expected` regenerates it after all actual checks. +The native fixed-port exclusion is separate from this bounded Python hook. + +From the upstream repository root, compile **one native command at a time**. +On Linux a configured C++20 `c++` works; this Mac's default linker rejects the +selected SDK, so use the tested Xcode compiler and SDK explicitly: + +```sh +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ \ + -target arm64-apple-macosx26.5 \ + -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk \ + -O3 -std=c++20 -Wall -Wextra -Wpedantic \ + research/scalable-dirty-connectors/fixed_port_census.cpp -o /tmp/fixed-port-census +/tmp/fixed-port-census 6 +/tmp/fixed-port-census 8 +``` + +In this math repository, prefix `research/` with `integer-mult-bounds/`. +macOS SDK/toolchain details and actual verification records are in TASK.json. +The opt-in upstream hook uses `scripts/research_package.py --package +research/scalable-dirty-connectors`. No dependencies or external replay inputs +are needed; source pins are historical provenance. No Lean proof, independent +human review, hosted CI, selected-supplier cold replay, caller admission or +head-return tape integration is claimed. + +## Open next questions + +The structured questions in TASK.json cover three useful next steps: +find a real recursive caller with these maps and stable ports and price its +full adoption inequality; reduce roots for n>=7 without losing the minimum +map-call count; and realize the paid frame/child program on a concrete tape +layout. The first is blocked by the absent caller contract, the second by the +lack of an attaining lower-root word, and the third by absent caller/head +layout. Each should start with a bounded positive fixture and full invoice. + +## Credit, sources and scope + +Ross Richardson's [PR934](https://github.com/CrocSwap/integer-mult-bounds/pull/934) +and [PR943](https://github.com/CrocSwap/integer-mult-bounds/pull/943) supply the +dirty query contract, complementary-subspace core, five-source obstruction, +extra-readout repair and balanced recursive echoes. Their retained NOTICE +credits the PR889 common-factor fanout and Chafik Boukhalfa's PR628 dirty +commutator lineage. Douglas Colkitt's +[PR1185](https://github.com/CrocSwap/integer-mult-bounds/pull/1185) supplies +the six-source one-root census, general Gray bound and extra-readout budget. +The later agent review supplied the attaining interleave extension and +identified the stronger one-root comparator; it is credited here +rather than treated as a new source-call discovery. + +Paid one-way two-root predecessors include woklerx's +[PR1438](https://github.com/CrocSwap/integer-mult-bounds/pull/1438), Gareth +Davidson's [PR1498](https://github.com/CrocSwap/integer-mult-bounds/pull/1498), +and Sagar Thakrar's [PR1767](https://github.com/CrocSwap/integer-mult-bounds/pull/1767). +Cinna Davis originated the eight-transfer word in +[Discussion1412](https://github.com/CrocSwap/integer-mult-bounds/discussions/1412). +Hanson Sun's [PR1615](https://github.com/CrocSwap/integer-mult-bounds/pull/1615) +proved the sharp one-way eight-transfer threshold before @nedveder's +[PR1812](https://github.com/CrocSwap/integer-mult-bounds/pull/1812), which also +verifies that threshold and asks the bidirectional question. Those +port/direction contracts differ from the fixed-z0 bidirectional optimum here. +Cinna Davis's [PR1887](https://github.com/CrocSwap/integer-mult-bounds/pull/1887) +already uses both directions at fixed z0 ports and publishes the shared +180-versus-182 leaf comparison. Our eight-X result supplies a lower-count fixed-port word in response to its +alternative-boundary-pair question, changing the source word as well. Cinna Davis's +[PR1675](https://github.com/CrocSwap/integer-mult-bounds/pull/1675) treats a +different signed target. Adam Gall's +[PR1915](https://github.com/CrocSwap/integer-mult-bounds/pull/1915) supplies +the one-connector phase-normalization and odd-parity framed control; these +techniques are inherited, while the two-root n>=6 obstruction is new. + +Adam Gall's concurrent [PR2065](https://github.com/CrocSwap/integer-mult-bounds/pull/2065), +at `2721b1e31d718a6e70266a99521f629ce2e1d259`, supplies the six-transfer +five-source endpoint when ports may differ between calls. It is credited +predecessor evidence here, not a new claim. Its port-changing witness differs +from the fixed-z0 optimum, and it does not claim the n>=6 two-root obstruction. +Adam Gall's [PR2063](https://github.com/CrocSwap/integer-mult-bounds/pull/2063) +prices all positive map tariffs for five sources and one root; Aaron Wang's +[PR2056](https://github.com/CrocSwap/integer-mult-bounds/pull/2056) adds combined +pair-source calls. Aaron Wang's subsequent +[PR2128](https://github.com/CrocSwap/integer-mult-bounds/pull/2128), at +`697369a971eed02c0fbcd75ebefec9f59945f08e`, extends that pair-source alphabet to +six sources with a fourteen-call source word. Pair-source calls are excluded +here, so its six-source construction has a different contract from our +ordinary-call two-root obstruction. These are different alphabets/domains +from the results here. +Cinna Davis's [PR2134](https://github.com/CrocSwap/integer-mult-bounds/pull/2134) +is a six-source one-TRIO census with sixteen source-map applications; its +combined call and nonminimal source multiplicities are likewise excluded here. + +New claims are the all-n star compiler/fully priced tradeoff, the unrestricted +frame two-root minimal-call boundary, and the eight-transfer fixed-z0 optimum. +Canonical-main guidance was reread at +`0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2`, priority revision 4. This is an +explicitly changed-scope interface side result, not a completion of revision 4's +central supplier handoffs. TASK.json records the fresh overlap audit and its +limits; absence of a match is not a novelty guarantee. Historical scientific +source pins are preserved. + +Prepared by @conorholds. Substantial AI assistance was used in mathematical +derivation, implementation and checking. No independent human peer review or +proof-assistant verification is claimed. Apache-2.0; predecessor attribution +and source notices are retained. diff --git a/research/scalable-dirty-connectors/SOURCES.json b/research/scalable-dirty-connectors/SOURCES.json new file mode 100644 index 0000000000..3dcd65137a --- /dev/null +++ b/research/scalable-dirty-connectors/SOURCES.json @@ -0,0 +1,305 @@ +{ + "schema_version": 1, + "base_commit": "fe19567d22524eef6d3858c537aeed537ad5a7e6", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "ae6a99f28aa468649eb66a361e764d769363bf11", + "sha256": "10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "06c96f5579bb67ed1b86d334e78fbed7da6945f1", + "sha256": "6686ad58f1fbdbc87134a78901b60fd53a20d3984355e91defbbebc9e9fa8075" + }, + { + "path": "AGENTS.md", + "usage": "provenance", + "git_blob": "860762e04e963e1b163b8fa5267854c0040a9e67", + "sha256": "5f29c7cbf0eb28f4e87f0affa9cffdaef4e39a630a5878c8fed02b544c894d2e" + }, + { + "path": "autoresearch.md", + "usage": "provenance", + "git_blob": "84c108dd0d650944066ee34796e733f2329acf28", + "sha256": "069a77b7999f9314def5cb7476ef379abed7af9a1064a71d3bbd8e3fbe220bc2" + }, + { + "path": "CONTRIBUTING.md", + "usage": "provenance", + "git_blob": "e51435543687f1bd88ab22248082dc689ce8b853", + "sha256": "df5b5646602f42cb5da5844f04ac925182ddcd0f627b9de1c96a5095bb7a277a" + }, + { + "path": "research/universal-connector-boundary/README.md", + "usage": "provenance", + "git_blob": "d277f7c5830b1f2bc42e1ff41ab86e7d7564929f", + "sha256": "23415f7829ab8d80a783142f10f7d31abbce84579362769984680af3df954476" + }, + { + "path": "research/universal-connector-boundary/NOTICE.md", + "usage": "provenance", + "git_blob": "d9afdf81f656278dab69239f0fd94924f97df87b", + "sha256": "1172648a1883827399d5103a9916deaa4314e4ee2c28653c183890f6bd5a7a17" + }, + { + "path": "research/universal-connector-six-source/README.md", + "usage": "provenance", + "git_blob": "c7123c3cfd7545deb6af607800df0d15c6e8c0d2", + "sha256": "ea9cca56d1547dcd984f5f99f6c6243c9417a7ede08f68782c7a6616aa6eb563" + }, + { + "path": "research/universal-connector-six-source/NOTICE.md", + "usage": "provenance", + "git_blob": "44201ca4626146a690fb5862eb2b6dddde611ce5", + "sha256": "a1c5b211f8e2357e145977be830493ec132ccaebcd7dfd35816cb527b3a196d6" + }, + { + "path": "research/two-connector-transfer-boundary/README.md", + "usage": "provenance", + "git_blob": "b02039847c7f878ba12fd95102c44672c8c321c9", + "sha256": "3057191382e0bb27d9b6125ea4a9a1878a5ea5b4b5bea84401a99b47598faa5c" + } + ], + "related_prs": [ + { + "number": 1915, + "author": "adamgall", + "author_name": "Adam Gall", + "head": "d30d64fea909219c364b11c2452f2207326e2b1f", + "state": "MERGED", + "merged_at": "2026-10-14T17:06:51Z", + "updated_at": "2026-10-14T17:10:16Z", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1915" + }, + { + "number": 1887, + "author": "1337isnot1337", + "author_name": "Cinna Davis", + "head": "025d4fcd87f1b6ea01aa1c52721f8f46389aacce", + "state": "MERGED", + "merged_at": "2026-10-14T16:57:12Z", + "updated_at": "2026-10-14T17:01:05Z", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1887" + }, + { + "number": 1812, + "author": "nedveder", + "author_name": "", + "head": "e43abcde1c98c718f5b4d0b25cf4cd9c04200bd8", + "state": "MERGED", + "merged_at": "2026-10-14T16:38:48Z", + "updated_at": "2026-10-14T16:41:53Z", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1812" + }, + { + "number": 1767, + "author": "thakrarsagar", + "author_name": "", + "head": "ce50fccd8086bfeb8a61cc9eded572fb4741c387", + "state": "MERGED", + "merged_at": "2026-10-14T16:16:41Z", + "updated_at": "2026-10-14T16:22:06Z", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1767" + }, + { + "number": 1675, + "author": "1337isnot1337", + "author_name": "Cinna Davis", + "head": "a8d459974abf7ba88316c87396565f7e5fc9656f", + "state": "MERGED", + "merged_at": "2026-10-14T15:44:16Z", + "updated_at": "2026-10-14T15:57:45Z", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1675" + }, + { + "number": 1615, + "author": "bbMisk", + "author_name": "", + "head": "96916897840829cc01b126f8f202a92d949d2bfc", + "state": "MERGED", + "merged_at": "2026-10-14T15:43:33Z", + "updated_at": "2026-10-14T15:55:55Z", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1615" + }, + { + "number": 1498, + "author": "bitplane", + "author_name": "Gareth Davidson", + "head": "b7baacc8048ab11d31751aee065206f2725a1a16", + "state": "MERGED", + "merged_at": "2026-10-14T15:14:11Z", + "updated_at": "2026-10-14T15:28:44Z", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1498" + }, + { + "number": 1438, + "author": "woklerx", + "author_name": "", + "head": "a61170c97c9ea2c396f6d76a953b0cf74a455cdd", + "state": "MERGED", + "merged_at": "2026-10-14T06:44:22Z", + "updated_at": "2026-10-14T06:48:35Z", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1438" + }, + { + "number": 1185, + "author": "Mister-Meeseeks", + "author_name": "Doug Colkitt", + "head": "4a60772285ce70f6414458f6d3a54948652bbed0", + "state": "MERGED", + "merged_at": "2026-10-14T05:19:17Z", + "updated_at": "2026-10-14T05:30:21Z", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1185" + }, + { + "number": 943, + "author": "RossRichardson", + "author_name": "Ross Richardson", + "head": "cf360b4b09b7d0419decdd6ac85421fefed55bdd", + "state": "MERGED", + "merged_at": "2026-10-13T16:15:01Z", + "updated_at": "2026-10-13T16:15:01Z", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/943" + }, + { + "number": 934, + "author": "RossRichardson", + "author_name": "Ross Richardson", + "head": "f3100aec6ce6a7b061987875d5e9a8b93801ac0b", + "state": "MERGED", + "merged_at": "2026-10-13T16:15:01Z", + "updated_at": "2026-10-13T16:15:01Z", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/934" + } + ], + "note": "All files are historical provenance, not replay imports; verification is self-contained. Preserve exact discovery pins. Related PR heads record attribution and overlap context.", + "upstream_recheck": { + "head": "e112d71c8d7bb32435debcc54df932593dd8223a", + "method": "Every historical file compared by Git blob and SHA256; original base/files pins preserved. Related PR states refreshed from all-state API snapshot.", + "unchanged_files": [ + "certificates/selected-result.json", + "docs/research/agent-task-catalog.json", + "AGENTS.md", + "autoresearch.md", + "CONTRIBUTING.md", + "research/universal-connector-boundary/README.md", + "research/universal-connector-boundary/NOTICE.md", + "research/universal-connector-six-source/README.md", + "research/universal-connector-six-source/NOTICE.md", + "research/two-connector-transfer-boundary/README.md" + ], + "changed_provenance_files": [], + "note": "All historical pinned bytes still match." + }, + "revision_sources": { + "base_commit": "e112d71c8d7bb32435debcc54df932593dd8223a", + "files": [ + { + "path": "research/connector-frame-rigidity/README.md", + "git_blob": "8f792e62700ec3809075b500f233cee00f3543fe", + "sha256": "d4c5aea3ecc0e988dfd01ee9e47381d813a736cf7eec96eb4f352ab4dc6f3872", + "usage": "revision provenance only; no replay import" + }, + { + "path": "research/two-projection-connector-seed51a5/README.md", + "git_blob": "4f342bd8d0ee1ea640e81e0670ac664e9a3e1be5", + "sha256": "f597abae5a974344fd9dcb60f5e3143dde29e2e1d35ceabd0829f21a4fadcfb1", + "usage": "revision provenance only; no replay import" + }, + { + "path": "research/two-connector-six-transfer/README.md", + "git_blob": "ab5d15be9f0706055a8931d34415577b855d9607", + "sha256": "824dd9a83950da3b5262b640ff1e1105888654f538532f1839787a8e1374ff90", + "usage": "revision provenance only; no replay import" + } + ] + }, + "discussion_1412": { + "title": "Read-only five-source connector: second dirty root and eight paid XORs (seed54)", + "author": { + "login": "1337isnot1337" + }, + "createdAt": "2026-10-14T00:27:57Z", + "updatedAt": "2026-10-14T00:27:57Z", + "url": "https://github.com/CrocSwap/integer-mult-bounds/discussions/1412", + "body_sha256": "2742742751dee3ff79c530e16b45afc1d36aa590596c4135ae8b233b9dee9463" + }, + "submission_sources": { + "upstream_head": "0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2", + "priority_revision": 4, + "checked_at": "2026-10-14T22:16:22.929452+00:00", + "concurrent_prs": [ + { + "pr": 2065, + "head": "2721b1e31d718a6e70266a99521f629ce2e1d259", + "author": "Adam Gall", + "state": "OPEN", + "delta": "Same six-transfer five-source endpoint. Credit as independent concurrent work; exclude the earlier bidirectional-universal-five package from the submission." + }, + { + "pr": 2063, + "head": "4caa7660fa4a31c4cfeaf177fabc3b56549dd065", + "author": "Adam Gall", + "state": "OPEN", + "delta": "Five-source one-root all-positive-map-tariff optimum; not the scalable star, arbitrary-frame two-root boundary or fixed-z0 eight-transfer result." + }, + { + "pr": 2056, + "head": "c713ff9eff95446508aeb865a9f58b1758b2a00a", + "author": "Aaron Wang", + "state": "OPEN", + "delta": "Adds combined pair-source calls to a one-root alphabet; those calls are excluded here." + }, + { + "pr": 2128, + "head": "697369a971eed02c0fbcd75ebefec9f59945f08e", + "author": "Aaron Wang", + "state": "OPEN", + "delta": "Six-source fourteen-call construction in a pair-source DUO alphabet. Combined source calls are excluded by this package; not the ordinary-call arbitrary-frame two-root obstruction or fixed-z0 eight-transfer optimum." + }, + { + "pr": 2134, + "head": "388a63c83cf24c3355be9798bde5a381188dadb3", + "author": "Cinna Davis", + "state": "OPEN", + "delta": "Six-source one-TRIO census with sixteen source-map applications; combined call and nonminimal multiplicities are excluded here." + }, + { + "pr": 2146, + "head": "302b0e87d9328fabc2a670248afb357bbb44041b", + "author": "1337isnot1337", + "state": "OPEN", + "delta": "Single-root combined TRIO/DUO source calls or additional readouts, outside the ordinary exactly-two-call two-root model." + }, + { + "pr": 2156, + "head": "05b4672fa4450ef50b06315e3a0893d4ba43d42d", + "author": "Tairitsu-Aya", + "state": "OPEN", + "delta": "Single-root combined TRIO/DUO source calls or additional readouts, outside the ordinary exactly-two-call two-root model." + } + ], + "files": [ + { + "repository": "CrocSwap/integer-mult-bounds", + "commit": "2721b1e31d718a6e70266a99521f629ce2e1d259", + "path": "research/bidirectional-five-source-connector/README.md", + "git_blob": "715dd2e76f41e9ddee095ff2aa0196597f312db3", + "sha256": "14ef42c5688fce6f174c6a5be47ed1c0ca3a6ef7512346f57a4a8f222dd6458b", + "usage": "Concurrent attribution/overlap evidence only; not a replay import, dependency or claimed human review." + }, + { + "repository": "CrocSwap/integer-mult-bounds", + "commit": "697369a971eed02c0fbcd75ebefec9f59945f08e", + "path": "research/connector-six-source-duo/README.md", + "git_blob": "9855372446ed4ecd9d91c0f7afee1932e2c2d61a", + "sha256": "f338d940075ba3782da276abf69b9578d3b1a4daaa285960cf168480d8f7c486", + "usage": "Concurrent attribution/overlap evidence only; pair-source alphabet excluded here; not a replay import." + } + ], + "note": "Local-only theorem-focused review proposal; original historical scientific pins preserved. Pending adjacent results use different ports, call alphabets or targets." + } +} diff --git a/research/scalable-dirty-connectors/TASK.json b/research/scalable-dirty-connectors/TASK.json new file mode 100644 index 0000000000..eec76f89d9 --- /dev/null +++ b/research/scalable-dirty-connectors/TASK.json @@ -0,0 +1,107 @@ +{ + "schema_version": 1, + "task_id": "connector-alphabet-change", + "priority_revision": 3, + "base_commit": "fe19567d22524eef6d3858c537aeed537ad5a7e6", + "original_card": { + "id": "connector-alphabet-change", + "question": "Does one explicit extension of the connector alphabet offer a favorable completed budget?", + "starting_points": [ + "research/universal-connector-boundary/README.md", + "certificates/selected-result.json" + ], + "methods": [ + "Construct and charge a legal extra operation on a minimal instance.", + "Prove a target-specific bound after adding one specified operation family." + ], + "acceptance_gate": "State which fixed-alphabet premise changes and charge its implementation; do not declare it free.", + "first_step": { + "command": [ + "python3", + "-B", + "research/universal-connector-boundary/verify.py" + ], + "expected": "PASS_UNIVERSAL_CONNECTOR_BOUNDARY", + "inspect": "Reproduce the 945-pairing control, then read Exact interface to list the allowed calls.", + "scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay." + }, + "first_experiment": "Add exactly one legally priced operation and test a tiny dirty-input instance before enumerating larger cases.", + "bottleneck_link": "A new legal connector operation could change recursive interface cost; a larger census in the same alphabet is a separate side result.", + "allowed_variations": [ + "Choose one additional operation and a small source count for its first counterexample." + ], + "scope_change_triggers": [ + "Keeping the alphabet and only increasing the source count; record this as a changed assignment." + ], + "overlap_terms": [ + "universal connector", + "source-toggle", + "connector alphabet" + ] + }, + "scope_status": "changed", + "outcome": "completed", + "open_questions": [ + { + "question": "Can a real recursive caller expose this product batch with reservable dirty roots and stable complete ports?", + "why_it_matters": "Only an actual caller and fully paid adoption inequality can translate the local map-call gain into supplier progress.", + "first_step": "Pin one caller, extract exact B/A roles and ownership, then compare C_star with both C_extra and C_gray, including complete ports, preparation, control and rows.", + "blocked_by": "No selected-supplier caller with this universal product-mask interface has been identified." + }, + { + "question": "Can n>=7 attain minimum map calls with fewer than n-3 dirty roots?", + "why_it_matters": "A lower root requirement would reduce hosting and extend adoption; only the six-source minimum of three roots is settled.", + "first_step": "Seek a seven-source three-root word in an explicitly bounded axis/frame domain; synthesize and physically replay every priced transfer for a positive candidate.", + "blocked_by": "The bounded favorable screen found no universal word; this is not an exclusion." + }, + { + "question": "Does a concrete tape implementation retain the gain after head returns and program access?", + "why_it_matters": "Resident RAM counts and timings do not determine the project model tape cost.", + "first_step": "Choose the caller/head layout and emit complete child/frame traces including all source/target/coefficient accesses and returns.", + "blocked_by": "No concrete caller/head layout is pinned." + } + ], + "actual_scope": "Fixed-z0 five-source eight-transfer optimum and arbitrary-frame two-root obstruction for n>=6 in the ordinary, exactly-two-source-call/exactly-two-readout model; attaining star family supplies the three-root n6 upper bound.", + "scope_change_reason": "The original card asks for a tiny operation-alphabet change. This completed side result instead establishes sharp transfer and root-count boundaries under explicit call/port restrictions; the attaining family is supporting evidence, not a selected-supplier or runtime claim.", + "bottleneck_link": "Settles two abstract interface design boundaries. A real recursive caller, complete port/hosting tariffs and tape admission are not supplied.", + "budget_minutes": 90, + "author": "@conorholds", + "ai_assistance": "Substantial AI assistance used in mathematical derivation, implementation and checking; no independent human review or proof-assistant verification claimed.", + "evidence": "Written reduction of arbitrary two-root frames to exact five/six-source prefix censuses; all-n specialization; literal fixed-z0 eight-transfer word; exhaustive six-transfer native census and in-engine positive fixture. Existing Python symbolic/matrix/corruption checks are retained unchanged.", + "verification": { + "python": "Python3.14.3 isolated optimized replay and Python3.12.11 registered hook pass:460 dense forward/inverse cases,all original704 controls plus336 baseline controls,dual word censuses,per-mask DP/BFS agreement,and61 exact volume checks. Original paired-case RNG stream preserved; extra cases have a separate stream. Python3.12 no-Git export passes and a boolean receipt corruption rejects.", + "native_census": "Six-transfer enumeration unchanged; prior packaged and independent physical-row matching histograms reused. Revised8 command runs the actual pairing/coverage engine on1 frame,105 legal pairings and1 universal, then also validates the literal witness. The reviewer separately reported an exhaustive8 run with464969376 legal schedules and828 universal; not rerun here.", + "not_run": [ + "Hosted CI", + "Lean/human proof review", + "Selected-supplier cold replay (no supplier changes)", + "Caller/head-return tape integration" + ], + "environment": { + "python": "CPython3.12.11", + "native_compiler": "Apple clang21.0.0, -O3 -std=c++20 -Wall -Wextra -Wpedantic; explicit Xcode SDK/arm64 target in README", + "native_reuse": "C++ source and CENSUS.json unchanged from prior complete six-transfer run and in-engine eight-transfer positive control." + } + }, + "publication": "Local review proposal only. Exact title, body and all submitted files require explicit user approval before any remote creation, update, push or submission.", + "review_checkpoint": { + "upstream_head": "0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2", + "priority_revision": 4, + "checked_at": "2026-10-14T22:16:22.929452+00:00", + "coverage": { + "open_prs": { + "fetched_at": "2026-10-14T22:14:51.839507+00:00", + "complete_pagination": true, + "records": 426 + }, + "discussions": { + "fetched_at": "2026-10-14T22:16:22.822876+00:00", + "complete_pagination": true, + "records": 859 + } + }, + "all_state_pr_bodies": 1966, + "scope": "Search current PR/discussion bodies and indexed main research notes for the two theorem scopes; no exact current overlap found. This is not a code-diff-complete novelty guarantee." + }, + "stop_rule": "Finish the written reductions, exact finite censuses, attaining words and meaningful replay controls. Treat this as a scoped interface side result; do not infer a supplier or exponent gain, and require explicit approval of the complete reviewed artifact before any publication." +} diff --git a/research/scalable-dirty-connectors/VERIFY.json b/research/scalable-dirty-connectors/VERIFY.json new file mode 100644 index 0000000000..f185ffee65 --- /dev/null +++ b/research/scalable-dirty-connectors/VERIFY.json @@ -0,0 +1,20 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Paired star/fixed-port identities and704 controls,one-root even extra-readout identity/invoice,minima checked independently by subset DP and pair BFS,460 rectangular/singular forward/inverse cases,336 extra-baseline mutations,neutral-readout/odd-source positive controls,both closed-word censuses,and61 exact readout-volume controls. Native fixed-port census remains a separate reproducible command." + } + ] +} diff --git a/research/scalable-dirty-connectors/connector.py b/research/scalable-dirty-connectors/connector.py new file mode 100644 index 0000000000..a927f6978d --- /dev/null +++ b/research/scalable-dirty-connectors/connector.py @@ -0,0 +1,154 @@ +"""Literal universal dirty-row connectors. Apache-2.0; AI assistance disclosed. + +An operation (kind, label, port) is B_label into port, A_label from port, +or, for kind X, row[label] ^= row[port]. No observation or frame change is free. +""" + +from dataclasses import dataclass + + +@dataclass(frozen=True) +class Program: + sources: int + roots: int + operations: tuple[tuple[str, int, int], ...] + + +def _source_count(n): + if type(n) is not int or n < 4: + raise ValueError("source count must be an integer >= 4") + + +def star(n): + """Use n-3 dirty roots and exactly two calls to every B and A. + + The emitted program has exponential size because it has 2**n-1 outputs. + """ + _source_count(n) + dimensions = n - 4 + gray = tuple(i ^ (i >> 1) for i in range(1 << dimensions)) + operations = [] + frame = 0 + + def move(destination): + nonlocal frame + changed = frame ^ destination + for bit in range(dimensions): + if changed & (1 << bit): + operations.append(("X", 0, bit + 1)) + frame ^= 1 << bit + + def tour(reverse, phase, point): + for g in reversed(gray) if reverse else gray: + move(g) + extra = frame + for other in range(4): + first, second = (point, other) if phase == 0 else (other, point) + mask = first | (second << 2) | (extra << 4) + if mask: + operations.append(("A", mask, 0)) + + for t, point in enumerate((0, 1, 3, 2)): + tour(bool(t % 2), 0, point) + operations.append(("B", (0, 1, 0, 1)[t], 0)) + for j in range(4, n): + operations.append(("B", j, j - 3)) + for t, point in enumerate((0, 1, 3, 2)): + tour(bool(t % 2), 1, point) + operations.append(("B", (2, 3, 2, 3)[t], 0)) + for j in range(4, n): + operations.append(("B", j, j - 3)) + return Program(n, n - 3, tuple(operations)) + + +def gray_baseline(n): + """PR1185's two closed Gray cycles, with explicitly scheduled readouts.""" + _source_count(n) + split = n // 2 + sizes = (split, n - split) + operations = [] + for phase, size in enumerate(sizes): + gray = tuple(i ^ (i >> 1) for i in range(1 << size)) + for t, point in enumerate(gray): + for other in range(1 << sizes[1 - phase]): + first, second = (point, other) if phase == 0 else (other, point) + mask = first | (second << split) + if mask: + operations.append(("A", mask, 0)) + changed = point ^ gray[(t + 1) % len(gray)] + label = changed.bit_length() - 1 + (split if phase else 0) + operations.append(("B", label, 0)) + return Program(n, 1, tuple(operations)) + + +def extra_readout_baseline(n): + """One root, two B calls per source, minimum even readouts on this word. + + PR943/1185 permit extra readouts instead of extra B calls. The interleave + word was supplied by the subsequent independent review. No global word + optimality is assumed here. A 0/1 subset DP minimizes readout cardinality + for each target on this fixed word, including cancellation of dirty roots. + """ + _source_count(n) + word = [0, 1] + [j for i in range(2, n) for j in (i, i - 2)] + [n - 2, n - 1] + points = [0] + for j in word: + points.append(points[-1] ^ (1 << j)) + # State index is (source mask << 1) | readout-count parity. Each boundary + # can be selected once: selecting it twice cancels and cannot be minimal. + unreachable = len(points) + 1 + cost = [unreachable] * (1 << (n + 1)) + selected = [0] * len(cost) + cost[0] = 0 + for boundary, point in enumerate(points): + old_cost, old_selected = cost, selected + cost, selected = old_cost[:], old_selected[:] + offset = (point << 1) | 1 + for state, count in enumerate(old_cost): + destination = state ^ offset + if count + 1 < cost[destination]: + cost[destination] = count + 1 + selected[destination] = old_selected[state] | (1 << boundary) + reads = [[] for _ in points] + for mask in range(1, 1 << n): + if cost[mask << 1] == unreachable: + raise ValueError("source-prefix span does not cover target") + for boundary in range(len(points)): + if selected[mask << 1] & (1 << boundary): + reads[boundary].append(("A", mask, 0)) + operations = [] + for boundary, calls in enumerate(reads): + operations.extend(calls) + if boundary < len(word): + operations.append(("B", word[boundary], 0)) + return Program(n, 1, tuple(operations)) + + +def fixed_port_five(): + """Eight paid transfers; every B and A uses physical row zero.""" + skeleton = ( + ("X", 1, 0), ("B", 0, 0), ("X", 1, 0), ("X", 0, 1), + ("B", 1, 0), ("X", 0, 1), ("B", 2, 0), ("B", 3, 0), + ("X", 1, 0), ("B", 0, 0), ("X", 1, 0), ("X", 0, 1), + ("B", 4, 0), ("X", 0, 1), ("B", 3, 0), ("B", 1, 0), + ("B", 4, 0), ("B", 2, 0), + ) + # Literal boundary pairs from physical replay; they are not computed using + # the verifier and can be checked independently by its row interpreter. + pairs = ( + (0, 2), (2, 6), (0, 6), (0, 17), (2, 17), (2, 7), (0, 7), + (7, 8), (7, 10), (10, 17), (8, 17), (5, 12), (6, 10), + (0, 10), (0, 8), (10, 14), (7, 15), (15, 17), (7, 16), + (0, 16), (2, 16), (0, 15), (2, 15), (10, 15), (7, 14), + (10, 16), (8, 16), (5, 13), (6, 14), (0, 14), (2, 14), + ) + readouts = [[] for _ in range(len(skeleton) + 1)] + for mask, pair in enumerate(pairs, 1): + for boundary in pair: + readouts[boundary].append(("A", mask, 0)) + operations = [] + for boundary, calls in enumerate(readouts): + operations.extend(calls) + if boundary < len(skeleton): + operations.append(skeleton[boundary]) + return Program(5, 2, tuple(operations)) diff --git a/research/scalable-dirty-connectors/fixed_port_census.cpp b/research/scalable-dirty-connectors/fixed_port_census.cpp new file mode 100644 index 0000000000..3e9c982bd8 --- /dev/null +++ b/research/scalable-dirty-connectors/fixed_port_census.cpp @@ -0,0 +1,389 @@ +// Fixed-port two-root connector census. Apache-2.0. +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + +constexpr int kSources = 5; +constexpr int kBCalls = 2 * kSources; +constexpr int kMaxTransfers = 8; +constexpr int kCanonicalPairings = 945; + +struct Event { + int kind; // 0: B source call; 1: S01; 2: S10 +}; + +struct Boundary { + int row0; + int source_mask; +}; + +int transfers = 0; +int event_count = 0; +long long identity_words = 0; +long long frame_patterns = 0; +long long legal_schedules = 0; +array coverage_hist{}; +int best_coverage = -1; +uint32_t best_cover = 0; +vector best_directions; +vector best_slots; +array best_word{}; +array best_axes{}; +vector events; +array axes_by_call{}; +array pair_word{}; + +bool identity_word(const vector &directions) { + int row0 = 1, row1 = 2; + for (int direction : directions) { + if (direction == 0) + row0 ^= row1; // S01: z0 += z1 + else + row1 ^= row0; // S10: z1 += z0 + } + return row0 == 1 && row1 == 2; +} + +int fixed_port_axis(int row0, int row1) { + for (int axis = 1; axis <= 3; ++axis) { + const int first = popcount(static_cast(row0 & axis)) & 1; + const int second = popcount(static_cast(row1 & axis)) & 1; + if (first == 1 && second == 0) + return axis; + } + abort(); // The current two-row frame is invertible. +} + +int project_mask(int row0, const array &source_state) { + int mask = 0; + for (int source = 0; source < kSources; ++source) + if (popcount(static_cast(row0 & source_state[source])) & 1) + mask |= 1 << source; + return mask; +} + +uint32_t xor_translate(uint32_t points, int offset) { + static constexpr uint32_t zero_masks[5] = { + 0x55555555u, 0x33333333u, 0x0f0f0f0fu, 0x00ff00ffu, 0x0000ffffu}; + for (int bit = 0; bit < kSources; ++bit) { + if ((offset & (1 << bit)) == 0) + continue; + const int distance = 1 << bit; + const uint32_t low = zero_masks[bit]; + points = ((points & low) << distance) | ((points & ~low) >> distance); + } + return points; +} + +uint32_t difference_cover(const array &points) { + uint32_t cover = 0; + for (int row0 = 1; row0 <= 3; ++row0) { + uint32_t offsets = points[row0]; + while (offsets != 0) { + const int offset = countr_zero(offsets); + offsets &= offsets - 1; + cover |= xor_translate(points[row0], offset); + } + } + return cover; +} + +void evaluate_pair_word(const vector &directions, + const vector &slots) { + array source_axes{}; + array source_state{}; + for (int call = 0; call < kBCalls; ++call) { + const int label = pair_word[call]; + if (source_axes[label] == 0) + source_axes[label] = axes_by_call[call]; + else if (source_axes[label] != axes_by_call[call]) + abort(); // Pair generation only joins calls with equal axes. + } + + int row0 = 1, row1 = 2, source_call = 0; + array points{}; + auto record = [&]() { + points[row0] |= uint32_t{1} << project_mask(row0, source_state); + }; + record(); + for (const Event &event : events) { + if (event.kind == 0) { + const int label = pair_word[source_call]; + source_state[label] ^= source_axes[label]; + ++source_call; + } else if (event.kind == 1) { + row0 ^= row1; + } else { + row1 ^= row0; + } + record(); + } + if (source_call != kBCalls || row0 != 1 || row1 != 2 || + any_of(source_state.begin(), source_state.end(), + [](int value) { return value != 0; })) + abort(); + + const uint32_t cover = difference_cover(points); + const int size = popcount(cover); + ++coverage_hist[size]; + ++legal_schedules; + if (size > best_coverage) { + best_coverage = size; + best_cover = cover; + best_directions = directions; + best_slots = slots; + best_word = pair_word; + best_axes = source_axes; + } +} + +void pair_calls_by_axis(int first_unpaired, int next_label, + const vector &directions, + const vector &slots) { + int first = first_unpaired; + while (first < kBCalls && pair_word[first] != -1) + ++first; + if (first == kBCalls) { + evaluate_pair_word(directions, slots); + return; + } + + pair_word[first] = next_label; + for (int partner = first + 1; partner < kBCalls; ++partner) { + if (pair_word[partner] != -1 || + axes_by_call[first] != axes_by_call[partner]) + continue; + pair_word[partner] = next_label; + pair_calls_by_axis(first + 1, next_label + 1, directions, slots); + pair_word[partner] = -1; + } + pair_word[first] = -1; +} + +void visit_frame(const vector &directions, const vector &slots) { + ++frame_patterns; + events.clear(); + events.reserve(event_count); + int row0 = 1, row1 = 2, slot_index = 0, source_call = 0; + for (int time = 0; time < event_count; ++time) { + if (slot_index < transfers && slots[slot_index] == time) { + const int direction = directions[slot_index++]; + events.push_back({direction + 1}); + if (direction == 0) + row0 ^= row1; + else + row1 ^= row0; + } else { + axes_by_call[source_call++] = fixed_port_axis(row0, row1); + events.push_back({0}); + } + } + if (slot_index != transfers || source_call != kBCalls || row0 != 1 || + row1 != 2) + abort(); + + pair_word.fill(-1); + pair_calls_by_axis(0, 0, directions, slots); +} + +void choose_slots(int next, vector &slots, const vector &directions) { + if (static_cast(slots.size()) == transfers) { + visit_frame(directions, slots); + return; + } + const int have = static_cast(slots.size()); + for (int time = next; time <= event_count - (transfers - have); ++time) { + slots.push_back(time); + choose_slots(time + 1, slots, directions); + slots.pop_back(); + } +} + +void run_exact_census() { + event_count = kBCalls + transfers; + const int direction_words = 1 << transfers; + for (int code = 0; code < direction_words; ++code) { + vector directions(static_cast(transfers)); + for (int index = 0; index < transfers; ++index) + directions[index] = (code >> index) & 1; + if (!identity_word(directions)) + continue; + ++identity_words; + vector slots; + slots.reserve(static_cast(transfers)); + choose_slots(0, slots, directions); + } + + const unsigned long long full_schedules = + static_cast(frame_patterns) * kCanonicalPairings; + cout << "PASS_FIXED_PORT_CENSUS\n"; + cout << "transfers=" << transfers + << " identity_direction_words=" << identity_words + << " frame_patterns=" << frame_patterns + << " canonical_pairings_per_frame=" << kCanonicalPairings + << " full_schedules=" << full_schedules + << " legal_schedules=" << legal_schedules + << " max_coverage=" << best_coverage + << " universal=" << (best_coverage == 32) << "\n"; + cout << "coverage_hist"; + for (int size = 0; size <= 32; ++size) + if (coverage_hist[size] != 0) + cout << ' ' << size << ':' << coverage_hist[size]; + cout << "\n"; + cout << "best_directions"; + for (int direction : best_directions) + cout << ' ' << direction; + cout << " best_slots"; + for (int slot : best_slots) + cout << ' ' << slot; + cout << " best_word"; + for (int label : best_word) + cout << ' ' << label; + cout << " best_axes"; + for (int axis : best_axes) + cout << ' ' << axis; + cout << " best_cover=0x" << hex << best_cover << dec << "\n"; +} + +bool run_eight_transfer_positive_control() { + constexpr array directions{1, 1, 0, 0, 1, 1, 0, 0}; + constexpr array slots{0, 2, 3, 5, 8, 10, 11, 13}; + constexpr array word{0, 1, 2, 3, 0, 4, 3, 1, 4, 2}; + constexpr array expected_axes{3, 1, 1, 1, 1}; + + array source_axes{}; + array source_state{}; + vector witness_events; + witness_events.reserve(kBCalls + 8); + int row0 = 1, row1 = 2, slot_index = 0, source_call = 0; + for (int time = 0; time < kBCalls + 8; ++time) { + if (slot_index < 8 && slots[slot_index] == time) { + const int direction = directions[slot_index++]; + witness_events.push_back({direction + 1}); + if (direction == 0) + row0 ^= row1; + else + row1 ^= row0; + } else { + const int axis = fixed_port_axis(row0, row1); + const int label = word[source_call++]; + if (source_axes[label] == 0) + source_axes[label] = axis; + else if (source_axes[label] != axis) + return false; + witness_events.push_back({0}); + } + } + if (slot_index != 8 || source_call != kBCalls || row0 != 1 || row1 != 2 || + source_axes != expected_axes) + return false; + + vector boundaries; + boundaries.reserve(kBCalls + 9); + row0 = 1; + row1 = 2; + auto record = [&]() { + boundaries.push_back({row0, project_mask(row0, source_state)}); + }; + record(); + source_call = 0; + for (const Event &event : witness_events) { + if (event.kind == 0) { + const int label = word[source_call]; + source_state[label] ^= source_axes[label]; + ++source_call; + } else if (event.kind == 1) { + row0 ^= row1; + } else { + row1 ^= row0; + } + record(); + } + if (row0 != 1 || row1 != 2 || + any_of(source_state.begin(), source_state.end(), + [](int value) { return value != 0; })) + return false; + + array covered{}; + int readout_pairs = 0; + for (int target = 1; target < 32; ++target) { + bool found = false; + for (size_t first = 0; first < boundaries.size() && !found; ++first) { + for (size_t second = first + 1; second < boundaries.size(); ++second) { + if (boundaries[first].row0 == boundaries[second].row0 && + (boundaries[first].source_mask ^ boundaries[second].source_mask) == + target) { + covered[static_cast(target)] = true; + ++readout_pairs; + found = true; + break; + } + } + } + if (!found) + return false; + } + + // Exercise the actual census path, including compatible-pair generation + // and difference_cover, on this restoring eight-transfer frame. This is + // bounded to one frame, not an exhaustive eight-transfer census. + transfers = 8; + event_count = kBCalls + transfers; + visit_frame(vector(directions.begin(), directions.end()), + vector(slots.begin(), slots.end())); + if (frame_patterns != 1 || coverage_hist[32] == 0) + return false; + cout << "PASS_FIXED_PORT_EIGHT_TRANSFER_POSITIVE_CONTROL\n"; + cout << "engine_frame_patterns=" << frame_patterns + << " engine_legal_pairings=" << legal_schedules + << " engine_universal_pairings=" << coverage_hist[32] << "\n"; + cout << "transfers=8 source_calls=10 readout_pairs=" << readout_pairs + << " readout_calls=" << 2 * readout_pairs << " covered_nonzero_masks=" + << count(covered.begin() + 1, covered.end(), true) + << " roots_restored=1 sources_restored=1\n"; + cout << "directions"; + for (int direction : directions) + cout << ' ' << direction; + cout << " slots"; + for (int slot : slots) + cout << ' ' << slot; + cout << " source_word"; + for (int label : word) + cout << ' ' << label; + cout << " source_axes"; + for (int axis : source_axes) + cout << ' ' << axis; + cout << "\n"; + return true; +} + +int main(int argc, char **argv) { + if (argc != 2) { + cerr << "usage: fixed_port_census \n"; + return 2; + } + int requested = -1; + const string_view argument(argv[1]); + const auto [end, error] = + from_chars(argument.data(), argument.data() + argument.size(), requested); + if (error != errc{} || end != argument.data() + argument.size() || + requested < 0 || requested > kMaxTransfers) { + cerr << "usage: fixed_port_census \n"; + return 2; + } + + if (requested == 8) + return run_eight_transfer_positive_control() ? 0 : 1; + transfers = requested; + run_exact_census(); + return 0; +} diff --git a/research/scalable-dirty-connectors/obstruction.py b/research/scalable-dirty-connectors/obstruction.py new file mode 100644 index 0000000000..97f015e5ac --- /dev/null +++ b/research/scalable-dirty-connectors/obstruction.py @@ -0,0 +1,94 @@ +"""Exact finite facts for the two-dirty-root scalability obstruction. + +Two word generators and two difference-set implementations are compared per +word, not merely against a common histogram. Apache-2.0; AI-assisted. +""" + +from collections import Counter +from math import factorial + + +def growth_words(n): + word, counts = [], [] + + def visit(): + if len(word) == 2 * n: + yield tuple(word) + return + for label in range(len(counts) + (len(counts) < n)): + fresh = label == len(counts) + if fresh: + counts.append(0) + if counts[label] < 2: + counts[label] += 1 + word.append(label) + yield from visit() + word.pop() + counts[label] -= 1 + if fresh: + counts.pop() + + yield from visit() + + +def matching_words(n): + word = [-1] * (2 * n) + + def pair(remaining, label): + if not remaining: + yield tuple(word) + return + first = remaining[0] + for index in range(1, len(remaining)): + second = remaining[index] + word[first] = word[second] = label + yield from pair(remaining[1:index] + remaining[index + 1 :], label + 1) + word[first] = word[second] = -1 + + yield from pair(tuple(range(2 * n)), 0) + + +def differences(word): + points, state = [0], 0 + for label in word: + state ^= 1 << label + points.append(state) + covered = {a ^ b for a in points for b in points} + return sum(1 << mask for mask in covered) + + +def dual_differences(word, n): + # Compute every prefix parity directly from its substring, then use the + # dual membership criterion instead of pairwise-XOR construction. + points = { + sum((word[:boundary].count(j) % 2) << j for j in range(n)) + for boundary in range(len(word) + 1) + } + return sum( + 1 << mask for mask in range(1 << n) + if any(point ^ mask in points for point in points) + ) + + +def census(): + result = {} + for n, maximum in ((5, 31), (6, 49)): + primary = {word: differences(word) for word in growth_words(n)} + independent = {word: dual_differences(word, n) for word in matching_words(n)} + expected_count = factorial(2 * n) // (2**n * factorial(n)) + if len(primary) != expected_count or primary != independent: + raise ValueError("closed-word generators or difference engines disagree") + histogram = Counter(coverage.bit_count() for coverage in primary.values()) + if max(histogram) != maximum: + raise ValueError("closed-word maximum changed") + result[str(n)] = { + "words": len(primary), "max_coverage": max(histogram), + "maximizers": histogram[maximum], + "histogram": {str(size): count for size, count in sorted(histogram.items())}, + } + return result + + +if __name__ == "__main__": + import json + print(json.dumps(census(), indent=2)) diff --git a/research/scalable-dirty-connectors/verify.py b/research/scalable-dirty-connectors/verify.py new file mode 100644 index 0000000000..a7b3a8b335 --- /dev/null +++ b/research/scalable-dirty-connectors/verify.py @@ -0,0 +1,306 @@ +#!/usr/bin/env python3 +"""Physical-row polynomial replay, rectangular matrix oracle and controls. + +No normalized-axis or Gray-path identity is used by the replay interpreter. +All safety/correctness checks remain active under python -O. Apache-2.0. +""" + +from collections import Counter, deque +from dataclasses import replace +import hashlib +import json +from math import comb +from pathlib import Path +import random +import sys + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from connector import extra_readout_baseline, fixed_port_five, gray_baseline, star +from obstruction import census + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def replay(program, *, minimal_sources=False, paired_readouts=True): + """Root bits are independent dirt; upper bits are formal B_j(x_j). + + For each output m, applying the formal linear map A_m to these bits is + injective as a *formal expression*. This proves the identity for arbitrary + maps; no actual A or B needs to be injective, square, or invertible. + """ + n, k = program.sources, program.roots + require(type(n) is int and n >= 4, "invalid sources") + require(type(k) is int and k >= 1, "invalid roots") + require(paired_readouts or k == 1, "extra-readout contract is one-root only") + roots = [1 << i for i in range(k)] + outputs = [0] * (1 << n) + source_counts, output_counts, tags = Counter(), Counter(), Counter() + ports = {} + for operation in program.operations: + require(type(operation) is tuple and len(operation) == 3, "invalid operation") + tag, label, port = operation + require(tag in ("B", "A", "X"), "invalid opcode") + require(type(label) is int and type(port) is int, "noninteger operand") + require(0 <= port < k, "invalid port") + tags[tag] += 1 + if tag == "X": + require(0 <= label < k and label != port, "invalid transfer") + roots[label] ^= roots[port] + elif tag == "B": + require(0 <= label < n, "invalid source") + roots[port] ^= 1 << (k + label) + source_counts[label] += 1 + ports.setdefault(label, set()).add(port) + else: + require(1 <= label < (1 << n), "invalid target") + outputs[label] ^= roots[port] + output_counts[label] += 1 + require(roots == [1 << i for i in range(k)], "dirty roots or sources not restored") + require(all(outputs[m] == m << k for m in range(1, 1 << n)), "wrong output polynomial") + require(all(output_counts[m] >= 2 and output_counts[m] % 2 == 0 + for m in range(1, 1 << n)), "even readout bill") + if paired_readouts: + require(all(output_counts[m] == 2 for m in range(1, 1 << n)), "paired readout bill") + require(all(source_counts[j] >= 2 for j in range(n)), "source bill") + if minimal_sources: + require(all(source_counts[j] == 2 for j in range(n)), "nonminimal source calls") + require(all(len(ports[j]) == 1 for j in range(n)), "source port changed") + require(all(op[2] == 0 for op in program.operations if op[0] == "A"), "readout port changed") + encoded = json.dumps(program.operations, separators=(",", ":")).encode() + return { + "sources": n, "roots": k, "source_calls": tags["B"], + "readouts": tags["A"], "transfers": tags["X"], + "instructions": len(program.operations), + "source_multiplicities": [source_counts[j] for j in range(n)], + "source_ports": [sorted(ports[j]) for j in range(n)], + "readout_multiplicity_histogram": { + str(count): targets for count, targets in sorted(Counter(output_counts.values()).items()) + }, + "program_sha256": hashlib.sha256(encoded).hexdigest(), + } + + +def apply(matrix, vector): + return sum(((row & vector).bit_count() % 2) << i for i, row in enumerate(matrix)) + + +def check_extra_readout_minima(program): + """An independent pair-difference BFS checks the compiler's subset DP. + + Any even subset of t observations is t/2 pair differences. Conversely, + canceling duplicated endpoints in a shortest pair representation yields + an even subset of no larger size. Thus the two minima coincide. + """ + points, state = [0], 0 + for tag, label, port in program.operations: + if tag == "B": + state ^= 1 << label + points.append(state) + differences = sorted({a ^ b for a in points for b in points} - {0}) + distance = {0: 0} + todo = deque([0]) + while todo: + mask = todo.popleft() + for difference in differences: + target = mask ^ difference + if target not in distance: + distance[target] = distance[mask] + 1 + todo.append(target) + counts = Counter(label for tag, label, port in program.operations if tag == "A") + require(len(distance) == 1 << program.sources, "pair-difference span") + require(all(counts[m] == 2 * distance[m] for m in range(1, 1 << program.sources)), + "subset DP disagrees with shortest pair-difference BFS") + + +def dense_case(program, rng, trial): + n, k = program.sources, program.roots + root_width = 1 + trial % 7 + input_width = 1 + (trial * 3) % 9 + output_width = 1 + (trial * 5) % 8 + b = [[rng.getrandbits(input_width) for _ in range(root_width)] for _ in range(n)] + a = [[rng.getrandbits(root_width) for _ in range(output_width)] for _ in range(1 << n)] + # Include singular/zero maps deliberately; restoration cannot rely on them. + if trial % 3 == 0: + b[0] = [0] * root_width + if trial % 4 == 0: + a[-1] = [1] * output_width + x = [rng.getrandbits(input_width) for _ in range(n)] + roots = [rng.getrandbits(root_width) for _ in range(k)] + outputs = [rng.getrandbits(output_width) for _ in range(1 << n)] + old_roots, expected = roots[:], outputs[:] + responses = [apply(matrix, source) for matrix, source in zip(b, x)] + for mask in range(1, 1 << n): + summed = 0 + for j, response in enumerate(responses): + if mask & (1 << j): + summed ^= response + expected[mask] ^= apply(a[mask], summed) + for tag, label, port in program.operations: + if tag == "X": + roots[label] ^= roots[port] + elif tag == "B": + roots[port] ^= apply(b[label], x[label]) + else: + outputs[label] ^= apply(a[label], roots[port]) + require(roots == old_roots and outputs == expected, "matrix oracle mismatch") + # The additive batch is its own inverse, including all initially dirty rows. + for tag, label, port in reversed(program.operations): + if tag == "X": + roots[label] ^= roots[port] + elif tag == "B": + roots[port] ^= apply(b[label], x[label]) + else: + outputs[label] ^= apply(a[label], roots[port]) + require(roots == old_roots, "inverse root mismatch") + for mask in range(1, 1 << n): + summed = 0 + for j, response in enumerate(responses): + if mask & (1 << j): + summed ^= response + require(outputs[mask] == expected[mask] ^ apply(a[mask], summed), "inverse output mismatch") + + +def failure_controls(program): + controls = 0 + for tag in ("B", "A", "X"): + for at, op in enumerate(program.operations): + if op[0] != tag: + continue + edited = program.operations[:at] + program.operations[at + 1 :] + try: + replay(replace(program, operations=edited), minimal_sources=True) + except ValueError: + controls += 1 + else: + raise ValueError(f"accepted omitted {tag} at {at}") + for at, (tag, label, port) in enumerate(program.operations): + if tag == "X": + wrong = (tag, port, label) + else: + wrong = (tag, label, (port + 1) % program.roots) + edited = program.operations[:at] + (wrong,) + program.operations[at + 1 :] + try: + replay(replace(program, operations=edited), minimal_sources=True) + except ValueError: + controls += 1 + else: + raise ValueError(f"accepted wrong port/direction at {at}") + if tag in ("B", "A"): + wrong_label = (label + 1) % program.sources if tag == "B" else label % ((1 << program.sources) - 1) + 1 + wrong = (tag, wrong_label, port) + edited = program.operations[:at] + (wrong,) + program.operations[at + 1 :] + try: + replay(replace(program, operations=edited), minimal_sources=True) + except ValueError: + controls += 1 + else: + raise ValueError(f"accepted wrong label at {at}") + for wrong in (("B", True, 0), ("A", 0, 0), ("X", 0, 0), ("B", 0.0, 0), ("B", 0, program.roots)): + try: + replay(replace(program, operations=program.operations + (wrong,))) + except ValueError: + controls += 1 + else: + raise ValueError("accepted malformed operation") + return controls + + +def main(): + require(sys.argv[1:] in ([], ["--write-expected"]), "use --write-expected or no arguments") + receipt = {"star": [], "gray": [], "extra_readout": [], "fixed_port_five": None} + rng = random.Random(0x53474152) + extra_rng = random.Random(0x45585452) + dense_cases = 0 + for n in range(4, 11): + candidate, baseline = star(n), gray_baseline(n) + bill = replay(candidate, minimal_sources=True) + require(bill["source_calls"] == 2 * n, "star source formula") + require(bill["readouts"] == 2 * ((1 << n) - 1), "star output formula") + require(bill["transfers"] == 8 * ((1 << (n - 4)) - 1), "star transfer formula") + old = replay(baseline) + require(old["source_calls"] == (1 << (n // 2)) + (1 << (n - n // 2)), "Gray source formula") + receipt["star"].append(bill) + receipt["gray"].append(old) + extra = extra_readout_baseline(n) + check_extra_readout_minima(extra) + alternative = replay(extra, minimal_sources=True, paired_readouts=False) + require(alternative["source_calls"] == 2 * n and alternative["transfers"] == 0, + "extra-readout source/transfer bill") + require(alternative["readouts"] <= n * (1 << n), "extra-readout general bound") + if n in (5, 6, 7, 8): + require(alternative["readouts"] == {5: 64, 6: 156, 7: 368, 8: 828}[n], + "reviewed extra-readout invoice") + receipt["extra_readout"].append(alternative) + for program in (candidate, baseline, extra): + for trial in range(20): + dense_case(program, extra_rng if program is extra else rng, trial) + dense_cases += 1 + fixed = fixed_port_five() + receipt["fixed_port_five"] = replay(fixed, minimal_sources=True) + for trial in range(40): + dense_case(fixed, rng, trial) + dense_cases += 1 + controls = sum(failure_controls(program) for program in (star(6), fixed)) + # With several dirty roots, three distinct injection axes can sum to zero. + # Thus >=2 is necessary, but an even source-call count is NOT necessary. + excursion = ( + ("X", 0, 1), ("X", 1, 0), ("X", 0, 1), ("B", 0, 0), + ("X", 1, 0), ("X", 0, 1), ("B", 0, 0), ("X", 1, 0), ("B", 0, 0), + ) + positive = star(5) + odd = replace(positive, operations=excursion + positive.operations) + receipt["odd_source_positive_control"] = replay(odd) + require(receipt["odd_source_positive_control"]["source_multiplicities"][0] == 5, "odd source control") + receipt["dense_cases"] = dense_cases + receipt["rejected_mutations"] = controls + # Preserve every existing paired-call control. The additional one-root + # baseline has separate omission and valid-label controls under its wider + # even-readout contract, rather than disabling the star's paired checks. + extra = extra_readout_baseline(6) + extra_controls = 0 + for at, (tag, label, port) in enumerate(extra.operations): + wrong_label = (label + 1) % 6 if tag == "B" else label % 63 + 1 + for edited in ( + extra.operations[:at] + extra.operations[at + 1 :], + extra.operations[:at] + ((tag, wrong_label, port),) + extra.operations[at + 1 :], + ): + try: + replay(replace(extra, operations=edited), minimal_sources=True, paired_readouts=False) + except ValueError: + extra_controls += 1 + else: + raise ValueError("accepted corrupted extra-readout program") + receipt["extra_readout_rejected_mutations"] = extra_controls + # Exact finite corroboration of the all-n counting proof in the README. + # 17^8 < 2*16^8 bounds the binomial volume without floating-point entropy. + require(17**8 < 2 * 16**8, "binomial volume proof constant") + for n in range(4, 65): + volume = sum(comb(2 * n, i) for i in range(n // 8 + 1)) + require(volume < 1 << (n - 1), "low-readout subset volume") + receipt["readout_bound_controls"] = {"n_min": 4, "n_max": 64, "exact_cases": 61} + # A repeated pair at one boundary contributes zero, so this equivalent + # program must pass semantic replay even though its invoice is larger. + zero_pair = (("A", 1, 0), ("A", 1, 0)) + enlarged = replay(replace(extra, operations=zero_pair + extra.operations), + minimal_sources=True, paired_readouts=False) + require(enlarged["readouts"] == receipt["extra_readout"][2]["readouts"] + 2, + "neutral extra-readout pair positive control") + receipt["closed_word_census"] = census() + path = Path(__file__).with_name("EXPECTED.json") + if sys.argv[1:]: + path.write_text(json.dumps(receipt, indent=2) + "\n") + else: + # JSON encodings distinguish true/1 and 1.0/1; ordinary Python equality + # would accept these type corruptions in an otherwise identical bill. + stored = json.dumps(json.loads(path.read_text()), sort_keys=True, separators=(",", ":")) + actual = json.dumps(receipt, sort_keys=True, separators=(",", ":")) + require(stored == actual, "regression receipt mismatch") + print(f"PASS_SCALABLE_DIRTY_CONNECTORS n=4..10 dense={dense_cases} rejected={controls} " + f"extra_rejected={extra_controls} fixed_port=8") + + +if __name__ == "__main__": + main()