diff --git a/research/r429-signed-range/CONTROLS.json b/research/r429-signed-range/CONTROLS.json new file mode 100644 index 0000000000..deef7b2aa9 --- /dev/null +++ b/research/r429-signed-range/CONTROLS.json @@ -0,0 +1,482 @@ +{ + "full_word_or_search_replayed": false, + "no_new_kappa": true, + "runs": [ + { + "complete_real_receipts": [ + { + "mutated_nested_path": [ + "forward", + "counts", + "0" + ], + "receipt": "frozen/candidate/RESULT.json", + "rejections": [ + { + "name": "real_nested_field_mutation", + "reason": "complete receipt mismatch: frozen/candidate/RESULT.json" + }, + { + "name": "real_nested_field_omission", + "reason": "complete receipt mismatch: frozen/candidate/RESULT.json" + } + ], + "sha256": "2ae84cc4cf6965832faf6c552f80f914820f53408e7d24cdb476dd7d87adaa20" + }, + { + "mutated_nested_path": [ + "whole_controller", + "local_stage_checkpoints", + 0, + "prefix_upper_bits" + ], + "receipt": "frozen/candidate/GROWTH.json", + "rejections": [ + { + "name": "real_nested_field_mutation", + "reason": "complete receipt mismatch: frozen/candidate/GROWTH.json" + }, + { + "name": "real_nested_field_omission", + "reason": "complete receipt mismatch: frozen/candidate/GROWTH.json" + } + ], + "sha256": "f932fc1ab6efb6b261e4774beb9771b7abf5f9d247343f79d78e1955cb2d8cb9" + }, + { + "mutated_nested_path": [ + "baseline", + "whole_controller", + "local_stage_checkpoints", + 0, + "prefix_upper_bits" + ], + "receipt": "frozen/historical/REPLAY.json", + "rejections": [ + { + "name": "real_nested_field_mutation", + "reason": "complete receipt mismatch: frozen/historical/REPLAY.json" + }, + { + "name": "real_nested_field_omission", + "reason": "complete receipt mismatch: frozen/historical/REPLAY.json" + } + ], + "sha256": "22bf26867c054dbc44a86aa2ea072b9a0b4675345ec3f76c71178795e78d8399" + }, + { + "mutated_nested_path": [ + "all_sign_family_transfer", + "quotients", + "parent", + "forward", + "matrix", + 0, + 0 + ], + "receipt": "frozen/reviews/integer/CHECKS.json.gz", + "rejections": [ + { + "name": "real_nested_field_mutation", + "reason": "complete receipt mismatch: frozen/reviews/integer/CHECKS.json.gz" + }, + { + "name": "real_nested_field_omission", + "reason": "complete receipt mismatch: frozen/reviews/integer/CHECKS.json.gz" + } + ], + "sha256": "b1710a496352872a80ed97271ddf2bfbf304cd009d45b345f2211561bfb5527e" + }, + { + "mutated_nested_path": [ + "candidate", + "suffix", + "forward", + "aggregate_attainment_witnesses", + "all_events", + "forward_output_sparse", + 0, + 0 + ], + "receipt": "frozen/reviews/range/CHECKS.json.gz", + "rejections": [ + { + "name": "real_nested_field_mutation", + "reason": "complete receipt mismatch: frozen/reviews/range/CHECKS.json.gz" + }, + { + "name": "real_nested_field_omission", + "reason": "complete receipt mismatch: frozen/reviews/range/CHECKS.json.gz" + } + ], + "sha256": "0e826dec630ab3ab60592d823dd425785add331b97e4b3f1bc84e71e25510780" + } + ], + "compressed_original_binding": { + "equivalent_storage_with_same_original_accepted": true, + "rejections": [ + { + "name": "changed_compressed_bytes", + "reason": "frozen input changed: frozen/original.json.gz" + }, + { + "name": "changed_decompressed_original", + "reason": "compressed original bytes changed: frozen/original.json.gz" + } + ] + }, + "mathematical_controls": { + "actual_authenticated_function": "bit_signed_audit.code", + "arbitrary_source_columns": 111, + "deleted_named_check_detected": true, + "positive_prefix_norms": [ + 2, + 3 + ], + "rejections": [ + { + "name": "self_source_add", + "reason": "source code not inplace" + }, + { + "name": "source_coordinate_outside_bank", + "reason": "source code not inplace" + }, + { + "name": "inverse_subtraction_replaced_by_addition", + "reason": "signed source-code literal inverse" + }, + { + "name": "independent_control_rejects_unrelated_exception", + "reason": "negative control reached an unintended gate: unrelated_fixture: UNRELATED_GATE" + } + ] + }, + "parent_optimization": 0, + "receipt_contract": { + "deleted_named_check_detected": true, + "rejections": [ + { + "name": "boolean_for_integer", + "reason": "complete receipt mismatch: frozen/receipt.json" + }, + { + "name": "float_for_integer", + "reason": "complete receipt mismatch: frozen/receipt.json" + }, + { + "name": "integer_for_boolean", + "reason": "complete receipt mismatch: frozen/receipt.json" + }, + { + "name": "nested_omission", + "reason": "complete receipt mismatch: frozen/receipt.json" + }, + { + "name": "list_reordering", + "reason": "complete receipt mismatch: frozen/receipt.json" + }, + { + "name": "list_truncation", + "reason": "complete receipt mismatch: frozen/receipt.json" + }, + { + "name": "missing_fixed_receipt", + "reason": "[Errno 2] No such file or directory: '/private/var/folders/3v/9244hdf12cj1k9jjspv9wh2h0000gn/T/b04-controls-84b3ciee/receipt/frozen/receipt.json'" + } + ] + }, + "source_selection": { + "imports_top_level_and_main_excluded": true, + "rejections": [ + { + "name": "direct_runtime_gate_under_parent_flags", + "reason": "DIRECT_RUNTIME_GATE" + }, + { + "name": "extracted_assert_under_parent_flags", + "reason": "EXTRACTED_ASSERT" + }, + { + "name": "nested_assert_under_parent_flags", + "reason": "NESTED_ASSERT" + }, + { + "name": "authenticated_module_assert_under_parent_flags", + "reason": "MODULE_ASSERT" + }, + { + "name": "changed_authenticated_module", + "reason": "frozen input changed: frozen/module.py" + }, + { + "name": "missing_named_definition", + "reason": "function selection changed" + }, + { + "name": "duplicate_source_definition", + "reason": "function selection changed" + }, + { + "name": "duplicate_requested_name", + "reason": "function selection changed" + }, + { + "name": "unregistered_source", + "reason": "unregistered frozen input: frozen/unknown.py" + }, + { + "name": "changed_authenticated_source", + "reason": "frozen input changed: frozen/source.py" + }, + { + "name": "missing_registered_source", + "reason": "[Errno 2] No such file or directory: '/private/var/folders/3v/9244hdf12cj1k9jjspv9wh2h0000gn/T/b04-controls-84b3ciee/source/frozen/source.py'" + } + ] + }, + "verifier_sha256": "9654fb97c9163dc04970e43e1f4c03a49279bc2983b5131f2d6134ce243fb6cc" + }, + { + "complete_real_receipts": [ + { + "mutated_nested_path": [ + "forward", + "counts", + "0" + ], + "receipt": "frozen/candidate/RESULT.json", + "rejections": [ + { + "name": "real_nested_field_mutation", + "reason": "complete receipt mismatch: frozen/candidate/RESULT.json" + }, + { + "name": "real_nested_field_omission", + "reason": "complete receipt mismatch: frozen/candidate/RESULT.json" + } + ], + "sha256": "2ae84cc4cf6965832faf6c552f80f914820f53408e7d24cdb476dd7d87adaa20" + }, + { + "mutated_nested_path": [ + "whole_controller", + "local_stage_checkpoints", + 0, + "prefix_upper_bits" + ], + "receipt": "frozen/candidate/GROWTH.json", + "rejections": [ + { + "name": "real_nested_field_mutation", + "reason": "complete receipt mismatch: frozen/candidate/GROWTH.json" + }, + { + "name": "real_nested_field_omission", + "reason": "complete receipt mismatch: frozen/candidate/GROWTH.json" + } + ], + "sha256": "f932fc1ab6efb6b261e4774beb9771b7abf5f9d247343f79d78e1955cb2d8cb9" + }, + { + "mutated_nested_path": [ + "baseline", + "whole_controller", + "local_stage_checkpoints", + 0, + "prefix_upper_bits" + ], + "receipt": "frozen/historical/REPLAY.json", + "rejections": [ + { + "name": "real_nested_field_mutation", + "reason": "complete receipt mismatch: frozen/historical/REPLAY.json" + }, + { + "name": "real_nested_field_omission", + "reason": "complete receipt mismatch: frozen/historical/REPLAY.json" + } + ], + "sha256": "22bf26867c054dbc44a86aa2ea072b9a0b4675345ec3f76c71178795e78d8399" + }, + { + "mutated_nested_path": [ + "all_sign_family_transfer", + "quotients", + "parent", + "forward", + "matrix", + 0, + 0 + ], + "receipt": "frozen/reviews/integer/CHECKS.json.gz", + "rejections": [ + { + "name": "real_nested_field_mutation", + "reason": "complete receipt mismatch: frozen/reviews/integer/CHECKS.json.gz" + }, + { + "name": "real_nested_field_omission", + "reason": "complete receipt mismatch: frozen/reviews/integer/CHECKS.json.gz" + } + ], + "sha256": "b1710a496352872a80ed97271ddf2bfbf304cd009d45b345f2211561bfb5527e" + }, + { + "mutated_nested_path": [ + "candidate", + "suffix", + "forward", + "aggregate_attainment_witnesses", + "all_events", + "forward_output_sparse", + 0, + 0 + ], + "receipt": "frozen/reviews/range/CHECKS.json.gz", + "rejections": [ + { + "name": "real_nested_field_mutation", + "reason": "complete receipt mismatch: frozen/reviews/range/CHECKS.json.gz" + }, + { + "name": "real_nested_field_omission", + "reason": "complete receipt mismatch: frozen/reviews/range/CHECKS.json.gz" + } + ], + "sha256": "0e826dec630ab3ab60592d823dd425785add331b97e4b3f1bc84e71e25510780" + } + ], + "compressed_original_binding": { + "equivalent_storage_with_same_original_accepted": true, + "rejections": [ + { + "name": "changed_compressed_bytes", + "reason": "frozen input changed: frozen/original.json.gz" + }, + { + "name": "changed_decompressed_original", + "reason": "compressed original bytes changed: frozen/original.json.gz" + } + ] + }, + "mathematical_controls": { + "actual_authenticated_function": "bit_signed_audit.code", + "arbitrary_source_columns": 111, + "deleted_named_check_detected": true, + "positive_prefix_norms": [ + 2, + 3 + ], + "rejections": [ + { + "name": "self_source_add", + "reason": "source code not inplace" + }, + { + "name": "source_coordinate_outside_bank", + "reason": "source code not inplace" + }, + { + "name": "inverse_subtraction_replaced_by_addition", + "reason": "signed source-code literal inverse" + }, + { + "name": "independent_control_rejects_unrelated_exception", + "reason": "negative control reached an unintended gate: unrelated_fixture: UNRELATED_GATE" + } + ] + }, + "parent_optimization": 1, + "receipt_contract": { + "deleted_named_check_detected": true, + "rejections": [ + { + "name": "boolean_for_integer", + "reason": "complete receipt mismatch: frozen/receipt.json" + }, + { + "name": "float_for_integer", + "reason": "complete receipt mismatch: frozen/receipt.json" + }, + { + "name": "integer_for_boolean", + "reason": "complete receipt mismatch: frozen/receipt.json" + }, + { + "name": "nested_omission", + "reason": "complete receipt mismatch: frozen/receipt.json" + }, + { + "name": "list_reordering", + "reason": "complete receipt mismatch: frozen/receipt.json" + }, + { + "name": "list_truncation", + "reason": "complete receipt mismatch: frozen/receipt.json" + }, + { + "name": "missing_fixed_receipt", + "reason": "[Errno 2] No such file or directory: '/private/var/folders/3v/9244hdf12cj1k9jjspv9wh2h0000gn/T/b04-controls-17w082fs/receipt/frozen/receipt.json'" + } + ] + }, + "source_selection": { + "imports_top_level_and_main_excluded": true, + "rejections": [ + { + "name": "direct_runtime_gate_under_parent_flags", + "reason": "DIRECT_RUNTIME_GATE" + }, + { + "name": "extracted_assert_under_parent_flags", + "reason": "EXTRACTED_ASSERT" + }, + { + "name": "nested_assert_under_parent_flags", + "reason": "NESTED_ASSERT" + }, + { + "name": "authenticated_module_assert_under_parent_flags", + "reason": "MODULE_ASSERT" + }, + { + "name": "changed_authenticated_module", + "reason": "frozen input changed: frozen/module.py" + }, + { + "name": "missing_named_definition", + "reason": "function selection changed" + }, + { + "name": "duplicate_source_definition", + "reason": "function selection changed" + }, + { + "name": "duplicate_requested_name", + "reason": "function selection changed" + }, + { + "name": "unregistered_source", + "reason": "unregistered frozen input: frozen/unknown.py" + }, + { + "name": "changed_authenticated_source", + "reason": "frozen input changed: frozen/source.py" + }, + { + "name": "missing_registered_source", + "reason": "[Errno 2] No such file or directory: '/private/var/folders/3v/9244hdf12cj1k9jjspv9wh2h0000gn/T/b04-controls-17w082fs/source/frozen/source.py'" + } + ] + }, + "verifier_sha256": "9654fb97c9163dc04970e43e1f4c03a49279bc2983b5131f2d6134ce243fb6cc" + } + ], + "source_hashes": { + "FROZEN-SHA256.json": "cffff97339b54903d6ae821ff5242a6506765e920975c81087de665d35ea4044", + "ORIGINS.json": "44c0671914f8991786bcb5654cb286aec029900f3470a3ce98026b060dfa2d3c", + "verify.py": "9654fb97c9163dc04970e43e1f4c03a49279bc2983b5131f2d6134ce243fb6cc" + }, + "status": "PASS_B04_COMPACT_SOURCE_AND_MATHEMATICAL_GATES" +} diff --git a/research/r429-signed-range/CORE-SNAPSHOT.json b/research/r429-signed-range/CORE-SNAPSHOT.json new file mode 100644 index 0000000000..0287327f06 --- /dev/null +++ b/research/r429-signed-range/CORE-SNAPSHOT.json @@ -0,0 +1,327 @@ +{ + "compact_controls": [ + { + "check_deletion_tests": 2, + "full_real_receipts": 5, + "intended_rejections": 34, + "optimization": 0 + }, + { + "check_deletion_tests": 2, + "full_real_receipts": 5, + "intended_rejections": 34, + "optimization": 1 + } + ], + "controls_receipt_sha256": "14fa6c2a9b5565be15748fe2f1a4b76371b6fac2c19f55c517a92000390ffa7f", + "core_sha256": "2dee81002aa7b327642ab08fd09df5732f404ebebace356e2c278e1e15990e2d", + "decompressed_original_bindings": [ + "frozen/controller/WORD.json.gz", + "frozen/geometry/MATRICES.json.gz", + "frozen/parent/GROWTH.json.gz", + "frozen/reviews/integer/CHECKS.json.gz" + ], + "file_count": 41, + "files": { + "EVIDENCE-INDEX.md": { + "bytes": 4229, + "sha256": "85be6b4295f287c21eeab54b6bc84481fa9ed53cd42e99324c956f3269704029" + }, + "FROZEN-SHA256.json": { + "bytes": 2700, + "sha256": "96df3452750366628ddf3c957654a60ca7e42f0ff8315efddc40dfade2437e11" + }, + "LICENSE": { + "bytes": 11357, + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + }, + "ORIGINS.json": { + "bytes": 8525, + "sha256": "25056f8eeab027f756a5b293b5f32e4f7da4df3b3c72b65fcb08615a2df4c26a" + }, + "PROOF-INTEGER.md": { + "bytes": 10687, + "sha256": "ed3adb5a955956a4bb1b24d38250fb18b8b1b3740010d3d0d987309fbbe743c9" + }, + "PROOF-RANGE.md": { + "bytes": 13072, + "sha256": "af5f7408119dd2ef8a17a97c0e025d24651081294ee9134d139cce4fa27b080f" + }, + "README.md": { + "bytes": 7673, + "sha256": "47667a24e139b69b7ddc10fbdc8264700b905fd41553cff52113d5a3514d9a95" + }, + "RELATED-WORK.json": { + "bytes": 1908, + "sha256": "0a1f45ac46da31fb9ff2339e6fb56aea6128053dce35f90591e93d8fe4e9347d" + }, + "REVIEW-INTEGER.md": { + "bytes": 5756, + "sha256": "5ecd25ee53bf04991848add1be87b95aadc489d74fdda45c4224a0ddb6cbd707" + }, + "REVIEW-RANGE.md": { + "bytes": 6855, + "sha256": "bcb8b0ccb3e48e2e2f276bcb3a237b615735df01754a96814d9002e37e303b50" + }, + "REVIEW-VERIFICATION.md": { + "bytes": 9350, + "sha256": "f40976abf21d2a78fb150329bc7cbbc837e8e487b3f9acc13306fa52304783da" + }, + "SOURCES.json": { + "bytes": 1825, + "sha256": "8bba7fd6b2fe4c7d567f9077c4b2b98720a780548077ca275fe14b960f20ca59" + }, + "TASK.json": { + "bytes": 6523, + "sha256": "7a67372964750dea14362660ddbc8fa26af849871b69fce041fd6e0407245d59" + }, + "VERIFY.json": { + "bytes": 1684, + "sha256": "e8253a2ed943c3b16c07c126b4d5ebb3eea8ed7e8936e5ed8f91049e91f46be7" + }, + "controls.py": { + "bytes": 15545, + "sha256": "f60feee719769a8c6ab6e0adc6ce3ee31bfd1391977fd66730b71343eb345e49" + }, + "frozen/candidate/GROWTH.json": { + "bytes": 2053, + "sha256": "f932fc1ab6efb6b261e4774beb9771b7abf5f9d247343f79d78e1955cb2d8cb9" + }, + "frozen/candidate/RESULT.json": { + "bytes": 1648, + "sha256": "2ae84cc4cf6965832faf6c552f80f914820f53408e7d24cdb476dd7d87adaa20" + }, + "frozen/candidate/WORD.json.gz": { + "bytes": 59544, + "sha256": "e802611104c61fc8477837b4ab41abc4f13cf41fbca6ef3de60d0b5e768fb949" + }, + "frozen/controller/WORD.json.gz": { + "bytes": 16510, + "sha256": "ff50e2df9b5a0ecb5e4a3aa24a5b93ac49f7c2b4fd3d28295e6d5a8f6154027f" + }, + "frozen/geometry/MATRICES.json.gz": { + "bytes": 8765, + "sha256": "0919f9b758078a5a1b51a9d550f607fd17c3adfddf55ace306b23f2108d57e7f" + }, + "frozen/geometry/WORD.json.gz": { + "bytes": 42305, + "sha256": "a353999bceac4ac957f540adfd3e5f8768297138b27132eeb83332e2ea4b1022" + }, + "frozen/historical/REPLAY.json": { + "bytes": 5096, + "sha256": "22bf26867c054dbc44a86aa2ea072b9a0b4675345ec3f76c71178795e78d8399" + }, + "frozen/old/bit_cap_copy_local.py": { + "bytes": 7588, + "sha256": "6e9ca1eb905d769716c009904f45d6849b225e48cd119f18b50c0379f35313cb" + }, + "frozen/old/bit_prune_audit.py": { + "bytes": 8758, + "sha256": "d284714fd65054279c180454b73eb717382e402669d5a04e3f373d0d7f54bc06" + }, + "frozen/old/bit_pruned_growth.py": { + "bytes": 5429, + "sha256": "9c59a9a521e0d0124df6b7686f76e0308c13678306f5efc53eb6e865757f8636" + }, + "frozen/old/bit_signed_audit.py": { + "bytes": 11946, + "sha256": "376356696663021693c0e2c9adf37f371675fe8837fb88232b8767a8b90793e8" + }, + "frozen/old/signed_quotient_search.py": { + "bytes": 4124, + "sha256": "fc9fce83d0fa613e8a442f44f0548fb82913b50ba901de89973eb11ff3311a16" + }, + "frozen/parent/GROWTH.json.gz": { + "bytes": 38095, + "sha256": "8e31256b3b4df6de4576d030fbe8ca6006d41565698e1eed245538cf25f5e92e" + }, + "frozen/parent/WORD.json.gz": { + "bytes": 59514, + "sha256": "1a6841fccba51fa922993c77b4b296e659c2c538252e5e06113d0438c5edb870" + }, + "frozen/reviews/integer/CHECKS.json.gz": { + "bytes": 17009, + "sha256": "b1710a496352872a80ed97271ddf2bfbf304cd009d45b345f2211561bfb5527e" + }, + "frozen/reviews/integer/SOURCE-DEPENDENCIES.json": { + "bytes": 8535, + "sha256": "4f6bc94a650c238dccd1e7e80e254373ec57071089968972b48860b71bfbeedf" + }, + "frozen/reviews/integer/VALIDATION-RUN.json": { + "bytes": 1794, + "sha256": "7310a204b8feb75ac3fa8be0ef438486e4a9ae7e7505470eaddd5cfd158f7853" + }, + "frozen/reviews/integer/VALIDATION.json": { + "bytes": 3383, + "sha256": "3dc24bdaf215887ca5aef5152259108aceed78f9662225eb466db4a85ed52e97" + }, + "frozen/reviews/integer/VALIDATION.md": { + "bytes": 2485, + "sha256": "229705bf1a97d65c63d25dbf54ad2cc90ba7c1093ee238f71fd6cf1f3247bad7" + }, + "frozen/reviews/integer/check_integer.py": { + "bytes": 39485, + "sha256": "96e6fe96e72111e691dac904fc3991b2ddca440509ffaf5bf4a990d27c33e522" + }, + "frozen/reviews/range/CHECKS.json.gz": { + "bytes": 286198, + "sha256": "0e826dec630ab3ab60592d823dd425785add331b97e4b3f1bc84e71e25510780" + }, + "frozen/reviews/range/SOURCE-DEPENDENCIES.json": { + "bytes": 6381, + "sha256": "14f317713ab4ebd39269966d3edf1b7f31a31077422e64c0f8b4fc8c15207a8d" + }, + "frozen/reviews/range/VALIDATION-RESULT.json": { + "bytes": 2853, + "sha256": "89653166a2d880b24f1ec5f92bf1849299b710acfdcd035953a51aedb7b5d67b" + }, + "frozen/reviews/range/VALIDATION.md": { + "bytes": 3393, + "sha256": "ea2b056ec7738e9af75bc09706855d7fc1f0653bf4e65c1a4004ed7b5e0291e2" + }, + "frozen/reviews/range/check_range.py": { + "bytes": 41189, + "sha256": "4aa90c275da461cbcef95b00c6088aa599c72e7b76a6cbf9b8cadb87e45e6df5" + }, + "verify.py": { + "bytes": 11827, + "sha256": "9654fb97c9163dc04970e43e1f4c03a49279bc2983b5131f2d6134ce243fb6cc" + } + }, + "frozen_tree_exactly_registered": true, + "independent_source_closure": { + "integer": { + "imports": [ + "argparse", + "collections", + "gzip", + "hashlib", + "itertools", + "json", + "math", + "pathlib" + ], + "sha256": "96e6fe96e72111e691dac904fc3991b2ddca440509ffaf5bf4a990d27c33e522", + "source": "frozen/reviews/integer/check_integer.py" + }, + "range": { + "imports": [ + "argparse", + "collections", + "gzip", + "hashlib", + "json", + "pathlib", + "sys" + ], + "sha256": "4aa90c275da461cbcef95b00c6088aa599c72e7b76a6cbf9b8cadb87e45e6df5", + "source": "frozen/reviews/range/check_range.py" + } + }, + "no_new_kappa": true, + "no_precision_or_supplier_admission": true, + "origin_entries_exactly_registered": true, + "package": "research/r429-signed-range", + "post_control_required_heading_refresh": { + "after_heading": "## Open next questions", + "after_sha256": "47667a24e139b69b7ddc10fbdc8264700b905fd41553cff52113d5a3514d9a95", + "all_other_snapshot_files_unchanged": true, + "before_heading": "## Limits and next obligation", + "before_sha256": "c9c461b1a3db8ce0764a45da6f7dc368aa19dfcf36e41a417bca7b64bb0e7b00", + "file": "README.md", + "gate_fix": "The repository package gate requires the exact README heading ## Open next questions. The existing limits and next-obligation section was renamed without changing its content.", + "gate_outcome_from_parent": "Previous package gate stopped before mathematical replay; final registered replay follows this heading fix.", + "mathematical_or_compact_replay_run_by_this_refresh": false, + "prior_core_sha256": "c56f88096a87bc19a4c8a96a996661e4dacae056e70894102b2c2f54b052a4c3", + "prior_readme_exactly_reconstructed_and_authenticated": true + }, + "post_control_whitespace_refresh": { + "all_other_snapshot_files_unchanged": true, + "compact_controls_replayed": false, + "control_code_and_scientific_code_receipts_unchanged": true, + "controls_receipt_scope": "Existing normal/-O execution precedes this whitespace-only documentation and matching manifest update; all scientific sources, complete scientific receipts and acceptance code are unchanged.", + "document_delta": { + "PROOF-INTEGER.md": { + "after_sha256": "ed3adb5a955956a4bb1b24d38250fb18b8b1b3740010d3d0d987309fbbe743c9", + "before_sha256": "cdd26a4e40df980dfd8d12b8da87e2ddcdc61b3d89586c618cbb07bc9a671e21", + "removed_LF_bytes": 1 + }, + "REVIEW-INTEGER.md": { + "after_sha256": "5ecd25ee53bf04991848add1be87b95aadc489d74fdda45c4224a0ddb6cbd707", + "before_sha256": "652b7aa528281c5205a163b63f33d5005655805e03a4b1f70788b5b467baac0b", + "removed_LF_bytes": 1 + }, + "frozen/reviews/integer/VALIDATION.md": { + "after_sha256": "229705bf1a97d65c63d25dbf54ad2cc90ba7c1093ee238f71fd6cf1f3247bad7", + "before_sha256": "624cf3c4dda6ad27903350afa1e42edc68a4482518e17edd89d7e94ed348bf50", + "removed_LF_bytes": 1 + } + }, + "manifest_delta": "Only frozen/reviews/integer/VALIDATION.md sha256 changed in each of FROZEN-SHA256.json and ORIGINS.json; exact prior serialized manifests reconstructed and authenticated.", + "original_current_run_validation_matches": true, + "prior_core_sha256": "de46386af42e7db363f65595a6d2bbeeaf2eff2954ab798307da9fd8c938a539" + }, + "registered_commands": [ + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/verify.py", + "--stage", + "historical" + ], + "checks": "Fixed 23-sign witness: exact declared record differences, retained complete integer/F2 replays, both original signed receipts and full new range summary; no sign search.", + "timeout_seconds": 120 + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/verify.py", + "--stage", + "integer" + ], + "checks": "Independent dense all 651-column integer/F2/frame/COPY audit, both roundtrips, attained prefix norms, exact fixed-transfer proof for all 2^47 signs and intended-gate controls.", + "timeout_seconds": 180 + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/verify.py", + "--stage", + "range" + ], + "checks": "Independent sparse range reconstruction, selected arbitrary-code schedule, all ordered controller factors and complete adjoint/dual/forward defect checks for both actual 651-input words.", + "timeout_seconds": 180 + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/controls.py", + "--package", + "{package}" + ], + "checks": "Normal and optimized source-selection/module assertions, compression bindings, all five full typed receipts, semantic inverse-sign control and deleted-check sensitivity.", + "timeout_seconds": 60 + } + ], + "registered_frozen_inputs": 25, + "reviewer_replayed_full_math_stages": false, + "schema": "b04-source-verification-core-snapshot-v1", + "snapshot_excluded_receipt_names": [ + "CONTROLS.json", + "CORE-SNAPSHOT.json", + "REVIEW-CONTROLS.json", + "REVIEW-CORE-SNAPSHOT.json" + ], + "status": "PASS_SCOPED_SOURCE_AND_CONTROL_REVIEW" +} diff --git a/research/r429-signed-range/EVIDENCE-INDEX.md b/research/r429-signed-range/EVIDENCE-INDEX.md new file mode 100644 index 0000000000..c2aecd0b50 --- /dev/null +++ b/research/r429-signed-range/EVIDENCE-INDEX.md @@ -0,0 +1,51 @@ +# Claims, source bindings and coverage + +| Claim | Evidence | Boundary | +| --- | --- | --- | +| Fixed 23-sign witness and unchanged records/boundaries | `verify.py --stage historical` compares every parent/candidate field and executes named retained functions | No repetition of the historical randomized sign search; no optimum claimed. | +| Complete original signed result and growth receipts | Same stage compares `frozen/candidate/RESULT.json` and `GROWTH.json` in full | The old parent growth receipt is retained as provenance; fresh parent ranges appear in the new complete replay receipt. | +| New retained-function summary | Same stage compares `frozen/historical/REPLAY.json` in full | Explicit selected scalar code instantiation; not the legacy controller code. | +| Every integer/F2 column, physical frame and COPY lifetime | Independent integer checker, with complete receipt and semantic controls | All 651 public inputs, both directions and roundtrips; native ADDRESS child implementations remain inherited. | +| Whole sign-family block restriction | Written prefix–quotient–suffix proof and exact fixed-transfer reconstruction | Rank bounds hold under the stated fixed prefix/suffix and nine-coordinate quotient replacement; exact ranks 9 and 3 describe this witness. | +| Local prefix range | Independent dense integer and sparse range implementations, plus retained functions | Exact scalar row norms with attaining inputs; native-vector use needs the specified isometry premise. | +| Ordered global range | Independent selected-code extraction, free noncommuting schedule check and full bank recurrence | Includes 63 selected code factors and encoded dirty magnitudes. It does not replay the artifact's different legacy integer code. | +| Atomic defect constants | Full adjoint scan for both actual 651-input words in each direction | Exact scalar assignment model with explicit eligible events and COPY/ERASE premise. | +| Sharpness and defect controls | Separate scalar dual-row recurrence, forward impulses and simultaneous sign-aligned errors | Completed output only; no perturbed-prefix, relative-error or native child-interior theorem. | +| Acceptance mechanism | Compact normal/optimized controls, including deliberate check deletion | Source authenticity and full typed comparison are separate from mathematical validity. | + +## Exact source execution + +The historical stage extracts only these unchanged original function definitions: + +- `bit_cap_copy_local.py`: `need`, `canonical`, `rank`; +- `bit_signed_audit.py`: `identity`, `add`, `row_weights`, `parity`, + `block_norms`, `code`, `global_bound`; +- `bit_prune_audit.py`: `execute`; +- `bit_pruned_growth.py`: `coefficients`; +- `signed_quotient_search.py`: `score`. + +Dependencies are explicitly supplied standard-library objects and the preceding +functions. Original imports, filesystem constants, entrypoints and search loops +are excluded. Each selected definition must occur exactly once. The exact +authenticated bytes are parsed and compiled with `dont_inherit=True,optimize=0`; +no mathematical expression, coefficient, domain or loop is patched. + +The independent integer and range programs import no producer implementation. +Their complete source files are authenticated and compiled with assertions +enabled. They write only fresh external temporary results during verification, +which are compared with the separately frozen complete receipts. Missing fixed +evidence fails; it is not regenerated into the package. + +The compressed controller retains all ordered events and its legacy code list. +The unused legacy code is explicitly examined as a differing source contract. +The retained original suffix program is not a runtime input: it concerns a +different 660-input word, and the fresh adjoint checker supplies the relevant +651-input calculation. + +## Distinct validation stages + +Committed-byte and source-history checks establish publication provenance. +The registered replay verifies the stated finite claims and controls. A +read-only Git-free export checks portability. Automatic hosted CI is reported +separately on the PR's actual head. None of these is a formal-kernel proof, +human acceptance, physical rounded implementation or supplier admission. diff --git a/research/r429-signed-range/FROZEN-SHA256.json b/research/r429-signed-range/FROZEN-SHA256.json new file mode 100644 index 0000000000..e13e34ea6c --- /dev/null +++ b/research/r429-signed-range/FROZEN-SHA256.json @@ -0,0 +1,27 @@ +{ + "frozen/parent/WORD.json.gz": "1a6841fccba51fa922993c77b4b296e659c2c538252e5e06113d0438c5edb870", + "frozen/candidate/WORD.json.gz": "e802611104c61fc8477837b4ab41abc4f13cf41fbca6ef3de60d0b5e768fb949", + "frozen/candidate/RESULT.json": "2ae84cc4cf6965832faf6c552f80f914820f53408e7d24cdb476dd7d87adaa20", + "frozen/candidate/GROWTH.json": "f932fc1ab6efb6b261e4774beb9771b7abf5f9d247343f79d78e1955cb2d8cb9", + "frozen/old/bit_prune_audit.py": "d284714fd65054279c180454b73eb717382e402669d5a04e3f373d0d7f54bc06", + "frozen/old/bit_signed_audit.py": "376356696663021693c0e2c9adf37f371675fe8837fb88232b8767a8b90793e8", + "frozen/old/bit_cap_copy_local.py": "6e9ca1eb905d769716c009904f45d6849b225e48cd119f18b50c0379f35313cb", + "frozen/old/signed_quotient_search.py": "fc9fce83d0fa613e8a442f44f0548fb82913b50ba901de89973eb11ff3311a16", + "frozen/old/bit_pruned_growth.py": "9c59a9a521e0d0124df6b7686f76e0308c13678306f5efc53eb6e865757f8636", + "frozen/geometry/WORD.json.gz": "a353999bceac4ac957f540adfd3e5f8768297138b27132eeb83332e2ea4b1022", + "frozen/controller/WORD.json.gz": "ff50e2df9b5a0ecb5e4a3aa24a5b93ac49f7c2b4fd3d28295e6d5a8f6154027f", + "frozen/geometry/MATRICES.json.gz": "0919f9b758078a5a1b51a9d550f607fd17c3adfddf55ace306b23f2108d57e7f", + "frozen/parent/GROWTH.json.gz": "8e31256b3b4df6de4576d030fbe8ca6006d41565698e1eed245538cf25f5e92e", + "frozen/historical/REPLAY.json": "22bf26867c054dbc44a86aa2ea072b9a0b4675345ec3f76c71178795e78d8399", + "frozen/reviews/range/check_range.py": "4aa90c275da461cbcef95b00c6088aa599c72e7b76a6cbf9b8cadb87e45e6df5", + "frozen/reviews/range/CHECKS.json.gz": "0e826dec630ab3ab60592d823dd425785add331b97e4b3f1bc84e71e25510780", + "frozen/reviews/range/SOURCE-DEPENDENCIES.json": "14f317713ab4ebd39269966d3edf1b7f31a31077422e64c0f8b4fc8c15207a8d", + "frozen/reviews/range/VALIDATION.md": "ea2b056ec7738e9af75bc09706855d7fc1f0653bf4e65c1a4004ed7b5e0291e2", + "frozen/reviews/range/VALIDATION-RESULT.json": "89653166a2d880b24f1ec5f92bf1849299b710acfdcd035953a51aedb7b5d67b", + "frozen/reviews/integer/check_integer.py": "96e6fe96e72111e691dac904fc3991b2ddca440509ffaf5bf4a990d27c33e522", + "frozen/reviews/integer/SOURCE-DEPENDENCIES.json": "4f6bc94a650c238dccd1e7e80e254373ec57071089968972b48860b71bfbeedf", + "frozen/reviews/integer/VALIDATION.json": "3dc24bdaf215887ca5aef5152259108aceed78f9662225eb466db4a85ed52e97", + "frozen/reviews/integer/VALIDATION-RUN.json": "7310a204b8feb75ac3fa8be0ef438486e4a9ae7e7505470eaddd5cfd158f7853", + "frozen/reviews/integer/CHECKS.json.gz": "b1710a496352872a80ed97271ddf2bfbf304cd009d45b345f2211561bfb5527e", + "frozen/reviews/integer/VALIDATION.md": "229705bf1a97d65c63d25dbf54ad2cc90ba7c1093ee238f71fd6cf1f3247bad7" +} diff --git a/research/r429-signed-range/LICENSE b/research/r429-signed-range/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/r429-signed-range/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/r429-signed-range/ORIGINS.json b/research/r429-signed-range/ORIGINS.json new file mode 100644 index 0000000000..11a918e832 --- /dev/null +++ b/research/r429-signed-range/ORIGINS.json @@ -0,0 +1,121 @@ +{ + "frozen/parent/WORD.json.gz": { + "original_path": "/Users/ross/git/math/.research-automation/runs/kappa-3605-successor-20261018T0940Z/major-frontier/root-pruned-code/BIT-PRUNED-WORD.json.gz", + "sha256": "1a6841fccba51fa922993c77b4b296e659c2c538252e5e06113d0438c5edb870" + }, + "frozen/candidate/WORD.json.gz": { + "original_path": "/Users/ross/git/math/.research-automation/runs/kappa-3605-successor-20261018T0940Z/major-frontier/root-pruned-code/BIT-SIGNED-QUOTIENT-WORD.json.gz", + "sha256": "e802611104c61fc8477837b4ab41abc4f13cf41fbca6ef3de60d0b5e768fb949" + }, + "frozen/candidate/RESULT.json": { + "original_path": "/Users/ross/git/math/.research-automation/runs/kappa-3605-successor-20261018T0940Z/major-frontier/root-pruned-code/SIGNED-QUOTIENT-RESULT.json", + "sha256": "2ae84cc4cf6965832faf6c552f80f914820f53408e7d24cdb476dd7d87adaa20" + }, + "frozen/candidate/GROWTH.json": { + "original_path": "/Users/ross/git/math/.research-automation/runs/kappa-3605-successor-20261018T0940Z/major-frontier/root-pruned-code/SIGNED-QUOTIENT-GROWTH.json", + "sha256": "f932fc1ab6efb6b261e4774beb9771b7abf5f9d247343f79d78e1955cb2d8cb9" + }, + "frozen/old/bit_prune_audit.py": { + "original_path": "/Users/ross/git/math/.research-automation/runs/kappa-3605-successor-20261018T0940Z/major-frontier/recursive/bit_prune_audit.py", + "sha256": "d284714fd65054279c180454b73eb717382e402669d5a04e3f373d0d7f54bc06" + }, + "frozen/old/bit_signed_audit.py": { + "original_path": "/Users/ross/git/math/.research-automation/runs/kappa-3605-successor-20261018T0940Z/major-frontier/recursive/bit_signed_audit.py", + "sha256": "376356696663021693c0e2c9adf37f371675fe8837fb88232b8767a8b90793e8" + }, + "frozen/old/bit_cap_copy_local.py": { + "original_path": "/Users/ross/git/math/.research-automation/runs/kappa-3605-successor-20261018T0940Z/major-frontier/recursive/bit_cap_copy_local.py", + "sha256": "6e9ca1eb905d769716c009904f45d6849b225e48cd119f18b50c0379f35313cb" + }, + "frozen/old/signed_quotient_search.py": { + "original_path": "/Users/ross/git/math/.research-automation/runs/kappa-3605-successor-20261018T0940Z/major-frontier/root-pruned-code/signed_quotient_search.py", + "sha256": "fc9fce83d0fa613e8a442f44f0548fb82913b50ba901de89973eb11ff3311a16" + }, + "frozen/old/bit_pruned_growth.py": { + "original_path": "/Users/ross/git/math/.research-automation/runs/kappa-3605-successor-20261018T0940Z/major-frontier/recursive/bit_pruned_growth.py", + "sha256": "9c59a9a521e0d0124df6b7686f76e0308c13678306f5efc53eb6e865757f8636" + }, + "frozen/geometry/WORD.json.gz": { + "original_path": "/Users/ross/git/math/integer-mult-bounds/research/bit-r438-transport-rehost/words/r438-t154.json.gz", + "sha256": "a353999bceac4ac957f540adfd3e5f8768297138b27132eeb83332e2ea4b1022" + }, + "frozen/controller/WORD.json.gz": { + "original_path": "/Users/ross/git/math/.research-automation/runs/kappa-3605-successor-20261018T0940Z/major-frontier/recursive/BIT-NATIVE-CONTROLLER-WORD.json", + "original_sha256": "859cdd2a87ea6ce58eb0ccdf2ca675e77c7134d6a7bbc7d450493d1abb108271", + "storage": "gzip of unchanged original bytes; mtime=0", + "sha256": "ff50e2df9b5a0ecb5e4a3aa24a5b93ac49f7c2b4fd3d28295e6d5a8f6154027f" + }, + "frozen/geometry/MATRICES.json.gz": { + "original_path": "/Users/ross/git/math/.research-automation/runs/kappa-3605-successor-20261018T0940Z/major-frontier/recursive/BIT-THREE-ROW-INPUT.json", + "original_sha256": "e5edb9e4e738192f98bd520ae6c1e8f1ddb19a0074ee9a1044e309b81e39c979", + "storage": "gzip of unchanged original bytes; mtime=0", + "sha256": "0919f9b758078a5a1b51a9d550f607fd17c3adfddf55ace306b23f2108d57e7f" + }, + "frozen/parent/GROWTH.json.gz": { + "original_path": "/Users/ross/git/math/.research-automation/runs/kappa-3605-successor-20261018T0940Z/major-frontier/recursive/BIT-PRUNED-GROWTH.json", + "original_sha256": "ccacefa32cf6edfe7a26ab5661ed14530f28dcba2d2150fff052c6f0f8f27d1b", + "storage": "gzip of unchanged original bytes; mtime=0", + "sha256": "8e31256b3b4df6de4576d030fbe8ca6006d41565698e1eed245538cf25f5e92e" + }, + "frozen/historical/REPLAY.json": { + "original_path": "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/B04-HISTORICAL.json", + "sha256": "22bf26867c054dbc44a86aa2ea072b9a0b4675345ec3f76c71178795e78d8399", + "role": "New complete retained-function replay receipt, generated from fixed original inputs with no search." + }, + "frozen/reviews/range/check_range.py": { + "original_path": "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/b04-range-review/check_range.py", + "sha256": "4aa90c275da461cbcef95b00c6088aa599c72e7b76a6cbf9b8cadb87e45e6df5", + "role": "New independent range/defect review output; source and full receipt preserved unchanged." + }, + "frozen/reviews/range/CHECKS.json.gz": { + "original_path": "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/b04-range-review/FULL-RECEIPT.json.gz", + "sha256": "0e826dec630ab3ab60592d823dd425785add331b97e4b3f1bc84e71e25510780", + "role": "New independent range/defect review output; source and full receipt preserved unchanged." + }, + "frozen/reviews/range/SOURCE-DEPENDENCIES.json": { + "original_path": "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/b04-range-review/SOURCE-DEPENDENCIES.json", + "sha256": "14f317713ab4ebd39269966d3edf1b7f31a31077422e64c0f8b4fc8c15207a8d", + "role": "New independent range/defect review output; source and full receipt preserved unchanged." + }, + "frozen/reviews/range/VALIDATION.md": { + "original_path": "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/b04-range-review/VALIDATION.md", + "sha256": "ea2b056ec7738e9af75bc09706855d7fc1f0653bf4e65c1a4004ed7b5e0291e2", + "role": "New independent range/defect review output; source and full receipt preserved unchanged." + }, + "frozen/reviews/range/VALIDATION-RESULT.json": { + "original_path": "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/b04-range-review/VALIDATION-RESULT.json", + "sha256": "89653166a2d880b24f1ec5f92bf1849299b710acfdcd035953a51aedb7b5d67b", + "role": "New independent range/defect review output; source and full receipt preserved unchanged." + }, + "frozen/reviews/integer/check_integer.py": { + "original_path": "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/b04-integer-review/check_integer.py", + "sha256": "96e6fe96e72111e691dac904fc3991b2ddca440509ffaf5bf4a990d27c33e522", + "role": "New independent integer audit output, preserved unchanged." + }, + "frozen/reviews/integer/SOURCE-DEPENDENCIES.json": { + "original_path": "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/b04-integer-review/SOURCE-DEPENDENCIES.json", + "sha256": "4f6bc94a650c238dccd1e7e80e254373ec57071089968972b48860b71bfbeedf", + "role": "New independent integer audit output, preserved unchanged." + }, + "frozen/reviews/integer/VALIDATION.json": { + "original_path": "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/b04-integer-review/VALIDATION.json", + "sha256": "3dc24bdaf215887ca5aef5152259108aceed78f9662225eb466db4a85ed52e97", + "role": "New independent integer audit output, preserved unchanged." + }, + "frozen/reviews/integer/VALIDATION-RUN.json": { + "original_path": "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/b04-integer-review/VALIDATION-RUN.json", + "sha256": "7310a204b8feb75ac3fa8be0ef438486e4a9ae7e7505470eaddd5cfd158f7853", + "role": "New independent integer audit output, preserved unchanged." + }, + "frozen/reviews/integer/CHECKS.json.gz": { + "original_path": "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/b04-integer-review/CHECKS.json", + "sha256": "b1710a496352872a80ed97271ddf2bfbf304cd009d45b345f2211561bfb5527e", + "original_sha256": "c887cf32e5640221e038e4358df6422fbc1f32d3f3c5b6ab3b14cc1723bce1fd", + "storage": "gzip of unchanged independent receipt bytes; mtime=0" + }, + "frozen/reviews/integer/VALIDATION.md": { + "original_path": "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/b04-integer-review/VALIDATION.md", + "sha256": "229705bf1a97d65c63d25dbf54ad2cc90ba7c1093ee238f71fd6cf1f3247bad7", + "role": "Independent integer validation report." + } +} diff --git a/research/r429-signed-range/PROOF-INTEGER.md b/research/r429-signed-range/PROOF-INTEGER.md new file mode 100644 index 0000000000..cd0a5fac63 --- /dev/null +++ b/research/r429-signed-range/PROOF-INTEGER.md @@ -0,0 +1,252 @@ +# The fixed signed quotient and its entire sign family + +This is a written proof using finite, exact prefix and suffix certificates. +The specific signed word is independently replayed over the integers and F2. +The family statement below follows from a linear factorization; it is not an +enumeration of its \(2^{47}\) members or a formal-kernel proof. + +## Domain and inherited contract + +There are 111 sources \(x\), 111 arbitrary targets \(y\), 429 arbitrary dirty +helpers \(h\), and one private register. The public order is \(x,y,h\), with +global indices \(0,\ldots,650\); private register 651 enters and exits at zero. +Every public coordinate is independent. All COPY episodes require a cleared +private register, an immutable physical source and an ERASE of that original +snapshot at its own cut. + +The parent is [PR3645](https://github.com/CrocSwap/integer-mult-bounds/pull/3645) +at `99b901c9b5ac70cf441b3d7e585cc7b8744b5359`. Its original R438 input is pinned +at `12fa8c5c844be21bfefb38a19503fbd867a11244`, with identical bytes at scientific +base `20ecf2891d80b5acf18d980b2164fb44ea7faa90`. +The exact source identities are in +[SOURCE-DEPENDENCIES.json](frozen/reviews/integer/SOURCE-DEPENDENCIES.json). +The complete parent construction ancestry and native copied-total ADDRESS +interface remain inherited, with their stated limits. + +The checker rederives \(R\) from the actual retained source coefficients after +raw phases D and A, and \(K\) from the actual raw scatter lists. It checks these +against the frozen matrix input. Let \(W\) equal \(K\) with physical rows 0,1,2 +zeroed. Then + +\[ + A=I+WR,\qquad \operatorname{rank}_{\mathbb F_2}(A-I)=9. +\] + +Both binary inverse identities are checked. The binary contract is + +\[ + (x,y,h)\longmapsto(Ax,y+Ax,h),\qquad + (x,y,h)\longmapsto(A^{-1}x,y+x,h) +\] + +in the forward and literal inverse orientations. + +## The fixed signed endpoint + +The candidate differs from the parent in exactly 23 coefficients, each changed +from \(+1\) to \(-1\), among its 47 phase-23 source ADDs. Every other record and +every boundary field agrees. Both words have 16,102 records, 13,223 ADDs, 2,873 +MOVEs, and three COPY/ERASE pairs. Their complete paid profile is + +\[ + \{1:1298,\ 2:1342,\ 3:79,\ 4:44,\ 5:93,\ 6:11,\ 7:9\}, +\] + +with 2,876 paid children and rank mass 4,989. Coefficient changes alone do not +improve this invoice. + +The independently computed integer endpoint is + +\[ + F(x,y,h)=(A_{\mathbb Z}x,\ y+T_{\mathbb Z}x+E_{\mathbb Z}h,\ h). +\] + +Every helper is restored literally. The source has no target or helper +dependence; the target self block is identity. Reduction modulo two gives +\(A_{\mathbb Z}\bmod2=T_{\mathbb Z}\bmod2=A\) and \(E_{\mathbb Z}\bmod2=0\). +The inverse is + +\[ + F^{-1}(x,y,h)= + (A_{\mathbb Z}^{-1}x,\ + y-T_{\mathbb Z}A_{\mathbb Z}^{-1}x-E_{\mathbb Z}h,\ + h). +\] + +This formula follows from the displayed triangular form and the checked +two-sided integer roundtrip; it does not identify the integer target map with +the binary map. + +In particular, the signed word has +\(A_{\mathbb Z}[0,0]=-23\), \(T_{\mathbb Z}[0,0]=-125\), and +\(E_{\mathbb Z}[0,4]=2\). Taking \(x=y=0\) and \(h=e_4\) therefore changes +target 0 by 2 while restoring that dirty helper. It is not an integer pure +source shear. The parent values in the first two entries are \(-21,-121\); +its entire \(E_{\mathbb Z}\) is unchanged by the sign variant. + +The dense integer endpoint hashes, including the zero private output row, +are: + +| Word and orientation | SHA256 | +|---|---| +| Parent forward | `fb1a055931d7344c66e958e8a73a18b6fdcaa48eac97dada7bcfd204c5847d4c` | +| Parent inverse | `f40e143c64a0a04c93643d2f910b35321e496c59fb3a37f84c16bd0ec6771214` | +| Signed forward | `e153a170456b6aa06022234ccb1d7cdbed64a6703b8e6ed3257cd794d299b079` | +| Signed inverse | `de9764a5d03a609ff8f71cbda97c74cb713bfc8cd1c29bea00843c39d1852eba` | + +Each hash encodes 652 rows of 651 signed decimal entries, comma separated, +with LF after every row. Full block hashes and entry witnesses are retained +in [CHECKS.json.gz](frozen/reviews/integer/CHECKS.json.gz); the checker can +emit every nonzero endpoint entry with `--endpoint-out`. + +## A fixed transfer certificate for all quotient signs + +The 47 phase-23 records form the contiguous interval +`[15228,15275)`, in zero-based indexing. Thus the fixed prefix has 15,228 +records and the fixed suffix has 827. The nine quotient coordinates are + +\[ + p=(0,1,2,4,8,9,14,30,59). +\] + +Let \(U:\mathbb Z^9\to\mathbb Z^{111}\) embed these coordinates, and let +\(P_3:\mathbb Z^3\to\mathbb Z^{111}\) embed target rows 0,1,2. +Let \(Q_\varepsilon\) be the integer 9-by-9 product of the existing 47 ordered +elementary ADDs with coefficients \(\varepsilon_i\in\{-1,+1\}\). +Every such \(Q_\varepsilon\) has determinant one, an integer inverse, and the +same reduction modulo two. + +Two exact certificates describe the fixed context. + +1. At the prefix cut, the nine quotient values are \(Bx\), for an explicit + integer matrix \(B\) of shape 9-by-111. There is no target or helper + dependence. Its columns at the nine selected positions satisfy + \(BU=I_9\). +2. Propagating a nine-dimensional perturbation on those coordinates through + the complete fixed suffix gives source perturbation \(U\), target + perturbation \(P_3L\), and zero perturbation on all helpers and the private + register, where + +\[ + L= + \begin{pmatrix} + 1&0&0&0&1&1&1&1&1\\ + 0&1&0&1&1&1&1&1&0\\ + 0&0&1&1&1&0&1&0&0 + \end{pmatrix}. +\] + +The first three columns of \(L\) form \(I_3\). +The complete reader \(B\), both transfer hashes, and the determinant-one +minor of \(L\) are retained in the receipt. The suffix transfer was computed +on all nine independent perturbation columns. It explicitly verifies each +COPY and original-snapshot ERASE, including zero private values at both cuts. +The full word independently verifies every frame and snapshot lifetime. + +Take any two quotient choices \(Q_0,Q_1\), and put +\(\Delta Q=Q_1-Q_0\). Immediately after the quotient, their difference is +\(\widehat U\Delta QBx\), with \(\widehat U\) embedding the source coordinates +in the full public/private state. Applying the fixed suffix certificate gives + +\[ + \boxed{ + \Delta A_{\mathbb Z}=U\Delta QB,\qquad + \Delta T_{\mathbb Z}=P_3L\Delta QB,\qquad + \Delta E_{\mathbb Z}=0. + } +\] + +All other public blocks are unchanged. These are integer matrix identities, +so they hold over every commutative ring by interpretation of the coefficients. +The legal snapshot conditions also hold for every choice: the fixed suffix +never mutates an open snapshot source or the private copy, and the transfer +identities preserve its zero/restore cuts. + +This proves the following for the entire \(2^{47}\)-member sign family: + +- Every source depends only on \(x\); source differences are supported on the + nine selected source rows. +- Target differences are supported on physical target rows 0,1,2. +- The target self block remains identity; \(E_{\mathbb Z}\) is unchanged and + even; all 429 arbitrary helpers and the private boundary are restored. +- Every quotient, hence the source code, is an invertible integer + elementary-matrix product. Reduction modulo two preserves the parent's + complete binary contract. +- The ordered gate destinations, frame paths, immutable snapshots and paid + histogram are unchanged. + +Over \(\mathbb Q\), injectivity of \(U,P_3\) and the right inverse \(BU=I_9\) +give the exact identities + +\[ + \operatorname{rank}(\Delta A_{\mathbb Z}) + =\operatorname{rank}(\Delta Q)\le9,\qquad + \operatorname{rank}(\Delta T_{\mathbb Z}) + =\operatorname{rank}(L\Delta Q)\le3. +\] + +For the particular signed witness versus its parent, +\(\det(\Delta Q)=1024\). Thus its source delta has rank 9. Since \(\Delta Q\) +is invertible over \(\mathbb Q\) and \(L\) has rank 3, its target delta has +rank 3. Those exact ranks apply to this pair; another sign pair can have +smaller rank, including zero. + +The same difference formula describes any substituted 9-by-9 integer +quotient matrix. Its invertibility, binary endpoint and implementation cost +would require their own hypotheses; that algebraic extension does not supply +a 47-ADD circuit for arbitrary matrices. + +## Exact scalar prefix norms and attaining inputs + +For a fixed orientation let \(M_t\) be the 652-by-651 integer coefficient +matrix after prefix \(t\), with the private input fixed at zero. MOVE preserves +scalar values, ADD applies its signed row operation, COPY duplicates the +source row, and a validated ERASE clears the private row. Induction gives the +exact scalar operator at every cut. + +For real scalar inputs, + +\[ + \|M_t\|_{\infty\to\infty} + =\max_i\sum_j |(M_t)_{ij}|. +\] + +The upper inequality is the triangle inequality. For a row attaining the +maximum, choose input \(u_j=\operatorname{sgn}((M_t)_{ij})\), with zero for a +zero coefficient. Then \(\|u\|_\infty=1\) and the selected output equals the +row's sum of absolute coefficients. The receipt supplies the entire concrete +sign vector and selected coefficient row, and a separate scalar replay +checks attainment. + +| Word | Forward maximum | Literal inverse maximum | +|---|---:|---:| +| Parent | 34,285 | 5,839,860 | +| Signed quotient | 80,639 | 239,014 | + +For the signed forward word, global register 1 after record 15,885 attains +80,639. For the signed inverse, global register 220 after processing original +record 5,651 in reverse order attains 239,014. Every record index is zero +based. All four parent/candidate maxima have complete attaining witnesses. + +The isolated quotient maxima are 442 forward / 75 inverse for the parent +and 7 forward / 9 inverse for the signed quotient. Improvement of that small +block does not imply that both complete-word maxima improve: the complete +forward maximum increases. + +## Coverage and open implications + +The finite computation reconstructs every integer and F2 public input column +in both orientations, two integer roundtrips for each word, all helper and +target blocks, every frame visit, all paid children, and exact snapshot cuts. +Unbounded Python integers and exact integer rank operations are used. +The all-sign theorem is the written linear consequence of the finite fixed +prefix/suffix certificates. + +The scalar cancellation bound is not a bound for an unproved native vector +realization with address-dependent operators. No theorem on native child +errors, rounded cleanup, precision reserves, physical ownership, source +access, storage, tape costs, terminal decoding, recursive callers or joint +outer assembly follows here. The historical PR589 precision formulas have +not been transferred to this changed source interface. No new supplier or +kappa admission, unrestricted sign optimum, or formal-kernel verification +is claimed. diff --git a/research/r429-signed-range/PROOF-RANGE.md b/research/r429-signed-range/PROOF-RANGE.md new file mode 100644 index 0000000000..d3f6df4eb4 --- /dev/null +++ b/research/r429-signed-range/PROOF-RANGE.md @@ -0,0 +1,271 @@ +# Conditional range and atomic-defect theorem for the two pinned 651-input words + +This note separates an exact finite calculation from the general linear-algebra +argument that gives it an all-input interpretation. It does not prove a native +rounded supplier, a finite-precision implementation, or a new multiplication +bound. There is no formal-kernel proof. + +## 1. Exact model and source domain + +There are 651 public scalar coordinates and a private coordinate `p=651`. +The public entrance coordinates are partitioned into source `0..110`, target +`111..221`, and 429 arbitrary dirty helpers `222..650`. The private entrance is +zero. Arithmetic is over the integers for the finite calculation and over the +reals for the range/error theorems. + +Both pinned words have 16,102 records. Their normalized atomic interpretations +are: + +* `ADD(d,s,c)`: `z_d <- z_d+c z_s`, with `c=+1` or `-1`; +* `MOVE(d)`: identity on normalized coefficients, with the recorded paid rank; +* `COPY(s)`: `z_p <- z_s`; +* `ERASE`: `z_p <- 0`. + +The literal reverse reads records backward, negates each ADD coefficient, and +exchanges COPY with ERASE. It is an inverse only on the appropriate ideal +reachable states. COPY and ERASE are noninvertible linear assignments on the +extended state space. + +For every ideal prefix the checker proves that a copied source is unchanged +until its paired erasure and that the private value equals that source at +erasure. It proves zero private return and literal restoration of all 429 +helpers. These ideal facts do **not** imply rounded cleanup. In particular, +setting the additive defect of ERASE to zero below still presupposes the +abstract zero assignment. It does not permit deleting a small physical residual. + +The normalization assumes that native frame changes give precisely this scalar +model. Native child interiors, frame implementation, scratch, actual rounding +rules, finite exponent limits, and physical zero-return are outside the theorem. + +## 2. Exact local prefix range + +Let `R_t` be the matrix from the 651 public entrance coordinates to all 652 +coordinates after the first `t` events, with the private entrance fixed to zero. +For a row `r` write + +`a(r)=sum_source |r_j|`, `b(r)=sum_target |r_j|`, +`c(r)=sum_helpers |r_j|`. + +The checker starts with the public identity rows and a zero private row, updates +the changed row under every event, and records every triple `(a,b,c)`. Unchanged +rows were already recorded. Consequently the saved set is the complete set of +block row norms over every row and prefix, including COPY values. It is not a +claim that every triple is a distinct exposed face of a minimal envelope. + +For entrance block bounds `||x||_infinity<=X`, `||y||_infinity<=Y`, +`||h||_infinity<=H`, every ideal prefix coordinate is bounded by + +`max_(a,b,c in envelope) (a X+b Y+c H)`. + +This follows by the triangle inequality on each exact row. For `X=Y=H=1`, the +maximum is exactly `max_t ||R_t||_infinity`: choosing the entrance signs of a +maximizing row attains its row L1 norm. The saved maximizing row and signs are +independently replayed by scalar forward evaluation. + +| Word | Forward exact maximum | Literal reverse exact maximum | +| --- | ---: | ---: | +| Parent, gzip `1a6841fc...` | 34,285 | 5,839,860 | +| Candidate, gzip `e8026111...` | 80,639 | 239,014 | + +Thus the forward maximum increases. Only the literal reverse maximum decreases. + +The exact endpoint has the integer form + +`(x,y,h) -> (A x, y+T x+E h, h)`. + +The checker verifies the source/target support and the identity target self +block before using it. The largest absolute row sums of the indicated blocks +are: + +| Word/direction | `A` | `T` | `E` | +| --- | ---: | ---: | ---: | +| Parent forward | 12,711 | 26,235 | 224 | +| Parent reverse | 136,165 | 5,839,659 | 224 | +| Candidate forward | 15,675 | 70,795 | 224 | +| Candidate reverse | 5,521 | 238,823 | 224 | + +`T=A` is not asserted over the integers. Helper leakage is even but need not be +zero over the integers. + +## 3. Source code and controller binding + +The source code is the actual subsequence of ADD records in phases 21 through +24: respectively 474, 504, 47, and 474 ADDs, for 1,499 total. Its endpoint equals +the full local word's source endpoint in each direction. Reversing these ADDs +and negating their coefficients gives the exact inverse on all 111 columns. + +| Word | Source forward prefix / endpoint | Source reverse prefix / endpoint | +| --- | ---: | ---: | +| Parent | 22,961 / 12,711 | 136,165 / 136,165 | +| Candidate | 15,675 / 15,675 | 5,521 / 5,521 | + +The controller file has a historical 6,372-gate `inplace_code_CNOTs` list. Its +binary endpoint differs from the selected 1,499-gate code in nine rows. Therefore +the calculation is **a new source-selected instantiation of its abstract +ordered schedule**, not a replay of that historical gate list. Both endpoints +and the first mismatch are recorded. + +The reason the schedule still applies in the binary VALUE model is independent +of that historical list. Write `Abar` for the selected source matrix modulo two. +The full local coefficient calculation verifies, on all columns, + +`F_Abar(x,y,h)=(Abar x,y+Abar x,h)`, + +and its literal inverse is + +`F_Abar^-1(x,y,h)=(Abar^-1 x,y+x,h)`. + +At a reverse stage the controller supplies source `Y` and target `X`. Thus its +abstract pair updates, with `G_s=Abar` at an even stage and `G_s=Abar^-1` at an +odd stage, are + +`forward: (X,Y) -> (G_s X,Y+G_s X)`, + +`reverse: (X,Y) -> (X+Y,G_s Y)`. + +Code sweeps left-multiply their selected bank by the listed generators. Bridges +are the two prescribed binary bank shears. Idle endpoints preserve normalized +values and advance the native chart; the terminal exchange swaps each pair. + +The checker evaluates every prefix on eight independent formal bank variables +in the free noncommuting polynomial algebra over GF(2). Its final diagonal is +`G_8 G_7 ... G_0` on all eight variables. Polynomial evaluation proves that this +identity holds for any linear maps substituted for the generators; no +commutation assumption is made. The stage updates above bind the selected +local word to this identity. Native chart/owner implementation and a physical +supplier remain separate premises. The identity is binary, and does not +replace the different integer `T` and `E` blocks in a range calculation. + +## 4. The complete ordered range recurrence + +Maintain nonnegative bounds `n[p][side]` for the eight DATA banks, initially one. +Suppose all completed native frame, idle, address and owner maps preserve the +chosen norm, hosted helpers restore literally, and the actual source-selected +codes are available at the scheduled charts. + +For a source code with exact prefix norm `P` and endpoint norm `U`, update + +`global_prefix <- max(global_prefix, P n)`, `n <- U n`. + +For a local call, let `x,y` be the current source and target bank bounds and let +`h=max_(all current banks) n`. Use its complete envelope to enlarge the running +prefix bound by `max(a x+b y+c h)`. With its exact endpoint block bounds +`U,T,E`, update the source to `U x` and target to `y+T x+E h`. Other bank +endpoints are unchanged because helpers restore. Using `h=1` would be +unjustified: hosted helpers may be in banks already enlarged by code sweeps. + +Each ordinary bridge has coefficient `+1` or `-1`. The triangle inequalities +give `n[d][X] += n[s][X]` and `n[s][Y] += n[d][Y]`. These two sources are not the +two just-modified destinations. Exchange only permutes the bounds. + +Induction over all 56 ordered controller events proves the saved bound. +The receipt lists every intermediate bank bound, all 35 forward and 28 reverse +source-code factors, five forward and four reverse local calls, 18 bridge +shears, ten isometric idle events and the exchange. No factor is inferred from +an endpoint-only norm. + +The resulting coefficient upper bounds have bit lengths 458 and 401. These +are valid upper bounds under the stated scalar instantiation and isometry +premises, not exact global maxima. + +For an additional per-bank inverse decode of `G_8...G_0`, there are five reverse +and four forward source-code factors. Every source prefix norm is at least one. +Hence the product `P_forward^4 P_reverse^5` bounds each prefix of that decode. +Multiplying the running bound by it gives bit lengths 601 and 519. The eight +bank decodes are independent; multiplying this factor eight times would be +unnecessary. Any additional normalization wrappers are assumed isometries. +This is a range bound for that conditional sequence, not a proof of terminal +decoder correctness or admission. + +The reported 64-bit block ceilings are respectively 512 to 448 and 640 to 576. +They are ceilings of coefficient-growth bit lengths. Actual signed storage +width also depends on input magnitude, errors, fractional grids, scaling and +internal native prefixes; no concrete precision saving follows here. + +## 5. Exact atomic additive-defect constants + +The following argument applies to every finite real linear word, including +noninvertible assignments. Number its matrices `M_0,...,M_(m-1)` and let + +`S_i=M_(m-1)...M_(i+1)`, with `S_(m-1)=I`. + +Use matched ideal and perturbed entrances. An independent scalar defect +`delta_i` is added to the single destination coordinate `d_i` immediately after +event `i`. Linearity and induction give the identity + +`error_final = sum_i S_i e_(d_i) delta_i`. + +This identity holds for every real entrance and defect choice. The receipt's +domain is the fixed two 652-coordinate words, with their chosen assignment +extension. It does not infer any actual rounding rule or independent-error +behavior of a native implementation. + +For any subset `I` of defect locations and `|delta_i|<=epsilon` there, +with other defects zero, define + +`C_I=max_output_r sum_(i in I) |(S_i)_(r,d_i)|`. + +Then `||error_final||_infinity <= C_I epsilon`. This constant is exact for the +stated independent-error model: choose a maximizing output row `r*` and +`delta_i=epsilon sign((S_i)_(r*,d_i))`. That output equals `C_I epsilon`. +This sharpness does not assert that these errors can be generated by rounding +while satisfying physical copy/erase preconditions. + +The commonly used `sum_i max_r |(S_i)_(r,d_i)|` is a generally looser bound. +The checker retains the row sums before taking the maximum. For groups with +different uniform allowances, the exact constant is +`max_r sum_g epsilon_g sum_(i in group_g) |(S_i)_(r,d_i)|` for a disjoint +partition. Saved per-group row vectors permit this calculation; overlapping +summary groups must not be counted twice. + +The sparse-column reverse recurrence is: + +* ADD `d<-d+c s`: column `s <- column s+c column d`; +* COPY `p<-s`: column `s <- column s+column p`, then column `p <- 0`; +* ERASE: column `p <- 0`; +* MOVE: unchanged. + +These formulas are right multiplication `S <- S M_i`. They include the +assignment's destruction of an old private value. Each destination column is +read **before** this update because the error is injected after that event. +The complete ordered destination-column stream is hashed. + +The reported exact aggregate uses every ADD, MOVE and COPY, with ERASE defects +zero but the abstract ERASE assignment still assumed: + +| Word/direction | Exact `C_I` | Loose sum of per-event maxima | +| --- | ---: | ---: | +| Parent forward | 880,068 | 965,052 | +| Candidate forward | 1,081,994 | 1,099,680 | +| Parent reverse | 34,848,225 | 34,872,847 | +| Candidate reverse | 1,255,309 | 1,289,381 | + +Allowing defects after ERASE leaves these four aggregate maxima unchanged, +although it adds a private-coordinate row and raises each loose sum by one. + +If only MOVE and COPY have defects, the exact forward constants are 383,045 +and 479,557; the reverse constant is 1,239 for both. Every reverse paid-rank +group is unchanged. Therefore the large reverse all-event improvement concerns +ADD-defect sensitivity; it is not a reduction of this MOVE/COPY aggregate. + +## 6. Finite witnesses and limits + +All four full scans cover every record and every paid rank. Peak single-defect +influences are 3,457 / 86,476 for the parent forward/reverse words and +3,935 / 4,366 for the candidate. Each saved peak impulse is independently +propagated forward. For each aggregate, a separate scalar-adjoint pass produces +the attaining error signs, and direct forward evaluation of all simultaneous +errors attains the claimed constant. Local range peaks and maximum suffix row +norms also have directly evaluated sign witnesses. + +Source-specific negative controls detect a wrong adjoint direction, reversed +suffix order, ignoring a real COPY, and replacing the required error signs by +all-positive errors. These execute after source authentication and operate on +the actual source events. + +The all-input arguments above are written linear-algebra proofs. The reported +numbers, symbolic schedule identity and witnesses are finite exhaustive exact +computations for the pinned words. They do not establish an all-size native +precision theorem, a formal-kernel result, physically legal rounded cleanup, +error propagation through the 63 global code factors, general sign optimality, +or an improved supplier/exponent. diff --git a/research/r429-signed-range/README.md b/research/r429-signed-range/README.md new file mode 100644 index 0000000000..503be260c9 --- /dev/null +++ b/research/r429-signed-range/README.md @@ -0,0 +1,143 @@ +# A signed R429 lift: lower range, mixed error sensitivity + +Changing 23 of the 47 quotient ADD coefficients in the published R429 word +preserves its complete binary map, arbitrary integer helper restoration and +paid rank mass 4989. It changes the integer lift. The selected scalar controller +has a smaller normalized range bound, but forward additive-error sensitivity +increases. This is a fixed witness and conditional scalar-network calculation, +not a precision-admitted supplier. + +The immediate parent is [PR3645](https://github.com/CrocSwap/integer-mult-bounds/pull/3645), +head `99b901c9b5ac70cf441b3d7e585cc7b8744b5359`. Parent gzip SHA256 is +`1a6841fccba51fa922993c77b4b296e659c2c538252e5e06113d0438c5edb870`; +the signed witness is +`e802611104c61fc8477837b4ab41abc4f13cf41fbca6ef3de60d0b5e768fb949`. +The unchanged `parent_word_gzip_sha256` field inside both artifacts names +their earlier support-code ancestor, not this immediate sign-variant parent. + +## Exact local contract + +There are 111 source fields, 111 target fields, 429 arbitrary dirty helpers +and one private field initially zero. Both words have 16,102 records, +2,873 MOVEs, 13,223 ADDs and three immutable COPY/ERASE pairs. +The independent integer checker covers every public input column in both +directions and both integer roundtrips. It derives the binary source matrix +from the original R438 word, rather than assuming the saved matrix. + +The binary interface is `(x,y,h) -> (Ax,y+Ax,h)`. Over the integers the +interface is `(A_Z x, y+T_Z x+E_Z h, h)`, with its literal inverse and exact +private return. The even dirty block need not vanish. For the signed witness, +`A_Z[0,0]=-23`, `T_Z[0,0]=-125` and `E_Z[0,4]=2`; it is not an integer +pure shear. All native frame and copied-source lifetimes are retained. + +The fixed prefix–quotient–suffix factorization explains the whole sign family. +Its nine-dimensional changed block cannot change integer helper leakage; +forward target changes are confined to three rows. The current forward witness +has source delta rank 9 and target delta rank 3. The universal bounds and their exact +premises are proved in [PROOF-INTEGER.md](PROOF-INTEGER.md). + +## Range and error are different comparisons + +| Quantity | Parent | Signed witness | +| --- | ---: | ---: | +| Exact forward scalar prefix row norm | 34,285 | 80,639 | +| Exact inverse scalar prefix row norm | 5,839,860 | 239,014 | +| Selected controller scalar upper-bound bit length | 458 | 401 | +| With the specified terminal scalar code sweeps | 601 | 519 | +| Historical 64-bit block allowance for controller range | 512 | 448 | +| Corresponding allowance with terminal scalar sweeps | 640 | 576 | + +The local scalar maxima have explicit attaining unit-box inputs. The global +numbers are sufficient upper bounds, not exact maxima or minimal word widths. +They include all 63 selected source-code factors, all nine local calls, +all 18 ordinary bank shears and the current encoded helper magnitudes. +Sign storage, initial input scale, native child interiors and physical access +are separate obligations. + +The controller artifact also contains an older 6,372-gate code. Its binary +endpoint differs from the selected 1,499-ADD source code. This package uses +only its ordered abstract schedule, instantiating every sweep with the actual +selected code or its literal inverse. An independent calculation in the free +noncommuting polynomial algebra over GF(2) checks the schedule identity. +Its interpretation here uses the selected invertible stage codes. +No claim is made that the artifact's older code listing is the new integer word. + +For a scalar defect of magnitude at most one at the destination immediately +after each eligible atomic event, the exact completed-output constant is +`J=max_j sum_i |(S_i e_dst(i))_j|`, where `S_i` is the suffix after that event. +Every event and all output coordinates are covered. Independent dual-row and +forward executions attain the reported constants. + +| Eligible defect locations; exact scalar J | Parent | Signed witness | +| --- | ---: | ---: | +| Forward, all events except exact ERASE | 880,068 | 1,081,994 | +| Inverse, all events except exact ERASE | 34,848,225 | 1,255,309 | +| Forward, MOVE and COPY only | 383,045 | 479,557 | +| Inverse, MOVE and COPY only | 1,239 | 1,239 | + +Thus the inverse all-event improvement comes from ADD sensitivity; the inverse +MOVE/COPY aggregate is unchanged. The forward bounds worsen. These are exact +constants of the stated normalized scalar assignment model, not an analysis +of arbitrary native child defects. COPY and ERASE use their exact abstract +assignments; physical copied-workspace cleanup under perturbations is not +proved by an assignment that simply clears a coordinate. + +The earlier saved suffix receipt concerned a different 660-input, six-copy +word. Its values are not transferred here. Both actual 651-input words are +recomputed in [PROOF-RANGE.md](PROOF-RANGE.md) and the new complete receipt. + +## Verification + +Use CPython 3.12 from the repository root: + +```sh +python3.12 -B scripts/check_research_commit.py --package research/r429-signed-range --check-source-history +python3.12 -B scripts/research_package.py --package research/r429-signed-range +``` + +[VERIFY.json](VERIFY.json) registers the bounded checks. +[EVIDENCE-INDEX.md](EVIDENCE-INDEX.md) separates the retained original functions, +two independent implementations, written proofs and acceptance controls. +No sign search is repeated. The fixed historical signed receipts and all new +receipts are compared completely, preserving JSON scalar types and list order. + +Original bytes are pinned in [ORIGINS.json](ORIGINS.json) and +[FROZEN-SHA256.json](FROZEN-SHA256.json). Large unchanged JSON inputs and full +receipts are gzip-compressed for storage; decompressed original hashes are +checked separately. Retained functions are selected from authenticated ASTs; +their imports and original entrypoints are not executed. Complete independent +checkers are also compiled from authenticated bytes, with assertions enabled +under optimized parent Python. + +[REVIEW-INTEGER.md](REVIEW-INTEGER.md), [REVIEW-RANGE.md](REVIEW-RANGE.md) +and [REVIEW-VERIFICATION.md](REVIEW-VERIFICATION.md) are separate AI reviews, +not independent human acceptance or formal-kernel proofs. + +## Open next questions + +No optimality of the 23-sign witness or of any width allowance is claimed. +The paid rank profile is unchanged. The scalar controller bounds do not +repair the terminal/owner deficit in +[PR4185](https://github.com/CrocSwap/integer-mult-bounds/pull/4185). +No selected frontier file is changed and no new kappa is claimed. + +The next precision obligation must specify the input lattice, native child +interiors, permitted defects, internal storage and exact copied-state return. +The completed-word atomic constants do not bound all perturbed prefixes or +state-relative feedback. A favorable range calculation alone cannot discharge +those obligations. + +## Sources and credit + +The R438 word lineage is due to Ali Romman/PR1043, with transport and rehosting +from Sagar Thakrar/PR2423 and the prior PR1307 geometry ancestry. +The source-code word is Ross Richardson's PR3645; original source headers, +notices and exact bytes are retained. The fixed signed witness, independent +mathematical checks, added proofs and publication were prepared by Ross +Richardson with substantial OpenAI Codex assistance. Apache-2.0. + +Scientific source artifacts retain their original +`20ecf2891d80b5acf18d980b2164fb44ea7faa90` context; publication guidance and +catalogue revision 7 are pinned at +`12fa8c5c844be21bfefb38a19503fbd867a11244`. +[RELATED-WORK.json](RELATED-WORK.json) records overlap scope and exact heads. diff --git a/research/r429-signed-range/RELATED-WORK.json b/research/r429-signed-range/RELATED-WORK.json new file mode 100644 index 0000000000..38b4a5607c --- /dev/null +++ b/research/r429-signed-range/RELATED-WORK.json @@ -0,0 +1,48 @@ +{ + "checked_at": "2026-10-20T11:59:32.201558+00:00", + "coverage": { + "open_prs": { + "fetched_at": "2026-10-20T11:57:54.361602+00:00", + "complete_pagination": true, + "records": 306 + }, + "discussions": { + "fetched_at": "2026-10-20T11:58:51.337749+00:00", + "complete_pagination": true, + "records": 2701 + }, + "closed_prs": { + "fetched_at": "2026-10-20T11:59:31.848484+00:00", + "complete_pagination": true, + "records": 3540 + } + }, + "limits": "Remote PR scope includes open and closed/merged titles and bodies, with separate coverage and timestamps. State changes are deduplicated by latest PR update; snapshots are not atomic. No code diffs or arbitrary package files are searched. Recheck relevant heads before submission.", + "related": [ + { + "pr": 3645, + "head": "99b901c9b5ac70cf441b3d7e585cc7b8744b5359", + "role": "Immediate 651-input parent word and binary local contract; the new witness changes23 integer coefficients, leaving F2 and paid rank unchanged." + }, + { + "pr": 4185, + "head": "86aa870336c05404855befe51bc0a5155cbc2252", + "role": "Returned-owner accounting and generic alternating-controller obstruction. This package neither improves its paid profile nor removes its coded endpoint." + }, + { + "pr": 1043, + "head": "e309e17f83f5759b1ea1fa24a76f24838784cb4d", + "role": "Ali Romman R438 word and local boundary ancestry." + }, + { + "pr": 2423, + "head": "13cd273dc13c98244b1f9bcf588b6e828cbc0347", + "role": "Sagar Thakrar transport/rehosted raw word." + } + ], + "old_suffix_receipt": { + "gzip_sha256": "33d5c73fc6012da643a6d498dcacccfe70470fd76d0ee327a85f9ac6381dabcd", + "scope": "660-public/438-helper six-copy word, distinct from both actual651-input words here; no receipt values transferred." + }, + "search_does_not_certify_novelty": true +} diff --git a/research/r429-signed-range/REVIEW-INTEGER.md b/research/r429-signed-range/REVIEW-INTEGER.md new file mode 100644 index 0000000000..a6edda3164 --- /dev/null +++ b/research/r429-signed-range/REVIEW-INTEGER.md @@ -0,0 +1,110 @@ +# Independent mathematical review of B04 + +**Disposition: pass for a narrow fixed-witness audit and the stated +all-sign-family transfer theorem.** No precision, native-vector, supplier or +kappa admission is established. + +The reviewed word is the unchanged historical +`BIT-SIGNED-QUOTIENT-WORD.json.gz`, SHA256 +`e802611104c61fc8477837b4ab41abc4f13cf41fbca6ef3de60d0b5e768fb949`. +Its immediate parent is the exact word published by PR3645 at +`99b901c9b5ac70cf441b3d7e585cc7b8744b5359`, SHA256 +`1a6841fccba51fa922993c77b4b296e659c2c538252e5e06113d0438c5edb870`. +Their 23 changed coefficients are all phase-23 \(+1\)-to-\(-1\) changes. +All other records, metadata apart from the format name, and boundary arrays +are identical. + +The candidate's historical `parent_word_gzip_sha256` field still names the +support-code ancestor `6e4e79c3...`; it was inherited unchanged. The immediate +sign-variant parent is authenticated separately, as above. + +## Independent method and results + +[check_integer.py](frozen/reviews/integer/check_integer.py) is a fresh +standard-library implementation using dense integer coefficient rows and a +parallel F2 bit-row interpreter. It does not import or execute the original +producer, optimizer, sparse integer replayer or native checker. Those sources +and the exact PR3645 proof were read to establish the intended contract. + +The checker authenticates all four explicit inputs, derives R and K directly +from the original R438 D/A/scatter data, derives \(A=I+WR\), and checks its +two-sided binary inverse. It rederives rational frame ranks using exact integer +elimination and checks actual entrance-line/target-cap bindings. + +The full replay establishes: + +- Every one of the 651 arbitrary public input columns in both rings and both + orientations; 429 literal integer helper restorations and identity target + self blocks; closed private snapshots. +- Both forward-then-inverse and inverse-then-forward integer roundtrips for + both parent and signed words. +- The complete profile with rank mass 4,989, including all 2,873 MOVEs and + all three rank-one COPY children; unchanged costs and frame paths. +- Exact scalar prefix maxima 80,639 / 239,014 for the candidate versus + 34,285 / 5,839,860 for the parent, each with a concrete attaining input. +- The actual integer endpoint, with nonzero even helper leakage. In + particular \(A_{\mathbb Z}[0,0]=-23\), \(T_{\mathbb Z}[0,0]=-125\), and + \(E_{\mathbb Z}[0,4]=2\); the integer target is not \(y+A_{\mathbb Z}x\). + +The useful expansion is a finite prefix/suffix transfer certificate and its +written proof. For every assignment of the 47 existing quotient signs, + +\[ + \Delta A_{\mathbb Z}=U\Delta QB,\quad + \Delta T_{\mathbb Z}=P_3L\Delta QB,\quad + \Delta E_{\mathbb Z}=0, +\] + +with \(BU=I_9\), and \(L\) a displayed rank-three 3-by-9 matrix. Thus source +changes are confined to the nine pivots, target changes to rows 0,1,2, dirty +leakage is unchanged, and helpers remain literally restored. The ranks are +at most 9 and 3 throughout the family. For this particular pair, +\(\det(\Delta Q)=1024\), giving exact ranks 9 and 3. +[PROOF-INTEGER.md](PROOF-INTEGER.md) proves the distinction between those +universal bounds and the current pair's exact ranks. + +## Controls that reach mathematical failure gates + +All mutations are applied to in-memory records after valid inputs have passed +authentication. Four exception controls require their exact intended error; +an unrelated exception or ineffective control fails the audit. + +| Mutation | Mathematical detection | +|---|---| +| Stale private COPY value | ERASE differs from original unchanged snapshot | +| Mutate physical copied source | Immutable-source lifetime violation | +| Write to the private snapshot | Immutable-private destination violation | +| Wrong MOVE rank | Exact frame-containment/rank violation | +| Wrong inverse ADD sign | F2 roundtrip stays identity; integer roundtrip has coefficient \(-58\) at row 0, column 59 | +| Flip one quotient sign | F2 endpoint stays fixed; integer source changes at row 0, column 59 | +| Wrong helper-cleanup sign | F2 stays fixed; helper 222 gains \(2x_0\) | +| Source code reads dirty helper 222 | Source 0 acquires coefficient 1 of that arbitrary helper | +| Omit one compensation term | Target 111 has odd coefficient 1 of dirty input 226 | + +The complete deterministic receipt is +[CHECKS.json.gz](frozen/reviews/integer/CHECKS.json.gz). +Source hashes and inherited obligations are in +[SOURCE-DEPENDENCIES.json](frozen/reviews/integer/SOURCE-DEPENDENCIES.json). +Actual local command and portability evidence are in +[VALIDATION.md](frozen/reviews/integer/VALIDATION.md). + +## Covered domain and remaining obligations + +The fixed integer identities cover every integer input and, by coefficient +identities, every module over a commutative ring, with the private register +initially zero. The F2 endpoint is stated only modulo two. The exact induced +infinity norms cover the scalar lift on real inputs. + +The family theorem covers all \(2^{47}\) sign assignments in the existing +ordered quotient alphabet. It does not establish a sign optimum, common +prefix bound for the whole family, or equal costs for arbitrary coefficient +or arbitrary matrix substitutions. + +The original native ADDRESS/copied-total interface and full parent +construction ancestry are inherited under their precise PR3645 assumptions. +The current audit does not rerun the parent's complete reconstruction. +Its scalar prefix bounds do not admit a native vector implementation or +charged precision theorem. Global decoder, source access, dirty ownership, +storage, tape, recursive caller and complex/BIT assembly obligations remain +open. This is independent AI-assisted mathematical work, not human review or +formal-kernel verification. diff --git a/research/r429-signed-range/REVIEW-RANGE.md b/research/r429-signed-range/REVIEW-RANGE.md new file mode 100644 index 0000000000..4e1987b48f --- /dev/null +++ b/research/r429-signed-range/REVIEW-RANGE.md @@ -0,0 +1,127 @@ +# Independent B04 range and atomic-defect review + +The selected sign change lowers the conditional controller range upper bound, +but worsens forward local range and forward additive-error amplification. The +inverse improvement is substantial for ADD defects. It gives no improvement +to the exact inverse MOVE/COPY aggregate in this atomic model. + +The frozen parent and candidate each have 651 public inputs, 429 dirty helpers, +one private coordinate, 16,102 records, three COPY/ERASE pairs, and paid rank +mass 4,989. The candidate changes exactly 23 of the 47 phase-23 ADD signs. +No sign search is performed by this review. + +| Exact local quantity | Parent forward | Candidate forward | Parent reverse | Candidate reverse | +| --- | ---: | ---: | ---: | ---: | +| Maximum prefix row L1 | 34,285 | 80,639 | 5,839,860 | 239,014 | +| Maximum suffix row L1 | 136,729 | 138,976 | 7,658,958 | 324,924 | +| Maximum single destination impulse | 3,457 | 3,935 | 86,476 | 4,366 | +| Exact aggregate, ADD+MOVE+COPY | 880,068 | 1,081,994 | 34,848,225 | 1,255,309 | +| Loose sum of individual maxima | 965,052 | 1,099,680 | 34,872,847 | 1,289,381 | +| Exact aggregate, MOVE+COPY only | 383,045 | 479,557 | 1,239 | 1,239 | + +The aggregate is `max_output sum_event |suffix_entry|`, not +`sum_event max_output |suffix_entry|`. It is exact for arbitrary independent +scalar additive defects after the indicated atomic operations. Each aggregate +has a saved simultaneous-error sign witness and a direct forward attainment +check. + +All assignments are interpreted literally in the extended linear model: +COPY overwrites the private coordinate with the source and ERASE assigns zero. +In the main aggregate ERASE defects are zero. **This entire assignment premise +is conditional:** zero ERASE defect does not prove that an actual rounded +private register has returned to an erasable zero state. Actual rounding rules, +native-child error support, interior prefixes and physical cleanup are absent. + +The per-event comparison is also mixed. In the forward word, 1,556 corresponding +single-destination weights increase, 667 decrease and 13,879 are equal. In the +reverse word, 842 decrease and 15,260 are equal; none increases. All reverse +MOVE/COPY rank-group constants are unchanged. + +The controller calculation independently reconstructs complete local block +prefix envelopes and follows all 56 controller events, including every one +of the 63 additional code factors. Hosted helper entrance magnitudes are +bounded by the largest **current encoded bank** magnitude. + +| Conditional coefficient upper bound | Parent | Candidate | +| --- | ---: | ---: | +| Ordered controller bit length | 458 | 401 | +| Ceiling to a multiple of 64 | 512 | 448 | +| With nine inverse-code factors per terminal bank | 601 | 519 | +| Terminal ceiling to a multiple of 64 | 640 | 576 | + +These are coefficient-growth upper bounds under admitted isometric native +charts and exact restoration. They are not finite-precision guard counts, +physical register sizes, exact global maxima, or supplier admission. + +## Source binding found during review + +The current words have a selected source code of 1,499 actual ADD records in +phases 21–24. The controller JSON retains a historical 6,372-gate binary code. +The two binary endpoints differ in nine source rows. Therefore its stored gate +list cannot be used as the implementation underlying the new range numbers. + +The checker instead binds every abstract sweep to the selected local source +code or its literal inverse. It verifies that the local binary interfaces are +`(x,y,h)->(A x,y+A x,h)` and `(x,y,h)->(A^-1 x,y+x,h)`. It independently evaluates +the complete abstract schedule on eight formal bank columns in the free +noncommuting polynomial algebra over GF(2), obtaining the common endpoint +`diag(G8...G0)`. This justifies replacing the abstract source maps in the binary +VALUE schedule. Native physical charts, ownership and integer terminal identity +are separate obligations. + +The older `root-rounding/SUFFIX-WEIGHTS.json` belongs to the different +660-public-input, 438-helper, six-copy word with gzip digest `33d5c73f...`. +None of its weights is reused. All four present suffix calculations are fresh +and bind to the exact 651-input source bytes. + +## What the checker establishes + +`frozen/reviews/range/check_range.py` uses only the Python standard library and imports no producer +code. It authenticates both words and the decoded controller bytes; JSON and +gzip JSON controller transport are supported. It then: + +1. Reconstructs exact sparse block-prefix envelopes, endpoint blocks and source + code matrices, including literal inverse and ideal private/helper cleanup. +2. Replays every ordered controller factor with full bank bounds and records + every intermediate recurrence value. +3. Scans every atomic suffix with correct COPY/ERASE adjoints, saving every + individual influence, opcode/rank row-sum vector, full-column-stream digest, + exact aggregate and attaining witness. +4. Cross-checks source-specific peak impulses, range/suffix sign witnesses and + simultaneous-error witnesses by forward scalar propagation. +5. Detects wrong-adjoint, reversed-order, ignored-COPY and error-sign controls + after authentication, on the actual source events. + +The full receipt is deterministic and compressed without timestamps. It +contains complete operation/rank coverage, all block-envelope triples, all +16,102 individual weights per orientation, aggregate rows and witnesses. +`frozen/reviews/range/SOURCE-DEPENDENCIES.json` records exact source and historical +receipt hashes. `frozen/reviews/range/VALIDATION.md` gives the executed commands +and outcomes. The complete receipt is `frozen/reviews/range/CHECKS.json.gz`. + +The calculation covers the two pinned finite words, all real entrance values +in the stated scalar model, and every independent additive-defect choice in +that model. The proof of the error formula and exact aggregate is all-input +linear algebra. The constants are finite exhaustive integer computations. +No formal-kernel proof is supplied. + +## Reproduction + +From the package root: + +```sh +python3.12 frozen/reviews/range/check_range.py \ + --parent-word frozen/parent/WORD.json.gz \ + --candidate-word frozen/candidate/WORD.json.gz \ + --controller frozen/controller/WORD.json.gz \ + --verify frozen/reviews/range/CHECKS.json.gz +``` + +Use `--output NEW-RECEIPT.json.gz` to write a fresh deterministic receipt. +Transport digests are included, so a receipt made from raw controller JSON +differs in its transport digest from one made from the unchanged compressed +controller. The decoded controller digest and all mathematical results agree. + +There is no new sign optimization, general optimality claim, global defect +constant, concrete rounded implementation, tape/stock invoice, terminal +correctness admission, or new multiplication exponent. diff --git a/research/r429-signed-range/REVIEW-VERIFICATION.md b/research/r429-signed-range/REVIEW-VERIFICATION.md new file mode 100644 index 0000000000..45998dc868 --- /dev/null +++ b/research/r429-signed-range/REVIEW-VERIFICATION.md @@ -0,0 +1,162 @@ +# B04 source binding and verification review + +**Disposition: pass for the stated fixed-witness and conditional scalar +claims, at the version identified in `CORE-SNAPSHOT.json`.** + +This review covers the fixed signed R429 witness, its authenticated historical +replay, the two new independent checkers, and the complete receipt acceptance +mechanism. It was prepared separately with substantial OpenAI Codex assistance. +It is neither human acceptance nor a formal-kernel proof. + +The reviewed package is bounded to one concrete 23-sign change among 47 +quotient ADDs and the stated consequences of its fixed prefix and suffix. +The local integer interface, binary interface, scalar range and scalar defect +model are distinct claims. No sign search, native rounded supplier, general +sign optimum, improved paid rank profile or new multiplication exponent is +established. + +## Source and receipt boundary + +`verify.py` authenticates each registered input before returning its bytes. +Historical replay parses those same bytes and compiles only the explicitly +named top-level function definitions. The original imports, filesystem +constants, entrypoints and search loops are excluded. The selected definitions +were inspected: none uses a decorator or default expression to reintroduce +excluded original execution. Dependencies are explicitly supplied standard +library values and preceding authenticated functions. Function multiplicities +are checked, so missing and duplicate definitions or duplicate requests fail. + +Compilation uses `dont_inherit=True, optimize=0`. Assertions inside extracted +functions and their nested functions remain active under an optimized parent +interpreter. New independent programs are executed from their authenticated +source bytes with `__name__="authenticated_review"` and their actual package +source path. Their main guards do not run during loading; the wrapper explicitly +calls `main` with declared inputs and a fresh external temporary output. +These programs import no producer implementation. There is no frozen module +import or bytecode-cache selection path. + +Compression preserves two different bindings where an original uncompressed +input was wrapped for storage: the manifest authenticates compressed bytes and +`ORIGINS.json` separately authenticates the decompressed original bytes. +Neither a transport hash nor an unchanged JSON value alone substitutes for +the original byte binding. + +The fixed scientific comparison set consists of: + +1. `frozen/candidate/RESULT.json`; +2. `frozen/candidate/GROWTH.json`; +3. `frozen/historical/REPLAY.json`; +4. `frozen/reviews/integer/CHECKS.json.gz`; +5. `frozen/reviews/range/CHECKS.json.gz`. + +Each fresh result is compared in full by canonical JSON serialization. This +retains integer/Boolean/float distinctions, list order and every nested field. +It does not select a convenient subset or compare only a status. Each stage +also requires its exact expected comparison set. A missing fixed receipt +fails; replay writes only a fresh temporary result and never regenerates the +fixed evidence. Root-level manifests, scripts and documentation are covered by +the separate core snapshot and repository publication checks. + +## Mathematical coverage inspected + +Both words have 651 public inputs: 111 sources, 111 targets and 429 arbitrary +dirty helpers. The private coordinate starts at zero. The independent integer +checker evaluates every public coefficient in both orientations and both +roundtrips. It reconstructs the binary source map from the original R438 word, +checks exact MOVE containment and rank, preserves physical endpoint frames, +and enforces immutable copied-source and private-snapshot lifetimes. +ERASE requires literal equality to the original unchanged copied value. + +Thus the integer conclusion is the actual block map +`(x,y,h) -> (A_Z x, y+T_Z x+E_Z h, h)`, with private return and literal inverse. +The even helper block need not vanish and `T_Z` need not equal `A_Z`. +The binary reduction is separately the specified +`(x,y,h) -> (A x, y+A x, h)`. + +The all-sign extension uses an exact forward prefix–quotient–suffix certificate. +The 47 ADD quotient lies on nine coordinates. Its fixed prefix reader `B` +contains no target or dirty columns and has an identity pivot minor; its +fixed suffix transfer is supported only on the nine source rows and three +target rows. The private coordinate is closed at both cuts. Consequently +`Delta A = U Delta Q B`, `Delta T = P3 L Delta Q B` and `Delta E = 0`. +The forward source and target rank bounds are at most 9 and 3 for the same fixed +47-gate sign family. The current determinant `det(Delta Q)=1024` and the +checked minors give exact forward ranks 9 and 3 for this witness. This is a written +linear-algebra implication of finite exact transfer data; it is not an +enumeration of all `2^47` assignments or an optimality theorem. + +The range checker independently reconstructs the full sparse prefix rows and +all suffix destination columns of both actual 651-input words. Scalar sign +witnesses attain the local prefix maxima and the completed-output defect +constants. The controller uses the selected 1,499 ADD source code and its +literal inverse. Its historical 6,372-gate code has a different binary endpoint +and is not substituted into the range calculation. The abstract schedule is +checked on all eight formal bank columns in the free noncommuting polynomial +algebra over GF(2). + +Every ordered controller factor and the current encoded helper magnitudes +enter the scalar recurrence. These are conditional coefficient upper bounds. +The exact atomic defect constant is +`max_r sum_i |(S_i e_dst(i))_r|`, which differs from summing per-event maxima. +COPY and ERASE use their stated linear assignment extension, including +`private <- 0` at ERASE. Setting the ERASE defect to zero does not prove +physically legal rounded cleanup. Native child interiors, error support, +perturbed prefixes, input lattices and finite-precision storage remain separate. + +The comparison is mixed: forward prefix range and forward defect amplification +increase, while the inverse quantities decrease. The inverse MOVE/COPY +aggregate remains 1,239. Only the specified conditional controller range bound +and its stated terminal code extension improve; no global precision admission +follows. + +## Controls and resolved review finding + +Compact controls load the actual verifier and original selected functions. +Disposable fixture files live in external system temporary directories. They +cover changed and missing source, function selection, direct and nested +assertions, whole-module assertion retention, original-main exclusion, +compressed/original byte binding, typed receipts, list order and nested +omissions. The full five real receipts are positively compared, then each +undergoes a nested value mutation and omission. + +The arithmetic control authenticates the original source first and executes +a noncommuting two-ADD source word on all 111 source columns. Replacing inverse +subtraction by addition reaches and fails the real +`signed source-code literal inverse` gate. It is not a hash rejection. +Removing that named gate makes the control fail because the faulty computation +is then accepted. An analogous check-deletion control tests the complete +receipt comparator. Unexpected acceptance is raised outside the caught +rejection branch. + +Review found that the initial integer negative-control helper accepted any +`ValueError`. A failure while preparing a stale snapshot could therefore have +been counted as the intended ERASE rejection. This was corrected before the +final receipt: each exception control now requires its exact intended semantic +error. The compact controls positively check this helper and verify that an +unrelated exception fails its contract. + +The integer checker also supplies actual-word faults for stale COPY state, +live source mutation, private mutation, wrong MOVE rank, inverse-sign error, +changed quotient sign, failed helper restoration, dirty-source contamination +and omitted compensation. The range checker supplies actual-event controls +for the adjoint direction, suffix order, COPY influence and error signs. +All mathematical mutations are applied after input authentication. +The reviewers' receipts identify the corresponding witnesses; transport +authentication failures are not counted as mathematical controls. + +## Evidence and remaining integration boundary + +`CONTROLS.json` records fresh compact execution under normal and optimized +CPython: 34 intended rejections and two check-deletion sensitivity tests in +each mode. Both runs positively compare all five fixed scientific receipts. +`CORE-SNAPSHOT.json` identifies the exact final package files inspected and the +control receipt digest. The compact suite deliberately does not rerun +the historical search or either complete independent mathematical replay. +Those full runs belong to their independent reviewer receipts and to the +parent's registered package verification. + +The snapshot binds the integrated independent sources, receipts, documentation +and registered command manifest. Any change to those bytes requires a scope +refresh; receipt files that contain the snapshot itself are explicitly excluded +to avoid circular hashes. Repository source-history checks, read-only Git-free +export, publication and hosted CI remain separately reported by the parent. diff --git a/research/r429-signed-range/SOURCES.json b/research/r429-signed-range/SOURCES.json new file mode 100644 index 0000000000..a02cfc3f72 --- /dev/null +++ b/research/r429-signed-range/SOURCES.json @@ -0,0 +1,48 @@ +{ + "schema_version": 1, + "base_commit": "12fa8c5c844be21bfefb38a19503fbd867a11244", + "files": [ + { + "path": "certificates/selected-result.json", + "git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81", + "sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129", + "usage": "provenance" + }, + { + "path": "docs/research/agent-task-catalog.json", + "git_blob": "64bfc5af6709ed9811171e0a2108f05e1219cb65", + "sha256": "352a6184713b8843d96fd2c2071eb7aeaa655906b7c51d45ad444912666c8a96", + "usage": "provenance" + }, + { + "path": "docs/research/research-family-status.md", + "git_blob": "abdd2792e6a5596b3fa6be3dc9db882bd8e3ef89", + "sha256": "0e61c47dfbc6f16e5f64594fcc7d907d4187568e38dddf10d473f0992419c44f", + "usage": "provenance" + }, + { + "path": "research/bit-r438-source-code/README.md", + "git_blob": "e501165027be66b75c60b13ed93377c4a58c1d0c", + "sha256": "f1033297e1156f9fb154a4319bee394a82476195cd2a53d01d93ef7332536d27", + "usage": "provenance" + }, + { + "path": "research/bit-r438-source-code/PROOF.md", + "git_blob": "1fbd2cad0e2d14b8fa6432fb5dd9b535882ab2b2", + "sha256": "ebcc91e74938b525b28e46bf03ec09d42d24ab02070dc96f4f0a51cee2cfb83d", + "usage": "provenance" + }, + { + "path": "research/bit-r438-source-code/WORD.json.gz", + "git_blob": "672c41534608d0d812b8020e496177d7c41c8527", + "sha256": "1a6841fccba51fa922993c77b4b296e659c2c538252e5e06113d0438c5edb870", + "usage": "provenance" + }, + { + "path": "research/bit-r438-transport-rehost/words/r438-t154.json.gz", + "git_blob": "e12a566658a4b2c8b6ae0ecc34fd41290f68f5e8", + "sha256": "a353999bceac4ac957f540adfd3e5f8768297138b27132eeb83332e2ea4b1022", + "usage": "provenance" + } + ] +} diff --git a/research/r429-signed-range/TASK.json b/research/r429-signed-range/TASK.json new file mode 100644 index 0000000000..264755fe67 --- /dev/null +++ b/research/r429-signed-range/TASK.json @@ -0,0 +1,90 @@ +{ + "schema_version": 1, + "task_id": "joint-query-controller", + "priority_revision": 7, + "base_commit": "12fa8c5c844be21bfefb38a19503fbd867a11244", + "original_card": { + "id": "joint-query-controller", + "question": "Can the installed QQ16 caller win a complete matched protocol bill, or can a changed demand eliminate actual paid work?", + "starting_points": [ + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "research/qq16-caller-install/README.md" + ], + "methods": [ + "Derive the matched whole-caller physical bill for installed and baseline protocols.", + "Change the actual demanded observations and prove a cheaper legal producer/consumer contract." + ], + "acceptance_gate": "Name the changed premise of the fixed F0/B1 observation obstruction. Show exactly which query is recovered, legal native reads and restoration, and a full favorable budget including cover maps, helpers and endpoints. Local inverse identities alone do not close the global controller. A scoped local result may be retained without a complete supplier. Expanding it into further construction rounds requires the family-level budget and obligation gate in research-family-status.md; an optimistic passing relaxation alone is not acceptance.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read #4166 COST.md and ADMISSION.json. An actual caller connection is now proposed. Its native-component profile loses; parent park/restore versus external-call costs remain unresolved. Retain the producer and recovery lineage rather than rebuild it.", + "scope": "Source-binding orientation only; no scientific replay, theorem acceptance or supplier admission. Budget any heavy replay separately." + }, + "first_experiment": "At the actual installed cut, compare matched complete parent park/restore and external input/return protocols at the same bank/packet geometry, including every later root call and service cost. Alternatively pin both bridge observations and derive a genuinely smaller source-compatible demand. Stop if the complete necessary inequality fails or an essential cost is unknown; no larger decoder scan from a local tape-action saving.", + "bottleneck_link": "The native local words exist; retained query information and its physical access are the missing link to a composed recursive interface.", + "allowed_variations": [ + "One paid query, one changed first pair, or one precisely specified affine helper state.", + "A counterexample or lower bound for that exact proposed repair.", + "One unresolved obligation of a newer local decoder, with exact source heads and a distinct claim/domain." + ], + "scope_change_triggers": [ + "Retaining the fixed first pair and ordinary schedule while allowing only homogeneous selected-only control, already excluded by the witness.", + "Treating cover-map counts as zero-cost physical address operations.", + "Recreating the pending complete local decoder or early-record/output-bank coalescing already under investigation without a distinct audit or changed premise.", + "Treating a completed-output defect inequality as a producer-interior, dirty-range or physical-cost certificate.", + "Recreating completed-output recovery or caller wiring already supplied by #4166 without new independent coverage.", + "Dropping retained later root calls or claiming native-profile dominance from the isolated publication saving." + ], + "overlap_terms": [ + "QQ16", + "joint-query", + "changing-chart controller", + "selected observation", + "1969", + "2540", + "early record", + "output-bank retention", + "complete native decoder", + "2965", + "producer defect", + "dirty-helper range", + "F17 consumer", + "4166", + "qq16-caller-install" + ], + "existing_checks": [ + { + "scope": "PR #4166: author-checked installed producer/service/return/bridge connection; native-component comparison loses.", + "evidence": "research/qq16-caller-install/README.md", + "remaining": "Complete matched physical protocol bill, or changed source-compatible demand/circuit; no affordable supplier yet.", + "status": "author-checked", + "source_commit": "0b082d22a0e9a442d264ab0633e35ef26c790630", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + } + ] + }, + "scope_status": "changed", + "actual_scope": "Audit the fixed 23-sign R429 quotient lift, its complete arbitrary-input integer/F2 map and normalized scalar range/atomic-defect bounds for a precisely selected controller instantiation.", + "scope_change_reason": "Explicit donor assignment to finish unpublished B04 and develop its promising range calculation. This is a finite signed-lift and conditional scalar-network result, not the current QQ16 supplier target.", + "bottleneck_link": "A better integer range envelope does not establish rounded-child stability, exact COPY cleanup under perturbations, or an affordable complete supplier.", + "budget_minutes": 240, + "stop_rule": "Use the saved sign witness only. Bind every result to its actual 651-input word, examine the ordered controller contract and complete atomic suffix weights; no optimization or native precision-admission search.", + "outcome": "partial", + "evidence": "Complete signed receipts, two independent implementations, fixed-prefix/suffix proof and full typed acceptance controls.", + "author": "Ross Richardson", + "ai_assistance": "Substantial OpenAI Codex assistance in original construction, independent mathematical checking contexts and publication. AI review is not human or formal-kernel acceptance.", + "open_questions": [ + { + "question": "Can the signed lift be given a complete rounded native implementation with exact copied-workspace return?", + "why_it_matters": "The forward atomic error constant worsens while the scalar range bound improves. Abstract COPY/ERASE assignments cannot certify physical exact cleanup.", + "first_step": "Specify the admitted input lattice and native child error contract, then prove internal range/grid and exact zero return at every COPY/ERASE cut.", + "blocked_by": "No native child-interior, physical source-access or all-size precision theorem is provided." + } + ] +} diff --git a/research/r429-signed-range/VERIFY.json b/research/r429-signed-range/VERIFY.json new file mode 100644 index 0000000000..a50b76c20e --- /dev/null +++ b/research/r429-signed-range/VERIFY.json @@ -0,0 +1,60 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/verify.py", + "--stage", + "historical" + ], + "timeout_seconds": 120, + "checks": "Fixed 23-sign witness: exact declared record differences, retained complete integer/F2 replays, both original signed receipts and full new range summary; no sign search." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/verify.py", + "--stage", + "integer" + ], + "timeout_seconds": 180, + "checks": "Independent dense all 651-column integer/F2/frame/COPY audit, both roundtrips, attained prefix norms, exact fixed-transfer proof for all 2^47 signs and intended-gate controls." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/verify.py", + "--stage", + "range" + ], + "timeout_seconds": 180, + "checks": "Independent sparse range reconstruction, selected arbitrary-code schedule, all ordered controller factors and complete adjoint/dual/forward defect checks for both actual 651-input words." + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/controls.py", + "--package", + "{package}" + ], + "timeout_seconds": 60, + "checks": "Normal and optimized source-selection/module assertions, compression bindings, all five full typed receipts, semantic inverse-sign control and deleted-check sensitivity." + } + ] +} diff --git a/research/r429-signed-range/controls.py b/research/r429-signed-range/controls.py new file mode 100644 index 0000000000..05cfb826c4 --- /dev/null +++ b/research/r429-signed-range/controls.py @@ -0,0 +1,358 @@ +#!/usr/bin/env python3 +"""Compact B04 source-selection and acceptance controls. + +No historical search or complete word replay is run here. +Prepared for Ross with substantial OpenAI Codex assistance. Apache-2.0. +""" +import argparse +import copy +import gzip +import hashlib +import json +from pathlib import Path +import subprocess +import sys +import tempfile +import types + + +HERE = Path(__file__).resolve().parent + + +def need(condition, message): + if not condition: + raise ValueError(message) + + +def canonical(value): + return json.dumps(value, sort_keys=True, separators=(",", ":")) + + +def sha(raw): + return hashlib.sha256(raw).hexdigest() + + +def load_verifier(package): + path = package / "verify.py" + raw = path.read_bytes() + module = types.ModuleType("b04_control_verifier") + module.__file__ = str(path) + exec(compile(raw, str(path), "exec", dont_inherit=True, optimize=0), module.__dict__) + return module, sha(raw) + + +def reject(name, action, expected, records): + try: + action() + except (ValueError, AssertionError, FileNotFoundError) as error: + need(expected in str(error), f"wrong rejection for {name}: {error}") + records.append({"name": name, "reason": str(error)}) + else: + raise ValueError("control accepted: " + name) + + +def fixture(directory, entries, original=None): + root = Path(directory).resolve() + root.mkdir(parents=True) + hashes, origins = {}, {} + for name, raw in entries.items(): + target = root / name + target.parent.mkdir(parents=True, exist_ok=True) + target.write_bytes(raw) + hashes[name] = sha(raw) + origins[name] = {"sha256": sha(raw)} + if original and name in original: + origins[name]["original_sha256"] = sha(original[name]) + (root / "FROZEN-SHA256.json").write_text(json.dumps(hashes)) + (root / "ORIGINS.json").write_text(json.dumps(origins)) + return root + + +def source_checks(v, temporary): + source = ( + b'import a_module_that_does_not_exist\n' + b'raise RuntimeError("ORIGINAL_TOP_LEVEL_RAN")\n' + b'def chosen(x=3):\n return x + 4\n' + b'def assertion():\n assert False, "EXTRACTED_ASSERT"\n' + b'def nested():\n def inner():\n assert False, "NESTED_ASSERT"\n' + b' return inner()\n' + b'def main():\n raise RuntimeError("ORIGINAL_MAIN_RAN")\n' + b'if __name__ == "__main__":\n main()\n' + ) + root = fixture(temporary / "source", { + "frozen/source.py": source, + "frozen/duplicate.py": b"def duplicate():\n return 1\n" + b"def duplicate():\n return 2\n", + "frozen/module.py": b'assert False, "MODULE_ASSERT"\n', + "frozen/module_main.py": b'VALUE = 7\n' + b'if __name__ == "__main__":\n' + b' raise RuntimeError("ORIGINAL_MAIN_RAN")\n', + }) + f = v.Frozen(root) + f.check_all() + chosen = f.functions("frozen/source.py", ["chosen"], {}) + need(chosen.chosen() == 7 and set(vars(chosen)) == {"chosen"}, + "only declared functions should be exported") + need(f.executed == {"frozen/source.py": ["chosen"]}, "selected-source receipt") + rejected = [] + reject("direct_runtime_gate_under_parent_flags", + lambda: v.need(False, "DIRECT_RUNTIME_GATE"), "DIRECT_RUNTIME_GATE", rejected) + reject("extracted_assert_under_parent_flags", + lambda: f.functions("frozen/source.py", ["assertion"], {}).assertion(), + "EXTRACTED_ASSERT", rejected) + reject("nested_assert_under_parent_flags", + lambda: f.functions("frozen/source.py", ["nested"], {}).nested(), + "NESTED_ASSERT", rejected) + reject("authenticated_module_assert_under_parent_flags", + lambda: f.module("frozen/module.py"), "MODULE_ASSERT", rejected) + module = f.module("frozen/module_main.py") + need(module["VALUE"] == 7 and module["__name__"] == "authenticated_review", + "independent module main exclusion") + (root / "frozen/module.py").write_bytes(b"VALUE = 99\n") + reject("changed_authenticated_module", + lambda: f.module("frozen/module.py"), "frozen input changed", rejected) + reject("missing_named_definition", + lambda: f.functions("frozen/source.py", ["absent"], {}), + "function selection changed", rejected) + reject("duplicate_source_definition", + lambda: f.functions("frozen/duplicate.py", ["duplicate"], {}), + "function selection changed", rejected) + reject("duplicate_requested_name", + lambda: f.functions("frozen/source.py", ["chosen", "chosen"], {}), + "function selection changed", rejected) + reject("unregistered_source", + lambda: f.functions("frozen/unknown.py", ["chosen"], {}), + "unregistered frozen input", rejected) + (root / "frozen/source.py").write_bytes(b"def chosen():\n return 99\n") + reject("changed_authenticated_source", + lambda: f.functions("frozen/source.py", ["chosen"], {}), + "frozen input changed", rejected) + (root / "frozen/source.py").unlink() + reject("missing_registered_source", + lambda: f.functions("frozen/source.py", ["chosen"], {}), + "source.py", rejected) + return {"imports_top_level_and_main_excluded": True, "rejections": rejected} + + +def receipt_checks(v, temporary): + value = {"integer": 1, "boolean": True, "nested": {"ordered": [1, 2, 3]}} + root = fixture(temporary / "receipt", { + "frozen/receipt.json": json.dumps(value).encode(), + }) + f = v.Frozen(root) + f.check_all() + f.compare("frozen/receipt.json", copy.deepcopy(value)) + rejected = [] + mutations = { + "boolean_for_integer": dict(value, integer=True), + "float_for_integer": dict(value, integer=1.0), + "integer_for_boolean": dict(value, boolean=1), + "nested_omission": dict(value, nested={}), + "list_reordering": dict(value, nested={"ordered": [1, 3, 2]}), + "list_truncation": dict(value, nested={"ordered": [1, 2]}), + } + for name, altered in mutations.items(): + reject(name, lambda altered=altered: f.compare("frozen/receipt.json", altered), + "complete receipt mismatch", rejected) + (root / "frozen/receipt.json").unlink() + reject("missing_fixed_receipt", lambda: f.compare("frozen/receipt.json", value), + "receipt.json", rejected) + need(not (root / "frozen/receipt.json").exists(), "missing receipt was regenerated") + (root / "frozen/receipt.json").write_bytes(json.dumps(value).encode()) + saved = v.need + try: + v.need = lambda ok, message: ( + None if message.startswith("complete receipt mismatch") else saved(ok, message)) + try: + reject("disabled_receipt_gate", + lambda: f.compare("frozen/receipt.json", mutations["boolean_for_integer"]), + "complete receipt mismatch", []) + except ValueError as error: + need(str(error) == "control accepted: disabled_receipt_gate", + "receipt check deletion sensitivity") + else: + raise ValueError("receipt mutation survived deletion of its target check") + finally: + v.need = saved + return {"rejections": rejected, "deleted_named_check_detected": True} + + +def compression_checks(v, temporary): + plain = b'{"all":"original bytes","ordered":[1,2,3]}\n' + name = "frozen/original.json.gz" + root = fixture(temporary / "compression", + {name: gzip.compress(plain, mtime=0)}, {name: plain}) + f = v.Frozen(root) + f.check_all() + need(f.decoded(name) == plain, "complete decompression") + rejected = [] + changed = gzip.compress(b'{"all":"different bytes","ordered":[1,2,3]}\n', mtime=0) + (root / name).write_bytes(changed) + reject("changed_compressed_bytes", f.check_all, "frozen input changed", rejected) + # Advance only the storage digest in this disposable fixture. The + # unchanged original digest must independently detect altered payload. + f.hashes[name] = sha(changed) + reject("changed_decompressed_original", f.check_all, + "compressed original bytes changed", rejected) + equivalent = gzip.compress(plain, mtime=17) + (root / name).write_bytes(equivalent) + f.hashes[name] = sha(equivalent) + f.check_all() + need(f.decoded(name) == plain, "equivalent compression rejected") + return {"rejections": rejected, "equivalent_storage_with_same_original_accepted": True} + + +def mathematical_checks(v, package): + frozen = v.Frozen(package) + frozen.check_all() + _, scalar, _, _, _ = v.retained_functions(frozen) + word = [[1, 0, 1, 1, 0, 23], [1, 1, 2, 1, 0, 23]] + records, rows, prefix, norms = scalar.code(word) + need(records == word and prefix == [2, 3] and norms == [2, 3], + "two-ADD source-code positive control") + need(rows[0][0] == {0: 1, 1: 1} and rows[1][0] == {0: 1, 1: -1, 2: 1}, + "noncommuting fixture endpoints") + rejected = [] + reject("self_source_add", lambda: scalar.code([[1, 0, 0, 1, 0, 23]]), + "source code not inplace", rejected) + reject("source_coordinate_outside_bank", lambda: scalar.code([[1, 0, 111, 1, 0, 23]]), + "source code not inplace", rejected) + namespace = scalar.code.__globals__ + saved_add, saved_need = namespace["add"], namespace["need"] + try: + # Source authentication has completed. This is an arithmetic defect + # injected into the executed primitive, not a modified pinned file. + namespace["add"] = lambda a, b, coefficient: saved_add(a, b, abs(coefficient)) + reject("inverse_subtraction_replaced_by_addition", lambda: scalar.code(word), + "signed source-code literal inverse", rejected) + namespace["need"] = lambda ok, message: ( + None if message == "signed source-code literal inverse" else saved_need(ok, message)) + try: + reject("disabled_inverse_gate", lambda: scalar.code(word), + "signed source-code literal inverse", []) + except ValueError as error: + need(str(error) == "control accepted: disabled_inverse_gate", + "mathematical check deletion sensitivity") + else: + raise ValueError("inverse mutation survived deletion of its target check") + finally: + namespace["add"], namespace["need"] = saved_add, saved_need + independent = frozen.module("frozen/reviews/integer/check_integer.py") + def fail(message): + raise ValueError(message) + intended = independent["rejected"]( + "intended_fixture", "INTENDED_GATE", lambda: fail("INTENDED_GATE")) + need(intended["expected_semantic_gate_matched"] is True, + "independent control intended-gate acceptance") + reject("independent_control_rejects_unrelated_exception", + lambda: independent["rejected"]( + "unrelated_fixture", "INTENDED_GATE", lambda: fail("UNRELATED_GATE")), + "negative control reached an unintended gate", rejected) + return {"actual_authenticated_function": "bit_signed_audit.code", + "arbitrary_source_columns": 111, "positive_prefix_norms": prefix, + "rejections": rejected, "deleted_named_check_detected": True} + + +def real_receipts(v, package): + frozen = v.Frozen(package) + names = [ + "frozen/candidate/RESULT.json", + "frozen/candidate/GROWTH.json", + "frozen/historical/REPLAY.json", + "frozen/reviews/integer/CHECKS.json.gz", + "frozen/reviews/range/CHECKS.json.gz", + ] + result = [] + + def leaves(value, path=()): + if isinstance(value, dict): + for key in sorted(value): + yield from leaves(value[key], path + (key,)) + elif isinstance(value, list): + for key, item in enumerate(value): + yield from leaves(item, path + (key,)) + else: + yield path, value + + for name in names: + value = frozen.data(name) + frozen.compare(name, copy.deepcopy(value)) + need(type(value) is dict and len(value) > 1, "real receipt structure") + changed = copy.deepcopy(value) + path, old = max(leaves(value), key=lambda item: len(item[0])) + need(len(path) > 1, "real receipt nested coverage") + parent = changed + for key in path[:-1]: + parent = parent[key] + if type(old) is bool: + parent[path[-1]] = not old + elif type(old) is int: + parent[path[-1]] = old + 1 + elif type(old) is str: + parent[path[-1]] = old + "-MUTATED" + else: + parent[path[-1]] = {"mutated": True} + rejected = [] + reject("real_nested_field_mutation", + lambda: frozen.compare(name, changed), "complete receipt mismatch", rejected) + omitted = copy.deepcopy(value) + parent = omitted + for key in path[:-1]: + parent = parent[key] + del parent[path[-1]] + reject("real_nested_field_omission", + lambda: frozen.compare(name, omitted), "complete receipt mismatch", rejected) + result.append({"receipt": name, "sha256": sha(frozen.raw(name)), + "mutated_nested_path": list(path), "rejections": rejected}) + return result + + +def child(package): + v, verifier_hash = load_verifier(package) + with tempfile.TemporaryDirectory(prefix="b04-controls-") as temp: + temporary = Path(temp).resolve() + result = { + "source_selection": source_checks(v, temporary), + "receipt_contract": receipt_checks(v, temporary), + "compressed_original_binding": compression_checks(v, temporary), + "mathematical_controls": mathematical_checks(v, package), + "complete_real_receipts": real_receipts(v, package), + } + return {"parent_optimization": sys.flags.optimize, "verifier_sha256": verifier_hash, **result} + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--package", type=Path, required=True) + parser.add_argument("--output", type=Path) + parser.add_argument("--child", action="store_true") + args = parser.parse_args() + package = args.package.resolve() + if args.child: + print(canonical(child(package))) + return + before = {name: sha((package / name).read_bytes()) + for name in ("verify.py", "FROZEN-SHA256.json", "ORIGINS.json")} + results = [] + for optimized in (False, True): + command = [sys.executable, "-I", "-B"] + if optimized: + command.append("-O") + command += [str(Path(__file__).resolve()), "--package", str(package), "--child"] + proc = subprocess.run(command, capture_output=True, text=True) + need(proc.returncode == 0, proc.stderr + proc.stdout) + results.append(json.loads(proc.stdout)) + need(all(sha((package / name).read_bytes()) == expected for name, expected in before.items()), + "verification core changed during compact controls") + need(all(x["verifier_sha256"] == before["verify.py"] for x in results), + "mixed verifier versions") + report = {"status": "PASS_B04_COMPACT_SOURCE_AND_MATHEMATICAL_GATES", + "source_hashes": before, "runs": results, + "full_word_or_search_replayed": False, "no_new_kappa": True} + if args.output: + args.output.write_text(json.dumps(report, sort_keys=True, indent=2) + "\n") + print(canonical(report)) + + +if __name__ == "__main__": + main() diff --git a/research/r429-signed-range/frozen/candidate/GROWTH.json b/research/r429-signed-range/frozen/candidate/GROWTH.json new file mode 100644 index 0000000000..c66a6de5be --- /dev/null +++ b/research/r429-signed-range/frozen/candidate/GROWTH.json @@ -0,0 +1,72 @@ +{ + "status": "NORMALIZED_SIGN_VARIANT_GROWTH_ONLY_NO_NATIVE_CHILD_ERROR_ADMISSION", + "word_canonical_sha256": "127f48ecae91547e90bd2e64769f222cb17601ab36edcfdfdb0fce6f2d1bd9b7", + "local_prefix": [ + 80639, + 239014 + ], + "code_prefix": [ + 15675, + 5521 + ], + "code_endpoint_norm": [ + 15675, + 5521 + ], + "whole_controller": { + "ordered_extra_code_counts": { + "forward_code": 35, + "inverse_code": 28, + "local_forward": 5, + "local_inverse": 4, + "scalar_bridge_shears": 18 + }, + "all63_code_factors_included": true, + "encoded_hosted_helper_inputs_bounded": true, + "weighted_global_prefix_upper": "4397932634265163211032730652944159284930493151000948442490115944709633826750504698384173944667730137152495901661848717130", + "weighted_global_prefix_upper_bits": 401, + "charge_rounded_up_to_64_bits": 448, + "crude_product_prefix_upper_bits": 1007, + "after_easy_completed_bank_decode_upper_bits": 519, + "local_stage_checkpoints": [ + { + "stage": 0, + "prefix_upper_bits": 87 + }, + { + "stage": 1, + "prefix_upper_bits": 105 + }, + { + "stage": 2, + "prefix_upper_bits": 134 + }, + { + "stage": 3, + "prefix_upper_bits": 221 + }, + { + "stage": 4, + "prefix_upper_bits": 249 + }, + { + "stage": 5, + "prefix_upper_bits": 310 + }, + { + "stage": 6, + "prefix_upper_bits": 339 + }, + { + "stage": 7, + "prefix_upper_bits": 373 + }, + { + "stage": 8, + "prefix_upper_bits": 401 + } + ], + "norm_proof": "owner/address permutations are isometries; each hosted helper is bounded by the largest current encoded DATA-bank norm. Use exact local block-prefix envelopes, exact source code prefix norm, endpoint block norms and triangle inequalities at actual bridges", + "limits": "terminal hole decoder omitted; tape, native child interior defect and all-size rounded-interface theorem remain separate" + } +} diff --git a/research/r429-signed-range/frozen/candidate/RESULT.json b/research/r429-signed-range/frozen/candidate/RESULT.json new file mode 100644 index 0000000000..5fd8b6ae38 --- /dev/null +++ b/research/r429-signed-range/frozen/candidate/RESULT.json @@ -0,0 +1,109 @@ +{ + "status": "PASS_LOCAL_INTEGER_SIGN_VARIANT_SAME_F2_AND_RANK_NO_PRECISION_ADMISSION", + "parent_sha256": "1a6841fccba51fa922993c77b4b296e659c2c538252e5e06113d0438c5edb870", + "word_sha256": "e802611104c61fc8477837b4ab41abc4f13cf41fbca6ef3de60d0b5e768fb949", + "word_canonical_sha256": "127f48ecae91547e90bd2e64769f222cb17601ab36edcfdfdb0fce6f2d1bd9b7", + "original_small_score": [ + 442, + 33150, + 517, + 517 + ], + "new_small_score": [ + 9, + 63, + 16, + 13 + ], + "quotient_signs": [ + -1, + 1, + 1, + -1, + -1, + -1, + 1, + -1, + 1, + -1, + -1, + 1, + 1, + 1, + 1, + -1, + 1, + -1, + -1, + 1, + -1, + -1, + 1, + 1, + -1, + -1, + 1, + 1, + -1, + 1, + -1, + 1, + 1, + 1, + 1, + -1, + -1, + 1, + -1, + -1, + 1, + -1, + 1, + -1, + 1, + -1, + 1 + ], + "changed_gates": 23, + "forward": { + "prefix_row_l1": 80639, + "profile": { + "1": 1298, + "2": 1342, + "3": 79, + "4": 44, + "5": 93, + "6": 11, + "7": 9 + }, + "rank_mass": 4989, + "copies": 3, + "counts": { + "0": 2873, + "1": 13223, + "2": 3, + "3": 3 + } + }, + "inverse": { + "prefix_row_l1": 239014, + "profile": { + "1": 1298, + "2": 1342, + "3": 79, + "4": 44, + "5": 93, + "6": 11, + "7": 9 + }, + "rank_mass": 4989, + "copies": 3, + "counts": { + "0": 2873, + "1": 13223, + "2": 3, + "3": 3 + } + }, + "scope": "47fixedbinaryquotientgates only; all651integer/F2columns andhelpers. Notthepublishedword; no globalprecision/stock/controller/tape or kappa." +} diff --git a/research/r429-signed-range/frozen/candidate/WORD.json.gz b/research/r429-signed-range/frozen/candidate/WORD.json.gz new file mode 100644 index 0000000000..b03a46ddf9 Binary files /dev/null and b/research/r429-signed-range/frozen/candidate/WORD.json.gz differ diff --git a/research/r429-signed-range/frozen/controller/WORD.json.gz b/research/r429-signed-range/frozen/controller/WORD.json.gz new file mode 100644 index 0000000000..ec3510a9a7 Binary files /dev/null and b/research/r429-signed-range/frozen/controller/WORD.json.gz differ diff --git a/research/r429-signed-range/frozen/geometry/MATRICES.json.gz b/research/r429-signed-range/frozen/geometry/MATRICES.json.gz new file mode 100644 index 0000000000..21d07202a3 Binary files /dev/null and b/research/r429-signed-range/frozen/geometry/MATRICES.json.gz differ diff --git a/research/r429-signed-range/frozen/geometry/WORD.json.gz b/research/r429-signed-range/frozen/geometry/WORD.json.gz new file mode 100644 index 0000000000..e12a566658 Binary files /dev/null and b/research/r429-signed-range/frozen/geometry/WORD.json.gz differ diff --git a/research/r429-signed-range/frozen/historical/REPLAY.json b/research/r429-signed-range/frozen/historical/REPLAY.json new file mode 100644 index 0000000000..f8d3ff2509 --- /dev/null +++ b/research/r429-signed-range/frozen/historical/REPLAY.json @@ -0,0 +1,177 @@ +{ + "status": "PASS_FIXED_SIGNED_WITNESS_AND_NORMALIZED_RANGE", + "baseline": { + "local_prefix": [ + 34285, + 5839860 + ], + "code_prefix": [ + 22961, + 136165 + ], + "code_endpoint_norm": [ + 12711, + 136165 + ], + "whole_controller": { + "ordered_extra_code_counts": { + "forward_code": 35, + "inverse_code": 28, + "local_forward": 5, + "local_inverse": 4, + "scalar_bridge_shears": 18 + }, + "all63_code_factors_included": true, + "encoded_hosted_helper_inputs_bounded": true, + "weighted_global_prefix_upper": "447400096150467723888121001604673621387130019890534559258613673060855207829528430254137867461796135911414112813000628304725960515036268750", + "weighted_global_prefix_upper_bits": 458, + "charge_rounded_up_to_64_bits": 512, + "crude_product_prefix_upper_bits": 1168, + "after_easy_completed_bank_decode_upper_bits": 601, + "local_stage_checkpoints": [ + { + "stage": 0, + "prefix_upper_bits": 100 + }, + { + "stage": 1, + "prefix_upper_bits": 123 + }, + { + "stage": 2, + "prefix_upper_bits": 155 + }, + { + "stage": 3, + "prefix_upper_bits": 254 + }, + { + "stage": 4, + "prefix_upper_bits": 287 + }, + { + "stage": 5, + "prefix_upper_bits": 355 + }, + { + "stage": 6, + "prefix_upper_bits": 388 + }, + { + "stage": 7, + "prefix_upper_bits": 426 + }, + { + "stage": 8, + "prefix_upper_bits": 458 + } + ], + "norm_proof": "owner/address permutations are isometries; each hosted helper is bounded by the largest current encoded DATA-bank norm. Use exact local block-prefix envelopes, exact source code prefix norm, endpoint block norms and triangle inequalities at actual bridges", + "limits": "terminal hole decoder omitted; tape, native child interior defect and all-size rounded-interface theorem remain separate" + }, + "terminal_64_bit_reserve": 640 + }, + "candidate": { + "local_prefix": [ + 80639, + 239014 + ], + "code_prefix": [ + 15675, + 5521 + ], + "code_endpoint_norm": [ + 15675, + 5521 + ], + "whole_controller": { + "ordered_extra_code_counts": { + "forward_code": 35, + "inverse_code": 28, + "local_forward": 5, + "local_inverse": 4, + "scalar_bridge_shears": 18 + }, + "all63_code_factors_included": true, + "encoded_hosted_helper_inputs_bounded": true, + "weighted_global_prefix_upper": "4397932634265163211032730652944159284930493151000948442490115944709633826750504698384173944667730137152495901661848717130", + "weighted_global_prefix_upper_bits": 401, + "charge_rounded_up_to_64_bits": 448, + "crude_product_prefix_upper_bits": 1007, + "after_easy_completed_bank_decode_upper_bits": 519, + "local_stage_checkpoints": [ + { + "stage": 0, + "prefix_upper_bits": 87 + }, + { + "stage": 1, + "prefix_upper_bits": 105 + }, + { + "stage": 2, + "prefix_upper_bits": 134 + }, + { + "stage": 3, + "prefix_upper_bits": 221 + }, + { + "stage": 4, + "prefix_upper_bits": 249 + }, + { + "stage": 5, + "prefix_upper_bits": 310 + }, + { + "stage": 6, + "prefix_upper_bits": 339 + }, + { + "stage": 7, + "prefix_upper_bits": 373 + }, + { + "stage": 8, + "prefix_upper_bits": 401 + } + ], + "norm_proof": "owner/address permutations are isometries; each hosted helper is bounded by the largest current encoded DATA-bank norm. Use exact local block-prefix envelopes, exact source code prefix norm, endpoint block norms and triangle inequalities at actual bridges", + "limits": "terminal hole decoder omitted; tape, native child interior defect and all-size rounded-interface theorem remain separate" + }, + "terminal_64_bit_reserve": 576 + }, + "full_signed_receipts_compared": [ + "frozen/candidate/GROWTH.json", + "frozen/candidate/RESULT.json" + ], + "executed_original_functions": { + "frozen/old/bit_cap_copy_local.py": [ + "need", + "canonical", + "rank" + ], + "frozen/old/bit_signed_audit.py": [ + "identity", + "add", + "row_weights", + "parity", + "block_norms", + "code", + "global_bound" + ], + "frozen/old/bit_prune_audit.py": [ + "execute" + ], + "frozen/old/bit_pruned_growth.py": [ + "coefficients" + ], + "frozen/old/signed_quotient_search.py": [ + "score" + ] + }, + "search_repeated": false, + "controller_contract": "Instantiate each abstract ordered code sweep with this word's actual 1499 source ADDs or their literal inverse; legacy inplace_code_CNOTs are not the selected integer code.", + "no_precision_admission": true +} diff --git a/research/r429-signed-range/frozen/old/bit_cap_copy_local.py b/research/r429-signed-range/frozen/old/bit_cap_copy_local.py new file mode 100644 index 0000000000..679be90ff9 --- /dev/null +++ b/research/r429-signed-range/frozen/old/bit_cap_copy_local.py @@ -0,0 +1,162 @@ +#!/usr/bin/env python3 +"""Local-only exact native cap-copy audit, independent of any controller. + +Inputs are the pinned R438 word and frozen signed six-copy local word. The +16-column ADDRESS identities hold over every odd field where dyadic entries +are interpreted. Scalar integer cleanup and rounded child errors are separate. +Apache-2.0; substantial OpenAI Codex assistance. +""" + +import argparse +from collections import Counter +from fractions import Fraction as Q +import gzip +from hashlib import sha256 +import json +from pathlib import Path + +HERE = Path(__file__).resolve().parent +RAW = Path('/Users/ross/git/math/integer-mult-bounds/research/bit-r438-transport-rehost/words/r438-t154.json.gz') +RAW_SHA = 'a353999bceac4ac957f540adfd3e5f8768297138b27132eeb83332e2ea4b1022' + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +def canonical(value): + return json.dumps(value, sort_keys=True, separators=(',', ':')).encode() + + +def rank(rows): + basis = {} + for row in rows: + row = list(map(Q, row)) + for j, old in sorted(basis.items()): + c = row[j] + row = [x-c*y for x,y in zip(row,old)] + j = next((j for j,x in enumerate(row) if x), None) + if j is not None: + c = row[j] + basis[j] = [x/c for x in row] + return len(basis) + + +def identity(n): + return [[Q(i == j) for j in range(n)] for i in range(n)] + + +def multiply(a, b): + return [[sum(x*y for x,y in zip(row,col)) for col in zip(*b)] for row in a] + + +def exchange(u): + c = [[Q(i == j)-u[i][j] for j in range(8)] for i in range(8)] + return [c[i]+u[i] for i in range(8)]+[u[i]+c[i] for i in range(8)] + + +def address_identities(word): + ident = identity(8) + out = [] + for p, q in enumerate(word['lines']): + need(sum(x*x for x in q) == 4, 'actual E8 root norm') + start = [word['lines'][j] for j in word['frames'][word['start'][p]]] + cap = [word['lines'][j] for j in word['frames'][word['final'][111+p]]] + need(rank(start) == 1 and all(all(4*x == sum(a*b for a,b in zip(row,q))*y + for x,y in zip(row,q)) for row in start), 'actual entrance is not P_p') + need(rank(cap) == 7 and all(sum(x*y for x,y in zip(row,q)) == 0 for row in cap), + 'actual target cap is not K_p') + proj = [[Q(x*y,4) for y in q] for x in q] + complement = [[ident[i][j]-proj[i][j] for j in range(8)] for i in range(8)] + need(multiply(proj,proj) == proj and rank(proj) == 1, 'actual P_p projector') + need(multiply(exchange(ident),exchange(proj)) == exchange(complement), + 'D_I D_P differs from D_K') + need(multiply(exchange(proj),exchange(proj)) == identity(16), 'D_P squared differs from I') + encoded = [[[v.numerator,v.denominator] for v in row] for row in proj] + out.append(sha256(canonical(encoded)).hexdigest()) + need(len(out) == 111, 'actual punctured root count') + return out + + +def frame_replay(word, program, backward=False, fault=None): + dims = [rank(word['lines'][j] for j in f) for f in word['frames']] + masks = [sum(1 << j for j in f) for f in word['frames']] + need(dims[1] == 8, 'named FULL is not full') + frames = (word['final'] if backward else word['start'])[:]+[None] + open_source, copies, erases = None, [], 0 + paid = Counter() + rows = list(reversed(program['records'])) if backward else program['records'] + for raw in rows: + op,x,y,c,f,phase = raw + if op == 0: + old,new = (c,y) if backward else (y,c) + lo,hi = (new,old) if backward else (old,new) + need(frames[x] == old, 'MOVE source frame') + need(not masks[lo] & ~masks[hi] and dims[hi]-dims[lo] == f > 0, 'MOVE rank or containment') + frames[x] = new + paid[f] += 1 + elif op == 1: + need(x < 660 and x != y and frames[x] == frames[y] == f, 'ADD common frame') + need(open_source != x, 'immutable copied source changed') + elif op == (3 if backward else 2): + need(open_source is None and y == 660 and frames[660] is None, 'COPY fresh private field') + if fault == 'copy_to_full': + f = 1 + need(frames[x] == c == 1 and not masks[f] & ~masks[c], 'COPY source FULL and target nested') + need(dims[c]-dims[f] == 1, 'COPY does not use rank-one cap descent') + frames[660],open_source = f,x + copies.append({'source':x,'source_frame':c,'private_frame':f,'rank':1}) + paid[1] += 1 + else: + need(op == (2 if backward else 3), 'unknown native opcode') + need(open_source == x and y == 660 and frames[x] == c and frames[660] == f, + 'ERASE original snapshot source/frame') + frames[660],open_source = None,None + erases += 1 + need(open_source is None and frames[:660] == (word['start'] if backward else word['final']), 'native endpoint') + need(len(copies) == erases == 6, 'six closed immutable snapshots') + return {'copies':copies,'literal_erases':erases,'paid_profile':dict(sorted(paid.items())), + 'maximum_simultaneous_private_snapshots':1} + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--write', action='store_true') + args = parser.parse_args() + raw = RAW.read_bytes() + need(sha256(raw).hexdigest() == RAW_SHA, 'R438 source pin') + word = json.loads(gzip.decompress(raw)) + meta = json.loads((HERE/'BIT-SIGNED-INPUT.json').read_bytes()) + packed = (HERE/'BIT-SIGNED-INPUT-WORD.json.gz').read_bytes() + decoded = gzip.decompress(packed) + need(sha256(packed).hexdigest() == meta['word_gzip_sha256'] and + sha256(decoded).hexdigest() == meta['word_canonical_sha256'], 'frozen signed word pin') + program = json.loads(decoded) + need(program['start'] == word['start'] and program['final'] == word['final'], 'retained native boundaries') + projectors = address_identities(word) + forward,backward = frame_replay(word,program),frame_replay(word,program,True) + try: + frame_replay(word,program,fault='copy_to_full') + except ValueError as error: + negative = str(error) + else: + raise ValueError('rank-zero FULL copy mutation escaped') + receipt = {'status':'PASS_LOCAL_SIX_CAP_COPY_NATIVE_CONTRACT', + 'raw_R438_gzip_sha256':RAW_SHA,'signed_word_canonical_sha256':meta['word_canonical_sha256'], + 'actual_port_count':111,'actual_entrance_and_target_frames':222, + 'projector_sha256':projectors,'address_identity_columns':3552, + 'forward':forward,'literal_inverse':backward,'negative_control':negative, + 'domain':'Exact dyadic projectors and ADDRESS matrices; every odd modulus where their dyadic coefficients are interpreted. VALUE scalar identity and native recursive child errors are separate.', + 'source_role_rule':'COPY may read an actual source field or an arbitrary helper, provided the physical source stays unchanged until ERASE. No helper-only restriction is used.', + 'limits':['local native/frame contract only','no global controller, endpoint decoder, owner allocation, precision theorem, tape bound or kappa claim']} + path = HERE/'BIT-CAP-COPY-LOCAL.json' + if args.write: + path.write_text(json.dumps(receipt,sort_keys=True,indent=2)+'\n') + else: + need(json.loads(path.read_bytes()) == json.loads(canonical(receipt)), 'complete cap-copy receipt differs') + print(receipt['status']) + + +if __name__ == '__main__': + main() diff --git a/research/r429-signed-range/frozen/old/bit_prune_audit.py b/research/r429-signed-range/frozen/old/bit_prune_audit.py new file mode 100644 index 0000000000..3d8f7ec651 --- /dev/null +++ b/research/r429-signed-range/frozen/old/bit_prune_audit.py @@ -0,0 +1,160 @@ +#!/usr/bin/env python3 +"""Independent deletion of unread R438 factory leaves, complete651-column audit. + +The discarded physical families are not retained with wrong endpoint frames. +Every surviving record is the literal projected support-code signed word. +Apache-2.0; substantial OpenAI Codex assistance. +""" + +import argparse +from collections import Counter +import gzip +from hashlib import sha256 +import json +from pathlib import Path +import sys + +sys.dont_write_bytecode = True +sys.path.insert(0,str(Path(__file__).resolve().parent)) +import bit_cap_copy_local as cap +import bit_signed_audit as scalar +import bit_raw_defect as algebra + +HERE = Path(__file__).resolve().parent +need = cap.need + + +def projected(program): + dead = [h for h in range(222,660) + if all(not(op == 1 and s == h or op in (2,3) and d == h) + for op,d,s,c,f,p in program['records'])] + need(dead == list(range(471,480)),'unread physical helper classification') + dead_set = set(dead) + keep = [p for p in range(660) if p not in dead_set] + mapping = {old:new for new,old in enumerate(keep)} + mapping[660] = len(keep) + records = [] + removed = Counter() + for op,d,s,c,f,p in program['records']: + if d in dead_set: + need(op in (0,1),'discarded helper has an owned snapshot role') + if op == 0: + removed[f] += 1 + continue + need(op == 0 or s not in dead_set,'remaining record reads discarded input') + records.append([op,mapping[d],s if op == 0 else mapping[s],c,f,p]) + return keep,records,dict(sorted(removed.items())) + + +def execute(word,keep,records,backward=False,initial=None): + n = len(keep) + rows = ([{i:1} for i in range(n)]+[{}]) if initial is None else [r.copy() for r in initial] + frames = [word['final' if backward else 'start'][i] for i in keep]+[None] + dims = [cap.rank(word['lines'][j] for j in f) for f in word['frames']] + masks = [sum(1 << j for j in f) for f in word['frames']] + opened,copies,prefix = None,0,1 + profile,counts = Counter(),Counter() + for op,d,s,c,f,p in reversed(records) if backward else records: + counts[op] += 1 + if op == 0: + old,new = (c,s) if backward else (s,c) + lo,hi = (new,old) if backward else (old,new) + need(frames[d] == old and not masks[lo] & ~masks[hi] and dims[hi]-dims[lo] == f > 0,'projected MOVE frame/rank') + frames[d] = new + profile[f] += 1 + elif op == 1: + need(d < n and d != s and frames[d] == frames[s] == f and d != opened,'projected common-frame ADD or snapshot source mutation') + rows[d] = scalar.add(rows[d],rows[s],-c if backward else c) + prefix = max(prefix,sum(abs(v) for v in rows[d].values())) + elif op == (3 if backward else 2): + need(opened is None and s == n and not rows[n] and frames[n] is None,'projected fresh private field') + need(d < 111 and frames[d] == c == 1 and not masks[f] & ~masks[c] and dims[c]-dims[f] == 1,'projected actual source cap COPY') + rows[n],frames[n],opened = rows[d].copy(),f,d + profile[1] += 1 + copies += 1 + else: + need(op == (2 if backward else 3) and opened == d and s == n and rows[n] == rows[d] and frames[d] == c and frames[n] == f,'projected immutable snapshot ERASE') + rows[n],frames[n],opened = {},None,None + need(opened is None and not rows[n] and frames[n] is None and copies == 3,'projected private endpoint') + need(frames[:n] == [word['start' if backward else 'final'][i] for i in keep],'retained physical endpoint frames') + need(profile == Counter({1:1298,2:1342,3:79,4:44,5:93,6:11,7:9}),'projected paid profile') + need(counts == Counter({0:2873,1:13223,2:3,3:3}),'projected literal record counts') + return rows,{'prefix_row_l1':prefix,'profile':dict(sorted(profile.items())), + 'rank_mass':sum(k*v for k,v in profile.items()),'copies':copies, + 'counts':dict(sorted(counts.items()))} + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--write',action='store_true') + args = parser.parse_args() + packed = (HERE/'BIT-SUPPORT-INPUT-WORD.json.gz').read_bytes() + need(sha256(packed).hexdigest() == '6e4e79c3d4fc9f8d01e3c2429d6794c057214f5bae9f8ab86c03d549f01922f1','frozen support-code word pin') + program = json.loads(gzip.decompress(packed)) + raw = cap.RAW.read_bytes() + need(sha256(raw).hexdigest() == cap.RAW_SHA,'raw R438 source pin') + word = json.loads(gzip.decompress(raw)) + keep,records,removed = projected(program) + need(len(keep) == 651 and removed == {1:27,5:9},'physical family/paid removal') + frozen = json.loads((HERE/'BIT-THREE-ROW-INPUT.json').read_bytes())['matrices'] + w = frozen['K'][:] + for p in (0,1,2): + w[p] = 0 + a = [r ^ (1 << p) for p,r in enumerate(algebra.product(w,frozen['R']))] + ainv = algebra.inverse(a) + code_records,code_rows,code_prefix,code_norm = scalar.code(records) + need(len(code_records) == 1499 and scalar.parity(code_rows[0]) == a and scalar.parity(code_rows[1]) == ainv,'projected exact source code') + receipts,outputs = [],[] + for backward in (False,True): + rows,receipt = execute(word,keep,records,backward) + need(rows[:111] == code_rows[int(backward)],'source has dirt/target dependence') + expected = [1 << p for p in range(651)]+[0] + for p in range(111): + expected[p] = ainv[p] if backward else a[p] + expected[111+p] ^= (1 << p) if backward else a[p] + need(rows[111+p].get(111+p) == 1 and all(j < 111 or j == 111+p or j >= 222 for j in rows[111+p]),'integer target self block') + need(all(not c & 1 for j,c in rows[111+p].items() if j >= 222),'integer odd helper leakage') + need(scalar.parity(rows) == expected,'all651 arbitrary binary input columns') + for h in range(222,651): + need(rows[h] == {h:1},'all429 arbitrary dirty helpers restored over Z') + outputs.append(rows) + receipts.append(receipt) + roundtrip,_ = execute(word,keep,records,True,outputs[0]) + need(roundtrip == [{i:1} for i in range(651)]+[{}],'full651-column integer roundtrip') + # A surviving target read of a removed leaf would invalidate the structural + # proof before any projected algebra could be evaluated. + bad = dict(program) + bad['records'] = program['records']+[[1,111,471,1,0,99]] + try: + projected(bad) + except ValueError as error: + control = str(error) + else: + raise ValueError('restored dead-leaf read mutation escaped') + receipt = {'status':'PASS_INDEPENDENT_NINE_DEAD_HELPER_REMOVAL_651_COLUMNS_LOCAL_ONLY', + 'input_support_word_sha256':sha256(gzip.decompress(packed)).hexdigest(), + 'projected_records_sha256':sha256(cap.canonical(records)).hexdigest(), + 'projected_start_sha256':sha256(cap.canonical([word['start'][p] for p in keep])).hexdigest(), + 'projected_final_sha256':sha256(cap.canonical([word['final'][p] for p in keep])).hexdigest(), + 'discarded_old_physical_families':list(range(471,480)), + 'retained_old_physical_families':keep,'new_public_families':651,'new_dirty_helpers':429, + 'removed_profile':removed,'removed_rank_mass':72, + 'saved_rank_mass_from_R438':132,'remaining_profile_mass':4989, + 'forward':receipts[0],'literal_inverse':receipts[1], + 'all651_integer_roundtrip':True,'source_code_exact_prefix':code_prefix, + 'source_code_endpoint_norm':code_norm,'negative_control':control, + 'owner_scope':'Restricting an old legal owner assignment to surviving helper occurrences preserves all old owner windows; no stronger rehosting or terminal-child allocation is asserted.', + 'limits':['the nine physical families are deleted, so their former0-to-FULL endpoints are no longer requested', + 'exact native cap identities inherited from separately audited actual111 root projectors', + 'terminal decoder, new stock recurrence, rounded child errors, source/tape work and joint kappa admission remain open']} + path = HERE/'BIT-PRUNE-AUDIT.json' + if args.write: + path.write_text(json.dumps(receipt,sort_keys=True,indent=2)+'\n') + else: + need(json.loads(path.read_bytes()) == json.loads(cap.canonical(receipt)),'complete pruned local receipt differs') + print(receipt['status']) + print('helpers429; localmass4989; saving132; exact prefixes',receipts[0]['prefix_row_l1'],receipts[1]['prefix_row_l1']) + + +if __name__ == '__main__': + main() diff --git a/research/r429-signed-range/frozen/old/bit_pruned_growth.py b/research/r429-signed-range/frozen/old/bit_pruned_growth.py new file mode 100644 index 0000000000..1dc21eaa8f --- /dev/null +++ b/research/r429-signed-range/frozen/old/bit_pruned_growth.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python3 +"""Normalized coefficient growth for the429-helper common-code controller. + +All63 added codes and encoded hosted-helper magnitudes are included. Native +child interiors, rounding defects and physical tape work remain separate. +Apache-2.0; substantial OpenAI Codex assistance. +""" + +import argparse +import gzip +from hashlib import sha256 +import json +from pathlib import Path +import sys + +sys.dont_write_bytecode = True +sys.path.insert(0,str(Path(__file__).resolve().parent)) +import bit_cap_copy_local as cap +import bit_prune_audit as prune +import bit_signed_audit as scalar + +HERE = Path(__file__).resolve().parent +need = cap.need + + +def coefficients(records,backward=False): + rows = [{i:1} for i in range(651)]+[{}] + prefix = 1 + envelope = {(1,0,0),(0,1,0),(0,0,1)} + for op,d,s,c,f,p in reversed(records) if backward else records: + if op == 1: + rows[d] = scalar.add(rows[d],rows[s],-c if backward else c) + weights = scalar.row_weights(rows[d]) + envelope.add(weights) + prefix = max(prefix,sum(weights)) + elif op == (3 if backward else 2): + rows[651] = rows[d].copy() + elif op == (2 if backward else 3): + rows[651] = {} + return rows,prefix,envelope + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--write',action='store_true') + args = parser.parse_args() + packed = (HERE/'BIT-SUPPORT-INPUT-WORD.json.gz').read_bytes() + need(sha256(packed).hexdigest() == '6e4e79c3d4fc9f8d01e3c2429d6794c057214f5bae9f8ab86c03d549f01922f1','support input pin') + program = json.loads(gzip.decompress(packed)) + keep,records,_ = prune.projected(program) + need(len(keep) == 651,'pruned word arity') + f,F,ef = coefficients(records) + r,R,er = coefficients(records,True) + codes,code_rows,code_prefix,code_norm = scalar.code(records) + need(len(codes) == 1499 and [F,R] == [34285,5839860],'local literal word changed') + ordered_path = HERE/'BIT-NATIVE-CONTROLLER-WORD.json' + ordered = json.loads(ordered_path.read_bytes())['ordered_controller'] + bound = scalar.global_bound(ordered,[scalar.block_norms(f),scalar.block_norms(r)], + [F,R],[ef,er],code_prefix,code_norm) + # Each terminal DATA bank gets exactly the same nine inverse G factors. + # N is an isometry under the normalized native permutation contract, so + # adding the two physical N wrappers does not enlarge this external scalar + # row bound. This deliberately does not bound a child's internal lift. + terminal = bound['after_easy_completed_bank_decode_upper_bits'] + owner = json.loads((HERE/'BIT-OWNER-PRUNE.json').read_bytes()) + excess = owner['pruned_plus_two_N_mass']-64*28416 + need(excess == 864,'complete terminal rank mass') + data = {'status':'PASS_PRUNED_CONTROLLER_NORMALIZED_GROWTH_TWO_N_COST_FAILS', + 'input_support_word_sha256':sha256(gzip.decompress(packed)).hexdigest(), + 'projected_records_sha256':sha256(cap.canonical(records)).hexdigest(), + 'ordered_common_code_controller_sha256':sha256(ordered_path.read_bytes()).hexdigest(), + 'source_code_ADDs':len(codes),'source_code_exact_prefix':code_prefix, + 'source_code_endpoint_norm':code_norm,'local_exact_prefix':[F,R], + 'local_block_norms':[scalar.block_norms(f),scalar.block_norms(r)], + 'local_prefix_envelopes':[sorted(ef),sorted(er)], + 'whole63_code_controller':bound, + 'with_all8_terminal_bank_decodes_normalized_prefix_bits':terminal, + 'terminal_normalized_round_up_to64_bits':64*((terminal+63)//64), + 'literal_scalar_ADDs_per_nine_call_replica':{ + 'nine_complete_local_words':9*13223, + '63_extra_source_codes':63*1499, + '18_ordinary_bank_shears_over111_ports':18*111, + '72_terminal_bank_code_factors':72*1499, + 'total_including_terminal':9*13223+63*1499+18*111+72*1499}, + 'terminal_rank1_children_per_replica':888, + 'whole_rank_mass_exceeds64W_at_beta0_by':excess, + 'all_nonnegative_exponent_failure_proof':'Every complete child tariff is at least its rank for beta>=0. The included local, restricted-owner idle and888-per-replica terminal children already have rank mass64W+864, before fallback. Thus this particular two-N completion cannot pass the modern recurrence at any beta>=0.', + 'limits':['601-bit terminal upper and640-bit reserve cover normalized external scalar coefficients only', + 'native child internal amplification, rounded MOVE/COPY defects, exact COPY reuse and all-size precision admission are not supplied', + 'physical source/address access and finite tape return are still paid obligations', + 'two-N mass failure concerns this complete W28416 construction, not every terminal decoder or changed recursive interface']} + path = HERE/'BIT-PRUNED-GROWTH.json' + if args.write: + path.write_text(json.dumps(data,sort_keys=True,indent=2)+'\n') + else: + need(json.loads(path.read_bytes()) == json.loads(cap.canonical(data)),'complete pruned growth receipt differs') + print(data['status']) + print('common controller458bits; terminal601bits normalized; rankmass exceeds64W by864') + + +if __name__ == '__main__': + main() diff --git a/research/r429-signed-range/frozen/old/bit_signed_audit.py b/research/r429-signed-range/frozen/old/bit_signed_audit.py new file mode 100644 index 0000000000..b147c4c6e9 --- /dev/null +++ b/research/r429-signed-range/frozen/old/bit_signed_audit.py @@ -0,0 +1,237 @@ +#!/usr/bin/env python3 +"""Independent exact signed local replay and whole added-code growth bound. + +The original-window controller is proved over binary VALUES. The integer +program is its literal signed lift, with no assertion that its global integer +endpoint is the binary identity. Prefix row-norms give a separate bound valid +under isometric owner/address permutations. No endpoint decoder is assumed. +Apache-2.0; substantial OpenAI Codex assistance. +""" + +import argparse +from collections import Counter +import gzip +from hashlib import sha256 +import json +from pathlib import Path + + +HERE = Path(__file__).resolve().parent +N, V = 660, 111 + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +def canonical(value): + return json.dumps(value, sort_keys=True, separators=(',', ':')).encode() + + +def identity(n): + return [{i: 1} for i in range(n)] + [{}] + + +def add(a, b, c): + output = a.copy() + for j, value in b.items(): + output[j] = output.get(j, 0) + c * value + if not output[j]: + del output[j] + return output + + +def row_weights(row): + return tuple(sum(abs(c) for j,c in row.items() if low <= j < high) + for low,high in ((0,V),(V,2*V),(2*V,N))) + + +def replay(records, backward=False, initial=None): + rows = [row.copy() for row in (identity(N) if initial is None else initial)] + open_source = None + prefix = 1 + envelope = {(1,0,0),(0,1,0),(0,0,1)} + copies = 0 + for op, dst, src, c, frame, phase in reversed(records) if backward else records: + if op == 1: + need(open_source is None or dst != open_source, 'integer snapshot source mutated') + rows[dst] = add(rows[dst], rows[src], -c if backward else c) + weights = row_weights(rows[dst]) + envelope.add(weights) + prefix = max(prefix, sum(weights)) + elif op == (3 if backward else 2): + need(open_source is None and src == N and not rows[N], 'integer COPY overwrites private') + rows[N] = rows[dst].copy() + open_source = dst + copies += 1 + elif op == (2 if backward else 3): + need(open_source == dst and rows[N] == rows[dst], 'integer ERASE original snapshot') + rows[N], open_source = {}, None + else: + need(op == 0, 'integer record opcode') + need(open_source is None and not rows[N] and copies == 6, 'integer private endpoint') + return rows, prefix, envelope + + +def parity(rows): + return [sum(1 << j for j,c in row.items() if c & 1) for row in rows] + + +def dense_digest(rows, n): + # Producer's documented signed-matrix digest is one comma-delimited row + # per line, distinct from its canonical JSON word digest. + h = sha256() + for row in rows: + h.update((','.join(str(row.get(j,0)) for j in range(n)) + '\n').encode()) + return h.hexdigest() + + +def block_norms(rows): + src = max(sum(abs(c) for c in row.values()) for row in rows[:V]) + target_x = max(row_weights(row)[0] for row in rows[V:2*V]) + target_h = max(row_weights(row)[2] for row in rows[V:2*V]) + return {'source_endpoint_row_norm': src, + 'target_source_block_row_norm': target_x, + 'target_helper_block_row_norm': target_h} + + +def code(records): + records = [r for r in records if r[0] == 1 and 21 <= r[5] <= 24] + output, prefixes = [], [] + for backward in (False, True): + rows = [{i: 1} for i in range(V)] + prefix = 1 + for _, d, s, c, f, phase in reversed(records) if backward else records: + need(d < V and s < V and d != s, 'source code not inplace') + rows[d] = add(rows[d], rows[s], -c if backward else c) + prefix = max(prefix, sum(abs(c) for c in rows[d].values())) + output.append(rows) + prefixes.append(prefix) + rows = [row.copy() for row in output[0]] + for _, d, s, c, f, phase in reversed(records): + rows[d] = add(rows[d], rows[s], -c) + need(rows == [{i: 1} for i in range(V)], 'signed source-code literal inverse') + norms = [max(sum(abs(c) for c in row.values()) for row in a) for a in output] + return records, output, prefixes, norms + + +def global_bound(ordered, local, local_prefix, envelopes, code_prefix, code_norm): + norms = [[1,1] for _ in range(4)] + maximum = 1 + checkpoints = [] + counts = Counter() + for event in ordered: + op = event.get('op') + if op == 'code sweep': + p, side = event['pair'], int(event['side'] == 'Y') + for s in event['stages']: + reverse = s % 2 + counts['inverse_code' if reverse else 'forward_code'] += 1 + maximum = max(maximum, code_prefix[reverse] * norms[p][side]) + norms[p][side] *= code_norm[reverse] + elif op == 'complete local coded call': + p, reverse = event['pair'], int(event['reverse']) + src_side = 1 if reverse else 0 + dst_side = 1 - src_side + x, y = norms[p][src_side], norms[p][dst_side] + # Hosted helpers may live in an already preloaded idle DATA bank. + # Their normalized coefficients are therefore bounded by the + # largest current bank norm, rather than by fresh independent1. + h = max(n for pair in norms for n in pair) + maximum = max(maximum, max(a*x + b*y + c*h for a,b,c in envelopes[reverse])) + endpoint = local[reverse] + norms[p][src_side] = endpoint['source_endpoint_row_norm'] * x + norms[p][dst_side] = y + endpoint['target_source_block_row_norm'] * x + endpoint['target_helper_block_row_norm'] * h + counts['local_inverse' if reverse else 'local_forward'] += 1 + checkpoints.append({'stage': event['stage'], 'prefix_upper_bits': maximum.bit_length()}) + elif event.get('kind') == 'bridge': + d, s = event['dst'], event['src'] + norms[d][0] += norms[s][0] + norms[s][1] += norms[d][1] + maximum = max(maximum, *(n for pair in norms for n in pair)) + counts['scalar_bridge_shears'] += 2 + elif event.get('kind') == 'exchange': + norms = [[y,x] for x,y in norms] + need(counts == Counter(forward_code=35, inverse_code=28, local_forward=5, + local_inverse=4, scalar_bridge_shears=18), 'whole added-code count') + crude = (1 << 18) * local_prefix[0]**5 * local_prefix[1]**4 * code_prefix[0]**35 * code_prefix[1]**28 + need(maximum <= crude, 'weighted global bound exceeds product upper') + # Completing the easy four FULL banks applies the nine inverse G factors + # independently on each bank; the maximum norm multiplies by one such + # sequence, not its fourth power. + completed_decode = code_prefix[0]**4 * code_prefix[1]**5 + return {'ordered_extra_code_counts': dict(counts), + 'all63_code_factors_included': True, + 'encoded_hosted_helper_inputs_bounded': True, + 'weighted_global_prefix_upper': str(maximum), + 'weighted_global_prefix_upper_bits': maximum.bit_length(), + 'charge_rounded_up_to_64_bits': 64*((maximum.bit_length()+63)//64), + 'crude_product_prefix_upper_bits': crude.bit_length(), + 'after_easy_completed_bank_decode_upper_bits': (maximum*completed_decode).bit_length(), + 'local_stage_checkpoints': checkpoints, + 'norm_proof': 'owner/address permutations are isometries; each hosted helper is bounded by the largest current encoded DATA-bank norm. Use exact local block-prefix envelopes, exact source code prefix norm, endpoint block norms and triangle inequalities at actual bridges', + 'limits': 'terminal hole decoder omitted; tape, native child interior defect and all-size rounded-interface theorem remain separate'} + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--write', action='store_true') + args = parser.parse_args() + meta = json.loads((HERE/'BIT-SIGNED-INPUT.json').read_bytes()) + compressed = (HERE/'BIT-SIGNED-INPUT-WORD.json.gz').read_bytes() + raw = gzip.decompress(compressed) + need(sha256(compressed).hexdigest() == meta['word_gzip_sha256'] and + sha256(raw).hexdigest() == meta['word_canonical_sha256'], 'actual signed producer word hashes') + program = json.loads(raw) + frozen = json.loads((HERE/'BIT-THREE-ROW-INPUT.json').read_bytes()) + records, matrices = program['records'], frozen['matrices'] + forward, f, ef = replay(records) + inverse, r, er = replay(records, True) + roundtrip, _, _ = replay(records, True, forward) + need(roundtrip == identity(N), 'full signed inverse roundtrip') + need(f == meta['prefix_F'] and r == meta['prefix_R'], 'independent exact prefix discrepancy') + source_code, source_rows, source_prefix, source_norm = code(records) + for direction, rows in enumerate((forward, inverse)): + for p in range(V): + need(rows[p] == source_rows[direction][p], 'integer source interface has dirt/target dependence') + need(rows[V+p].get(V+p) == 1 and all(j < V or j == V+p or j >= 2*V for j in rows[V+p]), + 'integer target self block') + need(all(not c & 1 for j,c in rows[V+p].items() if j >= 2*V), 'odd helper leakage') + for h in range(2*V,N): + need(rows[h] == {h:1}, 'integer helper not literally restored') + expected = [1 << i for i in range(N)] + [0] + for p in range(V): + expected[p] = matrices['Hinv' if direction else 'H'][p] + expected[V+p] ^= (1 << p) if direction else matrices['H'][p] + need(parity(rows) == expected, 'integer lift is not actual all-column BIT code') + need(dense_digest(source_rows[0],V) == meta['source_integer_matrix_sha256'] and + dense_digest(source_rows[1],V) == meta['source_integer_inverse_sha256'], 'source code digest') + ordered = json.loads((HERE/'BIT-NATIVE-CONTROLLER-WORD.json').read_bytes())['ordered_controller'] + bound = global_bound(ordered, [block_norms(forward),block_norms(inverse)], + [f,r], [ef,er], source_prefix, source_norm) + result = {'status':'PASS_INDEPENDENT_SIGNED_BIT_LIFT_AND_ALL63_CODE_GROWTH_ENDPOINT_OPEN', + 'signed_word_canonical_sha256':meta['word_canonical_sha256'], + 'all_integer_columns_each_orientation':N, 'literal_helpers_restored':438, + 'full_forward_inverse_roundtrip':True, 'local_exact_prefix':[f,r], + 'local_old_formula_bits':[(64*f**3*r**2).bit_length(),((1<<18)*f**5*r**4).bit_length()], + 'source_code_ADDs':len(source_code), 'source_code_exact_prefix':source_prefix, + 'source_code_endpoint_norm':source_norm, + 'local_endpoint_block_norms':[block_norms(forward),block_norms(inverse)], + 'global_controller_growth':bound, + 'integer_scope':'The source is A_Z x, helpers exactly restored, target self identity and even helper leakage. The desired coded target identity is over F2; no integer identity substitution is made.', + 'limits':['exact signed scalar normalization and copied snapshots, not internal native child errors', + 'no global restored endpoint or terminal N E^-1 N implementation', + 'new charged precision theorem, physical source/tape invoice and modern all-size release not supplied', + 'no supplier or conditional kappa claim']} + if args.write: + (HERE/'BIT-SIGNED-AUDIT.json').write_text(json.dumps(result,sort_keys=True,indent=2)+'\n') + else: + need(json.loads((HERE/'BIT-SIGNED-AUDIT.json').read_bytes()) == json.loads(canonical(result)), + 'complete signed/controller growth receipt differs') + print(result['status']) + print('local norms',f,r,'all63 bridge prefix bits',bound['weighted_global_prefix_upper_bits']) + + +if __name__ == '__main__': + main() diff --git a/research/r429-signed-range/frozen/old/signed_quotient_search.py b/research/r429-signed-range/frozen/old/signed_quotient_search.py new file mode 100644 index 0000000000..2f0da1ca27 --- /dev/null +++ b/research/r429-signed-range/frozen/old/signed_quotient_search.py @@ -0,0 +1,92 @@ +#!/usr/bin/env python3 +"""Optimize integer signs of the same47 binary quotient gates. + +The native rank profile and F2 source code are fixed. This is a new integer +lift, not the already published frozen local word or an admitted precision law. +""" +from pathlib import Path +import gzip +import hashlib +import json +import random +import sys +sys.dont_write_bytecode=True +HERE=Path(__file__).resolve().parent +sys.path.insert(0,str(HERE.parent/'recursive')) +import bit_signed_audit as sa +import bit_prune_audit as pa +import bit_cap_copy_local as cap + + +def score(gates, signs): + maxima=[] + endpoints=[] + for inverse in (False,True): + rows=[[int(i==j) for j in range(9)] for i in range(9)] + m=1 + seq=list(zip(gates,signs)) + for (d,s),c in reversed(seq) if inverse else seq: + c=-c if inverse else c + rows[d]=[x+c*y for x,y in zip(rows[d],rows[s])] + m=max(m,sum(map(abs,rows[d]))) + maxima.append(m) + endpoints.append(max(sum(map(abs,row)) for row in rows)) + return (max(maxima),maxima[0]*maxima[1],sum(maxima),sum(endpoints)) + + +def main(): + packed=(HERE/'BIT-PRUNED-WORD.json.gz').read_bytes() + cap.need(hashlib.sha256(packed).hexdigest()=='1a6841fccba51fa922993c77b4b296e659c2c538252e5e06113d0438c5edb870','fixed ancestry') + program=json.loads(gzip.decompress(packed)) + records=program['records'] + positions=[i for i,r in enumerate(records) if r[0]==1 and r[5]==23] + pivots=sorted({records[i][j] for i in positions for j in (1,2)}) + index={p:i for i,p in enumerate(pivots)} + gates=[(index[records[i][1]],index[records[i][2]]) for i in positions] + cap.need(len(gates)==47 and len(pivots)==9,'quotient alphabet') + start=[1]*47 + best=(score(gates,start),start) + rng=random.Random(3605) + for restart in range(24): + signs=start[:] if restart==0 else [rng.choice((-1,1)) for _ in start] + current=score(gates,signs) + for sweep in range(8): + changed=False + order=list(range(47));rng.shuffle(order) + for i in order: + signs[i]*=-1 + value=score(gates,signs) + if value 0, "MOVE containment/rank") + frames[d] = new + paths[d].append(new) + profile[f] += 1 + moves.append([index, d, old, new, f]) + elif op == 1: + require(d < N, "immutable private field is an ADD destination") + require(0 <= s <= N and d != s and c in (-1, 1), "ADD operands") + require(frames[d] == frames[s] == f, "ADD common frame") + require(d != opened, "copied source changed during snapshot lifetime") + sign = -c if backward else c + if fault == ("inverse_sign", index): + require(backward, "inverse fault direction") + sign = c + a, b = rows[d], rows[s] + rows[d] = [x + y for x, y in zip(a, b)] if sign == 1 else [ + x - y for x, y in zip(a, b)] + bits[d] ^= bits[s] + if track: + size = sum(map(abs, rows[d])) + if size > prefix: + prefix = size + maximum = {"record_index_zero_based": index, "execution_step_zero_based": step, + "register": d, "row": rows[d][:]} + elif op == (3 if backward else 2): + require(opened is None and s == N and not any(rows[N]) and + bits[N] == 0 and frames[N] is None, "COPY requires fresh zero private field") + require(0 <= d < V and frames[d] == c == 1 and + not (geo.masks[f] & ~geo.masks[c]) and + geo.ranks[c] - geo.ranks[f] == 1, "COPY actual FULL-to-cap rank") + require(phase == (0 if backward else 1), "COPY rank tag") + original_snapshot = rows[d][:] + rows[N], bits[N], frames[N], opened = rows[d][:], bits[d], f, d + if fault == ("stale_snapshot", index): + stale = [int(j == d) for j in range(N)] + require(stale != rows[N], "stale snapshot control is ineffective") + rows[N], bits[N] = stale, 1 << d + paths[N].append(f) + profile[1] += 1 + copies.append({"copy_record_index_zero_based": index, "source": d, + "source_frame": c, "private_frame": f, "paid_rank": 1, + "snapshot_row_sha256": matrix_digest([original_snapshot])}) + elif op == (2 if backward else 3): + require(opened == d and s == N and frames[d] == c and frames[N] == f, + "ERASE original physical source/frame") + require(rows[N] == rows[d] == original_snapshot and bits[N] == bits[d], + "ERASE private value is not its original unchanged snapshot") + require(phase == (1 if backward else 0), "ERASE tag") + copies[-1]["erase_record_index_zero_based"] = index + rows[N], bits[N], frames[N], opened, original_snapshot = [0] * N, 0, None, None, None + paths[N].append(None) + else: + raise ValueError("unknown opcode") + require(opened is None and not any(rows[N]) and not bits[N] and frames[N] is None, + "private endpoint is not zero/closed") + require(frames[:N] == (geo.start if backward else geo.final), "public endpoint frames") + require(parity(rows) == bits, "independent integer / F2 replay disagrees") + result = { + "prefix_row_l1": prefix, "record_counts": dict(sorted(counts.items())), + "paid_profile": dict(sorted(profile.items())), + "paid_children": sum(profile.values()), "rank_mass": sum(k * v for k, v in profile.items()), + "copies": copies, "maximum_simultaneous_private_snapshots": 1, + "MOVE_events_sha256": digest(canonical(moves)), + "all_register_frame_paths_sha256": digest(canonical(paths)), + "integer_endpoint_sha256": matrix_digest(rows), + "binary_endpoint_sha256": digest(canonical(bits)), + } + return rows, result, maximum + + +def source_code(records, backward=False): + code = [r for r in records if r[0] == 1 and r[5] in (21, 22, 23, 24)] + require(len(code) == 1499, "source-code length") + rows = dense_identity(V, private=False) + for _, d, s, c, frame, phase in reversed(code) if backward else code: + require(0 <= d < V and 0 <= s < V and d != s and frame == 1, "source-only code grammar") + c = -c if backward else c + rows[d] = [x + c * y for x, y in zip(rows[d], rows[s])] + return rows + + +def endpoints(rows, code, binary_source, backward=False): + require(rows[:V] == [r + [0] * (N - V) for r in code], "exact source-only integer block") + for h in range(2 * V, N): + require(rows[h] == [int(j == h) for j in range(N)], "arbitrary dirty helper restoration") + for p in range(V): + require(rows[V + p][V:2 * V] == [int(j == p) for j in range(V)], + "target identity block") + require(all(x % 2 == 0 for x in rows[V + p][2 * V:]), "odd target helper leakage") + want = [1 << j for j in range(N)] + [0] + for p in range(V): + want[p] = binary_source[p] + want[V + p] ^= (1 << p) if backward else binary_source[p] + require(parity(rows) == want, "complete all-column binary boundary") + + +def block_summary(rows): + source = [r[:V] for r in rows[:V]] + target = [r[:V] for r in rows[V:2 * V]] + leakage = [r[2 * V:] for r in rows[V:2 * V]] + result = {} + for label, matrix in (("A_Z", source), ("T_Z", target), ("E_Z", leakage)): + coefficients = [x for row in matrix for x in row if x] + common = 0 + for x in coefficients: + common = gcd(common, x) + result[label] = { + "shape": [len(matrix), len(matrix[0])], "sha256": matrix_digest(matrix), + "nonzero_entries": len(coefficients), "coefficient_gcd": common, + "maximum_entry_abs": max(map(abs, coefficients), default=0), + "maximum_row_l1": max(sum(map(abs, row)) for row in matrix), + } + result["source_not_identity_witness"] = first_difference(source, dense_identity(V, private=False)) + result["target_not_A_Z_witness"] = first_difference(target, source) + result["nonzero_even_helper_witness"] = first_difference(leakage, [[0] * (N - 2 * V) for _ in range(V)]) + return result + + +def attain_prefix(records, backward, maximum, expected): + row = maximum["row"] + chosen = [(x > 0) - (x < 0) for x in row] + require(max(map(abs, chosen)) == 1, "attaining input must have unit infinity norm") + values = chosen[:] + [0] + measured, attained = 1, None + order = range(len(records) - 1, -1, -1) if backward else range(len(records)) + for index in order: + op, d, s, c, f, phase = records[index] + if op == 1: + values[d] += (-c if backward else c) * values[s] + elif op == (3 if backward else 2): + values[N] = values[d] + elif op == (2 if backward else 3): + require(values[N] == values[d], "scalar witness ERASE") + values[N] = 0 + measured = max(measured, abs(values[d]), abs(values[N])) + if index == maximum["record_index_zero_based"]: + attained = values[maximum["register"]] + require(attained == measured == expected and sum(map(abs, row)) == expected, + "prefix maximum not attained by direct scalar replay") + return {key: value for key, value in maximum.items() if key != "row"} | { + "prefix_norm": expected, "attained_value": attained, + "public_input_signs": chosen, + "maximizing_row_sparse": [[j, x] for j, x in enumerate(row) if x], + "maximizing_row_sha256": matrix_digest([row]), + "direct_scalar_replay_maximum": measured, + "domain": "scalar lifted word, arbitrary real public inputs with infinity norm <= 1, private=0", + } + + +def rejected(label, expected_message, operation): + try: + operation() + except ValueError as error: + require(str(error) == expected_message, + "negative control reached an unintended gate: " + label + ": " + str(error)) + return {"name": label, "detected": True, "reason": str(error), + "expected_semantic_gate_matched": True, + "authentication_bypassed_only_after_valid_inputs_loaded": True} + raise ValueError("semantic negative control escaped: " + label) + + +def negative_controls(records, geo, good, signed_change): + results = [] + copy_index = next(i for i, r in enumerate(records) if r[0] == 2) + results.append(rejected("stale_private_snapshot_at_legal_COPY", + "ERASE private value is not its original unchanged snapshot", + lambda: replay(records, geo, track=False, + fault=("stale_snapshot", copy_index)))) + altered = [r[:] for r in records] + pivot = altered[copy_index][1] + altered.insert(copy_index + 1, [1, pivot, (pivot + 1) % V, 1, 1, 99]) + results.append(rejected("mutate_copied_source_before_ERASE", + "copied source changed during snapshot lifetime", + lambda: replay(altered, geo, track=False))) + altered = [r[:] for r in records] + cap = altered[copy_index][4] + altered.insert(copy_index + 1, [1, N, V + pivot, 1, cap, 99]) + results.append(rejected("mutate_private_copy_before_ERASE", + "immutable private field is an ADD destination", + lambda: replay(altered, geo, track=False))) + altered = [r[:] for r in records] + move_index = next(i for i, r in enumerate(altered) if r[0] == 0) + altered[move_index][4] += 1 + results.append(rejected("wrong_paid_MOVE_rank", "MOVE containment/rank", + lambda: replay(altered, geo, track=False))) + wrong, _, _ = replay(records, geo, backward=True, initial=good, track=False, + fault=("inverse_sign", signed_change)) + identity = dense_identity() + require(parity(wrong) == parity(identity) and wrong != identity, + "wrong inverse sign control did not separate Z from F2") + results.append({"name": "wrong_integer_inverse_sign", "detected": True, + "binary_roundtrip_still_identity": True, + "integer_roundtrip_failure": first_difference(wrong, identity)}) + altered = [r[:] for r in records] + altered[signed_change][3] *= -1 + wrong, _, _ = replay(altered, geo, track=False) + require(parity(wrong) == parity(good) and wrong[:V] != good[:V], + "wrong quotient coefficient control did not change integer source") + results.append({"name": "wrong_quotient_coefficient_same_F2", "detected": True, + "binary_endpoint_unchanged": True, + "integer_endpoint_failure": first_difference(wrong, good)}) + altered = [r[:] for r in records] + cleanup = max(i for i, r in enumerate(altered) if r[0] == 1 and r[5] == 5 and r[1] >= 2 * V) + altered[cleanup][3] *= -1 + wrong, _, _ = replay(altered, geo, track=False) + difference = first_difference(wrong[2 * V:N], good[2 * V:N]) + require(difference is not None and parity(wrong) == parity(good), + "dirty restoration sign control ineffective") + difference["output_row"] += 2 * V + results.append({"name": "dirty_helper_cleanup_wrong_integer_sign", "detected": True, + "binary_endpoint_unchanged": True, "integer_helper_failure": difference}) + altered = [r[:] for r in records] + # A legal FULL-frame source write reads a formerly arbitrary dirty input. + altered[signed_change][2] = 2 * V + wrong, _, _ = replay(altered, geo, track=False) + leakage = next(((i, j, row[j]) for i, row in enumerate(wrong[:V]) + for j in range(2 * V, N) if row[j]), None) + require(leakage is not None, "dirty source dependence control ineffective") + results.append({"name": "source_code_reads_arbitrary_dirty_helper", "detected": True, + "witness": {"source_output": leakage[0], "dirty_input": leakage[1], + "coefficient": leakage[2]}}) + altered = [r[:] for r in records] + # Remove an actual zero-frame compensation term, keeping every gate legal. + compensation = next(i for i, r in enumerate(altered) if r[0] == 1 and r[5] == 10) + removed = altered.pop(compensation) + wrong, _, _ = replay(altered, geo, track=False) + leakage = next(((i, j, row[j]) for i, row in enumerate(wrong[V:2 * V]) + for j in range(2 * V, N) if row[j] & 1), None) + require(leakage is not None, "odd dirty target control ineffective") + results.append({"name": "omitted_dirty_compensation", "detected": True, + "removed_record": removed, + "witness": {"target_output": V + leakage[0], "dirty_input": leakage[1], + "odd_coefficient": leakage[2]}}) + return results + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--parent-word", type=Path, required=True) + parser.add_argument("--signed-word", type=Path, required=True) + parser.add_argument("--raw-word", type=Path, required=True) + parser.add_argument("--matrices", type=Path, required=True) + parser.add_argument("--out", type=Path, help="optional deterministic JSON receipt") + parser.add_argument("--endpoint-out", type=Path, help="optional complete sparse integer endpoint JSON") + args = parser.parse_args() + inputs, authentication = {}, {} + for label in PINS: + inputs[label], authentication[label] = read_pinned(getattr(args, label), label) + parent, signed, raw, frozen = (inputs[k] for k in PINS) + variant = authenticate_variant(parent, signed) + a, ai, binary = raw_binary_code(raw, frozen) + geo = Geometry(raw, signed) + all_rows, runs = {}, {} + for name, program in (("parent", parent), ("signed", signed)): + directions, summary = [], {} + for backward in (False, True): + rows, invoice, maximum = replay(program["records"], geo, backward) + require(invoice["record_counts"] == COUNTS and invoice["paid_profile"] == PROFILE, + "complete literal invoice") + code = source_code(program["records"], backward) + endpoints(rows, code, ai if backward else a, backward) + invoice["endpoint_blocks"] = block_summary(rows) + invoice["prefix_attainment"] = attain_prefix( + program["records"], backward, maximum, invoice["prefix_row_l1"]) + direction = "inverse" if backward else "forward" + summary[direction], all_rows[name + "_" + direction] = invoice, rows + directions.append(rows) + for backward, initial in ((True, directions[0]), (False, directions[1])): + roundtrip, _, _ = replay(program["records"], geo, backward, initial, track=False) + require(roundtrip == dense_identity(), "all-column integer two-sided roundtrip") + summary["both_integer_roundtrips_on_all_651_columns"] = True + runs[name] = summary + require([runs["parent"][d]["prefix_row_l1"] for d in ("forward", "inverse")] == [34285, 5839860], + "parent exact prefixes") + require([runs["signed"][d]["prefix_row_l1"] for d in ("forward", "inverse")] == [80639, 239014], + "signed exact prefixes") + pf, sf, si = (all_rows[k] for k in ("parent_forward", "signed_forward", "signed_inverse")) + delta_source = [[x - y for x, y in zip(r[:V], s[:V])] for r, s in zip(sf[:V], pf[:V])] + delta_target = [[x - y for x, y in zip(r[:V], s[:V])] for r, s in zip(sf[V:2 * V], pf[V:2 * V])] + require(all(x % 2 == 0 for row in delta_source + delta_target for x in row), "odd lift difference") + require([r[2 * V:] for r in sf[V:2 * V]] == [r[2 * V:] for r in pf[V:2 * V]], + "forward helper leakage changed") + require([r[2 * V:] for r in si[V:2 * V]] == + [[-x for x in r[2 * V:]] for r in sf[V:2 * V]], "inverse leakage is not negative E_Z") + changed_targets = [i for i, row in enumerate(delta_target) if any(row)] + require(changed_targets == [0, 1, 2], "target lift change outside three repaired rows") + changes = { + "source_delta_rank_over_Q": integer_rank(delta_source), + "target_delta_rank_over_Q": integer_rank(delta_target), + "target_source_block_changed_rows": changed_targets, + "source_delta_sha256": matrix_digest(delta_source), + "target_delta_sha256": matrix_digest(delta_target), + "forward_E_Z_identical_to_parent": True, + "integer_endpoint_difference_witness": first_difference(sf, pf), + } + family = sign_family_transfer(parent["records"], signed["records"], pf, sf) + controls = negative_controls(signed["records"], geo, sf, + variant["changed_record_indices_zero_based"][0]) + receipt = { + "schema": "fixed-r429-signed-quotient-independent-integer-audit-v1", + "status": "PASS_FIXED_SIGNED_QUOTIENT_ALL_COLUMNS_LOCAL_ONLY", + "no_new_kappa": True, + "authentication": authentication, "variant": variant, + "registers": {"sources": V, "arbitrary_targets": V, "arbitrary_dirty_helpers": 429, + "public_independent_columns": N, "private_register": N, + "private_initial_and_final_value": 0}, + "binary_contract": binary, + "geometry": geo.receipt, + "runs": runs, "changed_integer_endpoint": changes, + "all_sign_family_transfer": family, + "controls_after_authentication": controls, + "matrix_digest_encoding": "Dense signed decimal entries separated by comma, LF after " + "every row; full endpoint includes 652 output rows and 651 public input columns.", + "integer_contract": { + "forward": "(x,y,h) -> (A_Z*x, y+T_Z*x+E_Z*h, h)", + "inverse": "(x,y,h) -> (A_Z^-1*x, y-T_Z*A_Z^-1*x-E_Z*h, h)", + "binary_forward": "(x,y,h) -> (A*x,y+A*x,h)", + "binary_inverse": "(x,y,h) -> (A^-1*x,y+x,h)", + "A_Z_mod_2_and_T_Z_mod_2": "A", + "E_Z_mod_2": 0, + "domain": "Every integer, rational, or real public input; every commutative ring " + "by the same integer-polynomial identities, with a cleared private field. " + "The binary identity is over F2. Prefix l-infinity equalities concern real scalars.", + }, + "scope": [ + "Fixed witness and its pinned parent; no sign optimization or optimality claim. " + "The checked prefix/suffix factorization also proves the stated entire-sign-family law.", + "All integer and F2 input columns, both orientations, and both roundtrips are exact.", + "Scalar prefix row norms are exact induced l-infinity norms, with attained inputs.", + "Native ADDRESS action, native vector cancellations, rounded child defects, precision, " + "owner allocation, source access, storage, recursive supplier and outer kappa admission " + "are not proved by this scalar calculation.", + "No formal-kernel proof; separately authored dense standard-library implementation.", + ], + } + if args.endpoint_out: + payload = { + "schema": "sparse-integer-endpoint-rows-v1", "shape": [N + 1, N], + "indexing": "Rows and columns zero-based; absent entries zero; pairs sorted by column.", + "matrices": {name: [[[j, x] for j, x in enumerate(row) if x] for row in rows] + for name, rows in all_rows.items()}, + } + args.endpoint_out.write_text(json.dumps(payload, sort_keys=True, separators=(",", ":")) + "\n") + if args.out: + args.out.write_text(json.dumps(receipt, sort_keys=True, indent=2) + "\n") + else: + print(json.dumps(receipt, sort_keys=True, indent=2)) + if args.out: + print(json.dumps({"status": receipt["status"], "signed_prefixes": [80639, 239014], + "parent_prefixes": [34285, 5839860], + "negative_controls": len(controls), "no_new_kappa": True}, sort_keys=True)) + + +if __name__ == "__main__": + main() diff --git a/research/r429-signed-range/frozen/reviews/range/CHECKS.json.gz b/research/r429-signed-range/frozen/reviews/range/CHECKS.json.gz new file mode 100644 index 0000000000..bcc1d49053 Binary files /dev/null and b/research/r429-signed-range/frozen/reviews/range/CHECKS.json.gz differ diff --git a/research/r429-signed-range/frozen/reviews/range/SOURCE-DEPENDENCIES.json b/research/r429-signed-range/frozen/reviews/range/SOURCE-DEPENDENCIES.json new file mode 100644 index 0000000000..35504f8b8e --- /dev/null +++ b/research/r429-signed-range/frozen/reviews/range/SOURCE-DEPENDENCIES.json @@ -0,0 +1,125 @@ +{ + "artifacts": { + "frozen/reviews/range/CHECKS.json.gz": { + "decoded_bytes": 10824873, + "decoded_sha256": "a12dcd0e33f4f3a3728ff76373ce00ce312cc0f53b147cb5c608c6b6de9f8f6c", + "transport_bytes": 286198, + "transport_sha256": "0e826dec630ab3ab60592d823dd425785add331b97e4b3f1bc84e71e25510780" + }, + "frozen/reviews/range/check_range.py": { + "decoded_bytes": 41189, + "decoded_sha256": "4aa90c275da461cbcef95b00c6088aa599c72e7b76a6cbf9b8cadb87e45e6df5", + "transport_bytes": 41189, + "transport_sha256": "4aa90c275da461cbcef95b00c6088aa599c72e7b76a6cbf9b8cadb87e45e6df5" + } + }, + "excluded_old_suffix_word_gzip_sha256": "33d5c73fc6012da643a6d498dcacccfe70470fd76d0ee327a85f9ac6381dabcd", + "execution_imports": "Python standard library only; no historical producer module is imported.", + "historical_read_only_sources": { + "major-frontier/recursive/BIT-PRUNED-GROWTH.json": { + "decoded_bytes": 613964, + "decoded_sha256": "ccacefa32cf6edfe7a26ab5661ed14530f28dcba2d2150fff052c6f0f8f27d1b", + "required_to_reproduce": false, + "role": "Historical parent range claims/envelopes, independently matched above.", + "transport_bytes": 613964, + "transport_sha256": "ccacefa32cf6edfe7a26ab5661ed14530f28dcba2d2150fff052c6f0f8f27d1b" + }, + "major-frontier/recursive/bit_native_controller.py": { + "decoded_bytes": 25018, + "decoded_sha256": "e08adc1483c5bc75f40da1f7b62a7d1d5eb058615c5dfe6db6c38350348ff288", + "required_to_reproduce": false, + "role": "Historical abstract schedule explanation; independently evaluated in a free noncommuting GF2 algebra.", + "transport_bytes": 25018, + "transport_sha256": "e08adc1483c5bc75f40da1f7b62a7d1d5eb058615c5dfe6db6c38350348ff288" + }, + "major-frontier/recursive/bit_pruned_growth.py": { + "decoded_bytes": 5429, + "decoded_sha256": "9c59a9a521e0d0124df6b7686f76e0308c13678306f5efc53eb6e865757f8636", + "required_to_reproduce": false, + "role": "Historical source-code and terminal prefix convention; read, never imported.", + "transport_bytes": 5429, + "transport_sha256": "9c59a9a521e0d0124df6b7686f76e0308c13678306f5efc53eb6e865757f8636" + }, + "major-frontier/recursive/bit_signed_audit.py": { + "decoded_bytes": 11946, + "decoded_sha256": "376356696663021693c0e2c9adf37f371675fe8837fb88232b8767a8b90793e8", + "required_to_reproduce": false, + "role": "Historical global range recurrence and helper-magnitude convention; read, never imported.", + "transport_bytes": 11946, + "transport_sha256": "376356696663021693c0e2c9adf37f371675fe8837fb88232b8767a8b90793e8" + }, + "major-frontier/root-pruned-code/SIGNED-QUOTIENT-GROWTH.json": { + "decoded_bytes": 2053, + "decoded_sha256": "f932fc1ab6efb6b261e4774beb9771b7abf5f9d247343f79d78e1955cb2d8cb9", + "required_to_reproduce": false, + "role": "Historical candidate range claims, independently matched above.", + "transport_bytes": 2053, + "transport_sha256": "f932fc1ab6efb6b261e4774beb9771b7abf5f9d247343f79d78e1955cb2d8cb9" + }, + "major-frontier/root-pruned-code/SIGNED-QUOTIENT-RESULT.json": { + "decoded_bytes": 1648, + "decoded_sha256": "2ae84cc4cf6965832faf6c552f80f914820f53408e7d24cdb476dd7d87adaa20", + "required_to_reproduce": false, + "role": "Historical local sign-variant claim; not imported.", + "transport_bytes": 1648, + "transport_sha256": "2ae84cc4cf6965832faf6c552f80f914820f53408e7d24cdb476dd7d87adaa20" + }, + "major-frontier/root-rounding/SUFFIX-WEIGHTS.json": { + "decoded_bytes": 4682, + "decoded_sha256": "3577f7115fe1c5c6f3f0aa0c68c17d8f141d0e735521e870c531fb00b4dd4818", + "required_to_reproduce": false, + "role": "Historical excluded suffix receipt; not evidence for either current word.", + "transport_bytes": 4682, + "transport_sha256": "3577f7115fe1c5c6f3f0aa0c68c17d8f141d0e735521e870c531fb00b4dd4818" + }, + "major-frontier/root-rounding/suffix_weights.py": { + "decoded_bytes": 7458, + "decoded_sha256": "1941834c673c0b420741d049d16427a0e13b82b2abe2aa79cc3df3bc47995be5", + "required_to_reproduce": false, + "role": "Older660-public,438-helper,six-copy audit; no numerical result reused.", + "transport_bytes": 7458, + "transport_sha256": "1941834c673c0b420741d049d16427a0e13b82b2abe2aa79cc3df3bc47995be5" + } + }, + "independently_matched_historical_range_fields": { + "candidate": { + "exact_ordered_integer_upper": true, + "local_prefix": true, + "ordered_bits": true, + "source_code_prefix": true, + "terminal_bits": true + }, + "parent": { + "complete_prefix_envelopes_with_zero_row": true, + "exact_ordered_integer_upper": true, + "local_prefix": true, + "ordered_bits": true, + "source_code_prefix": true, + "terminal_bits": true + } + }, + "proof_kind": "Finite exhaustive exact integer calculation and written all-input conditional linear-algebra proof; no formal-kernel proof.", + "receipt_canonical_sha256": "eff9d7a72677d9ae67f8257a99efbc67e621488220e3b14f7ba127a4409ec1d4", + "required_frozen_inputs": { + "frozen/candidate/WORD.json.gz": { + "decoded_bytes": 305012, + "decoded_sha256": "127f48ecae91547e90bd2e64769f222cb17601ab36edcfdfdb0fce6f2d1bd9b7", + "transport_bytes": 59544, + "transport_sha256": "e802611104c61fc8477837b4ab41abc4f13cf41fbca6ef3de60d0b5e768fb949" + }, + "frozen/controller/WORD.json.gz": { + "decoded_bytes": 215137, + "decoded_sha256": "859cdd2a87ea6ce58eb0ccdf2ca675e77c7134d6a7bbc7d450493d1abb108271", + "transport_bytes": 16510, + "transport_sha256": "ff50e2df9b5a0ecb5e4a3aa24a5b93ac49f7c2b4fd3d28295e6d5a8f6154027f" + }, + "frozen/parent/WORD.json.gz": { + "decoded_bytes": 304990, + "decoded_sha256": "ebc33ee086f610c1fd540fa56bb99b2b96a768e4aed4a18defcb0e1f507fca89", + "transport_bytes": 59514, + "transport_sha256": "1a6841fccba51fa922993c77b4b296e659c2c538252e5e06113d0438c5edb870" + } + }, + "schema": "b04-range-source-dependencies-v1", + "source_binding_resolution": "The legacy controller6372gate endpoint differs in9rows from the selected1499gate endpoint. Abstract schedule identity and actual selected local binary F_A/inverse interfaces are checked separately; native chart implementation stays conditional." +} diff --git a/research/r429-signed-range/frozen/reviews/range/VALIDATION-RESULT.json b/research/r429-signed-range/frozen/reviews/range/VALIDATION-RESULT.json new file mode 100644 index 0000000000..ff5ac94b4e --- /dev/null +++ b/research/r429-signed-range/frozen/reviews/range/VALIDATION-RESULT.json @@ -0,0 +1,39 @@ +{ + "preliminary_fix": "Receipt equality now compares canonical JSON: decoded lists/string keys correspond to in-memory tuples/integer keys. No mathematical result changed.", + "preliminary_runs": [ + { + "elapsed_seconds": 3.019372, + "exit_code": 0, + "name": "normal_generate", + "python": "3.12.14 (main, Aug 25 2026, 13:50:33) [Clang 22.1.3 ]", + "stderr": "", + "stdout": "PASS_EXACT_RANGE_AND_ATOMIC_DEFECT_CONSTANTS_NO_PRECISION_ADMISSION\nparent range [34285, 5839860] controller bits 458 terminal bits 601\n forward peak impulse 3457 exact aggregate 880068 loose sum 965052\n inverse peak impulse 86476 exact aggregate 34848225 loose sum 34872847\ncandidate range [80639, 239014] controller bits 401 terminal bits 519\n forward peak impulse 3935 exact aggregate 1081994 loose sum 1099680\n inverse peak impulse 4366 exact aggregate 1255309 loose sum 1289381\nreceipt_sha256 88da016107a663d4c6930e49bee832cb4660c262d80c3067ba8f23baa1cabb0b\n" + }, + { + "elapsed_seconds": 3.408473, + "exit_code": 1, + "name": "optimized_verify", + "python": "3.12.14 (main, Aug 25 2026, 13:50:33) [Clang 22.1.3 ]", + "stderr": "FAIL: complete deterministic receipt differs\n", + "stdout": "" + } + ], + "runs": [ + { + "elapsed_seconds": 2.895955, + "exit_code": 0, + "name": "normal_generate", + "python": "3.12.14 (main, Aug 25 2026, 13:50:33) [Clang 22.1.3 ]", + "stderr": "", + "stdout": "PASS_EXACT_RANGE_AND_ATOMIC_DEFECT_CONSTANTS_NO_PRECISION_ADMISSION\nparent range [34285, 5839860] controller bits 458 terminal bits 601\n forward peak impulse 3457 exact aggregate 880068 loose sum 965052\n inverse peak impulse 86476 exact aggregate 34848225 loose sum 34872847\ncandidate range [80639, 239014] controller bits 401 terminal bits 519\n forward peak impulse 3935 exact aggregate 1081994 loose sum 1099680\n inverse peak impulse 4366 exact aggregate 1255309 loose sum 1289381\nreceipt_sha256 eff9d7a72677d9ae67f8257a99efbc67e621488220e3b14f7ba127a4409ec1d4\n" + }, + { + "elapsed_seconds": 2.712904, + "exit_code": 0, + "name": "optimized_verify", + "python": "3.12.14 (main, Aug 25 2026, 13:50:33) [Clang 22.1.3 ]", + "stderr": "", + "stdout": "PASS_EXACT_RANGE_AND_ATOMIC_DEFECT_CONSTANTS_NO_PRECISION_ADMISSION\nparent range [34285, 5839860] controller bits 458 terminal bits 601\n forward peak impulse 3457 exact aggregate 880068 loose sum 965052\n inverse peak impulse 86476 exact aggregate 34848225 loose sum 34872847\ncandidate range [80639, 239014] controller bits 401 terminal bits 519\n forward peak impulse 3935 exact aggregate 1081994 loose sum 1099680\n inverse peak impulse 4366 exact aggregate 1255309 loose sum 1289381\nreceipt_sha256 eff9d7a72677d9ae67f8257a99efbc67e621488220e3b14f7ba127a4409ec1d4\n" + } + ] +} diff --git a/research/r429-signed-range/frozen/reviews/range/VALIDATION.md b/research/r429-signed-range/frozen/reviews/range/VALIDATION.md new file mode 100644 index 0000000000..fe3f877a77 --- /dev/null +++ b/research/r429-signed-range/frozen/reviews/range/VALIDATION.md @@ -0,0 +1,77 @@ +# B04 range-review validation + +The final source was executed with bundled CPython 3.12 on the three unchanged +compressed sources now staged as `frozen/parent/WORD.json.gz`, +`frozen/candidate/WORD.json.gz`, and `frozen/controller/WORD.json.gz`. +Each subprocess had an enforced 60-second timeout. + +From the package root, the equivalent commands are: + +```sh +python3.12 frozen/reviews/range/check_range.py \ + --parent-word frozen/parent/WORD.json.gz \ + --candidate-word frozen/candidate/WORD.json.gz \ + --controller frozen/controller/WORD.json.gz \ + --output frozen/reviews/range/CHECKS.json.gz + +python3.12 -O frozen/reviews/range/check_range.py \ + --parent-word frozen/parent/WORD.json.gz \ + --candidate-word frozen/candidate/WORD.json.gz \ + --controller frozen/controller/WORD.json.gz \ + --verify frozen/reviews/range/CHECKS.json.gz +``` + +Both final executions passed. Receipt generation took 2.896 seconds; optimized +complete receipt verification took 2.713 seconds. All invariants use explicit +exceptions and remain active under `-O`. + +The exact receipt canonical-JSON SHA256 is: + +`eff9d7a72677d9ae67f8257a99efbc67e621488220e3b14f7ba127a4409ec1d4` + +The checker SHA256 is: + +`4aa90c275da461cbcef95b00c6088aa599c72e7b76a6cbf9b8cadb87e45e6df5` + +The compressed full receipt SHA256 is: + +`0e826dec630ab3ab60592d823dd425785add331b97e4b3f1bc84e71e25510780` + +The decoded controller SHA256 is: + +`859cdd2a87ea6ce58eb0ccdf2ca675e77c7134d6a7bbc7d450493d1abb108271` + +The compressed controller transport SHA256 is: + +`ff50e2df9b5a0ecb5e4a3aa24a5b93ac49f7c2b4fd3d28295e6d5a8f6154027f` + +All four range/adjoint scans cover all 16,102 records. Their checks include +every opcode and paid rank; all 651 public entrance columns are represented +in the exact sparse range matrices. The full adjoints operate on 652 extended +coordinates. The controller recurrence covers all 56 events and 63 added +source-code factors. The binary abstract schedule checks all eight independent +formal bank columns. + +After source authentication, each orientation executes actual source-specific +controls for the wrong adjoint, reversed suffix order, ignored COPY and +incorrect uniform error signs. It independently propagates saved impulse, +range-peak and suffix-row witnesses forward. It also directly propagates the +simultaneous error signs that attain the three reported aggregate categories. +Thus these controls test the linear calculation, not merely authentication. + +An independent read-only comparison with the retained historical range JSON +confirmed both exact ordered integer upper bounds, local/source prefix +numbers, controller bit lengths and terminal bit lengths. The complete parent +block envelopes agree after adding the identically zero row, which the older +ADD-only envelope omitted. `SOURCE-DEPENDENCIES.json` records these comparisons +and all source hashes. + +A preliminary verification call exposed a receipt-comparison bug: Python +tuples/integer JSON keys were compared directly against decoded lists/string +keys. Verification was changed to compare canonical JSON. That preliminary +failure and the final successful reruns are retained in +`VALIDATION-RESULT.json`. It did not change any mathematical value. + +This validation is finite exact computation and written conditional proof. It +is not formal-kernel validation, hosted CI, a physical rounding test, a native +child implementation, or supplier admission. diff --git a/research/r429-signed-range/frozen/reviews/range/check_range.py b/research/r429-signed-range/frozen/reviews/range/check_range.py new file mode 100644 index 0000000000..bdd21b2823 --- /dev/null +++ b/research/r429-signed-range/frozen/reviews/range/check_range.py @@ -0,0 +1,851 @@ +#!/usr/bin/env python3 +"""Exact range and atomic additive-defect audit of two pinned BIT words. + +Standard library only; no producer code is imported. This is finite exact +integer computation, not a proof of native-child accuracy or rounded cleanup. +SPDX-License-Identifier: Apache-2.0 +Substantial OpenAI Codex assistance. +""" + +import argparse +from collections import Counter +import gzip +from hashlib import sha256 +import json +from pathlib import Path +import sys + + +PUBLIC = 651 +PORTS = 111 +PRIVATE = 651 +DIM = PUBLIC + 1 +PINS = { + "parent": { + "gzip": "1a6841fccba51fa922993c77b4b296e659c2c538252e5e06113d0438c5edb870", + "decoded": "ebc33ee086f610c1fd540fa56bb99b2b96a768e4aed4a18defcb0e1f507fca89", + "format": "coded-r429-pruned-three-source-copy-v1", + }, + "candidate": { + "gzip": "e802611104c61fc8477837b4ab41abc4f13cf41fbca6ef3de60d0b5e768fb949", + "decoded": "127f48ecae91547e90bd2e64769f222cb17601ab36edcfdfdb0fce6f2d1bd9b7", + "format": "coded-r429-signed-quotient-variant-v1", + }, + "controller_decoded": "859cdd2a87ea6ce58eb0ccdf2ca675e77c7134d6a7bbc7d450493d1abb108271", +} +OPNAMES = {0: "move", 1: "add", 2: "copy", 3: "clear"} + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def canonical(value): + return json.dumps(value, sort_keys=True, separators=(",", ":")).encode() + + +def digest(value): + return sha256(canonical(value)).hexdigest() + + +def sparse_items(row): + return sorted(row.items()) + + +def read_json(path): + transport = Path(path).read_bytes() + decoded = gzip.decompress(transport) if transport[:2] == b"\x1f\x8b" else transport + return json.loads(decoded), { + "transport_sha256": sha256(transport).hexdigest(), + "decoded_sha256": sha256(decoded).hexdigest(), + } + + +def load_word(path, label): + obj, hashes = read_json(path) + require(hashes["transport_sha256"] == PINS[label]["gzip"], label + " gzip pin") + require(hashes["decoded_sha256"] == PINS[label]["decoded"], label + " decoded pin") + require(obj["format"] == PINS[label]["format"], label + " format") + require(obj["public_registers"] == PUBLIC and obj["private_register"] == PRIVATE, + "651 public coordinates and one private coordinate") + records = obj["records"] + require(len(records) == 16102, "complete record count") + require(Counter(r[0] for r in records) == Counter({0: 2873, 1: 13223, 2: 3, 3: 3}), + "complete operation coverage") + for r in records: + require(len(r) == 6 and all(type(v) is int for v in r), "record schema") + op, dst, src, coefficient, rank, phase = r + require(op in OPNAMES and 0 <= dst < PUBLIC, "public destination") + if op == 1: + require(0 <= src < DIM and src != dst and coefficient in (-1, 1), + "unit signed distinct-coordinate shear") + elif op == 0: + require(1 <= rank <= 7, "MOVE paid rank") + else: + require(src == PRIVATE, "COPY/ERASE private address") + return obj, hashes + + +def events_of(records, reverse=False): + """Tuples (kind, dst, src, coefficient, rank, original_record).""" + out = [] + iterator = reversed(list(enumerate(records))) if reverse else enumerate(records) + for index, (op, dst, src, c, rank, phase) in iterator: + if op == 1: + out.append(("add", dst, src, -c if reverse else c, 0, index)) + elif op == 0: + out.append(("move", dst, -1, 0, rank, index)) + elif op == (3 if reverse else 2): + # Reverse COPY comes from the forward ERASE record; its paid + # rank belongs to the paired COPY, which is 1 in these pins. + out.append(("copy", PRIVATE, dst, 0, 1, index)) + else: + out.append(("clear", PRIVATE, dst, 0, 0, index)) + return out + + +def add_sparse(dst, src, coefficient): + require(dst is not src, "sparse source and destination must differ") + for key, value in src.items(): + result = dst.get(key, 0) + coefficient * value + if result: + dst[key] = result + else: + dst.pop(key, None) + + +def block_l1(row): + totals = [0, 0, 0] + for j, value in row.items(): + totals[0 if j < PORTS else 1 if j < 2 * PORTS else 2] += abs(value) + return tuple(totals) + + +def forward_values(events, values, stop=None, impulses=None, mutation=None): + """Independent scalar simulation, with optional errors after each event.""" + values = list(values) + selected = events if stop is None else events[:stop] + for i, (op, dst, src, c, rank, original) in enumerate(selected): + if op == "add": + if mutation == "transpose_shear": + values[src] += c * values[dst] + else: + values[dst] += c * values[src] + elif op == "copy": + if mutation != "ignore_copy": + values[dst] = values[src] + elif op == "clear": + values[dst] = 0 + else: + require(op == "move", "scalar replay opcode") + if impulses is not None: + values[dst] += impulses[i] + return values + + +def range_audit(events): + rows = [{i: 1} for i in range(PUBLIC)] + [{}] + envelopes = {(1, 0, 0), (0, 1, 0), (0, 0, 1)} + prefix = 1 + peak = {"after_event": -1, "coordinate": 0, "row": {0: 1}} + snapshot = None + copies = 0 + row_trace = sha256() + for i, (op, dst, src, c, rank, original) in enumerate(events): + if op == "add": + require(snapshot is None or dst != snapshot, "immutable snapshot source") + add_sparse(rows[dst], rows[src], c) + elif op == "copy": + require(snapshot is None and not rows[PRIVATE], "private COPY entrance") + rows[PRIVATE] = dict(rows[src]) + snapshot = src + copies += 1 + elif op == "clear": + require(snapshot == src and rows[PRIVATE] == rows[src], + "exact ideal ERASE snapshot return") + rows[PRIVATE] = {} + snapshot = None + else: + require(op == "move", "range opcode") + weights = block_l1(rows[dst]) + envelopes.add(weights) + norm = sum(weights) + if norm > prefix: + prefix = norm + peak = {"after_event": i, "coordinate": dst, "row": dict(rows[dst])} + row_trace.update(canonical([i, dst, sparse_items(rows[dst]), weights]) + b"\n") + require(snapshot is None and not rows[PRIVATE] and copies == 3, "private ideal endpoint") + for j in range(2 * PORTS, PUBLIC): + require(rows[j] == {j: 1}, "all 429 ideal helpers restored") + for j in range(PORTS): + require(all(k < PORTS for k in rows[j]), "source endpoint has only source inputs") + require(rows[PORTS + j].get(PORTS + j) == 1 and + all(k < PORTS or k == PORTS + j or k >= 2 * PORTS + for k in rows[PORTS + j]), "target self block is identity") + endpoints = { + "source_source_l1": max(sum(abs(c) for c in row.values()) for row in rows[:PORTS]), + "target_source_l1": max(block_l1(row)[0] for row in rows[PORTS:2 * PORTS]), + "target_helper_l1": max(block_l1(row)[2] for row in rows[PORTS:2 * PORTS]), + } + signs = [0] * DIM + for j, coefficient in peak["row"].items(): + signs[j] = 1 if coefficient > 0 else -1 + witness = forward_values(events, signs, peak["after_event"] + 1) + require(witness[peak["coordinate"]] == prefix, "range peak forward witness") + return { + "exact_prefix_l1": prefix, + "block_prefix_envelope": sorted(envelopes), + "block_prefix_envelope_sha256": digest(sorted(envelopes)), + "prefix_changed_row_trace_sha256": row_trace.hexdigest(), + "endpoint_blocks": endpoints, + "endpoint_sparse_matrix_sha256": digest([sparse_items(row) for row in rows]), + "ideal_helper_restoration_count": 429, + "ideal_private_copies_and_erases": [copies, copies], + "peak_witness": { + "after_event": peak["after_event"], + "original_record": events[peak["after_event"]][-1], + "coordinate": peak["coordinate"], + "row_sparse": sparse_items(peak["row"]), + "input_signs_sparse": [(j, s) for j, s in enumerate(signs) if s], + "forward_observed_coordinate": witness[peak["coordinate"]], + }, + }, rows + + +def source_code_audit(records, legacy_gates, local_rows): + selected = [(i, r) for i, r in enumerate(records) if r[0] == 1 and 21 <= r[5] <= 24] + require(len(selected) == 1499, "complete source code extraction") + require(Counter(r[5] for i, r in selected) == Counter({21: 474, 22: 504, 23: 47, 24: 474}), + "source code phase coverage") + for i, r in selected: + require(r[1] < PORTS and r[2] < PORTS, "source code support") + output = [] + matrices = [] + for reverse in (False, True): + rows = [{j: 1} for j in range(PORTS)] + prefix = 1 + peak = -1 + iterator = reversed(selected) if reverse else selected + for original, r in iterator: + _, dst, src, c, rank, phase = r + add_sparse(rows[dst], rows[src], -c if reverse else c) + norm = sum(abs(v) for v in rows[dst].values()) + if norm > prefix: + prefix, peak = norm, original + require(rows == local_rows[int(reverse)][:PORTS], + "selected source code equals full local integer source endpoint") + matrices.append(rows) + output.append({ + "exact_prefix_l1": prefix, + "endpoint_l1": max(sum(abs(v) for v in r.values()) for r in rows), + "peak_original_record": peak, + "sparse_matrix_sha256": digest([sparse_items(r) for r in rows]), + }) + # Literal inverse on all 111 integer columns, independently of GF(2). + restored = [dict(row) for row in matrices[0]] + for original, r in reversed(selected): + _, dst, src, c, rank, phase = r + add_sparse(restored[dst], restored[src], -c) + require(restored == [{j: 1} for j in range(PORTS)], "source code literal inverse") + legacy = [1 << j for j in range(PORTS)] + for gate in legacy_gates: + require(len(gate) == 2 and all(type(j) is int and 0 <= j < PORTS for j in gate) + and gate[0] != gate[1], "legacy binary source gate") + dst, src = gate + legacy[dst] ^= legacy[src] + selected_binary = [ + sum(1 << j for j, v in row.items() if v % 2) + for row in matrices[0] + ] + for reverse, local in enumerate(local_rows): + for j in range(PORTS): + row = local[PORTS + j] + binary_source = sum(1 << k for k, v in row.items() if k < PORTS and v % 2) + require(binary_source == (1 << j if reverse else selected_binary[j]), + "actual local binary target fits the selected abstract source code") + require(all(v % 2 == 0 for k, v in row.items() if k >= 2 * PORTS), + "actual local helper leakage vanishes over GF(2)") + differences = [i for i, (a, b) in enumerate(zip(legacy, selected_binary)) if a != b] + require(len(legacy_gates) == 6372 and differences, + "historical controller code is explicitly a different source endpoint") + return { + "source_code_adds": len(selected), + "source_code_record_indices": [i for i, r in selected], + "source_code_records_sha256": digest([r for i, r in selected]), + "phase_counts": dict(sorted(Counter(r[5] for i, r in selected).items())), + "forward": output[0], + "inverse": output[1], + "source_integer_inverse_verified": True, + "actual_local_binary_interfaces_all_columns_verified": True, + "actual_local_binary_interface": + "Forward (x,y,h)->(A x,y+A x,h); literal reverse " + "(x,y,h)->(A^-1 x,y+x,h). The controller uses the reverse " + "interface with source Y and target X.", + "legacy_controller_binary_gate_count": len(legacy_gates), + "legacy_binary_endpoint_sha256": digest(legacy), + "selected_binary_endpoint_sha256": digest(selected_binary), + "legacy_binary_endpoint_equals_selected_source_mod2": False, + "legacy_binary_endpoint_different_rows": differences, + "first_legacy_binary_mismatch": { + "row": differences[0], "legacy_row_bits": legacy[differences[0]], + "selected_row_bits": selected_binary[differences[0]], + }, + "integer_sweep_binding": + "Each abstract sweep uses this word's selected phase21..24 signed code " + "or its literal inverse; the controller's legacy binary gate list is " + "a different endpoint and is not the implementation being bounded.", + } + + +def abstract_schedule_audit(ordered): + """Exact free noncommuting GF(2)-polynomial evaluation of the 8 bank columns.""" + banks = [{((), j)} for j in range(8)] + levels = [-1] * 4 + trace = [] + def encoded(row, stages): + result = row + for stage in stages: + result = {((stage,) + word, column) for word, column in result} + return result + for index, event in enumerate(ordered): + op = event.get("op") + if op == "code sweep": + pair, side = event["pair"], int(event["side"] == "Y") + for stage in event["stages"]: + require((side == 1 and (levels[pair] == -1 or stage > levels[pair])) + or (side == 0 and levels[pair] >= stage), + "abstract sweep native-level side premise") + coordinate = 2 * pair + side + banks[coordinate] = encoded(banks[coordinate], event["stages"]) + elif op == "complete local coded call": + pair, stage = event["pair"], event["stage"] + require(levels[pair] == stage - 1, "abstract local incoming native level") + x, y = banks[2 * pair:2 * pair + 2] + if event["reverse"]: + banks[2 * pair:2 * pair + 2] = [x ^ y, encoded(y, [stage])] + else: + coded_x = encoded(x, [stage]) + banks[2 * pair:2 * pair + 2] = [coded_x, y ^ coded_x] + levels[pair] = stage + elif op == "unchanged idle child": + pair = event["pair"] + require(levels[pair] == event["source_level"], "abstract idle incoming chart") + levels[pair] = event["target_level"] + elif event.get("kind") == "bridge": + d, s = event["dst"], event["src"] + require(levels[d] == levels[s], "abstract bridge common native chart") + banks[2 * d] ^= banks[2 * s] + banks[2 * s + 1] ^= banks[2 * d + 1] + else: + require(event.get("kind") == "exchange" and levels == [8] * 4, + "abstract terminal exchange") + banks = [banks[j ^ 1] for j in range(8)] + trace.append([sorted(row) for row in banks]) + endpoint = [{(tuple(range(8, -1, -1)), j)} for j in range(8)] + require(banks == endpoint, "abstract all-column common-code endpoint") + return { + "coefficient_ring": "free noncommuting polynomial algebra over GF(2)", + "independent_bank_columns": 8, + "generator_labels": list(range(9)), + "all_controller_events": len(ordered), + "all_prefixes_sha256": digest(trace), + "endpoint": "diag(G8 G7 ... G0, ..., G8 G7 ... G0)", + "endpoint_verified": True, + "scope": "Formal binary VALUE model only. Arbitrary substitution of linear " + "maps for G_s is allowed by polynomial evaluation. This does not " + "identify the integer lifted target with that binary local formula.", + } + + +def controller_bound(ordered, local, source): + bank = [[1, 1] for _ in range(4)] + maximum = 1 + counts = Counter() + transcript = [] + local_checkpoints = [] + directions = ["forward", "inverse"] + seen_stages = [] + for index, event in enumerate(ordered): + before = [list(pair) for pair in bank] + op = event.get("op") + entry = {"controller_event": index, "before": before} + if op == "code sweep": + pair = event["pair"] + require(0 <= pair < 4 and event["side"] in ("X", "Y"), "code bank") + side = int(event["side"] == "Y") + factors = [] + for stage in event["stages"]: + require(type(stage) is int and 0 <= stage <= 8, "code stage") + direction = directions[stage % 2] + prefix = source[direction]["exact_prefix_l1"] * bank[pair][side] + maximum = max(maximum, prefix) + bank[pair][side] *= source[direction]["endpoint_l1"] + counts[direction + "_code"] += 1 + factors.append({"stage": stage, "direction": direction, + "prefix_upper": prefix, "endpoint_upper": bank[pair][side]}) + entry.update(kind="code sweep", factors=factors) + elif op == "complete local coded call": + pair = event["pair"] + stage = event["stage"] + reverse = int(event["reverse"]) + require(0 <= pair < 4 and stage % 2 == reverse, "local source orientation") + source_side = reverse + target_side = 1 - reverse + x, y = bank[pair][source_side], bank[pair][target_side] + h = max(v for pair_values in bank for v in pair_values) + direction = directions[reverse] + envelopes = local[direction]["block_prefix_envelope"] + values = [(a * x + b * y + c * h, (a, b, c)) for a, b, c in envelopes] + prefix, maximizing_block = max(values) + maximum = max(maximum, prefix) + endpoint = local[direction]["endpoint_blocks"] + bank[pair][source_side] = endpoint["source_source_l1"] * x + bank[pair][target_side] = ( + y + endpoint["target_source_l1"] * x + endpoint["target_helper_l1"] * h) + counts["local_" + direction] += 1 + seen_stages.append(stage) + entry.update(kind="local", stage=stage, direction=direction, + source_input=x, target_input=y, hosted_helper_input=h, + maximizing_block=maximizing_block, prefix_upper=prefix) + local_checkpoints.append({"stage": stage, "prefix_upper_bits": maximum.bit_length()}) + elif op == "unchanged idle child": + require(0 <= event["pair"] < 4 and + event["rank"] == 7 * (event["target_level"] - event["source_level"]), + "idle chart rank") + counts["isometric_idle_events"] += 1 + entry.update(kind="assumed isometric idle endpoint", rank=event["rank"]) + elif event.get("kind") == "bridge": + d, s = event["dst"], event["src"] + coefficient = event["coefficient"] + require(0 <= d < 4 and 0 <= s < 4 and d != s and coefficient in (-1, 1), + "bridge schema") + bank[d][0] += abs(coefficient) * bank[s][0] + bank[s][1] += abs(coefficient) * bank[d][1] + maximum = max(maximum, *(v for pair in bank for v in pair)) + counts["scalar_bridge_shears"] += 2 + entry.update(kind="two scalar bank shears", coefficient=coefficient) + elif event.get("kind") == "exchange": + bank = [[y, x] for x, y in bank] + counts["exchange"] += 1 + entry.update(kind="exchange") + else: + raise ValueError("uncovered controller event: " + repr(event)) + entry.update(after=[list(pair) for pair in bank], running_prefix_upper=maximum) + transcript.append(entry) + require(len(ordered) == 56 and seen_stages == list(range(9)), "full ordered controller") + require(counts == Counter(forward_code=35, inverse_code=28, local_forward=5, + local_inverse=4, scalar_bridge_shears=18, + isometric_idle_events=10, exchange=1), "all controller counts") + pf, pr = [source[d]["exact_prefix_l1"] for d in directions] + lf, lr = [local[d]["exact_prefix_l1"] for d in directions] + crude = (1 << 18) * lf**5 * lr**4 * pf**35 * pr**28 + require(maximum <= crude, "block-aware bound below full factor product") + decode_factor = pf**4 * pr**5 + terminal = maximum * decode_factor + return { + "counts": dict(counts), + "controller_event_count": len(ordered), + "sweep_instantiation": source["integer_sweep_binding"], + "ordered_scalar_growth_upper": maximum, + "ordered_scalar_growth_upper_bits": maximum.bit_length(), + "block64_reserve_bits": 64 * ((maximum.bit_length() + 63) // 64), + "crude_product_upper": crude, + "crude_product_upper_bits": crude.bit_length(), + "terminal_decode_factor_upper": decode_factor, + "with_per_bank_nine_factor_decode_upper": terminal, + "with_per_bank_nine_factor_decode_upper_bits": terminal.bit_length(), + "terminal_block64_reserve_bits": 64 * ((terminal.bit_length() + 63) // 64), + "local_stage_checkpoints": local_checkpoints, + "full_ordered_recurrence": transcript, + "full_ordered_recurrence_sha256": digest(transcript), + } + + +def row_adjoint_coefficients(events, output, mutation=None): + """Scalar dual recurrence; independent of the sparse-column implementation.""" + row = [0] * DIM + row[output] = 1 + coefficients = [0] * len(events) + for i in range(len(events) - 1, -1, -1): + op, dst, src, c, rank, original = events[i] + coefficients[i] = row[dst] + if op == "add": + if mutation == "wrong_adjoint": + row[dst] += c * row[src] + else: + row[src] += c * row[dst] + elif op == "copy": + row[src] += row[dst] + row[dst] = 0 + elif op == "clear": + row[dst] = 0 + return coefficients + + +def impulse(events, after_event, coordinate, mutation=None): + values = [0] * DIM + values[coordinate] = 1 + suffix = events[after_event + 1:] + if mutation == "wrong_order": + suffix = list(reversed(suffix)) + return forward_values(suffix, values, mutation=mutation) + + +def suffix_row(events, before_event, output): + """One full row of M_last ... M_before_event, by scalar backward recurrence.""" + row = [0] * DIM + row[output] = 1 + for op, dst, src, c, rank, original in reversed(events[before_event:]): + if op == "add": + row[src] += c * row[dst] + elif op == "copy": + row[src] += row[dst] + row[dst] = 0 + elif op == "clear": + row[dst] = 0 + return row + + +def as_sparse(values): + return [(j, v) for j, v in enumerate(values) if v] + + +def suffix_audit(events): + # Column j is S_i e_j, where S_i consists of events strictly after i. + columns = [{j: 1} for j in range(DIM)] + row_norms = [1] * DIM + groups = Counter() + sums_max = Counter() + row_sums = {} + suffix_peak = {"before_event": len(events), "output": 0, "row_l1": 1} + peak = {"after_event": len(events) - 1, "destination": events[-1][1], + "influence": 0, "column": {}} + columns_digest = sha256() + selected_indices = {0, len(events) // 5, len(events) // 2, + 4 * len(events) // 5, len(events) - 1} + selected_indices.update(i for i, event in enumerate(events) if event[0] in ("copy", "clear")) + selected_columns = {} + influences = [0] * len(events) + for i in range(len(events) - 1, -1, -1): + op, dst, src, c, rank, original = events[i] + column = columns[dst] + influence = max((abs(v) for v in column.values()), default=0) + influences[i] = influence + categories = [op, "all_events"] + if op != "clear": + categories.append("exact_clear") + if op in ("move", "copy"): + categories += ["move_and_copy", "paid_rank_" + str(rank)] + for group in categories: + groups[group] += 1 + sums_max[group] += influence + totals = row_sums.setdefault(group, [0] * DIM) + for row, value in column.items(): + totals[row] += abs(value) + if influence > peak["influence"]: + peak = {"after_event": i, "destination": dst, + "influence": influence, "column": dict(column)} + if i in selected_indices: + selected_columns[i] = dict(column) + columns_digest.update(canonical([i, sparse_items(column)]) + b"\n") + # Exact right multiplication S <- S M_i. + if op in ("add", "copy"): + multiplier = c if op == "add" else 1 + target = columns[src] + for row, value in columns[dst].items(): + old = target.get(row, 0) + new = old + multiplier * value + row_norms[row] += abs(new) - abs(old) + if new: + target[row] = new + else: + target.pop(row, None) + if op in ("copy", "clear"): + for row, value in columns[dst].items(): + row_norms[row] -= abs(value) + columns[dst] = {} + candidate = max(row_norms) + if candidate > suffix_peak["row_l1"]: + suffix_peak = {"before_event": i, "output": row_norms.index(candidate), "row_l1": candidate} + independently_summed = [0] * DIM + for column in columns: + for row, value in column.items(): + independently_summed[row] += abs(value) + require(independently_summed == row_norms, "complete final suffix row accounting") + peak_row = suffix_row(events, suffix_peak["before_event"], suffix_peak["output"]) + require(sum(map(abs, peak_row)) == suffix_peak["row_l1"], + "independent scalar adjoint confirms maximum suffix row") + peak_row_signs = [1 if v > 0 else -1 if v < 0 else 0 for v in peak_row] + suffix_output = forward_values(events[suffix_peak["before_event"]:], peak_row_signs) + require(suffix_output[suffix_peak["output"]] == suffix_peak["row_l1"], + "maximum suffix row sign vector forward attainment") + suffix_peak.update(row_sparse=as_sparse(peak_row), + forward_attained_coordinate=suffix_output[suffix_peak["output"]]) + selected_columns[peak["after_event"]] = peak["column"] + impulses = [] + for i, expected in sorted(selected_columns.items()): + observed = impulse(events, i, events[i][1]) + require(dict(as_sparse(observed)) == expected, "forward impulse and reverse adjoint") + impulses.append({"after_event": i, "original_record": events[i][-1], + "destination": events[i][1], "influence": influences[i], + "output_sparse_sha256": digest(as_sparse(observed)), + "nonzero_outputs": len(expected)}) + peak_output = min(j for j, v in peak["column"].items() if abs(v) == peak["influence"]) + witness_coefficients = row_adjoint_coefficients(events, peak_output) + require(witness_coefficients[peak["after_event"]] == peak["column"][peak_output], + "peak scalar adjoint agrees") + wrong_coefficients = row_adjoint_coefficients(events, peak_output, "wrong_adjoint") + wrong_candidates = [i for i, e in enumerate(events) + if wrong_coefficients[i] != witness_coefficients[i]] + require(wrong_candidates, "wrong-adjoint negative control must fail") + bad_i = next((i for i in wrong_candidates if witness_coefficients[i]), wrong_candidates[0]) + direct = impulse(events, bad_i, events[bad_i][1]) + require(direct[peak_output] == witness_coefficients[bad_i] != wrong_coefficients[bad_i], + "source-specific wrong-adjoint control") + correct_peak = impulse(events, peak["after_event"], peak["destination"]) + wrong_order = impulse(events, peak["after_event"], peak["destination"], "wrong_order") + require(wrong_order != correct_peak, "source-specific reversed-order control") + copy_control = None + for i, event in enumerate(events): + if event[0] != "copy": + continue + source_coordinate = event[2] + correct = impulse(events, i - 1, source_coordinate) + ignored = impulse(events, i - 1, source_coordinate, "ignore_copy") + if correct != ignored: + output = next(j for j in range(DIM) if correct[j] != ignored[j]) + copy_control = { + "before_copy_event": i, "injected_coordinate": source_coordinate, + "output_coordinate": output, "correct": correct[output], "ignored_copy": ignored[output], + } + break + require(copy_control is not None, "source-specific ignored-COPY control") + aggregates = {} + for group, sums in sorted(row_sums.items()): + maximum = max(sums) + output = sums.index(maximum) + aggregates[group] = { + "event_count": groups[group], + "exact_linf_defect_constant": maximum, + "maximizing_output": output, + "row_sums": sums, + "loose_sum_of_event_linf_influences": sums_max[group], + } + aggregate_witnesses = {} + for group in ("all_events", "exact_clear", "move_and_copy"): + maximum = aggregates[group]["exact_linf_defect_constant"] + output = aggregates[group]["maximizing_output"] + coefficients = row_adjoint_coefficients(events, output) + admitted = [ + group == "all_events" or group == "exact_clear" and e[0] != "clear" + or group == "move_and_copy" and e[0] in ("move", "copy") + for e in events + ] + signs = [(1 if a > 0 else -1 if a < 0 else 0) if allowed else 0 + for a, allowed in zip(coefficients, admitted)] + require(sum(abs(a) for a, allowed in zip(coefficients, admitted) if allowed) == maximum, + "dual row reproduces exact aggregate") + observed = forward_values(events, [0] * DIM, impulses=signs) + require(observed[output] == maximum and max(map(abs, observed)) == maximum, + "simultaneous signed errors attain aggregate exactly") + all_positive = [int(allowed) for allowed in admitted] + positive_observed = forward_values(events, [0] * DIM, impulses=all_positive) + signed_sum = sum(a for a, allowed in zip(coefficients, admitted) if allowed) + require(positive_observed[output] == signed_sum, "all-positive error replay") + require(abs(signed_sum) < maximum, "error-sign cancellation control is strict") + aggregate_witnesses[group] = { + "output_coordinate": output, "attained": maximum, + "signed_coefficients": coefficients, + "admitted_event_mask_sha256": digest(admitted), + "attaining_error_signs": signs, + "forward_output_sparse": as_sparse(observed), + "all_positive_errors_at_same_output": signed_sum, + "strict_sign_cancellation": True, + } + peak.pop("column") + peak.update(original_record=events[peak["after_event"]][-1], output_coordinate=peak_output, + output_sparse=as_sparse(correct_peak)) + return { + "events": len(events), + "normalized_event_sha256": digest(events), + "per_event_single_destination_influences": influences, + "per_event_single_destination_influences_sha256": digest(influences), + "all_destination_columns_reverse_order_sha256": columns_digest.hexdigest(), + "maximum_suffix_row_l1": suffix_peak["row_l1"], + "maximum_suffix_row_l1_witness": suffix_peak, + "maximum_single_destination_influence": peak["influence"], + "peak_impulse_witness": peak, + "groups": aggregates, + "aggregate_attainment_witnesses": aggregate_witnesses, + "independent_forward_impulse_checks": impulses, + "negative_controls": { + "wrong_adjoint": {"after_event": bad_i, "output": peak_output, + "correct": witness_coefficients[bad_i], + "wrong": wrong_coefficients[bad_i]}, + "wrong_suffix_order": { + "after_event": peak["after_event"], + "correct_output_sha256": digest(correct_peak), + "wrong_order_output_sha256": digest(wrong_order), + "wrong_order_norm": max(map(abs, wrong_order)), + }, + "ignored_copy": copy_control, + "error_signs": "For each aggregate witness, all-positive errors strictly " + "underachieve at the maximizing output; the saved signs " + "attain the exact absolute-coefficient sum.", + }, + } + + +def compare_words(parent, candidate): + result = {} + for direction in ("forward", "inverse"): + a = parent["suffix"][direction] + b = candidate["suffix"][direction] + old = a["per_event_single_destination_influences"] + new = b["per_event_single_destination_influences"] + increased = [i for i, (x, y) in enumerate(zip(old, new)) if y > x] + decreased = [i for i, (x, y) in enumerate(zip(old, new)) if y < x] + equal = [i for i, (x, y) in enumerate(zip(old, new)) if y == x] + require(len(increased) + len(decreased) + len(equal) == 16102, "all defect comparisons") + changes = {} + for group in a["groups"]: + changes[group] = { + "parent_exact_aggregate": a["groups"][group]["exact_linf_defect_constant"], + "candidate_exact_aggregate": b["groups"][group]["exact_linf_defect_constant"], + "parent_loose_sum": a["groups"][group]["loose_sum_of_event_linf_influences"], + "candidate_loose_sum": b["groups"][group]["loose_sum_of_event_linf_influences"], + } + result[direction] = { + "increased_event_count": len(increased), + "decreased_event_count": len(decreased), + "equal_event_count": len(equal), + "increased_events_sha256": digest(increased), + "decreased_events_sha256": digest(decreased), + "first_increase": None if not increased else { + "event": increased[0], "parent": old[increased[0]], "candidate": new[increased[0]]}, + "largest_absolute_increase": None if not increased else ( + lambda i: {"event": i, "parent": old[i], "candidate": new[i]})( + max(increased, key=lambda j: new[j] - old[j])), + "group_comparison": changes, + } + return result + + +def run(parent_path, candidate_path, controller_path): + parent_obj, parent_hashes = load_word(parent_path, "parent") + candidate_obj, candidate_hashes = load_word(candidate_path, "candidate") + controller_obj, controller_hashes = read_json(controller_path) + require(controller_hashes["decoded_sha256"] == PINS["controller_decoded"], + "controller decoded source pin") + abstract_schedule = abstract_schedule_audit(controller_obj["ordered_controller"]) + parent_records, candidate_records = parent_obj["records"], candidate_obj["records"] + changed = [] + for index, (old, new) in enumerate(zip(parent_records, candidate_records)): + if old == new: + continue + require(old[:3] == new[:3] and old[4:] == new[4:] and + old[0] == 1 and old[5] == 23 and old[3] == 1 and new[3] == -1, + "only phase23 signs change") + changed.append(index) + require(len(changed) == 23, "exactly 23 changed signs") + outputs = {} + for label, records, hashes in ( + ("parent", parent_records, parent_hashes), + ("candidate", candidate_records, candidate_hashes)): + normalized = {d: events_of(records, d == "inverse") for d in ("forward", "inverse")} + ranges, rows = {}, [] + suffixes = {} + for direction in ("forward", "inverse"): + ranges[direction], endpoint = range_audit(normalized[direction]) + rows.append(endpoint) + suffixes[direction] = suffix_audit(normalized[direction]) + code = source_code_audit(records, controller_obj["inplace_code_CNOTs"], rows) + controller = controller_bound(controller_obj["ordered_controller"], ranges, code) + paid = Counter() + for op, dst, src, c, rank, phase in records: + if op == 0: + paid[rank] += 1 + elif op == 2: + paid[phase] += 1 + require(sum(rank * count for rank, count in paid.items()) == 4989, "full paid rank mass") + outputs[label] = { + "source": hashes, "record_count": len(records), "public_inputs": PUBLIC, + "helper_inputs": PUBLIC - 2 * PORTS, "private_coordinate": PRIVATE, + "opcode_counts": dict(Counter(OPNAMES[r[0]] for r in records)), + "paid_rank_counts": dict(sorted(paid.items())), + "paid_rank_mass": sum(rank * count for rank, count in paid.items()), + "range": ranges, "source_code": code, "controller": controller, + "suffix": suffixes, + } + return { + "status": "PASS_EXACT_RANGE_AND_ATOMIC_DEFECT_CONSTANTS_NO_PRECISION_ADMISSION", + "schema": "b04-range-and-atomic-defect-review-v1", + "checker_sha256": sha256(Path(__file__).read_bytes()).hexdigest(), + "controller_source": controller_hashes, + "controller_ordered_events_sha256": digest(controller_obj["ordered_controller"]), + "abstract_binary_schedule": abstract_schedule, + "changed_phase23_sign_record_indices": changed, + "parent": outputs["parent"], + "candidate": outputs["candidate"], + "comparison": compare_words(outputs["parent"], outputs["candidate"]), + "scope": { + "arithmetic": "exact unbounded integers; exact normalized atomic operations", + "norm": "maximum absolute scalar coordinate, including the private coordinate", + "defects": "independent scalar additive errors after each admitted event in its " + "single destination; MOVE is the identity in this normalized model", + "copy_extension": "COPY overwrites the private coordinate with its source; " + "ERASE assigns private zero. This noninvertible extension " + "is conditional and does not justify physical cleanup.", + "strict_cleanup": "The exact_clear aggregate sets all ERASE defects to zero; " + "actual rounded copy/zero-return still requires a separate proof.", + "controller": "Conditional on source-selected codes at admitted native charts, " + "isometric frame/owner/address maps and exact helper restoration.", + "excluded": ["native-child internal prefixes and defects", "actual rounding/tie rules", + "overflow or finite machine exponent admission", "relative error feedback", + "tape/storage/work invoice", "general sign optimality", + "global integer BIT identity", "new supplier or kappa"], + "proof_kind": "finite exhaustive integer calculation plus written all-input " + "conditional linear-algebra proof; no formal-kernel proof", + }, + } + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--parent-word", required=True) + parser.add_argument("--candidate-word", required=True) + parser.add_argument("--controller", required=True, + help="pinned JSON or gzip JSON; decoded bytes are bound") + parser.add_argument("--output", help="write deterministic JSON or .gz JSON receipt") + parser.add_argument("--verify", help="require equality with an existing JSON/.gz receipt") + args = parser.parse_args() + result = run(args.parent_word, args.candidate_word, args.controller) + if args.verify: + old, _ = read_json(args.verify) + require(canonical(old) == canonical(result), "complete deterministic receipt differs") + if args.output: + body = (json.dumps(result, sort_keys=True, indent=2) + "\n").encode() + if args.output.endswith(".gz"): + body = gzip.compress(body, mtime=0) + Path(args.output).write_bytes(body) + print(result["status"]) + for label in ("parent", "candidate"): + r = result[label] + print(label, "range", [r["range"][d]["exact_prefix_l1"] for d in ("forward", "inverse")], + "controller bits", r["controller"]["ordered_scalar_growth_upper_bits"], + "terminal bits", r["controller"]["with_per_bank_nine_factor_decode_upper_bits"]) + for d in ("forward", "inverse"): + s = r["suffix"][d] + print(" ", d, "peak impulse", s["maximum_single_destination_influence"], + "exact aggregate", s["groups"]["exact_clear"]["exact_linf_defect_constant"], + "loose sum", s["groups"]["exact_clear"]["loose_sum_of_event_linf_influences"]) + print("receipt_sha256", digest(result)) + + +if __name__ == "__main__": + try: + main() + except (ValueError, KeyError, TypeError) as error: + print("FAIL:", error, file=sys.stderr) + raise SystemExit(1) diff --git a/research/r429-signed-range/verify.py b/research/r429-signed-range/verify.py new file mode 100644 index 0000000000..d9d581477a --- /dev/null +++ b/research/r429-signed-range/verify.py @@ -0,0 +1,245 @@ +#!/usr/bin/env python3 +"""Source-bound replay of a fixed signed lift, without repeating its search. + +Ross Richardson with substantial OpenAI Codex assistance. Apache-2.0. +""" +import argparse +import ast +from collections import Counter +from fractions import Fraction +import gzip +import hashlib +import json +from pathlib import Path +import sys +import tempfile +from types import SimpleNamespace + + +def need(condition, message): + if not condition: + raise ValueError(message) + + +def canonical(value): + return json.dumps(value, sort_keys=True, separators=(",", ":"), ensure_ascii=False) + + +class Frozen: + def __init__(self, root): + self.root = Path(root).resolve() + self.hashes = json.loads((self.root / "FROZEN-SHA256.json").read_bytes()) + self.executed = {} + self.compared = set() + + def raw(self, name): + need(name in self.hashes, "unregistered frozen input: " + name) + data = (self.root / name).read_bytes() + need(hashlib.sha256(data).hexdigest() == self.hashes[name], + "frozen input changed: " + name) + return data + + def decoded(self, name): + data = self.raw(name) + return gzip.decompress(data) if data.startswith(b"\x1f\x8b") else data + + def data(self, name): + return json.loads(self.decoded(name)) + + def check_all(self): + for name in self.hashes: + self.raw(name) + origins = json.loads((self.root / "ORIGINS.json").read_bytes()) + for name, row in origins.items(): + if "original_sha256" in row: + need(hashlib.sha256(self.decoded(name)).hexdigest() == row["original_sha256"], + "compressed original bytes changed: " + name) + + def functions(self, name, names, globals_): + """Compile only named original definitions from authenticated bytes.""" + tree = ast.parse(self.raw(name), filename=str(self.root / name)) + nodes = [n for n in tree.body if isinstance(n, ast.FunctionDef) and n.name in names] + need(Counter(n.name for n in nodes) == Counter(names), "function selection changed") + code = compile(ast.Module(body=nodes, type_ignores=[]), str(self.root / name), + "exec", dont_inherit=True, optimize=0) + namespace = dict(globals_) + exec(code, namespace) + self.executed[name] = list(names) + return SimpleNamespace(**{name: namespace[name] for name in names}) + + def compare(self, name, value): + need(canonical(value) == canonical(self.data(name)), "complete receipt mismatch: " + name) + self.compared.add(name) + + def module(self, name): + namespace = {"__name__": "authenticated_review", "__file__": str(self.root / name)} + code = compile(self.raw(name), str(self.root / name), "exec", + dont_inherit=True, optimize=0) + exec(code, namespace) + self.executed[name] = ["complete independent checker"] + return namespace + + +def retained_functions(frozen): + cap = frozen.functions("frozen/old/bit_cap_copy_local.py", ["need", "canonical", "rank"], + {"json": json, "Q": Fraction}) + scalar = frozen.functions( + "frozen/old/bit_signed_audit.py", + ["identity", "add", "row_weights", "parity", "block_norms", "code", "global_bound"], + {"N": 660, "V": 111, "need": need, "Counter": Counter}) + prune = frozen.functions("frozen/old/bit_prune_audit.py", ["execute"], + {"need": need, "cap": cap, "scalar": scalar, "Counter": Counter}) + growth = frozen.functions("frozen/old/bit_pruned_growth.py", ["coefficients"], + {"scalar": scalar}) + scoring = frozen.functions("frozen/old/signed_quotient_search.py", ["score"], {}) + return cap, scalar, prune, growth, scoring + + +def historical(frozen): + cap, scalar, prune, growth, scoring = retained_functions(frozen) + parent = frozen.data("frozen/parent/WORD.json.gz") + candidate = frozen.data("frozen/candidate/WORD.json.gz") + raw = frozen.data("frozen/geometry/WORD.json.gz") + baseline, records = parent["records"], candidate["records"] + need(len(records) == len(baseline) == 16102, "complete literal word length") + positions = [i for i, r in enumerate(baseline) if r[0] == 1 and r[5] == 23] + need(len(positions) == 47 and all(baseline[i][3] == 1 for i in positions), + "fixed binary quotient alphabet") + signs = [records[i][3] for i in positions] + need(all(c in (-1, 1) for c in signs) and signs.count(-1) == 23, + "fixed signed witness") + changed = [r[:] for r in baseline] + for i, c in zip(positions, signs): + changed[i][3] = c + need(candidate == dict(parent, format="coded-r429-signed-quotient-variant-v1", + records=changed), "change outside declared quotient signs") + pivots = sorted({baseline[i][j] for i in positions for j in (1, 2)}) + need(len(pivots) == 9, "quotient register count") + index = {p: i for i, p in enumerate(pivots)} + gates = [(index[baseline[i][1]], index[baseline[i][2]]) for i in positions] + keep = [i for i in range(660) if i not in range(471, 480)] + need(parent["start"] == [raw["start"][i] for i in keep] + and parent["final"] == [raw["final"][i] for i in keep], "physical boundary binding") + forward, fs = prune.execute(raw, keep, records) + inverse, rs = prune.execute(raw, keep, records, True) + roundtrip, _ = prune.execute(raw, keep, records, True, forward) + need(roundtrip == scalar.identity(651), "full signed integer roundtrip") + oldforward, oldfs = prune.execute(raw, keep, baseline) + oldinverse, oldrs = prune.execute(raw, keep, baseline, True) + need(scalar.parity(forward) == scalar.parity(oldforward) + and scalar.parity(inverse) == scalar.parity(oldinverse), + "complete binary endpoints changed") + need(all(forward[i] == inverse[i] == {i: 1} for i in range(222, 651)), + "arbitrary integer helper restoration") + receipt = { + "status": "PASS_LOCAL_INTEGER_SIGN_VARIANT_SAME_F2_AND_RANK_NO_PRECISION_ADMISSION", + "parent_sha256": hashlib.sha256(frozen.raw("frozen/parent/WORD.json.gz")).hexdigest(), + "word_sha256": hashlib.sha256(frozen.raw("frozen/candidate/WORD.json.gz")).hexdigest(), + "word_canonical_sha256": hashlib.sha256(frozen.decoded("frozen/candidate/WORD.json.gz")).hexdigest(), + "original_small_score": list(scoring.score(gates, [1] * 47)), + "new_small_score": list(scoring.score(gates, signs)), + "quotient_signs": signs, "changed_gates": 23, "forward": fs, "inverse": rs, + "scope": "47fixedbinaryquotientgates only; all651integer/F2columns andhelpers. Notthepublishedword; no globalprecision/stock/controller/tape or kappa.", + } + # JSON converts histogram integer keys in the original returned value. + receipt = json.loads(json.dumps(receipt)) + frozen.compare("frozen/candidate/RESULT.json", receipt) + ordered = frozen.data("frozen/controller/WORD.json.gz")["ordered_controller"] + bounds = {} + for label, word, pair in (("parent", parent, [oldfs, oldrs]), + ("candidate", candidate, [fs, rs])): + rows, maxima, envelopes = [], [], [] + for backward in (False, True): + result, maximum, envelope = growth.coefficients(word["records"], backward) + rows.append(result) + maxima.append(maximum) + envelopes.append(envelope) + need(maxima == [r["prefix_row_l1"] for r in pair], "two retained prefix calculations disagree") + code_records, code_rows, code_prefix, code_norm = scalar.code(word["records"]) + need(len(code_records) == 1499 and rows[0][:111] == code_rows[0] + and rows[1][:111] == code_rows[1], "selected source-code interface") + bound = scalar.global_bound( + ordered, [scalar.block_norms(a) for a in rows], maxima, envelopes, + code_prefix, code_norm) + bounds[label] = { + "local_prefix": maxima, "code_prefix": code_prefix, "code_endpoint_norm": code_norm, + "whole_controller": bound, + "terminal_64_bit_reserve": 64 * ((bound["after_easy_completed_bank_decode_upper_bits"] + 63) // 64), + } + signed_growth = { + "status": "NORMALIZED_SIGN_VARIANT_GROWTH_ONLY_NO_NATIVE_CHILD_ERROR_ADMISSION", + "word_canonical_sha256": receipt["word_canonical_sha256"], + **{k: bounds["candidate"][k] for k in + ("local_prefix", "code_prefix", "code_endpoint_norm", "whole_controller")}, + } + frozen.compare("frozen/candidate/GROWTH.json", signed_growth) + return { + "status": "PASS_FIXED_SIGNED_WITNESS_AND_NORMALIZED_RANGE", + "baseline": bounds["parent"], "candidate": bounds["candidate"], + "full_signed_receipts_compared": sorted(frozen.compared), + "executed_original_functions": frozen.executed, + "search_repeated": False, + "controller_contract": "Instantiate each abstract ordered code sweep with this word's actual 1499 source ADDs or their literal inverse; legacy inplace_code_CNOTs are not the selected integer code.", + "no_precision_admission": True, + } + + +def independent(frozen, stage): + names = { + "integer": ("frozen/reviews/integer/check_integer.py", + "frozen/reviews/integer/CHECKS.json.gz"), + "range": ("frozen/reviews/range/check_range.py", + "frozen/reviews/range/CHECKS.json.gz"), + } + source, receipt = names[stage] + module = frozen.module(source) + old_argv = sys.argv + with tempfile.TemporaryDirectory(prefix="signed R429 check ") as tmp: + output = Path(tmp) / "fresh.json" + sys.argv = [str(frozen.root / source), + "--parent-word", str(frozen.root / "frozen/parent/WORD.json.gz")] + if stage == "integer": + sys.argv += [ + "--signed-word", str(frozen.root / "frozen/candidate/WORD.json.gz"), + "--raw-word", str(frozen.root / "frozen/geometry/WORD.json.gz"), + "--matrices", str(frozen.root / "frozen/geometry/MATRICES.json.gz"), + "--out", str(output)] + else: + sys.argv += [ + "--candidate-word", str(frozen.root / "frozen/candidate/WORD.json.gz"), + "--controller", str(frozen.root / "frozen/controller/WORD.json.gz"), + "--output", str(output)] + try: + module["main"]() + frozen.compare(receipt, json.loads(output.read_bytes())) + finally: + sys.argv = old_argv + return {"status": "PASS_INDEPENDENT_SIGNED_R429_" + stage.upper(), + "complete_receipt": receipt, "no_precision_admission": True} + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--stage", choices=["historical", "integer", "range"], required=True) + parser.add_argument("--output", type=Path) + args = parser.parse_args() + frozen = Frozen(Path(__file__).resolve().parent) + frozen.check_all() + if args.stage == "historical": + result = historical(frozen) + frozen.compare("frozen/historical/REPLAY.json", result) + expected_receipts = {"frozen/candidate/RESULT.json", "frozen/candidate/GROWTH.json", + "frozen/historical/REPLAY.json"} + else: + result = independent(frozen, args.stage) + expected_receipts = {result["complete_receipt"]} + need(frozen.compared == expected_receipts, "incomplete receipt coverage") + frozen.check_all() + if args.output: + need(not args.output.resolve().is_relative_to(frozen.root), "output must be external") + args.output.write_text(json.dumps(result, indent=2) + "\n") + print(canonical(result)) + + +if __name__ == "__main__": + main()