diff --git a/research/scatter-alias-native-audit/NATIVE.json b/research/scatter-alias-native-audit/NATIVE.json new file mode 100644 index 0000000000..cabca7a61f --- /dev/null +++ b/research/scatter-alias-native-audit/NATIVE.json @@ -0,0 +1,1903 @@ +{ + "balanced_minus_selected": { + "adds": 2, + "copies": 1, + "copy_rank_sum": 7, + "erasures": 1, + "moves": 0, + "rank_mass": 7, + "records": 4, + "scatter_adds": 2 + }, + "columns": 661, + "fixtures": { + "balanced_alias": { + "artifacts_sha256": { + "249-records.bin": "ee0be35807a5a49a4204ab89f4d132ac6164ecef72fc39e9858b12d70166bb52", + "249-states.json": "79f257bcad74e48e10083d6b7674e6334979573d7707436bb9c7bec20ab541f0", + "frames.json": "d006b3bfe0c04afecfea7aecfa59dfe4298b99501c70da3938e40289bc2f5010" + }, + "guard": { + "accepted": false, + "existing_outputs_preserved": true, + "rejected_before_creation": true, + "valid_bytes_preserved": null + }, + "invoice": { + "adds": 24307, + "copies": 10, + "copy_rank_sum": 70, + "erasures": 10, + "moves": 2911, + "paid_histogram": [ + [ + 1, + 1323 + ], + [ + 2, + 1342 + ], + [ + 3, + 79 + ], + [ + 4, + 44 + ], + [ + 5, + 102 + ], + [ + 6, + 11 + ], + [ + 7, + 20 + ] + ], + "rank_mass": 5136, + "records": 27238, + "scatter_adds": 529 + }, + "prefix": { + "below_2_104": true, + "bits": 93, + "forward": "49347", + "payload": "9528119495320518471870892800", + "reverse": "1113070" + }, + "scalar_differences": [], + "symbolic": { + "columns": 661, + "conclusion": { + "C_is_U_inverse": true, + "J_identity": true, + "K_equals_D": true, + "U_block_form": true + }, + "copy_ranks": [ + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7 + ], + "gates": { + "A": 2075, + "B": 712, + "C": 2574, + "D": 111 + }, + "hypotheses": { + "H1_no_target_feeds_z": true, + "H2_D_frame0_targets_from_helpers": true, + "H3_A_z_only_scatter_targets_B_split": true, + "H4_C_literal_reverse_at_full": true, + "H5_V_identity": true + }, + "interleaving": { + "B_target_reads_of_registers_rewritten_earlier_in_B": 111, + "B_z_operand_kinds": { + "helper<-helper": 3, + "helper<-source": 13, + "source<-helper": 108, + "source<-source": 375 + }, + "B_z_operand_kinds_by_dim": { + "dim4:helper<-source": 13, + "dim4:source<-source": 375, + "dim6:helper<-helper": 3, + "dim6:source<-helper": 108 + }, + "B_z_write_frame_dims": { + "4": 388, + "6": 111 + }, + "B_z_writes_after_a_target_read_of_the_same_register": 454, + "cleanup_gates": 2574, + "helper_writes_B": 16, + "source_writes_A": 0, + "source_writes_B": 483, + "sources_rewritten_B": 108, + "target_reads_of_targets": 0, + "z_gates_A": 2075, + "z_gates_B": 499 + }, + "punctured": 9, + "status": "PASS_EXACT_REPLAY_AND_INTERLEAVED_INTERFACE", + "totals_on_punctured_hyperplanes": true, + "v": 111 + } + }, + "baseline": { + "artifacts_sha256": { + "249-records.bin": "ea44aa047a2a9cf034de8b56b2166c49cf2dbdf9cd9ed6a20299a4f2b05ef09a", + "249-states.json": "701ca802279b23ba23ffd502935ae9f34a33fc81fdfd266042f3208a2cb16265", + "frames.json": "d006b3bfe0c04afecfea7aecfa59dfe4298b99501c70da3938e40289bc2f5010" + }, + "guard": { + "accepted": true, + "existing_outputs_preserved": null, + "rejected_before_creation": null, + "valid_bytes_preserved": true + }, + "invoice": { + "adds": 24305, + "copies": 9, + "copy_rank_sum": 63, + "erasures": 9, + "moves": 2911, + "paid_histogram": [ + [ + 1, + 1323 + ], + [ + 2, + 1342 + ], + [ + 3, + 79 + ], + [ + 4, + 44 + ], + [ + 5, + 102 + ], + [ + 6, + 11 + ], + [ + 7, + 19 + ] + ], + "rank_mass": 5129, + "records": 27234, + "scatter_adds": 527 + }, + "prefix": { + "below_2_104": true, + "bits": 93, + "forward": "49347", + "payload": "9528119495320518471870892800", + "reverse": "1113070" + }, + "scalar_differences": [], + "symbolic": { + "columns": 661, + "conclusion": { + "C_is_U_inverse": true, + "J_identity": true, + "K_equals_D": true, + "U_block_form": true + }, + "copy_ranks": [ + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7 + ], + "gates": { + "A": 2075, + "B": 712, + "C": 2574, + "D": 111 + }, + "hypotheses": { + "H1_no_target_feeds_z": true, + "H2_D_frame0_targets_from_helpers": true, + "H3_A_z_only_scatter_targets_B_split": true, + "H4_C_literal_reverse_at_full": true, + "H5_V_identity": true + }, + "interleaving": { + "B_target_reads_of_registers_rewritten_earlier_in_B": 111, + "B_z_operand_kinds": { + "helper<-helper": 3, + "helper<-source": 13, + "source<-helper": 108, + "source<-source": 375 + }, + "B_z_operand_kinds_by_dim": { + "dim4:helper<-source": 13, + "dim4:source<-source": 375, + "dim6:helper<-helper": 3, + "dim6:source<-helper": 108 + }, + "B_z_write_frame_dims": { + "4": 388, + "6": 111 + }, + "B_z_writes_after_a_target_read_of_the_same_register": 454, + "cleanup_gates": 2574, + "helper_writes_B": 16, + "source_writes_A": 0, + "source_writes_B": 483, + "sources_rewritten_B": 108, + "target_reads_of_targets": 0, + "z_gates_A": 2075, + "z_gates_B": 499 + }, + "punctured": 9, + "status": "PASS_EXACT_REPLAY_AND_INTERLEAVED_INTERFACE", + "totals_on_punctured_hyperplanes": true, + "v": 111 + } + }, + "distinct_helpers": { + "artifacts_sha256": { + "249-records.bin": "12081d70e0040c89e645f2be94a085dae2f11f8bc59188d56eeae0c02b0b239d", + "249-states.json": "a597733c50f1fcfd8cb00c884d64284da9bd8a5bbe0ed29ff05403a8b2b75db8", + "frames.json": "d006b3bfe0c04afecfea7aecfa59dfe4298b99501c70da3938e40289bc2f5010" + }, + "guard": { + "accepted": false, + "existing_outputs_preserved": true, + "rejected_before_creation": true, + "valid_bytes_preserved": null + }, + "invoice": { + "adds": 24307, + "copies": 10, + "copy_rank_sum": 70, + "erasures": 10, + "moves": 2911, + "paid_histogram": [ + [ + 1, + 1323 + ], + [ + 2, + 1342 + ], + [ + 3, + 79 + ], + [ + 4, + 44 + ], + [ + 5, + 102 + ], + [ + 6, + 11 + ], + [ + 7, + 20 + ] + ], + "rank_mass": 5136, + "records": 27238, + "scatter_adds": 529 + }, + "prefix": { + "below_2_104": true, + "bits": 93, + "forward": "49347", + "payload": "9528119495320518471870892800", + "reverse": "1113070" + }, + "scalar_differences": [ + { + "input_columns": [ + 1, + 2, + 5, + 6, + 11, + 12, + 13, + 14, + 16, + 19, + 21, + 24, + 25, + 26, + 27, + 31, + 33, + 34, + 36, + 38, + 39, + 44, + 45, + 46, + 50, + 52, + 57, + 58, + 59, + 60, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 75, + 77, + 79, + 82, + 83, + 86, + 87, + 89, + 91, + 93, + 95, + 96, + 97, + 100, + 101, + 104, + 105, + 108, + 109, + 223, + 224, + 226, + 231, + 233, + 235, + 238, + 242, + 248, + 251, + 252, + 256, + 257, + 258, + 260, + 263, + 264, + 265, + 266, + 271, + 274, + 277, + 279, + 280, + 281, + 284, + 286, + 287, + 288, + 290, + 291, + 293, + 294, + 296, + 297, + 301, + 303, + 306, + 312, + 315, + 316, + 318, + 321, + 325, + 326, + 327, + 340, + 343, + 348, + 352, + 355, + 360, + 361, + 363, + 365, + 367, + 368, + 371, + 374, + 376, + 382, + 385, + 386, + 388, + 389, + 391, + 402, + 406, + 411, + 422, + 426, + 429, + 430, + 434, + 439, + 441, + 450, + 452, + 455, + 457, + 459, + 467, + 469, + 471, + 479, + 480, + 488, + 490, + 501, + 506, + 514, + 515, + 518, + 525, + 530, + 531, + 536, + 538, + 544, + 554, + 561, + 568, + 569, + 571, + 582, + 593, + 594, + 596, + 606, + 608, + 612, + 617, + 624, + 625, + 629, + 631, + 641, + 643, + 644, + 649, + 656 + ], + "output": 175 + } + ], + "symbolic": { + "columns": 661, + "conclusion": { + "C_is_U_inverse": true, + "J_identity": true, + "K_equals_D": true, + "U_block_form": true + }, + "copy_ranks": [ + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7 + ], + "gates": { + "A": 2075, + "B": 712, + "C": 2574, + "D": 111 + }, + "hypotheses": { + "H1_no_target_feeds_z": true, + "H2_D_frame0_targets_from_helpers": true, + "H3_A_z_only_scatter_targets_B_split": true, + "H4_C_literal_reverse_at_full": true, + "H5_V_identity": true + }, + "interleaving": { + "B_target_reads_of_registers_rewritten_earlier_in_B": 111, + "B_z_operand_kinds": { + "helper<-helper": 3, + "helper<-source": 13, + "source<-helper": 108, + "source<-source": 375 + }, + "B_z_operand_kinds_by_dim": { + "dim4:helper<-source": 13, + "dim4:source<-source": 375, + "dim6:helper<-helper": 3, + "dim6:source<-helper": 108 + }, + "B_z_write_frame_dims": { + "4": 388, + "6": 111 + }, + "B_z_writes_after_a_target_read_of_the_same_register": 454, + "cleanup_gates": 2574, + "helper_writes_B": 16, + "source_writes_A": 0, + "source_writes_B": 483, + "sources_rewritten_B": 108, + "target_reads_of_targets": 0, + "z_gates_A": 2075, + "z_gates_B": 499 + }, + "punctured": 9, + "status": "PASS_EXACT_REPLAY_AND_INTERLEAVED_INTERFACE", + "totals_on_punctured_hyperplanes": true, + "v": 111 + } + }, + "unpaired_even": { + "artifacts_sha256": { + "249-records.bin": "458fd079ee59c3b04813f4afe8fdcf77394627f0b2159da256bd3672e013289e", + "249-states.json": "79f257bcad74e48e10083d6b7674e6334979573d7707436bb9c7bec20ab541f0", + "frames.json": "d006b3bfe0c04afecfea7aecfa59dfe4298b99501c70da3938e40289bc2f5010" + }, + "guard": { + "accepted": false, + "existing_outputs_preserved": true, + "rejected_before_creation": true, + "valid_bytes_preserved": null + }, + "invoice": { + "adds": 24306, + "copies": 10, + "copy_rank_sum": 70, + "erasures": 10, + "moves": 2911, + "paid_histogram": [ + [ + 1, + 1323 + ], + [ + 2, + 1342 + ], + [ + 3, + 79 + ], + [ + 4, + 44 + ], + [ + 5, + 102 + ], + [ + 6, + 11 + ], + [ + 7, + 20 + ] + ], + "rank_mass": 5136, + "records": 27237, + "scatter_adds": 528 + }, + "prefix": { + "below_2_104": true, + "bits": 93, + "forward": "49347", + "payload": "9528119495320518471870892800", + "reverse": "1113070" + }, + "scalar_differences": [ + { + "input_columns": [ + 0, + 2, + 4, + 6, + 8, + 11, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 24, + 27, + 29, + 30, + 32, + 35, + 37, + 39, + 40, + 43, + 44, + 46, + 47, + 49, + 52, + 54, + 55, + 57, + 59, + 63, + 65, + 66, + 68, + 69, + 71, + 73, + 74, + 75, + 76, + 83, + 84, + 86, + 89, + 91, + 92, + 94, + 97, + 98, + 100, + 105, + 106, + 107, + 108, + 223, + 226, + 235, + 251, + 256, + 258, + 260, + 264, + 265, + 266, + 274, + 280, + 281, + 284, + 286, + 291, + 297, + 301, + 306, + 315, + 318, + 321, + 326, + 340, + 343, + 361, + 365, + 368, + 374, + 382, + 385, + 386, + 388, + 411, + 422, + 426, + 439, + 450, + 457, + 467, + 480, + 488, + 506, + 515, + 518, + 530, + 536, + 538, + 554, + 569, + 571, + 593, + 596, + 612, + 624, + 625, + 631, + 644, + 656 + ], + "output": 175 + } + ], + "symbolic": { + "columns": 661, + "conclusion": { + "C_is_U_inverse": true, + "J_identity": true, + "K_equals_D": true, + "U_block_form": true + }, + "copy_ranks": [ + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7 + ], + "gates": { + "A": 2075, + "B": 712, + "C": 2574, + "D": 111 + }, + "hypotheses": { + "H1_no_target_feeds_z": true, + "H2_D_frame0_targets_from_helpers": true, + "H3_A_z_only_scatter_targets_B_split": true, + "H4_C_literal_reverse_at_full": true, + "H5_V_identity": true + }, + "interleaving": { + "B_target_reads_of_registers_rewritten_earlier_in_B": 111, + "B_z_operand_kinds": { + "helper<-helper": 3, + "helper<-source": 13, + "source<-helper": 108, + "source<-source": 375 + }, + "B_z_operand_kinds_by_dim": { + "dim4:helper<-source": 13, + "dim4:source<-source": 375, + "dim6:helper<-helper": 3, + "dim6:source<-helper": 108 + }, + "B_z_write_frame_dims": { + "4": 388, + "6": 111 + }, + "B_z_writes_after_a_target_read_of_the_same_register": 454, + "cleanup_gates": 2574, + "helper_writes_B": 16, + "source_writes_A": 0, + "source_writes_B": 483, + "sources_rewritten_B": 108, + "target_reads_of_targets": 0, + "z_gates_A": 2075, + "z_gates_B": 499 + }, + "punctured": 9, + "status": "PASS_EXACT_REPLAY_AND_INTERLEAVED_INTERFACE", + "totals_on_punctured_hyperplanes": true, + "v": 111 + } + }, + "unused_alias": { + "artifacts_sha256": { + "249-records.bin": "8527032c4eef4b18812779e4a90640c50e45c151b4ef1ed40d0369187a6bde90", + "249-states.json": "79f257bcad74e48e10083d6b7674e6334979573d7707436bb9c7bec20ab541f0", + "frames.json": "d006b3bfe0c04afecfea7aecfa59dfe4298b99501c70da3938e40289bc2f5010" + }, + "guard": { + "accepted": true, + "existing_outputs_preserved": null, + "rejected_before_creation": null, + "valid_bytes_preserved": true + }, + "invoice": { + "adds": 24305, + "copies": 10, + "copy_rank_sum": 70, + "erasures": 10, + "moves": 2911, + "paid_histogram": [ + [ + 1, + 1323 + ], + [ + 2, + 1342 + ], + [ + 3, + 79 + ], + [ + 4, + 44 + ], + [ + 5, + 102 + ], + [ + 6, + 11 + ], + [ + 7, + 20 + ] + ], + "rank_mass": 5136, + "records": 27236, + "scatter_adds": 527 + }, + "prefix": { + "below_2_104": true, + "bits": 93, + "forward": "49347", + "payload": "9528119495320518471870892800", + "reverse": "1113070" + }, + "scalar_differences": [], + "symbolic": { + "columns": 661, + "conclusion": { + "C_is_U_inverse": true, + "J_identity": true, + "K_equals_D": true, + "U_block_form": true + }, + "copy_ranks": [ + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7 + ], + "gates": { + "A": 2075, + "B": 712, + "C": 2574, + "D": 111 + }, + "hypotheses": { + "H1_no_target_feeds_z": true, + "H2_D_frame0_targets_from_helpers": true, + "H3_A_z_only_scatter_targets_B_split": true, + "H4_C_literal_reverse_at_full": true, + "H5_V_identity": true + }, + "interleaving": { + "B_target_reads_of_registers_rewritten_earlier_in_B": 111, + "B_z_operand_kinds": { + "helper<-helper": 3, + "helper<-source": 13, + "source<-helper": 108, + "source<-source": 375 + }, + "B_z_operand_kinds_by_dim": { + "dim4:helper<-source": 13, + "dim4:source<-source": 375, + "dim6:helper<-helper": 3, + "dim6:source<-helper": 108 + }, + "B_z_write_frame_dims": { + "4": 388, + "6": 111 + }, + "B_z_writes_after_a_target_read_of_the_same_register": 454, + "cleanup_gates": 2574, + "helper_writes_B": 16, + "source_writes_A": 0, + "source_writes_B": 483, + "sources_rewritten_B": 108, + "target_reads_of_targets": 0, + "z_gates_A": 2075, + "z_gates_B": 499 + }, + "punctured": 9, + "status": "PASS_EXACT_REPLAY_AND_INTERLEAVED_INTERFACE", + "totals_on_punctured_hyperplanes": true, + "v": 111 + } + } + }, + "native": { + "backend": "checked_cpp_int_128_standin", + "columns": 883, + "controls": { + "omit_alias_add": { + "columns": { + "accepted": false, + "reason": "local defining-decoder full formal column" + }, + "legality": { + "accepted": true, + "receipt": { + "all_final_frames_pass": true, + "common_frame_ADDs": 24306, + "containment_pairs_checked": 2386, + "copies": 10, + "donor_intersections": 0, + "erasures": 10, + "max_inherited_integer_abs": 2, + "nested_MOVEs": 2911, + "new_frame_ids_collision": false, + "nondegeneracy_checked_by_separate_exact_bank_audit": true, + "old_max_frame_id": 635, + "paid_histogram": [ + [ + 1, + 1323 + ], + [ + 2, + 1342 + ], + [ + 3, + 79 + ], + [ + 4, + 44 + ], + [ + 5, + 102 + ], + [ + 6, + 11 + ], + [ + 7, + 20 + ] + ], + "rank_mass": 5136, + "records": 27237, + "scope": "Independent chronological geometry/copy/source-owner audit. F2 all-column replay is in the separately freshly compiled transform receipt; address transform theorem and bank completion remain separate.", + "selected_helpers": 0, + "selected_pairs": 0, + "source_owner_intersections": 0, + "status": "PASS_INDEPENDENT_COHORT_LEGALITY_SOURCE_OWNERS_AND_LIFECYCLE" + } + } + }, + "underprice_copy_rank": { + "columns": { + "accepted": true, + "receipt": { + "bridge_additions": 666, + "copied_center_original_source_immutable": true, + "five_stage_additions": 121535, + "formal_columns_checked": 883, + "fresh_center_copies": 50, + "global_live_registers": 883, + "independent_dirty_registers": 439, + "local_odd_scalar_additions": 24307, + "local_raw_H": [ + [ + 1, + 1323 + ], + [ + 2, + 1342 + ], + [ + 3, + 79 + ], + [ + 4, + 44 + ], + [ + 5, + 102 + ], + [ + 6, + 12 + ], + [ + 7, + 19 + ] + ], + "local_registers": 661, + "local_scalar_additions": 24307, + "local_scalar_stream": "COHORT249-RECORDS.bin", + "negative_controls": [ + { + "omit_bridge": 0, + "rejected": true + }, + { + "omit_bridge": 1, + "rejected": true + }, + { + "omit_bridge": 2, + "rejected": true + }, + { + "omit_bridge": 3, + "rejected": true + }, + { + "omit_bridge": 4, + "rejected": true + }, + { + "omit_bridge": 5, + "rejected": true + } + ], + "new_Q_categories": [ + 28, + 29 + ], + "payload_prefix_bits": 93, + "payload_prefix_upper": "9528119495320518471870892800", + "reverse_fresh_center_copies": 20, + "scope": "All independent physical input columns over F2, including all arbitrary helper dirt, restored; external copied-center work closes to zero. New cohort scalar lift uses actual signed coefficients and computed cancellation-free bounds; unchanged source527 signed decoder remains separate defining evidence. Physical projector routing and paid rank/bank receipts are independently bound, not inferred from scalar check.", + "signed_lift_prefix": [ + { + "bits": 16, + "cancellation_free_signed_row_l1_upper": "49347", + "reverse": false + }, + { + "bits": 21, + "cancellation_free_signed_row_l1_upper": "1113070", + "reverse": true + } + ], + "signed_reverse_semantics": "Reverse ADD coefficient negated; reverse DISCARD is fresh COPY from recorded unchanged original center; reverse COPY is DISCARD. Each such block is inverse over every commutative coefficient ring, by elementary-shear induction.", + "stages": [ + { + "fresh_copies": 10, + "scalar_additions": 24307, + "signed_inverse": false, + "stage": 0 + }, + { + "fresh_copies": 10, + "scalar_additions": 24307, + "signed_inverse": true, + "stage": 1 + }, + { + "fresh_copies": 10, + "scalar_additions": 24307, + "signed_inverse": false, + "stage": 2 + }, + { + "fresh_copies": 10, + "scalar_additions": 24307, + "signed_inverse": true, + "stage": 3 + }, + { + "fresh_copies": 10, + "scalar_additions": 24307, + "signed_inverse": false, + "stage": 4 + } + ], + "status": "PASS_NEW_COHORT249_ALL_FIVE_STAGE_FORMAL_COLUMNS_AND_PREFIX_BILL" + } + }, + "legality": { + "accepted": false, + "reason": "COPY rank" + } + }, + "wrong_erase_source": { + "columns": { + "accepted": false, + "reason": "discard original-source binding" + }, + "legality": { + "accepted": false, + "reason": "invalid ERASE lifecycle" + } + } + }, + "fixtures": { + "balanced_alias": { + "10": { + "columns": { + "accepted": true, + "receipt": { + "bridge_additions": 666, + "copied_center_original_source_immutable": true, + "five_stage_additions": 121535, + "formal_columns_checked": 883, + "fresh_center_copies": 50, + "global_live_registers": 883, + "independent_dirty_registers": 439, + "local_odd_scalar_additions": 24307, + "local_raw_H": [ + [ + 1, + 1323 + ], + [ + 2, + 1342 + ], + [ + 3, + 79 + ], + [ + 4, + 44 + ], + [ + 5, + 102 + ], + [ + 6, + 11 + ], + [ + 7, + 20 + ] + ], + "local_registers": 661, + "local_scalar_additions": 24307, + "local_scalar_stream": "COHORT249-RECORDS.bin", + "negative_controls": [ + { + "omit_bridge": 0, + "rejected": true + }, + { + "omit_bridge": 1, + "rejected": true + }, + { + "omit_bridge": 2, + "rejected": true + }, + { + "omit_bridge": 3, + "rejected": true + }, + { + "omit_bridge": 4, + "rejected": true + }, + { + "omit_bridge": 5, + "rejected": true + } + ], + "new_Q_categories": [ + 28, + 29 + ], + "payload_prefix_bits": 93, + "payload_prefix_upper": "9528119495320518471870892800", + "reverse_fresh_center_copies": 20, + "scope": "All independent physical input columns over F2, including all arbitrary helper dirt, restored; external copied-center work closes to zero. New cohort scalar lift uses actual signed coefficients and computed cancellation-free bounds; unchanged source527 signed decoder remains separate defining evidence. Physical projector routing and paid rank/bank receipts are independently bound, not inferred from scalar check.", + "signed_lift_prefix": [ + { + "bits": 16, + "cancellation_free_signed_row_l1_upper": "49347", + "reverse": false + }, + { + "bits": 21, + "cancellation_free_signed_row_l1_upper": "1113070", + "reverse": true + } + ], + "signed_reverse_semantics": "Reverse ADD coefficient negated; reverse DISCARD is fresh COPY from recorded unchanged original center; reverse COPY is DISCARD. Each such block is inverse over every commutative coefficient ring, by elementary-shear induction.", + "stages": [ + { + "fresh_copies": 10, + "scalar_additions": 24307, + "signed_inverse": false, + "stage": 0 + }, + { + "fresh_copies": 10, + "scalar_additions": 24307, + "signed_inverse": true, + "stage": 1 + }, + { + "fresh_copies": 10, + "scalar_additions": 24307, + "signed_inverse": false, + "stage": 2 + }, + { + "fresh_copies": 10, + "scalar_additions": 24307, + "signed_inverse": true, + "stage": 3 + }, + { + "fresh_copies": 10, + "scalar_additions": 24307, + "signed_inverse": false, + "stage": 4 + } + ], + "status": "PASS_NEW_COHORT249_ALL_FIVE_STAGE_FORMAL_COLUMNS_AND_PREFIX_BILL" + } + }, + "legality": { + "accepted": true, + "receipt": { + "all_final_frames_pass": true, + "common_frame_ADDs": 24307, + "containment_pairs_checked": 2386, + "copies": 10, + "donor_intersections": 0, + "erasures": 10, + "max_inherited_integer_abs": 2, + "nested_MOVEs": 2911, + "new_frame_ids_collision": false, + "nondegeneracy_checked_by_separate_exact_bank_audit": true, + "old_max_frame_id": 635, + "paid_histogram": [ + [ + 1, + 1323 + ], + [ + 2, + 1342 + ], + [ + 3, + 79 + ], + [ + 4, + 44 + ], + [ + 5, + 102 + ], + [ + 6, + 11 + ], + [ + 7, + 20 + ] + ], + "rank_mass": 5136, + "records": 27238, + "scope": "Independent chronological geometry/copy/source-owner audit. F2 all-column replay is in the separately freshly compiled transform receipt; address transform theorem and bank completion remain separate.", + "selected_helpers": 0, + "selected_pairs": 0, + "source_owner_intersections": 0, + "status": "PASS_INDEPENDENT_COHORT_LEGALITY_SOURCE_OWNERS_AND_LIFECYCLE" + } + } + }, + "9": { + "columns": { + "accepted": false, + "reason": "center boundaries" + }, + "legality": { + "accepted": false, + "reason": "unclosed COPY" + } + } + }, + "baseline": { + "10": { + "columns": { + "accepted": false, + "reason": "center boundaries" + }, + "legality": { + "accepted": false, + "reason": "unclosed COPY" + } + }, + "9": { + "columns": { + "accepted": true, + "receipt": { + "bridge_additions": 666, + "copied_center_original_source_immutable": true, + "five_stage_additions": 121525, + "formal_columns_checked": 883, + "fresh_center_copies": 45, + "global_live_registers": 883, + "independent_dirty_registers": 439, + "local_odd_scalar_additions": 24305, + "local_raw_H": [ + [ + 1, + 1323 + ], + [ + 2, + 1342 + ], + [ + 3, + 79 + ], + [ + 4, + 44 + ], + [ + 5, + 102 + ], + [ + 6, + 11 + ], + [ + 7, + 19 + ] + ], + "local_registers": 661, + "local_scalar_additions": 24305, + "local_scalar_stream": "COHORT249-RECORDS.bin", + "negative_controls": [ + { + "omit_bridge": 0, + "rejected": true + }, + { + "omit_bridge": 1, + "rejected": true + }, + { + "omit_bridge": 2, + "rejected": true + }, + { + "omit_bridge": 3, + "rejected": true + }, + { + "omit_bridge": 4, + "rejected": true + }, + { + "omit_bridge": 5, + "rejected": true + } + ], + "new_Q_categories": [ + 28, + 29 + ], + "payload_prefix_bits": 93, + "payload_prefix_upper": "9528119495320518471870892800", + "reverse_fresh_center_copies": 18, + "scope": "All independent physical input columns over F2, including all arbitrary helper dirt, restored; external copied-center work closes to zero. New cohort scalar lift uses actual signed coefficients and computed cancellation-free bounds; unchanged source527 signed decoder remains separate defining evidence. Physical projector routing and paid rank/bank receipts are independently bound, not inferred from scalar check.", + "signed_lift_prefix": [ + { + "bits": 16, + "cancellation_free_signed_row_l1_upper": "49347", + "reverse": false + }, + { + "bits": 21, + "cancellation_free_signed_row_l1_upper": "1113070", + "reverse": true + } + ], + "signed_reverse_semantics": "Reverse ADD coefficient negated; reverse DISCARD is fresh COPY from recorded unchanged original center; reverse COPY is DISCARD. Each such block is inverse over every commutative coefficient ring, by elementary-shear induction.", + "stages": [ + { + "fresh_copies": 9, + "scalar_additions": 24305, + "signed_inverse": false, + "stage": 0 + }, + { + "fresh_copies": 9, + "scalar_additions": 24305, + "signed_inverse": true, + "stage": 1 + }, + { + "fresh_copies": 9, + "scalar_additions": 24305, + "signed_inverse": false, + "stage": 2 + }, + { + "fresh_copies": 9, + "scalar_additions": 24305, + "signed_inverse": true, + "stage": 3 + }, + { + "fresh_copies": 9, + "scalar_additions": 24305, + "signed_inverse": false, + "stage": 4 + } + ], + "status": "PASS_NEW_COHORT249_ALL_FIVE_STAGE_FORMAL_COLUMNS_AND_PREFIX_BILL" + } + }, + "legality": { + "accepted": true, + "receipt": { + "all_final_frames_pass": true, + "common_frame_ADDs": 24305, + "containment_pairs_checked": 2386, + "copies": 9, + "donor_intersections": 0, + "erasures": 9, + "max_inherited_integer_abs": 2, + "nested_MOVEs": 2911, + "new_frame_ids_collision": false, + "nondegeneracy_checked_by_separate_exact_bank_audit": true, + "old_max_frame_id": 635, + "paid_histogram": [ + [ + 1, + 1323 + ], + [ + 2, + 1342 + ], + [ + 3, + 79 + ], + [ + 4, + 44 + ], + [ + 5, + 102 + ], + [ + 6, + 11 + ], + [ + 7, + 19 + ] + ], + "rank_mass": 5129, + "records": 27234, + "scope": "Independent chronological geometry/copy/source-owner audit. F2 all-column replay is in the separately freshly compiled transform receipt; address transform theorem and bank completion remain separate.", + "selected_helpers": 0, + "selected_pairs": 0, + "source_owner_intersections": 0, + "status": "PASS_INDEPENDENT_COHORT_LEGALITY_SOURCE_OWNERS_AND_LIFECYCLE" + } + } + } + }, + "distinct_helpers": { + "10": { + "columns": { + "accepted": false, + "reason": "local defining-decoder full formal column" + }, + "legality": { + "accepted": true, + "receipt": { + "all_final_frames_pass": true, + "common_frame_ADDs": 24307, + "containment_pairs_checked": 2386, + "copies": 10, + "donor_intersections": 0, + "erasures": 10, + "max_inherited_integer_abs": 2, + "nested_MOVEs": 2911, + "new_frame_ids_collision": false, + "nondegeneracy_checked_by_separate_exact_bank_audit": true, + "old_max_frame_id": 635, + "paid_histogram": [ + [ + 1, + 1323 + ], + [ + 2, + 1342 + ], + [ + 3, + 79 + ], + [ + 4, + 44 + ], + [ + 5, + 102 + ], + [ + 6, + 11 + ], + [ + 7, + 20 + ] + ], + "rank_mass": 5136, + "records": 27238, + "scope": "Independent chronological geometry/copy/source-owner audit. F2 all-column replay is in the separately freshly compiled transform receipt; address transform theorem and bank completion remain separate.", + "selected_helpers": 0, + "selected_pairs": 0, + "source_owner_intersections": 0, + "status": "PASS_INDEPENDENT_COHORT_LEGALITY_SOURCE_OWNERS_AND_LIFECYCLE" + } + } + }, + "9": { + "columns": { + "accepted": false, + "reason": "center boundaries" + }, + "legality": { + "accepted": false, + "reason": "unclosed COPY" + } + } + }, + "unpaired_even": { + "10": { + "columns": { + "accepted": false, + "reason": "local defining-decoder full formal column" + }, + "legality": { + "accepted": true, + "receipt": { + "all_final_frames_pass": true, + "common_frame_ADDs": 24306, + "containment_pairs_checked": 2386, + "copies": 10, + "donor_intersections": 0, + "erasures": 10, + "max_inherited_integer_abs": 2, + "nested_MOVEs": 2911, + "new_frame_ids_collision": false, + "nondegeneracy_checked_by_separate_exact_bank_audit": true, + "old_max_frame_id": 635, + "paid_histogram": [ + [ + 1, + 1323 + ], + [ + 2, + 1342 + ], + [ + 3, + 79 + ], + [ + 4, + 44 + ], + [ + 5, + 102 + ], + [ + 6, + 11 + ], + [ + 7, + 20 + ] + ], + "rank_mass": 5136, + "records": 27237, + "scope": "Independent chronological geometry/copy/source-owner audit. F2 all-column replay is in the separately freshly compiled transform receipt; address transform theorem and bank completion remain separate.", + "selected_helpers": 0, + "selected_pairs": 0, + "source_owner_intersections": 0, + "status": "PASS_INDEPENDENT_COHORT_LEGALITY_SOURCE_OWNERS_AND_LIFECYCLE" + } + } + }, + "9": { + "columns": { + "accepted": false, + "reason": "center boundaries" + }, + "legality": { + "accepted": false, + "reason": "unclosed COPY" + } + } + }, + "unused_alias": { + "10": { + "columns": { + "accepted": true, + "receipt": { + "bridge_additions": 666, + "copied_center_original_source_immutable": true, + "five_stage_additions": 121525, + "formal_columns_checked": 883, + "fresh_center_copies": 50, + "global_live_registers": 883, + "independent_dirty_registers": 439, + "local_odd_scalar_additions": 24305, + "local_raw_H": [ + [ + 1, + 1323 + ], + [ + 2, + 1342 + ], + [ + 3, + 79 + ], + [ + 4, + 44 + ], + [ + 5, + 102 + ], + [ + 6, + 11 + ], + [ + 7, + 20 + ] + ], + "local_registers": 661, + "local_scalar_additions": 24305, + "local_scalar_stream": "COHORT249-RECORDS.bin", + "negative_controls": [ + { + "omit_bridge": 0, + "rejected": true + }, + { + "omit_bridge": 1, + "rejected": true + }, + { + "omit_bridge": 2, + "rejected": true + }, + { + "omit_bridge": 3, + "rejected": true + }, + { + "omit_bridge": 4, + "rejected": true + }, + { + "omit_bridge": 5, + "rejected": true + } + ], + "new_Q_categories": [ + 28, + 29 + ], + "payload_prefix_bits": 93, + "payload_prefix_upper": "9528119495320518471870892800", + "reverse_fresh_center_copies": 20, + "scope": "All independent physical input columns over F2, including all arbitrary helper dirt, restored; external copied-center work closes to zero. New cohort scalar lift uses actual signed coefficients and computed cancellation-free bounds; unchanged source527 signed decoder remains separate defining evidence. Physical projector routing and paid rank/bank receipts are independently bound, not inferred from scalar check.", + "signed_lift_prefix": [ + { + "bits": 16, + "cancellation_free_signed_row_l1_upper": "49347", + "reverse": false + }, + { + "bits": 21, + "cancellation_free_signed_row_l1_upper": "1113070", + "reverse": true + } + ], + "signed_reverse_semantics": "Reverse ADD coefficient negated; reverse DISCARD is fresh COPY from recorded unchanged original center; reverse COPY is DISCARD. Each such block is inverse over every commutative coefficient ring, by elementary-shear induction.", + "stages": [ + { + "fresh_copies": 10, + "scalar_additions": 24305, + "signed_inverse": false, + "stage": 0 + }, + { + "fresh_copies": 10, + "scalar_additions": 24305, + "signed_inverse": true, + "stage": 1 + }, + { + "fresh_copies": 10, + "scalar_additions": 24305, + "signed_inverse": false, + "stage": 2 + }, + { + "fresh_copies": 10, + "scalar_additions": 24305, + "signed_inverse": true, + "stage": 3 + }, + { + "fresh_copies": 10, + "scalar_additions": 24305, + "signed_inverse": false, + "stage": 4 + } + ], + "status": "PASS_NEW_COHORT249_ALL_FIVE_STAGE_FORMAL_COLUMNS_AND_PREFIX_BILL" + } + }, + "legality": { + "accepted": true, + "receipt": { + "all_final_frames_pass": true, + "common_frame_ADDs": 24305, + "containment_pairs_checked": 2386, + "copies": 10, + "donor_intersections": 0, + "erasures": 10, + "max_inherited_integer_abs": 2, + "nested_MOVEs": 2911, + "new_frame_ids_collision": false, + "nondegeneracy_checked_by_separate_exact_bank_audit": true, + "old_max_frame_id": 635, + "paid_histogram": [ + [ + 1, + 1323 + ], + [ + 2, + 1342 + ], + [ + 3, + 79 + ], + [ + 4, + 44 + ], + [ + 5, + 102 + ], + [ + 6, + 11 + ], + [ + 7, + 20 + ] + ], + "rank_mass": 5136, + "records": 27236, + "scope": "Independent chronological geometry/copy/source-owner audit. F2 all-column replay is in the separately freshly compiled transform receipt; address transform theorem and bank completion remain separate.", + "selected_helpers": 0, + "selected_pairs": 0, + "source_owner_intersections": 0, + "status": "PASS_INDEPENDENT_COHORT_LEGALITY_SOURCE_OWNERS_AND_LIFECYCLE" + } + } + }, + "9": { + "columns": { + "accepted": false, + "reason": "center boundaries" + }, + "legality": { + "accepted": false, + "reason": "unclosed COPY" + } + } + } + }, + "no_new_kappa": true, + "status": "PASS_SCATTER_ALIAS_NATIVE_AUDIT" + }, + "no_new_kappa": true, + "status": "PASS_SCATTER_ALIAS_BOUNDARY_AUDIT", + "unused_minus_selected": { + "adds": 0, + "copies": 1, + "copy_rank_sum": 7, + "erasures": 1, + "moves": 0, + "rank_mass": 7, + "records": 2, + "scatter_adds": 0 + } +} diff --git a/research/scatter-alias-native-audit/README.md b/research/scatter-alias-native-audit/README.md new file mode 100644 index 0000000000..618e3f1092 --- /dev/null +++ b/research/scatter-alias-native-audit/README.md @@ -0,0 +1,198 @@ +# Retained aliases at the native scatter boundary + +PR3128's balanced retained-helper alias passes the actual native legality and +883-column five-stage checks **when compiled for ten COPY/ERASE pairs**. +The unchanged selected nine-copy builds reject it at their count checks. +The opt-in simple-support guard rejects it before checking or exporting, +even though this particular ten-copy word has the correct F2 endpoint. + +This closes PR3128's unrun finite native step: four predecessor fixtures, +one unused-slot control and two copied-centre contracts. It does not admit a ten-total supplier. No saving or +new kappa is claimed; selected and frozen sources remain unchanged. + +## Precise additional check + +[Sricharan Vagvala's PR3128](../retained-alias-parity-audit/README.md) supplied +the alias-grouped scalar criterion and fixtures. The selected word has nine +distinct retained helpers. Slot 8 names helper 480; row 64 is `[2,4,6]`. +The balanced fixture appends helper 480 as slot 9 and appends `[8,8,9,9]` to +that row. Symbolic occurrence parity cancels each pair. Export instead emits +two separate ADDs of the same helper value, which also cancel over F2. + +That scalar argument belongs to PR3128. This audit checks the next boundary +using the unchanged exporter, staging program, C++ legality checker and C++ +formal-column checker. The selected build is +`HDIM=8, VPORTS=111, RHELP=439, NCOPY=9`. The same bytes are separately compiled +with `NCOPY=10`, explicitly changing the finite copied-centre contract. + +| Fixture | Full symbolic | NCOPY=9 legality / columns | NCOPY=10 legality / columns | Guard | +|---|---|---|---|---| +| Selected baseline | pass | pass / pass | count reject / count reject | pass | +| Balanced alias | pass | count reject / count reject | pass / pass | reject | +| Unpaired even slot | pass | count reject / count reject | pass / endpoint reject | reject | +| Distinct helpers | pass | count reject / count reject | pass / endpoint reject | reject | +| Unused alias slot | pass | count reject / count reject | pass / pass | pass | + +The unpaired control appends only `[8,8]`, keeping the tenth retained slot. +The distinct-helper control appends `[8,8,9,9]` but makes slot 9 name helper +479. Both preserve the symbolic endpoint. Their exports differ only at output +175; dirty input 480 is a witness. An independent interpreter checks all 661 +input columns, reproducing PR3128's full difference supports and stream hashes. + +Count rejection is `unclosed COPY` in legality and `center boundaries` in +columns. At the correct count, bad endpoints reject at +`local defining-decoder full formal column`. Rejections create no success receipt. + +The unused-slot control only appends helper 480 to `ret`; all scatter rows +remain unchanged and simple. It passes both actual guard entry points and the +ten-copy native checks, while the nine-copy native builds reject it. Thus the +guard enforces row support, not retained-list injectivity or the selected copy +count. It pays one extra COPY/ERASE pair and rank 7, without an extra ADD. + +## Complete literal local invoice + +| Quantity | Selected | Balanced alias | Delta | +|---|---:|---:|---:| +| Records | 27,234 | 27,238 | +4 | +| MOVEs | 2,911 | 2,911 | 0 | +| ADDs | 24,305 | 24,307 | +2 | +| Scatter ADDs | 527 | 529 | +2 | +| COPY/ERASE pairs | 9 | 10 | +1 | +| COPY rank sum | 63 | 70 | +7 | +| Local paid rank mass | 5,129 | 5,136 | +7 | + +Only the rank-seven histogram entry changes, from 19 to 20. The frame +dictionary is byte-identical. The baseline native receipts also match the +pinned PR2977 receipts after normalizing only the validated temporary stream +path and elapsed-time fields. + +The five-stage receipt charges 121,535 ADDs instead of 121,525, 50 fresh copies +instead of 45, and 20 reverse-stage copies instead of 18. The six bridges still +cost 666 ADDs. These are complete event counts at this boundary, not an +integrated nine-stage or supplier bill. + +A separate unbounded-integer implementation agrees with the native +cancellation-free prefix recurrence for every fixture: forward maximum 49,347, +reverse maximum 1,113,070, and payload bound +`64 * 49347^3 * 1113070^2 = 9528119495320518471870892800`. +Its bit length remains 93, strictly below `2^104`. The unchanged maximum does +not remove any added COPY or ADD charge. + +## Guard and controls + +The actual [PR2992 entry points](../simple-scatter-boundary/boundary.py) accept +the selected word and preserve all three exporter artifacts byte for byte. +They reject all duplicate-row fixtures before delegation or output creation. +Rejected export leaves all three preexisting artifacts unchanged. Receipt +fields use `null` for checks not applicable to a fixture. + +Three additional mutations separate the native obligations: + +| Mutation of balanced export | Legality | Columns | +|---|---|---| +| Underprice last COPY, rank 7 to 6 | rejects COPY rank | passes | +| Bind its ERASE to helper 479 instead of 480 | rejects lifecycle | rejects source binding | +| Omit its final scatter ADD | passes | rejects endpoint | + +Scalar checking therefore cannot replace pricing/lifecycle checking, and +legality cannot replace endpoint checking. Simple support is a sufficient, +intentionally conservative guard even at this finite native boundary; its +rejection does not imply every repeated-row operator is incorrect. + +## Reproduce + +From the repository root, with Python 3.12 and a C++17 compiler: + +```sh +python3 -I -O -Werror -B research/scatter-alias-native-audit/verify.py --native +``` + +Expected final line: + +```text +PASS_SCATTER_ALIAS_NATIVE_AUDIT fixtures=5 contracts=2 native_columns=883 controls=3 no_new_kappa +``` + +This authenticates inputs, executes the full symbolic/export/guard audit, +compiles four binaries sequentially and checks [NATIVE.json](NATIVE.json). +It uses the credited [checked 128-bit cpp_int stand-in](../bit589-checked-cpp-int-seed92/README.md), +which refuses overflow, rather than system Boost. Python's independent prefix +cross-check uses unbounded integers. Exact backend, headers, subjects and +staging bytes are pinned. + +The standard-library registered replay does **not** compile native code: + +```sh +python3 -B scripts/research_package.py --package research/scatter-alias-native-audit +python3 -I -O -Werror -B research/scatter-alias-native-audit/verify.py +python3 -I -O -Werror -B research/scatter-alias-native-audit/test_verify.py +``` + +It checks [RESULT.json](RESULT.json) and six behavioral groups: alias +cancellation and charges, unpaired/changed-helper columns, source corruption, +lifetimes/alignment, prefix growth despite cancellation, and tampered saved +native invoices. Checking a saved receipt does not replace the explicit native +command. `--emit`, with or without `--native`, reconstructs a receipt on stdout; +normal replay leaves evidence unchanged. + +All audit subjects execute from authenticated private snapshots. Original +scripts retain assertions even when this audit uses `-O`. Native compilations +are sequential, with 120-second deadlines; delegates have 60-second deadlines. +The legacy legality program aborts on some rejected inputs. Core files are +suppressed; exact diagnostics and absence of success receipts are required. +Platform-specific abort wrappers are excluded from deterministic evidence. + +Local validation used CPython 3.12.3 and GCC 13.3.0 on Linux x86_64. Native +replay, registered replay, six groups and package metadata/source-pin checks +pass. Hosted CI, system-Boost replay and independent human review are not claimed. + +## Scope and sources + +Base main: `463113d675af7410ac91d53a4fed51ec6494eb9a`, priority revision 6. +The claim is in [Discussion #2976](https://github.com/CrocSwap/integer-mult-bounds/discussions/2976#discussioncomment-19001909). +[TASK.json](TASK.json) records the refined card, domain and remaining obligations; +[SOURCES.json](SOURCES.json) pins inputs by Git blob and SHA-256. + +Exact predecessors: PR3128 `2bf13e5b55f8318ae74a8f17db36a19447ba8c7f`; +PR2977 `cd23d242dfe0e7a71cafba0ad5590dc4f2fbf4f2`; +PR2992 `b31bf0360ad702b1be71dea7a33edc11711084af`; +PR3004 `ce08d19f6e43bbc6f552858d93154efe3aa98916`; +selected PR589 `a5afc8c6169ea61ba7c51dfd3cade02cc7b13b46`. +The original #2977 paired-mismatch replay and selected-source binding +orientation also passed during preparation. + +Native staging uses an empty kernel selection and no source owners/donors. +The receipt's reference to a separate bank audit is inherited text, not a +newly executed proof. Physical projectors, bank completion, hosting, full +nine-stage allocation, supplier moments, all-size compilation, precision/tape +and analytic transfer remain open here. Formal columns are over F2; the prefix +bound is not a new general-ring endpoint theorem. No complete cold replay or +selected-frontier change follows. + +## Open next questions + +Should a separately versioned supplier adopt `simple-scatter-v1` with an +explicit retained-slot/count contract? Review these fixtures and both native +contracts, then bind successor entry points and run the complete +symbolic/export/native and bank/hosting replay. Source binding and full +supplier admission remain blockers. Changing `NCOPY` alone is not adoption. +No new construction search is justified by this audit. + +## Credit + +Prepared for commdata2338 (@commdata2338), with substantial OpenAI Codex assistance. + +Sricharan Vagvala (@theon199), PR3128, retains credit for the alias criterion +and full-size fixtures. Nick Petalas, PR2977, discovered the scatter/export +mismatch and supplied native controls and the checked-backend replay pattern. +Arham Tahir, PR2992, supplied the operational simple-support boundary. Hiroki +Kumazaki, PR3004, supplied the independent-slot parity characterization; James +Reed, PR3099, supplied a separate scalar corroboration. The concurrent odd-multiplicity +native audit in Discussion #2976 keeps nine distinct retained helpers fixed +and is complementary. + +Credit eumemic and DreamingOfClouds for the word/checker lineage, Dylan Crow +for the exporter/native/staging programs, Douglas Colkitt for selected bindings +and review, and Sagar Thakrar for the checked cpp_int stand-in. Original notices and +source bytes remain unchanged. New work is Apache-2.0. No independent human or +proof-assistant review is claimed. diff --git a/research/scatter-alias-native-audit/RESULT.json b/research/scatter-alias-native-audit/RESULT.json new file mode 100644 index 0000000000..96d3836d99 --- /dev/null +++ b/research/scatter-alias-native-audit/RESULT.json @@ -0,0 +1,971 @@ +{ + "balanced_minus_selected": { + "adds": 2, + "copies": 1, + "copy_rank_sum": 7, + "erasures": 1, + "moves": 0, + "rank_mass": 7, + "records": 4, + "scatter_adds": 2 + }, + "columns": 661, + "fixtures": { + "balanced_alias": { + "artifacts_sha256": { + "249-records.bin": "ee0be35807a5a49a4204ab89f4d132ac6164ecef72fc39e9858b12d70166bb52", + "249-states.json": "79f257bcad74e48e10083d6b7674e6334979573d7707436bb9c7bec20ab541f0", + "frames.json": "d006b3bfe0c04afecfea7aecfa59dfe4298b99501c70da3938e40289bc2f5010" + }, + "guard": { + "accepted": false, + "existing_outputs_preserved": true, + "rejected_before_creation": true, + "valid_bytes_preserved": null + }, + "invoice": { + "adds": 24307, + "copies": 10, + "copy_rank_sum": 70, + "erasures": 10, + "moves": 2911, + "paid_histogram": [ + [ + 1, + 1323 + ], + [ + 2, + 1342 + ], + [ + 3, + 79 + ], + [ + 4, + 44 + ], + [ + 5, + 102 + ], + [ + 6, + 11 + ], + [ + 7, + 20 + ] + ], + "rank_mass": 5136, + "records": 27238, + "scatter_adds": 529 + }, + "prefix": { + "below_2_104": true, + "bits": 93, + "forward": "49347", + "payload": "9528119495320518471870892800", + "reverse": "1113070" + }, + "scalar_differences": [], + "symbolic": { + "columns": 661, + "conclusion": { + "C_is_U_inverse": true, + "J_identity": true, + "K_equals_D": true, + "U_block_form": true + }, + "copy_ranks": [ + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7 + ], + "gates": { + "A": 2075, + "B": 712, + "C": 2574, + "D": 111 + }, + "hypotheses": { + "H1_no_target_feeds_z": true, + "H2_D_frame0_targets_from_helpers": true, + "H3_A_z_only_scatter_targets_B_split": true, + "H4_C_literal_reverse_at_full": true, + "H5_V_identity": true + }, + "interleaving": { + "B_target_reads_of_registers_rewritten_earlier_in_B": 111, + "B_z_operand_kinds": { + "helper<-helper": 3, + "helper<-source": 13, + "source<-helper": 108, + "source<-source": 375 + }, + "B_z_operand_kinds_by_dim": { + "dim4:helper<-source": 13, + "dim4:source<-source": 375, + "dim6:helper<-helper": 3, + "dim6:source<-helper": 108 + }, + "B_z_write_frame_dims": { + "4": 388, + "6": 111 + }, + "B_z_writes_after_a_target_read_of_the_same_register": 454, + "cleanup_gates": 2574, + "helper_writes_B": 16, + "source_writes_A": 0, + "source_writes_B": 483, + "sources_rewritten_B": 108, + "target_reads_of_targets": 0, + "z_gates_A": 2075, + "z_gates_B": 499 + }, + "punctured": 9, + "status": "PASS_EXACT_REPLAY_AND_INTERLEAVED_INTERFACE", + "totals_on_punctured_hyperplanes": true, + "v": 111 + } + }, + "baseline": { + "artifacts_sha256": { + "249-records.bin": "ea44aa047a2a9cf034de8b56b2166c49cf2dbdf9cd9ed6a20299a4f2b05ef09a", + "249-states.json": "701ca802279b23ba23ffd502935ae9f34a33fc81fdfd266042f3208a2cb16265", + "frames.json": "d006b3bfe0c04afecfea7aecfa59dfe4298b99501c70da3938e40289bc2f5010" + }, + "guard": { + "accepted": true, + "existing_outputs_preserved": null, + "rejected_before_creation": null, + "valid_bytes_preserved": true + }, + "invoice": { + "adds": 24305, + "copies": 9, + "copy_rank_sum": 63, + "erasures": 9, + "moves": 2911, + "paid_histogram": [ + [ + 1, + 1323 + ], + [ + 2, + 1342 + ], + [ + 3, + 79 + ], + [ + 4, + 44 + ], + [ + 5, + 102 + ], + [ + 6, + 11 + ], + [ + 7, + 19 + ] + ], + "rank_mass": 5129, + "records": 27234, + "scatter_adds": 527 + }, + "prefix": { + "below_2_104": true, + "bits": 93, + "forward": "49347", + "payload": "9528119495320518471870892800", + "reverse": "1113070" + }, + "scalar_differences": [], + "symbolic": { + "columns": 661, + "conclusion": { + "C_is_U_inverse": true, + "J_identity": true, + "K_equals_D": true, + "U_block_form": true + }, + "copy_ranks": [ + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7 + ], + "gates": { + "A": 2075, + "B": 712, + "C": 2574, + "D": 111 + }, + "hypotheses": { + "H1_no_target_feeds_z": true, + "H2_D_frame0_targets_from_helpers": true, + "H3_A_z_only_scatter_targets_B_split": true, + "H4_C_literal_reverse_at_full": true, + "H5_V_identity": true + }, + "interleaving": { + "B_target_reads_of_registers_rewritten_earlier_in_B": 111, + "B_z_operand_kinds": { + "helper<-helper": 3, + "helper<-source": 13, + "source<-helper": 108, + "source<-source": 375 + }, + "B_z_operand_kinds_by_dim": { + "dim4:helper<-source": 13, + "dim4:source<-source": 375, + "dim6:helper<-helper": 3, + "dim6:source<-helper": 108 + }, + "B_z_write_frame_dims": { + "4": 388, + "6": 111 + }, + "B_z_writes_after_a_target_read_of_the_same_register": 454, + "cleanup_gates": 2574, + "helper_writes_B": 16, + "source_writes_A": 0, + "source_writes_B": 483, + "sources_rewritten_B": 108, + "target_reads_of_targets": 0, + "z_gates_A": 2075, + "z_gates_B": 499 + }, + "punctured": 9, + "status": "PASS_EXACT_REPLAY_AND_INTERLEAVED_INTERFACE", + "totals_on_punctured_hyperplanes": true, + "v": 111 + } + }, + "distinct_helpers": { + "artifacts_sha256": { + "249-records.bin": "12081d70e0040c89e645f2be94a085dae2f11f8bc59188d56eeae0c02b0b239d", + "249-states.json": "a597733c50f1fcfd8cb00c884d64284da9bd8a5bbe0ed29ff05403a8b2b75db8", + "frames.json": "d006b3bfe0c04afecfea7aecfa59dfe4298b99501c70da3938e40289bc2f5010" + }, + "guard": { + "accepted": false, + "existing_outputs_preserved": true, + "rejected_before_creation": true, + "valid_bytes_preserved": null + }, + "invoice": { + "adds": 24307, + "copies": 10, + "copy_rank_sum": 70, + "erasures": 10, + "moves": 2911, + "paid_histogram": [ + [ + 1, + 1323 + ], + [ + 2, + 1342 + ], + [ + 3, + 79 + ], + [ + 4, + 44 + ], + [ + 5, + 102 + ], + [ + 6, + 11 + ], + [ + 7, + 20 + ] + ], + "rank_mass": 5136, + "records": 27238, + "scatter_adds": 529 + }, + "prefix": { + "below_2_104": true, + "bits": 93, + "forward": "49347", + "payload": "9528119495320518471870892800", + "reverse": "1113070" + }, + "scalar_differences": [ + { + "input_columns": [ + 1, + 2, + 5, + 6, + 11, + 12, + 13, + 14, + 16, + 19, + 21, + 24, + 25, + 26, + 27, + 31, + 33, + 34, + 36, + 38, + 39, + 44, + 45, + 46, + 50, + 52, + 57, + 58, + 59, + 60, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 75, + 77, + 79, + 82, + 83, + 86, + 87, + 89, + 91, + 93, + 95, + 96, + 97, + 100, + 101, + 104, + 105, + 108, + 109, + 223, + 224, + 226, + 231, + 233, + 235, + 238, + 242, + 248, + 251, + 252, + 256, + 257, + 258, + 260, + 263, + 264, + 265, + 266, + 271, + 274, + 277, + 279, + 280, + 281, + 284, + 286, + 287, + 288, + 290, + 291, + 293, + 294, + 296, + 297, + 301, + 303, + 306, + 312, + 315, + 316, + 318, + 321, + 325, + 326, + 327, + 340, + 343, + 348, + 352, + 355, + 360, + 361, + 363, + 365, + 367, + 368, + 371, + 374, + 376, + 382, + 385, + 386, + 388, + 389, + 391, + 402, + 406, + 411, + 422, + 426, + 429, + 430, + 434, + 439, + 441, + 450, + 452, + 455, + 457, + 459, + 467, + 469, + 471, + 479, + 480, + 488, + 490, + 501, + 506, + 514, + 515, + 518, + 525, + 530, + 531, + 536, + 538, + 544, + 554, + 561, + 568, + 569, + 571, + 582, + 593, + 594, + 596, + 606, + 608, + 612, + 617, + 624, + 625, + 629, + 631, + 641, + 643, + 644, + 649, + 656 + ], + "output": 175 + } + ], + "symbolic": { + "columns": 661, + "conclusion": { + "C_is_U_inverse": true, + "J_identity": true, + "K_equals_D": true, + "U_block_form": true + }, + "copy_ranks": [ + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7 + ], + "gates": { + "A": 2075, + "B": 712, + "C": 2574, + "D": 111 + }, + "hypotheses": { + "H1_no_target_feeds_z": true, + "H2_D_frame0_targets_from_helpers": true, + "H3_A_z_only_scatter_targets_B_split": true, + "H4_C_literal_reverse_at_full": true, + "H5_V_identity": true + }, + "interleaving": { + "B_target_reads_of_registers_rewritten_earlier_in_B": 111, + "B_z_operand_kinds": { + "helper<-helper": 3, + "helper<-source": 13, + "source<-helper": 108, + "source<-source": 375 + }, + "B_z_operand_kinds_by_dim": { + "dim4:helper<-source": 13, + "dim4:source<-source": 375, + "dim6:helper<-helper": 3, + "dim6:source<-helper": 108 + }, + "B_z_write_frame_dims": { + "4": 388, + "6": 111 + }, + "B_z_writes_after_a_target_read_of_the_same_register": 454, + "cleanup_gates": 2574, + "helper_writes_B": 16, + "source_writes_A": 0, + "source_writes_B": 483, + "sources_rewritten_B": 108, + "target_reads_of_targets": 0, + "z_gates_A": 2075, + "z_gates_B": 499 + }, + "punctured": 9, + "status": "PASS_EXACT_REPLAY_AND_INTERLEAVED_INTERFACE", + "totals_on_punctured_hyperplanes": true, + "v": 111 + } + }, + "unpaired_even": { + "artifacts_sha256": { + "249-records.bin": "458fd079ee59c3b04813f4afe8fdcf77394627f0b2159da256bd3672e013289e", + "249-states.json": "79f257bcad74e48e10083d6b7674e6334979573d7707436bb9c7bec20ab541f0", + "frames.json": "d006b3bfe0c04afecfea7aecfa59dfe4298b99501c70da3938e40289bc2f5010" + }, + "guard": { + "accepted": false, + "existing_outputs_preserved": true, + "rejected_before_creation": true, + "valid_bytes_preserved": null + }, + "invoice": { + "adds": 24306, + "copies": 10, + "copy_rank_sum": 70, + "erasures": 10, + "moves": 2911, + "paid_histogram": [ + [ + 1, + 1323 + ], + [ + 2, + 1342 + ], + [ + 3, + 79 + ], + [ + 4, + 44 + ], + [ + 5, + 102 + ], + [ + 6, + 11 + ], + [ + 7, + 20 + ] + ], + "rank_mass": 5136, + "records": 27237, + "scatter_adds": 528 + }, + "prefix": { + "below_2_104": true, + "bits": 93, + "forward": "49347", + "payload": "9528119495320518471870892800", + "reverse": "1113070" + }, + "scalar_differences": [ + { + "input_columns": [ + 0, + 2, + 4, + 6, + 8, + 11, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 24, + 27, + 29, + 30, + 32, + 35, + 37, + 39, + 40, + 43, + 44, + 46, + 47, + 49, + 52, + 54, + 55, + 57, + 59, + 63, + 65, + 66, + 68, + 69, + 71, + 73, + 74, + 75, + 76, + 83, + 84, + 86, + 89, + 91, + 92, + 94, + 97, + 98, + 100, + 105, + 106, + 107, + 108, + 223, + 226, + 235, + 251, + 256, + 258, + 260, + 264, + 265, + 266, + 274, + 280, + 281, + 284, + 286, + 291, + 297, + 301, + 306, + 315, + 318, + 321, + 326, + 340, + 343, + 361, + 365, + 368, + 374, + 382, + 385, + 386, + 388, + 411, + 422, + 426, + 439, + 450, + 457, + 467, + 480, + 488, + 506, + 515, + 518, + 530, + 536, + 538, + 554, + 569, + 571, + 593, + 596, + 612, + 624, + 625, + 631, + 644, + 656 + ], + "output": 175 + } + ], + "symbolic": { + "columns": 661, + "conclusion": { + "C_is_U_inverse": true, + "J_identity": true, + "K_equals_D": true, + "U_block_form": true + }, + "copy_ranks": [ + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7 + ], + "gates": { + "A": 2075, + "B": 712, + "C": 2574, + "D": 111 + }, + "hypotheses": { + "H1_no_target_feeds_z": true, + "H2_D_frame0_targets_from_helpers": true, + "H3_A_z_only_scatter_targets_B_split": true, + "H4_C_literal_reverse_at_full": true, + "H5_V_identity": true + }, + "interleaving": { + "B_target_reads_of_registers_rewritten_earlier_in_B": 111, + "B_z_operand_kinds": { + "helper<-helper": 3, + "helper<-source": 13, + "source<-helper": 108, + "source<-source": 375 + }, + "B_z_operand_kinds_by_dim": { + "dim4:helper<-source": 13, + "dim4:source<-source": 375, + "dim6:helper<-helper": 3, + "dim6:source<-helper": 108 + }, + "B_z_write_frame_dims": { + "4": 388, + "6": 111 + }, + "B_z_writes_after_a_target_read_of_the_same_register": 454, + "cleanup_gates": 2574, + "helper_writes_B": 16, + "source_writes_A": 0, + "source_writes_B": 483, + "sources_rewritten_B": 108, + "target_reads_of_targets": 0, + "z_gates_A": 2075, + "z_gates_B": 499 + }, + "punctured": 9, + "status": "PASS_EXACT_REPLAY_AND_INTERLEAVED_INTERFACE", + "totals_on_punctured_hyperplanes": true, + "v": 111 + } + }, + "unused_alias": { + "artifacts_sha256": { + "249-records.bin": "8527032c4eef4b18812779e4a90640c50e45c151b4ef1ed40d0369187a6bde90", + "249-states.json": "79f257bcad74e48e10083d6b7674e6334979573d7707436bb9c7bec20ab541f0", + "frames.json": "d006b3bfe0c04afecfea7aecfa59dfe4298b99501c70da3938e40289bc2f5010" + }, + "guard": { + "accepted": true, + "existing_outputs_preserved": null, + "rejected_before_creation": null, + "valid_bytes_preserved": true + }, + "invoice": { + "adds": 24305, + "copies": 10, + "copy_rank_sum": 70, + "erasures": 10, + "moves": 2911, + "paid_histogram": [ + [ + 1, + 1323 + ], + [ + 2, + 1342 + ], + [ + 3, + 79 + ], + [ + 4, + 44 + ], + [ + 5, + 102 + ], + [ + 6, + 11 + ], + [ + 7, + 20 + ] + ], + "rank_mass": 5136, + "records": 27236, + "scatter_adds": 527 + }, + "prefix": { + "below_2_104": true, + "bits": 93, + "forward": "49347", + "payload": "9528119495320518471870892800", + "reverse": "1113070" + }, + "scalar_differences": [], + "symbolic": { + "columns": 661, + "conclusion": { + "C_is_U_inverse": true, + "J_identity": true, + "K_equals_D": true, + "U_block_form": true + }, + "copy_ranks": [ + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7 + ], + "gates": { + "A": 2075, + "B": 712, + "C": 2574, + "D": 111 + }, + "hypotheses": { + "H1_no_target_feeds_z": true, + "H2_D_frame0_targets_from_helpers": true, + "H3_A_z_only_scatter_targets_B_split": true, + "H4_C_literal_reverse_at_full": true, + "H5_V_identity": true + }, + "interleaving": { + "B_target_reads_of_registers_rewritten_earlier_in_B": 111, + "B_z_operand_kinds": { + "helper<-helper": 3, + "helper<-source": 13, + "source<-helper": 108, + "source<-source": 375 + }, + "B_z_operand_kinds_by_dim": { + "dim4:helper<-source": 13, + "dim4:source<-source": 375, + "dim6:helper<-helper": 3, + "dim6:source<-helper": 108 + }, + "B_z_write_frame_dims": { + "4": 388, + "6": 111 + }, + "B_z_writes_after_a_target_read_of_the_same_register": 454, + "cleanup_gates": 2574, + "helper_writes_B": 16, + "source_writes_A": 0, + "source_writes_B": 483, + "sources_rewritten_B": 108, + "target_reads_of_targets": 0, + "z_gates_A": 2075, + "z_gates_B": 499 + }, + "punctured": 9, + "status": "PASS_EXACT_REPLAY_AND_INTERLEAVED_INTERFACE", + "totals_on_punctured_hyperplanes": true, + "v": 111 + } + } + }, + "no_new_kappa": true, + "status": "PASS_SCATTER_ALIAS_BOUNDARY_AUDIT", + "unused_minus_selected": { + "adds": 0, + "copies": 1, + "copy_rank_sum": 7, + "erasures": 1, + "moves": 0, + "rank_mass": 7, + "records": 2, + "scatter_adds": 0 + } +} diff --git a/research/scatter-alias-native-audit/SOURCES.json b/research/scatter-alias-native-audit/SOURCES.json new file mode 100644 index 0000000000..1ffc2ec2fe --- /dev/null +++ b/research/scatter-alias-native-audit/SOURCES.json @@ -0,0 +1,108 @@ +{ + "schema_version": 1, + "base_commit": "463113d675af7410ac91d53a4fed51ec6494eb9a", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81", + "sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "67f085acd86acd7d4e03922d9cf4b26bca66fed5", + "sha256": "47b42433f5a85809a3aadd29c2c339da2c6ed728e4f7762df6b88bccb7874cf0" + }, + { + "path": "research/bit589-checked-cpp-int-seed92/include/boost/multiprecision/cpp_int.hpp", + "usage": "input", + "git_blob": "bc9634fd9090bdc2f6071a92472cc09306a0a9df", + "sha256": "2cb97050101cfd286ccfc7caa62221c63a2bcd3102f7d5f916ccef0953fb4426" + }, + { + "path": "research/community-frontier1094-audit/SELECTED-SOURCE.json", + "usage": "input", + "git_blob": "6a75493790b4eff9c4a98051ef8b01d6aad0d5a8", + "sha256": "79b3de5db3dbcb9829789ba58e9e45758926031e2a7d80667a08429d369be53b" + }, + { + "path": "research/e8-bit-carrier-skeleton/code/bit/checkers/columns_h.cpp", + "usage": "input", + "git_blob": "00c5a3a5d81d083582f60f33dd2e7bea5049c37f", + "sha256": "d1297f9052be4f2496e1ff2a77e4db2c0cdbd7d460d489b4c03e50bf317238ce" + }, + { + "path": "research/e8-bit-carrier-skeleton/code/bit/checkers/json.hpp", + "usage": "input", + "git_blob": "82d69f7c5d044c9887c96b90c97f5639083ecd14", + "sha256": "aaf127c04cb31c406e5b04a63f1ae89369fccde6d8fa7cdda1ed4f32dfc5de63" + }, + { + "path": "research/e8-bit-carrier-skeleton/code/bit/checkers/legality_h.cpp", + "usage": "input", + "git_blob": "cb1233c7e96b1aa8bbf4d2e4165d75ab0dca64b9", + "sha256": "6c1ef2b24e57781d6951c172a1024fc4300e6fd392c9d6672079a7806ab663b3" + }, + { + "path": "research/e8-bit-carrier-skeleton/code/bit/export_records.py", + "usage": "input", + "git_blob": "3632d370486a02f5456f7643ced03f8c925b2350", + "sha256": "8a5999601f917dbb492bb9ae9a344611f18cc7cedc53dc3c76496a369e530eb3" + }, + { + "path": "research/e8-bit-carrier-skeleton/code/bit/regression/stage_cohort.py", + "usage": "input", + "git_blob": "f6d7afe3e623208c4207b6a683a1e3e49249e31c", + "sha256": "6c288f6f234b528c1a7c0a4adfb724e91e0fe6b18c8dffad96af3f973de1829a" + }, + { + "path": "research/e8-bit-carrier-skeleton/portable-include/bits/stdc++.h", + "usage": "input", + "git_blob": "fc5664e929d9a81d9b4926bee049a93330be86ec", + "sha256": "420094be2af295eed03a983dd66debbbe9cfb78d8252859f4498a615a0074b99" + }, + { + "path": "research/e8-bit-p111-tuned/code/xcheck_p.py", + "usage": "input", + "git_blob": "184f5dcf94a486cc7db91ca4db5865916bf26009", + "sha256": "af3decc877e27c00001cf56f50c6c09566e8e101297ab34c7860aed96a06d80e" + }, + { + "path": "research/e8-bit-p111-tuned/tune/bitE8mut-p111-tuned.json.gz", + "usage": "input", + "git_blob": "85a4499bf9e4911a705d50567a2c2ef6cf23739a", + "sha256": "e3e301e62bc2b41dbf1ceac0acf3d35824ebeab1848c5a2142d4577b109da52f" + }, + { + "path": "research/retained-alias-parity-audit/EXPECTED.json", + "usage": "input", + "git_blob": "eca24a21c71d26e3a635a22a8436c7926c848a17", + "sha256": "97fa6f631c8b5064921566cc0d1b428e3e91e33834a29deec02836f67611fba3" + }, + { + "path": "research/retained-alias-parity-audit/README.md", + "usage": "input", + "git_blob": "e7531e57dad3ca08053d3e4590d2e3034a0849c5", + "sha256": "0f9c1b454abbb4735408317e5e7e0b83050c5b44bf70bd022aa5c023b9d13c4e" + }, + { + "path": "research/scatter-export-parity-audit/NATIVE.json", + "usage": "input", + "git_blob": "867a37ccfb0e977db83d626e2e5fbf746d6bb3ff", + "sha256": "7c243b1c0727948cce296d7290401088ae9f2b31e848a7a0725a1a639633fa3e" + }, + { + "path": "research/simple-scatter-boundary/SOURCES.json", + "usage": "input", + "git_blob": "b10fb0e15a15518103ca37c49b718858b3c35b62", + "sha256": "9f424d5e2e42c4e285fb4e2ae500e05d4cf13cc6a055aed54a355b0e993a8944" + }, + { + "path": "research/simple-scatter-boundary/boundary.py", + "usage": "input", + "git_blob": "8f205a335a50ded30991e7aba345ac7eee1d6c19", + "sha256": "49c71495b6996dc7f02a86f97d26b0900a932841cc4b7cd82c0f09d4823f6c26" + } + ] +} diff --git a/research/scatter-alias-native-audit/TASK.json b/research/scatter-alias-native-audit/TASK.json new file mode 100644 index 0000000000..eef3bbc2f7 --- /dev/null +++ b/research/scatter-alias-native-audit/TASK.json @@ -0,0 +1,161 @@ +{ + "schema_version": 1, + "task_id": "supplier-boundary-audit", + "priority_revision": 6, + "base_commit": "463113d675af7410ac91d53a4fed51ec6494eb9a", + "original_card": { + "id": "supplier-boundary-audit", + "question": "Does one selected supplier obligation follow from its actual source-bound checks?", + "starting_points": [ + "certificates/selected-result.json", + "research/owner-boundary-audit/README.md", + "research/scatter-export-parity-audit/README.md" + ], + "methods": [ + "Trace one hypothesis through the source, checker and complete caller.", + "Construct one semantically invalid but superficially well-formed fixture and test rejection." + ], + "acceptance_gate": "Pin the current sources and one obligation; the historical owner audit is an example, not evidence of a current bug.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read #2977 reported duplicate-scatter counterexample and its opt-in repair. The archive is not a production fix or an independently validated selected-result failure; the selected generator emits unique rows.", + "scope": "Source-binding orientation only; does not replay or validate the reported bug." + }, + "first_experiment": "First check whether the scatter repair has been adopted. If still open, independently reproduce #2977 symbolic-versus-exported parity on the tiny duplicate fixture, compare the selected unique-row positive control, and define either enforced uniqueness or consistent multiplicity semantics. A bounded guard-adoption patch must preserve valid inputs and test the actual exported action. Stop after this obligation; no full historical replay or frontier change follows from the mutant alone.", + "bottleneck_link": "Closing a current acceptance gap or proof obligation strengthens reliability even without changing kappa.", + "allowed_variations": [ + "Audit one named current condition using a new semantic counterexample." + ], + "scope_change_triggers": [ + "Reporting the historical timing-only diagnostic as a new current acceptance bug.", + "Calling a malformed mutant a failure of the selected construction, or importing an opt-in repair without testing the exporter boundary." + ], + "overlap_terms": [ + "owner boundary", + "bridge omission", + "hosting", + "2977", + "scatter export", + "duplicate index", + "parity semantics" + ] + }, + "scope_status": "refined", + "actual_scope": "PR3128 balanced retained-helper alias: actual native COPY-count, geometry/lifecycle, complete formal-column and local event-invoice boundary for four predecessor fixtures plus an unused-slot positive control and NCOPY=9/10.", + "scope_change_reason": "The original paired mismatch and opt-in guard already exist. PR3128 leaves native compilation and supplier admission unrun; this closes only the finite native implication, with the selected nine-copy contract tested separately.", + "bottleneck_link": "Tests one current acceptance implication and the sufficient guard at the actual exporter/native boundary, without changing the selected construction.", + "budget_minutes": 60, + "stop_rule": "Stop after four predecessor fixtures, one unused-slot positive control, two copied-centre contracts and named semantic/billing controls. No search, supplier expansion or frontier change.", + "outcome": "completed", + "evidence": "RESULT.json: authenticated full symbolic/export/guard replay and independent 661-column and invoice oracle. NATIVE.json: actual native builds for NCOPY=9/10, 883-column five-stage acceptance or exact rejection, and three native controls. Six behavioral test groups; native reproduction is explicit and optional.", + "author": "commdata2338", + "ai_assistance": "Substantial OpenAI Codex assistance in derivation, implementation, checking and writing. No independent human review is claimed.", + "open_questions": [ + { + "question": "Should a separately versioned supplier adopt simple-scatter-v1 with an explicit retained-slot/count contract?", + "why_it_matters": "The sufficient guard rejects a scalar- and native-correct ten-copy alias while the selected nine-copy interface rejects its changed inventory; schema, endpoint and supplier admission are different boundaries.", + "first_step": "Review the four predecessor fixtures, unused-slot control and both native contracts, then bind an approved successor entry point and run the applicable complete symbolic/export/native and bank/hosting replay.", + "blocked_by": "Successor contract/source binding and complete supplier admission; this finite audit does not authorize repinning frozen sources." + } + ], + "selection": { + "mode": "handoff-first", + "track": "adversarial-audit", + "task_id": "supplier-boundary-audit", + "scope_key": "dcdb0fa8e49b08a958d0", + "chooser_nonce": "4fb367c43cb03fcc8f765c3fb6bcf428", + "canonical_thread": "https://github.com/CrocSwap/integer-mult-bounds/discussions/2976", + "handoff": "PR3128 Open next questions: unrun symbolic/export/native sequence for retained aliases", + "existing_checks": [], + "coverage_interpretation": "Unknown catalogue coverage; inspected actual PR2977, PR2992, PR3004, PR3099, PR3100 and PR3128 before selection.", + "claim_url": "https://github.com/CrocSwap/integer-mult-bounds/discussions/2976#discussioncomment-19001909" + }, + "dependency_heads": { + "3128": "2bf13e5b55f8318ae74a8f17db36a19447ba8c7f", + "2977": "cd23d242dfe0e7a71cafba0ad5590dc4f2fbf4f2", + "2992": "b31bf0360ad702b1be71dea7a33edc11711084af", + "3004": "ce08d19f6e43bbc6f552858d93154efe3aa98916", + "589": "a5afc8c6169ea61ba7c51dfd3cade02cc7b13b46" + }, + "bounded_domain": { + "fixtures": [ + "baseline", + "balanced_alias", + "unpaired_even", + "distinct_helpers", + "unused_alias" + ], + "native_copy_counts": [ + 9, + 10 + ], + "local_columns": 661, + "five_stage_columns": 883, + "native_controls": [ + "underprice_copy_rank", + "wrong_erase_source", + "omit_alias_add" + ] + }, + "family_decision": "Narrow and stop after audit; no construction expansion. No primitive saving or kappa claim.", + "remaining_obligations": [ + "Full selected or successor cold replay", + "Physical bank/projector and hosting admission", + "Nine-stage allocation and full supplier moment", + "All-size compiler, precision/tape and analytic transfer", + "System-Boost rather than checked128 native build", + "Independent human or proof-assistant review" + ], + "refresh_checkpoint": { + "checked_at": "2026-10-17T17:45:23.523776+00:00", + "base_commit": "463113d675af7410ac91d53a4fed51ec6494eb9a", + "origin_main": "463113d675af7410ac91d53a4fed51ec6494eb9a", + "changed_paths": [], + "priority_revision": 6, + "decision": "Continue the completed fixed-input audit; no upstream or priority changes." + }, + "overlap": { + "entry_snapshot_prs": "2026-10-17T17:04:11.636955+00:00", + "entry_snapshot_discussions": "2026-10-17T17:04:42.538402+00:00", + "final_queries": [ + "--task supplier-boundary-audit", + "retained-alias / alias native / NCOPY=10", + "--path research/retained-alias-parity-audit/*" + ], + "mode": "offline complete-pagination cache; new or unpublished changes can be missed", + "nearest": [ + "PR2977 original paired mismatch and native controls", + "PR2992 operational guard", + "PR3004 independent-slot criterion", + "PR3099 scalar-only corroboration", + "PR3100 different label-coercion boundary", + "PR3128 grouped alias scalar theorem and fixtures" + ], + "parallel_scope": "The concurrent odd-multiplicity native audit keeps the nine distinct retained helpers fixed; this audit changes ret and the native copy-count contract.", + "final_snapshot_prs": "2026-10-17T17:37:12.534077+00:00", + "final_snapshot_discussions": "2026-10-17T17:39:04.580509+00:00", + "final_counts": { + "open_prs": 251, + "discussion_records": 2015 + }, + "file_index": { + "fetched_at": "2026-10-17T17:12:31.392684+00:00", + "records": 246, + "matches": 0, + "unverified_heads_and_bases": [ + 3201, + 3202, + 3203, + 3204, + 3205 + ], + "resolution": "Read all five current cached PR bodies; they concern P112 decoder shortening or complex native/idle audits, outside this bit scatter-alias scope. Their changed-file inventories remain unverified." + } + }, + "scope_refinement": "After the four claimed predecessor fixtures passed, add one unused retained-alias slot with unchanged simple scatter rows. This fixed positive control separates the guard schema from native copy-count enforcement; no new search or mechanism." +} diff --git a/research/scatter-alias-native-audit/VERIFY.json b/research/scatter-alias-native-audit/VERIFY.json new file mode 100644 index 0000000000..d8817bd56c --- /dev/null +++ b/research/scatter-alias-native-audit/VERIFY.json @@ -0,0 +1,49 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/bit589-checked-cpp-int-seed92/include/boost/multiprecision/cpp_int.hpp", + "research/community-frontier1094-audit/SELECTED-SOURCE.json", + "research/e8-bit-carrier-skeleton/code/bit/checkers/columns_h.cpp", + "research/e8-bit-carrier-skeleton/code/bit/checkers/json.hpp", + "research/e8-bit-carrier-skeleton/code/bit/checkers/legality_h.cpp", + "research/e8-bit-carrier-skeleton/code/bit/export_records.py", + "research/e8-bit-carrier-skeleton/code/bit/regression/stage_cohort.py", + "research/e8-bit-carrier-skeleton/portable-include/bits/stdc++.h", + "research/e8-bit-p111-tuned/code/xcheck_p.py", + "research/e8-bit-p111-tuned/tune/bitE8mut-p111-tuned.json.gz", + "research/retained-alias-parity-audit/EXPECTED.json", + "research/retained-alias-parity-audit/README.md", + "research/scatter-export-parity-audit/NATIVE.json", + "research/simple-scatter-boundary/SOURCES.json", + "research/simple-scatter-boundary/boundary.py" + ], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-O", + "-Werror", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Five full symbolic/export fixtures (four predecessor cases plus an unused-slot positive control), exact predecessor bytes, all 661 scalar columns, independent event/prefix invoice and actual guard entry modes with output preservation." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-Werror", + "-B", + "{package}/test_verify.py" + ], + "timeout_seconds": 60, + "checks": "Six behavioral groups: alias cancellation and charges, changed helper and missing ADD, source corruption, lifecycle/alignment, positive majorant and saved native-invoice controls. Does not compile native code." + } + ] +} diff --git a/research/scatter-alias-native-audit/test_verify.py b/research/scatter-alias-native-audit/test_verify.py new file mode 100644 index 0000000000..73c0141673 --- /dev/null +++ b/research/scatter-alias-native-audit/test_verify.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python3 +"""Failure controls for the independent alias audit; Apache-2.0. + +Prepared for commdata2338, with substantial OpenAI Codex assistance. +""" +import copy +import json +from pathlib import Path +import tempfile +import types +import unittest + +PACKAGE = Path(__file__).resolve().parent +# Read source explicitly, so a stale bytecode cache cannot substitute the audit. +audit = types.ModuleType("alias_audit") +audit.__file__ = str(PACKAGE / "verify.py") +exec(compile((PACKAGE / "verify.py").read_bytes(), audit.__file__, "exec"), audit.__dict__) + + +def toy(): + # n=4, v=1: target1 += source0, then two separate copies of dirty helper2. + return [(1, 1, 0, 1, 0, 1), + (2, 2, 4, 0, 0, 7), (1, 1, 4, 1, 0, 3), (3, 2, 4, 0, 0, 0), + (2, 2, 4, 0, 0, 7), (1, 1, 4, 1, 0, 3), (3, 2, 4, 0, 0, 0)] + + +class Controls(unittest.TestCase): + def test_alias_cancels_but_every_copy_is_charged(self): + differences, invoice = audit.scalar_and_invoice(toy(), n=4, v=1) + self.assertEqual(differences, []) + self.assertEqual(invoice["copies"], 2) + self.assertEqual(invoice["copy_rank_sum"], 14) + self.assertEqual(invoice["adds"], 3) + self.assertEqual(invoice["scatter_adds"], 2) + + def test_unpaired_and_distinct_helper_columns(self): + rows = toy() + del rows[5] + self.assertEqual(audit.scalar_and_invoice(rows, n=4, v=1)[0], + [{"output": 1, "input_columns": [2]}]) + rows = list(toy()) + rows[4] = (2, 3, 4, 0, 0, 7) + rows[6] = (3, 3, 4, 0, 0, 0) + self.assertEqual(audit.scalar_and_invoice(rows, n=4, v=1)[0], + [{"output": 1, "input_columns": [2, 3]}]) + + def test_lifecycle_and_alignment_failures(self): + rows = toy() + rows[-1] = (3, 3, 4, 0, 0, 0) + with self.assertRaisesRegex(ValueError, "ERASE source binding"): + audit.scalar_and_invoice(rows, n=4, v=1) + with self.assertRaisesRegex(ValueError, "temporary not closed"): + audit.scalar_and_invoice(toy()[:-1], n=4, v=1) + raw = b"".join(audit.RECORD.pack(*r) for r in toy()) + with self.assertRaisesRegex(ValueError, "record alignment"): + audit.read_records(raw[:-1]) + + def test_prefix_counts_cancelling_adds_in_both_directions(self): + self.assertEqual(audit.prefix_invoice(toy(), n=4), + {"forward": "4", "reverse": "4", "payload": "65536", + "bits": 17, "below_2_104": True}) + rows = list(toy()) + rows[5] = (1, 1, 4, -1, 0, 3) + self.assertEqual(audit.prefix_invoice(rows, n=4), audit.prefix_invoice(toy(), n=4)) + + def test_corrupted_exporter_rejected_before_execution(self): + data = audit.sources() + with tempfile.TemporaryDirectory(prefix="alias-source-control-") as temporary: + root = Path(temporary) + audit.snapshot(data, root) + path = root / audit.EXPORT + path.write_bytes(path.read_bytes() + b"\n# changed source\n") + with self.assertRaisesRegex(ValueError, "source pin mismatch"): + audit.sources(root) + + def test_native_invoice_cannot_refund_alias_copy(self): + # This uses the saved native receipt solely as a test fixture. + data = json.loads((PACKAGE / "NATIVE.json").read_bytes()) + result = data["native"]["fixtures"]["balanced_alias"]["10"] + local = data["fixtures"]["balanced_alias"] + audit.reconcile_native(result, local, 10) + wrong = copy.deepcopy(result) + wrong["legality"]["receipt"]["rank_mass"] -= 7 + with self.assertRaisesRegex(ValueError, "native invoice mismatch"): + audit.reconcile_native(wrong, local, 10) + wrong = copy.deepcopy(result) + wrong["columns"]["receipt"]["fresh_center_copies"] = 45 + with self.assertRaisesRegex(ValueError, "five-stage COPY bill"): + audit.reconcile_native(wrong, local, 10) + + +if __name__ == "__main__": + unittest.main(verbosity=2) diff --git a/research/scatter-alias-native-audit/verify.py b/research/scatter-alias-native-audit/verify.py new file mode 100644 index 0000000000..c8548995fe --- /dev/null +++ b/research/scatter-alias-native-audit/verify.py @@ -0,0 +1,445 @@ +#!/usr/bin/env python3 +"""PR3128 alias boundary audit, including optional actual native replay. + +Prepared for commdata2338, with substantial OpenAI Codex assistance. +Apache-2.0. Predecessor programs execute as authenticated audit subjects. +""" +import argparse +from collections import Counter +import copy +import gzip +import hashlib +import json +import math +import os +from pathlib import Path +import struct +import subprocess +import sys +import tempfile + +PACKAGE = Path(__file__).resolve().parent +ROOT = PACKAGE.parents[1] +WORD = "research/e8-bit-p111-tuned/tune/bitE8mut-p111-tuned.json.gz" +CHECK = "research/e8-bit-p111-tuned/code/xcheck_p.py" +BIT = "research/e8-bit-carrier-skeleton/code/bit/" +EXPORT = BIT + "export_records.py" +STAGE = BIT + "regression/stage_cohort.py" +CHECKERS = BIT + "checkers/" +PORTABLE = "research/e8-bit-carrier-skeleton/portable-include/" +STANDIN = "research/bit589-checked-cpp-int-seed92/include/" +BOUNDARY = "research/simple-scatter-boundary/boundary.py" +PREVIOUS = "research/retained-alias-parity-audit/EXPECTED.json" +SELECTED = "research/community-frontier1094-audit/SELECTED-SOURCE.json" +ARTIFACTS = ("249-records.bin", "249-states.json", "frames.json") +RECORD = struct.Struct("<6i") +LEGAL_PASS = "PASS_INDEPENDENT_COHORT_LEGALITY_SOURCE_OWNERS_AND_LIFECYCLE" +COLUMN_PASS = "PASS_NEW_COHORT249_ALL_FIVE_STAGE_FORMAL_COLUMNS_AND_PREFIX_BILL" +ENDPOINT_FAILURE = "local defining-decoder full formal column" + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +def canonical(value): + return json.dumps(value, sort_keys=True, separators=(",", ":"), allow_nan=False) + + +def digest(body): + return hashlib.sha256(body).hexdigest() + + +def sources(root=ROOT): + pins = json.loads((PACKAGE / "SOURCES.json").read_bytes()) + data = {} + for row in pins["files"]: + if row["usage"] == "input": + body = (root / row["path"]).read_bytes() + need(digest(body) == row["sha256"], "source pin mismatch: " + row["path"]) + data[row["path"]] = body + selected = json.loads(data[SELECTED])["files"] + for path in (WORD, CHECK, EXPORT): + need(digest(data[path]) == selected[path], "selected source binding: " + path) + return data + + +def command(args, timeout=60): + return subprocess.run([str(x) for x in args], capture_output=True, + text=True, check=False, timeout=timeout) + + +def python(script, *args): + # No audit-subject repository imports; scripts run on private snapshots. + return command([sys.executable, "-I", "-B", script, *args]) + + +def snapshot(data, directory): + for name, body in data.items(): + path = directory / name + path.parent.mkdir(parents=True, exist_ok=True) + path.write_bytes(body) + + +def fixtures(word): + need((word["v"], word["R"], len(word["ret"])) == (111, 439, 9), "fixed header") + need(word["ret"][8] == 480 and word["scatter"][64] == [2, 4, 6], "PR3128 site") + out = {"baseline": copy.deepcopy(word)} + for name, tail, helper in ( + ("balanced_alias", [8, 8, 9, 9], 480), + ("unpaired_even", [8, 8], 480), + ("distinct_helpers", [8, 8, 9, 9], 479), + ("unused_alias", [], 480), + ): + mutant = copy.deepcopy(word) + mutant["ret"].append(helper) + mutant["scatter"][64].extend(tail) + out[name] = mutant + return out + + +def read_records(raw): + need(len(raw) % RECORD.size == 0, "record alignment") + need(0 < len(raw) // RECORD.size < 30000, "bounded record count") + return list(RECORD.iter_unpack(raw)) + + +def scalar_and_invoice(records, n=661, v=111): + """Independent scalar projection and literal paid-event recount. + + MOVE geometry is left to the actual native program. Each integer bit is + one arbitrary dirty-input basis column. COPY/ERASE source binding is checked. + """ + values = [1 << r for r in range(n)] + [0] + opened = None + counts, ranks = Counter(), Counter() + scatter_adds = 0 + for op, a, b, c, f, z in records: + need(op in range(4) and 0 <= a <= n, "opcode or destination") + counts[op] += 1 + if op == 0: + need(a != n or opened is not None, "MOVE inactive temporary") + need(f >= 0, "negative MOVE charge") + if f: + ranks[f] += 1 + elif op == 1: + need(0 <= b <= n and a != b, "ADD source") + need(a != n and (b != n or opened is not None), "ADD temporary lifecycle") + need(a != opened, "copied source mutated") + if c % 2: + values[a] ^= values[b] + scatter_adds += (z == 3) + elif op == 2: + need(opened is None and a < n and b == n, "COPY lifecycle") + need(z >= 0, "COPY charge") + opened = a + values[n] = values[a] + ranks[z] += 1 + else: + need(opened is not None and a == opened and b == n, "ERASE source binding") + values[n] = 0 + opened = None + need(opened is None and values[n] == 0, "temporary not closed") + differences = [] + for r in range(n): + expected = (1 << r) ^ ((1 << (r - v)) if v <= r < 2 * v else 0) + delta = values[r] ^ expected + if delta: + differences.append({"output": r, "input_columns": [ + i for i in range(n) if delta >> i & 1]}) + return differences, { + "records": len(records), "moves": counts[0], "adds": counts[1], + "copies": counts[2], "erasures": counts[3], "scatter_adds": scatter_adds, + "rank_mass": sum(k * count for k, count in ranks.items()), + "paid_histogram": [[k, ranks[k]] for k in sorted(ranks)], + "copy_rank_sum": sum(row[5] for row in records if row[0] == 2), + } + + +def prefix_invoice(records, n=661): + """Unbounded integer recurrence cross-checking the native checked128 bill.""" + events = [(op, a, b, c) for op, a, b, c, _, _ in records if op != 0] + maxima = [] + for reverse in (False, True): + norms = [1] * (n + 1) + peak = 1 + for op, a, b, coefficient in (reversed(events) if reverse else events): + if reverse and op in (2, 3): + op = 5 - op + if op == 1: + norms[a] += abs(coefficient) * norms[b] + peak = max(peak, norms[a]) + elif op == 2: + norms[n] = norms[a] + else: + norms[n] = 0 + need(norms[n] == 0, "prefix temporary closure") + maxima.append(peak) + forward, backward = maxima + payload = 64 * forward ** 3 * backward ** 2 + return {"forward": str(forward), "reverse": str(backward), + "payload": str(payload), "bits": payload.bit_length(), + "below_2_104": payload < 2 ** 104} + + +def guard(snapshot_root, wordpath, directory, accepted, artifacts): + checked = python(snapshot_root / BOUNDARY, "check", wordpath) + need(checked.returncode == (0 if accepted else 2), "actual guard check outcome") + if not accepted: + need("duplicate index 8" in checked.stderr, "guard check rejection site") + output = directory / "guard-export" + result = python(snapshot_root / BOUNDARY, "export", wordpath, output) + need(result.returncode == (0 if accepted else 2), "actual guard export outcome") + if accepted: + need(all((output / k).read_bytes() == artifacts[k] for k in ARTIFACTS), + "guard changes valid export") + else: + need(not output.exists() and "duplicate index 8" in result.stderr, + "guard must reject before output") + output.mkdir() + for name in ARTIFACTS: + (output / name).write_bytes(b"preexisting output\n") + result = python(snapshot_root / BOUNDARY, "export", wordpath, output) + need(result.returncode == 2, "existing-output duplicate rejected") + need(all((output / k).read_bytes() == b"preexisting output\n" for k in ARTIFACTS), + "guard clobbered output") + return {"accepted": accepted, "valid_bytes_preserved": True if accepted else None, + "rejected_before_creation": None if accepted else True, + "existing_outputs_preserved": None if accepted else True} + + +def run_fixture(name, word, snapshot_root, directory, predecessor): + directory.mkdir() + wordpath = directory / "word.json.gz" + wordpath.write_bytes(gzip.compress(canonical(word).encode(), mtime=0)) + receipt = directory / "symbolic.json" + checked = python(snapshot_root / CHECK, wordpath, "--json", receipt) + need(checked.returncode == 0 and receipt.exists(), + "full symbolic check: " + checked.stdout + checked.stderr) + symbolic = json.loads(receipt.read_bytes()) + need(symbolic["status"] == "PASS_EXACT_REPLAY_AND_INTERLEAVED_INTERFACE", "symbolic status") + need(symbolic["columns"] == 661 and all(symbolic["hypotheses"].values()) + and all(symbolic["conclusion"].values()), "full interface") + output = directory / "records" + exported = python(snapshot_root / EXPORT, wordpath, output) + need(exported.returncode == 0, "actual exporter: " + exported.stderr) + artifacts = {k: (output / k).read_bytes() for k in ARTIFACTS} + raw = artifacts["249-records.bin"] + records = read_records(raw) + differences, invoice = scalar_and_invoice(records) + if name in predecessor["fixtures"]: + prior = predecessor["fixtures"][name] + need(digest(raw) == prior["records_sha256"], "exact PR3128 record fixture identity") + need(differences == prior["differences"], "independent full-column comparison to PR3128") + need(invoice["copy_rank_sum"] == prior["copy_rank_sum"], "COPY rank cross-check") + return { + "artifacts_sha256": {k: digest(body) for k, body in artifacts.items()}, + "symbolic": symbolic, "scalar_differences": differences, "invoice": invoice, + "prefix": prefix_invoice(records), + "guard": guard(snapshot_root, wordpath, directory, + name in ("baseline", "unused_alias"), artifacts), + }, records + + +def primary(data, directory): + snapshot_root = directory / "sources" + snapshot(data, snapshot_root) + predecessor = json.loads(data[PREVIOUS]) + results, streams = {}, {} + for name, word in fixtures(json.loads(gzip.decompress(data[WORD]))).items(): + results[name], streams[name] = run_fixture( + name, word, snapshot_root, directory / name, predecessor) + base, alias = results["baseline"], results["balanced_alias"] + need(not base["scalar_differences"] and not alias["scalar_differences"], "positive endpoints") + for name in ("unpaired_even", "distinct_helpers"): + delta = results[name]["scalar_differences"] + need(len(delta) == 1 and delta[0]["output"] == 175 + and 480 in delta[0]["input_columns"], "dirty-column control") + need(base["artifacts_sha256"]["frames.json"] == alias["artifacts_sha256"]["frames.json"], + "unchanged frame dictionary") + delta = {k: alias["invoice"][k] - base["invoice"][k] for k in ( + "records", "moves", "adds", "copies", "erasures", + "scatter_adds", "rank_mass", "copy_rank_sum")} + need(delta == {"records": 4, "moves": 0, "adds": 2, "copies": 1, "erasures": 1, + "scatter_adds": 2, "rank_mass": 7, "copy_rank_sum": 7}, + "complete literal alias delta") + unused = results["unused_alias"] + need(not unused["scalar_differences"], "unused alias endpoint") + unused_delta = {k: unused["invoice"][k] - base["invoice"][k] for k in delta} + need(unused_delta == {"records": 2, "moves": 0, "adds": 0, "copies": 1, + "erasures": 1, "scatter_adds": 0, "rank_mass": 7, + "copy_rank_sum": 7}, "unused alias count-only control") + return {"status": "PASS_SCATTER_ALIAS_BOUNDARY_AUDIT", "fixtures": results, + "balanced_minus_selected": delta, "unused_minus_selected": unused_delta, + "columns": 661, + "no_new_kappa": True}, streams, snapshot_root + + +def compile_native(snapshot_root, directory, copies): + flags = [os.environ.get("CXX", "c++"), "-O2", "-std=c++17", "-DHDIM=8", + "-DVPORTS=111", "-DRHELP=439", f"-DNCOPY={copies}"] + flags += ["-I" + str(snapshot_root / p) for p in (PORTABLE, CHECKERS, STANDIN)] + out = {} + for name in ("legality_h", "columns_h"): + target = directory / (name + str(copies)) + result = command(flags + ["-o", target, snapshot_root / CHECKERS / (name + ".cpp")], + timeout=120) + need(result.returncode == 0 and target.exists(), "native compile: " + result.stderr) + out[name] = target + return out + + +def native_check(binary, args, receipt, rejection=None): + result = command([binary, *args, receipt]) + if rejection: + need(result.returncode != 0 and not receipt.exists(), + "native must reject without success receipt") + need(rejection in result.stderr, "native rejection site: " + result.stderr) + return {"accepted": False, "reason": rejection} + need(result.returncode == 0 and receipt.exists(), "native failure: " + result.stderr) + value = json.loads(receipt.read_bytes()) + need(value.get("status") in (LEGAL_PASS, COLUMN_PASS), "native success status") + if "seconds" in value: + seconds = value.pop("seconds") + need(type(seconds) in (int, float) and math.isfinite(seconds) and seconds >= 0, + "native elapsed time") + need(value["local_scalar_stream"] == str(args[0]), "native stream receipt binding") + value["local_scalar_stream"] = "COHORT249-RECORDS.bin" + lines = result.stderr.splitlines() + need(len(lines) == 5, "five native stages") + for i, line in enumerate(lines): + prefix = f"stage {i} PASS elapsed " + need(line.startswith(prefix) and line.endswith("s"), "native stage progress") + elapsed = float(line[len(prefix):-1]) + need(math.isfinite(elapsed) and elapsed >= 0, "stage elapsed time") + return {"accepted": True, "receipt": value} + + +def stage(snapshot_root, directory): + source = directory / "records" + cin, cout = directory / "cin", directory / "cout" + result = python(snapshot_root / STAGE, source, source, cin, cout) + need(result.returncode == 0, "native staging: " + result.stderr) + need((cout / "COHORT249-RECORDS.bin").read_bytes() == + (source / "249-records.bin").read_bytes(), "staging changed stream") + return cin, cout + + +def reconcile_native(result, local, copies): + legal, invoice = result["legality"]["receipt"], local["invoice"] + need(legal["status"] == LEGAL_PASS, "legality receipt status") + for native, own in (("records", "records"), ("nested_MOVEs", "moves"), + ("common_frame_ADDs", "adds"), ("copies", "copies"), + ("erasures", "erasures"), ("rank_mass", "rank_mass"), + ("paid_histogram", "paid_histogram")): + need(legal[native] == invoice[own], "native invoice mismatch: " + native) + if not result["columns"]["accepted"]: + return + columns = result["columns"]["receipt"] + need(columns["status"] == COLUMN_PASS and columns["formal_columns_checked"] == 883, + "native columns") + need(columns["local_raw_H"] == invoice["paid_histogram"], "column paid histogram") + need(columns["local_scalar_additions"] == invoice["adds"] + and columns["five_stage_additions"] == 5 * invoice["adds"], "five-stage ADD bill") + need(columns["fresh_center_copies"] == 5 * copies + and columns["reverse_fresh_center_copies"] == 2 * copies, "five-stage COPY bill") + prefix = local["prefix"] + need([x["cancellation_free_signed_row_l1_upper"] for x in columns["signed_lift_prefix"]] + == [prefix["forward"], prefix["reverse"]], "native prefix recurrence") + need(columns["payload_prefix_upper"] == prefix["payload"] + and columns["payload_prefix_bits"] == prefix["bits"], "native payload invoice") + + +def native_controls(binaries, records, directory): + fixture_dir = directory / "balanced_alias" + cin, cout = fixture_dir / "cin", fixture_dir / "cout" + stream = cout / "COHORT249-RECORDS.bin" + copy_index = max(i for i, row in enumerate(records) if row[0] == 2) + erase_index = next(i for i in range(copy_index + 1, len(records)) if records[i][0] == 3) + add_index = next(i for i in range(copy_index + 1, erase_index) if records[i][0] == 1) + result = {} + for kind in ("underprice_copy_rank", "wrong_erase_source", "omit_alias_add"): + mutated = [list(r) for r in records] + if kind == "underprice_copy_rank": + mutated[copy_index][5] -= 1 + legal_failure, column_failure = "COPY rank", None + elif kind == "wrong_erase_source": + mutated[erase_index][1] = 479 + legal_failure, column_failure = "invalid ERASE lifecycle", "discard original-source binding" + else: + del mutated[add_index] + legal_failure, column_failure = None, ENDPOINT_FAILURE + stream.write_bytes(b"".join(RECORD.pack(*row) for row in mutated)) + result[kind] = { + "legality": native_check(binaries["legality_h"], [cin, cout], + fixture_dir / (kind + "-legal.json"), legal_failure), + "columns": native_check(binaries["columns_h"], [stream], + fixture_dir / (kind + "-columns.json"), column_failure), + } + stream.write_bytes(b"".join(RECORD.pack(*row) for row in records)) + return result + + +def native_audit(primary_result, streams, snapshot_root, directory): + # The legacy legality checker aborts on failure; prevent core-file writes. + if os.name == "posix": + import resource + resource.setrlimit(resource.RLIMIT_CORE, (0, 0)) + binaries = {count: compile_native(snapshot_root, directory, count) for count in (9, 10)} + results = {} + for name, local in primary_result["fixtures"].items(): + fixture_dir = directory / name + cin, cout = stage(snapshot_root, fixture_dir) + stream = cout / "COHORT249-RECORDS.bin" + results[name] = {} + for count in (9, 10): + right_count = count == local["invoice"]["copies"] + legal_failure = None if right_count else "unclosed COPY" + column_failure = ("center boundaries" if not right_count else + (ENDPOINT_FAILURE if local["scalar_differences"] else None)) + result = { + "legality": native_check(binaries[count]["legality_h"], [cin, cout], + fixture_dir / f"legality{count}.json", legal_failure), + "columns": native_check(binaries[count]["columns_h"], [stream], + fixture_dir / f"columns{count}.json", column_failure), + } + if right_count: + reconcile_native(result, local, count) + results[name][str(count)] = result + previous = json.loads((snapshot_root / "research/scatter-export-parity-audit/NATIVE.json").read_bytes()) + for kind in ("legality", "columns"): + need(results["baseline"]["9"][kind]["receipt"] == previous["fixtures"]["baseline"][kind], + "unchanged PR2977 native baseline receipt") + return {"status": "PASS_SCATTER_ALIAS_NATIVE_AUDIT", + "backend": "checked_cpp_int_128_standin", "fixtures": results, + "controls": native_controls(binaries[10], streams["balanced_alias"], directory), + "columns": 883, "no_new_kappa": True} + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--native", action="store_true", + help="compile both actual checker contracts with C++17") + parser.add_argument("--emit", action="store_true", + help="print reconstructed deterministic receipt") + args = parser.parse_args() + with tempfile.TemporaryDirectory(prefix="scatter-alias-") as temporary: + directory = Path(temporary) + result, streams, snapshot_root = primary(sources(), directory) + if args.native: + result["native"] = native_audit(result, streams, snapshot_root, directory) + if args.emit: + print(json.dumps(result, indent=2, sort_keys=True, allow_nan=False)) + else: + receipt = PACKAGE / ("NATIVE.json" if args.native else "RESULT.json") + need(canonical(result) == canonical(json.loads(receipt.read_bytes())), + "deterministic typed receipt mismatch") + if args.native: + print("PASS_SCATTER_ALIAS_NATIVE_AUDIT fixtures=5 contracts=2 native_columns=883 controls=3 no_new_kappa") + else: + print("PASS_SCATTER_ALIAS_BOUNDARY_AUDIT fixtures=5 columns=661 guard_rejects=3 no_new_kappa") + + +if __name__ == "__main__": + main()