diff --git a/research/r439-block8-integer-factor/CERTIFICATE.json b/research/r439-block8-integer-factor/CERTIFICATE.json new file mode 100644 index 0000000000..b562025b7b --- /dev/null +++ b/research/r439-block8-integer-factor/CERTIFICATE.json @@ -0,0 +1,951 @@ +{ + "F2_matrix": [ + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0 + ], + [ + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0 + ], + [ + 1, + 1, + 0, + 1, + 1, + 1, + 1, + 0, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 0, + 1, + 1, + 0, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 0, + 1, + 0, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 0, + 1, + 1, + 0, + 1, + 1, + 1, + 0, + 1, + 1 + ], + [ + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 1, + 1 + ], + [ + 1, + 1, + 0, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0 + ] + ], + "block": 8, + "boolean_inputs": 4096, + "columns": 661, + "controls_rejected": [ + "drop circuit gate", + "reverse circuit operand", + "F2-neutral positive-cost inflation", + "dropped cleanup", + "nonliteral original cleanup", + "illegal lower frame", + "missing dirty compensation", + "dropped exported block ADD", + "payload overflow", + "wrong source register" + ], + "kappa_claim": "none; unchanged paid rank profile, no hosted replay", + "labels": { + "frames": 636, + "gram_det": 1, + "labels": 111, + "lattice_rank": 8, + "punctured": 9, + "root_lines": 120 + }, + "native_records": { + "original": { + "adds": 24305, + "copies": 9, + "erasures": 9, + "moves": 2911, + "paid_histogram": { + "1": 1323, + "2": 1342, + "3": 79, + "4": 44, + "5": 102, + "6": 11, + "7": 19 + }, + "prefix": { + "cap_bits": 104, + "forward": 49347, + "payload": "9528119495320518471870892800", + "payload_bits": 93, + "reverse": 1113070 + }, + "rank_mass": 5129, + "records": 27234, + "records_sha256": "ea44aa047a2a9cf034de8b56b2166c49cf2dbdf9cd9ed6a20299a4f2b05ef09a" + }, + "replacement": { + "adds": 24295, + "copies": 9, + "erasures": 9, + "moves": 2911, + "paid_histogram": { + "1": 1323, + "2": 1342, + "3": 79, + "4": 44, + "5": 102, + "6": 11, + "7": 19 + }, + "prefix": { + "cap_bits": 104, + "forward": 49347, + "payload": "11607066161648800787038010112", + "payload_bits": 94, + "reverse": 1228514 + }, + "rank_mass": 5129, + "records": 27224, + "records_sha256": "d724453cd6e942c01f5ffaf6c7c37e0fb735086ced3eff7d0d2f76b7d04d4b69" + } + }, + "new_gates": 40, + "new_phase_gates": { + "A": 2075, + "B": 707, + "C": 2569, + "D": 111 + }, + "old_gates": 45, + "old_phase_gates": { + "A": 2075, + "B": 712, + "C": 2574, + "D": 111 + }, + "positive_matrices": { + "forward": { + "original": [ + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0 + ], + [ + 1, + 2, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0 + ], + [ + 1, + 1, + 2, + 1, + 3, + 1, + 3, + 2, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 2, + 1, + 1, + 2, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 2, + 1, + 2, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 2, + 1, + 3, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 0, + 1, + 1, + 0, + 1, + 1, + 1, + 0, + 1, + 1 + ], + [ + 2, + 2, + 1, + 3, + 3, + 1, + 3, + 1, + 3, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 3, + 1, + 3, + 1, + 1, + 2, + 1, + 1 + ], + [ + 1, + 1, + 0, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 3, + 1, + 3, + 1, + 1, + 1, + 1, + 2 + ] + ], + "replacement": [ + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0 + ], + [ + 1, + 2, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0 + ], + [ + 1, + 1, + 2, + 1, + 3, + 1, + 3, + 2, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 2, + 1, + 1, + 2, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 2, + 1, + 2, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 2, + 1, + 3, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 0, + 1, + 1, + 0, + 1, + 1, + 1, + 0, + 1, + 1 + ], + [ + 2, + 2, + 1, + 3, + 3, + 1, + 3, + 1, + 3, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 3, + 1, + 3, + 1, + 1, + 2, + 1, + 1 + ], + [ + 1, + 1, + 0, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 3, + 1, + 3, + 1, + 1, + 1, + 1, + 2 + ] + ] + }, + "reverse": { + "original": [ + [ + 3, + 1, + 0, + 2, + 1, + 9, + 1, + 0, + 1, + 0, + 14, + 0 + ], + [ + 1, + 1, + 0, + 0, + 0, + 2, + 0, + 0, + 0, + 0, + 2, + 0 + ], + [ + 0, + 0, + 1, + 0, + 1, + 3, + 1, + 1, + 0, + 0, + 7, + 0 + ], + [ + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 2, + 0 + ], + [ + 0, + 0, + 0, + 0, + 1, + 1, + 0, + 0, + 0, + 0, + 2, + 0 + ], + [ + 0, + 0, + 1, + 0, + 3, + 9, + 3, + 2, + 0, + 1, + 19, + 0 + ], + [ + 0, + 0, + 0, + 0, + 1, + 2, + 1, + 0, + 0, + 0, + 4, + 0 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 1, + 0 + ], + [ + 1, + 0, + 0, + 1, + 0, + 4, + 1, + 0, + 1, + 0, + 7, + 0 + ], + [ + 0, + 0, + 0, + 0, + 1, + 3, + 1, + 0, + 0, + 1, + 6, + 0 + ], + [ + 5, + 2, + 0, + 4, + 4, + 22, + 4, + 0, + 2, + 0, + 38, + 1 + ], + [ + 0, + 0, + 0, + 0, + 1, + 3, + 1, + 0, + 0, + 0, + 6, + 1 + ] + ], + "replacement": [ + [ + 21, + 1, + 0, + 2, + 19, + 7, + 9, + 0, + 1, + 0, + 22, + 0 + ], + [ + 1, + 1, + 0, + 0, + 2, + 0, + 0, + 0, + 0, + 0, + 2, + 0 + ], + [ + 10, + 0, + 1, + 0, + 9, + 5, + 5, + 1, + 0, + 0, + 11, + 0 + ], + [ + 8, + 0, + 0, + 1, + 6, + 3, + 4, + 0, + 0, + 0, + 8, + 0 + ], + [ + 8, + 0, + 0, + 0, + 7, + 3, + 4, + 0, + 0, + 0, + 8, + 0 + ], + [ + 30, + 0, + 3, + 0, + 25, + 15, + 15, + 4, + 0, + 1, + 31, + 0 + ], + [ + 6, + 0, + 0, + 0, + 5, + 2, + 3, + 0, + 0, + 0, + 6, + 0 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 1, + 0 + ], + [ + 11, + 0, + 0, + 1, + 10, + 4, + 5, + 0, + 1, + 0, + 11, + 0 + ], + [ + 18, + 0, + 2, + 0, + 15, + 9, + 9, + 2, + 0, + 1, + 18, + 0 + ], + [ + 13, + 0, + 0, + 0, + 12, + 6, + 6, + 0, + 0, + 0, + 14, + 1 + ], + [ + 10, + 0, + 0, + 0, + 9, + 5, + 5, + 0, + 0, + 0, + 10, + 1 + ] + ] + } + }, + "reconstructed_word_sha256": "262865c8eeffce832c498dd46993ea5f3a8d9a66351536d497db3efbef4aa66a", + "saved_with_cleanup": 10, + "status": "PASS_R439_BLOCK8_INTEGER_FACTOR" +} diff --git a/research/r439-block8-integer-factor/CLAIM.md b/research/r439-block8-integer-factor/CLAIM.md new file mode 100644 index 0000000000..c98998d2d7 --- /dev/null +++ b/research/r439-block8-integer-factor/CLAIM.md @@ -0,0 +1,45 @@ +# Local sprint claim + +- Track: bit supplier. OS randomness assignment seed: **18**. +- Base: `f567884aeb8851b6e794af1184119a3bfbe1e631`. +- Started: 2026-10-13; expected finish within 45 minutes of scope selection. +- No pinned coordination issue exists (GitHub GraphQL checked); the only open + issue is #650 about Discussions. Claim recorded locally as instructed. +- Candidates considered: (1) whole positive-integer factorization of tuned R439 + B block 8, (2) phase-A quad 18 resynthesis, (3) cleanup frame reduction. + Choose (1): (2) closely repeats existing quad work and (3) is excluded by + #827's fixed-prefix result. Seed 18 selects block 18 modulo 10 = 8. +- Exact object: PR589 tuned R439 B[404:449], frame 523, twelve wires. + Search full-block nonnegative integer row-subtraction factorizations, without + preserving the predecessor's two-factor boundary. Require the same forward + integer matrix and entrywise nonincreasing reverse positive matrix. +- Deliverable: one literal circuit witness, exact verifier, paid restoration + and source/access/frame accounting, mutation controls, and a scoped note. +- Overlap checked through PR854, all open PR titles and relevant bodies. + #844 changes R439 block 4 with fixed-factor destination-once optimization; + #810 changes historical R420 block 8; #728/#792 change R439 A mini-nodes; + #827 concerns cleanup frames, not scalar factorization. This investigates a + different whole-block search class on the punctured word, imports none of + those pending implementations, and will not add their savings to ours. +- Selected result: #799 with #589, conditional kappa 0.001661634653669567. + This experiment claims no new kappa and will not edit the selection. + +## Result update + +The 5,000-trial strict search produced no shorter reverse-dominated circuit +among its 333 identity factorizations. One pivot kept exactly the same sampled +trajectories and allowed a larger reverse positive bound subject to the full +existing 104-bit native cap. The resulting 40-gate block saves ten ADDs with +cleanup; the native envelope grows from 93 to 94 bits. No moment/kappa change. +The full search coverage, witness, exact controls and replay are packaged here. + +Final overlap refresh: all open PR metadata through #856 on 2026-10-13; +#843 (head c99f4478156906c323b1a041f0443f76139d6b6c) changes frame 509, +#844 (dee2c7d506312d2e555a59fb0916c161b4e64028) changes frame 520, and +#848 (510441077c17ad775003b22fca03a519f5330453) is a sharing barrier. +No block-8/frame-523 substitution found. No pinned coordination issue exists +on the final check either. Main remains the exact experimental base. + +Submitted result: [PR #857](https://github.com/CrocSwap/integer-mult-bounds/pull/857). +Local and native verification passed; detailed evidence and limitations are in +`VALIDATION.md`. One focused PR submitted; no selected-frontier change or merge. diff --git a/research/r439-block8-integer-factor/NATIVE-CERTIFICATE.json b/research/r439-block8-integer-factor/NATIVE-CERTIFICATE.json new file mode 100644 index 0000000000..e6ca0ac033 --- /dev/null +++ b/research/r439-block8-integer-factor/NATIVE-CERTIFICATE.json @@ -0,0 +1,1202 @@ +{ + "original": { + "legality": { + "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" + }, + "stages": { + "11": { + "bridge_additions": 2664, + "copied_center_original_source_immutable": true, + "formal_columns_checked": 1549, + "fresh_center_copies": 99, + "global_live_registers": 1549, + "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, + "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 + }, + { + "omit_bridge": 6, + "rejected": true + }, + { + "omit_bridge": 7, + "rejected": true + }, + { + "omit_bridge": 8, + "rejected": true + }, + { + "omit_bridge": 9, + "rejected": true + }, + { + "omit_bridge": 10, + "rejected": true + }, + { + "omit_bridge": 11, + "rejected": true + }, + { + "omit_bridge": 12, + "rejected": true + }, + { + "omit_bridge": 13, + "rejected": true + }, + { + "omit_bridge": 14, + "rejected": true + }, + { + "omit_bridge": 15, + "rejected": true + }, + { + "omit_bridge": 16, + "rejected": true + }, + { + "omit_bridge": 17, + "rejected": true + }, + { + "omit_bridge": 18, + "rejected": true + }, + { + "omit_bridge": 19, + "rejected": true + }, + { + "omit_bridge": 20, + "rejected": true + }, + { + "omit_bridge": 21, + "rejected": true + }, + { + "omit_bridge": 22, + "rejected": true + }, + { + "omit_bridge": 23, + "rejected": true + } + ], + "new_Q_categories": [ + 28, + 29 + ], + "payload_prefix_bits": 93, + "payload_prefix_upper": "9528119495320518471870892800", + "reverse_fresh_center_copies": 45, + "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.", + "stage_additions": 267355, + "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 + }, + { + "fresh_copies": 9, + "scalar_additions": 24305, + "signed_inverse": true, + "stage": 5 + }, + { + "fresh_copies": 9, + "scalar_additions": 24305, + "signed_inverse": false, + "stage": 6 + }, + { + "fresh_copies": 9, + "scalar_additions": 24305, + "signed_inverse": true, + "stage": 7 + }, + { + "fresh_copies": 9, + "scalar_additions": 24305, + "signed_inverse": false, + "stage": 8 + }, + { + "fresh_copies": 9, + "scalar_additions": 24305, + "signed_inverse": true, + "stage": 9 + }, + { + "fresh_copies": 9, + "scalar_additions": 24305, + "signed_inverse": false, + "stage": 10 + } + ], + "status": "PASS_NEW_COHORT249_ALL_BRIDGED_STAGE_FORMAL_COLUMNS_AND_PREFIX_BILL" + }, + "5": { + "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, + "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" + }, + "9": { + "bridge_additions": 1998, + "copied_center_original_source_immutable": true, + "formal_columns_checked": 1327, + "fresh_center_copies": 81, + "global_live_registers": 1327, + "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, + "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 + }, + { + "omit_bridge": 6, + "rejected": true + }, + { + "omit_bridge": 7, + "rejected": true + }, + { + "omit_bridge": 8, + "rejected": true + }, + { + "omit_bridge": 9, + "rejected": true + }, + { + "omit_bridge": 10, + "rejected": true + }, + { + "omit_bridge": 11, + "rejected": true + }, + { + "omit_bridge": 12, + "rejected": true + }, + { + "omit_bridge": 13, + "rejected": true + }, + { + "omit_bridge": 14, + "rejected": true + }, + { + "omit_bridge": 15, + "rejected": true + }, + { + "omit_bridge": 16, + "rejected": true + }, + { + "omit_bridge": 17, + "rejected": true + } + ], + "new_Q_categories": [ + 28, + 29 + ], + "payload_prefix_bits": 93, + "payload_prefix_upper": "9528119495320518471870892800", + "reverse_fresh_center_copies": 36, + "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.", + "stage_additions": 218745, + "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 + }, + { + "fresh_copies": 9, + "scalar_additions": 24305, + "signed_inverse": true, + "stage": 5 + }, + { + "fresh_copies": 9, + "scalar_additions": 24305, + "signed_inverse": false, + "stage": 6 + }, + { + "fresh_copies": 9, + "scalar_additions": 24305, + "signed_inverse": true, + "stage": 7 + }, + { + "fresh_copies": 9, + "scalar_additions": 24305, + "signed_inverse": false, + "stage": 8 + } + ], + "status": "PASS_NEW_COHORT249_ALL_BRIDGED_STAGE_FORMAL_COLUMNS_AND_PREFIX_BILL" + } + } + }, + "replacement": { + "legality": { + "all_final_frames_pass": true, + "common_frame_ADDs": 24295, + "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": 27224, + "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" + }, + "stages": { + "11": { + "bridge_additions": 2664, + "copied_center_original_source_immutable": true, + "formal_columns_checked": 1549, + "fresh_center_copies": 99, + "global_live_registers": 1549, + "independent_dirty_registers": 439, + "local_odd_scalar_additions": 24295, + "local_raw_H": [ + [ + 1, + 1323 + ], + [ + 2, + 1342 + ], + [ + 3, + 79 + ], + [ + 4, + 44 + ], + [ + 5, + 102 + ], + [ + 6, + 11 + ], + [ + 7, + 19 + ] + ], + "local_registers": 661, + "local_scalar_additions": 24295, + "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 + }, + { + "omit_bridge": 6, + "rejected": true + }, + { + "omit_bridge": 7, + "rejected": true + }, + { + "omit_bridge": 8, + "rejected": true + }, + { + "omit_bridge": 9, + "rejected": true + }, + { + "omit_bridge": 10, + "rejected": true + }, + { + "omit_bridge": 11, + "rejected": true + }, + { + "omit_bridge": 12, + "rejected": true + }, + { + "omit_bridge": 13, + "rejected": true + }, + { + "omit_bridge": 14, + "rejected": true + }, + { + "omit_bridge": 15, + "rejected": true + }, + { + "omit_bridge": 16, + "rejected": true + }, + { + "omit_bridge": 17, + "rejected": true + }, + { + "omit_bridge": 18, + "rejected": true + }, + { + "omit_bridge": 19, + "rejected": true + }, + { + "omit_bridge": 20, + "rejected": true + }, + { + "omit_bridge": 21, + "rejected": true + }, + { + "omit_bridge": 22, + "rejected": true + }, + { + "omit_bridge": 23, + "rejected": true + } + ], + "new_Q_categories": [ + 28, + 29 + ], + "payload_prefix_bits": 94, + "payload_prefix_upper": "11607066161648800787038010112", + "reverse_fresh_center_copies": 45, + "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": "1228514", + "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.", + "stage_additions": 267245, + "stages": [ + { + "fresh_copies": 9, + "scalar_additions": 24295, + "signed_inverse": false, + "stage": 0 + }, + { + "fresh_copies": 9, + "scalar_additions": 24295, + "signed_inverse": true, + "stage": 1 + }, + { + "fresh_copies": 9, + "scalar_additions": 24295, + "signed_inverse": false, + "stage": 2 + }, + { + "fresh_copies": 9, + "scalar_additions": 24295, + "signed_inverse": true, + "stage": 3 + }, + { + "fresh_copies": 9, + "scalar_additions": 24295, + "signed_inverse": false, + "stage": 4 + }, + { + "fresh_copies": 9, + "scalar_additions": 24295, + "signed_inverse": true, + "stage": 5 + }, + { + "fresh_copies": 9, + "scalar_additions": 24295, + "signed_inverse": false, + "stage": 6 + }, + { + "fresh_copies": 9, + "scalar_additions": 24295, + "signed_inverse": true, + "stage": 7 + }, + { + "fresh_copies": 9, + "scalar_additions": 24295, + "signed_inverse": false, + "stage": 8 + }, + { + "fresh_copies": 9, + "scalar_additions": 24295, + "signed_inverse": true, + "stage": 9 + }, + { + "fresh_copies": 9, + "scalar_additions": 24295, + "signed_inverse": false, + "stage": 10 + } + ], + "status": "PASS_NEW_COHORT249_ALL_BRIDGED_STAGE_FORMAL_COLUMNS_AND_PREFIX_BILL" + }, + "5": { + "bridge_additions": 666, + "copied_center_original_source_immutable": true, + "five_stage_additions": 121475, + "formal_columns_checked": 883, + "fresh_center_copies": 45, + "global_live_registers": 883, + "independent_dirty_registers": 439, + "local_odd_scalar_additions": 24295, + "local_raw_H": [ + [ + 1, + 1323 + ], + [ + 2, + 1342 + ], + [ + 3, + 79 + ], + [ + 4, + 44 + ], + [ + 5, + 102 + ], + [ + 6, + 11 + ], + [ + 7, + 19 + ] + ], + "local_registers": 661, + "local_scalar_additions": 24295, + "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": 94, + "payload_prefix_upper": "11607066161648800787038010112", + "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": "1228514", + "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": 24295, + "signed_inverse": false, + "stage": 0 + }, + { + "fresh_copies": 9, + "scalar_additions": 24295, + "signed_inverse": true, + "stage": 1 + }, + { + "fresh_copies": 9, + "scalar_additions": 24295, + "signed_inverse": false, + "stage": 2 + }, + { + "fresh_copies": 9, + "scalar_additions": 24295, + "signed_inverse": true, + "stage": 3 + }, + { + "fresh_copies": 9, + "scalar_additions": 24295, + "signed_inverse": false, + "stage": 4 + } + ], + "status": "PASS_NEW_COHORT249_ALL_FIVE_STAGE_FORMAL_COLUMNS_AND_PREFIX_BILL" + }, + "9": { + "bridge_additions": 1998, + "copied_center_original_source_immutable": true, + "formal_columns_checked": 1327, + "fresh_center_copies": 81, + "global_live_registers": 1327, + "independent_dirty_registers": 439, + "local_odd_scalar_additions": 24295, + "local_raw_H": [ + [ + 1, + 1323 + ], + [ + 2, + 1342 + ], + [ + 3, + 79 + ], + [ + 4, + 44 + ], + [ + 5, + 102 + ], + [ + 6, + 11 + ], + [ + 7, + 19 + ] + ], + "local_registers": 661, + "local_scalar_additions": 24295, + "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 + }, + { + "omit_bridge": 6, + "rejected": true + }, + { + "omit_bridge": 7, + "rejected": true + }, + { + "omit_bridge": 8, + "rejected": true + }, + { + "omit_bridge": 9, + "rejected": true + }, + { + "omit_bridge": 10, + "rejected": true + }, + { + "omit_bridge": 11, + "rejected": true + }, + { + "omit_bridge": 12, + "rejected": true + }, + { + "omit_bridge": 13, + "rejected": true + }, + { + "omit_bridge": 14, + "rejected": true + }, + { + "omit_bridge": 15, + "rejected": true + }, + { + "omit_bridge": 16, + "rejected": true + }, + { + "omit_bridge": 17, + "rejected": true + } + ], + "new_Q_categories": [ + 28, + 29 + ], + "payload_prefix_bits": 94, + "payload_prefix_upper": "11607066161648800787038010112", + "reverse_fresh_center_copies": 36, + "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": "1228514", + "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.", + "stage_additions": 218655, + "stages": [ + { + "fresh_copies": 9, + "scalar_additions": 24295, + "signed_inverse": false, + "stage": 0 + }, + { + "fresh_copies": 9, + "scalar_additions": 24295, + "signed_inverse": true, + "stage": 1 + }, + { + "fresh_copies": 9, + "scalar_additions": 24295, + "signed_inverse": false, + "stage": 2 + }, + { + "fresh_copies": 9, + "scalar_additions": 24295, + "signed_inverse": true, + "stage": 3 + }, + { + "fresh_copies": 9, + "scalar_additions": 24295, + "signed_inverse": false, + "stage": 4 + }, + { + "fresh_copies": 9, + "scalar_additions": 24295, + "signed_inverse": true, + "stage": 5 + }, + { + "fresh_copies": 9, + "scalar_additions": 24295, + "signed_inverse": false, + "stage": 6 + }, + { + "fresh_copies": 9, + "scalar_additions": 24295, + "signed_inverse": true, + "stage": 7 + }, + { + "fresh_copies": 9, + "scalar_additions": 24295, + "signed_inverse": false, + "stage": 8 + } + ], + "status": "PASS_NEW_COHORT249_ALL_BRIDGED_STAGE_FORMAL_COLUMNS_AND_PREFIX_BILL" + } + } + } +} diff --git a/research/r439-block8-integer-factor/README.md b/research/r439-block8-integer-factor/README.md new file mode 100644 index 0000000000..33b44aff22 --- /dev/null +++ b/research/r439-block8-integer-factor/README.md @@ -0,0 +1,168 @@ +# R439 block 8: ten fewer ADDs using one more payload bit + +**Finite circuit construction; no new kappa.** Replacing the tuned PR589 +R439 word's phase-B block 8, `B[404:449]` at frame 523, reduces **45 to 40 +binary additions**. Its required literal reverse cleanup saves five more: +**24,305 to 24,295 native ADDs**. The complete forward integer transfer matrix +of the block is identical. All 661 input columns, including arbitrary helper +dirt, satisfy the unchanged endpoint contract. + +There is a deliberate precision tradeoff. Unlike a reverse-dominated local +rewrite, this replacement increases 50 entries of the block's reverse positive +matrix and decreases seven. The full-word cancellation-free reverse bound grows +from **1,113,070 to 1,228,514**. The forward bound remains **49,347**. The existing +native envelope `64 F^3 B^2` increases from +`9528119495320518471870892800` (93 bits) to +`11607066161648800787038010112` (**94 bits**), still strictly below `2^104`. +No scalar precision charge is dropped or treated as free. + +All 661 register frame paths, 439 helpers, 2,911 MOVEs, nine rank-seven COPYs +and nine ERASEs are unchanged. The paid local histogram remains +`{1:1323, 2:1342, 3:79, 4:44, 5:102, 6:11, 7:19}`, of rank mass **5,129**. +Thus the paid recursive moment is unchanged at every exponent. This saves a +finite scalar constant; it does not establish an improved supplier exponent +or multiplication exponent. + +## Reproduce + +From the repository root, Python 3.10+ and its standard library: + +```sh +python3 -I -B research/r439-block8-integer-factor/verify.py +``` + +Expected final line: + +```text +PASS_R439_BLOCK8_INTEGER_FACTOR gates=45->40 native_adds=24305->24295 columns=661 rank_mass=5129 payload_bits=93->94 controls=10 +``` + +This checks source hashes; exact F2 and integer matrices; all 4,096 local +Boolean inputs; the predecessor's E8, frame, dirty-column and H1–H5 interface +checks; actual exported records with a separate set-valued symbolic interpreter; +COPY/ERASE lifecycles; full positive prefix bounds; the exact certificate; and +ten rejection controls. Acceptance checks remain active under `python3 -O`. + +For fresh native C++17 and Boost checks of **both** words: + +```sh +python3 -I -B research/r439-block8-integer-factor/native.py +``` + +Expected: `PASS_R439_BLOCK8_NATIVE words=2 stages=5,9,11 columns=883,1327,1549 bridge_controls=96`. +This compiles the unchanged legality checker and the 5/9/11-stage column checker, +checks every column and all 6/18/24 omitted-bridge controls per word, and compares +native prefix bounds and paid profiles against the Python certificate. Only +elapsed time and the local input pathname are removed from the retained native +receipts. Set `CXX` or `BOOST_INCLUDE` if necessary. + +Both commands accept `--output /absolute/new/directory` to retain scratch files; +the directory must not already exist. Without it they use temporary directories. +`--write-certificate` explicitly regenerates only this package's receipt. + +The bounded nomination is separately reproducible, taking approximately +30 seconds on the development environment: + +```sh +python3 -I -B research/r439-block8-integer-factor/search.py +``` + +Expected: `PASS_R439_BLOCK8_SEARCH seed=18 trials=5000 identity=333 gates=45->40 strict_candidates=0`. +`search.py --write` regenerates only `WITNESS.json` and `SEARCH.json`. + +## Substitution argument and accounting + +The twelve local wires, in witness order, are source registers +`[2,4,14,16,18,20,88,90,93,95,103,109]`. Every gate in the replaced contiguous +slice has the same frame. There are no external reads interleaved in this slice. +Let `P(L)` denote the nonnegative integer transfer matrix formed by replacing +XORs by additions. The certificate proves `P(new) = P(old)`; reduction modulo +two therefore proves equality for **every incoming local state**, not only +clean inputs. Literal reversal gives the same inverse over F2. Substituting +this circuit preserves the state at the slice's end and every later target +read. We regenerate all of C as the literal full-frame reverse of z-destination +gates in A followed by B, exactly as required by H4. D, A, scatter and all +other B operations are retained, including dirty compensation and source access. + +Every wire follows its original ordered frame path. Although its first touch +inside the slice can move, no earlier instruction in that slice acts on that +wire before its first touch. The incoming climb still acts on the same value, +to the same frame. The symbolic and native checkers validate nestedness and +common-frame access. No helper, frame, COPY, retained total or recursive child +is added; the restoration and access costs are present in the exported word. + +A general reverse-domination argument is **not** available for this witness. +Instead we replay every native scalar instruction in both orientations with +nonnegative integer row-sum bounds, including copied-center lifecycles, and +check the predecessor's exact `64 F^3 B^2 < 2^104` obligation. This proves the +finite envelope used by the native checkers, not any unimplemented all-size +precision or tape theorem. The native 5/9/11-stage tests separately check the +signed inverse stage convention and F2 formal columns, including arbitrary dirt. + +## Search class, pivot and overlap + +OS assignment seed **18** selected the bit track and block `18 mod 10 = 8`. +Starting with the full block's positive matrix, the search repeatedly subtracts +one row from another only when every coordinate stays nonnegative. It chooses +uniformly among allowed ordered pairs, except every third trial first restricts +to sources with maximal row sum. Each subtraction strictly lowers total mass; +a trial ends when no subtraction is possible. A trial yields a circuit only +when the terminal matrix is the identity. Reversing its subtraction list then +constructs the original positive matrix exactly. + +The stopping rule is **5,000 trials** with `random.Random(18)`. Exactly **333** +reach identity. The first strict hypothesis additionally required a shorter +circuit whose reverse positive matrix was entrywise dominated by the original; +none of the sampled trajectories met it. One evidence-driven pivot retained +the same domain and seed but admitted reverse growth when the complete native +payload still fits the existing cap. The same 5,000 trajectories produce record +lengths **44 at trial 1165** and **40 at trial 2123** (zero-based). The frozen +witness is the latter. No larger search was used. The search report establishes +sample coverage, not a minimum gate count or impossibility theorem. + +This changes the **whole-block integer factorization**, without imposing the +original two-factor boundary or a destination-once restriction. Gautam Gupta's +pending **#844** shortens tuned R439 block 4 with a different, exact fixed-factor +search. Jerry Lin's **#810** changes historical R420 block 8, whose wires and +matrix differ; Yuzhou Wang's **#789** and commdata2338's **#790** are other +historical R420 block factorizations. Sagar Thakrar's **#728** and Ryan Haines' +**#792** change R439 phase-A mini-nodes. Anudeep Adiraju's **#843** +changes the distinct R439 frame-509 block; Aaron Wang's **#848** prices +restored-temporary sharing on A, D and decoder totals. Charles Bethin's **#827** excludes +smaller cleanup *frames* for a fixed prefix, not the scalar gate substitution +here. None of those pending implementations is imported or composed; their +savings are not included in ours. See `CLAIM.md` for the three candidate tasks +and final overlap check. + +## Pins, scope and attribution + +Base: **`f567884aeb8851b6e794af1184119a3bfbe1e631`**. The selected reviewed +result at that base is PR799 with PR589, conditional +**kappa = 0.001661634653669567**. The bit supplier's reviewed source head is +**`a5afc8c6169ea61ba7c51dfd3cade02cc7b13b46`**. `SOURCES.json` records exact +SHA-256 and Git blob pins for consumed files and separately labels contextual +sources. Execution depends on the local pinned source bytes, not a live PR. + +Only this isolated research package is added. No selected certificate, +existing generator, ledger or `upstream/` file is changed. No complete hosted +parent invoice, global moment/outer assembly, selected cold replay, +repository-wide `make verify`, Lean theorem or remote CI success is claimed. +The all-size compiler, common-label/mutable-source realization, whole-call +hosting, signed decoder, precision/tape and analytic obligations remain inherited. +Finite replay is not a formal proof of the multiplication theorem. Integration +into a selected supplier still requires its full downstream review and replay. + +Prepared for **@zeusinsight** with substantial **OpenAI Codex assistance** in +research, implementation, verification and writing. No independent human or +subagent review is claimed. New files are Apache-2.0 under the repository license. + +Credit **eumemic** (PR543/555 and the punctured word and independent interface +checker), **DreamingOfClouds** (PR545/589 and PR503/510), **Dylan Crow** (native +record format/exporter and checkers), **mtpsl** (PR691's quad verifier, from which +`verify.py` adapts the matrix, full-word, record and mutation-check structure), +and the full predecessor attribution in +[`e8-bit-p111-tuned/NOTICE.md`](../e8-bit-p111-tuned/NOTICE.md). +This includes Jacob Sussman's E8 unit, Zhihao Chen's interface work, DaysSky's +hosting, and the retained construction and accounting lineage. The current +consuming composition credits Jeremy Kothe and Chafik Boukhalfa and their +predecessors. This contribution claims only the new block witness and evidence. diff --git a/research/r439-block8-integer-factor/SEARCH.json b/research/r439-block8-integer-factor/SEARCH.json new file mode 100644 index 0000000000..6fa96a0152 --- /dev/null +++ b/research/r439-block8-integer-factor/SEARCH.json @@ -0,0 +1,19 @@ +{ + "seed": 18, + "trials": 5000, + "completed_identity_factorizations": 333, + "shorter_reverse_dominated": 0, + "improvements": [ + { + "trial": 1165, + "gates": 44 + }, + { + "trial": 2123, + "gates": 40 + } + ], + "stopping_rule": "exactly 5000 trials; row subtraction until no legal pair", + "domain": "nonnegative integer row-subtractions of full twelve-wire block 8", + "scope": "sampled trajectories, not exhaustive or optimal" +} diff --git a/research/r439-block8-integer-factor/SOURCES.json b/research/r439-block8-integer-factor/SOURCES.json new file mode 100644 index 0000000000..4a999437b0 --- /dev/null +++ b/research/r439-block8-integer-factor/SOURCES.json @@ -0,0 +1,73 @@ +{ + "base_commit": "f567884aeb8851b6e794af1184119a3bfbe1e631", + "supplier_pr": 589, + "supplier_head": "a5afc8c6169ea61ba7c51dfd3cade02cc7b13b46", + "execution_inputs": [ + "research/e8-bit-p111-tuned/tune/bitE8mut-p111-tuned.json.gz", + "research/e8-bit-p111-tuned/code/xcheck_p.py", + "research/e8-bit-carrier-skeleton/code/bit/export_records.py" + ], + "files": { + "research/e8-bit-p111-tuned/tune/bitE8mut-p111-tuned.json.gz": { + "sha256": "e3e301e62bc2b41dbf1ceac0acf3d35824ebeab1848c5a2142d4577b109da52f", + "git_blob": "85a4499bf9e4911a705d50567a2c2ef6cf23739a" + }, + "research/e8-bit-p111-tuned/code/xcheck_p.py": { + "sha256": "af3decc877e27c00001cf56f50c6c09566e8e101297ab34c7860aed96a06d80e", + "git_blob": "184f5dcf94a486cc7db91ca4db5865916bf26009" + }, + "research/e8-bit-carrier-skeleton/code/bit/export_records.py": { + "sha256": "8a5999601f917dbb492bb9ae9a344611f18cc7cedc53dc3c76496a369e530eb3", + "git_blob": "3632d370486a02f5456f7643ced03f8c925b2350" + }, + "research/e8-bit-carrier-skeleton/code/bit/regression/stage_cohort.py": { + "sha256": "6c288f6f234b528c1a7c0a4adfb724e91e0fe6b18c8dffad96af3f973de1829a", + "git_blob": "f6d7afe3e623208c4207b6a683a1e3e49249e31c" + }, + "research/e8-bit-carrier-skeleton/code/bit/checkers/legality_h.cpp": { + "sha256": "6c1ef2b24e57781d6951c172a1024fc4300e6fd392c9d6672079a7806ab663b3", + "git_blob": "cb1233c7e96b1aa8bbf4d2e4165d75ab0dca64b9" + }, + "research/e8-bit-carrier-skeleton/code/bit/checkers/columns_k.cpp": { + "sha256": "1c344d18fcd494eeca93e259f10cafae7705780e6592f6dcb35b34752dab9bc2", + "git_blob": "42bb232fbec4de703e70cc13dc2f39a3b43a3a01" + }, + "research/e8-bit-carrier-skeleton/code/bit/checkers/json.hpp": { + "sha256": "aaf127c04cb31c406e5b04a63f1ae89369fccde6d8fa7cdda1ed4f32dfc5de63", + "git_blob": "82d69f7c5d044c9887c96b90c97f5639083ecd14" + }, + "research/e8-bit-carrier-skeleton/portable-include/bits/stdc++.h": { + "sha256": "420094be2af295eed03a983dd66debbbe9cfb78d8252859f4498a615a0074b99", + "git_blob": "fc5664e929d9a81d9b4926bee049a93330be86ec" + }, + "research/r420-quad13/verify.py": { + "sha256": "cf46b382822c1323ac0d96561599b442d13f261c91c2d1c67245bf5c7aac8fe8", + "git_blob": "6721f8b461e68c2c51ca19c0861e6ae4b5b61d45" + }, + "certificates/selected-result.json": { + "sha256": "9873519224e2db72d6a8c926f51e3e75129671e467948c6f6b03744f8bcfc699", + "git_blob": "1f107b55a2f045fa66d9c35d658b3b79549f5ba6" + }, + "research/e8-bit-p111-tuned/tune/README.md": { + "sha256": "46c7917fb252949f38b7bcd88cf568efc282e3ea065b61d11e457e41673d0b2d", + "git_blob": "5b1554369682c8344d4f0767111d9b2b35eecbec" + }, + "research/e8-bit-p111-tuned/NOTICE.md": { + "sha256": "5b88eb2b7de76aa2a3288ee3c7a08d18a5eadfa82f5e7a99e207d232aed71221", + "git_blob": "b589500c8ae02a0a4c476e61dfdd1b79dcbf7cad" + } + }, + "native_inputs": [ + "research/e8-bit-carrier-skeleton/code/bit/regression/stage_cohort.py", + "research/e8-bit-carrier-skeleton/code/bit/checkers/legality_h.cpp", + "research/e8-bit-carrier-skeleton/code/bit/checkers/columns_k.cpp", + "research/e8-bit-carrier-skeleton/code/bit/checkers/json.hpp", + "research/e8-bit-carrier-skeleton/portable-include/bits/stdc++.h" + ], + "context_inputs": [ + "research/r420-quad13/verify.py", + "certificates/selected-result.json", + "research/e8-bit-p111-tuned/tune/README.md", + "research/e8-bit-p111-tuned/NOTICE.md" + ] +} diff --git a/research/r439-block8-integer-factor/VALIDATION.md b/research/r439-block8-integer-factor/VALIDATION.md new file mode 100644 index 0000000000..63c01e1d9b --- /dev/null +++ b/research/r439-block8-integer-factor/VALIDATION.md @@ -0,0 +1,51 @@ +# Executed validation — 2026-10-13 + +Research and test base: `f567884aeb8851b6e794af1184119a3bfbe1e631`. +Linux x86_64, Python 3.12.3, GCC 13.3.0, Boost 1.83. + +Completed: + +- `python3 -I -B research/r439-block8-integer-factor/verify.py`: pass; + exact source pins, local matrices, all 4,096 Boolean inputs, 661 symbolic + dirty-input columns, frame geometry, H1–H5, exported records, ten negative + controls, complete prefix bounds and deterministic certificate comparison. +- The same verifier with `-O`: pass, same result. +- Minimal temporary relocation containing only this package and the three + execution inputs: pass. Separate certificate corruption (claimed saving + changed to 11) and source corruption (comment appended to pinned auditor) + both fail with their intended mismatch messages. +- `python3 -I -B research/r439-block8-integer-factor/search.py`: pass; + regenerated 5,000 trajectories and compared the exact witness and report. + 333 identity completions, no shorter reverse-dominated candidates, best + relaxed circuit 40 gates. No claim of exhaustive circuit coverage. +- `BOOST_INCLUDE=/tmp/r439-boost/extracted/usr/include python3 -I -B + research/r439-block8-integer-factor/native.py --write-certificate + --output /tmp/r439-block8-native-complete`: pass. Both words were rebuilt + by the local verifier; unchanged C++ legality and 5/9/11-stage checkers were + freshly compiled and run. All 883/1,327/1,549 columns per word and 96 total + bridge-omission controls pass. Exact Python/C++ positive bounds, paid profiles + and ADD counts agree. `NATIVE-CERTIFICATE.json` retains all receipt fields + except timing and the temporary stream pathname. +- `python3 -B scripts/verify_selected_result.py`: pass for the unchanged + conditional `1661634653669567/1000000000000000000` selection. +- Python AST parsing and staged `git diff --check`: pass; only this package + is added. No pre-existing tracked file changes. + +The first native compile found no system Boost headers. Resolved by downloading +Ubuntu's `libboost1.83-dev_1.83.0-2.1ubuntu3.2_amd64.deb` and extracting it into +`/tmp/r439-boost`; no repository or system package installation was needed. +The downloaded archive's SHA-256 is +`519ecf2c64308527e15b6582955681d192a832250baa4bc424967aaf7d02d68f`. +A machine with Boost installed can omit `BOOST_INCLUDE`. + +The prototype strict and relaxed searches used the same 5,000 seeded paths. +The committed search reproduces both criteria together. The strict failure is +a failed sampled search, not an impossibility result. The observed growth of +the reverse bound is preserved in the certificate and accepted only because +the unchanged native precision obligation passes. + +The relevant checks for this isolated research addition are listed above. +No selected supplier input or existing generator changed. The broad regenerating +`make verify` suite, selected cold replay, hosted-parent invoice, moment/outer +assembly, Lean and remote CI were not run. Native scalar and stage coverage +must not be confused with those further obligations or a full theorem proof. diff --git a/research/r439-block8-integer-factor/WITNESS.json b/research/r439-block8-integer-factor/WITNESS.json new file mode 100644 index 0000000000..653268fa59 --- /dev/null +++ b/research/r439-block8-integer-factor/WITNESS.json @@ -0,0 +1,365 @@ +{ + "phase": "B", + "start": 404, + "stop": 449, + "frame": 523, + "registers": [ + 2, + 4, + 14, + 16, + 18, + 20, + 88, + 90, + 93, + 95, + 103, + 109 + ], + "original": [ + [ + 10, + 0 + ], + [ + 10, + 6 + ], + [ + 10, + 1 + ], + [ + 10, + 8 + ], + [ + 10, + 3 + ], + [ + 10, + 11 + ], + [ + 10, + 4 + ], + [ + 5, + 6 + ], + [ + 5, + 9 + ], + [ + 5, + 2 + ], + [ + 5, + 7 + ], + [ + 0, + 1 + ], + [ + 0, + 8 + ], + [ + 0, + 3 + ], + [ + 0, + 4 + ], + [ + 6, + 4 + ], + [ + 8, + 3 + ], + [ + 9, + 4 + ], + [ + 11, + 4 + ], + [ + 2, + 7 + ], + [ + 2, + 4 + ], + [ + 4, + 10 + ], + [ + 4, + 5 + ], + [ + 7, + 10 + ], + [ + 2, + 10 + ], + [ + 2, + 5 + ], + [ + 2, + 6 + ], + [ + 11, + 10 + ], + [ + 11, + 5 + ], + [ + 11, + 6 + ], + [ + 3, + 10 + ], + [ + 3, + 5 + ], + [ + 9, + 10 + ], + [ + 9, + 5 + ], + [ + 9, + 6 + ], + [ + 8, + 10 + ], + [ + 8, + 5 + ], + [ + 8, + 0 + ], + [ + 8, + 6 + ], + [ + 1, + 5 + ], + [ + 1, + 0 + ], + [ + 6, + 10 + ], + [ + 6, + 5 + ], + [ + 0, + 5 + ], + [ + 5, + 10 + ] + ], + "replacement": [ + [ + 5, + 9 + ], + [ + 9, + 5 + ], + [ + 0, + 8 + ], + [ + 5, + 2 + ], + [ + 8, + 4 + ], + [ + 0, + 3 + ], + [ + 2, + 4 + ], + [ + 10, + 11 + ], + [ + 11, + 4 + ], + [ + 3, + 6 + ], + [ + 4, + 6 + ], + [ + 8, + 4 + ], + [ + 6, + 10 + ], + [ + 0, + 1 + ], + [ + 11, + 4 + ], + [ + 10, + 0 + ], + [ + 2, + 7 + ], + [ + 1, + 0 + ], + [ + 9, + 6 + ], + [ + 5, + 7 + ], + [ + 10, + 4 + ], + [ + 2, + 4 + ], + [ + 3, + 5 + ], + [ + 6, + 4 + ], + [ + 9, + 4 + ], + [ + 8, + 0 + ], + [ + 4, + 5 + ], + [ + 1, + 4 + ], + [ + 9, + 0 + ], + [ + 5, + 0 + ], + [ + 5, + 6 + ], + [ + 7, + 10 + ], + [ + 0, + 4 + ], + [ + 3, + 10 + ], + [ + 8, + 3 + ], + [ + 9, + 2 + ], + [ + 11, + 5 + ], + [ + 4, + 10 + ], + [ + 6, + 0 + ], + [ + 2, + 5 + ] + ], + "trial": 2123 +} diff --git a/research/r439-block8-integer-factor/native.py b/research/r439-block8-integer-factor/native.py new file mode 100644 index 0000000000..92ad257f5b --- /dev/null +++ b/research/r439-block8-integer-factor/native.py @@ -0,0 +1,106 @@ +"""Fresh native legality and 5/9/11-stage columns for both words. + +Prepared for @zeusinsight with substantial OpenAI Codex assistance; Apache-2.0. +Uses the unchanged predecessor's export/staging/checkers with their notices. +""" +import argparse +import hashlib +import json +import os +from pathlib import Path +import subprocess +import sys +import tempfile + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +PKG = ROOT / "research/e8-bit-carrier-skeleton" +CHECKERS = PKG / "code/bit/checkers" + + +def need(condition, message): + if not condition: + raise ValueError(message) + + +def run(work, write): + pins = json.loads((HERE / "SOURCES.json").read_text()) + for path in pins["native_inputs"]: + need(hashlib.sha256((ROOT / path).read_bytes()).hexdigest() == + pins["files"][path]["sha256"], "native source mismatch: " + path) + subprocess.run([sys.executable, "-I", "-B", str(HERE / "verify.py"), + "--output", str(work / "local")], check=True) + cert = json.loads((HERE / "CERTIFICATE.json").read_text()) + compiler = os.environ.get("CXX", "c++") + common = [compiler, "-O2", "-std=c++17", "-DHDIM=8", "-DNCOPY=9", + "-DVPORTS=111", "-DRHELP=439", "-I" + str(CHECKERS), + "-I" + str(PKG / "portable-include")] + if os.environ.get("BOOST_INCLUDE"): + common.append("-I" + os.environ["BOOST_INCLUDE"]) + subprocess.run(common + [str(CHECKERS / "legality_h.cpp"), + "-o", str(work / "legality")], check=True) + for pairs in (2, 4, 5): + subprocess.run(common + ["-DKPAIRS=" + str(pairs), str(CHECKERS / "columns_k.cpp"), + "-o", str(work / ("columns" + str(pairs)))], check=True) + receipts = {} + for name in ("original", "replacement"): + records = work / "local" / name + inp, out = work / (name + "-in"), work / (name + "-out") + subprocess.run([sys.executable, "-I", "-B", str(PKG / "code/bit/regression/stage_cohort.py"), + str(records), str(records), str(inp), str(out)], check=True) + subprocess.run([str(work / "legality"), str(inp), str(out), str(out / "legality.json")], + check=True, capture_output=True, text=True) + legality = json.loads((out / "legality.json").read_text()) + expected = cert["native_records"][name] + need(legality["status"] == "PASS_INDEPENDENT_COHORT_LEGALITY_SOURCE_OWNERS_AND_LIFECYCLE", + "legality status") + for field, value in (("rank_mass", 5129), ("copies", 9), ("erasures", 9), + ("common_frame_ADDs", expected["adds"]), ("nested_MOVEs", expected["moves"])): + need(legality[field] == value, "legality mismatch: " + field) + receipts[name] = {"legality": legality, "stages": {}} + for pairs in (2, 4, 5): + dest = out / ("columns" + str(pairs) + ".json") + subprocess.run([str(work / ("columns" + str(pairs))), + str(out / "COHORT249-RECORDS.bin"), str(dest)], + check=True, capture_output=True, text=True) + receipt = json.loads(dest.read_text()) + stages = 2 * pairs + 1 + need(receipt["formal_columns_checked"] == (stages - 1) * 111 + 439, + "formal column coverage") + controls = receipt["negative_controls"] + need(len(controls) == 6 * (pairs - 1) and all(c["rejected"] for c in controls), + "bridge control coverage") + prefix = expected["prefix"] + need(receipt["payload_prefix_upper"] == prefix["payload"] and + receipt["payload_prefix_bits"] == prefix["payload_bits"], "prefix disagreement") + need([int(r["cancellation_free_signed_row_l1_upper"]) for r in receipt["signed_lift_prefix"]] + == [prefix["forward"], prefix["reverse"]], "forward/reverse bounds") + need(receipt["local_scalar_additions"] == expected["adds"], "native ADD mismatch") + need(dict(receipt["local_raw_H"]) == {int(k): v for k, v in expected["paid_histogram"].items()}, + "paid histogram mismatch") + receipt.pop("seconds") + receipt.pop("local_scalar_stream") + receipts[name]["stages"][str(stages)] = receipt + dest = HERE / "NATIVE-CERTIFICATE.json" + if write: + dest.write_text(json.dumps(receipts, indent=2, sort_keys=True) + "\n") + else: + need(receipts == json.loads(dest.read_text()), "native certificate mismatch") + print("PASS_R439_BLOCK8_NATIVE words=2 stages=5,9,11 columns=883,1327,1549 bridge_controls=96") + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--output", type=Path, help="new directory for retained build/replay") + parser.add_argument("--write-certificate", action="store_true") + args = parser.parse_args() + if args.output: + args.output.mkdir(parents=True, exist_ok=False) + run(args.output.resolve(), args.write_certificate) + else: + with tempfile.TemporaryDirectory(prefix="r439-block8-native-") as temp: + run(Path(temp), args.write_certificate) + + +if __name__ == "__main__": + main() diff --git a/research/r439-block8-integer-factor/search.py b/research/r439-block8-integer-factor/search.py new file mode 100644 index 0000000000..5ddd4ee466 --- /dev/null +++ b/research/r439-block8-integer-factor/search.py @@ -0,0 +1,89 @@ +"""Bounded nomination of integer factorizations; not an optimality proof. + +Prepared for @zeusinsight with substantial OpenAI Codex assistance; Apache-2.0. +""" +import argparse +import gzip +import hashlib +import json +from pathlib import Path +import random + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +WORD = "research/e8-bit-p111-tuned/tune/bitE8mut-p111-tuned.json.gz" + + +def transfer(gates, n): + rows = [[int(i == j) for j in range(n)] for i in range(n)] + for d, s in gates: + rows[d] = [x + y for x, y in zip(rows[d], rows[s])] + return rows + + +def search(): + pins = json.loads((HERE / "SOURCES.json").read_text()) + raw = (ROOT / WORD).read_bytes() + if hashlib.sha256(raw).hexdigest() != pins["files"][WORD]["sha256"]: + raise ValueError("source hash mismatch") + word = json.loads(gzip.decompress(raw)) + block = word["B"][404:449] + registers = sorted({r for _, d, ss in block for r in [d] + ss}) + n = len(registers) + old = [(registers.index(d), registers.index(s)) for _, d, ss in block for s in ss] + target, reverse = transfer(old, n), transfer(old[::-1], n) + identity = transfer([], n) + rng, best, complete, dominated = random.Random(18), len(old), 0, 0 + history, candidate = [], None + for trial in range(5000): + rows, undo = [r[:] for r in target], [] + while True: + pairs = [(d, s) for d in range(n) for s in range(n) if d != s + and all(x >= y for x, y in zip(rows[d], rows[s]))] + if not pairs: + break + # Every third trial favors the greatest decrease in row-sum mass. + if trial % 3 == 0: + scores = [sum(rows[s]) for d, s in pairs] + largest = max(scores) + pairs = [p for p, score in zip(pairs, scores) if score == largest] + d, s = rng.choice(pairs) + rows[d] = [x - y for x, y in zip(rows[d], rows[s])] + undo.append((d, s)) + if rows != identity: + continue + complete += 1 + if len(undo) < len(old): + backwards = transfer(undo, n) + if all(a <= b for ra, rb in zip(backwards, reverse) for a, b in zip(ra, rb)): + dominated += 1 + if len(undo) < best: + best = len(undo) + history.append({"trial": trial, "gates": best}) + candidate = dict(phase="B", start=404, stop=449, frame=523, + registers=registers, original=old, + replacement=undo[::-1], trial=trial) + report = dict(seed=18, trials=5000, completed_identity_factorizations=complete, + shorter_reverse_dominated=dominated, improvements=history, + stopping_rule="exactly 5000 trials; row subtraction until no legal pair", + domain="nonnegative integer row-subtractions of full twelve-wire block 8", + scope="sampled trajectories, not exhaustive or optimal") + return candidate, report + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--write", action="store_true") + args = parser.parse_args() + candidate, report = search() + for name, data in (("WITNESS.json", candidate), ("SEARCH.json", report)): + raw = json.dumps(data, indent=2) + "\n" + if args.write: + (HERE / name).write_text(raw) + elif json.loads(raw) != json.loads((HERE / name).read_text()): + raise ValueError("search mismatch: " + name) + print("PASS_R439_BLOCK8_SEARCH seed=18 trials=5000 identity=333 gates=45->40 strict_candidates=0") + + +if __name__ == "__main__": + main() diff --git a/research/r439-block8-integer-factor/verify.py b/research/r439-block8-integer-factor/verify.py new file mode 100644 index 0000000000..67f639b012 --- /dev/null +++ b/research/r439-block8-integer-factor/verify.py @@ -0,0 +1,323 @@ +"""Exact finite R439 block-8 substitution; no new rate claim. + +Adapted from mtpsl PR691 quad verifier by @zeusinsight with substantial +OpenAI Codex assistance. Apache-2.0; see README.md for predecessor credit. +Python 3.10+, standard library only. No assertions are used for acceptance. +""" +import argparse +from collections import Counter +import copy +import gzip +import hashlib +import importlib.util +import json +from pathlib import Path +import struct +import subprocess +import sys +import tempfile + +sys.dont_write_bytecode = True +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +WORD = "research/e8-bit-p111-tuned/tune/bitE8mut-p111-tuned.json.gz" +AUDITOR = "research/e8-bit-p111-tuned/code/xcheck_p.py" +EXPORTER = "research/e8-bit-carrier-skeleton/code/bit/export_records.py" + + +class Reject(Exception): + pass + + +def need(condition, reason): + if not condition: + raise Reject(reason) + + +def canonical(value): + return json.dumps(value, sort_keys=True, separators=(",", ":")).encode() + + +def sha(data): + return hashlib.sha256(data).hexdigest() + + +def matrix(ops, positive=False): + # Each column is evolved separately; search.py evolves whole rows. + cols = [] + for j in range(12): + values = [int(i == j) for i in range(12)] + for d, s in ops: + need(type(d) is int and type(s) is int and 0 <= d < 12 and + 0 <= s < 12 and d != s, "invalid circuit gate") + values[d] = values[d] + values[s] if positive else values[d] ^ values[s] + cols.append(values) + return [list(r) for r in zip(*cols)] + + +def circuit_check(old, new): + need(matrix(old) == matrix(new), "circuit F2 map changed") + need(matrix(old, True) == matrix(new, True), "forward integer map changed") + return {direction: {"original": matrix(a, True), "replacement": matrix(b, True)} + for direction, a, b in (("forward", old, new), ("reverse", old[::-1], new[::-1]))} + + +def cleanup(w): + return [[1, d, list(ss)] for _, d, ss in reversed(w["A"] + w["B"]) + if not 111 <= d < 222] + + +def build(base, recipe): + need((recipe["phase"], recipe["start"], recipe["stop"], recipe["frame"]) + == ("B", 404, 449, 523), "unexpected circuit location") + regs = recipe["registers"] + need(regs == [2, 4, 14, 16, 18, 20, 88, 90, 93, 95, 103, 109], + "unexpected circuit registers") + original = [[523, regs[d], [regs[s]]] for d, s in recipe["original"]] + need(base["B"][404:449] == original, "original gate slice mismatch") + circuit_check(recipe["original"], recipe["replacement"]) + out = copy.deepcopy(base) + out["B"][404:449] = [[523, regs[d], [regs[s]]] for d, s in recipe["replacement"]] + out["C"] = cleanup(out) + return out + + +def paths(w): + result = [[f] for f in w["start"]] + for sec in ("D", "A", "B", "C"): + for f, d, ss in w[sec]: + for r in [d] + ss: + if result[r][-1] != f: + result[r].append(f) + for r, f in enumerate(w["final"]): + if result[r][-1] != f: + result[r].append(f) + return result + + +def audit(w, module, geometry): + # Geometry is unchanged; reuse the baseline's already checked exact spaces. + obj = copy.copy(geometry) + obj.w = w + result = obj.full() + h, c, _ = obj.interface() + need(all(h.values()) and all(c.values()), "interface H1-H5 or decomposition failed") + return result + + +def records_check(directory, word): + """Independent set-valued interpreter of the actual exported instructions. + + This checks the scalar projection and literal MOVE/COPY/ERASE lifecycle, + not the multistage formal-column or hosted-recursion contracts. + """ + raw = (directory / "249-records.bin").read_bytes() + need(len(raw) % 24 == 0, "truncated record") + records = list(struct.iter_unpack("<6i", raw)) + dim = {int(k): v["dim"] for k, v in + json.loads((directory / "frames.json").read_text())["frames"].items()} + frames = list(word["start"]) + [None] + values = [{i} for i in range(661)] + [set()] + pths = [[f] for f in frames[:661]] + hist, counts = Counter(), Counter() + for op, a, b, c, d, e in records: + counts[op] += 1 + if op == 0: + need(a < 661 and frames[a] == b and dim[c] - dim[b] == d and d > 0, + "bad MOVE") + need(set(word["frames"][b]) <= set(word["frames"][c]), "MOVE not nested") + frames[a] = c + pths[a].append(c) + hist[d] += 1 + elif op == 1: + need(a != b and c == 1 and frames[a] == frames[b] == d, "bad ADD frame") + values[a] = values[a].symmetric_difference(values[b]) + elif op == 2: + need(b == 661 and not values[b] and frames[b] is None and frames[a] == c, + "COPY lifecycle") + need(d == 0 and e == dim[c], "COPY rank") + values[b] = set(values[a]) + frames[b] = d + hist[e] += 1 + elif op == 3: + need(b == 661 and frames[a] == c and frames[b] == d == 0 + and values[b] == values[a], "ERASE lifecycle") + values[b] = set() + frames[b] = None + else: + raise Reject("unknown record opcode") + expected = [{i} if not 111 <= i < 222 else {i, i - 111} for i in range(661)] + need(values[:661] == expected and not values[661], "record dirty-column endpoint") + need(frames[:661] == word["final"] and frames[661] is None, "record frame endpoint") + need(pths == paths(word), "record frame paths differ") + bounds = prefix_bounds(records) + return {"prefix": bounds, "records": len(records), "adds": counts[1], "moves": counts[0], + "copies": counts[2], "erasures": counts[3], + "paid_histogram": dict(sorted(hist.items())), + "rank_mass": sum(k * v for k, v in hist.items()), + "records_sha256": sha(raw)} + + +def prefix_bounds(records): + """Exact cancellation-free scalar envelope, same formula as columns_h.cpp.""" + peaks = [] + for reverse in (False, True): + values, peak, opened = [1] * 662, 1, False + for op, a, b, c, d, e in (reversed(records) if reverse else records): + if op == 0: + continue + if reverse and op in (2, 3): + op = 5 - op + if op == 1: + values[a] += abs(c) * values[b] + peak = max(peak, values[a]) + elif op == 2: + need(not opened, "nested prefix copy") + values[b], opened = values[a], True + elif op == 3: + need(opened, "unmatched prefix erase") + values[b], opened = 0, False + else: + raise Reject("unknown prefix opcode") + need(not opened, "unclosed prefix copy") + peaks.append(peak) + payload = 64 * peaks[0] ** 3 * peaks[1] ** 2 + need(payload < 2 ** 104, "payload exceeds existing 104-bit cap") + return {"forward": peaks[0], "reverse": peaks[1], "payload": str(payload), + "payload_bits": payload.bit_length(), "cap_bits": 104} + + +def rejected(label, fn, exceptions): + try: + fn() + except exceptions: + return label + raise Reject("negative control accepted: " + label) + + +def run(output, write_certificate): + pins = json.loads((HERE / "SOURCES.json").read_text()) + for path in pins["execution_inputs"]: + pin = pins["files"][path] + need(sha((ROOT / path).read_bytes()) == pin["sha256"], "source hash mismatch: " + path) + base = json.loads(gzip.decompress((ROOT / WORD).read_bytes())) + recipe = json.loads((HERE / "WITNESS.json").read_text()) + revised = build(base, recipe) + positive = circuit_check(recipe["original"], recipe["replacement"]) + need(positive["forward"]["original"] == positive["forward"]["replacement"], + "integer forward map changed") + need(paths(base) == paths(revised), "physical frame path changed") + + spec = importlib.util.spec_from_file_location("predecessor_xcheck", ROOT / AUDITOR) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + geometry, labels, baseline, h, c, _ = module.check(base) + need(all(h.values()) and all(c.values()), "baseline interface failed") + revised_audit = audit(revised, module, geometry) + + # Independent exhaustive evaluation of the twelve-register Boolean map. + for bits in range(4096): + endings = [] + for gates in (recipe["original"], recipe["replacement"]): + value = bits + for d, s in gates: + value ^= ((value >> s) & 1) << d + endings.append(value) + need(endings[0] == endings[1], "exhaustive twelve-bit map differs") + + evidence = {} + for name, word in (("original", base), ("replacement", revised)): + path = output / (name + ".json") + path.write_text(json.dumps(word, separators=(",", ":")) + "\n") + directory = output / name + subprocess.run([sys.executable, "-B", str(ROOT / EXPORTER), str(path), str(directory)], + check=True, capture_output=True, text=True) + evidence[name] = records_check(directory, word) + a, b = evidence["original"], evidence["replacement"] + need(a["adds"] == 24305 and b["adds"] == 24295, "unexpected native ADD count") + for key in ("moves", "copies", "erasures", "paid_histogram", "rank_mass"): + need(a[key] == b[key], "native cost changed: " + key) + need(b["rank_mass"] == 5129 and b["copies"] == 9, "incorrect native cost") + + controls = [] + fail = (Reject, module.Reject) + controls.append(rejected("drop circuit gate", lambda: circuit_check( + recipe["original"], recipe["replacement"][1:]), fail)) + wrong = copy.deepcopy(recipe["replacement"]) + wrong[0].reverse() + controls.append(rejected("reverse circuit operand", lambda: circuit_check( + recipe["original"], wrong), fail)) + inflated = recipe["replacement"] + [[0, 1], [0, 1]] + need(matrix(inflated) == matrix(recipe["replacement"]), "inflation control is not F2-neutral") + controls.append(rejected("F2-neutral positive-cost inflation", lambda: circuit_check( + recipe["original"], inflated), fail)) + bad = copy.deepcopy(revised) + bad["C"].pop() + controls.append(rejected("dropped cleanup", lambda: audit(bad, module, geometry), fail)) + bad = copy.deepcopy(revised) + bad["C"] = copy.deepcopy(base["C"]) + # Same endpoint but not the literal reverse required by H4. + obj = copy.copy(geometry) + obj.w = bad + obj.full() + controls.append(rejected("nonliteral original cleanup", lambda: audit(bad, module, geometry), fail)) + bad = copy.deepcopy(revised) + bad["B"][404][0] = 0 + controls.append(rejected("illegal lower frame", lambda: audit(bad, module, geometry), fail)) + bad = copy.deepcopy(revised) + bad["D"][0][2].pop() + controls.append(rejected("missing dirty compensation", lambda: audit(bad, module, geometry), fail)) + + # The record endpoint checker must see literal instruction corruption too. + directory = output / "replacement" + rawpath = directory / "249-records.bin" + raw = rawpath.read_bytes() + recs = list(struct.iter_unpack("<6i", raw)) + for i, rec in enumerate(recs): + if rec[0] == 1 and rec[5] == 4 and rec[4] == 523: + rawpath.write_bytes(raw[:24*i] + raw[24*(i+1):]) + break + try: + controls.append(rejected("dropped exported block ADD", lambda: records_check(directory, revised), fail)) + finally: + rawpath.write_bytes(raw) + + need(a["prefix"]["payload_bits"] == 93 and b["prefix"]["payload_bits"] == 94, + "unexpected prefix tradeoff") + overflow = [(1, 0, 1, 1, 0, 0), (1, 1, 0, 1, 0, 0)] * 50 + controls.append(rejected("payload overflow", lambda: prefix_bounds(overflow), fail)) + wrong = copy.deepcopy(recipe) + wrong["registers"][0] = 3 + controls.append(rejected("wrong source register", lambda: build(base, wrong), fail)) + cert = {"status": "PASS_R439_BLOCK8_INTEGER_FACTOR", "block": 8, + "old_gates": 45, "new_gates": 40, "saved_with_cleanup": 10, + "labels": labels, "columns": revised_audit["columns"], + "old_phase_gates": baseline["gates"], "new_phase_gates": revised_audit["gates"], + "boolean_inputs": 4096, "F2_matrix": matrix(recipe["replacement"]), + "positive_matrices": positive, "native_records": evidence, + "reconstructed_word_sha256": sha(canonical(revised)), "controls_rejected": controls, + "kappa_claim": "none; unchanged paid rank profile, no hosted replay"} + path = HERE / "CERTIFICATE.json" + if write_certificate: + path.write_text(json.dumps(cert, indent=2, sort_keys=True) + "\n") + else: + need(canonical(cert) == canonical(json.loads(path.read_text())), "certificate mismatch") + print("PASS_R439_BLOCK8_INTEGER_FACTOR gates=45->40 native_adds=24305->24295 " + "columns=661 rank_mass=5129 payload_bits=93->94 controls=10") + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--output", type=Path, help="new directory for reconstructed word and records") + parser.add_argument("--write-certificate", action="store_true", help="regenerate this package's certificate") + args = parser.parse_args() + if args.output: + args.output.mkdir(parents=True, exist_ok=False) + run(args.output.resolve(), args.write_certificate) + else: + with tempfile.TemporaryDirectory(prefix="r439-block8-") as temporary: + run(Path(temporary), args.write_certificate) + + +if __name__ == "__main__": + main()