diff --git a/research/staged-compensation-forests/.gitattributes b/research/staged-compensation-forests/.gitattributes new file mode 100644 index 0000000000..9b80cb5c3e --- /dev/null +++ b/research/staged-compensation-forests/.gitattributes @@ -0,0 +1,2 @@ +frozen/producers/bw_emit.py -text whitespace=trailing-space,space-before-tab,cr-at-eol +frozen/producers/bw_transport.py -text whitespace=trailing-space,space-before-tab,cr-at-eol diff --git a/research/staged-compensation-forests/CONTROL-VALIDATION.json b/research/staged-compensation-forests/CONTROL-VALIDATION.json new file mode 100644 index 0000000000..4a96acd423 --- /dev/null +++ b/research/staged-compensation-forests/CONTROL-VALIDATION.json @@ -0,0 +1,17 @@ +{ + "controls_sha256": "cb25c9ce5b7ebf6f0f589b1749424036dbc7f5c752d7e34e7559d545be36c1f3", + "full_normal_and_optimized_receipts_byte_identical": true, + "runs": [ + { + "outer_optimization": 0, + "receipt_sha256": "7ed2337a7a39f6dc2d4e113b938c823459e84c170fa841b7a7fa783a703337c8", + "seconds": 4.207446083979448 + }, + { + "outer_optimization": 1, + "receipt_sha256": "7ed2337a7a39f6dc2d4e113b938c823459e84c170fa841b7a7fa783a703337c8", + "seconds": 4.195838083018316 + } + ], + "status": "PASS_C01_CONTROL_DRIVER_BYTE_EQUALITY" +} diff --git a/research/staged-compensation-forests/CONTROLS.json b/research/staged-compensation-forests/CONTROLS.json new file mode 100644 index 0000000000..075c6eb58c --- /dev/null +++ b/research/staged-compensation-forests/CONTROLS.json @@ -0,0 +1,1050 @@ +{ + "actual_single_compensation_panel_replayed": true, + "full_wholeword_or_edge_census_replayed": false, + "no_new_kappa": true, + "normal_and_optimized_receipts_equal_except_mode": true, + "runs": [ + { + "actual_mathematics": { + "actual_authenticated_candidate": true, + "all_arbitrary_input_columns": 632, + "named_endpoint_gate_deletion_detected": true, + "rejections": [ + { + "intended_gate": "complete arbitrary-input panel endpoint", + "name": "actual_target_basis_sign" + } + ], + "witness": { + "actual": "-2", + "column": 163, + "expected": "0", + "row": 156 + } + }, + "compression": { + "equivalent_recompression_accepted": true, + "rejections": [ + { + "intended_gate": "changed frozen input: original.json.gz", + "name": "changed_compressed_input" + }, + { + "intended_gate": "origin digest mismatch: original.json.gz", + "name": "changed_container_origin" + }, + { + "intended_gate": "original decoded bytes changed: original.json.gz", + "name": "changed_original_after_transport_rebinding" + }, + { + "intended_gate": "frozen/origin inventory mismatch", + "name": "omitted_origin" + } + ] + }, + "coverage": { + "named_coverage_gate_deletion_detected": true, + "real_dispatch_with_tiny_fixtures_passes": true, + "rejections": [ + { + "intended_gate": "complete stage record coverage changed: construction", + "name": "construction_omission" + }, + { + "intended_gate": "complete stage record coverage changed: construction", + "name": "construction_duplicate" + }, + { + "intended_gate": "complete stage record coverage changed: construction", + "name": "construction_extra" + }, + { + "intended_gate": "complete stage record coverage changed: forest", + "name": "forest_omission" + }, + { + "intended_gate": "complete stage record coverage changed: forest", + "name": "forest_duplicate" + }, + { + "intended_gate": "complete stage record coverage changed: forest", + "name": "forest_extra" + }, + { + "intended_gate": "complete stage record coverage changed: wholeword", + "name": "wholeword_omission" + }, + { + "intended_gate": "complete stage record coverage changed: wholeword", + "name": "wholeword_duplicate" + }, + { + "intended_gate": "complete stage record coverage changed: wholeword", + "name": "wholeword_extra" + }, + { + "intended_gate": "construction output inventory changed", + "name": "extra_generated_construction_artifact" + }, + { + "intended_gate": "complete stage record coverage changed: construction", + "name": "deleted_actual_compare_call" + } + ], + "stage_counts": { + "construction": 13, + "forest": 1, + "wholeword": 1 + } + }, + "loader": { + "captured_source_survives_disposable_path_change": true, + "child_assertions_enabled": true, + "file_and_argument_semantics_preserved": true, + "rejections": [ + { + "intended_gate": "AssertionError: DIRECT_ASSERT", + "name": "direct.py" + }, + { + "intended_gate": "AssertionError: NESTED_ASSERT", + "name": "nested.py" + }, + { + "intended_gate": "changed frozen input: direct.py", + "name": "changed_executable_source" + }, + { + "intended_gate": "missing regular input: direct.py", + "name": "missing_executable_source" + }, + { + "intended_gate": "unregistered input: absent.py", + "name": "unregistered_source" + }, + { + "intended_gate": "unsafe package path", + "name": "absolute_path" + }, + { + "intended_gate": "unsafe package path", + "name": "parent_escape" + }, + { + "intended_gate": "missing regular input: link.py", + "name": "symlink_input" + }, + { + "intended_gate": "input escapes package", + "name": "ancestor_symlink_escape" + }, + { + "intended_gate": "DIRECT_RUNTIME_GATE", + "name": "direct_runtime_requirement" + } + ] + }, + "nested_producers": { + "nested_captured_source_survives_path_change": true, + "nested_producer_assertions_enabled": true, + "rejections": [ + { + "intended_gate": "AssertionError: NESTED_PRODUCER_ASSERT", + "name": "nested_producer_assertion" + }, + { + "intended_gate": "producer execution buffer hash mismatch: transport", + "name": "nested_producer_changed_source" + } + ] + }, + "parent_optimization": 0, + "real_records": [ + { + "nested_path": [ + "providers", + "base", + "semantic_controls", + 0, + "witnesses", + "dual", + "actual" + ], + "record": "artifacts/DESIGN.json", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/DESIGN.json", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/DESIGN.json", + "name": "nested_omission" + } + ], + "sha256": "81af0f8d0699d79989ba89fc7de8bb7af047c4ca79b05b413a29428d3160a6e9" + }, + { + "nested_path": [ + 0, + 0 + ], + "record": "artifacts/FOREST-COMPENSATION-base.json.gz", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/FOREST-COMPENSATION-base.json.gz", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/FOREST-COMPENSATION-base.json.gz", + "name": "nested_omission" + } + ], + "sha256": "7a39e3cfe0113743714b1fc38258c36803b20c5f4abeecf977e76ff5da0533e7" + }, + { + "nested_path": [ + 0, + 0 + ], + "record": "artifacts/FOREST-COMPENSATION-extra.json.gz", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/FOREST-COMPENSATION-extra.json.gz", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/FOREST-COMPENSATION-extra.json.gz", + "name": "nested_omission" + } + ], + "sha256": "7a39e3cfe0113743714b1fc38258c36803b20c5f4abeecf977e76ff5da0533e7" + }, + { + "nested_path": [ + "A", + 12, + 3, + 0 + ], + "record": "artifacts/FOREST-WORD-base.json.gz", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/FOREST-WORD-base.json.gz", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/FOREST-WORD-base.json.gz", + "name": "nested_omission" + } + ], + "sha256": "0f9a6750289ff2ccde92580079254f88fa6546e8f1903f88fb869c4e2fbe32c8" + }, + { + "nested_path": [ + "A", + 12, + 3, + 0 + ], + "record": "artifacts/FOREST-WORD-extra.json.gz", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/FOREST-WORD-extra.json.gz", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/FOREST-WORD-extra.json.gz", + "name": "nested_omission" + } + ], + "sha256": "30faba0e589c162e5f7478c2c6f4496d8c5664d81693cf2cf1c7290f2a7d4dd4" + }, + { + "nested_path": [ + "providers", + "base", + "audits", + "FOREST", + "bill", + "coefficient_histogram", + "-1" + ], + "record": "artifacts/INDEPENDENT-FOREST.json.gz", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/INDEPENDENT-FOREST.json.gz", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/INDEPENDENT-FOREST.json.gz", + "name": "nested_omission" + } + ], + "sha256": "058a5377582227aa0784d205e49efe59b0d4ba525afc2cb49a608f06bd51924a" + }, + { + "nested_path": [ + "current_eighth_witnesses", + 0, + 0 + ], + "record": "artifacts/PR1080-COMPARISON.json", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/PR1080-COMPARISON.json", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/PR1080-COMPARISON.json", + "name": "nested_omission" + } + ], + "sha256": "88116932a22a3927bb630fd4ecf3e171663e12e8fd8d0347fa21a840a81482ac" + }, + { + "nested_path": [ + "bills", + "forest", + "histogram", + "-1" + ], + "record": "artifacts/PRICES.json", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/PRICES.json", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/PRICES.json", + "name": "nested_omission" + } + ], + "sha256": "801e9f76954d330c6276ca5f681cd1b361df13538824dbee84373f46c16f93d3" + }, + { + "nested_path": [ + "A", + 12, + 3, + 0 + ], + "record": "artifacts/SOURCE-base.json.gz", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/SOURCE-base.json.gz", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/SOURCE-base.json.gz", + "name": "nested_omission" + } + ], + "sha256": "735c540b1fe29d0ceeb4d2f304ec941e5f2bd3bc92bafc8cce2b4f9a67a3b653" + }, + { + "nested_path": [ + "A", + 12, + 3, + 0 + ], + "record": "artifacts/SOURCE-extra.json.gz", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/SOURCE-extra.json.gz", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/SOURCE-extra.json.gz", + "name": "nested_omission" + } + ], + "sha256": "886338fc32da14f3389a82c8120a1bcf9c5e2f0ec3e9b2d377fdae809e1d977f" + }, + { + "nested_path": [ + 0, + 0 + ], + "record": "artifacts/TWO-SIDED-COMPENSATION-base.json.gz", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/TWO-SIDED-COMPENSATION-base.json.gz", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/TWO-SIDED-COMPENSATION-base.json.gz", + "name": "nested_omission" + } + ], + "sha256": "4119728ab2a3833636a77862bf997b46a50ff7c3c5a874b5d7c675d9577c8546" + }, + { + "nested_path": [ + 0, + 0 + ], + "record": "artifacts/TWO-SIDED-COMPENSATION-extra.json.gz", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/TWO-SIDED-COMPENSATION-extra.json.gz", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/TWO-SIDED-COMPENSATION-extra.json.gz", + "name": "nested_omission" + } + ], + "sha256": "4119728ab2a3833636a77862bf997b46a50ff7c3c5a874b5d7c675d9577c8546" + }, + { + "nested_path": [ + "A", + 12, + 3, + 0 + ], + "record": "artifacts/TWO-SIDED-WORD-base.json.gz", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/TWO-SIDED-WORD-base.json.gz", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/TWO-SIDED-WORD-base.json.gz", + "name": "nested_omission" + } + ], + "sha256": "52f37fbd972cf70ca3ec5edcb9a8bdb4e0bcffa06aa7179dcff4c938a4e7265d" + }, + { + "nested_path": [ + "A", + 12, + 3, + 0 + ], + "record": "artifacts/TWO-SIDED-WORD-extra.json.gz", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/TWO-SIDED-WORD-extra.json.gz", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/TWO-SIDED-WORD-extra.json.gz", + "name": "nested_omission" + } + ], + "sha256": "0591b5386589c43cd10e9c516477bed5ea55d3fb28ee5eab02399b8750c3735d" + }, + { + "nested_path": [ + "providers", + "base", + "historical_rank_basis_panel", + "checks", + "dual", + "prefix", + "exact_row_sum_witness", + "row", + "terms", + 0, + 0, + 0 + ], + "record": "artifacts/WHOLE-WORD.json.gz", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/WHOLE-WORD.json.gz", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/WHOLE-WORD.json.gz", + "name": "nested_omission" + } + ], + "sha256": "8f779bd86348e60c06db984652308e6e3fa96d1a2782ea75e69695f7ed4d741f" + } + ], + "record_gate": { + "named_record_gate_deletion_detected": true, + "rejections": [ + { + "intended_gate": "complete typed record mismatch: expected.json", + "name": "boolean_for_integer" + }, + { + "intended_gate": "complete typed record mismatch: expected.json", + "name": "float_for_integer" + }, + { + "intended_gate": "complete typed record mismatch: expected.json", + "name": "integer_for_boolean" + }, + { + "intended_gate": "complete typed record mismatch: expected.json", + "name": "nested_omission" + }, + { + "intended_gate": "complete typed record mismatch: expected.json", + "name": "ordered_list_reorder" + }, + { + "intended_gate": "complete typed record mismatch: expected.json", + "name": "ordered_list_truncate" + }, + { + "intended_gate": "duplicate JSON key: a", + "name": "duplicate_json_key" + }, + { + "intended_gate": "duplicate JSON key: a", + "name": "nested_duplicate_json_key" + }, + { + "intended_gate": "nonfinite JSON constant: NaN", + "name": "nonfinite_NaN" + }, + { + "intended_gate": "nonfinite JSON constant: Infinity", + "name": "nonfinite_Infinity" + }, + { + "intended_gate": "nonfinite JSON constant: -Infinity", + "name": "nonfinite_-Infinity" + }, + { + "intended_gate": "missing regular input: expected.json", + "name": "missing_expected_record" + } + ] + } + }, + { + "actual_mathematics": { + "actual_authenticated_candidate": true, + "all_arbitrary_input_columns": 632, + "named_endpoint_gate_deletion_detected": true, + "rejections": [ + { + "intended_gate": "complete arbitrary-input panel endpoint", + "name": "actual_target_basis_sign" + } + ], + "witness": { + "actual": "-2", + "column": 163, + "expected": "0", + "row": 156 + } + }, + "compression": { + "equivalent_recompression_accepted": true, + "rejections": [ + { + "intended_gate": "changed frozen input: original.json.gz", + "name": "changed_compressed_input" + }, + { + "intended_gate": "origin digest mismatch: original.json.gz", + "name": "changed_container_origin" + }, + { + "intended_gate": "original decoded bytes changed: original.json.gz", + "name": "changed_original_after_transport_rebinding" + }, + { + "intended_gate": "frozen/origin inventory mismatch", + "name": "omitted_origin" + } + ] + }, + "coverage": { + "named_coverage_gate_deletion_detected": true, + "real_dispatch_with_tiny_fixtures_passes": true, + "rejections": [ + { + "intended_gate": "complete stage record coverage changed: construction", + "name": "construction_omission" + }, + { + "intended_gate": "complete stage record coverage changed: construction", + "name": "construction_duplicate" + }, + { + "intended_gate": "complete stage record coverage changed: construction", + "name": "construction_extra" + }, + { + "intended_gate": "complete stage record coverage changed: forest", + "name": "forest_omission" + }, + { + "intended_gate": "complete stage record coverage changed: forest", + "name": "forest_duplicate" + }, + { + "intended_gate": "complete stage record coverage changed: forest", + "name": "forest_extra" + }, + { + "intended_gate": "complete stage record coverage changed: wholeword", + "name": "wholeword_omission" + }, + { + "intended_gate": "complete stage record coverage changed: wholeword", + "name": "wholeword_duplicate" + }, + { + "intended_gate": "complete stage record coverage changed: wholeword", + "name": "wholeword_extra" + }, + { + "intended_gate": "construction output inventory changed", + "name": "extra_generated_construction_artifact" + }, + { + "intended_gate": "complete stage record coverage changed: construction", + "name": "deleted_actual_compare_call" + } + ], + "stage_counts": { + "construction": 13, + "forest": 1, + "wholeword": 1 + } + }, + "loader": { + "captured_source_survives_disposable_path_change": true, + "child_assertions_enabled": true, + "file_and_argument_semantics_preserved": true, + "rejections": [ + { + "intended_gate": "AssertionError: DIRECT_ASSERT", + "name": "direct.py" + }, + { + "intended_gate": "AssertionError: NESTED_ASSERT", + "name": "nested.py" + }, + { + "intended_gate": "changed frozen input: direct.py", + "name": "changed_executable_source" + }, + { + "intended_gate": "missing regular input: direct.py", + "name": "missing_executable_source" + }, + { + "intended_gate": "unregistered input: absent.py", + "name": "unregistered_source" + }, + { + "intended_gate": "unsafe package path", + "name": "absolute_path" + }, + { + "intended_gate": "unsafe package path", + "name": "parent_escape" + }, + { + "intended_gate": "missing regular input: link.py", + "name": "symlink_input" + }, + { + "intended_gate": "input escapes package", + "name": "ancestor_symlink_escape" + }, + { + "intended_gate": "DIRECT_RUNTIME_GATE", + "name": "direct_runtime_requirement" + } + ] + }, + "nested_producers": { + "nested_captured_source_survives_path_change": true, + "nested_producer_assertions_enabled": true, + "rejections": [ + { + "intended_gate": "AssertionError: NESTED_PRODUCER_ASSERT", + "name": "nested_producer_assertion" + }, + { + "intended_gate": "producer execution buffer hash mismatch: transport", + "name": "nested_producer_changed_source" + } + ] + }, + "parent_optimization": 1, + "real_records": [ + { + "nested_path": [ + "providers", + "base", + "semantic_controls", + 0, + "witnesses", + "dual", + "actual" + ], + "record": "artifacts/DESIGN.json", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/DESIGN.json", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/DESIGN.json", + "name": "nested_omission" + } + ], + "sha256": "81af0f8d0699d79989ba89fc7de8bb7af047c4ca79b05b413a29428d3160a6e9" + }, + { + "nested_path": [ + 0, + 0 + ], + "record": "artifacts/FOREST-COMPENSATION-base.json.gz", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/FOREST-COMPENSATION-base.json.gz", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/FOREST-COMPENSATION-base.json.gz", + "name": "nested_omission" + } + ], + "sha256": "7a39e3cfe0113743714b1fc38258c36803b20c5f4abeecf977e76ff5da0533e7" + }, + { + "nested_path": [ + 0, + 0 + ], + "record": "artifacts/FOREST-COMPENSATION-extra.json.gz", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/FOREST-COMPENSATION-extra.json.gz", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/FOREST-COMPENSATION-extra.json.gz", + "name": "nested_omission" + } + ], + "sha256": "7a39e3cfe0113743714b1fc38258c36803b20c5f4abeecf977e76ff5da0533e7" + }, + { + "nested_path": [ + "A", + 12, + 3, + 0 + ], + "record": "artifacts/FOREST-WORD-base.json.gz", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/FOREST-WORD-base.json.gz", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/FOREST-WORD-base.json.gz", + "name": "nested_omission" + } + ], + "sha256": "0f9a6750289ff2ccde92580079254f88fa6546e8f1903f88fb869c4e2fbe32c8" + }, + { + "nested_path": [ + "A", + 12, + 3, + 0 + ], + "record": "artifacts/FOREST-WORD-extra.json.gz", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/FOREST-WORD-extra.json.gz", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/FOREST-WORD-extra.json.gz", + "name": "nested_omission" + } + ], + "sha256": "30faba0e589c162e5f7478c2c6f4496d8c5664d81693cf2cf1c7290f2a7d4dd4" + }, + { + "nested_path": [ + "providers", + "base", + "audits", + "FOREST", + "bill", + "coefficient_histogram", + "-1" + ], + "record": "artifacts/INDEPENDENT-FOREST.json.gz", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/INDEPENDENT-FOREST.json.gz", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/INDEPENDENT-FOREST.json.gz", + "name": "nested_omission" + } + ], + "sha256": "058a5377582227aa0784d205e49efe59b0d4ba525afc2cb49a608f06bd51924a" + }, + { + "nested_path": [ + "current_eighth_witnesses", + 0, + 0 + ], + "record": "artifacts/PR1080-COMPARISON.json", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/PR1080-COMPARISON.json", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/PR1080-COMPARISON.json", + "name": "nested_omission" + } + ], + "sha256": "88116932a22a3927bb630fd4ecf3e171663e12e8fd8d0347fa21a840a81482ac" + }, + { + "nested_path": [ + "bills", + "forest", + "histogram", + "-1" + ], + "record": "artifacts/PRICES.json", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/PRICES.json", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/PRICES.json", + "name": "nested_omission" + } + ], + "sha256": "801e9f76954d330c6276ca5f681cd1b361df13538824dbee84373f46c16f93d3" + }, + { + "nested_path": [ + "A", + 12, + 3, + 0 + ], + "record": "artifacts/SOURCE-base.json.gz", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/SOURCE-base.json.gz", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/SOURCE-base.json.gz", + "name": "nested_omission" + } + ], + "sha256": "735c540b1fe29d0ceeb4d2f304ec941e5f2bd3bc92bafc8cce2b4f9a67a3b653" + }, + { + "nested_path": [ + "A", + 12, + 3, + 0 + ], + "record": "artifacts/SOURCE-extra.json.gz", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/SOURCE-extra.json.gz", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/SOURCE-extra.json.gz", + "name": "nested_omission" + } + ], + "sha256": "886338fc32da14f3389a82c8120a1bcf9c5e2f0ec3e9b2d377fdae809e1d977f" + }, + { + "nested_path": [ + 0, + 0 + ], + "record": "artifacts/TWO-SIDED-COMPENSATION-base.json.gz", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/TWO-SIDED-COMPENSATION-base.json.gz", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/TWO-SIDED-COMPENSATION-base.json.gz", + "name": "nested_omission" + } + ], + "sha256": "4119728ab2a3833636a77862bf997b46a50ff7c3c5a874b5d7c675d9577c8546" + }, + { + "nested_path": [ + 0, + 0 + ], + "record": "artifacts/TWO-SIDED-COMPENSATION-extra.json.gz", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/TWO-SIDED-COMPENSATION-extra.json.gz", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/TWO-SIDED-COMPENSATION-extra.json.gz", + "name": "nested_omission" + } + ], + "sha256": "4119728ab2a3833636a77862bf997b46a50ff7c3c5a874b5d7c675d9577c8546" + }, + { + "nested_path": [ + "A", + 12, + 3, + 0 + ], + "record": "artifacts/TWO-SIDED-WORD-base.json.gz", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/TWO-SIDED-WORD-base.json.gz", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/TWO-SIDED-WORD-base.json.gz", + "name": "nested_omission" + } + ], + "sha256": "52f37fbd972cf70ca3ec5edcb9a8bdb4e0bcffa06aa7179dcff4c938a4e7265d" + }, + { + "nested_path": [ + "A", + 12, + 3, + 0 + ], + "record": "artifacts/TWO-SIDED-WORD-extra.json.gz", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/TWO-SIDED-WORD-extra.json.gz", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/TWO-SIDED-WORD-extra.json.gz", + "name": "nested_omission" + } + ], + "sha256": "0591b5386589c43cd10e9c516477bed5ea55d3fb28ee5eab02399b8750c3735d" + }, + { + "nested_path": [ + "providers", + "base", + "historical_rank_basis_panel", + "checks", + "dual", + "prefix", + "exact_row_sum_witness", + "row", + "terms", + 0, + 0, + 0 + ], + "record": "artifacts/WHOLE-WORD.json.gz", + "rejections": [ + { + "intended_gate": "complete typed record mismatch: artifacts/WHOLE-WORD.json.gz", + "name": "nested_mutation" + }, + { + "intended_gate": "complete typed record mismatch: artifacts/WHOLE-WORD.json.gz", + "name": "nested_omission" + } + ], + "sha256": "8f779bd86348e60c06db984652308e6e3fa96d1a2782ea75e69695f7ed4d741f" + } + ], + "record_gate": { + "named_record_gate_deletion_detected": true, + "rejections": [ + { + "intended_gate": "complete typed record mismatch: expected.json", + "name": "boolean_for_integer" + }, + { + "intended_gate": "complete typed record mismatch: expected.json", + "name": "float_for_integer" + }, + { + "intended_gate": "complete typed record mismatch: expected.json", + "name": "integer_for_boolean" + }, + { + "intended_gate": "complete typed record mismatch: expected.json", + "name": "nested_omission" + }, + { + "intended_gate": "complete typed record mismatch: expected.json", + "name": "ordered_list_reorder" + }, + { + "intended_gate": "complete typed record mismatch: expected.json", + "name": "ordered_list_truncate" + }, + { + "intended_gate": "duplicate JSON key: a", + "name": "duplicate_json_key" + }, + { + "intended_gate": "duplicate JSON key: a", + "name": "nested_duplicate_json_key" + }, + { + "intended_gate": "nonfinite JSON constant: NaN", + "name": "nonfinite_NaN" + }, + { + "intended_gate": "nonfinite JSON constant: Infinity", + "name": "nonfinite_Infinity" + }, + { + "intended_gate": "nonfinite JSON constant: -Infinity", + "name": "nonfinite_-Infinity" + }, + { + "intended_gate": "missing regular input: expected.json", + "name": "missing_expected_record" + } + ] + } + } + ], + "source_hashes": { + "FROZEN-SHA256.json": "e6cab1a1119591f00fddbaa743b5a8469f1759396a95e38c0b7ced4e9edbd5f4", + "ORIGINS.json": "8037036b46003234b5247c6b140c36b92e5964d0675dcee99b98c93ec9615e83", + "check_word.py": "16cdeef8aabed919c066ad5da45450cfc524024814f550b3415368ed098a38c6", + "independent_mst.py": "8ef41fafd73ab06bfdc78ec69de0192f658bb94c6e452c3ffe53c5983cb16094", + "verify.py": "cd3cf6493ba50303fd6a90acc084d186d434add5c7d98288b8785f6a9310467d" + }, + "status": "PASS_C01_COMPACT_SOURCE_AND_MATHEMATICAL_GATES" +} diff --git a/research/staged-compensation-forests/CORE-SNAPSHOT.json b/research/staged-compensation-forests/CORE-SNAPSHOT.json new file mode 100644 index 0000000000..83266ad7df --- /dev/null +++ b/research/staged-compensation-forests/CORE-SNAPSHOT.json @@ -0,0 +1,405 @@ +{ + "authenticated_input_count": 41, + "controls": { + "complete_scientific_records": [ + "artifacts/DESIGN.json", + "artifacts/FOREST-COMPENSATION-base.json.gz", + "artifacts/FOREST-COMPENSATION-extra.json.gz", + "artifacts/FOREST-WORD-base.json.gz", + "artifacts/FOREST-WORD-extra.json.gz", + "artifacts/INDEPENDENT-FOREST.json.gz", + "artifacts/PR1080-COMPARISON.json", + "artifacts/PRICES.json", + "artifacts/SOURCE-base.json.gz", + "artifacts/SOURCE-extra.json.gz", + "artifacts/TWO-SIDED-COMPENSATION-base.json.gz", + "artifacts/TWO-SIDED-COMPENSATION-extra.json.gz", + "artifacts/TWO-SIDED-WORD-base.json.gz", + "artifacts/TWO-SIDED-WORD-extra.json.gz", + "artifacts/WHOLE-WORD.json.gz" + ], + "mode_results": [ + { + "complete_real_records": 15, + "intended_rejections": 70, + "named_check_deletions_detected": 3, + "optimization": 0 + }, + { + "complete_real_records": 15, + "intended_rejections": 70, + "named_check_deletions_detected": 3, + "optimization": 1 + } + ], + "outer_normal_and_optimized_driver_receipts_byte_identical": true, + "path": "CONTROLS.json", + "sha256": "7ed2337a7a39f6dc2d4e113b938c823459e84c170fa841b7a7fa783a703337c8", + "source_hashes": { + "FROZEN-SHA256.json": "e6cab1a1119591f00fddbaa743b5a8469f1759396a95e38c0b7ced4e9edbd5f4", + "ORIGINS.json": "8037036b46003234b5247c6b140c36b92e5964d0675dcee99b98c93ec9615e83", + "check_word.py": "16cdeef8aabed919c066ad5da45450cfc524024814f550b3415368ed098a38c6", + "independent_mst.py": "8ef41fafd73ab06bfdc78ec69de0192f658bb94c6e452c3ffe53c5983cb16094", + "verify.py": "cd3cf6493ba50303fd6a90acc084d186d434add5c7d98288b8785f6a9310467d" + } + }, + "core_digest_definition": "SHA256 of UTF-8 JSON for files, sorted keys, compact separators, ensure_ascii=False.", + "core_file_count": 59, + "core_sha256": "91f7cfb5d3c58fa55ad453987229041b91de2a6b158eb1a8f53c74646705cb07", + "excluded_from_core_inventory": [ + "CONTROLS.json", + "CORE-SNAPSHOT.json" + ], + "execution_scope": { + "all_live_column_panel_maps_replayed_by_reviewer": true, + "independent_MST_and_helper_census_replayed_by_reviewer": true, + "parent_owns_committed_and_git_free_package_replays": true, + "wholeword_scalar_stage_replayed_by_this_reviewer": false + }, + "files": { + ".gitattributes": { + "bytes": 179, + "sha256": "e5117b89b0b3b9da816516d1687ad69bc558b99e10ff18791dcf96720c84d4a5" + }, + "CONTROL-VALIDATION.json": { + "bytes": 564, + "sha256": "d16aad6c26c630bab84d6169515e6b9606bf0c727bd28566940dc13704f19be9" + }, + "EVIDENCE-INDEX.md": { + "bytes": 3712, + "sha256": "f8ae5939c6cdca6cbe7f99bbf5db4d07ed5e275c51431122f30cf3b175a6ea59" + }, + "FROZEN-SHA256.json": { + "bytes": 4311, + "sha256": "e6cab1a1119591f00fddbaa743b5a8469f1759396a95e38c0b7ced4e9edbd5f4" + }, + "MST-VALIDATION.json": { + "bytes": 517, + "sha256": "aad6c64636c6265ff30bb06bf3940e7ac1ec2385727b6db23e640069dcc205b2" + }, + "NOTICE.md": { + "bytes": 1085, + "sha256": "e0155aa1e1f8a70ac86432b64c2b36d609064c72bf0409dcebcc5d2e5c553b88" + }, + "ORIGINS.json": { + "bytes": 11210, + "sha256": "8037036b46003234b5247c6b140c36b92e5964d0675dcee99b98c93ec9615e83" + }, + "PRIOR-CHECK.json": { + "bytes": 1504, + "sha256": "1f5cb9713e1944743c4fb6d0b58e00f285c838a6422a9591124412b50e67ee94" + }, + "PROOF-NUMERICAL.md": { + "bytes": 10036, + "sha256": "9842350cb53d68fd613ef511ec65d71b8af1e89c2354c491087880137b1cf6ef" + }, + "PROOF.md": { + "bytes": 15172, + "sha256": "fcb5a93fec05523ca40de6b16c805a004fda43059837653f8a9644ebdb1b76d6" + }, + "README.md": { + "bytes": 6469, + "sha256": "c4a99ba41a718bf905e63e3812a763f5c155c54ad2c531eaedecc68e7092f47a" + }, + "RELATED-WORK.md": { + "bytes": 2103, + "sha256": "5fd31fe13185502bfd716e603d33fb1fc49d97246abdd026bb77db39a82ba9a3" + }, + "REVIEW-DESIGN.md": { + "bytes": 3024, + "sha256": "d6f72ba8a9b02c39702643de0d00aacb2fddc7ce19783a578be8c0fea549f161" + }, + "REVIEW-NUMERICAL.md": { + "bytes": 10515, + "sha256": "a6408f2fd32a04153625e52885965f3c307371735982c367b41ad153e4adca2a" + }, + "REVIEW-VERIFICATION.md": { + "bytes": 9613, + "sha256": "a6dc3c2fe817b41ad73c9d373224302a085a593f1c3c260bf156c6929b16d25f" + }, + "SOURCE-HISTORY-ALIASES.json": { + "bytes": 6176, + "sha256": "533d0f2b40beb634a1aeec967f8a59abe158719d7a5896cc8f340cb5c1cb0685" + }, + "SOURCES.json": { + "bytes": 5733, + "sha256": "04be05f30d742027809408aacd527b16ba851ce5a453eb35050d0deabdb8ac27" + }, + "TASK.json": { + "bytes": 7004, + "sha256": "e8f051415f5005051ef7b959f1fb4212e34f4d149a048cbd40c77ee8779435d2" + }, + "VERIFY.json": { + "bytes": 1530, + "sha256": "7724471088215b565509ebdb5b321e32b8aed9f8cad2d87f2b5f29e670a7818c" + }, + "artifacts/DESIGN.json": { + "bytes": 74627, + "sha256": "81af0f8d0699d79989ba89fc7de8bb7af047c4ca79b05b413a29428d3160a6e9" + }, + "artifacts/FOREST-COMPENSATION-base.json.gz": { + "bytes": 8882, + "sha256": "7a39e3cfe0113743714b1fc38258c36803b20c5f4abeecf977e76ff5da0533e7" + }, + "artifacts/FOREST-COMPENSATION-extra.json.gz": { + "bytes": 8882, + "sha256": "7a39e3cfe0113743714b1fc38258c36803b20c5f4abeecf977e76ff5da0533e7" + }, + "artifacts/FOREST-WORD-base.json.gz": { + "bytes": 65174, + "sha256": "0f9a6750289ff2ccde92580079254f88fa6546e8f1903f88fb869c4e2fbe32c8" + }, + "artifacts/FOREST-WORD-extra.json.gz": { + "bytes": 65170, + "sha256": "30faba0e589c162e5f7478c2c6f4496d8c5664d81693cf2cf1c7290f2a7d4dd4" + }, + "artifacts/HISTORICAL-SHARED-COMPENSATION.json.gz": { + "bytes": 9960, + "sha256": "e7bdb1e299a43a8fcbdad4c598b7161e504a94691df3940a9a4eaf638f5013f0" + }, + "artifacts/INDEPENDENT-FOREST.json.gz": { + "bytes": 6460, + "sha256": "058a5377582227aa0784d205e49efe59b0d4ba525afc2cb49a608f06bd51924a" + }, + "artifacts/PR1080-COMPARISON.json": { + "bytes": 8196, + "sha256": "88116932a22a3927bb630fd4ecf3e171663e12e8fd8d0347fa21a840a81482ac" + }, + "artifacts/PRICES.json": { + "bytes": 3626, + "sha256": "801e9f76954d330c6276ca5f681cd1b361df13538824dbee84373f46c16f93d3" + }, + "artifacts/SOURCE-base.json.gz": { + "bytes": 72570, + "sha256": "735c540b1fe29d0ceeb4d2f304ec941e5f2bd3bc92bafc8cce2b4f9a67a3b653" + }, + "artifacts/SOURCE-extra.json.gz": { + "bytes": 72568, + "sha256": "886338fc32da14f3389a82c8120a1bcf9c5e2f0ec3e9b2d377fdae809e1d977f" + }, + "artifacts/TWO-SIDED-COMPENSATION-base.json.gz": { + "bytes": 7761, + "sha256": "4119728ab2a3833636a77862bf997b46a50ff7c3c5a874b5d7c675d9577c8546" + }, + "artifacts/TWO-SIDED-COMPENSATION-extra.json.gz": { + "bytes": 7761, + "sha256": "4119728ab2a3833636a77862bf997b46a50ff7c3c5a874b5d7c675d9577c8546" + }, + "artifacts/TWO-SIDED-WORD-base.json.gz": { + "bytes": 63913, + "sha256": "52f37fbd972cf70ca3ec5edcb9a8bdb4e0bcffa06aa7179dcff4c938a4e7265d" + }, + "artifacts/TWO-SIDED-WORD-extra.json.gz": { + "bytes": 63910, + "sha256": "0591b5386589c43cd10e9c516477bed5ea55d3fb28ee5eab02399b8750c3735d" + }, + "artifacts/WHOLE-WORD.json.gz": { + "bytes": 34903, + "sha256": "8f779bd86348e60c06db984652308e6e3fa96d1a2782ea75e69695f7ed4d741f" + }, + "check_word.py": { + "bytes": 37571, + "sha256": "16cdeef8aabed919c066ad5da45450cfc524024814f550b3415368ed098a38c6" + }, + "compare_prior.py": { + "bytes": 5694, + "sha256": "34b5345c59643fad8875305b8a89417439a31bd2d1bca160199aa25d127d73e1" + }, + "construct.py": { + "bytes": 10805, + "sha256": "7d64232bced5cb621ff1a4ee65155b8d48b95620323564721042b4cfcb11bb00" + }, + "controls.py": { + "bytes": 21377, + "sha256": "cb25c9ce5b7ebf6f0f589b1749424036dbc7f5c752d7e34e7559d545be36c1f3" + }, + "frozen/history/C01-PROOF.md": { + "bytes": 12894, + "sha256": "b1529379218f953973a3fd0c450bf795eebe861461a676a09b5268bc8196b8d8" + }, + "frozen/inputs/HISTORICAL-base.json.gz": { + "bytes": 9960, + "sha256": "e7bdb1e299a43a8fcbdad4c598b7161e504a94691df3940a9a4eaf638f5013f0" + }, + "frozen/inputs/HISTORICAL-extra.json.gz": { + "bytes": 9960, + "sha256": "e7bdb1e299a43a8fcbdad4c598b7161e504a94691df3940a9a4eaf638f5013f0" + }, + "frozen/inputs/SOURCE-base.json.gz": { + "bytes": 72570, + "sha256": "735c540b1fe29d0ceeb4d2f304ec941e5f2bd3bc92bafc8cce2b4f9a67a3b653" + }, + "frozen/inputs/SOURCE-extra.json.gz": { + "bytes": 72568, + "sha256": "886338fc32da14f3389a82c8120a1bcf9c5e2f0ec3e9b2d377fdae809e1d977f" + }, + "frozen/notices/CREDITS.md": { + "bytes": 5030, + "sha256": "1d9d8f56d8899f55878e4cb2c4e052b22506444016a51c2e678773505f5189e6" + }, + "frozen/notices/LICENSE": { + "bytes": 11357, + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + }, + "frozen/notices/NATIVE-LINEAGE-NOTICE": { + "bytes": 2456, + "sha256": "ee0c73ca35877aad0e0b6adc560a3881cb82276dba4cf2d4fc58cd19e57cc420" + }, + "frozen/notices/NOTICE": { + "bytes": 3234, + "sha256": "c9731c9cca25ede32c2a1b3aef6d5b249973cb2ed5fb2494407bdca598763661" + }, + "frozen/prior/PR1080-CANONICAL-WORD.json.gz": { + "bytes": 84026, + "sha256": "387a2266ffe006d20042221d967f67a4b18d9bb8de1cd1e01d4031b539fa74a5" + }, + "frozen/prior/PR1080-RECIPE.json": { + "bytes": 30228, + "sha256": "d526804d9d627cbd850b0e54c3de9aadc74646e1a9b6befb577f42240720750a" + }, + "frozen/producers/bw_emit.py": { + "bytes": 10012, + "sha256": "99b59a6fa3feda86785e4225157dcb1a6169d256cec4f5e0acc9cea7a701df76" + }, + "frozen/producers/bw_transport.py": { + "bytes": 17646, + "sha256": "9818e08b819310b40f1441b89be8c4369584a5b3fa5dfe9b86b1df9a7f5d6a76" + }, + "frozen/reviews/c01-design/SOURCE-DEPENDENCIES.json": { + "bytes": 2461, + "sha256": "0b7f7e854d7e756fca595f3144ae07336401c8897fe35226f8bfbcc7e95b2c10" + }, + "frozen/reviews/c01-design/VALIDATION.json": { + "bytes": 3496, + "sha256": "daa6902b6bd7c8bbc413cf618d24abf1dbfd1c4f34cd9fb7f37f5c70b77cfc5e" + }, + "frozen/reviews/c01-wholeword/SOURCE-DEPENDENCIES.json": { + "bytes": 2801, + "sha256": "7258f6729e69ecbcfe22730d18ded622feda3977a122093ca8be64ddc8413589" + }, + "frozen/reviews/c01-wholeword/VALIDATION.json": { + "bytes": 4420, + "sha256": "9eef8187df474a4b4ccdfb0410f92c66ad920a2c23fab2ca9456e032564685d2" + }, + "independent_mst.py": { + "bytes": 24296, + "sha256": "8ef41fafd73ab06bfdc78ec69de0192f658bb94c6e452c3ffe53c5983cb16094" + }, + "price_replay.py": { + "bytes": 4475, + "sha256": "d88ece61765bb04be465ef98fbcd8afb0013ca82b9c3487ad9a62a72d4843877" + }, + "verify.py": { + "bytes": 8010, + "sha256": "cd3cf6493ba50303fd6a90acc084d186d434add5c7d98288b8785f6a9310467d" + } + }, + "limits": [ + "Exact target-only forest class minimum; no joint target/helper optimum.", + "Companion scalar prefix model treats nonscalar events as identity and CLEAR as assignment.", + "Native Clifford phases, reversible erasure, native-child precision, recursive rounding, physical COPY/tape costs and a new kappa result remain unclaimed." + ], + "mathematical_review": { + "MST_normal_and_optimized_complete_receipts_byte_identical": true, + "MST_receipt_decoded_sha256": "cc1712a26558e0f9d832d3f2489c8ed49fa026b5a7618c31e5e61eee75582ab3", + "controls_per_provider": 13, + "disjoint_helper_pairs": 88, + "independently_priced_helper_candidates": 85284, + "live_input_columns_each_provider": 632, + "paid_cancelling_pair_added_component_primitives": 8, + "panel_orientations": [ + "forward", + "inverse", + "dual" + ], + "signed_graph_edges_and_cycle_inequalities": 12544, + "source_head": "3efbb5de06a49ffeea6684482f2d3fe48cdca3fb", + "target_forest_minimum": 13716, + "two_sided_component_price": 10633 + }, + "packaging_refresh": { + "added": [ + ".gitattributes" + ], + "all_scientific_sources_and_receipts_unchanged": true, + "changed": [ + "EVIDENCE-INDEX.md" + ], + "controls_and_math_not_rerun_for_metadata_only_change": true, + "prior_core_sha256": "6b0d8c253039e7f4a7ebb32d2d3e598da328793303f88223cbb4d4c3bc40cc34", + "prior_snapshot_sha256": "22ad402988676765427d39ab2613d10cd77cacfe61aa2097b4e3e5e8a36dff07", + "producer_attribute_rules": [ + "frozen/producers/bw_emit.py -text whitespace=trailing-space,space-before-tab,cr-at-eol", + "frozen/producers/bw_transport.py -text whitespace=trailing-space,space-before-tab,cr-at-eol" + ], + "purpose": "Preserve exact original CRLF producer bytes under repository line-ending normalization, with explicit whitespace diagnostics.", + "removed": [] + }, + "schema_version": 1, + "status": "PASS_C01_REVIEWED_CORE", + "validation": { + "all_frozen_origin_and_protected_tree_inventories_agree": true, + "all_root_documentation_included": true, + "all_storage_and_declared_original_hashes_match": true, + "compressed_original_bindings": [ + "artifacts/INDEPENDENT-FOREST.json.gz", + "artifacts/WHOLE-WORD.json.gz", + "frozen/prior/PR1080-CANONICAL-WORD.json.gz" + ], + "no_symlinks_or_bytecode_artifacts": true, + "owned_source_review_and_receipt_copies_match": true, + "registered_commands": [ + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/verify.py", + "--stage", + "construction" + ], + "checks": "Complete deterministic source-matched forest/helper circuit, full output inventory and typed records, literal Horner prices, exact fixed PR1080 comparison.", + "timeout_seconds": 90 + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/verify.py", + "--stage", + "forest" + ], + "checks": "Independent Fraction graph and basis audit: every signed edge and helper score, class minimum, arbitrary inputs and semantic controls.", + "timeout_seconds": 90 + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/verify.py", + "--stage", + "wholeword" + ], + "checks": "Independent full raw free-warp words, four orientations, complete emitted scalar projection, literal prices and exact prefix/grid witnesses.", + "timeout_seconds": 180 + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/controls.py", + "--package", + "{package}" + ], + "checks": "Normal/optimized source-byte execution, exact typed receipt coverage, actual semantic defects and check deletion.", + "timeout_seconds": 90 + } + ] + } +} diff --git a/research/staged-compensation-forests/EVIDENCE-INDEX.md b/research/staged-compensation-forests/EVIDENCE-INDEX.md new file mode 100644 index 0000000000..b026207948 --- /dev/null +++ b/research/staged-compensation-forests/EVIDENCE-INDEX.md @@ -0,0 +1,52 @@ +# Evidence and scope + +The package contains one replacement of the PR3605 compensation boundary. +Its comparator, intermediate forest and final two-sided word all use the same +source matrix. The checked final words are in +`artifacts/TWO-SIDED-WORD-{base,extra}.json.gz`. + +| Evidence | What it establishes | +| --- | --- | +| [PROOF.md](PROOF.md) | Arbitrary-dirty basis identity, exact signed-forest class minimum, disjoint-helper construction and paid local comparison | +| [PROOF-NUMERICAL.md](PROOF-NUMERICAL.md) | Full logical words, scalar-projection invoice, exact attained range and reachable-grid statements, with explicit physical exclusions | +| `construct.py`, `artifacts/DESIGN.json` | Complete deterministic edge and helper-choice census, frozen recipe, literal words and actual defect witnesses | +| `independent_mst.py`, `artifacts/INDEPENDENT-FOREST.json.gz` | Separate Fraction arithmetic, graph minimum, helper scores, restored basis and arbitrary-input operators | +| `check_word.py`, `artifacts/WHOLE-WORD.json.gz` | Separate integer-dyadic/free-word interpreter, complete source and candidate words, emitted scalar programs and prefix witnesses | +| `price_replay.py`, `artifacts/PRICES.json` | Literal Horner microcircuits and all four panel prices | +| `compare_prior.py`, `artifacts/PR1080-COMPARISON.json` | One frozen prior-source/recipe comparison; no relabeling search or broader obstruction | +| [REVIEW-DESIGN.md](REVIEW-DESIGN.md) | Separate review of the construction proof | +| [REVIEW-NUMERICAL.md](REVIEW-NUMERICAL.md) | Separate review of the logical and scalar numerical models | +| [REVIEW-VERIFICATION.md](REVIEW-VERIFICATION.md) | Source execution, acceptance controls, completeness and package boundary review | + +The mathematical checkers do not import one another or the builder. They share +the authenticated source words and candidate bytes. The original transport and +emitter retain their own checks; they are producers and inherited evidence, +not another independent verifier. Their executed source bytes are captured, +authenticated and compiled with assertions enabled. + +The 15 compared records comprise all 11 construction outputs, complete price +and prior-comparison records, the independent forest record and the complete +whole-word record. Comparison is typed and covers every JSON field. Gzip +payload equality permits equivalent compression containers for regenerated +outputs; frozen inputs retain exact byte pins. + +`FROZEN-SHA256.json` and `ORIGINS.json` enumerate the immutable inputs and +their provenance. The package attributes preserve the two inherited producer +files' original CRLF bytes through Git; no source text is rewritten. Original research files are retained without edits outside +this package. The two proof copies have only the declared filename-reference +adaptations in `ORIGINS.json`. Historical C01 factory screens are provenance +only and have not been rerun. + +The scientific source remains PR3605 +`3efbb5de06a49ffeea6684482f2d3fe48cdca3fb`. That PR head is not an ancestor of +this publication's base. [SOURCE-HISTORY-ALIASES.json](SOURCE-HISTORY-ALIASES.json) +records byte-for-byte bindings to the retained main copies used by the +repository's source-history gate. Neither the experimental word nor its +scientific pin changes. The prior PR1080 word is authenticated as one exact +member of its pinned source archive. + +Finite exact computation, written all-input arguments, AI review, package CI, +native/physical admission and a formal-kernel proof are separate kinds of +evidence. This package supplies the computations, arguments and AI reviews; +the PR records hosted CI separately. Native/physical admission and formal +kernel evidence are not supplied. diff --git a/research/staged-compensation-forests/FROZEN-SHA256.json b/research/staged-compensation-forests/FROZEN-SHA256.json new file mode 100644 index 0000000000..1db522f87e --- /dev/null +++ b/research/staged-compensation-forests/FROZEN-SHA256.json @@ -0,0 +1,43 @@ +{ + "frozen/inputs/SOURCE-base.json.gz": "735c540b1fe29d0ceeb4d2f304ec941e5f2bd3bc92bafc8cce2b4f9a67a3b653", + "frozen/inputs/HISTORICAL-base.json.gz": "e7bdb1e299a43a8fcbdad4c598b7161e504a94691df3940a9a4eaf638f5013f0", + "frozen/inputs/SOURCE-extra.json.gz": "886338fc32da14f3389a82c8120a1bcf9c5e2f0ec3e9b2d377fdae809e1d977f", + "frozen/inputs/HISTORICAL-extra.json.gz": "e7bdb1e299a43a8fcbdad4c598b7161e504a94691df3940a9a4eaf638f5013f0", + "frozen/notices/CREDITS.md": "1d9d8f56d8899f55878e4cb2c4e052b22506444016a51c2e678773505f5189e6", + "frozen/notices/NOTICE": "c9731c9cca25ede32c2a1b3aef6d5b249973cb2ed5fb2494407bdca598763661", + "frozen/notices/NATIVE-LINEAGE-NOTICE": "ee0c73ca35877aad0e0b6adc560a3881cb82276dba4cf2d4fc58cd19e57cc420", + "frozen/notices/LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "frozen/history/C01-PROOF.md": "b1529379218f953973a3fd0c450bf795eebe861461a676a09b5268bc8196b8d8", + "frozen/producers/bw_transport.py": "9818e08b819310b40f1441b89be8c4369584a5b3fa5dfe9b86b1df9a7f5d6a76", + "frozen/producers/bw_emit.py": "99b59a6fa3feda86785e4225157dcb1a6169d256cec4f5e0acc9cea7a701df76", + "construct.py": "7d64232bced5cb621ff1a4ee65155b8d48b95620323564721042b4cfcb11bb00", + "price_replay.py": "d88ece61765bb04be465ef98fbcd8afb0013ca82b9c3487ad9a62a72d4843877", + "compare_prior.py": "34b5345c59643fad8875305b8a89417439a31bd2d1bca160199aa25d127d73e1", + "artifacts/TWO-SIDED-COMPENSATION-extra.json.gz": "4119728ab2a3833636a77862bf997b46a50ff7c3c5a874b5d7c675d9577c8546", + "artifacts/FOREST-WORD-base.json.gz": "0f9a6750289ff2ccde92580079254f88fa6546e8f1903f88fb869c4e2fbe32c8", + "artifacts/TWO-SIDED-WORD-extra.json.gz": "0591b5386589c43cd10e9c516477bed5ea55d3fb28ee5eab02399b8750c3735d", + "artifacts/FOREST-COMPENSATION-extra.json.gz": "7a39e3cfe0113743714b1fc38258c36803b20c5f4abeecf977e76ff5da0533e7", + "artifacts/SOURCE-extra.json.gz": "886338fc32da14f3389a82c8120a1bcf9c5e2f0ec3e9b2d377fdae809e1d977f", + "artifacts/SOURCE-base.json.gz": "735c540b1fe29d0ceeb4d2f304ec941e5f2bd3bc92bafc8cce2b4f9a67a3b653", + "artifacts/TWO-SIDED-COMPENSATION-base.json.gz": "4119728ab2a3833636a77862bf997b46a50ff7c3c5a874b5d7c675d9577c8546", + "artifacts/TWO-SIDED-WORD-base.json.gz": "52f37fbd972cf70ca3ec5edcb9a8bdb4e0bcffa06aa7179dcff4c938a4e7265d", + "artifacts/FOREST-COMPENSATION-base.json.gz": "7a39e3cfe0113743714b1fc38258c36803b20c5f4abeecf977e76ff5da0533e7", + "artifacts/FOREST-WORD-extra.json.gz": "30faba0e589c162e5f7478c2c6f4496d8c5664d81693cf2cf1c7290f2a7d4dd4", + "artifacts/HISTORICAL-SHARED-COMPENSATION.json.gz": "e7bdb1e299a43a8fcbdad4c598b7161e504a94691df3940a9a4eaf638f5013f0", + "artifacts/DESIGN.json": "81af0f8d0699d79989ba89fc7de8bb7af047c4ca79b05b413a29428d3160a6e9", + "artifacts/PRICES.json": "801e9f76954d330c6276ca5f681cd1b361df13538824dbee84373f46c16f93d3", + "artifacts/PR1080-COMPARISON.json": "88116932a22a3927bb630fd4ecf3e171663e12e8fd8d0347fa21a840a81482ac", + "check_word.py": "16cdeef8aabed919c066ad5da45450cfc524024814f550b3415368ed098a38c6", + "artifacts/WHOLE-WORD.json.gz": "8f779bd86348e60c06db984652308e6e3fa96d1a2782ea75e69695f7ed4d741f", + "frozen/reviews/c01-design/VALIDATION.json": "daa6902b6bd7c8bbc413cf618d24abf1dbfd1c4f34cd9fb7f37f5c70b77cfc5e", + "frozen/reviews/c01-design/SOURCE-DEPENDENCIES.json": "0b7f7e854d7e756fca595f3144ae07336401c8897fe35226f8bfbcc7e95b2c10", + "frozen/reviews/c01-wholeword/VALIDATION.json": "9eef8187df474a4b4ccdfb0410f92c66ad920a2c23fab2ca9456e032564685d2", + "frozen/reviews/c01-wholeword/SOURCE-DEPENDENCIES.json": "7258f6729e69ecbcfe22730d18ded622feda3977a122093ca8be64ddc8413589", + "PROOF.md": "fcb5a93fec05523ca40de6b16c805a004fda43059837653f8a9644ebdb1b76d6", + "PROOF-NUMERICAL.md": "9842350cb53d68fd613ef511ec65d71b8af1e89c2354c491087880137b1cf6ef", + "REVIEW-DESIGN.md": "d6f72ba8a9b02c39702643de0d00aacb2fddc7ce19783a578be8c0fea549f161", + "frozen/prior/PR1080-CANONICAL-WORD.json.gz": "387a2266ffe006d20042221d967f67a4b18d9bb8de1cd1e01d4031b539fa74a5", + "frozen/prior/PR1080-RECIPE.json": "d526804d9d627cbd850b0e54c3de9aadc74646e1a9b6befb577f42240720750a", + "independent_mst.py": "8ef41fafd73ab06bfdc78ec69de0192f658bb94c6e452c3ffe53c5983cb16094", + "artifacts/INDEPENDENT-FOREST.json.gz": "058a5377582227aa0784d205e49efe59b0d4ba525afc2cb49a608f06bd51924a" +} diff --git a/research/staged-compensation-forests/MST-VALIDATION.json b/research/staged-compensation-forests/MST-VALIDATION.json new file mode 100644 index 0000000000..8e6c46e74c --- /dev/null +++ b/research/staged-compensation-forests/MST-VALIDATION.json @@ -0,0 +1,10 @@ +{ + "checker_sha256": "8ef41fafd73ab06bfdc78ec69de0192f658bb94c6e452c3ffe53c5983cb16094", + "normal_and_optimized_receipt_bytes_identical": true, + "python": "3.12.14 (main, Aug 25 2026, 13:50:33) [Clang 22.1.3 ]", + "receipt_sha256": "cc1712a26558e0f9d832d3f2489c8ed49fa026b5a7618c31e5e61eee75582ab3", + "seconds": 3.1999305830104277, + "source_and_candidate_inputs_were_shared_read_only": true, + "status": "PASS_OPTIMIZED_SPACED_SCRIPT_COMPLETE_RECEIPT_EQUALITY", + "temporary_script_path_contains_spaces": true +} diff --git a/research/staged-compensation-forests/NOTICE.md b/research/staged-compensation-forests/NOTICE.md new file mode 100644 index 0000000000..2b0bd19952 --- /dev/null +++ b/research/staged-compensation-forests/NOTICE.md @@ -0,0 +1,22 @@ +# Attribution and license + +New material: Ross Richardson, with substantial OpenAI Codex assistance. +Apache-2.0, as in [the repository license](frozen/notices/LICENSE). + +The exact staged words are Ross Richardson's PR3605 contribution, based on +dcharb78's PR3133 coupled carrier construction. Retained notices: + +- [PR3133 credits](frozen/notices/CREDITS.md) +- [PR3133 notice](frozen/notices/NOTICE) +- [Native implementation lineage](frozen/notices/NATIVE-LINEAGE-NOTICE) + +That lineage includes Yiyang Lu's staged compensation kernels, Jeremy Kothe's +preload and routing constructions, Marius-Paul Dumitrean's joint construction, +Mason Hale and Tekalign's dirty recovery work, and the earlier factory and +native architecture of icekylinx, DreamingOfClouds and their contributors. +The unmodified transport/emitter retain their own source notices, including +Cinna Davis's anticipatory borrowing changes. + +[RELATED-WORK.md](RELATED-WORK.md) credits the forest and two-sided +factorization methods. Their results and different source matrices are not +silently relabeled as this contribution. diff --git a/research/staged-compensation-forests/ORIGINS.json b/research/staged-compensation-forests/ORIGINS.json new file mode 100644 index 0000000000..fcd0f0f1b8 --- /dev/null +++ b/research/staged-compensation-forests/ORIGINS.json @@ -0,0 +1,244 @@ +{ + "frozen/inputs/SOURCE-base.json.gz": { + "sha256": "735c540b1fe29d0ceeb4d2f304ec941e5f2bd3bc92bafc8cce2b4f9a67a3b653", + "kind": "git", + "commit": "3efbb5de06a49ffeea6684482f2d3fe48cdca3fb", + "path": "research/staged-644-660-width-reduction/STAGED644-660-base.json.gz" + }, + "frozen/inputs/HISTORICAL-base.json.gz": { + "sha256": "e7bdb1e299a43a8fcbdad4c598b7161e504a94691df3940a9a4eaf638f5013f0", + "kind": "preserved-research", + "run": "kappa-3605-successor-20261018T0940Z", + "path": "major-frontier/word-factory/SHARED-COMPENSATION-base.json.gz", + "role": "Superseded rank-basis comparator; replayed as a literal panel." + }, + "frozen/inputs/SOURCE-extra.json.gz": { + "sha256": "886338fc32da14f3389a82c8120a1bcf9c5e2f0ec3e9b2d377fdae809e1d977f", + "kind": "git", + "commit": "3efbb5de06a49ffeea6684482f2d3fe48cdca3fb", + "path": "research/staged-644-660-width-reduction/STAGED644-660-extra.json.gz" + }, + "frozen/inputs/HISTORICAL-extra.json.gz": { + "sha256": "e7bdb1e299a43a8fcbdad4c598b7161e504a94691df3940a9a4eaf638f5013f0", + "kind": "preserved-research", + "run": "kappa-3605-successor-20261018T0940Z", + "path": "major-frontier/word-factory/SHARED-COMPENSATION-extra.json.gz", + "role": "Superseded rank-basis comparator; replayed as a literal panel." + }, + "frozen/notices/CREDITS.md": { + "sha256": "1d9d8f56d8899f55878e4cb2c4e052b22506444016a51c2e678773505f5189e6", + "kind": "git", + "commit": "3efbb5de06a49ffeea6684482f2d3fe48cdca3fb", + "path": "research/rank7-coupled-586-588-carrier-fold/CREDITS.md", + "role": "retained source credit" + }, + "frozen/notices/NOTICE": { + "sha256": "c9731c9cca25ede32c2a1b3aef6d5b249973cb2ed5fb2494407bdca598763661", + "kind": "git", + "commit": "3efbb5de06a49ffeea6684482f2d3fe48cdca3fb", + "path": "research/rank7-coupled-586-588-carrier-fold/NOTICE", + "role": "retained source credit" + }, + "frozen/notices/NATIVE-LINEAGE-NOTICE": { + "sha256": "ee0c73ca35877aad0e0b6adc560a3881cb82276dba4cf2d4fc58cd19e57cc420", + "kind": "git", + "commit": "3efbb5de06a49ffeea6684482f2d3fe48cdca3fb", + "path": "research/t74-native-fast/NATIVE-LINEAGE-NOTICE", + "role": "retained source credit" + }, + "frozen/notices/LICENSE": { + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "kind": "git", + "commit": "3efbb5de06a49ffeea6684482f2d3fe48cdca3fb", + "path": "LICENSE", + "role": "retained source credit" + }, + "frozen/history/C01-PROOF.md": { + "sha256": "b1529379218f953973a3fd0c450bf795eebe861461a676a09b5268bc8196b8d8", + "kind": "preserved-research", + "run": "kappa-3605-successor-20261018T0940Z", + "path": "major-frontier/word-factory/PROOF.md", + "role": "Unchanged historical scope and findings; factory screens are not re-run here." + }, + "frozen/producers/bw_transport.py": { + "sha256": "9818e08b819310b40f1441b89be8c4369584a5b3fa5dfe9b86b1df9a7f5d6a76", + "kind": "git", + "commit": "3efbb5de06a49ffeea6684482f2d3fe48cdca3fb", + "path": "research/t74-native-fast/vendor/native/new/code/borrow/bw_transport.py", + "role": "Unchanged source transport/emitter. Its checks are producer-lineage evidence." + }, + "frozen/producers/bw_emit.py": { + "sha256": "99b59a6fa3feda86785e4225157dcb1a6169d256cec4f5e0acc9cea7a701df76", + "kind": "git", + "commit": "3efbb5de06a49ffeea6684482f2d3fe48cdca3fb", + "path": "research/t74-native-fast/vendor/native/new/code/borrow/bw_emit.py", + "role": "Unchanged source transport/emitter. Its checks are producer-lineage evidence." + }, + "construct.py": { + "sha256": "7d64232bced5cb621ff1a4ee65155b8d48b95620323564721042b4cfcb11bb00", + "kind": "new-contribution", + "source": "c01-design/design.py" + }, + "price_replay.py": { + "sha256": "d88ece61765bb04be465ef98fbcd8afb0013ca82b9c3487ad9a62a72d4843877", + "kind": "new-contribution", + "source": "c01-design/price_replay.py" + }, + "compare_prior.py": { + "sha256": "34b5345c59643fad8875305b8a89417439a31bd2d1bca160199aa25d127d73e1", + "kind": "new-contribution", + "source": "c01-design/compare_prior.py" + }, + "artifacts/TWO-SIDED-COMPENSATION-extra.json.gz": { + "sha256": "4119728ab2a3833636a77862bf997b46a50ff7c3c5a874b5d7c675d9577c8546", + "kind": "new-contribution", + "source": "c01-design/artifacts/TWO-SIDED-COMPENSATION-extra.json.gz" + }, + "artifacts/FOREST-WORD-base.json.gz": { + "sha256": "0f9a6750289ff2ccde92580079254f88fa6546e8f1903f88fb869c4e2fbe32c8", + "kind": "new-contribution", + "source": "c01-design/artifacts/FOREST-WORD-base.json.gz" + }, + "artifacts/TWO-SIDED-WORD-extra.json.gz": { + "sha256": "0591b5386589c43cd10e9c516477bed5ea55d3fb28ee5eab02399b8750c3735d", + "kind": "new-contribution", + "source": "c01-design/artifacts/TWO-SIDED-WORD-extra.json.gz" + }, + "artifacts/FOREST-COMPENSATION-extra.json.gz": { + "sha256": "7a39e3cfe0113743714b1fc38258c36803b20c5f4abeecf977e76ff5da0533e7", + "kind": "new-contribution", + "source": "c01-design/artifacts/FOREST-COMPENSATION-extra.json.gz" + }, + "artifacts/SOURCE-extra.json.gz": { + "sha256": "886338fc32da14f3389a82c8120a1bcf9c5e2f0ec3e9b2d377fdae809e1d977f", + "kind": "new-contribution", + "source": "c01-design/artifacts/SOURCE-extra.json.gz" + }, + "artifacts/SOURCE-base.json.gz": { + "sha256": "735c540b1fe29d0ceeb4d2f304ec941e5f2bd3bc92bafc8cce2b4f9a67a3b653", + "kind": "new-contribution", + "source": "c01-design/artifacts/SOURCE-base.json.gz" + }, + "artifacts/TWO-SIDED-COMPENSATION-base.json.gz": { + "sha256": "4119728ab2a3833636a77862bf997b46a50ff7c3c5a874b5d7c675d9577c8546", + "kind": "new-contribution", + "source": "c01-design/artifacts/TWO-SIDED-COMPENSATION-base.json.gz" + }, + "artifacts/TWO-SIDED-WORD-base.json.gz": { + "sha256": "52f37fbd972cf70ca3ec5edcb9a8bdb4e0bcffa06aa7179dcff4c938a4e7265d", + "kind": "new-contribution", + "source": "c01-design/artifacts/TWO-SIDED-WORD-base.json.gz" + }, + "artifacts/FOREST-COMPENSATION-base.json.gz": { + "sha256": "7a39e3cfe0113743714b1fc38258c36803b20c5f4abeecf977e76ff5da0533e7", + "kind": "new-contribution", + "source": "c01-design/artifacts/FOREST-COMPENSATION-base.json.gz" + }, + "artifacts/FOREST-WORD-extra.json.gz": { + "sha256": "30faba0e589c162e5f7478c2c6f4496d8c5664d81693cf2cf1c7290f2a7d4dd4", + "kind": "new-contribution", + "source": "c01-design/artifacts/FOREST-WORD-extra.json.gz" + }, + "artifacts/HISTORICAL-SHARED-COMPENSATION.json.gz": { + "sha256": "e7bdb1e299a43a8fcbdad4c598b7161e504a94691df3940a9a4eaf638f5013f0", + "kind": "new-contribution", + "source": "c01-design/artifacts/HISTORICAL-SHARED-COMPENSATION.json.gz" + }, + "artifacts/DESIGN.json": { + "sha256": "81af0f8d0699d79989ba89fc7de8bb7af047c4ca79b05b413a29428d3160a6e9", + "kind": "new-contribution", + "source": "c01-design/artifacts/DESIGN.json" + }, + "artifacts/PRICES.json": { + "sha256": "801e9f76954d330c6276ca5f681cd1b361df13538824dbee84373f46c16f93d3", + "kind": "new-contribution", + "source": "c01-design/PRICES.json" + }, + "artifacts/PR1080-COMPARISON.json": { + "sha256": "88116932a22a3927bb630fd4ecf3e171663e12e8fd8d0347fa21a840a81482ac", + "kind": "new-contribution", + "source": "c01-design/PR1080-COMPARISON.json" + }, + "check_word.py": { + "sha256": "16cdeef8aabed919c066ad5da45450cfc524024814f550b3415368ed098a38c6", + "kind": "new-contribution", + "source": "c01-wholeword/check.py" + }, + "artifacts/WHOLE-WORD.json.gz": { + "sha256": "8f779bd86348e60c06db984652308e6e3fa96d1a2782ea75e69695f7ed4d741f", + "kind": "new-contribution", + "source": "c01-wholeword/CHECKS.json", + "original_sha256": "bd442037a8dc9c2a27f6a1b1e8b1e45e5c934cb7129cee2db2f85d1c20f26ec1" + }, + "frozen/reviews/c01-design/VALIDATION.json": { + "sha256": "daa6902b6bd7c8bbc413cf618d24abf1dbfd1c4f34cd9fb7f37f5c70b77cfc5e", + "kind": "new-contribution", + "source": "c01-design/VALIDATION.json", + "role": "Review-context evidence; registered replay is package-local." + }, + "frozen/reviews/c01-design/SOURCE-DEPENDENCIES.json": { + "sha256": "0b7f7e854d7e756fca595f3144ae07336401c8897fe35226f8bfbcc7e95b2c10", + "kind": "new-contribution", + "source": "c01-design/SOURCE-DEPENDENCIES.json", + "role": "Review-context evidence; registered replay is package-local." + }, + "frozen/reviews/c01-wholeword/VALIDATION.json": { + "sha256": "9eef8187df474a4b4ccdfb0410f92c66ad920a2c23fab2ca9456e032564685d2", + "kind": "new-contribution", + "source": "c01-wholeword/VALIDATION.json", + "role": "Review-context evidence; registered replay is package-local." + }, + "frozen/reviews/c01-wholeword/SOURCE-DEPENDENCIES.json": { + "sha256": "7258f6729e69ecbcfe22730d18ded622feda3977a122093ca8be64ddc8413589", + "kind": "new-contribution", + "source": "c01-wholeword/SOURCE-DEPENDENCIES.json", + "role": "Review-context evidence; registered replay is package-local." + }, + "PROOF.md": { + "sha256": "fcb5a93fec05523ca40de6b16c805a004fda43059837653f8a9644ebdb1b76d6", + "kind": "new-contribution", + "source": "c01-design/PROOF.md", + "source_sha256": "3cbacd11a7d7414e8889a6f559e759e9166d367fb7ec14c8896d381c7365ccf4", + "adaptation": "Document references only: design.py -> construct.py; receipts -> artifacts/." + }, + "PROOF-NUMERICAL.md": { + "sha256": "9842350cb53d68fd613ef511ec65d71b8af1e89c2354c491087880137b1cf6ef", + "kind": "new-contribution", + "source": "c01-wholeword/PROOF.md", + "source_sha256": "4bf4ab27640122985b4d2c9f941003d6e9cbda612b0811735f014585fde0d109", + "adaptation": "Document reference only: check.py -> check_word.py." + }, + "REVIEW-DESIGN.md": { + "sha256": "d6f72ba8a9b02c39702643de0d00aacb2fddc7ce19783a578be8c0fea549f161", + "kind": "new-contribution", + "source": "c01-wholeword/CROSS-REVIEW-DESIGN.md" + }, + "frozen/prior/PR1080-CANONICAL-WORD.json.gz": { + "sha256": "387a2266ffe006d20042221d967f67a4b18d9bb8de1cd1e01d4031b539fa74a5", + "kind": "git-archive-member", + "source": "PR1080 archive", + "commit": "803e080e181229a3af2196b7a13615c9d81ae10d", + "path": "research/community-frontier942-audit/t37-replay.tar.gz", + "archive_sha256": "48285025105210b56a32d3d4d57a21b7591760acc709d38073e4dca339eb06fe", + "member": "native/local/CANONICAL-WORD.json.gz", + "original_sha256": "24db880b7dab31e6af4eec8a1aba1bbbae29cd50d9a7b77cf0e9b571b3e5ae7c" + }, + "frozen/prior/PR1080-RECIPE.json": { + "sha256": "d526804d9d627cbd850b0e54c3de9aadc74646e1a9b6befb577f42240720750a", + "kind": "git", + "source": "PR1080", + "commit": "803e080e181229a3af2196b7a13615c9d81ae10d", + "path": "research/u8-two-sided-biforest-seed35/RECIPE.json" + }, + "independent_mst.py": { + "sha256": "8ef41fafd73ab06bfdc78ec69de0192f658bb94c6e452c3ffe53c5983cb16094", + "kind": "new-contribution", + "source": "c01-verification-review/independent_mst.py" + }, + "artifacts/INDEPENDENT-FOREST.json.gz": { + "sha256": "058a5377582227aa0784d205e49efe59b0d4ba525afc2cb49a608f06bd51924a", + "kind": "new-contribution", + "source": "c01-verification-review/CHECKS.json", + "original_sha256": "cc1712a26558e0f9d832d3f2489c8ed49fa026b5a7618c31e5e61eee75582ab3" + } +} diff --git a/research/staged-compensation-forests/PRIOR-CHECK.json b/research/staged-compensation-forests/PRIOR-CHECK.json new file mode 100644 index 0000000000..cc0313d593 --- /dev/null +++ b/research/staged-compensation-forests/PRIOR-CHECK.json @@ -0,0 +1,59 @@ +{ + "current_active_columns": 207, + "current_source_sha256": "735c540b1fe29d0ceeb4d2f304ec941e5f2bd3bc92bafc8cce2b4f9a67a3b653", + "development_note": "Initial reuse of the current raw-panel reader rejected the prior canonical frame ID 0, as expected. This separate audit explicitly reads prior canonical frame 0 and current raw empty-vector frame; no production checker changed.", + "frozen_prior_target_price_on_current_C": 22548, + "literal_helper_transfer_violations": { + "nonfull_terminal_helpers": [ + 226, + 228, + 230, + 251, + 267, + 299, + 304, + 320, + 331, + 363, + 395, + 412, + 428, + 511, + 531, + 572 + ], + "nonzero_entrance_helpers": [ + 462, + 474, + 476, + 477, + 478, + 480, + 523, + 526, + 527, + 528, + 529, + 531, + 542, + 561 + ], + "unavailable_removed_helpers": [ + 494, + 495, + 507, + 519 + ] + }, + "one_strict_eighth_witness": [ + 113, + 288, + "-1/8" + ], + "prior_active_columns": 216, + "prior_recipe_sha256": "d526804d9d627cbd850b0e54c3de9aadc74646e1a9b6befb577f42240720750a", + "prior_word_decoded_sha256": "24db880b7dab31e6af4eec8a1aba1bbbae29cd50d9a7b77cf0e9b571b3e5ae7c", + "scope": "Signed row/column permutations and this exact raw-register recipe transfer only; no general basis or paid remapping obstruction.", + "status": "PASS_INDEPENDENT_PR1080_FIXED_COMPARISON", + "strict_eighth_witness_count": 96 +} diff --git a/research/staged-compensation-forests/PROOF-NUMERICAL.md b/research/staged-compensation-forests/PROOF-NUMERICAL.md new file mode 100644 index 0000000000..56eba045f3 --- /dev/null +++ b/research/staged-compensation-forests/PROOF-NUMERICAL.md @@ -0,0 +1,196 @@ +# Exact finite scalar and prefix consequences of the C01 replacement + +This note concerns the two immutable PR3605 words at head +`3efbb5de06a49ffeea6684482f2d3fe48cdca3fb`. It checks the replacement produced in +the companion design package. It does not establish a new recursive bound, +physical Clifford implementation, or rounded native supplier. + +## Models and input domains + +The raw word has 704 historical register names, of which 72 are removed +identities. Every one of the remaining 632 logical inputs is an arbitrary +independent element. These comprise 112 sources, 112 targets and 408 helpers. +The 91 separate cleanup buffers enter at zero and must return exactly to zero. +The formal warp letters are independent invertible noncommuting operators. + +For the full raw word, `check_word.py` checks all coefficients in the dyadic free +warp algebra. Its integer rows use a common power-of-two denominator and +canonical signed integer coefficients. A warp left-multiplies each formal +word and cancels only an adjacent inverse pair. No numerical specialization of +the warp letters is used for this endpoint check. + +The inverse-transpose replay transposes and negates each ADD and inverts each +SCALE. Each dual warp letter represents `K^-T`, an independent free generator +in that orientation. Identifying it with `conjugate(K)` additionally uses the +inherited unit-modulus monomial premise; arbitrary invertibility alone is not +that premise. This is a separate interpretation of the same free-generator +names. The literal reverse inverse is also checked in each +orientation by reversing the entire chronological list and inverting every +gate. The two orientations and their inverses each cover all 632 arbitrary +input columns and all 91 required-zero buffer outputs. + +A second, explicitly weaker model is the **complete scalar projection** of the +emitted local programs. Every scalar macro is expanded by binary Horner into +ADD, DOUBLE, HALVE, NEGATE, COPY and CLEAR operations. All nonscalar native +events act as the identity in this projection. CLEAR is the assignment of zero, +with unit cost; it is not being proved to be reversible physical erasure. +Logical inputs remain arbitrary, while the eight center registers, 91 cleanup +buffers and one coefficient work register start at zero. Exact symbolic rows +are maintained through every primitive, including every internal Horner step. + +## Panel identity and availability + +Write the original frame-zero compensation as + + (y,h) -> (y+C h,h). + +The proposed target forest is an invertible unit shear product `T`, and the +helper preparation is a product `H` of 88 disjoint signed unit shears. The +literal chronological panel is + + T; H; +(T C H^-1) h; H^-1; T^-1. + +At the correction cut the stored helper vector is `H h`. Consequently + + T^-1 [T y + (T C H^-1)(H h)] = y + C h. + +Restoring `H` returns every arbitrary helper value. Neither preparation uses a +clean helper. The identity holds over every module over the dyadic rationals. +Its inverse subtracts `C h`; its inverse transpose adds `-C^T y` into the helper +bank. The finite check independently replays all four interfaces. + +There are 207 helper coordinates used in the panel. All are live and absent +from both `start_extra` and `helper_final` of the pinned source words. The +pinned transport's definition therefore gives each entrance frame zero and +exit frame FULL. Both preparation and restoration occur in the existing +frame-zero compensation phase, before the native entry adapters. + +The independent checker verifies that every field of the full word other than +`compensation` is unchanged. It also binds the raw panel to its compact +canonical register numbering and to every emitted zero-frame event. The +entire event suffix starting at entry adapters, and the entire nonscalar event +stream, are byte-semantically unchanged. This preserves their existing charges; +it does not price them at zero. + +## Complete scalar invoice + +For a reduced nonzero dyadic coefficient `a/2^d`, the literal binary-Horner +expansion costs + + p(a/2^d) = 3 + floor(log2(abs(a))) + popcount(abs(a)) + d + +per real component. The three fixed operations are the initial work clear, +target addition and final work clear. Every numerator doubling, numerator +addition and denominator halving is included. + +The following panel counts are the same for the base and extra providers and +in both orientations: + +| Part | ADD macros | Primitives per real component | +| --- | ---: | ---: | +| Target preparation | 95 | 380 | +| Helper preparation | 88 | 352 | +| Residual correction | 1922 | 9169 | +| Helper restoration | 88 | 352 | +| Target restoration | 95 | 380 | +| Candidate total | 2288 | 10633 | +| Original panel | 5736 | 31214 | +| Historical C01 rank-basis panel | 3214 | 17334 | + +The historical rank-basis panel is authenticated and freshly replayed on all +632 input columns in all four orientations. Its old receipt is not used as an +acceptance oracle. + +The complete emitted scalar programs, including their unchanged scalar +suffixes, have the following literal prices: + +| Orientation | Original | Candidate | Saving | +| --- | ---: | ---: | ---: | +| Forward, per real component | 79072 | 58491 | 20581 | +| Inverse transpose, per real component | 79096 | 58515 | 20581 | +| Forward, two real components | 158144 | 116982 | 41162 | +| Inverse transpose, two real components | 158192 | 117030 | 41162 | + +There are 17449 original scalar macros and 14001 candidate macros in either +emitted orientation. All native event charges, the recursive child histogram, +helper identities, helper widths, private buffers and source-wrapper charges +are retained. This finite scalar saving supplies no change in a recursive +rank moment or exponent. + +## Exact scalar-prefix and grid consequences + +For the scalar projection, let `A_j` be the matrix taking the 632 initial +logical inputs to all logical and private registers after primitive `j`. +Private initial values are zero. The checker computes every row of every +`A_j` exactly, without rounding. Define + + M = max_j max_r sum_i abs((A_j)[r,i]). + +The maximum is attained: the receipt includes an exact maximizing row, and +choosing each input's sign to match that row attains the row sum on the unit +input cube. These are exact scalar-projection range bounds, not physical +native-prefix norms. + +| Orientation | Original M | Candidate M | Original/candidate extra grid bits D | +| --- | ---: | ---: | ---: | +| Forward | 302 | 302 | 4 / 4 | +| Inverse transpose | 169 | 181 | 5 / 5 | + +The dual range bound becomes worse. It remains below 256 in both cases. +The forward bound remains below 512. For inputs bounded by `B` in absolute +value, all projected scalar registers are bounded by `M B`. + +For any integer `g`, if all logical inputs lie on the grid `2^-g Z`, the +checked primitive prefixes lie on `2^-(g+D) Z`. This follows by writing the +computed matrix rows as integer numerators divided by `2^D`. The receipt +includes a primitive, register and input coefficient having an odd numerator +at the stated maximum denominator. Applying the corresponding basis input +`2^-g e_i` therefore needs exactly `D` extra fractional bits at that prefix. +One fewer extra bit cannot represent that input's exact intermediate value. +Thus `D` is both sufficient and necessary for exact common-grid representation +of this finite scalar projection over the unrestricted common-grid input +domain. It is not a minimum physical guard count for a native supplier. + +On a fixed-point implementation of precisely this scalar projection, with +the stated exact input lattice and sufficient range, those grid bits make +every listed primitive exact. No rounding tie rule is exercised. This +conditional statement concerns the listed assignment/COPY primitives as +well; it does not establish an implementation of their physical contracts. + +The checker separately propagates a cancellation-free positive envelope from +unit bounds on logical inputs and zero bounds on private inputs. It applies +the absolute coefficient to every source contribution and resets the envelope +on each CLEAR assignment. Its largest values are: + +| Orientation | Original positive envelope | Candidate positive envelope | +| --- | --- | --- | +| Forward | 202390250292205836324211411723 / 512 | 277593730512244114269209832351 / 512 | +| Inverse transpose | 4091250694836343058381993950001 / 128 | 18499730109946033497554374971719 / 128 | + +The least integer `b` giving a strict bound by `2^b` is 89 in both forward +cases and changes from 95 to 97 in the inverse transpose. These envelopes are +conservative; they are not the exact attained ranges `M`, a physical storage +invoice, or a local-defect/error-feedback theorem. + +## Defect sensitivity and limits + +Sixteen semantic panel controls per provider must fail after exact arithmetic: +omitted target preparation, omitted helper preparation, omitted helper +restoration, omitted target restoration, stale original correction instead of +the current pullback, a final literal sign error, and wrong target restoration +order in both orientations; plus failure to reverse the literal inverse and a +wrong dual sign. Every rejection has a concrete differing output row in the +receipt. These are mathematical failures rather than authentication failures. + +The scalar replay observes nonzero linear forms at thousands of charged CLEAR +assignments, including eight final center clears. It records their counts +instead of treating those assignments as a strict-zero physical cleanup proof. +The 91 separate zero buffers do return to zero by literal exact computation +before their free events. + +The results comprise finite exact symbolic computations, together with written +linearity and grid arguments covering every input in the stated domains. +No formal proof assistant or kernel certificate is supplied. The result does +not establish a globally optimal two-sided factorization, all-size native +precision, physical Clifford phases, rounded strict-zero cleanup, recursive +source access, complete tape costs, or a new multiplication exponent. diff --git a/research/staged-compensation-forests/PROOF.md b/research/staged-compensation-forests/PROOF.md new file mode 100644 index 0000000000..f2943c76d0 --- /dev/null +++ b/research/staged-compensation-forests/PROOF.md @@ -0,0 +1,269 @@ +# A same-matrix forest and restored helper-basis replacement for C01 + +This is a finite exact compensation construction for the two PR3605 providers +at `3efbb5de06a49ffeea6684482f2d3fe48cdca3fb`. It replaces only their +`compensation` fields. The original 5,736 additions cost 31,214 cleared-work +primitives per real component. A signed target forest costs 13,716, the exact +minimum in the specified target-only forest class. Adding 88 disjoint signed +helper changes produces 2,288 additions at cost **10,633 per real component**. +This strictly improves the preserved C01 rank-basis proposal on this same +matrix, whose 3,214 additions cost 17,334. No recursive cost or kappa changes. + +The forest and two-sided mechanisms are established prior methods. The result +here is their exact source-specific application, complete same-matrix price, +literal restored word, and independently reviewable source bindings. Published +prices for different CK, X4 and U8 matrices are not comparators for this C. + +## Exact source and arbitrary-input contract + +The original compressed blobs are +`research/staged-644-660-width-reduction/STAGED644-660-{base,extra}.json.gz` at +the PR3605 head above. Their SHA256 values are respectively +`735c540b1fe29d0ceeb4d2f304ec941e5f2bd3bc92bafc8cce2b4f9a67a3b653` and +`886338fc32da14f3389a82c8120a1bcf9c5e2f0ec3e9b2d377fdae809e1d977f`. +Their exact compensation matrices agree. Each has 112 target rows, 207 +nonzero helper columns, and coefficients in one eighth of the integers. + +Let y be the actual target registers 112 through 223. Let h be the 207 active +helper coordinates, in their actual raw register identities. Both y and h are +arbitrary and independent on entrance. All remaining live coordinates are +arbitrary spectators. The required local map is + + (y,h) -> (y+C h,h). + +The full source word has 632 arbitrary live inputs and 91 private cleanup +buffers with the inherited zero entrance/exit contract. The compensation +replacement never touches a private cleanup buffer. It uses no new helper, +copy, source query, native warp or recursive child. No helper starts clean by +assumption. + +Every active helper is absent from both `start_extra` and `helper_final`. +This is not inferred just from the old compensation's reads. At the source pin, +`bw_transport.py` lines 158-167 give ordinary helpers default start frame zero +and final frame FULL, overridden precisely by those two dictionaries. Lines +339-348 enforce zero frame for compensation. `bw_emit.py` lines 72-83 execute +compensation before entry adapters and identify wrapped helpers using nonzero +entrance or nonFULL terminal frames. Consequently all chosen helper shears +operate on available, unwrapped frame-zero coordinates. Targets also have +zero entrance at this interface. The 207 helper identities and every selected +pair are recorded in `artifacts/DESIGN.json`. + +These source-code conditions establish the local frame premise. This work does +not claim that a fresh complete native emitter/phase run has been performed. +Native admission remains a dependent obligation. The separate whole-word +reviewer supplies a companion scalar, primitive-price and numerical audit; +its source bindings and exact covered domains must accompany any integrated claim. + +## Signed target forest and its exact class minimum + +For a rooted signed target forest, each nonroot t has one parent p(t) and +sign s_t in {-1,1}. Define + + (T y)_t = y_t - s_t y_p(t), + +with unchanged roots. Prepare these unit shears deepest-first, preserving the +original parent row until every child has read it. Restore by reversing the +preparation list and negating each coefficient. The resulting matrix T is +unit triangular in a depth ordering and invertible over the dyadic rationals. +At the prepared cut the correct residual is D=T C, with rows +`D_t=C_t-s_t C_p(t)`. These are immutable original rows of C, not a sequentially +updated parent row. Omitting preparation or reversing its chronological order +is rejected by actual arbitrary-input operator checks. + +For a reduced nonzero coefficient q=a/2^d, define + + p(q)=3+floor(log2(abs(a)))+popcount(abs(a))+d; p(0)=0. + +This counts one initial work clear, binary Horner source accumulations and +doublings, d halvings, one signed target accumulation and one final clear. +The coefficient work may enter arbitrarily and is erased by the two charged +clears. Real and imaginary components execute the same real-coefficient word +and are charged separately. A unit shear has component cost four, hence a +prepared/restored forest edge costs eight. + +Put `P(r)=sum_j p(r_j)`. Add one superroot *. The graph has a root edge +`(*,t)` of price P(C_t) and two signed edges between every unordered pair t,u, +with price `8+P(C_t-s C_u)`. The sign-symmetric tariff makes the latter prices +independent of the edge's eventual orientation, since +`C_u-s C_t=-s(C_t-s C_u)`. + +Every target forest extends to a spanning tree by joining its roots to *. +Conversely, deleting * from a spanning tree gives components each with exactly +one former neighbor of *, providing their roots. This is a bijection preserving +the complete residual-plus-two-adapter cost. Thus a minimum spanning tree +solves exactly the single-parent signed-unit target-forest problem. + +The complete graph has `112+2*binom(112,2)=12,544` edges. The deterministic +Kruskal construction orders by price, then actual endpoint identities and sign. +It attains 17 roots and 95 forest edges, with maximum target edge depth 15. +All 12,544 cycle inequalities are checked: each graph edge costs at least the +largest selected edge on its unique tree path. This is a certificate of the +spanning-tree minimum by the usual cycle-exchange argument. A separate Prim +traversal of the complete priced graph yields the identical 13,716 price. That +Prim traversal shares the complete edge price list; it is an algorithmic +cross-check, not a second arithmetic implementation. + +The claimed optimum is only for these signed-unit single-parent target forests +with independent coefficient lowering. It excludes multiple parents, general +dyadic target shears, helper transformations, shared coefficient work, +alternative lowerings and surrounding-boundary folding. In particular it is +not a lower bound for the subsequent two-sided construction. + +## Disjoint helper construction on the transformed matrix + +For each chosen ordered pair (a,b) with sign s, prepare `h_a += s h_b`. Every +helper occurs in at most one of the 88 selected pairs. Therefore their unit +shears commute, square-zero cross-terms vanish, and their product H has inverse +obtained by negating the signs. The correction matrix must be + + E = T C H^-1. + +For one pair its only changed column is `E_b=D_b-s D_a`. All pair prices are +computed from D=T C, rather than the original C. The complete signed pair +saving is + + sum_t [p(D_tb)-p(D_tb-s D_ta)] - 8. + +There are exactly `207*206*2=85,284` ordered/sign candidates; 951 have positive +complete savings. Sort by decreasing saving, then actual (a,b,s). One greedy +pass accepts a candidate exactly when neither helper has been used. This +selects 88 disjoint pairs with total saving 3,083 per real component. Disjointness +makes the savings additive because each chosen pair changes a distinct column +and no pair changes another pair's donor column. + +This is a fully specified construction, not a maximum-weight matching claim, +not a joint target/helper optimum, and not an alternating search. No wider +search was performed after finding this useful bounded candidate. + +The complete chronological word is + + y <- T y + h <- H h + y <- y + E h + h <- H^-1 h + y <- T^-1 y. + +For arbitrary y and h it returns +`T^-1(T y+T C H^-1 H h)=y+C h`, with h literally restored. Thus the original +panel and replacement are equal before any surrounding noncommuting native +operator is composed. Every other field of both complete source words remains +identical as a JSON value. No commutation of surrounding warp letters is used. + +The literal inverse reverses every gate and negates every ADD coefficient, +therefore implements `(y,h)->(y-C h,h)`. For a logical ADD gate +`A=I+q e_t e_s^T`, its inverse transpose is `A^-T=I-q e_s e_t^T`. +Apply these dual gates in the same chronological order. This yields the panel +`(y,h)->(y,h-C^T y)`. The helpers change at that dual panel boundary; their +whole-program endpoint obligation cannot be inferred from the forward panel's +unchanged-helper statement. Logical gates are dualized before primitive +lowering. Destructive work clears are not asserted to be invertible. + +## Complete same-matrix price + +| Compensation | Target basis ADDs, both ways | Helper basis ADDs, both ways | Residual ADDs | Total ADDs | Primitives per real component | +| --- | ---: | ---: | ---: | ---: | ---: | +| Original C | 0 | 0 | 5736 | 5736 | 31214 | +| Preserved rank basis | 112 | 0 | 3102 | 3214 | 17334 | +| Signed target forest | 190 | 0 | 2644 | 2834 | 13716 | +| Forest plus disjoint helpers | 190 | 176 | 1922 | 2288 | 10633 | + +The new residual costs 9,169 per component, the target preparation/restoration +760, and the helper preparation/restoration 704, totaling 10,633. Thus the +complete finite compensation saving is 3,448 logical ADDs and +`2*(31214-10633)=41,162` real primitives. It saves 13,402 real primitives over +the preserved rank basis and 6,166 beyond the same-C target-forest floor. +The logical ADD count and coefficient-dependent primitive bill are different +quantities; the latter includes every basis gate and every coefficient read. + +`price_replay.py` independently emits and executes the actual binary-Horner +microcircuit for all 21 coefficients used across the four panels. It checks +arbitrary source, target and private-work inputs and the required zero work +output. It obtains all four prices by summing literal primitive-list lengths, +without invoking the designer's tariff function. Its receipt is `artifacts/PRICES.json`. +The historical rank-basis panel's decompressed SHA256 is +`9f242abd5d2ed46a2e95dad46449d1d77c6fec330b5e0db6b324ac93fe756e62`. + +The inherited recursive histogram remains +`{1:2439,2:726,3:224,4:102,5:20,8:8}` and helper-width inventory remains +`{4:26,5:2,6:18,7:52,8:97,9:213}`. The replacement adds no recursive child, +non-scalar event or helper role. This finite scalar change does not improve +the recursive moment. + +## Comparison with the broader PR1080 method + +PR1080 at `803e080e181229a3af2196b7a13615c9d81ae10d` already supplies signed +helper forests and alternating two-sided MST refinement for historical U8. +Its baseline is a different 112-by-216 matrix with 6,320 nonzeros, quarter-grid +coefficients and cost 34,728. The exact canonical source was extracted from its +pinned archive and checked against decompressed SHA256 +`24db880b7dab31e6af4eec8a1aba1bbbae29cd50d9a7b77cf0e9b571b3e5ae7c`. +The present matrix has 207 active columns and genuine eighth-grid coefficients, +so signed row/column permutations cannot identify the two matrices. + +One fixed recipe-transfer check was performed, without an optimization search. +Its final frozen target forest, applied to the current C, costs **22,548** per +component. A literal register-ID transfer of the helper forest touches four +currently removed helpers (494,495,507,519), 14 helpers with nonzero entrances, +and 16 with nonFULL terminals. It is therefore not an admitted free-wrapper +substitution under the current source contract. The full offending sets and +actual eighth-grid witnesses are in `artifacts/PR1080-COMPARISON.json`. Historical +canonical numbering is not a supplied physical-role correspondence to the +current raw register identities: a paid remapping or other correspondence +would be a new obligation. No general change-of-basis equivalence obstruction +is claimed. The prior 7,930 U8 price is not a bound or candidate price for C01. + +This comparison credits the stronger preexisting mechanism rather than claiming +novelty for two-sided factorization. Applying its broader alternating class to +this new C remains outside the present bounded construction. + +## Executed exact domain and unresolved obligations + +`construct.py` checks original versus each candidate on every one of the 632 live +input columns, under forward, literal inverse and inverse-transpose operators, +in both source providers. All complete words preserve non-compensation JSON +fields. Nine actual operator mutations each fail in all three orientations: +omitted target preparation/restoration; wrong target preparation order; +omitted helper preparation/restoration; helper-preparation sign; residual sign; +target-restoration sign; and stale original-C injection. Each rejection has a +specific differing row/column coefficient. The omitted-target-preparation +control also passes the 520-column projection omitting arbitrary target inputs, +showing why that incomplete projection would be insufficient. + +The design and price checks concern exact rational scalar maps. Complete +supplier numerical prefixes are handled by the separately bound companion +audit. Rounded precision, source/tape access and finite native-phase admission +remain separate dependent obligations. Component +endpoint equality and fewer operations alone prove no bound on intermediate +magnitude or denominator growth. Neither the historical 192-bit allowance nor +an old whole-word prefix receipt is transferred automatically. This note does +not claim an all-size compiler, physical supplier, new owner allocation, +analytic transfer, full multiplication theorem, selected-frontier change, or +formal-kernel proof. + +## Sources and credit + +The actual source is dcharb78's PR3133 lineage and Ross Richardson's PR3605; +the preserved C01 rank-basis proposal is only the same-matrix comparator. +Credit Oscar Fennell PR759 for the forest/superroot method, Sricharan Vagvala +PR749 for rational target pairs and PR967 for bit helper stars, @dd-hemant PR816 +for signed rational forests, David Awad PR807 for helper-basis factoring, Ross +Richardson PR917 and PR932 for exact two-sided and X4 forest applications, and +Stephan Arrington (@steph4n-gh), with the disclosed Google DeepMind Antigravity +assistance, in PR1080 for arbitrary-depth helper forests and alternating refinement. +PR961's target-only dyadic forest analysis concerns its own historical input. +The inherited Gauge44, native, cold-helper, source-recovery, compiler and +precision attributions remain those of the pinned source packages. No code or +numeric saving from a different matrix is treated as interchangeable evidence. + +Prepared with substantial OpenAI Codex assistance. Separate AI mathematical +review is not independent human review. New material is Apache-2.0 under the +repository license. Exact source and output hashes accompany this proof. + +## Open next questions + +A fresh native compilation is needed for an integrated native supplier claim. +The separate whole-supplier scalar/numerical replay must be bound to these +exact replacement bytes. A larger signed helper-forest or +nonunit alphabet could further improve this matrix, but its paid restoration, +precision and source contracts must be recomputed. The present result provides +one useful fully restored candidate without claiming those broader optima. diff --git a/research/staged-compensation-forests/README.md b/research/staged-compensation-forests/README.md new file mode 100644 index 0000000000..6450dcbed9 --- /dev/null +++ b/research/staged-compensation-forests/README.md @@ -0,0 +1,129 @@ +# Restored compensation forests for the staged 644/660 words + +This finite construction replaces the frame-zero compensation in the two +PR3605 words. It reduces **5,736 additions to 2,288**, including preparation +and restoration of both the target and helper bases. Under the stated +cleared-work binary-Horner price, the saving is **41,162 real-component +primitives per orientation**. Every arbitrary target and helper input is +included. + +| Compensation on the same source matrix | Additions | Primitives per real component | +| --- | ---: | ---: | +| Original PR3605 | 5,736 | 31,214 | +| Earlier unpublished rank-basis construction | 3,214 | 17,334 | +| Signed-unit target forest | 2,834 | 13,716 | +| Target forest with disjoint helper pairs | 2,288 | 10,633 | + +The target forest has 17 roots and 95 signed edges. Its fully paid cost is +minimal within the single-parent signed-unit target-forest class on this +matrix. The second step selects 88 disjoint helper pairs from one fully +specified sorted greedy pass. **The two-sided circuit has no claimed global +or matching optimality.** The 1,922 remaining injections, 95 target preparations, +88 helper preparations, and both sets of restorations are all charged. + +The construction uses established forest and two-sided basis methods. Its +contribution is the explicit circuit for these exact staged words, the +comparison with the superseded unpublished circuit, and the accompanying +source-bound checks. [RELATED-WORK.md](RELATED-WORK.md) separates the input +matrices and prior recipes. + +## Exact interface + +Let `y` be the 112 arbitrary targets and `h` the arbitrary helper coordinates +at the compensation boundary. The source response is `(y,h) -> (y+C h,h)`. +Prepare the signed target forest `T` deepest-first, prepare the disjoint helper +shears `H`, inject `T C H^-1`, restore `H`, and restore `T`. The endpoint is +exactly the original response over the dyadic rationals. The helpers are +temporarily changed and then restored. + +All 207 active helper columns have the required zero-frame entrance and FULL +terminal frame in the pinned word. No removed register, private zero buffer, +wrapped entrance or early-ended helper is used as a new donor. Only the +compensation field changes. Sources, centers, warps, helper roles, ordered +widths, cleanup and the paid recursive profile are retained. + +The literal inverse reverses and negates the additions. The same-chronology +inverse transpose swaps source and target and negates each coefficient. Its +compensation endpoint changes helpers by `-C^T y`; unchanged-helper language +applies to the forward boundary. + +## Complete scalar comparison + +The independent logical-word replay retains ordered formal warp letters and +checks 632 arbitrary live inputs and 91 initially zero private buffers in +both orientations and their literal reverse inverses. A separate replay lowers +both emitted programs to scalar primitives. In that projection, nonscalar +events act as identity and CLEAR is a zero assignment. The original transport +and emitter produce these streams; they are not counted as a second +independent mathematical implementation. + +| Complete scalar-program quantity, per provider | Original | New | +| --- | ---: | ---: | +| Forward primitives per real component | 79,072 | 58,491 | +| Backward primitives per real component | 79,096 | 58,515 | +| Forward maximum exact coefficient row sum | 302 | 302 | +| Backward maximum exact coefficient row sum | 169 | 181 | +| Forward positive-envelope bits | 89 | 89 | +| Backward positive-envelope bits | 95 | 97 | + +Both conservative positive envelopes increase; the forward bit ceiling stays +at 89, while the backward ceiling rises to 97. The backward exact row sum also +increases. The earlier supplier's precision allowance is not reused. Exact prefix denominator +depths remain 4 forward and 5 backward. These are finite scalar/free-warp +calculations, not native phase or rounding certificates. + +## Reproduce + +With CPython 3.12 and its standard library, from the repository root: + +```sh +python3 -I -B scripts/research_package.py --package research/staged-compensation-forests +``` + +The registered commands authenticate the frozen inputs, regenerate the circuit +and its complete records, check the independent mathematical receipts, and +exercise acceptance controls. Generated output goes to temporary directories. +The package also works from a Git-free source export. The source transport and +emitter run with their assertions enabled. + +## Scope and limits + +The recursive profile remains +`{1:2439,2:726,3:224,4:102,5:20,8:8}`. The 408 helper roles, 91 private cleanup +buffers and ordered helper-width inventory are unchanged. Consequently this +scalar substitution gives **no improved recursive moment or kappa**. + +All coefficient work uses the declared component price +`p(a/2^d)=3+floor(log2|a|)+popcount(|a|)+d` for reduced nonzero dyadics, +with `p(0)=0`. This is a specified finite lowering model, not a measured runtime +claim. Scalar projection checks do not establish native phases, physical +strict-zero erasures, rounded cleanup, hosted owner allocations or an all-size +supplier. No existing whole-supplier precision allowance is admitted by this +package. + +The historical C01 factory and cold-tail screens are retained as provenance +in [the original note](frozen/history/C01-PROOF.md). They are not rerun or +promoted to new claims here. + +## Open next questions + +1. Can this exact compensation be admitted into a complete hosted native + supplier with its actual rounding, source-access and physical cleanup + costs? Start from the frozen two-sided words and regenerate that full + invoice and precision argument. +2. Can a different local contract improve the paid recursive profile? + Further scalar savings alone do not resolve that obligation. A new claim + must name the changed frame or child call and include all restoration. + +## Sources and credit + +PR3605 is pinned at `3efbb5de06a49ffeea6684482f2d3fe48cdca3fb`. +Its PR3133 word lineage, Jeremy Kothe's routing/preload work, Yiyang Lu's +compensation work and the retained native implementation notices remain +credited in [NOTICE.md](NOTICE.md). Forest and two-sided predecessors are +credited separately in [RELATED-WORK.md](RELATED-WORK.md). + +Prepared by Ross Richardson with substantial OpenAI Codex assistance in +construction, mathematical checking, verification and publication. Separate +AI contexts are not independent human review or formal-kernel evidence. +Apache-2.0. diff --git a/research/staged-compensation-forests/RELATED-WORK.md b/research/staged-compensation-forests/RELATED-WORK.md new file mode 100644 index 0000000000..b4afe5dd5c --- /dev/null +++ b/research/staged-compensation-forests/RELATED-WORK.md @@ -0,0 +1,37 @@ +# Related work and comparison boundary + +Restored target bases, signed forests and two-sided bases are prior methods. +The identity `T^-1(Ty + T C H^-1 Hh) = y+Ch` is not new. + +- Oscar Fennell's rooted target forests, Sricharan Vagvala's JP8 target + factorization, and the target-pair work of Scott Woolsey Biggart, Sagar + Thakrar, Dugongue, @dd-hemant and ToikY establish the relevant lineage. +- PR816 gives signed CK target forests and their exact class floor. +- David Awad's PR807 and Ross Richardson's + [PR917](https://github.com/CrocSwap/integer-mult-bounds/pull/917) + apply disjoint helper bases around target factorizations. PR917 is pinned + at `085c32a25e2a09b029fa816195b97fa93d6f0788`. +- PR967 allows depth-one helper stars. + [PR1080](https://github.com/CrocSwap/integer-mult-bounds/pull/1080), + pinned at `803e080e181229a3af2196b7a13615c9d81ae10d`, supplies a broader + two-sided signed bi-forest alphabet with arbitrary depth. + +Those numerical savings concern other matrices. This package compares all +four displayed costs on the exact PR3605 compensation matrix. In particular, +PR1080 has 216 active helpers and a quarter-grid matrix; this source has 207 +active helpers and nonzero eighth-grid coefficients. Its frozen literal +register recipe also refers to removed or differently wrapped helpers in the +staged word. A paid port or role remapping would be a separate construction. +The restricted 88-pair result does not exclude bi-forests or any other wider +alphabet. + +The historical unpublished C01 panel is supplied as an exact comparator, +not a new claim for basis-factorization priority. Its finite benefit is +superseded by the new circuit. The earlier source-factory failure screens +answer different questions and are not expanded here. + +Live overlap checks on 2026-10-20 searched paginated open and closed PR titles +and bodies, Discussions, and 5,234 local records. The snapshot reached +312 open PRs, 3,540 closed PRs and 2,707 Discussions, with individual fetches +between 12:45 and 12:47 UTC. These searches identify leads; they do not prove +novelty or inspect every code diff. diff --git a/research/staged-compensation-forests/REVIEW-DESIGN.md b/research/staged-compensation-forests/REVIEW-DESIGN.md new file mode 100644 index 0000000000..ee9fc797a7 --- /dev/null +++ b/research/staged-compensation-forests/REVIEW-DESIGN.md @@ -0,0 +1,45 @@ +# Mathematical cross-review of the companion C01 design + +PASS within the stated finite, exact scalar compensation model. Reviewed +`c01-design/PROOF.md` (SHA256 `3cbacd11a7d7414e8889a6f559e759e9166d367fb7ec14c8896d381c7365ccf4`) and the constructor +`c01-design/design.py` (SHA256 `7d64232bced5cb621ff1a4ee65155b8d48b95620323564721042b4cfcb11bb00`). The independent whole-word +checker in this directory does not import that constructor. + +The target preparation order is correct: deepest-first updates read each +original parent before that parent changes. Its residual is exactly `T C`. +For each helper preparation `h_a += s h_b`, right multiplication by `H^-1` +changes column b to `D_b - s D_a`. Pairwise disjointness prevents cross terms +and makes the claimed selected-pair savings additive. Restoring H and then T +therefore returns every arbitrary helper and target dirt term correctly. This +is freshly checked on all 632 logical input columns in both providers, with +forward, inverse-transpose and both literal reverse inverses. In particular, +the dual panel changes helpers by `-C^T y`; the proof correctly avoids claiming +they remain fixed at that local dual boundary. + +The source-availability premise is sufficient for this changed choice. The +207 used helpers are live and absent from both source override dictionaries; +the authenticated transport gives precisely those helpers zero entrance and +FULL exit frames. The emitted prefix binds each raw register to its compact +identity and executes all helper preparation/restoration before entry adapters. +The entire suffix and every nonscalar event are unchanged. This is a checked +local availability and scalar-emission statement, not a fresh physical phase +proof or a new native supplier contract. + +The target-forest optimum is correctly restricted to one signed unit parent +per nonroot, with the stated independent coefficient tariff. The superroot +bijection and sign symmetry make its total bill exactly a spanning-tree bill; +the complete all-edge cycle certificate is the appropriate minimum criterion. +The Prim calculation is correctly described as sharing the edge prices. The +88-pair selection is explicitly greedy and not claimed globally optimal. My +arithmetic replay independently confirms the final panel price 10633 per +component and the historical same-matrix rank-basis price 17334; it does not +supply an independent second enumeration of all forest or helper candidates. + +The finite primitive reduction is useful, but its numerical tradeoff must +accompany the integrated claim: the exact scalar dual prefix row bound rises +from 169 to 181 and its positive-envelope strict power-of-two allowance rises +from 95 to 97 bits. Forward positive envelope also grows, while its 89-bit +allowance and exact range bound 302 remain unchanged. Exact scalar projection +grid depths stay four and five in the two orientations. CLEAR remains a +charged assignment in this model. No rounded physical cleanup, formal-kernel +proof, all-size implementation or new kappa follows. diff --git a/research/staged-compensation-forests/REVIEW-NUMERICAL.md b/research/staged-compensation-forests/REVIEW-NUMERICAL.md new file mode 100644 index 0000000000..2134503988 --- /dev/null +++ b/research/staged-compensation-forests/REVIEW-NUMERICAL.md @@ -0,0 +1,185 @@ +# Cross-review of the companion C01 whole-word audit + +Status: **PASS for the stated exact formal-word and finite scalar-projection +claims.** No remaining mathematical or implementation blocker was found in +this bounded source review. This is a read-only review, not a second execution +of the companion checker or an independent human review. + +Reviewed source hashes: + +- `c01-wholeword/check.py`: + `16cdeef8aabed919c066ad5da45450cfc524024814f550b3415368ed098a38c6` +- `c01-wholeword/PROOF.md`: + `4bf4ab27640122985b4d2c9f941003d6e9cbda612b0811735f014585fde0d109` + +The review also used the already frozen, unchanged design-side source copies +of the PR3605 `bw_transport.py` and `bw_emit.py` to check the claimed event and +frame convention. The design panel payload remains SHA256 +`27defe7675576baaebfd45efe40439f491a683bd923b7259c98495db8d3783ac`. +No design source, proof or frozen receipt was changed by this cross-review. +This new review file is supplemental to the earlier design output inventory. + +## Formal operator interpretation + +`raw_program` constructs the entire literal chronology: expanded initial +corrections, precondition, compensation, A, cut, indexed B warps, B, restore and +cleanup. Initial corrections apply their operator word in the correct order +by reversing the chronological list of letters, then remove it with the +corresponding inverse sequence. `free_replay` left-multiplies free words and +cancels only adjacent inverse pairs. The word action is injective, which is +checked rather than using a commutative projection. + +The raw endpoint check covers all 632 arbitrary logical columns plus the 91 +zero-input private buffer rows. It compares the complete symbolic output with +the required shear and all helper identities, including zero private outputs. +The literal reverse inverse reverses the whole gate list and inverts each +ADD/SCALE/warp. The signed expected shear is adjusted accordingly. + +The same-order dual gate rules are correct. Scalar ADDs exchange source and +target and negate their coefficient; SCALE coefficients are inverted. The +unchanged warp identifier has a separate meaning in the dual alphabet, +namely K inverse transpose. Since free generators can be independently +renamed, the symbolic replay is valid under that interpretation. It does not +identify K with its own inverse transpose. For the inherited unit-modulus +monomial realization, K inverse transpose equals conjugate K; the physical +phase premise is separate and is not checked here. + +The proof originally left the last premise implicit. I requested an explicit +distinction between arbitrary invertibility and the unit-modulus monomial +interpretation. The reviewed final proof now states that distinction directly. +The checker required no change. + +## Raw word, emitted program and scalar projection + +The raw free-word map and the complete scalar projection are distinct models +throughout the reviewed proof. The latter explicitly sets nonscalar events +to identity, uses 632 arbitrary logical inputs, and initializes all eight +centers, 91 cleanup buffers and coefficient work to zero. No scalar-projection +range is asserted to be a physical native-prefix norm. + +The producer scripts are pinned before execution. The final loader reads each +producer into a byte buffer, checks that exact buffer against the declared +source hash, and sends the same bytes to the child over standard input. +Child Python invocations use `-I -B` without `-O`, even when the surrounding +checker is optimized. The bootstrap compiles those authenticated bytes with +`dont_inherit=True, optimize=0`, preserving the producer's `__file__` and +command-line arguments. It does not reopen the producer path as executable +source after authentication. +`bind_emitted_prefix` checks the raw-to-compact register mapping and every +zero-frame event against the independently expanded raw prefix, in both +orientations. The changed complete raw word is equal to the source in every +non-compensation field. The emitted suffix from entry adapters onward and +all nonscalar events must also agree exactly as JSON values. Those checks +justify retaining their existing charges, without setting them to zero or +claiming physical phase verification. + +The source helper availability check uses actual live register identities +and excludes both entrance and terminal wrapper overrides. This agrees with +the pinned transport defaults and zero-frame phase placement. The unchanged +literal helper and target restoration lists are checked explicitly before +operator equality is accepted. + +## Literal primitive price + +`lower_scalar` spells out the primitive lists separately from `primitive_price`. +For a nonzero dyadic ADD it emits the initial clear, every binary Horner +doubling and source ADD, every denominator halving, the signed target ADD and +the final clear. Its length is precisely +`3+floor(log2(abs(a)))+popcount(abs(a))+d`. Binary SCALE, negative sign, +COPY and CLEAR are all counted. The full scalar replay counts the emitted +primitive stream rather than multiplying ADD macro counts by a unit price. +It checks agreement with the producer's count and with the panel delta. + +This supports the stated component price change 79,072 to 58,491 forward and +79,096 to 58,515 dual, conditioned on the companion's executed receipts. +The common saving is 20,581 per real component, or 41,162 for two components. +The panel bill 31,214 to 10,633 agrees with the design and its separately +executed Horner microcircuit audit. No additional work-buffer or helper +initialization is hidden by these exact counting rules. + +## Exact range and grid theorem + +The normalized integer-dyadic row representation is sound. `row_add` aligns +both denominators before addition; `normalize` removes only the common power +of two shared by all coefficients. Row updates produce new dictionaries, so +COPY's temporary sharing of an immutable row object does not introduce a +later aliasing mutation. + +The metrics observe every changed destination after every literal primitive. +Unchanged rows retain their previously observed values. Initial logical rows +have norm one and private rows are zero, agreeing with the metric initialization. +Therefore the maximum of the observed exact absolute row sums is exactly +`max_j ||A_j||_infinity`, including intermediate Horner work. The maximizing +row witness gives an attaining input by assigning each independent real input +the sign of its coefficient. This proves the all-input unit-cube range claim +for the specified scalar projection. Scaling gives M times the input bound. + +For the grid theorem, every stored row denominator divides 2^D, so common-grid +inputs in 2^-g times the integers remain in the grid with g+D fractional bits. +At each newly largest positive exponent, canonical normalization guarantees +an odd coefficient exists; `Metrics.observe` records one. The corresponding +basis input at scale 2^-g proves necessity of that D over the unrestricted +common-grid domain. This does not prove a physical native guard-bit minimum. +The proof makes that limitation explicit. + +The companion's reported exact dual range increases from 169 to 181, and its +positive-envelope exponent increases from 95 to 97. These are retained as +worse bounds, not suppressed by the lower primitive count. The forward exact +range 302 and extra fractional grid bits 4/5 have their stated restricted +scalar-projection meaning. Positive-envelope propagation uses absolute values +and therefore provides a separate conservative bound, not the exact attained +row sum. The strict power-of-two bit conversion is correct for the nonzero +maxima used here. + +## CLEAR semantics and precision boundary + +A CLEAR is an explicitly charged zero assignment in the scalar model. The +counter increments when its pre-clear symbolic linear form is nonzero. This +means some admitted input makes that clear erase nonzero content; it does not +mean every numerical input is nonzero at that instruction. I requested this +wording clarification, and the reviewed final proof now says “nonzero linear +forms.” The implementation was already consistent with that statement. + +The 91 private zero buffers have a different, literal zero contract: allocation +and free events check their exact rows are zero, and all their uses are checked +against the active allocation set for the operations occurring here. Eight +final center clear assignments are not promoted to a reversible cleanup proof. +The proof separates these assignments from physical erasure, native child +precision, roundoff feedback, strict-zero restoration and all-size tape costs. + +The fixed-point observation is valid as a conditional exact implementation +statement: sufficient range and the proven input/grid assumptions make each +listed scalar primitive exact, so no rounding tie is exercised. It supplies +no implementation of the physical COPY/CLEAR contracts. + +## Loader-only update + +The initial review covered checker +`793a5ad6ab49640f732aed19788e4eb30f7af6fe30709ac917ae07c80959f725`. +For the updated checker I isolated the new authenticated-buffer loader block +inside `produced_programs`. Replacing only that block with its previous +path-execution implementation reconstructs the exact former checker hash. +Thus no mathematical interpreter, cost, domain, witness or acceptance code +changed in this update. The proof hash above is also unchanged. + +The companion's final `VALIDATION.json`, SHA256 +`9eef8187df474a4b4ccdfb0410f92c66ad920a2c23fab2ca9456e032564685d2`, +records successful normal and optimized replay with identical receipts. +It records that removing only `checker_sha256` leaves the entire mathematical +receipt unchanged. The current `CHECKS.json` SHA256 is +`bd442037a8dc9c2a27f6a1b1e8b1e45e5c934cb7129cee2db2f85d1c20f26ec1`; +I checked its binding to the new checker hash. This review inspected those +bindings and the exact loader-only difference; it did not repeat the +companion's mathematical executions. + +## Review outcome + +The two requested documentation clarifications were applied and re-read at the +hashes above. The authenticated-buffer loader update is also accepted. +No checker defect or numerical inconsistency requiring an additional +mathematical run was found during this review; no checker was rerun here. +Root integration should +bind the companion's executed receipt to these exact checker and replacement +bytes, preserve the worsened dual bounds, and retain the native/rounded and +full-multiplication-theorem exclusions. No broader optimum, new kappa or formal +kernel proof follows from this pass. diff --git a/research/staged-compensation-forests/REVIEW-VERIFICATION.md b/research/staged-compensation-forests/REVIEW-VERIFICATION.md new file mode 100644 index 0000000000..3a99a36eda --- /dev/null +++ b/research/staged-compensation-forests/REVIEW-VERIFICATION.md @@ -0,0 +1,171 @@ +# Independent forest, source and acceptance review + +**Verdict: PASS within the declared finite compensation model.** +This review independently derives the target-forest prices and verifies the +literal two-sided basis word, then audits the package's execution and receipt +bindings. It is separate AI review, not human acceptance or a formal-kernel +proof. Substantial OpenAI Codex assistance was used. + +## Exact mathematical domain + +The two inputs are pinned PR3605 words at +`3efbb5de06a49ffeea6684482f2d3fe48cdca3fb`. Their compensation matrices agree: +112 targets, 207 active helper columns and 5,736 nonzero entries. Each complete +word has 632 arbitrary live logical inputs. The independent panel interpreter +gives every live register its own input column, including arbitrary targets, +all active dirty helpers and all untouched spectators. + +The required panel is `(y,h) -> (y+C h,h)`. The source's ZERO and FULL frames +are frame conditions, not assertions that a helper's entering data are zero. +The pinned transport's default `start` and `final` expressions were inspected +and matched as AST expressions without executing that producer. All 207 +active helpers are present, absent from `removed`, and absent from both +override dictionaries `start_extra` and `helper_final`. They therefore have +the required ZERO entrance and FULL terminal conditions under that producer. + +The independent checker uses sparse `Fraction` rows, without the builder's +common-eighth representation or any imported builder routines. Its tariff +counts a separately constructed binary-Horner work computation: initial +CLEAR, source accumulations, doublings, denominator halvings, signed target +ADD and final CLEAR. Its exact coefficient reconstruction is checked before +the count is used. + +## Forest minimum and literal basis word + +For a signed parent edge, the complete component cost is +`8 + sum_j p(C_tj - s C_pj)`; a root costs `sum_j p(C_tj)`. +The eight primitives include both unit basis directions. Sign invariance +makes each signed pair price independent of its eventual orientation. +Adding a superroot gives a cost-preserving bijection between the declared +single-parent forests and spanning trees. + +The independent computation prices all 112 root edges and both signs of +all 6,216 target pairs: **12,544 edges**. It validates the selected tree, +reconstructs its rooted orientation and checks every cycle inequality. +A separate heap-based Prim traversal of the independently priced graph +returns **13,716**. The certificate has 17 roots, 95 target edges and maximum +target depth 15. This is a minimum only in the fixed signed-unit, +single-parent target-forest class with independent coefficient lowering. + +The actual preparation list is checked for the prescribed parent/sign +incidences and leaf-before-parent chronology. Applying that literal list to +the source matrix independently yields `D=T C`; it equals the direct +immutable-parent formula. The restore list must be the literal reverse +inverse. This checks arbitrary target inputs as well as helper coefficients. + +The checker separately recomputes all **85,284** ordered signed helper scores +from D. Exactly 951 are positive. The declared deterministic greedy rule +selects **88 disjoint pairs**, using 176 helpers and saving 3,083 component +primitives. Disjointness makes those scores additive. This verifies a +construction; it does not prove a maximum matching or a joint basis optimum. + +For `h_a += s h_b`, right multiplication by `H^-1` changes column b to +`D_b-s D_a`. The actual residual injections are compared completely with +`E=T C H^-1`. The actual helper restore is `H^-1`, followed by `T^-1`. +Thus every arbitrary input returns +`T^-1(T y + T C H^-1 H h)=y+C h`, with h restored literally. + +Both supplied providers pass all 632 input columns in the forward, literal +reverse-inverse and same-chronology inverse-transpose orientations. The dual +panel is `(y,h-C^T y)`: helpers change at this intermediate dual boundary. +The forward panel's restored-helper statement is not transferred to it. +Every complete candidate word is also checked to differ from its source +only in the compensation field. + +The independent complete component bills are: + +| Panel | Logical ADDs | Component primitives | +| --- | ---: | ---: | +| Original | 5,736 | 31,214 | +| Signed forest | 2,834 | 13,716 | +| Forest and disjoint helper basis | 2,288 | 10,633 | + +The last bill includes 760 target-basis primitives, 704 helper-basis primitives +and 9,169 residual primitives. It does not omit restoration. The separate +same-matrix historical rank-basis comparator costs 17,334, as checked by the +package's literal-price and whole-word auditors. + +## Defect-sensitive controls + +The independent forest receipt records thirteen rejecting controls for each +provider. Actual mutations omit or change target preparation, helper +preparation, residual injections and either restore; reverse target +chronology; or violate the helper entrance/terminal conditions. Each +operator mutation has an explicit differing row and input-column coefficient. +The test requires the intended semantic error. Unexpected acceptance is +raised outside the exception handler. + +Deleting only the complete endpoint requirement makes its negative control +fail, establishing sensitivity to that requirement. A positive control adds a +cancelling unit ADD pair: all three operator orientations still pass, and its +eight component primitives are charged. Omitting target preparation passes +the helper-only input projection while failing the full arbitrary-input map, +so checking only incoming helper columns would be insufficient. + +Normal execution and an isolated optimized execution from a temporary script +path containing spaces produce byte-identical complete forest receipts. +`MST-VALIDATION.json` records that run. The source and candidate directories were +shared read-only; this is not described as a complete package export. + +## Source execution and complete records + +Three execution-layer gaps were found and corrected during review: the root +wrapper reopened authenticated script paths, its stage result could omit a +comparison without failing coverage, and the whole-word checker's nested +producer subprocesses reopened producer paths. Both execution levels now send +the captured authenticated bytes to isolated subprocesses and compile with +`dont_inherit=True, optimize=0`, preserving the declared `__file__` and +`sys.argv` values. No frozen module is loaded through importlib or a bytecode +cache. The nested historical producers' assertions remain active under an +optimized outer verifier. + +The wrapper rejects duplicate JSON object keys and nonfinite constants, +unsafe paths, missing regular inputs, symlink escapes, changed frozen bytes, +origin-inventory mismatches and changed decompressed originals. Complete +canonical JSON comparison distinguishes integer, float and boolean values, +preserves list order and includes every nested field. Missing fixed records +are not regenerated. + +The required stage sets contain thirteen construction/comparator records, +one independent forest record and one whole-word record. Exact set and +duplicate-count checks enforce all fifteen comparisons. Construction also +checks its complete generated-file inventory. + +`CONTROLS.json` records compact normal and optimized runs against the final +wrapper and checkers: **70 intended rejections and three named-check deletion +tests per mode**, with all fifteen complete records checked. The control +driver itself also produces byte-identical receipts under outer normal and +optimized execution, recorded in `CONTROL-VALIDATION.json`. +These cover actual captured-source execution after a +disposable path change, both assertion layers, complete-record mutation and +omission, stage coverage, and a changed sign in the actual authenticated +target-basis word. Named record, coverage and endpoint checks are deliberately +deleted to verify that the corresponding controls then fail. The compact +suite replays the actual compensation panel; it does not repeat the complete +whole-word scalar audit or edge census for every mutation. + +## Earlier work and remaining limits + +The fixed PR1080 comparison was independently recalculated. Its prior matrix +has 216 active columns and quarter-grid coefficients; this one has 207 active +columns and 96 strict eighth-grid entries. Those invariants exclude signed +row/column permutation equivalence. Its frozen target forest costs 22,548 on +this matrix. Literal helper-ID transfer touches exactly four removed helpers, +fourteen nonzero entrances and sixteen non-FULL terminals. These are bounded +facts about that source and recipe, not a general basis-equivalence or paid +remapping obstruction. + +The design proof and related-work note credit the prior target-forest, +helper-basis and broader bi-forest methods. The present contribution is a +source-specific restored circuit and its complete same-matrix comparison, +not priority for those mechanisms. + +The companion whole-word audit owns the full free-operator identities, +literal emitter bindings and scalar-prefix replay. Its scalar numerical model +treats nonscalar events as identity and CLEAR as assignment. It therefore +does not by itself prove physical Clifford phases, reversible erasure, +native-child precision or recursive rounding. The panel proof also does not +establish COPY lifetimes, a new physical tape implementation, recursive +histogram improvement, a general supplier bound or a new kappa result. +Final package bytes are delimited by `CORE-SNAPSHOT.json`; committed and +Git-free package replay remain the parent's separate validation stages. diff --git a/research/staged-compensation-forests/SOURCE-HISTORY-ALIASES.json b/research/staged-compensation-forests/SOURCE-HISTORY-ALIASES.json new file mode 100644 index 0000000000..be909b05a1 --- /dev/null +++ b/research/staged-compensation-forests/SOURCE-HISTORY-ALIASES.json @@ -0,0 +1,133 @@ +{ + "reason": "PR3605 head is available locally but not ancestor of canonical main; registered source-history gate uses byte-identical retained main copies. Scientific pin and frozen word bytes remain unchanged.", + "bindings": [ + { + "historical_source": { + "path": "research/staged-644-660-width-reduction/STAGED644-660-base.json.gz", + "usage": "provenance", + "git_blob": "dc6d321b1e8e2a837a1ff7bb60e8f8f78d043db5", + "sha256": "735c540b1fe29d0ceeb4d2f304ec941e5f2bd3bc92bafc8cce2b4f9a67a3b653", + "pin": "head:3efbb5de06a49ffeea6684482f2d3fe48cdca3fb:research/staged-644-660-width-reduction/STAGED644-660-base.json.gz" + }, + "retained_source": { + "path": "research/staged-644-660-independent-audit/inputs/STAGED644-660-base.json.gz", + "usage": "provenance", + "git_blob": "dc6d321b1e8e2a837a1ff7bb60e8f8f78d043db5", + "sha256": "735c540b1fe29d0ceeb4d2f304ec941e5f2bd3bc92bafc8cce2b4f9a67a3b653" + }, + "byte_identical": true + }, + { + "historical_source": { + "path": "research/staged-644-660-width-reduction/STAGED644-660-extra.json.gz", + "usage": "provenance", + "git_blob": "78e7b2bb0653c8dcc0133980a19dd9d97ebdb67e", + "sha256": "886338fc32da14f3389a82c8120a1bcf9c5e2f0ec3e9b2d377fdae809e1d977f", + "pin": "head:3efbb5de06a49ffeea6684482f2d3fe48cdca3fb:research/staged-644-660-width-reduction/STAGED644-660-extra.json.gz" + }, + "retained_source": { + "path": "research/staged-644-660-independent-audit/inputs/STAGED644-660-extra.json.gz", + "usage": "provenance", + "git_blob": "78e7b2bb0653c8dcc0133980a19dd9d97ebdb67e", + "sha256": "886338fc32da14f3389a82c8120a1bcf9c5e2f0ec3e9b2d377fdae809e1d977f" + }, + "byte_identical": true + }, + { + "historical_source": { + "path": "research/rank7-coupled-586-588-carrier-fold/CREDITS.md", + "usage": "provenance", + "git_blob": "24f00912d4ec829c3c8d2a8d086aa135664a124c", + "sha256": "1d9d8f56d8899f55878e4cb2c4e052b22506444016a51c2e678773505f5189e6", + "pin": "head:3efbb5de06a49ffeea6684482f2d3fe48cdca3fb:research/rank7-coupled-586-588-carrier-fold/CREDITS.md" + }, + "retained_source": { + "path": "research/rank7-coupled-586-588-carrier-fold/CREDITS.md", + "usage": "provenance", + "git_blob": "24f00912d4ec829c3c8d2a8d086aa135664a124c", + "sha256": "1d9d8f56d8899f55878e4cb2c4e052b22506444016a51c2e678773505f5189e6" + }, + "byte_identical": true + }, + { + "historical_source": { + "path": "research/rank7-coupled-586-588-carrier-fold/NOTICE", + "usage": "provenance", + "git_blob": "89c20926ea7f803718f751d95989d5a269908efd", + "sha256": "c9731c9cca25ede32c2a1b3aef6d5b249973cb2ed5fb2494407bdca598763661", + "pin": "head:3efbb5de06a49ffeea6684482f2d3fe48cdca3fb:research/rank7-coupled-586-588-carrier-fold/NOTICE" + }, + "retained_source": { + "path": "research/rank7-coupled-586-588-carrier-fold/NOTICE", + "usage": "provenance", + "git_blob": "89c20926ea7f803718f751d95989d5a269908efd", + "sha256": "c9731c9cca25ede32c2a1b3aef6d5b249973cb2ed5fb2494407bdca598763661" + }, + "byte_identical": true + }, + { + "historical_source": { + "path": "research/t74-native-fast/NATIVE-LINEAGE-NOTICE", + "usage": "provenance", + "git_blob": "380e979f0e84e00a22bd890615d87cc4684ad740", + "sha256": "ee0c73ca35877aad0e0b6adc560a3881cb82276dba4cf2d4fc58cd19e57cc420", + "pin": "head:3efbb5de06a49ffeea6684482f2d3fe48cdca3fb:research/t74-native-fast/NATIVE-LINEAGE-NOTICE" + }, + "retained_source": { + "path": "research/t74-native-fast/NATIVE-LINEAGE-NOTICE", + "usage": "provenance", + "git_blob": "380e979f0e84e00a22bd890615d87cc4684ad740", + "sha256": "ee0c73ca35877aad0e0b6adc560a3881cb82276dba4cf2d4fc58cd19e57cc420" + }, + "byte_identical": true + }, + { + "historical_source": { + "path": "LICENSE", + "usage": "provenance", + "git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "pin": "head:3efbb5de06a49ffeea6684482f2d3fe48cdca3fb:LICENSE" + }, + "retained_source": { + "path": "LICENSE", + "usage": "provenance", + "git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + }, + "byte_identical": true + }, + { + "historical_source": { + "path": "research/t74-native-fast/vendor/native/new/code/borrow/bw_transport.py", + "usage": "provenance", + "git_blob": "08248542b18864c94a5ac050c8669f68519838e1", + "sha256": "9818e08b819310b40f1441b89be8c4369584a5b3fa5dfe9b86b1df9a7f5d6a76", + "pin": "head:3efbb5de06a49ffeea6684482f2d3fe48cdca3fb:research/t74-native-fast/vendor/native/new/code/borrow/bw_transport.py" + }, + "retained_source": { + "path": "research/t74-native-fast/vendor/native/new/code/borrow/bw_transport.py", + "usage": "provenance", + "git_blob": "08248542b18864c94a5ac050c8669f68519838e1", + "sha256": "9818e08b819310b40f1441b89be8c4369584a5b3fa5dfe9b86b1df9a7f5d6a76" + }, + "byte_identical": true + }, + { + "historical_source": { + "path": "research/t74-native-fast/vendor/native/new/code/borrow/bw_emit.py", + "usage": "provenance", + "git_blob": "6d47f63ab7a533941b3881bbfd3ae4dac5f76932", + "sha256": "99b59a6fa3feda86785e4225157dcb1a6169d256cec4f5e0acc9cea7a701df76", + "pin": "head:3efbb5de06a49ffeea6684482f2d3fe48cdca3fb:research/t74-native-fast/vendor/native/new/code/borrow/bw_emit.py" + }, + "retained_source": { + "path": "research/t74-native-fast/vendor/native/new/code/borrow/bw_emit.py", + "usage": "provenance", + "git_blob": "6d47f63ab7a533941b3881bbfd3ae4dac5f76932", + "sha256": "99b59a6fa3feda86785e4225157dcb1a6169d256cec4f5e0acc9cea7a701df76" + }, + "byte_identical": true + } + ] +} diff --git a/research/staged-compensation-forests/SOURCES.json b/research/staged-compensation-forests/SOURCES.json new file mode 100644 index 0000000000..f5f99bad8d --- /dev/null +++ b/research/staged-compensation-forests/SOURCES.json @@ -0,0 +1,131 @@ +{ + "schema_version": 1, + "base_commit": "12fa8c5c844be21bfefb38a19503fbd867a11244", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81", + "sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "64bfc5af6709ed9811171e0a2108f05e1219cb65", + "sha256": "352a6184713b8843d96fd2c2071eb7aeaa655906b7c51d45ad444912666c8a96" + }, + { + "path": "docs/research/research-family-status.md", + "usage": "provenance", + "git_blob": "abdd2792e6a5596b3fa6be3dc9db882bd8e3ef89", + "sha256": "0e61c47dfbc6f16e5f64594fcc7d907d4187568e38dddf10d473f0992419c44f" + }, + { + "path": "research/complex-ck-target-forest/README.md", + "usage": "provenance", + "git_blob": "23bbf1d09ccff2c8684902558e56d3337d66776a", + "sha256": "40d554792408752bd9aaf8852e7a55d60671e619a6511885cebdd6b4fe7d5e66" + }, + { + "path": "research/complex-ck-two-sided/README.md", + "usage": "provenance", + "git_blob": "e08efda4901a4c665a2e6b63d5da86adf3ed77fe", + "sha256": "b94bddf26ba781d93019dbf2f595f139bb842381dd0c53b5ec27bb9468afa428" + }, + { + "path": "research/complex-x4-target-forest/README.md", + "usage": "provenance", + "git_blob": "2794a3190a6a02ccc31b25c09fb2d7f268bae2db", + "sha256": "5ff31dd635e74215ee987c7c6381068dfa58355717263e5b8cf69119b7fc8e37" + }, + { + "path": "research/complex-compensation-basis/README.md", + "usage": "provenance", + "git_blob": "c054d50a137c8cacd2356ee9c9ce554438dcd46f", + "sha256": "5bbd35327a03f336cd983d3760bd3de747db10a40172fc828bb0cfc38c6c3f65" + }, + { + "path": "research/staged-644-660-independent-audit/inputs/STAGED644-660-base.json.gz", + "usage": "provenance", + "git_blob": "dc6d321b1e8e2a837a1ff7bb60e8f8f78d043db5", + "sha256": "735c540b1fe29d0ceeb4d2f304ec941e5f2bd3bc92bafc8cce2b4f9a67a3b653" + }, + { + "path": "research/staged-644-660-independent-audit/inputs/STAGED644-660-extra.json.gz", + "usage": "provenance", + "git_blob": "78e7b2bb0653c8dcc0133980a19dd9d97ebdb67e", + "sha256": "886338fc32da14f3389a82c8120a1bcf9c5e2f0ec3e9b2d377fdae809e1d977f" + }, + { + "path": "research/rank7-coupled-586-588-carrier-fold/CREDITS.md", + "usage": "provenance", + "git_blob": "24f00912d4ec829c3c8d2a8d086aa135664a124c", + "sha256": "1d9d8f56d8899f55878e4cb2c4e052b22506444016a51c2e678773505f5189e6" + }, + { + "path": "research/rank7-coupled-586-588-carrier-fold/NOTICE", + "usage": "provenance", + "git_blob": "89c20926ea7f803718f751d95989d5a269908efd", + "sha256": "c9731c9cca25ede32c2a1b3aef6d5b249973cb2ed5fb2494407bdca598763661" + }, + { + "path": "research/t74-native-fast/NATIVE-LINEAGE-NOTICE", + "usage": "provenance", + "git_blob": "380e979f0e84e00a22bd890615d87cc4684ad740", + "sha256": "ee0c73ca35877aad0e0b6adc560a3881cb82276dba4cf2d4fc58cd19e57cc420" + }, + { + "path": "LICENSE", + "usage": "provenance", + "git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + }, + { + "path": "research/t74-native-fast/vendor/native/new/code/borrow/bw_transport.py", + "usage": "provenance", + "git_blob": "08248542b18864c94a5ac050c8669f68519838e1", + "sha256": "9818e08b819310b40f1441b89be8c4369584a5b3fa5dfe9b86b1df9a7f5d6a76" + }, + { + "path": "research/t74-native-fast/vendor/native/new/code/borrow/bw_emit.py", + "usage": "provenance", + "git_blob": "6d47f63ab7a533941b3881bbfd3ae4dac5f76932", + "sha256": "99b59a6fa3feda86785e4225157dcb1a6169d256cec4f5e0acc9cea7a701df76" + }, + { + "path": "research/u8-two-sided-biforest-seed35/README.md", + "usage": "provenance", + "git_blob": "79f484e008b95b036503985b8d89830d4c20fbf3", + "sha256": "f7226bb8c46f4e2130d38d7342735c65b6217282563558357d2df5b8a9500963", + "pin": "head:803e080e181229a3af2196b7a13615c9d81ae10d:research/u8-two-sided-biforest-seed35/README.md" + }, + { + "path": "research/u8-two-sided-biforest-seed35/PROOF.md", + "usage": "provenance", + "git_blob": "52b68b24512a8bbc6bfd0d7c544f226fafae2b0d", + "sha256": "462ef3a290217c1e080d6b33f70129608efb8542a6076b3dda9a80ce5134aab7", + "pin": "head:803e080e181229a3af2196b7a13615c9d81ae10d:research/u8-two-sided-biforest-seed35/PROOF.md" + }, + { + "path": "research/u8-two-sided-biforest-seed35/RECIPE.json", + "usage": "provenance", + "git_blob": "3da499553bb790d4aea19cf04a5677c8f2c3f780", + "sha256": "d526804d9d627cbd850b0e54c3de9aadc74646e1a9b6befb577f42240720750a", + "pin": "head:803e080e181229a3af2196b7a13615c9d81ae10d:research/u8-two-sided-biforest-seed35/RECIPE.json" + }, + { + "path": "research/u8-two-sided-biforest-seed35/SOURCES.json", + "usage": "provenance", + "git_blob": "455a1dcd1980b28e000e11b3ab092cc6407b6c36", + "sha256": "1aaf2c3c0a71479919c0df184e9b60af7a6490049137de0bc643b1385a04f835", + "pin": "head:803e080e181229a3af2196b7a13615c9d81ae10d:research/u8-two-sided-biforest-seed35/SOURCES.json" + }, + { + "path": "research/community-frontier942-audit/t37-replay.tar.gz", + "usage": "provenance", + "pin": "head:803e080e181229a3af2196b7a13615c9d81ae10d:research/community-frontier942-audit/t37-replay.tar.gz", + "git_blob": "04ab9096221a06a58a0d2d915a43a5d7f091317f", + "sha256": "48285025105210b56a32d3d4d57a21b7591760acc709d38073e4dca339eb06fe" + } + ] +} diff --git a/research/staged-compensation-forests/TASK.json b/research/staged-compensation-forests/TASK.json new file mode 100644 index 0000000000..bc303aead7 --- /dev/null +++ b/research/staged-compensation-forests/TASK.json @@ -0,0 +1,112 @@ +{ + "schema_version": 1, + "task_id": "scalar-to-moment", + "priority_revision": 7, + "base_commit": "12fa8c5c844be21bfefb38a19503fbd867a11244", + "original_card": { + "id": "scalar-to-moment", + "question": "Can a changed frame itinerary remove a paid transition beyond the already covered scalar A2 contractions?", + "starting_points": [ + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "research/staged544-a2-graph-rewrite/README.md", + "research/staged544-separated-a2/README.md", + "research/staged544-a2-composition-audit/README.md", + "research/staged544-a1858-contraction-audit/README.md" + ], + "methods": [ + "Derive the changed legal frame itinerary and exact child histogram.", + "Prove a scoped obstruction showing why that scalar gain cannot change the paid contract." + ], + "acceptance_gate": "An unchanged histogram is not a kappa gain; record any separate runtime or proof benefit explicitly.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read the A2 and separated-A2 constructions and their composition/contraction audits. Scalar contractions can preserve the complete recursive histogram; fewer ADDs alone do not justify further scans.", + "scope": "Source-binding orientation only; no scientific replay, theorem acceptance or supplier admission. Budget any heavy replay separately." + }, + "first_experiment": "Identify an actual paid transition to remove and construct a legal replacement frame itinerary, charging restoration, source windows and changed helpers. Compare complete before/after histograms. Stop if only scalar count changes; report that benefit honestly, without expanding the same scalar-only census.", + "bottleneck_link": "A legal change to the histogram, not addition count alone, is the bridge to an exponent gain.", + "allowed_variations": [ + "One existing scalar simplification and one proposed frame-path change." + ], + "scope_change_triggers": [ + "Submitting only another scalar count as completion of a paid-profile task." + ], + "overlap_terms": [ + "scalar simplification", + "paid profile", + "R439", + "3998", + "4019", + "4112", + "4152", + "staged544-a2-graph-rewrite", + "staged544-separated-a2", + "staged544-a2-composition-audit", + "staged544-a1858-contraction-audit" + ], + "existing_checks": [ + { + "scope": "PR #3998: consecutive A2 scalar contraction", + "evidence": "research/staged544-a2-graph-rewrite/README.md", + "remaining": "A genuinely changed paid itinerary or a distinct independent audit; no default scalar-only expansion.", + "status": "author-checked", + "source_commit": "389268a6b5e0373a3125d5c6fcd6995f4ea324f5", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4019: separated A2 sites with unchanged recursive histogram", + "evidence": "research/staged544-separated-a2/README.md", + "remaining": "A genuinely changed paid itinerary or a distinct independent audit; no default scalar-only expansion.", + "status": "author-checked", + "source_commit": "f408e09df300b575235f7f77f81948071397e16d", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4112: composition audit", + "evidence": "research/staged544-a2-composition-audit/README.md", + "remaining": "A genuinely changed paid itinerary or a distinct independent audit; no default scalar-only expansion.", + "status": "author-checked", + "source_commit": "205b7380656ba4b6316a8a493b1a3c679b8f7a0e", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4152: A1858 contraction audit", + "evidence": "research/staged544-a1858-contraction-audit/README.md", + "remaining": "A genuinely changed paid itinerary or a distinct independent audit; no default scalar-only expansion.", + "status": "author-checked", + "source_commit": "caaa14cde5962adc372fdca71f63d0f29e73c8b2", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + } + ] + }, + "scope_status": "changed", + "actual_scope": "Finish the preserved C01 finite compensation result on its exact staged matrix: source-matched target-forest class minimum, one deterministic disjoint-helper construction, full literal scalar comparison and independent verification. No paid-profile improvement.", + "scope_change_reason": "The user explicitly assigned completion, review and bounded publication of unpublished contributions, including worthwhile refinement. This is one finite source-specific completion of C01, not completion of the scalar-to-moment research target or a repeated scalar-only search campaign.", + "bottleneck_link": "The old unpublished rank-basis circuit needed a fair same-matrix comparison with prior forest and two-sided methods and a complete finite scalar bill.", + "budget_minutes": 240, + "stop_rule": "One complete signed-unit target MST and one sorted disjoint-helper pass on the transformed matrix. Stop after the reviewed useful candidate; no alternating forest search or repeated scalar census, no kappa claim.", + "outcome": "partial", + "evidence": "PROOF.md, whole-word numerical note, complete generated circuit and records, independent exact graph/basis and full-word scalar checks, and actual semantic controls.", + "author": "Ross Richardson", + "ai_assistance": "Substantial OpenAI Codex assistance in construction, separate mathematical checking contexts and publication. AI reviews are not human or formal-kernel acceptance.", + "open_questions": [ + { + "question": "Can this exact local substitution be admitted into a complete native hosted supplier with its physical cleanup and precision costs?", + "why_it_matters": "The finite scalar savings and formal local identities do not certify native phases, physical CLEAR or recursive rounding.", + "first_step": "Regenerate the full source-bound hosted native program, all precision allocations and owner invoice for these exact frozen words.", + "blocked_by": "No complete native/physical/rounded admission is supplied." + }, + { + "question": "Can a changed local contract improve the complete paid profile?", + "why_it_matters": "The current scalar substitution leaves the entire recursive histogram unchanged.", + "first_step": "Identify an actual removable paid transition or changed child call and include all source, wrapper and restoration costs.", + "blocked_by": "No changed recursive child or frame contract is constructed here." + } + ] +} diff --git a/research/staged-compensation-forests/VERIFY.json b/research/staged-compensation-forests/VERIFY.json new file mode 100644 index 0000000000..bc65b005dd --- /dev/null +++ b/research/staged-compensation-forests/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", + "construction" + ], + "timeout_seconds": 90, + "checks": "Complete deterministic source-matched forest/helper circuit, full output inventory and typed records, literal Horner prices, exact fixed PR1080 comparison." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/verify.py", + "--stage", + "forest" + ], + "timeout_seconds": 90, + "checks": "Independent Fraction graph and basis audit: every signed edge and helper score, class minimum, arbitrary inputs and semantic controls." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/verify.py", + "--stage", + "wholeword" + ], + "timeout_seconds": 180, + "checks": "Independent full raw free-warp words, four orientations, complete emitted scalar projection, literal prices and exact prefix/grid witnesses." + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/controls.py", + "--package", + "{package}" + ], + "timeout_seconds": 90, + "checks": "Normal/optimized source-byte execution, exact typed receipt coverage, actual semantic defects and check deletion." + } + ] +} diff --git a/research/staged-compensation-forests/artifacts/DESIGN.json b/research/staged-compensation-forests/artifacts/DESIGN.json new file mode 100644 index 0000000000..c7c4748fc9 --- /dev/null +++ b/research/staged-compensation-forests/artifacts/DESIGN.json @@ -0,0 +1,5045 @@ +{ + "head": "3efbb5de06a49ffeea6684482f2d3fe48cdca3fb", + "providers": { + "base": { + "active_helpers": [ + 224, + 225, + 227, + 229, + 231, + 232, + 233, + 234, + 235, + 236, + 237, + 238, + 239, + 240, + 241, + 242, + 243, + 244, + 245, + 246, + 247, + 248, + 250, + 252, + 253, + 254, + 255, + 256, + 257, + 258, + 259, + 260, + 261, + 262, + 263, + 264, + 266, + 268, + 269, + 270, + 271, + 272, + 274, + 276, + 278, + 279, + 280, + 281, + 283, + 284, + 285, + 286, + 287, + 288, + 290, + 292, + 294, + 295, + 296, + 297, + 300, + 301, + 302, + 303, + 306, + 308, + 310, + 312, + 313, + 315, + 316, + 317, + 318, + 319, + 322, + 324, + 326, + 328, + 329, + 332, + 333, + 334, + 335, + 336, + 338, + 340, + 342, + 343, + 344, + 345, + 347, + 348, + 349, + 350, + 351, + 352, + 354, + 356, + 358, + 359, + 360, + 361, + 364, + 365, + 366, + 367, + 368, + 370, + 372, + 374, + 375, + 376, + 377, + 379, + 380, + 381, + 382, + 383, + 384, + 386, + 388, + 390, + 391, + 392, + 393, + 396, + 397, + 398, + 399, + 400, + 401, + 402, + 403, + 404, + 405, + 406, + 407, + 409, + 410, + 411, + 413, + 414, + 415, + 416, + 417, + 418, + 419, + 420, + 421, + 422, + 423, + 425, + 426, + 427, + 429, + 430, + 431, + 432, + 433, + 434, + 435, + 436, + 437, + 438, + 439, + 440, + 441, + 442, + 443, + 444, + 445, + 446, + 447, + 456, + 459, + 461, + 463, + 464, + 465, + 466, + 467, + 468, + 469, + 470, + 471, + 479, + 481, + 490, + 491, + 492, + 493, + 502, + 503, + 504, + 505, + 514, + 515, + 516, + 517, + 546, + 547, + 548, + 549, + 558, + 560, + 568, + 570 + ], + "all_column_checks": [ + [ + "forest", + "forward", + 632 + ], + [ + "forest", + "inverse", + 632 + ], + [ + "forest", + "dual", + 632 + ], + [ + "two-sided", + "forward", + 632 + ], + [ + "two-sided", + "inverse", + 632 + ], + [ + "two-sided", + "dual", + 632 + ] + ], + "all_cycle_inequalities": 12544, + "edge_census_sha256": "6f40d71cf2d1cdacc32ac943016e60a34ffa38399b117fc57ebb103b2fb7f8f1", + "edge_count": 12544, + "eligible_helpers": [ + 224, + 225, + 227, + 229, + 231, + 232, + 233, + 234, + 235, + 236, + 237, + 238, + 239, + 240, + 241, + 242, + 243, + 244, + 245, + 246, + 247, + 248, + 250, + 252, + 253, + 254, + 255, + 256, + 257, + 258, + 259, + 260, + 261, + 262, + 263, + 264, + 266, + 268, + 269, + 270, + 271, + 272, + 274, + 276, + 278, + 279, + 280, + 281, + 283, + 284, + 285, + 286, + 287, + 288, + 290, + 292, + 294, + 295, + 296, + 297, + 300, + 301, + 302, + 303, + 306, + 308, + 310, + 312, + 313, + 315, + 316, + 317, + 318, + 319, + 322, + 324, + 326, + 328, + 329, + 332, + 333, + 334, + 335, + 336, + 338, + 340, + 342, + 343, + 344, + 345, + 347, + 348, + 349, + 350, + 351, + 352, + 354, + 356, + 358, + 359, + 360, + 361, + 364, + 365, + 366, + 367, + 368, + 370, + 372, + 374, + 375, + 376, + 377, + 379, + 380, + 381, + 382, + 383, + 384, + 386, + 388, + 390, + 391, + 392, + 393, + 396, + 397, + 398, + 399, + 400, + 401, + 402, + 403, + 404, + 405, + 406, + 407, + 409, + 410, + 411, + 413, + 414, + 415, + 416, + 417, + 418, + 419, + 420, + 421, + 422, + 423, + 425, + 426, + 427, + 429, + 430, + 431, + 432, + 433, + 434, + 435, + 436, + 437, + 438, + 439, + 440, + 441, + 442, + 443, + 444, + 445, + 446, + 447, + 456, + 459, + 461, + 463, + 464, + 465, + 466, + 467, + 468, + 469, + 470, + 471, + 479, + 481, + 490, + 491, + 492, + 493, + 502, + 503, + 504, + 505, + 514, + 515, + 516, + 517, + 546, + 547, + 548, + 549, + 558, + 560, + 568, + 570 + ], + "forest_panel_sha256": "665d299ef25d80ea42e54d10c2e94e15527c2657898b88f3970cc14eb4fac654", + "forest_word_sha256": "882a0a24f6ad0741513251034692f437b588a1c5a26631a0a575b0686dd44de4", + "helper_candidate_count": 85284, + "helper_candidates_sha256": "abcd9fd7d6e8eccfdf9f856435d387e46162c5f2250b08eec8e9cf8bd6bb6f6a", + "max_depth": 15, + "original_bill": { + "coefficient_histogram": { + "-1": 153, + "-1/2": 1379, + "-1/4": 1221, + "-1/8": 34, + "-2": 3, + "-3/2": 3, + "-3/4": 5, + "-3/8": 9, + "-5/8": 3, + "1": 193, + "1/2": 1307, + "1/4": 1319, + "1/8": 30, + "2": 39, + "3/2": 3, + "3/4": 15, + "3/8": 11, + "5/8": 9 + }, + "component_primitives": 31214, + "logical_additions": 5736 + }, + "pairs": [ + [ + 123, + 288, + 296, + -1 + ], + [ + 100, + 272, + 280, + -1 + ], + [ + 90, + 306, + 312, + -1 + ], + [ + 90, + 308, + 318, + 1 + ], + [ + 86, + 356, + 366, + 1 + ], + [ + 86, + 372, + 382, + 1 + ], + [ + 81, + 340, + 350, + 1 + ], + [ + 75, + 262, + 266, + -1 + ], + [ + 75, + 269, + 257, + 1 + ], + [ + 68, + 422, + 426, + -1 + ], + [ + 66, + 233, + 227, + 1 + ], + [ + 64, + 253, + 241, + 1 + ], + [ + 64, + 405, + 414, + 1 + ], + [ + 62, + 438, + 442, + -1 + ], + [ + 62, + 441, + 434, + -1 + ], + [ + 60, + 406, + 410, + -1 + ], + [ + 59, + 332, + 326, + 1 + ], + [ + 59, + 421, + 430, + 1 + ], + [ + 57, + 437, + 446, + 1 + ], + [ + 56, + 388, + 398, + 1 + ], + [ + 55, + 246, + 250, + -1 + ], + [ + 52, + 276, + 234, + 1 + ], + [ + 51, + 274, + 279, + 1 + ], + [ + 51, + 370, + 375, + 1 + ], + [ + 50, + 261, + 270, + 1 + ], + [ + 50, + 284, + 283, + -1 + ], + [ + 49, + 352, + 367, + 1 + ], + [ + 48, + 384, + 399, + -1 + ], + [ + 47, + 229, + 238, + 1 + ], + [ + 47, + 354, + 359, + 1 + ], + [ + 47, + 368, + 383, + 1 + ], + [ + 47, + 409, + 402, + -1 + ], + [ + 47, + 425, + 418, + -1 + ], + [ + 47, + 445, + 433, + 1 + ], + [ + 45, + 245, + 254, + 1 + ], + [ + 43, + 336, + 351, + -1 + ], + [ + 40, + 290, + 295, + 1 + ], + [ + 37, + 338, + 343, + 1 + ], + [ + 37, + 411, + 427, + 1 + ], + [ + 37, + 413, + 401, + 1 + ], + [ + 36, + 380, + 379, + -1 + ], + [ + 32, + 429, + 417, + 1 + ], + [ + 31, + 324, + 334, + 1 + ], + [ + 31, + 348, + 347, + -1 + ], + [ + 31, + 396, + 225, + 1 + ], + [ + 30, + 264, + 259, + -1 + ], + [ + 29, + 391, + 386, + 1 + ], + [ + 25, + 260, + 271, + 1 + ], + [ + 25, + 419, + 287, + -1 + ], + [ + 24, + 358, + 364, + 1 + ], + [ + 21, + 268, + 263, + 1 + ], + [ + 20, + 248, + 243, + -1 + ], + [ + 20, + 335, + 328, + 1 + ], + [ + 17, + 258, + 256, + 1 + ], + [ + 17, + 294, + 300, + 1 + ], + [ + 16, + 285, + 403, + 1 + ], + [ + 16, + 415, + 431, + 1 + ], + [ + 15, + 237, + 224, + -1 + ], + [ + 15, + 244, + 255, + 1 + ], + [ + 15, + 361, + 377, + 1 + ], + [ + 12, + 231, + 235, + -1 + ], + [ + 12, + 242, + 240, + 1 + ], + [ + 12, + 292, + 239, + -1 + ], + [ + 12, + 436, + 447, + 1 + ], + [ + 12, + 439, + 443, + -1 + ], + [ + 12, + 440, + 435, + -1 + ], + [ + 12, + 444, + 432, + 1 + ], + [ + 11, + 345, + 393, + 1 + ], + [ + 10, + 301, + 303, + 1 + ], + [ + 10, + 310, + 313, + -1 + ], + [ + 10, + 322, + 329, + -1 + ], + [ + 10, + 416, + 286, + 1 + ], + [ + 9, + 479, + 349, + 1 + ], + [ + 9, + 505, + 517, + 1 + ], + [ + 6, + 247, + 252, + 1 + ], + [ + 6, + 344, + 376, + 1 + ], + [ + 5, + 461, + 317, + 1 + ], + [ + 5, + 463, + 333, + 1 + ], + [ + 5, + 491, + 365, + 1 + ], + [ + 5, + 503, + 381, + 1 + ], + [ + 5, + 504, + 316, + 1 + ], + [ + 4, + 456, + 467, + 1 + ], + [ + 4, + 459, + 465, + 1 + ], + [ + 3, + 548, + 549, + -1 + ], + [ + 3, + 560, + 547, + 1 + ], + [ + 1, + 471, + 360, + -1 + ], + [ + 1, + 493, + 302, + 1 + ], + [ + 1, + 515, + 397, + 1 + ] + ], + "parent": { + "-1": null, + "112": [ + 169, + -1, + 225 + ], + "113": [ + 118, + -1, + 191 + ], + "114": [ + -1, + 0, + 216 + ], + "115": [ + 179, + -1, + 177 + ], + "116": [ + -1, + 0, + 229 + ], + "117": [ + 116, + -1, + 176 + ], + "118": [ + 135, + 1, + 309 + ], + "119": [ + -1, + 0, + 273 + ], + "120": [ + 179, + 1, + 127 + ], + "121": [ + 173, + 1, + 156 + ], + "122": [ + 174, + 1, + 236 + ], + "123": [ + 148, + -1, + 288 + ], + "124": [ + 143, + -1, + 133 + ], + "125": [ + 128, + 1, + 244 + ], + "126": [ + -1, + 0, + 0 + ], + "127": [ + 154, + -1, + 269 + ], + "128": [ + 155, + 1, + 281 + ], + "129": [ + 124, + 1, + 180 + ], + "130": [ + 151, + 1, + 150 + ], + "131": [ + 151, + -1, + 181 + ], + "132": [ + 148, + -1, + 232 + ], + "133": [ + 123, + -1, + 8 + ], + "134": [ + 135, + 1, + 157 + ], + "135": [ + -1, + 0, + 250 + ], + "136": [ + -1, + 0, + 265 + ], + "137": [ + 121, + -1, + 109 + ], + "138": [ + -1, + 0, + 221 + ], + "139": [ + 119, + -1, + 220 + ], + "140": [ + 118, + -1, + 181 + ], + "141": [ + 157, + -1, + 296 + ], + "142": [ + 141, + -1, + 179 + ], + "143": [ + -1, + 0, + 234 + ], + "144": [ + 136, + 1, + 8 + ], + "145": [ + 135, + 1, + 8 + ], + "146": [ + 134, + 1, + 140 + ], + "147": [ + 136, + 1, + 188 + ], + "148": [ + 223, + -1, + 202 + ], + "149": [ + 123, + 1, + 140 + ], + "150": [ + 143, + 1, + 181 + ], + "151": [ + -1, + 0, + 225 + ], + "152": [ + 130, + 1, + 8 + ], + "153": [ + -1, + 0, + 0 + ], + "154": [ + 119, + 1, + 319 + ], + "155": [ + 149, + -1, + 196 + ], + "156": [ + 163, + -1, + 242 + ], + "157": [ + 136, + -1, + 170 + ], + "158": [ + 191, + 1, + 254 + ], + "159": [ + 137, + -1, + 8 + ], + "160": [ + 157, + 1, + 140 + ], + "161": [ + 146, + 1, + 8 + ], + "162": [ + 135, + 1, + 193 + ], + "163": [ + 125, + -1, + 264 + ], + "164": [ + -1, + 0, + 0 + ], + "165": [ + 127, + -1, + 289 + ], + "166": [ + 151, + 1, + 133 + ], + "167": [ + 151, + 1, + 8 + ], + "168": [ + 150, + 1, + 8 + ], + "169": [ + 139, + -1, + 243 + ], + "170": [ + 118, + 1, + 214 + ], + "171": [ + 142, + 1, + 8 + ], + "172": [ + 141, + 1, + 230 + ], + "173": [ + 114, + -1, + 94 + ], + "174": [ + -1, + 0, + 264 + ], + "175": [ + -1, + 0, + 0 + ], + "176": [ + 117, + 1, + 182 + ], + "177": [ + 116, + 1, + 8 + ], + "178": [ + 115, + 1, + 8 + ], + "179": [ + 138, + -1, + 146 + ], + "180": [ + 117, + 1, + 8 + ], + "181": [ + 116, + -1, + 179 + ], + "182": [ + 174, + -1, + 216 + ], + "183": [ + -1, + 0, + 0 + ], + "184": [ + 112, + 1, + 224 + ], + "185": [ + 141, + -1, + 174 + ], + "186": [ + 141, + 1, + 8 + ], + "187": [ + 140, + 1, + 8 + ], + "188": [ + 114, + -1, + 8 + ], + "189": [ + 143, + 1, + 8 + ], + "190": [ + 155, + 1, + 134 + ], + "191": [ + 201, + -1, + 236 + ], + "192": [ + 179, + 1, + 8 + ], + "193": [ + 190, + -1, + 8 + ], + "194": [ + 118, + 1, + 8 + ], + "195": [ + 185, + 1, + 8 + ], + "196": [ + 172, + 1, + 8 + ], + "197": [ + 147, + 1, + 8 + ], + "198": [ + 113, + 1, + 8 + ], + "199": [ + 155, + -1, + 8 + ], + "200": [ + 138, + 1, + 8 + ], + "201": [ + 206, + -1, + 263 + ], + "202": [ + 149, + -1, + 8 + ], + "203": [ + 122, + -1, + 218 + ], + "204": [ + 173, + -1, + 8 + ], + "205": [ + 170, + 1, + 8 + ], + "206": [ + 169, + 1, + 224 + ], + "207": [ + 120, + 1, + 8 + ], + "208": [ + 176, + 1, + 8 + ], + "209": [ + 181, + 1, + 8 + ], + "210": [ + 160, + 1, + 8 + ], + "211": [ + -1, + 0, + 0 + ], + "212": [ + 124, + 1, + 8 + ], + "213": [ + 166, + 1, + 8 + ], + "214": [ + 131, + 1, + 8 + ], + "215": [ + 129, + 1, + 8 + ], + "216": [ + -1, + 0, + 0 + ], + "217": [ + 165, + -1, + 261 + ], + "218": [ + -1, + 0, + 0 + ], + "219": [ + 157, + 1, + 8 + ], + "220": [ + 134, + 1, + 8 + ], + "221": [ + 162, + 1, + 8 + ], + "222": [ + 121, + -1, + 8 + ], + "223": [ + 158, + -1, + 233 + ] + }, + "prim_cost": 13716, + "profitable_helpers": 951, + "roots": 17, + "semantic_controls": [ + { + "mutation": "omit_target_preparation", + "witnesses": { + "dual": { + "actual": "-1", + "column": 184, + "expected": "0", + "row": 112 + }, + "forward": { + "actual": "-1", + "column": 119, + "expected": "0", + "row": 112 + }, + "inverse": { + "actual": "1", + "column": 169, + "expected": "0", + "row": 112 + } + } + }, + { + "mutation": "omit_target_restoration", + "witnesses": { + "dual": { + "actual": "1", + "column": 184, + "expected": "0", + "row": 112 + }, + "forward": { + "actual": "1", + "column": 169, + "expected": "0", + "row": 112 + }, + "inverse": { + "actual": "-1", + "column": 119, + "expected": "0", + "row": 112 + } + } + }, + { + "mutation": "parent_before_child_preparation", + "witnesses": { + "dual": { + "actual": "1", + "column": 121, + "expected": "0", + "row": 114 + }, + "forward": { + "actual": "1", + "column": 139, + "expected": "0", + "row": 112 + }, + "inverse": { + "actual": "-1", + "column": 139, + "expected": "0", + "row": 112 + } + } + }, + { + "mutation": "omit_helper_preparation", + "witnesses": { + "dual": { + "actual": "-1", + "column": 237, + "expected": "0", + "row": 224 + }, + "forward": { + "actual": "0", + "column": 234, + "expected": "1/2", + "row": 112 + }, + "inverse": { + "actual": "1", + "column": 238, + "expected": "0", + "row": 229 + } + } + }, + { + "mutation": "omit_helper_restoration", + "witnesses": { + "dual": { + "actual": "0", + "column": 119, + "expected": "1/2", + "row": 224 + }, + "forward": { + "actual": "1", + "column": 238, + "expected": "0", + "row": 229 + }, + "inverse": { + "actual": "0", + "column": 234, + "expected": "-1/2", + "row": 112 + } + } + }, + { + "mutation": "flip_helper_preparation_sign", + "witnesses": { + "dual": { + "actual": "-2", + "column": 288, + "expected": "0", + "row": 296 + }, + "forward": { + "actual": "-1/2", + "column": 296, + "expected": "1/2", + "row": 112 + }, + "inverse": { + "actual": "-2", + "column": 296, + "expected": "0", + "row": 288 + } + } + }, + { + "mutation": "flip_residual_sign", + "witnesses": { + "dual": { + "actual": "-1/2", + "column": 112, + "expected": "1/2", + "row": 224 + }, + "forward": { + "actual": "1/2", + "column": 224, + "expected": "-1/2", + "row": 112 + }, + "inverse": { + "actual": "-1/2", + "column": 224, + "expected": "1/2", + "row": 112 + } + } + }, + { + "mutation": "flip_target_restoration_sign", + "witnesses": { + "dual": { + "actual": "-2", + "column": 156, + "expected": "0", + "row": 163 + }, + "forward": { + "actual": "2", + "column": 163, + "expected": "0", + "row": 156 + }, + "inverse": { + "actual": "-2", + "column": 163, + "expected": "0", + "row": 156 + } + } + }, + { + "mutation": "stale_original_injection", + "witnesses": { + "dual": { + "actual": "1", + "column": 112, + "expected": "1/2", + "row": 224 + }, + "forward": { + "actual": "-1", + "column": 224, + "expected": "-1/2", + "row": 112 + }, + "inverse": { + "actual": "1", + "column": 224, + "expected": "1/2", + "row": 112 + } + } + }, + { + "full_arbitrary_target_domain_rejects": true, + "helper_only_projection_passes": true, + "mutation": "omit_target_preparation", + "projected_input_columns": 520 + } + ], + "source_compressed_sha256": "735c540b1fe29d0ceeb4d2f304ec941e5f2bd3bc92bafc8cce2b4f9a67a3b653", + "source_frame_predicate": "helper absent from start_extra and helper_final; not removed", + "target_edges": 95, + "target_only_bill": { + "coefficient_histogram": { + "-1": 447, + "-1/2": 789, + "-1/4": 176, + "-1/8": 2, + "-2": 16, + "-3/2": 3, + "1": 443, + "1/2": 709, + "1/4": 196, + "1/8": 4, + "2": 29, + "3": 2, + "3/2": 9, + "3/4": 2, + "3/8": 2, + "4": 3, + "5/4": 1, + "5/8": 1 + }, + "component_primitives": 13716, + "logical_additions": 2834 + }, + "target_residual_nonzeros": 2644, + "tree": [ + [ + 0, + -1, + 126, + 0 + ], + [ + 0, + -1, + 153, + 0 + ], + [ + 0, + -1, + 164, + 0 + ], + [ + 0, + -1, + 175, + 0 + ], + [ + 0, + -1, + 183, + 0 + ], + [ + 0, + -1, + 211, + 0 + ], + [ + 0, + -1, + 216, + 0 + ], + [ + 0, + -1, + 218, + 0 + ], + [ + 8, + 113, + 198, + 1 + ], + [ + 8, + 114, + 188, + -1 + ], + [ + 8, + 115, + 178, + 1 + ], + [ + 8, + 116, + 177, + 1 + ], + [ + 8, + 117, + 180, + 1 + ], + [ + 8, + 118, + 194, + 1 + ], + [ + 8, + 120, + 207, + 1 + ], + [ + 8, + 121, + 222, + -1 + ], + [ + 8, + 123, + 133, + -1 + ], + [ + 8, + 124, + 212, + 1 + ], + [ + 8, + 129, + 215, + 1 + ], + [ + 8, + 130, + 152, + 1 + ], + [ + 8, + 131, + 214, + 1 + ], + [ + 8, + 134, + 220, + 1 + ], + [ + 8, + 135, + 145, + 1 + ], + [ + 8, + 136, + 144, + 1 + ], + [ + 8, + 137, + 159, + -1 + ], + [ + 8, + 138, + 200, + 1 + ], + [ + 8, + 140, + 187, + 1 + ], + [ + 8, + 141, + 186, + 1 + ], + [ + 8, + 142, + 171, + 1 + ], + [ + 8, + 143, + 189, + 1 + ], + [ + 8, + 146, + 161, + 1 + ], + [ + 8, + 147, + 197, + 1 + ], + [ + 8, + 149, + 202, + -1 + ], + [ + 8, + 150, + 168, + 1 + ], + [ + 8, + 151, + 167, + 1 + ], + [ + 8, + 155, + 199, + -1 + ], + [ + 8, + 157, + 219, + 1 + ], + [ + 8, + 160, + 210, + 1 + ], + [ + 8, + 162, + 221, + 1 + ], + [ + 8, + 166, + 213, + 1 + ], + [ + 8, + 170, + 205, + 1 + ], + [ + 8, + 172, + 196, + 1 + ], + [ + 8, + 173, + 204, + -1 + ], + [ + 8, + 176, + 208, + 1 + ], + [ + 8, + 179, + 192, + 1 + ], + [ + 8, + 181, + 209, + 1 + ], + [ + 8, + 185, + 195, + 1 + ], + [ + 8, + 190, + 193, + -1 + ], + [ + 94, + 114, + 173, + -1 + ], + [ + 109, + 121, + 137, + -1 + ], + [ + 127, + 120, + 179, + 1 + ], + [ + 133, + 124, + 143, + -1 + ], + [ + 133, + 151, + 166, + 1 + ], + [ + 134, + 155, + 190, + 1 + ], + [ + 140, + 123, + 149, + 1 + ], + [ + 140, + 134, + 146, + 1 + ], + [ + 140, + 157, + 160, + 1 + ], + [ + 146, + 138, + 179, + -1 + ], + [ + 150, + 130, + 151, + 1 + ], + [ + 156, + 121, + 173, + 1 + ], + [ + 157, + 134, + 135, + 1 + ], + [ + 170, + 136, + 157, + -1 + ], + [ + 174, + 141, + 185, + -1 + ], + [ + 176, + 116, + 117, + -1 + ], + [ + 177, + 115, + 179, + -1 + ], + [ + 179, + 116, + 181, + -1 + ], + [ + 179, + 141, + 142, + -1 + ], + [ + 180, + 124, + 129, + 1 + ], + [ + 181, + 118, + 140, + -1 + ], + [ + 181, + 131, + 151, + -1 + ], + [ + 181, + 143, + 150, + 1 + ], + [ + 182, + 117, + 176, + 1 + ], + [ + 188, + 136, + 147, + 1 + ], + [ + 191, + 113, + 118, + -1 + ], + [ + 193, + 135, + 162, + 1 + ], + [ + 196, + 149, + 155, + -1 + ], + [ + 202, + 148, + 223, + -1 + ], + [ + 214, + 118, + 170, + 1 + ], + [ + 216, + -1, + 114, + 0 + ], + [ + 216, + 174, + 182, + -1 + ], + [ + 218, + 122, + 203, + -1 + ], + [ + 220, + 119, + 139, + -1 + ], + [ + 221, + -1, + 138, + 0 + ], + [ + 224, + 112, + 184, + 1 + ], + [ + 224, + 169, + 206, + 1 + ], + [ + 225, + -1, + 151, + 0 + ], + [ + 225, + 112, + 169, + -1 + ], + [ + 229, + -1, + 116, + 0 + ], + [ + 230, + 141, + 172, + 1 + ], + [ + 232, + 132, + 148, + -1 + ], + [ + 233, + 158, + 223, + -1 + ], + [ + 234, + -1, + 143, + 0 + ], + [ + 236, + 122, + 174, + 1 + ], + [ + 236, + 191, + 201, + -1 + ], + [ + 242, + 156, + 163, + -1 + ], + [ + 243, + 139, + 169, + -1 + ], + [ + 244, + 125, + 128, + 1 + ], + [ + 250, + -1, + 135, + 0 + ], + [ + 254, + 158, + 191, + 1 + ], + [ + 261, + 165, + 217, + -1 + ], + [ + 263, + 201, + 206, + -1 + ], + [ + 264, + -1, + 174, + 0 + ], + [ + 264, + 125, + 163, + -1 + ], + [ + 265, + -1, + 136, + 0 + ], + [ + 269, + 127, + 154, + -1 + ], + [ + 273, + -1, + 119, + 0 + ], + [ + 281, + 128, + 155, + 1 + ], + [ + 288, + 123, + 148, + -1 + ], + [ + 289, + 127, + 165, + -1 + ], + [ + 296, + 141, + 157, + -1 + ], + [ + 309, + 118, + 135, + 1 + ], + [ + 319, + 119, + 154, + 1 + ] + ], + "two-sided_panel_sha256": "27defe7675576baaebfd45efe40439f491a683bd923b7259c98495db8d3783ac", + "two-sided_word_sha256": "225cfbdf657b7aca21536948a5a810462393fe80d55e8662ae585dfafcdfdf3c", + "two_sided_bill": { + "coefficient_histogram": { + "-1": 508, + "-1/2": 552, + "-1/4": 91, + "-1/8": 2, + "-2": 13, + "1": 524, + "1/2": 455, + "1/4": 109, + "1/8": 4, + "2": 23, + "3": 2, + "3/2": 2, + "3/4": 2, + "4": 1 + }, + "component_primitives": 10633, + "logical_additions": 2288 + }, + "two_sided_residual_nonzeros": 1922 + }, + "extra": { + "active_helpers": [ + 224, + 225, + 227, + 229, + 231, + 232, + 233, + 234, + 235, + 236, + 237, + 238, + 239, + 240, + 241, + 242, + 243, + 244, + 245, + 246, + 247, + 248, + 250, + 252, + 253, + 254, + 255, + 256, + 257, + 258, + 259, + 260, + 261, + 262, + 263, + 264, + 266, + 268, + 269, + 270, + 271, + 272, + 274, + 276, + 278, + 279, + 280, + 281, + 283, + 284, + 285, + 286, + 287, + 288, + 290, + 292, + 294, + 295, + 296, + 297, + 300, + 301, + 302, + 303, + 306, + 308, + 310, + 312, + 313, + 315, + 316, + 317, + 318, + 319, + 322, + 324, + 326, + 328, + 329, + 332, + 333, + 334, + 335, + 336, + 338, + 340, + 342, + 343, + 344, + 345, + 347, + 348, + 349, + 350, + 351, + 352, + 354, + 356, + 358, + 359, + 360, + 361, + 364, + 365, + 366, + 367, + 368, + 370, + 372, + 374, + 375, + 376, + 377, + 379, + 380, + 381, + 382, + 383, + 384, + 386, + 388, + 390, + 391, + 392, + 393, + 396, + 397, + 398, + 399, + 400, + 401, + 402, + 403, + 404, + 405, + 406, + 407, + 409, + 410, + 411, + 413, + 414, + 415, + 416, + 417, + 418, + 419, + 420, + 421, + 422, + 423, + 425, + 426, + 427, + 429, + 430, + 431, + 432, + 433, + 434, + 435, + 436, + 437, + 438, + 439, + 440, + 441, + 442, + 443, + 444, + 445, + 446, + 447, + 456, + 459, + 461, + 463, + 464, + 465, + 466, + 467, + 468, + 469, + 470, + 471, + 479, + 481, + 490, + 491, + 492, + 493, + 502, + 503, + 504, + 505, + 514, + 515, + 516, + 517, + 546, + 547, + 548, + 549, + 558, + 560, + 568, + 570 + ], + "all_column_checks": [ + [ + "forest", + "forward", + 632 + ], + [ + "forest", + "inverse", + 632 + ], + [ + "forest", + "dual", + 632 + ], + [ + "two-sided", + "forward", + 632 + ], + [ + "two-sided", + "inverse", + 632 + ], + [ + "two-sided", + "dual", + 632 + ] + ], + "all_cycle_inequalities": 12544, + "edge_census_sha256": "6f40d71cf2d1cdacc32ac943016e60a34ffa38399b117fc57ebb103b2fb7f8f1", + "edge_count": 12544, + "eligible_helpers": [ + 224, + 225, + 227, + 229, + 231, + 232, + 233, + 234, + 235, + 236, + 237, + 238, + 239, + 240, + 241, + 242, + 243, + 244, + 245, + 246, + 247, + 248, + 250, + 252, + 253, + 254, + 255, + 256, + 257, + 258, + 259, + 260, + 261, + 262, + 263, + 264, + 266, + 268, + 269, + 270, + 271, + 272, + 274, + 276, + 278, + 279, + 280, + 281, + 283, + 284, + 285, + 286, + 287, + 288, + 290, + 292, + 294, + 295, + 296, + 297, + 300, + 301, + 302, + 303, + 306, + 308, + 310, + 312, + 313, + 315, + 316, + 317, + 318, + 319, + 322, + 324, + 326, + 328, + 329, + 332, + 333, + 334, + 335, + 336, + 338, + 340, + 342, + 343, + 344, + 345, + 347, + 348, + 349, + 350, + 351, + 352, + 354, + 356, + 358, + 359, + 360, + 361, + 364, + 365, + 366, + 367, + 368, + 370, + 372, + 374, + 375, + 376, + 377, + 379, + 380, + 381, + 382, + 383, + 384, + 386, + 388, + 390, + 391, + 392, + 393, + 396, + 397, + 398, + 399, + 400, + 401, + 402, + 403, + 404, + 405, + 406, + 407, + 409, + 410, + 411, + 413, + 414, + 415, + 416, + 417, + 418, + 419, + 420, + 421, + 422, + 423, + 425, + 426, + 427, + 429, + 430, + 431, + 432, + 433, + 434, + 435, + 436, + 437, + 438, + 439, + 440, + 441, + 442, + 443, + 444, + 445, + 446, + 447, + 456, + 459, + 461, + 463, + 464, + 465, + 466, + 467, + 468, + 469, + 470, + 471, + 479, + 481, + 490, + 491, + 492, + 493, + 502, + 503, + 504, + 505, + 514, + 515, + 516, + 517, + 546, + 547, + 548, + 549, + 558, + 560, + 568, + 570 + ], + "forest_panel_sha256": "665d299ef25d80ea42e54d10c2e94e15527c2657898b88f3970cc14eb4fac654", + "forest_word_sha256": "392a974d80dab042164dbbda7595b34fe23cecdeb67ec3dd60bf10fdfa1a0c32", + "helper_candidate_count": 85284, + "helper_candidates_sha256": "abcd9fd7d6e8eccfdf9f856435d387e46162c5f2250b08eec8e9cf8bd6bb6f6a", + "max_depth": 15, + "original_bill": { + "coefficient_histogram": { + "-1": 153, + "-1/2": 1379, + "-1/4": 1221, + "-1/8": 34, + "-2": 3, + "-3/2": 3, + "-3/4": 5, + "-3/8": 9, + "-5/8": 3, + "1": 193, + "1/2": 1307, + "1/4": 1319, + "1/8": 30, + "2": 39, + "3/2": 3, + "3/4": 15, + "3/8": 11, + "5/8": 9 + }, + "component_primitives": 31214, + "logical_additions": 5736 + }, + "pairs": [ + [ + 123, + 288, + 296, + -1 + ], + [ + 100, + 272, + 280, + -1 + ], + [ + 90, + 306, + 312, + -1 + ], + [ + 90, + 308, + 318, + 1 + ], + [ + 86, + 356, + 366, + 1 + ], + [ + 86, + 372, + 382, + 1 + ], + [ + 81, + 340, + 350, + 1 + ], + [ + 75, + 262, + 266, + -1 + ], + [ + 75, + 269, + 257, + 1 + ], + [ + 68, + 422, + 426, + -1 + ], + [ + 66, + 233, + 227, + 1 + ], + [ + 64, + 253, + 241, + 1 + ], + [ + 64, + 405, + 414, + 1 + ], + [ + 62, + 438, + 442, + -1 + ], + [ + 62, + 441, + 434, + -1 + ], + [ + 60, + 406, + 410, + -1 + ], + [ + 59, + 332, + 326, + 1 + ], + [ + 59, + 421, + 430, + 1 + ], + [ + 57, + 437, + 446, + 1 + ], + [ + 56, + 388, + 398, + 1 + ], + [ + 55, + 246, + 250, + -1 + ], + [ + 52, + 276, + 234, + 1 + ], + [ + 51, + 274, + 279, + 1 + ], + [ + 51, + 370, + 375, + 1 + ], + [ + 50, + 261, + 270, + 1 + ], + [ + 50, + 284, + 283, + -1 + ], + [ + 49, + 352, + 367, + 1 + ], + [ + 48, + 384, + 399, + -1 + ], + [ + 47, + 229, + 238, + 1 + ], + [ + 47, + 354, + 359, + 1 + ], + [ + 47, + 368, + 383, + 1 + ], + [ + 47, + 409, + 402, + -1 + ], + [ + 47, + 425, + 418, + -1 + ], + [ + 47, + 445, + 433, + 1 + ], + [ + 45, + 245, + 254, + 1 + ], + [ + 43, + 336, + 351, + -1 + ], + [ + 40, + 290, + 295, + 1 + ], + [ + 37, + 338, + 343, + 1 + ], + [ + 37, + 411, + 427, + 1 + ], + [ + 37, + 413, + 401, + 1 + ], + [ + 36, + 380, + 379, + -1 + ], + [ + 32, + 429, + 417, + 1 + ], + [ + 31, + 324, + 334, + 1 + ], + [ + 31, + 348, + 347, + -1 + ], + [ + 31, + 396, + 225, + 1 + ], + [ + 30, + 264, + 259, + -1 + ], + [ + 29, + 391, + 386, + 1 + ], + [ + 25, + 260, + 271, + 1 + ], + [ + 25, + 419, + 287, + -1 + ], + [ + 24, + 358, + 364, + 1 + ], + [ + 21, + 268, + 263, + 1 + ], + [ + 20, + 248, + 243, + -1 + ], + [ + 20, + 335, + 328, + 1 + ], + [ + 17, + 258, + 256, + 1 + ], + [ + 17, + 294, + 300, + 1 + ], + [ + 16, + 285, + 403, + 1 + ], + [ + 16, + 415, + 431, + 1 + ], + [ + 15, + 237, + 224, + -1 + ], + [ + 15, + 244, + 255, + 1 + ], + [ + 15, + 361, + 377, + 1 + ], + [ + 12, + 231, + 235, + -1 + ], + [ + 12, + 242, + 240, + 1 + ], + [ + 12, + 292, + 239, + -1 + ], + [ + 12, + 436, + 447, + 1 + ], + [ + 12, + 439, + 443, + -1 + ], + [ + 12, + 440, + 435, + -1 + ], + [ + 12, + 444, + 432, + 1 + ], + [ + 11, + 345, + 393, + 1 + ], + [ + 10, + 301, + 303, + 1 + ], + [ + 10, + 310, + 313, + -1 + ], + [ + 10, + 322, + 329, + -1 + ], + [ + 10, + 416, + 286, + 1 + ], + [ + 9, + 479, + 349, + 1 + ], + [ + 9, + 505, + 517, + 1 + ], + [ + 6, + 247, + 252, + 1 + ], + [ + 6, + 344, + 376, + 1 + ], + [ + 5, + 461, + 317, + 1 + ], + [ + 5, + 463, + 333, + 1 + ], + [ + 5, + 491, + 365, + 1 + ], + [ + 5, + 503, + 381, + 1 + ], + [ + 5, + 504, + 316, + 1 + ], + [ + 4, + 456, + 467, + 1 + ], + [ + 4, + 459, + 465, + 1 + ], + [ + 3, + 548, + 549, + -1 + ], + [ + 3, + 560, + 547, + 1 + ], + [ + 1, + 471, + 360, + -1 + ], + [ + 1, + 493, + 302, + 1 + ], + [ + 1, + 515, + 397, + 1 + ] + ], + "parent": { + "-1": null, + "112": [ + 169, + -1, + 225 + ], + "113": [ + 118, + -1, + 191 + ], + "114": [ + -1, + 0, + 216 + ], + "115": [ + 179, + -1, + 177 + ], + "116": [ + -1, + 0, + 229 + ], + "117": [ + 116, + -1, + 176 + ], + "118": [ + 135, + 1, + 309 + ], + "119": [ + -1, + 0, + 273 + ], + "120": [ + 179, + 1, + 127 + ], + "121": [ + 173, + 1, + 156 + ], + "122": [ + 174, + 1, + 236 + ], + "123": [ + 148, + -1, + 288 + ], + "124": [ + 143, + -1, + 133 + ], + "125": [ + 128, + 1, + 244 + ], + "126": [ + -1, + 0, + 0 + ], + "127": [ + 154, + -1, + 269 + ], + "128": [ + 155, + 1, + 281 + ], + "129": [ + 124, + 1, + 180 + ], + "130": [ + 151, + 1, + 150 + ], + "131": [ + 151, + -1, + 181 + ], + "132": [ + 148, + -1, + 232 + ], + "133": [ + 123, + -1, + 8 + ], + "134": [ + 135, + 1, + 157 + ], + "135": [ + -1, + 0, + 250 + ], + "136": [ + -1, + 0, + 265 + ], + "137": [ + 121, + -1, + 109 + ], + "138": [ + -1, + 0, + 221 + ], + "139": [ + 119, + -1, + 220 + ], + "140": [ + 118, + -1, + 181 + ], + "141": [ + 157, + -1, + 296 + ], + "142": [ + 141, + -1, + 179 + ], + "143": [ + -1, + 0, + 234 + ], + "144": [ + 136, + 1, + 8 + ], + "145": [ + 135, + 1, + 8 + ], + "146": [ + 134, + 1, + 140 + ], + "147": [ + 136, + 1, + 188 + ], + "148": [ + 223, + -1, + 202 + ], + "149": [ + 123, + 1, + 140 + ], + "150": [ + 143, + 1, + 181 + ], + "151": [ + -1, + 0, + 225 + ], + "152": [ + 130, + 1, + 8 + ], + "153": [ + -1, + 0, + 0 + ], + "154": [ + 119, + 1, + 319 + ], + "155": [ + 149, + -1, + 196 + ], + "156": [ + 163, + -1, + 242 + ], + "157": [ + 136, + -1, + 170 + ], + "158": [ + 191, + 1, + 254 + ], + "159": [ + 137, + -1, + 8 + ], + "160": [ + 157, + 1, + 140 + ], + "161": [ + 146, + 1, + 8 + ], + "162": [ + 135, + 1, + 193 + ], + "163": [ + 125, + -1, + 264 + ], + "164": [ + -1, + 0, + 0 + ], + "165": [ + 127, + -1, + 289 + ], + "166": [ + 151, + 1, + 133 + ], + "167": [ + 151, + 1, + 8 + ], + "168": [ + 150, + 1, + 8 + ], + "169": [ + 139, + -1, + 243 + ], + "170": [ + 118, + 1, + 214 + ], + "171": [ + 142, + 1, + 8 + ], + "172": [ + 141, + 1, + 230 + ], + "173": [ + 114, + -1, + 94 + ], + "174": [ + -1, + 0, + 264 + ], + "175": [ + -1, + 0, + 0 + ], + "176": [ + 117, + 1, + 182 + ], + "177": [ + 116, + 1, + 8 + ], + "178": [ + 115, + 1, + 8 + ], + "179": [ + 138, + -1, + 146 + ], + "180": [ + 117, + 1, + 8 + ], + "181": [ + 116, + -1, + 179 + ], + "182": [ + 174, + -1, + 216 + ], + "183": [ + -1, + 0, + 0 + ], + "184": [ + 112, + 1, + 224 + ], + "185": [ + 141, + -1, + 174 + ], + "186": [ + 141, + 1, + 8 + ], + "187": [ + 140, + 1, + 8 + ], + "188": [ + 114, + -1, + 8 + ], + "189": [ + 143, + 1, + 8 + ], + "190": [ + 155, + 1, + 134 + ], + "191": [ + 201, + -1, + 236 + ], + "192": [ + 179, + 1, + 8 + ], + "193": [ + 190, + -1, + 8 + ], + "194": [ + 118, + 1, + 8 + ], + "195": [ + 185, + 1, + 8 + ], + "196": [ + 172, + 1, + 8 + ], + "197": [ + 147, + 1, + 8 + ], + "198": [ + 113, + 1, + 8 + ], + "199": [ + 155, + -1, + 8 + ], + "200": [ + 138, + 1, + 8 + ], + "201": [ + 206, + -1, + 263 + ], + "202": [ + 149, + -1, + 8 + ], + "203": [ + 122, + -1, + 218 + ], + "204": [ + 173, + -1, + 8 + ], + "205": [ + 170, + 1, + 8 + ], + "206": [ + 169, + 1, + 224 + ], + "207": [ + 120, + 1, + 8 + ], + "208": [ + 176, + 1, + 8 + ], + "209": [ + 181, + 1, + 8 + ], + "210": [ + 160, + 1, + 8 + ], + "211": [ + -1, + 0, + 0 + ], + "212": [ + 124, + 1, + 8 + ], + "213": [ + 166, + 1, + 8 + ], + "214": [ + 131, + 1, + 8 + ], + "215": [ + 129, + 1, + 8 + ], + "216": [ + -1, + 0, + 0 + ], + "217": [ + 165, + -1, + 261 + ], + "218": [ + -1, + 0, + 0 + ], + "219": [ + 157, + 1, + 8 + ], + "220": [ + 134, + 1, + 8 + ], + "221": [ + 162, + 1, + 8 + ], + "222": [ + 121, + -1, + 8 + ], + "223": [ + 158, + -1, + 233 + ] + }, + "prim_cost": 13716, + "profitable_helpers": 951, + "roots": 17, + "semantic_controls": [ + { + "mutation": "omit_target_preparation", + "witnesses": { + "dual": { + "actual": "-1", + "column": 184, + "expected": "0", + "row": 112 + }, + "forward": { + "actual": "-1", + "column": 119, + "expected": "0", + "row": 112 + }, + "inverse": { + "actual": "1", + "column": 169, + "expected": "0", + "row": 112 + } + } + }, + { + "mutation": "omit_target_restoration", + "witnesses": { + "dual": { + "actual": "1", + "column": 184, + "expected": "0", + "row": 112 + }, + "forward": { + "actual": "1", + "column": 169, + "expected": "0", + "row": 112 + }, + "inverse": { + "actual": "-1", + "column": 119, + "expected": "0", + "row": 112 + } + } + }, + { + "mutation": "parent_before_child_preparation", + "witnesses": { + "dual": { + "actual": "1", + "column": 121, + "expected": "0", + "row": 114 + }, + "forward": { + "actual": "1", + "column": 139, + "expected": "0", + "row": 112 + }, + "inverse": { + "actual": "-1", + "column": 139, + "expected": "0", + "row": 112 + } + } + }, + { + "mutation": "omit_helper_preparation", + "witnesses": { + "dual": { + "actual": "-1", + "column": 237, + "expected": "0", + "row": 224 + }, + "forward": { + "actual": "0", + "column": 234, + "expected": "1/2", + "row": 112 + }, + "inverse": { + "actual": "1", + "column": 238, + "expected": "0", + "row": 229 + } + } + }, + { + "mutation": "omit_helper_restoration", + "witnesses": { + "dual": { + "actual": "0", + "column": 119, + "expected": "1/2", + "row": 224 + }, + "forward": { + "actual": "1", + "column": 238, + "expected": "0", + "row": 229 + }, + "inverse": { + "actual": "0", + "column": 234, + "expected": "-1/2", + "row": 112 + } + } + }, + { + "mutation": "flip_helper_preparation_sign", + "witnesses": { + "dual": { + "actual": "-2", + "column": 288, + "expected": "0", + "row": 296 + }, + "forward": { + "actual": "-1/2", + "column": 296, + "expected": "1/2", + "row": 112 + }, + "inverse": { + "actual": "-2", + "column": 296, + "expected": "0", + "row": 288 + } + } + }, + { + "mutation": "flip_residual_sign", + "witnesses": { + "dual": { + "actual": "-1/2", + "column": 112, + "expected": "1/2", + "row": 224 + }, + "forward": { + "actual": "1/2", + "column": 224, + "expected": "-1/2", + "row": 112 + }, + "inverse": { + "actual": "-1/2", + "column": 224, + "expected": "1/2", + "row": 112 + } + } + }, + { + "mutation": "flip_target_restoration_sign", + "witnesses": { + "dual": { + "actual": "-2", + "column": 156, + "expected": "0", + "row": 163 + }, + "forward": { + "actual": "2", + "column": 163, + "expected": "0", + "row": 156 + }, + "inverse": { + "actual": "-2", + "column": 163, + "expected": "0", + "row": 156 + } + } + }, + { + "mutation": "stale_original_injection", + "witnesses": { + "dual": { + "actual": "1", + "column": 112, + "expected": "1/2", + "row": 224 + }, + "forward": { + "actual": "-1", + "column": 224, + "expected": "-1/2", + "row": 112 + }, + "inverse": { + "actual": "1", + "column": 224, + "expected": "1/2", + "row": 112 + } + } + }, + { + "full_arbitrary_target_domain_rejects": true, + "helper_only_projection_passes": true, + "mutation": "omit_target_preparation", + "projected_input_columns": 520 + } + ], + "source_compressed_sha256": "886338fc32da14f3389a82c8120a1bcf9c5e2f0ec3e9b2d377fdae809e1d977f", + "source_frame_predicate": "helper absent from start_extra and helper_final; not removed", + "target_edges": 95, + "target_only_bill": { + "coefficient_histogram": { + "-1": 447, + "-1/2": 789, + "-1/4": 176, + "-1/8": 2, + "-2": 16, + "-3/2": 3, + "1": 443, + "1/2": 709, + "1/4": 196, + "1/8": 4, + "2": 29, + "3": 2, + "3/2": 9, + "3/4": 2, + "3/8": 2, + "4": 3, + "5/4": 1, + "5/8": 1 + }, + "component_primitives": 13716, + "logical_additions": 2834 + }, + "target_residual_nonzeros": 2644, + "tree": [ + [ + 0, + -1, + 126, + 0 + ], + [ + 0, + -1, + 153, + 0 + ], + [ + 0, + -1, + 164, + 0 + ], + [ + 0, + -1, + 175, + 0 + ], + [ + 0, + -1, + 183, + 0 + ], + [ + 0, + -1, + 211, + 0 + ], + [ + 0, + -1, + 216, + 0 + ], + [ + 0, + -1, + 218, + 0 + ], + [ + 8, + 113, + 198, + 1 + ], + [ + 8, + 114, + 188, + -1 + ], + [ + 8, + 115, + 178, + 1 + ], + [ + 8, + 116, + 177, + 1 + ], + [ + 8, + 117, + 180, + 1 + ], + [ + 8, + 118, + 194, + 1 + ], + [ + 8, + 120, + 207, + 1 + ], + [ + 8, + 121, + 222, + -1 + ], + [ + 8, + 123, + 133, + -1 + ], + [ + 8, + 124, + 212, + 1 + ], + [ + 8, + 129, + 215, + 1 + ], + [ + 8, + 130, + 152, + 1 + ], + [ + 8, + 131, + 214, + 1 + ], + [ + 8, + 134, + 220, + 1 + ], + [ + 8, + 135, + 145, + 1 + ], + [ + 8, + 136, + 144, + 1 + ], + [ + 8, + 137, + 159, + -1 + ], + [ + 8, + 138, + 200, + 1 + ], + [ + 8, + 140, + 187, + 1 + ], + [ + 8, + 141, + 186, + 1 + ], + [ + 8, + 142, + 171, + 1 + ], + [ + 8, + 143, + 189, + 1 + ], + [ + 8, + 146, + 161, + 1 + ], + [ + 8, + 147, + 197, + 1 + ], + [ + 8, + 149, + 202, + -1 + ], + [ + 8, + 150, + 168, + 1 + ], + [ + 8, + 151, + 167, + 1 + ], + [ + 8, + 155, + 199, + -1 + ], + [ + 8, + 157, + 219, + 1 + ], + [ + 8, + 160, + 210, + 1 + ], + [ + 8, + 162, + 221, + 1 + ], + [ + 8, + 166, + 213, + 1 + ], + [ + 8, + 170, + 205, + 1 + ], + [ + 8, + 172, + 196, + 1 + ], + [ + 8, + 173, + 204, + -1 + ], + [ + 8, + 176, + 208, + 1 + ], + [ + 8, + 179, + 192, + 1 + ], + [ + 8, + 181, + 209, + 1 + ], + [ + 8, + 185, + 195, + 1 + ], + [ + 8, + 190, + 193, + -1 + ], + [ + 94, + 114, + 173, + -1 + ], + [ + 109, + 121, + 137, + -1 + ], + [ + 127, + 120, + 179, + 1 + ], + [ + 133, + 124, + 143, + -1 + ], + [ + 133, + 151, + 166, + 1 + ], + [ + 134, + 155, + 190, + 1 + ], + [ + 140, + 123, + 149, + 1 + ], + [ + 140, + 134, + 146, + 1 + ], + [ + 140, + 157, + 160, + 1 + ], + [ + 146, + 138, + 179, + -1 + ], + [ + 150, + 130, + 151, + 1 + ], + [ + 156, + 121, + 173, + 1 + ], + [ + 157, + 134, + 135, + 1 + ], + [ + 170, + 136, + 157, + -1 + ], + [ + 174, + 141, + 185, + -1 + ], + [ + 176, + 116, + 117, + -1 + ], + [ + 177, + 115, + 179, + -1 + ], + [ + 179, + 116, + 181, + -1 + ], + [ + 179, + 141, + 142, + -1 + ], + [ + 180, + 124, + 129, + 1 + ], + [ + 181, + 118, + 140, + -1 + ], + [ + 181, + 131, + 151, + -1 + ], + [ + 181, + 143, + 150, + 1 + ], + [ + 182, + 117, + 176, + 1 + ], + [ + 188, + 136, + 147, + 1 + ], + [ + 191, + 113, + 118, + -1 + ], + [ + 193, + 135, + 162, + 1 + ], + [ + 196, + 149, + 155, + -1 + ], + [ + 202, + 148, + 223, + -1 + ], + [ + 214, + 118, + 170, + 1 + ], + [ + 216, + -1, + 114, + 0 + ], + [ + 216, + 174, + 182, + -1 + ], + [ + 218, + 122, + 203, + -1 + ], + [ + 220, + 119, + 139, + -1 + ], + [ + 221, + -1, + 138, + 0 + ], + [ + 224, + 112, + 184, + 1 + ], + [ + 224, + 169, + 206, + 1 + ], + [ + 225, + -1, + 151, + 0 + ], + [ + 225, + 112, + 169, + -1 + ], + [ + 229, + -1, + 116, + 0 + ], + [ + 230, + 141, + 172, + 1 + ], + [ + 232, + 132, + 148, + -1 + ], + [ + 233, + 158, + 223, + -1 + ], + [ + 234, + -1, + 143, + 0 + ], + [ + 236, + 122, + 174, + 1 + ], + [ + 236, + 191, + 201, + -1 + ], + [ + 242, + 156, + 163, + -1 + ], + [ + 243, + 139, + 169, + -1 + ], + [ + 244, + 125, + 128, + 1 + ], + [ + 250, + -1, + 135, + 0 + ], + [ + 254, + 158, + 191, + 1 + ], + [ + 261, + 165, + 217, + -1 + ], + [ + 263, + 201, + 206, + -1 + ], + [ + 264, + -1, + 174, + 0 + ], + [ + 264, + 125, + 163, + -1 + ], + [ + 265, + -1, + 136, + 0 + ], + [ + 269, + 127, + 154, + -1 + ], + [ + 273, + -1, + 119, + 0 + ], + [ + 281, + 128, + 155, + 1 + ], + [ + 288, + 123, + 148, + -1 + ], + [ + 289, + 127, + 165, + -1 + ], + [ + 296, + 141, + 157, + -1 + ], + [ + 309, + 118, + 135, + 1 + ], + [ + 319, + 119, + 154, + 1 + ] + ], + "two-sided_panel_sha256": "27defe7675576baaebfd45efe40439f491a683bd923b7259c98495db8d3783ac", + "two-sided_word_sha256": "20b8b7779904f7c33832f426489c192bf4b1ea0b7e53e041a5841e144d521f31", + "two_sided_bill": { + "coefficient_histogram": { + "-1": 508, + "-1/2": 552, + "-1/4": 91, + "-1/8": 2, + "-2": 13, + "1": 524, + "1/2": 455, + "1/4": 109, + "1/8": 4, + "2": 23, + "3": 2, + "3/2": 2, + "3/4": 2, + "4": 1 + }, + "component_primitives": 10633, + "logical_additions": 2288 + }, + "two_sided_residual_nonzeros": 1922 + } + } +} diff --git a/research/staged-compensation-forests/artifacts/FOREST-COMPENSATION-base.json.gz b/research/staged-compensation-forests/artifacts/FOREST-COMPENSATION-base.json.gz new file mode 100644 index 0000000000..c589fb5b31 Binary files /dev/null and b/research/staged-compensation-forests/artifacts/FOREST-COMPENSATION-base.json.gz differ diff --git a/research/staged-compensation-forests/artifacts/FOREST-COMPENSATION-extra.json.gz b/research/staged-compensation-forests/artifacts/FOREST-COMPENSATION-extra.json.gz new file mode 100644 index 0000000000..c589fb5b31 Binary files /dev/null and b/research/staged-compensation-forests/artifacts/FOREST-COMPENSATION-extra.json.gz differ diff --git a/research/staged-compensation-forests/artifacts/FOREST-WORD-base.json.gz b/research/staged-compensation-forests/artifacts/FOREST-WORD-base.json.gz new file mode 100644 index 0000000000..880ba5611e Binary files /dev/null and b/research/staged-compensation-forests/artifacts/FOREST-WORD-base.json.gz differ diff --git a/research/staged-compensation-forests/artifacts/FOREST-WORD-extra.json.gz b/research/staged-compensation-forests/artifacts/FOREST-WORD-extra.json.gz new file mode 100644 index 0000000000..94665ead95 Binary files /dev/null and b/research/staged-compensation-forests/artifacts/FOREST-WORD-extra.json.gz differ diff --git a/research/staged-compensation-forests/artifacts/HISTORICAL-SHARED-COMPENSATION.json.gz b/research/staged-compensation-forests/artifacts/HISTORICAL-SHARED-COMPENSATION.json.gz new file mode 100644 index 0000000000..4c0905b320 Binary files /dev/null and b/research/staged-compensation-forests/artifacts/HISTORICAL-SHARED-COMPENSATION.json.gz differ diff --git a/research/staged-compensation-forests/artifacts/INDEPENDENT-FOREST.json.gz b/research/staged-compensation-forests/artifacts/INDEPENDENT-FOREST.json.gz new file mode 100644 index 0000000000..743ac1725e Binary files /dev/null and b/research/staged-compensation-forests/artifacts/INDEPENDENT-FOREST.json.gz differ diff --git a/research/staged-compensation-forests/artifacts/PR1080-COMPARISON.json b/research/staged-compensation-forests/artifacts/PR1080-COMPARISON.json new file mode 100644 index 0000000000..ee67cdcb82 --- /dev/null +++ b/research/staged-compensation-forests/artifacts/PR1080-COMPARISON.json @@ -0,0 +1,730 @@ +{ + "current_active_helpers": 207, + "current_component_price": 31214, + "current_eighth_witnesses": [ + [ + 113, + 288, + "-1/8" + ], + [ + 113, + 296, + "1/8" + ], + [ + 113, + 302, + "-5/8" + ], + [ + 118, + 288, + "1/8" + ], + [ + 118, + 296, + "-1/8" + ], + [ + 118, + 302, + "-3/8" + ], + [ + 122, + 288, + "-1/8" + ], + [ + 122, + 296, + "-3/8" + ], + [ + 122, + 302, + "-1/8" + ], + [ + 123, + 288, + "3/8" + ], + [ + 123, + 296, + "1/8" + ], + [ + 123, + 302, + "-1/8" + ], + [ + 125, + 288, + "1/8" + ], + [ + 125, + 296, + "-1/8" + ], + [ + 125, + 302, + "-3/8" + ], + [ + 128, + 288, + "1/8" + ], + [ + 128, + 296, + "-1/8" + ], + [ + 128, + 302, + "-3/8" + ], + [ + 133, + 288, + "-3/8" + ], + [ + 133, + 296, + "-1/8" + ], + [ + 133, + 302, + "1/8" + ], + [ + 134, + 288, + "-1/8" + ], + [ + 134, + 296, + "5/8" + ], + [ + 134, + 302, + "-1/8" + ], + [ + 135, + 288, + "1/8" + ], + [ + 135, + 296, + "3/8" + ], + [ + 135, + 302, + "1/8" + ], + [ + 140, + 288, + "1/8" + ], + [ + 140, + 296, + "-1/8" + ], + [ + 140, + 302, + "5/8" + ], + [ + 145, + 288, + "1/8" + ], + [ + 145, + 296, + "3/8" + ], + [ + 145, + 302, + "1/8" + ], + [ + 146, + 288, + "-1/8" + ], + [ + 146, + 296, + "5/8" + ], + [ + 146, + 302, + "-1/8" + ], + [ + 149, + 288, + "3/8" + ], + [ + 149, + 296, + "1/8" + ], + [ + 149, + 302, + "-1/8" + ], + [ + 155, + 288, + "1/8" + ], + [ + 155, + 296, + "-1/8" + ], + [ + 155, + 302, + "-3/8" + ], + [ + 156, + 288, + "1/8" + ], + [ + 156, + 296, + "-1/8" + ], + [ + 156, + 302, + "5/8" + ], + [ + 161, + 288, + "-1/8" + ], + [ + 161, + 296, + "5/8" + ], + [ + 161, + 302, + "-1/8" + ], + [ + 162, + 288, + "1/8" + ], + [ + 162, + 296, + "3/8" + ], + [ + 162, + 302, + "1/8" + ], + [ + 163, + 288, + "-1/8" + ], + [ + 163, + 296, + "1/8" + ], + [ + 163, + 302, + "-5/8" + ], + [ + 170, + 288, + "-1/8" + ], + [ + 170, + 296, + "1/8" + ], + [ + 170, + 302, + "3/8" + ], + [ + 174, + 288, + "-1/8" + ], + [ + 174, + 296, + "5/8" + ], + [ + 174, + 302, + "-1/8" + ], + [ + 182, + 288, + "-1/8" + ], + [ + 182, + 296, + "5/8" + ], + [ + 182, + 302, + "-1/8" + ], + [ + 187, + 288, + "1/8" + ], + [ + 187, + 296, + "-1/8" + ], + [ + 187, + 302, + "5/8" + ], + [ + 190, + 288, + "1/8" + ], + [ + 190, + 296, + "-1/8" + ], + [ + 190, + 302, + "-3/8" + ], + [ + 193, + 288, + "-1/8" + ], + [ + 193, + 296, + "1/8" + ], + [ + 193, + 302, + "3/8" + ], + [ + 194, + 288, + "1/8" + ], + [ + 194, + 296, + "-1/8" + ], + [ + 194, + 302, + "-3/8" + ], + [ + 198, + 288, + "-1/8" + ], + [ + 198, + 296, + "1/8" + ], + [ + 198, + 302, + "-5/8" + ], + [ + 199, + 288, + "-1/8" + ], + [ + 199, + 296, + "1/8" + ], + [ + 199, + 302, + "3/8" + ], + [ + 202, + 288, + "-3/8" + ], + [ + 202, + 296, + "-1/8" + ], + [ + 202, + 302, + "1/8" + ], + [ + 203, + 288, + "1/8" + ], + [ + 203, + 296, + "3/8" + ], + [ + 203, + 302, + "1/8" + ], + [ + 205, + 288, + "-1/8" + ], + [ + 205, + 296, + "1/8" + ], + [ + 205, + 302, + "3/8" + ], + [ + 220, + 288, + "-1/8" + ], + [ + 220, + 296, + "5/8" + ], + [ + 220, + 302, + "-1/8" + ], + [ + 221, + 288, + "1/8" + ], + [ + 221, + 296, + "3/8" + ], + [ + 221, + 302, + "1/8" + ] + ], + "current_nonzeros": 5736, + "current_targets": 112, + "frozen_helper_recipe_literal_id_transfer": { + "admitted_without_adapters_or_remapping": false, + "nonfull_terminal_helpers": [ + 226, + 228, + 230, + 251, + 267, + 299, + 304, + 320, + 331, + 363, + 395, + 412, + 428, + 511, + 531, + 572 + ], + "nonzero_entrance_helpers": [ + 462, + 474, + 476, + 477, + 478, + 480, + 523, + 526, + 527, + 528, + 529, + 531, + 542, + 561 + ], + "touched_helpers": [ + 226, + 228, + 230, + 231, + 235, + 236, + 238, + 239, + 240, + 242, + 244, + 246, + 247, + 248, + 251, + 252, + 253, + 254, + 255, + 256, + 258, + 260, + 262, + 263, + 264, + 267, + 268, + 269, + 270, + 271, + 272, + 274, + 276, + 278, + 279, + 280, + 283, + 284, + 285, + 286, + 287, + 288, + 290, + 292, + 294, + 295, + 296, + 299, + 300, + 301, + 302, + 303, + 304, + 306, + 308, + 310, + 312, + 315, + 316, + 317, + 318, + 319, + 320, + 322, + 324, + 326, + 331, + 332, + 333, + 334, + 335, + 336, + 338, + 340, + 342, + 343, + 344, + 345, + 347, + 348, + 349, + 350, + 351, + 352, + 354, + 356, + 358, + 359, + 360, + 361, + 363, + 364, + 365, + 366, + 367, + 368, + 370, + 372, + 374, + 375, + 377, + 379, + 380, + 381, + 382, + 383, + 384, + 386, + 388, + 390, + 391, + 392, + 393, + 395, + 396, + 397, + 398, + 399, + 400, + 402, + 404, + 406, + 407, + 411, + 412, + 413, + 414, + 415, + 416, + 418, + 420, + 422, + 423, + 427, + 428, + 430, + 431, + 434, + 436, + 438, + 439, + 440, + 443, + 444, + 445, + 446, + 447, + 462, + 464, + 465, + 467, + 468, + 469, + 474, + 476, + 477, + 478, + 479, + 480, + 491, + 493, + 494, + 495, + 502, + 503, + 505, + 507, + 511, + 515, + 516, + 517, + 519, + 523, + 526, + 527, + 528, + 529, + 531, + 542, + 558, + 560, + 561, + 570, + 572 + ], + "unavailable_removed_helpers": [ + 494, + 495, + 507, + 519 + ] + }, + "frozen_target_recipe_on_current_matrix_component_price": 22548, + "prior_active_helpers": 216, + "prior_component_price": 34728, + "prior_head": "803e080e181229a3af2196b7a13615c9d81ae10d", + "prior_nonzeros": 6320, + "prior_pr": 1080, + "prior_quarter_grid": true, + "prior_recipe_sha256": "d526804d9d627cbd850b0e54c3de9aadc74646e1a9b6befb577f42240720750a", + "prior_targets": 112, + "prior_word_compressed_sha256": "387a2266ffe006d20042221d967f67a4b18d9bb8de1cd1e01d4031b539fa74a5", + "prior_word_decoded_sha256": "24db880b7dab31e6af4eec8a1aba1bbbae29cd50d9a7b77cf0e9b571b3e5ae7c", + "scope": "One frozen source/recipe comparison. No relabeling search, general basis-equivalence obstruction, paid wrapper transfer, or global circuit optimum.", + "signed_permutation_equivalence_excluded_by_grid_and_support": true +} diff --git a/research/staged-compensation-forests/artifacts/PRICES.json b/research/staged-compensation-forests/artifacts/PRICES.json new file mode 100644 index 0000000000..d5056b1c9e --- /dev/null +++ b/research/staged-compensation-forests/artifacts/PRICES.json @@ -0,0 +1,151 @@ +{ + "arbitrary_microcircuit_input_symbols": [ + "source", + "target", + "coefficient-work" + ], + "bills": { + "forest": { + "component_primitives": 13716, + "histogram": { + "-1": 447, + "-1/2": 789, + "-1/4": 176, + "-1/8": 2, + "-2": 16, + "-3/2": 3, + "1": 443, + "1/2": 709, + "1/4": 196, + "1/8": 4, + "2": 29, + "3": 2, + "3/2": 9, + "3/4": 2, + "3/8": 2, + "4": 3, + "5/4": 1, + "5/8": 1 + }, + "logical_additions": 2834 + }, + "historical-rank-basis": { + "component_primitives": 17334, + "histogram": { + "-1": 132, + "-1/2": 774, + "-1/4": 659, + "-1/8": 20, + "-2": 2, + "-3/2": 2, + "-3/4": 4, + "-3/8": 4, + "-5/8": 2, + "1": 156, + "1/2": 712, + "1/4": 685, + "1/8": 16, + "2": 20, + "3/2": 2, + "3/4": 12, + "3/8": 6, + "5/8": 6 + }, + "logical_additions": 3214 + }, + "original": { + "component_primitives": 31214, + "histogram": { + "-1": 153, + "-1/2": 1379, + "-1/4": 1221, + "-1/8": 34, + "-2": 3, + "-3/2": 3, + "-3/4": 5, + "-3/8": 9, + "-5/8": 3, + "1": 193, + "1/2": 1307, + "1/4": 1319, + "1/8": 30, + "2": 39, + "3/2": 3, + "3/4": 15, + "3/8": 11, + "5/8": 9 + }, + "logical_additions": 5736 + }, + "two-sided": { + "component_primitives": 10633, + "histogram": { + "-1": 508, + "-1/2": 552, + "-1/4": 91, + "-1/8": 2, + "-2": 13, + "1": 524, + "1/2": 455, + "1/4": 109, + "1/8": 4, + "2": 23, + "3": 2, + "3/2": 2, + "3/4": 2, + "4": 1 + }, + "logical_additions": 2288 + } + }, + "microcircuit_coefficients": { + "-1": 4, + "-1/2": 5, + "-1/4": 6, + "-1/8": 7, + "-2": 5, + "-3/2": 7, + "-3/4": 8, + "-3/8": 9, + "-5/8": 10, + "1": 4, + "1/2": 5, + "1/4": 6, + "1/8": 7, + "2": 5, + "3": 6, + "3/2": 7, + "3/4": 8, + "3/8": 9, + "4": 6, + "5/4": 9, + "5/8": 10 + }, + "private_work_output": "zero", + "scope": "Independent emitted Horner microcircuit count; not a whole-supplier precision or tape invoice.", + "source_bindings": { + "forest": { + "compressed_sha256": "7a39e3cfe0113743714b1fc38258c36803b20c5f4abeecf977e76ff5da0533e7", + "decoded_sha256": "665d299ef25d80ea42e54d10c2e94e15527c2657898b88f3970cc14eb4fac654", + "input": "FOREST-COMPENSATION-base.json.gz" + }, + "historical-rank-basis": { + "compressed_sha256": "e7bdb1e299a43a8fcbdad4c598b7161e504a94691df3940a9a4eaf638f5013f0", + "decoded_sha256": "9f242abd5d2ed46a2e95dad46449d1d77c6fec330b5e0db6b324ac93fe756e62", + "input": "HISTORICAL-SHARED-COMPENSATION.json.gz" + }, + "original": { + "compressed_sha256": "735c540b1fe29d0ceeb4d2f304ec941e5f2bd3bc92bafc8cce2b4f9a67a3b653", + "decoded_sha256": "94d33db98720483f57efcd7bf50657f29f710554474e4f6b4b90617ad4500263", + "input": "SOURCE-base.json.gz" + }, + "two-sided": { + "compressed_sha256": "4119728ab2a3833636a77862bf997b46a50ff7c3c5a874b5d7c675d9577c8546", + "decoded_sha256": "27defe7675576baaebfd45efe40439f491a683bd923b7259c98495db8d3783ac", + "input": "TWO-SIDED-COMPENSATION-base.json.gz" + } + }, + "two_real_component_savings_vs_historical_rank_basis": 13402, + "two_real_component_savings_vs_original": 41162, + "two_real_component_savings_vs_target_forest": 6166 +} diff --git a/research/staged-compensation-forests/artifacts/SOURCE-base.json.gz b/research/staged-compensation-forests/artifacts/SOURCE-base.json.gz new file mode 100644 index 0000000000..dc6d321b1e Binary files /dev/null and b/research/staged-compensation-forests/artifacts/SOURCE-base.json.gz differ diff --git a/research/staged-compensation-forests/artifacts/SOURCE-extra.json.gz b/research/staged-compensation-forests/artifacts/SOURCE-extra.json.gz new file mode 100644 index 0000000000..78e7b2bb06 Binary files /dev/null and b/research/staged-compensation-forests/artifacts/SOURCE-extra.json.gz differ diff --git a/research/staged-compensation-forests/artifacts/TWO-SIDED-COMPENSATION-base.json.gz b/research/staged-compensation-forests/artifacts/TWO-SIDED-COMPENSATION-base.json.gz new file mode 100644 index 0000000000..73ce8a7b09 Binary files /dev/null and b/research/staged-compensation-forests/artifacts/TWO-SIDED-COMPENSATION-base.json.gz differ diff --git a/research/staged-compensation-forests/artifacts/TWO-SIDED-COMPENSATION-extra.json.gz b/research/staged-compensation-forests/artifacts/TWO-SIDED-COMPENSATION-extra.json.gz new file mode 100644 index 0000000000..73ce8a7b09 Binary files /dev/null and b/research/staged-compensation-forests/artifacts/TWO-SIDED-COMPENSATION-extra.json.gz differ diff --git a/research/staged-compensation-forests/artifacts/TWO-SIDED-WORD-base.json.gz b/research/staged-compensation-forests/artifacts/TWO-SIDED-WORD-base.json.gz new file mode 100644 index 0000000000..e1b8445ae3 Binary files /dev/null and b/research/staged-compensation-forests/artifacts/TWO-SIDED-WORD-base.json.gz differ diff --git a/research/staged-compensation-forests/artifacts/TWO-SIDED-WORD-extra.json.gz b/research/staged-compensation-forests/artifacts/TWO-SIDED-WORD-extra.json.gz new file mode 100644 index 0000000000..0b40283f04 Binary files /dev/null and b/research/staged-compensation-forests/artifacts/TWO-SIDED-WORD-extra.json.gz differ diff --git a/research/staged-compensation-forests/artifacts/WHOLE-WORD.json.gz b/research/staged-compensation-forests/artifacts/WHOLE-WORD.json.gz new file mode 100644 index 0000000000..267c41453a Binary files /dev/null and b/research/staged-compensation-forests/artifacts/WHOLE-WORD.json.gz differ diff --git a/research/staged-compensation-forests/check_word.py b/research/staged-compensation-forests/check_word.py new file mode 100644 index 0000000000..8a9e4f1acc --- /dev/null +++ b/research/staged-compensation-forests/check_word.py @@ -0,0 +1,807 @@ +"""Independent exact finite-word and scalar-prefix audit for the C01 rewrite. + +Only the authenticated historical transport/emitter are run as producers. +Acceptance below uses this separate integer-dyadic row interpreter. Native +Clifford phases, physical CLEAR implementations and recursive rounding are +outside the checked model. Prepared with substantial OpenAI Codex assistance. +""" + +from collections import Counter +from fractions import Fraction +from pathlib import Path +import argparse +import copy +import gzip +import hashlib +import json +import os +import subprocess +import sys +import tempfile + + +HEAD = "3efbb5de06a49ffeea6684482f2d3fe48cdca3fb" +SOURCE_HASHES = { + "base": "735c540b1fe29d0ceeb4d2f304ec941e5f2bd3bc92bafc8cce2b4f9a67a3b653", + "extra": "886338fc32da14f3389a82c8120a1bcf9c5e2f0ec3e9b2d377fdae809e1d977f", +} +PRODUCER_HASHES = { + "transport": "9818e08b819310b40f1441b89be8c4369584a5b3fa5dfe9b86b1df9a7f5d6a76", + "emitter": "99b59a6fa3feda86785e4225157dcb1a6169d256cec4f5e0acc9cea7a701df76", +} +HISTORICAL_PANEL_HASH = "e7bdb1e299a43a8fcbdad4c598b7161e504a94691df3940a9a4eaf638f5013f0" + + +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 hashlib.sha256(canonical(value)).hexdigest() + + +def read(path): + raw = path.read_bytes() + return json.loads(gzip.decompress(raw) if path.suffix == ".gz" else raw) + + +def file_record(path): + raw = path.read_bytes() + return { + "sha256": hashlib.sha256(raw).hexdigest(), + "bytes": len(raw), + "decoded_sha256": hashlib.sha256( + gzip.decompress(raw) if path.suffix == ".gz" else raw + ).hexdigest(), + } + + +def dyadic(numerator, denominator=1): + require(type(numerator) is int and type(denominator) is int, + "a coefficient must have integer numerator and denominator") + q = Fraction(numerator, denominator) + require(q.denominator & (q.denominator - 1) == 0, "non-dyadic coefficient") + return q.numerator, q.denominator.bit_length() - 1 + + +def normalize(terms, exponent): + terms = {column: value for column, value in terms.items() if value} + if not terms: + return {}, 0 + reduction = min(exponent, min( + (abs(value) & -abs(value)).bit_length() - 1 for value in terms.values())) + if reduction: + terms = {column: value >> reduction for column, value in terms.items()} + exponent -= reduction + return terms, exponent + + +def row_scale(row, numerator, exponent): + terms, old_exponent = row + return normalize({column: numerator * value for column, value in terms.items()}, + old_exponent + exponent) + + +def row_add(left, right, numerator=1, exponent=0): + left_terms, left_exponent = left + right_terms, right_exponent = right + final_exponent = max(left_exponent, right_exponent + exponent) + terms = {column: value << (final_exponent - left_exponent) + for column, value in left_terms.items()} + shift = final_exponent - right_exponent - exponent + for column, value in right_terms.items(): + terms[column] = terms.get(column, 0) + numerator * (value << shift) + return normalize(terms, final_exponent) + + +def number(numerator, exponent=0): + require(numerator >= 0, "negative positive-envelope number") + if not numerator: + return 0, 0 + reduction = min(exponent, (numerator & -numerator).bit_length() - 1) + return numerator >> reduction, exponent - reduction + + +def number_add(left, right): + exponent = max(left[1], right[1]) + return number((left[0] << (exponent - left[1])) + + (right[0] << (exponent - right[1])), exponent) + + +def number_scale(value, numerator, exponent=0): + return number(value[0] * abs(numerator), value[1] + exponent) + + +def greater(left, right): + return (left[0] << right[1]) > (right[0] << left[1]) + + +def number_json(value): + numerator, exponent = value + return { + "numerator": numerator, + "denominator_exponent": exponent, + "value": str(Fraction(numerator, 1 << exponent)), + "strict_power_of_two_bits": numerator.bit_length() - exponent if numerator else 0, + } + + +def key_json(key): + if isinstance(key, tuple): + return [key_json(item) for item in key] + return key + + +def row_json(row): + return {"denominator_exponent": row[1], + "terms": [[key_json(key), value] for key, value in sorted(row[0].items())]} + + +def state_digest(state): + return digest([[key_json(key), row_json(row)] for key, row in sorted(state.items())]) + + +class Metrics: + def __init__(self): + self.maximum_denominator_exponent = 0 + self.maximum_numerator_bits = 1 + self.maximum_exact_row_sum = (1, 0) + self.maximum_positive_envelope = (1, 0) + self.grid_witness = None + self.row_sum_witness = None + self.envelope_witness = None + + def observe(self, row, envelope, index, reference): + terms, exponent = row + if exponent > self.maximum_denominator_exponent: + odd = next(key for key, value in sorted(terms.items()) if value % 2) + self.maximum_denominator_exponent = exponent + self.grid_witness = { + "instruction": index, "reference": key_json(reference), + "input_column": key_json(odd), "numerator": terms[odd], + "denominator_exponent": exponent, + } + if terms: + self.maximum_numerator_bits = max( + self.maximum_numerator_bits, + max(abs(value).bit_length() for value in terms.values())) + row_sum = number(sum(abs(value) for value in terms.values()), exponent) + if greater(row_sum, self.maximum_exact_row_sum): + self.maximum_exact_row_sum = row_sum + self.row_sum_witness = { + "instruction": index, "reference": key_json(reference), + "row": row_json(row), "row_sha256": digest(row_json(row))} + if greater(envelope, self.maximum_positive_envelope): + self.maximum_positive_envelope = envelope + self.envelope_witness = { + "instruction": index, "reference": key_json(reference)} + + def result(self): + return { + "maximum_denominator_exponent": self.maximum_denominator_exponent, + "maximum_numerator_bits": self.maximum_numerator_bits, + "maximum_exact_row_sum": number_json(self.maximum_exact_row_sum), + "maximum_positive_envelope": number_json(self.maximum_positive_envelope), + "grid_witness": self.grid_witness, + "exact_row_sum_witness": self.row_sum_witness, + "positive_envelope_witness": self.envelope_witness, + } + + +def inverse_gate(gate): + tag = gate[0] + if tag == "add": + return [tag, gate[1], gate[2], -gate[3], gate[4]] + if tag == "scale": + return [tag, gate[1], gate[3], gate[2]] + require(tag == "warp", "unknown inverse gate") + return [tag, gate[1], -gate[2]] + + +def dual_gate(gate): + tag = gate[0] + if tag == "add": + return [tag, gate[2], gate[1], -gate[3], gate[4]] + if tag == "scale": + return [tag, gate[1], gate[3], gate[2]] + require(tag == "warp", "unknown dual gate") + # Here the generator means the conjugate monomial K-bar, as in the + # inherited inverse-transpose alphabet. It is an independent free letter. + return gate[:] + + +def orientations(program, dual=False, inverse=False): + result = [dual_gate(gate) if dual else gate[:] for gate in program] + return [inverse_gate(gate) for gate in reversed(result)] if inverse else result + + +def bare_gate(gate): + tag = gate[0] + require(tag in ("add", "scale", "warp"), "unknown raw-word gate") + length = {"add": 5, "scale": 4, "warp": 3}[tag] + return gate[:length] + + +def raw_prefix(word): + gates = [] + for correction in word["initial_corrections"]: + q = Fraction(correction["coefficient"]) + source = correction["source"] + letters = correction["operator_word"] + gates += [["warp", source, op] for op in reversed(letters)] + gates += [["add", correction["target"], source, q.numerator, q.denominator]] + gates += [["warp", source, -op] for op in letters] + for section in ("precondition", "compensation"): + gates += [bare_gate(gate) for gate in word[section]] + return gates + + +def raw_program(word): + gates = raw_prefix(word) + for section in ("A", "cut"): + gates += [bare_gate(gate) for gate in word[section]] + at = {} + for operator, warp in enumerate(word["warps"], 1): + at.setdefault(warp[0], []).append(["warp", warp[1], operator]) + for index in range(len(word["B"]) + 1): + gates += at.get(index, []) + if index < len(word["B"]): + gates.append(bare_gate(word["B"][index])) + for section in ("restore", "cleanup"): + gates += [bare_gate(gate) for gate in word[section]] + return gates + + +def bind_emitted_prefix(word, canonical_word, events, dual): + kept = sorted(set(range(704)) - set(word["removed"])) + new_id = {register: index for index, register in enumerate(kept)} + expected_compensation = [ + ["add", new_id[gate[1]], new_id[gate[2]], gate[3], gate[4], 0] + for gate in word["compensation"]] + require(canonical_word["compensation"] == expected_compensation, + "raw-to-canonical compensation mismatch") + expected = [["phase", "zero_frame_precondition"]] + for gate in orientations(raw_prefix(word), dual): + if gate[0] == "warp": + expected.append(["warp", ["L", new_id[gate[1]]], gate[2], 0, 0]) + elif gate[0] == "scale": + expected.append(["scalar", ["scale", ["L", new_id[gate[1]]], + gate[2], gate[3]], 0]) + else: + expected.append(["scalar", ["add", ["L", new_id[gate[1]]], + ["L", new_id[gate[2]]], gate[3], gate[4]], 0]) + end = events.index(["phase", "entry_adapters"]) + require(events[:end] == expected, "literal emitted zero-frame prefix mismatch") + return {"events": end, "sha256": digest(expected)} + + +def free_replay(program, live, zero_buffers=()): + state = {r: ({(r, ()): 1}, 0) for r in live} + envelope = {r: (1, 0) for r in live} + for r in zero_buffers: + require(r not in state, "zero buffer aliases arbitrary input") + state[r] = ({}, 0) + envelope[r] = (0, 0) + metrics = Metrics() + for index, gate in enumerate(program): + tag, target = gate[:2] + require(target in state, "undeclared destination") + if tag == "warp": + operator = gate[2] + require(type(operator) is int and operator != 0, "invalid warp") + terms, exponent = state[target] + changed = {} + for (column, letters), value in terms.items(): + word = letters[1:] if letters and letters[0] == -operator else (operator,) + letters + key = column, word + require(key not in changed, "left free-word action must be injective") + changed[key] = value + state[target] = changed, exponent + elif tag == "scale": + numerator, exponent = dyadic(gate[2], gate[3]) + require(numerator != 0, "singular scale") + state[target] = row_scale(state[target], numerator, exponent) + envelope[target] = number_scale(envelope[target], numerator, exponent) + else: + require(tag == "add", "unknown operation") + source = gate[2] + require(source in state and source != target, "undeclared or aliasing source") + numerator, exponent = dyadic(gate[3], gate[4]) + require(numerator != 0, "zero addition") + state[target] = row_add(state[target], state[source], numerator, exponent) + envelope[target] = number_add( + envelope[target], number_scale(envelope[source], numerator, exponent)) + metrics.observe(state[target], envelope[target], index, target) + return state, metrics.result() + + +def difference(actual, expected): + for reference in sorted(set(actual) | set(expected)): + if actual.get(reference) != expected.get(reference): + return {"reference": key_json(reference), + "actual": row_json(actual.get(reference, ({}, 0))), + "expected": row_json(expected.get(reference, ({}, 0)))} + return None + + +def full_expected(live, zero_buffers, dual, inverse): + state = {r: ({(r, ()): 1}, 0) for r in live} + for r in zero_buffers: + state[r] = ({}, 0) + for port in range(112): + target, source = (port, 112 + port) if dual else (112 + port, port) + sign = (-1 if dual else 1) * (-1 if inverse else 1) + state[target][0][source, ()] = sign + return state + + +def audit_whole_word(word): + live = sorted(set(range(704)) - set(word["removed"])) + zero_buffers = sorted(704 + int(r) for r in word["helper_final"]) + require(len(live) == 632 and len(zero_buffers) == 91, "changed input domain") + program = raw_program(word) + result = {} + for dual in (False, True): + for inverse in (False, True): + label = ("dual" if dual else "forward") + ("-inverse" if inverse else "") + oriented = orientations(program, dual, inverse) + actual, metrics = free_replay(oriented, live, zero_buffers) + witness = difference(actual, full_expected(live, zero_buffers, dual, inverse)) + require(witness is None, f"whole-word endpoint {label}: {witness}") + result[label] = { + "all_arbitrary_input_columns": len(live), + "zero_buffer_columns_required_zero": len(zero_buffers), + "literal_gate_count": len(oriented), + "gate_counts": dict(sorted(Counter(gate[0] for gate in oriented).items())), + "endpoint_sha256": state_digest(actual), + "exact_endpoint": True, "all_zero_buffers_returned_exactly": True, + "metrics": metrics, + } + return result + + +def panel_sections(panel): + def kind(gate): + require(gate[0] == "add" and gate[-1] == [], "panel must be zero-frame additions") + target, source = gate[1:3] + if 112 <= target < 224 and 112 <= source < 224: + return "target" + if target >= 224 and source >= 224: + return "helper" + require(112 <= target < 224 and source >= 224, "incorrect panel bank") + return "residual" + runs = [] + for gate in panel: + label = kind(gate) + if not runs or runs[-1][0] != label: + runs.append((label, [])) + runs[-1][1].append(gate) + require([label for label, _ in runs] == + ["target", "helper", "residual", "helper", "target"], + "expected restored two-sided factorization") + return [gates for _, gates in runs] + + +def primitive_price(gate): + require(gate[0] == "add", "panel price only supports ADD") + numerator, exponent = dyadic(gate[3], gate[4]) + require(numerator != 0, "zero coefficient") + digits = [] + n = abs(numerator) + while n: + digits.append(n % 2) + n //= 2 + return 3 + len(digits) - 1 + sum(digits) + exponent + + +def panel_audit(source, candidate): + live = sorted(set(range(704)) - set(source["removed"])) + old = [bare_gate(gate) for gate in source["compensation"]] + new = [bare_gate(gate) for gate in candidate["compensation"]] + target_prepare, helper_prepare, residual, helper_restore, target_restore = panel_sections( + candidate["compensation"]) + require([bare_gate(gate) for gate in helper_restore] == + [inverse_gate(bare_gate(gate)) for gate in reversed(helper_prepare)], + "literal helper restoration mismatch") + require([bare_gate(gate) for gate in target_restore] == + [inverse_gate(bare_gate(gate)) for gate in reversed(target_prepare)], + "literal target restoration mismatch") + helpers = sorted({r for gate in candidate["compensation"] for r in gate[1:3] if r >= 224}) + require(all(r in live and str(r) not in source["start_extra"] + and str(r) not in source["helper_final"] for r in helpers), + "helper not available unwrapped at the compensation cut") + target_pre = [bare_gate(gate) for gate in target_prepare] + helper_pre = [bare_gate(gate) for gate in helper_prepare] + correction = [bare_gate(gate) for gate in residual] + helper_post = [bare_gate(gate) for gate in helper_restore] + target_post = [bare_gate(gate) for gate in target_restore] + checks = {} + for dual in (False, True): + for inverse in (False, True): + label = ("dual" if dual else "forward") + ("-inverse" if inverse else "") + old_state, old_metrics = free_replay(orientations(old, dual, inverse), live) + new_state, new_metrics = free_replay(orientations(new, dual, inverse), live) + require(difference(new_state, old_state) is None, "panel mismatch: " + label) + checks[label] = {"all_arbitrary_input_columns": len(live), + "endpoint_sha256": state_digest(new_state), + "old_prefix": old_metrics, "new_prefix": new_metrics} + sign = copy.deepcopy(new) + sign[-1][3] *= -1 + controls = { + "omit_target_prepare": helper_pre + correction + helper_post + target_post, + "omit_helper_prepare": target_pre + correction + helper_post + target_post, + "omit_helper_restore": target_pre + helper_pre + correction + target_post, + "omit_target_restore": target_pre + helper_pre + correction + helper_post, + "stale_original_pullback": target_pre + helper_pre + old + helper_post + target_post, + "literal_final_sign": sign, + "wrong_target_restore_order": target_pre + helper_pre + correction + helper_post + + list(reversed(target_post)), + } + rejected = [] + for dual in (False, True): + expected, _ = free_replay(orientations(old, dual), live) + for label, program in controls.items(): + state, _ = free_replay(orientations(program, dual), live) + witness = difference(state, expected) + require(witness is not None, "insensitive panel control: " + label) + rejected.append({"control": label, "orientation": "dual" if dual else "forward", + "witness": witness}) + # Deliberately omit the reversal required by a literal inverse. + expected, _ = free_replay(orientations(old, inverse=True), live) + state, _ = free_replay([inverse_gate(gate) for gate in new], live) + witness = difference(state, expected) + require(witness is not None, "insensitive inverse-order control") + rejected.append({"control": "invert_each_gate_without_reversal", "witness": witness}) + # Deliberately retain the forward sign on exactly one dual ADD. + bad_dual = orientations(new, dual=True) + bad_dual[0][3] *= -1 + state, _ = free_replay(bad_dual, live) + expected, _ = free_replay(orientations(old, dual=True), live) + witness = difference(state, expected) + require(witness is not None, "insensitive dual-sign control") + rejected.append({"control": "wrong_dual_sign", "witness": witness}) + names = ["target_prepare", "helper_prepare", "residual", "helper_restore", "target_restore"] + groups = [target_prepare, helper_prepare, residual, helper_restore, target_restore] + bill = {name: {"additions": len(gates), + "price_per_real_component": sum(map(primitive_price, gates))} + for name, gates in zip(names, groups)} + bill["source"] = {"additions": len(old), + "price_per_real_component": sum(map(primitive_price, source["compensation"]))} + bill["candidate"] = {"additions": len(new), + "price_per_real_component": sum(map(primitive_price, candidate["compensation"]))} + return {"input_columns": len(live), "helper_coordinates": helpers, + "all_helpers_enter_zero_frame_and_exit_full": True, + "restored_factorization": True, "checks": checks, + "bill": bill, "controls": rejected} + + +def historical_panel_audit(source, path): + require(hashlib.sha256(path.read_bytes()).hexdigest() == HISTORICAL_PANEL_HASH, + "historical rank-basis panel hash mismatch") + panel = read(path) + live = sorted(set(range(704)) - set(source["removed"])) + old = [bare_gate(gate) for gate in source["compensation"]] + new = [bare_gate(gate) for gate in panel] + checks = {} + for dual in (False, True): + for inverse in (False, True): + label = ("dual" if dual else "forward") + ("-inverse" if inverse else "") + expected, _ = free_replay(orientations(old, dual, inverse), live) + actual, metrics = free_replay(orientations(new, dual, inverse), live) + require(difference(actual, expected) is None, + "historical panel endpoint mismatch: " + label) + checks[label] = {"all_arbitrary_input_columns": len(live), + "endpoint_sha256": state_digest(actual), "prefix": metrics} + bill = sum(map(primitive_price, panel)) + require(len(panel) == 3214 and bill == 17334, "historical rank-basis bill changed") + return {"additions": len(panel), "price_per_real_component": bill, + "checks": checks, "scope": "Fresh boundary and panel-prefix replay only."} + + +def lower_scalar(operation): + """Binary Horner scalar expansion, independently spelled out.""" + tag = operation[0] + target = tuple(operation[1]) + work = ("W", 0) + if tag == "clear": + return [("clear", target)] + if tag == "copy": + return [("copy", target, tuple(operation[2]))] + if tag == "scale": + numerator, exponent = dyadic(operation[2], operation[3]) + absolute = abs(numerator) + require(absolute and absolute & (absolute - 1) == 0, "non-binary scale") + shift = absolute.bit_length() - 1 - exponent + result = [("double" if shift >= 0 else "halve", target)] * abs(shift) + if numerator < 0: + result.append(("negate", target)) + return result + require(tag == "add", "unknown scalar macro") + source = tuple(operation[2]) + require(target != source and work not in (target, source), "aliased scalar ADD") + numerator, exponent = dyadic(operation[3], operation[4]) + require(numerator != 0, "zero scalar ADD") + bits = [] + absolute = abs(numerator) + while absolute: + bits.append(absolute % 2) + absolute //= 2 + result = [("clear", work)] + for index, bit in enumerate(reversed(bits)): + if index: + result.append(("double", work)) + if bit: + result.append(("add", work, source, 1)) + result += [("halve", work)] * exponent + result += [("add", target, work, 1 if numerator > 0 else -1), ("clear", work)] + return result + + +def audit_scalar_projection(events, canonical_word, orientation): + n = 2 * canonical_word["v"] + canonical_word["R"] + require(n == 632, "unexpected compact logical dimension") + centers = len(canonical_word["centers"]) + zeroes = canonical_word["zero_buffers"] + sizes = {"L": set(range(n)), "C": set(range(centers)), "Z": set(zeroes), "W": {0}} + state = {("L", i): ({i: 1}, 0) for i in range(n)} + envelope = {("L", i): (1, 0) for i in range(n)} + for kind in ("C", "Z", "W"): + for i in sizes[kind]: + state[kind, i] = ({}, 0) + envelope[kind, i] = (0, 0) + metrics = Metrics() + counts = Counter() + by_phase = {} + phase = None + nonzero_clears = Counter() + active_zeroes = set() + primitive_index = 0 + macro_count = 0 + primitive_hash = hashlib.sha256() + for event_index, event in enumerate(events): + tag = event[0] + if tag == "phase": + phase = event[1] + continue + if tag == "zero_buffer": + z = event[2] + require(z in sizes["Z"], "undeclared zero buffer") + require(not state["Z", z][0], "nonzero private buffer at allocation/free") + if event[1] == "alloc": + require(z not in active_zeroes, "double zero-buffer allocation") + active_zeroes.add(z) + else: + require(event[1] == "free" and z in active_zeroes, "invalid zero-buffer free") + active_zeroes.remove(z) + continue + if tag != "scalar": + require(tag in ("adapter", "residual_adapter", "warp", "climb", "center"), + "unknown nonscalar event") + continue + macro_count += 1 + primitives = lower_scalar(event[1]) + for operation in primitives: + op, target = operation[:2] + require(target[0] in sizes and target[1] in sizes[target[0]], "invalid scalar destination") + if target[0] == "Z": + require(target[1] in active_zeroes, "unallocated private destination") + primitive_hash.update(canonical(operation) + b"\n") + counts[op] += 1 + by_phase.setdefault(phase, Counter())[op] += 1 + if op == "clear": + if state[target][0]: + nonzero_clears[target[0]] += 1 + state[target] = ({}, 0) + envelope[target] = (0, 0) + elif op == "copy": + source = operation[2] + require(source in state, "invalid scalar COPY source") + state[target] = state[source] + envelope[target] = envelope[source] + elif op == "add": + source, sign = operation[2:4] + require(source in state and source != target and sign in (-1, 1), + "invalid scalar ADD") + if source[0] == "Z": + require(source[1] in active_zeroes, "unallocated private source") + state[target] = row_add(state[target], state[source], sign) + envelope[target] = number_add(envelope[target], envelope[source]) + elif op == "double": + state[target] = row_scale(state[target], 2, 0) + envelope[target] = number_scale(envelope[target], 2, 0) + elif op == "halve": + state[target] = row_scale(state[target], 1, 1) + envelope[target] = number_scale(envelope[target], 1, 1) + else: + require(op == "negate", "unknown scalar primitive") + state[target] = row_scale(state[target], -1, 0) + metrics.observe(state[target], envelope[target], primitive_index, target) + primitive_index += 1 + require(not active_zeroes, "live private buffers at scalar endpoint") + expected = {("L", i): ({i: 1}, 0) for i in range(n)} + for i in range(112): + target, source, sign = ((112 + i, i, 1) if orientation == "forward" + else (i, 112 + i, -1)) + expected["L", target][0][source] = sign + for kind in ("C", "Z", "W"): + for index in sizes[kind]: + expected[kind, index] = ({}, 0) + witness = difference(state, expected) + require(witness is None, f"scalar endpoint {orientation}: {witness}") + return { + "arbitrary_logical_inputs": n, + "initial_zero_registers": {"C": centers, "Z": len(zeroes), "W": 1}, + "scalar_macro_count": macro_count, + "primitive_count_per_real_component": primitive_index, + "primitive_counts_per_real_component": dict(sorted(counts.items())), + "two_real_component_count": 2 * primitive_index, + "primitive_stream_sha256": primitive_hash.hexdigest(), + "primitive_counts_by_phase": {key: dict(sorted(value.items())) + for key, value in sorted(by_phase.items())}, + "nonzero_clear_assignments": dict(sorted(nonzero_clears.items())), + "endpoint_sha256": state_digest(state), + "exact_scalar_endpoint": True, + "metrics": metrics.result(), + "scope": "Scalar projection: nonscalar events act as identity; CLEAR is an assignment. " + "This is not a physical implementation or a reversible-erasure proof.", + } + + +def produced_programs(word_path, transport, emitter, directory): + env = dict(os.environ) + env.pop("PYTHONOPTIMIZE", None) + env["PYTHONDONTWRITEBYTECODE"] = "1" + for label, source, arguments in ( + ("transport", transport, [str(word_path), str(directory)]), + ("emitter", emitter, [str(directory)]), + ): + source_bytes = source.read_bytes() + require(hashlib.sha256(source_bytes).hexdigest() == PRODUCER_HASHES[label], + "producer execution buffer hash mismatch: " + label) + bootstrap = ( + "import sys\n" + "source = sys.stdin.buffer.read()\n" + "sys.argv = sys.argv[1:]\n" + "namespace = {'__name__': '__main__', '__file__': sys.argv[0]}\n" + "exec(compile(source, sys.argv[0], 'exec', dont_inherit=True, optimize=0), namespace)\n" + ) + completed = subprocess.run( + [sys.executable, "-I", "-B", "-c", bootstrap, str(source), *arguments], + input=source_bytes, capture_output=True, env=env, timeout=120) + require(completed.returncode == 0, + label + " failed: " + completed.stderr.decode(errors="replace")) + canonical_word = read(directory / "CANONICAL-WORD.json.gz") + programs = read(directory / "LOCAL-PROGRAMS.json.gz") + producer_checks = read(directory / "LOCAL-CHECKS.json") + require(set(programs) == {"forward", "backward"}, "incomplete emitted orientations") + for orientation, events in programs.items(): + require(digest(events) == producer_checks[orientation]["sha256"], + "emitted producer hash mismatch") + return canonical_word, programs, producer_checks + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + for name in ("source-base", "source-extra", "candidate-base", "candidate-extra", + "historical-panel-base", "historical-panel-extra", + "transport-source", "emitter-source", "output"): + parser.add_argument("--" + name, type=Path, required=True) + args = parser.parse_args() + paths = {name: value.resolve() for name, value in vars(args).items()} + require(len(set(paths.values())) == len(paths), "input/output path alias") + output = paths.pop("output") + for label in ("transport", "emitter"): + actual = hashlib.sha256(paths[label + "_source"].read_bytes()).hexdigest() + require(actual == PRODUCER_HASHES[label], "producer source hash mismatch: " + label) + result = { + "status": "PASS_EXACT_FINITE_WORD_AND_SCALAR_PREFIX", + "head": HEAD, "checker_sha256": hashlib.sha256(Path(__file__).read_bytes()).hexdigest(), + "inputs": {name: file_record(path) for name, path in sorted(paths.items())}, + "providers": {}, + "scope": { + "free_operator_model": "All632 arbitrary logical inputs over dyadic free warp algebra; " + "91 private buffers initially and finally zero. Four orientations.", + "scalar_model": "Both emitted orientations lowered to charged binary-Horner scalar primitives; " + "nonscalar events are identity and CLEAR is assignment.", + "not_established": ["physical Clifford phase correctness", + "physical reversible CLEAR implementation", + "native-child internal precision", "recursive rounding", + "all-size compiler or tape cost", "new kappa"], + }, + } + with tempfile.TemporaryDirectory(prefix="c01-wholeword-") as temporary: + scratch = Path(temporary) + for provider in ("base", "extra"): + source_path = paths["source_" + provider] + candidate_path = paths["candidate_" + provider] + require(hashlib.sha256(source_path.read_bytes()).hexdigest() == SOURCE_HASHES[provider], + "historical word hash mismatch: " + provider) + source, candidate = read(source_path), read(candidate_path) + require(set(source) == set(candidate), "changed full-word key set") + require(all(source[key] == candidate[key] for key in source if key != "compensation"), + "candidate changed a field outside compensation") + panel = panel_audit(source, candidate) + historical = historical_panel_audit(source, paths["historical_panel_" + provider]) + full = {} + generated = {} + for name, word, word_path in (("source", source, source_path), + ("candidate", candidate, candidate_path)): + full[name] = audit_whole_word(word) + canonical_word, programs, producer_checks = produced_programs( + word_path, paths["transport_source"], paths["emitter_source"], + scratch / (provider + "-" + name)) + generated[name] = { + "canonical_sha256": digest(canonical_word), + "program_sha256": digest(programs), + "producer_checks": producer_checks, + "canonical_word": canonical_word, + "programs": programs, + } + old_canonical, new_canonical = (generated[name]["canonical_word"] + for name in ("source", "candidate")) + require(all(old_canonical[key] == new_canonical[key] + for key in old_canonical if key != "compensation"), + "canonical transport changed outside compensation") + scalar = {} + preserved = {} + for orientation in ("forward", "backward"): + old_events = generated["source"]["programs"][orientation] + new_events = generated["candidate"]["programs"][orientation] + old_nonscalar = [event for event in old_events if event[0] != "scalar"] + new_nonscalar = [event for event in new_events if event[0] != "scalar"] + require(old_nonscalar == new_nonscalar, "changed nonscalar event stream") + old_boundary = old_events.index(["phase", "entry_adapters"]) + new_boundary = new_events.index(["phase", "entry_adapters"]) + require(old_events[old_boundary:] == new_events[new_boundary:], + "changed post-compensation native stream") + preserved[orientation] = { + "nonscalar_events": len(old_nonscalar), + "nonscalar_sha256": digest(old_nonscalar), + "unchanged_suffix_events": len(old_events) - old_boundary, + "suffix_sha256": digest(old_events[old_boundary:]), + } + preserved[orientation]["literal_prefix_binding"] = { + name: bind_emitted_prefix( + word, generated[name]["canonical_word"], + generated[name]["programs"][orientation], + orientation == "backward") + for name, word in (("source", source), ("candidate", candidate))} + scalar[orientation] = { + name: audit_scalar_projection(generated[name]["programs"][orientation], + generated[name]["canonical_word"], orientation) + for name in ("source", "candidate")} + for name in ("source", "candidate"): + ours = scalar[orientation][name] + theirs = generated[name]["producer_checks"][orientation] + require(ours["two_real_component_count"] == + theirs["real_component_primitive_bound"], + "independent literal primitive invoice mismatch") + require(ours["scalar_macro_count"] == theirs["scalar_macros"], + "independent macro coverage mismatch") + actual_saving = ( + scalar[orientation]["source"]["primitive_count_per_real_component"] + - scalar[orientation]["candidate"]["primitive_count_per_real_component"]) + predicted_saving = ( + panel["bill"]["source"]["price_per_real_component"] + - panel["bill"]["candidate"]["price_per_real_component"]) + require(actual_saving == predicted_saving, "whole primitive bill delta mismatch") + result["providers"][provider] = { + "panel": panel, "whole_word": full, "scalar_projection": scalar, + "historical_rank_basis_panel": historical, + "native_nonscalar_stream_preservation": preserved, + "generated": {name: {key: value for key, value in row.items() + if key not in ("canonical_word", "programs")} + for name, row in generated.items()}, + } + output.parent.mkdir(parents=True, exist_ok=True) + output.write_bytes(json.dumps(result, indent=2, sort_keys=True).encode() + b"\n") + print("PASS_EXACT_FINITE_WORD_AND_SCALAR_PREFIX", output) + + +if __name__ == "__main__": + main() diff --git a/research/staged-compensation-forests/compare_prior.py b/research/staged-compensation-forests/compare_prior.py new file mode 100644 index 0000000000..68ae32541c --- /dev/null +++ b/research/staged-compensation-forests/compare_prior.py @@ -0,0 +1,126 @@ +"""One fixed PR1080 recipe-transfer check; no optimization or search.""" +import argparse +from fractions import Fraction as Q +import gzip +import hashlib +import json +from pathlib import Path + + +def require(ok, message): + if not ok: + raise ValueError(message) + + +def digest(data): + return hashlib.sha256(data).hexdigest() + + +def matrix(gates): + result = {t: {} for t in range(112, 224)} + for op, t, h, numerator, denominator, frame in gates: + require(op == "add", "addition-only source") + q = result[t].get(h, Q(0)) + Q(numerator, denominator) + if q: + result[t][h] = q + else: + result[t].pop(h, None) + return result + + +def tariff(q): + if not q: + return 0 + d = q.denominator + require(d & (d - 1) == 0, "dyadic coefficient") + a = abs(q.numerator) + return 3 + a.bit_length() - 1 + a.bit_count() + d.bit_length() - 1 + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("--prior-word", type=Path, required=True) + parser.add_argument("--prior-recipe", type=Path, required=True) + parser.add_argument("--current-word", type=Path, required=True) + parser.add_argument("--output", type=Path, required=True) + args = parser.parse_args() + require(args.output.resolve() not in + {args.prior_word.resolve(), args.prior_recipe.resolve(), args.current_word.resolve()}, + "output must not replace a frozen input") + old_bytes = args.prior_word.read_bytes() + old_payload = gzip.decompress(old_bytes) + require(digest(old_payload) == + "24db880b7dab31e6af4eec8a1aba1bbbae29cd50d9a7b77cf0e9b571b3e5ae7c", + "PR1080 original canonical word") + current_bytes = args.current_word.read_bytes() + require(digest(current_bytes) == + "735c540b1fe29d0ceeb4d2f304ec941e5f2bd3bc92bafc8cce2b4f9a67a3b653", + "PR3605 source word") + recipe_bytes = args.prior_recipe.read_bytes() + require(digest(recipe_bytes) == + "d526804d9d627cbd850b0e54c3de9aadc74646e1a9b6befb577f42240720750a", + "PR1080 frozen recipe") + recipe = json.loads(recipe_bytes) + old, current = json.loads(old_payload), json.loads(gzip.decompress(current_bytes)) + A, C = matrix(old["compensation"]), matrix(current["compensation"]) + old_support = set().union(*map(set, A.values())) + new_support = set().union(*map(set, C.values())) + require(len(old_support) == 216 and len(new_support) == 207, "support counts") + require(all((4 * a).denominator == 1 for row in A.values() for a in row.values()), + "prior quarter grid") + eighths = [(t, h, str(q)) for t, row in C.items() for h, q in row.items() + if (4 * q).denominator != 1] + require(bool(eighths), "strict current eighth-grid witness") + live = set(range(704)) - set(current["removed"]) + sources = set(recipe["sources"]) + helper_edges = recipe["helper_forest"] + touched = {recipe["sources"][i] for c, p, s, depth in helper_edges for i in (c, p)} + # This is deliberately the literal register-ID transfer. No mapping from + # historical canonical identities to current raw helper roles is assumed. + invalid = sorted(touched - live) + nonzero = sorted(touched & set(map(int, current["start_extra"]))) + nonfull = sorted(touched & set(map(int, current["helper_final"]))) + require(invalid or nonzero or nonfull, "expected direct transfer obstruction") + target_forest = recipe["target_forest"] + D = {t: dict(row) for t, row in C.items()} + for child, parent, sign, depth in target_forest: + t, p = recipe["targets"][child], recipe["targets"][parent] + for h in set(C[t]) | set(C[p]): + q = C[t].get(h, Q(0)) - sign * C[p].get(h, Q(0)) + if q: + D[t][h] = q + else: + D[t].pop(h, None) + target_cost = 8 * len(target_forest) + sum(tariff(q) for row in D.values() for q in row.values()) + output = { + "prior_pr": 1080, + "prior_head": "803e080e181229a3af2196b7a13615c9d81ae10d", + "prior_recipe_sha256": digest(recipe_bytes), + "prior_word_compressed_sha256": digest(old_bytes), + "prior_word_decoded_sha256": digest(old_payload), + "prior_targets": 112, "prior_active_helpers": len(old_support), + "prior_nonzeros": sum(map(len, A.values())), + "prior_component_price": sum(tariff(q) for row in A.values() for q in row.values()), + "current_targets": 112, "current_active_helpers": len(new_support), + "current_nonzeros": sum(map(len, C.values())), + "current_component_price": sum(tariff(q) for row in C.values() for q in row.values()), + "prior_quarter_grid": True, + "current_eighth_witnesses": sorted(eighths), + "signed_permutation_equivalence_excluded_by_grid_and_support": True, + "frozen_target_recipe_on_current_matrix_component_price": target_cost, + "frozen_helper_recipe_literal_id_transfer": { + "touched_helpers": sorted(touched), + "unavailable_removed_helpers": invalid, + "nonzero_entrance_helpers": nonzero, + "nonfull_terminal_helpers": nonfull, + "admitted_without_adapters_or_remapping": False, + }, + "scope": "One frozen source/recipe comparison. No relabeling search, general basis-equivalence obstruction, paid wrapper transfer, or global circuit optimum.", + } + args.output.write_text(json.dumps(output, sort_keys=True, indent=2) + "\n") + print("PASS_PR1080_FIXED_TRANSFER_CHECK", "target_recipe_price", target_cost, + "unavailable", len(invalid), "nonzero", len(nonzero), "nonfull", len(nonfull)) + + +if __name__ == "__main__": + main() diff --git a/research/staged-compensation-forests/construct.py b/research/staged-compensation-forests/construct.py new file mode 100644 index 0000000000..0d54e55239 --- /dev/null +++ b/research/staged-compensation-forests/construct.py @@ -0,0 +1,202 @@ +"""Deterministic same-C signed-unit MST and disjoint helper candidate. + +All arithmetic is exact on a common eighth grid. Writes only --out. +""" +import argparse, collections, fractions, gzip, hashlib, json, pathlib, subprocess +Q=fractions.Fraction +HEAD='3efbb5de06a49ffeea6684482f2d3fe48cdca3fb' +PKG='research/staged-644-660-width-reduction' +HASHES={'base':'735c540b1fe29d0ceeb4d2f304ec941e5f2bd3bc92bafc8cce2b4f9a67a3b653','extra':'886338fc32da14f3389a82c8120a1bcf9c5e2f0ec3e9b2d377fdae809e1d977f'} +def need(x,msg): + if not x: raise ValueError(msg) +def sha(b): return hashlib.sha256(b).hexdigest() +def canonical(x): return json.dumps(x,sort_keys=True,separators=(',',':')).encode() +def price(q): + if not q:return 0 + a=abs(q.numerator);d=q.denominator.bit_length()-1 + need(q.denominator==1<=maxpaths[a][b] for cost,a,b,s in edges),'MST cycle inequality') + # Different Prim graph traversal (same complete edge costs). + adjacency={i:[] for i in graph} + for cost,a,b,s in edges:adjacency[a].append((cost,b));adjacency[b].append((cost,a)) + seen={-1}; best={t:min(cost for cost,b in adjacency[-1] if b==t) for t in targets}; prim=0 + while len(seen)<113: + cost,t=min((v,t) for t,v in best.items() if t not in seen);seen.add(t);prim+=cost + for cost2,b in adjacency[t]: + if b not in seen:best[b]=min(best[b],cost2) + need(prim==sum(e[0] for e in tree),'Prim mismatch') + T=[];D={t:list(row) for t,row in zip(targets,rows)} + for t in sorted(targets,key=lambda t:(-depth[t],t)): + a,s,cost=parent[t] + if a!=-1:T.append(add(t,a,Q(-s))) + for t in targets: + a,s,cost=parent[t] + if a!=-1:D[t]=[x-s*y for x,y in zip(rows[t-112],rows[a-112])] + # Legal full-lifetime helpers only. The parent must verify the source's + # default frame interpretation against its frozen emitter. + eligible=[h for h in helpers if str(h) not in w['start_extra'] and str(h) not in w['helper_final'] and h not in w['removed']] + cols={h:[D[t][j] for t in targets] for j,h in enumerate(helpers)} + candidates=[];count=0 + for a in eligible: + for b in eligible: + if a==b:continue + old=sum(map(pi,cols[b])) + for s in (-1,1): + gain=old-sum(pi(v-s*u) for u,v in zip(cols[a],cols[b]))-8 + candidates.append((gain,a,b,s));count+=1 + positive=sorted((e for e in candidates if e[0]>0),key=lambda e:(-e[0],e[1:])) + used=set();pairs=[] + for e in positive: + gain,a,b,s=e + if a not in used and b not in used:pairs.append(e);used.update((a,b)) + H=[add(a,b,Q(s)) for gain,a,b,s in pairs] + E={t:list(row) for t,row in D.items()};index={h:j for j,h in enumerate(helpers)} + for gain,a,b,s in pairs: + for t in targets:E[t][index[b]]-=s*D[t][index[a]] + def injections(M):return [add(t,h,Q(a,8)) for t in targets for h,a in zip(helpers,M[t]) if a] + f=T+injections(D)+inverse(T) + g=T+H+injections(E)+inverse(H)+inverse(T) + def bill(gs):return {'logical_additions':len(gs),'component_primitives':sum(price(Q(z[3],z[4])) for z in gs),'coefficient_histogram':dict(sorted(collections.Counter(str(Q(z[3],z[4])) for z in gs).items()))} + original=bill(w['compensation']);fb=bill(f);gb=bill(g) + need(fb['component_primitives']==prim,'literal forest bill') + need(gb['component_primitives']==prim-sum(x[0] for x in pairs),'helper additive bill') + rec={'edge_count':len(edges),'edge_census_sha256':sha(canonical(edges)),'tree':tree,'parent':parent,'prim_cost':prim,'all_cycle_inequalities':len(edges),'roots':len([t for t in targets if parent[t][0]==-1]),'target_edges':len(T),'max_depth':max(depth.values())-1,'active_helpers':helpers,'eligible_helpers':eligible,'helper_candidate_count':count,'helper_candidates_sha256':sha(canonical(candidates)),'profitable_helpers':len(positive),'pairs':pairs,'source_frame_predicate':'helper absent from start_extra and helper_final; not removed','target_only_bill':fb,'two_sided_bill':gb,'original_bill':original,'target_residual_nonzeros':sum(map(lambda r:sum(a!=0 for a in r),D.values())),'two_sided_residual_nonzeros':sum(map(lambda r:sum(a!=0 for a in r),E.values()))} + return rec,f,g + +def endpoint(gs,live,mode): + rows={r:{r:Q(1)} for r in live} + seq=inverse(gs) if mode=='inverse' else gs + for g in seq: + t,s,q=g[1],g[2],Q(g[3],g[4]) + if mode=='dual':t,s,q=s,t,-q + plus(rows[t],rows[s],q) + return rows + +def semantic_controls(original, candidate, rec, live): + """Actual operator mutations, independent of file authentication.""" + nt=rec['target_edges']; nh=len(rec['pairs']) + ninj=rec['two_sided_residual_nonzeros'] + T=candidate[:nt]; H=candidate[nt:nt+nh] + injection=candidate[nt+nh:nt+nh+ninj] + Hi=candidate[nt+nh+ninj:nt+2*nh+ninj] + Ti=candidate[nt+2*nh+ninj:] + need(len(Hi)==nh and len(Ti)==nt,'five-stage partition') + def changed(xs,index): + ys=[list(g) for g in xs];ys[index]=list(ys[index]);ys[index][3]*=-1;return ys + mutants={ + 'omit_target_preparation':H+injection+Hi+Ti, + 'omit_target_restoration':T+H+injection+Hi, + 'parent_before_child_preparation':list(reversed(T))+H+injection+Hi+Ti, + 'omit_helper_preparation':T+injection+Hi+Ti, + 'omit_helper_restoration':T+H+injection+Ti, + 'flip_helper_preparation_sign':T+changed(H,0)+injection+Hi+Ti, + 'flip_residual_sign':T+H+changed(injection,0)+Hi+Ti, + 'flip_target_restoration_sign':T+H+injection+Hi+changed(Ti,-1), + 'stale_original_injection':T+H+original+Hi+Ti, + } + results=[] + expected={mode:endpoint(original,live,mode) for mode in ('forward','inverse','dual')} + for label,gs in mutants.items(): + bad={} + for mode in expected: + actual=endpoint(gs,live,mode) + differing=[r for r in live if actual[r]!=expected[mode][r]] + need(differing,'insensitive semantic control '+label+' '+mode) + r=differing[0]; keys=sorted(set(actual[r])|set(expected[mode][r])) + c=next(c for c in keys if actual[r].get(c,0)!=expected[mode][r].get(c,0)) + bad[mode]={'row':r,'column':c,'expected':str(expected[mode][r].get(c,0)),'actual':str(actual[r].get(c,0))} + results.append({'mutation':label,'witnesses':bad}) + # The target preparation is essential even though a helper-only test misses it. + omitted=endpoint(mutants['omit_target_preparation'],live,'forward') + outside_targets=[c for c in live if not 112<=c<224] + need(all(omitted[r].get(c,0)==expected['forward'][r].get(c,0) + for r in live for c in outside_targets),'helper-only counterexample premise') + results.append({'mutation':'omit_target_preparation', + 'helper_only_projection_passes':True, + 'projected_input_columns':len(outside_targets), + 'full_arbitrary_target_domain_rejects':True}) + return results + +def main(): + a=argparse.ArgumentParser() + source=a.add_mutually_exclusive_group(required=True) + source.add_argument('--repo',type=pathlib.Path) + source.add_argument('--source-dir',type=pathlib.Path) + a.add_argument('--out',type=pathlib.Path,required=True) + args=a.parse_args() + if args.source_dir: + source_root=args.source_dir.resolve(); output_root=args.out.resolve() + need(output_root!=source_root and source_root not in output_root.parents, + 'output must be outside frozen input directory') + args.out.mkdir(parents=True,exist_ok=True) + report={'head':HEAD,'providers':{}} + for provider in ('base','extra'): + raw=(args.source_dir/f'SOURCE-{provider}.json.gz').read_bytes() if args.source_dir else subprocess.check_output(['git','show',f'{HEAD}:{PKG}/STAGED644-660-{provider}.json.gz'],cwd=args.repo) + need(sha(raw)==HASHES[provider],'source digest');(args.out/f'SOURCE-{provider}.json.gz').write_bytes(raw) + w=json.loads(gzip.decompress(raw));C=matrix(w);rec,f,g=construct(C,w);live=sorted(set(range(704))-set(w['removed']));checks=[] + for name,gs in [('forest',f),('two-sided',g)]: + for mode in ('forward','inverse','dual'): + need(endpoint(gs,live,mode)==endpoint(w['compensation'],live,mode),'operator mismatch '+name+mode);checks.append([name,mode,len(live)]) + panel=canonical(gs);(args.out/f'{name.upper()}-COMPENSATION-{provider}.json.gz').write_bytes(gzip.compress(panel,mtime=0)) + candidate=dict(w);candidate['compensation']=gs + for key in w: + if key!='compensation':need(candidate[key]==w[key],'outside changed') + whole=canonical(candidate);(args.out/f'{name.upper()}-WORD-{provider}.json.gz').write_bytes(gzip.compress(whole,mtime=0));rec[name+'_panel_sha256']=sha(panel);rec[name+'_word_sha256']=sha(whole) + rec['semantic_controls']=semantic_controls(w['compensation'],g,rec,live) + rec['all_column_checks']=checks;rec['source_compressed_sha256']=sha(raw);report['providers'][provider]=rec + print(provider,rec['original_bill']['component_primitives'],rec['target_only_bill']['component_primitives'],rec['two_sided_bill']['component_primitives'],'pairs',len(rec['pairs']),'eligible',len(rec['eligible_helpers']),flush=True) + (args.out/'DESIGN.json').write_bytes(json.dumps(report,indent=2,sort_keys=True).encode()+b'\n') +if __name__=='__main__':main() diff --git a/research/staged-compensation-forests/controls.py b/research/staged-compensation-forests/controls.py new file mode 100644 index 0000000000..4559691ace --- /dev/null +++ b/research/staged-compensation-forests/controls.py @@ -0,0 +1,438 @@ +#!/usr/bin/env python3 +"""Compact C01 source, complete-record and mathematical acceptance controls. + +Uses external temporary fixtures. Does not rerun the whole-word scalar audit +or the all-edge/all-helper census. Prepared with substantial Codex assistance. +""" +import argparse +import copy +import gzip +import hashlib +import json +from pathlib import Path +import subprocess +import sys +import tempfile +import types + + +def require(ok, message): + if not ok: + raise ValueError(message) + + +def sha(raw): + return hashlib.sha256(raw).hexdigest() + + +def load_module(path, raw=None, name="reviewed_controls_module"): + source = path.read_bytes() if raw is None else raw + module = types.ModuleType(name) + module.__file__ = str(path) + exec(compile(source, str(path), "exec", dont_inherit=True, optimize=0), module.__dict__) + return module + + +def reject(label, action, expected, records, exact=True): + try: + action() + except (ValueError, AssertionError) as error: + message = str(error) + require(message == expected if exact else expected in message, + "wrong rejection for " + label + ": " + message) + records.append({"name": label, "intended_gate": expected}) + else: + raise ValueError("control accepted: " + label) + + +def fixture(root, files, originals=None): + root.mkdir(parents=True) + hashes, origins = {}, {} + for name, raw in files.items(): + path = root / name + path.parent.mkdir(parents=True, exist_ok=True) + path.write_bytes(raw) + hashes[name] = sha(raw) + origins[name] = {"sha256": sha(raw)} + if originals and name in originals: + origins[name]["original_sha256"] = sha(originals[name]) + (root / "FROZEN-SHA256.json").write_text(json.dumps(hashes)) + (root / "ORIGINS.json").write_text(json.dumps(origins)) + return root + + +def loader_checks(v, temporary): + positive = ( + b"import json, sys\nfrom pathlib import Path\n" + b"assert __debug__ and sys.flags.optimize == 0, 'CHILD_OPTIMIZATION'\n" + b"assert __file__ == sys.argv[0], 'SCRIPT_FILE_ARGUMENT'\n" + b"Path(sys.argv[-1]).write_text(json.dumps(sys.argv[1:-1]))\n" + ) + files = { + "script with spaces.py": positive, + "direct.py": b"assert False, 'DIRECT_ASSERT'\n", + "nested.py": b"def inner():\n assert False, 'NESTED_ASSERT'\ninner()\n", + "notfinite.json": b'{"a":NaN}', + } + root = fixture(temporary / "loader", files) + frozen, rejected = v.Frozen(root), [] + frozen.check_all() + output = temporary / "literal argument result.json" + frozen.run("script with spaces.py", ["argument with spaces", output]) + require(json.loads(output.read_text()) == ["argument with spaces"], "preserved script arguments") + for name, marker in (("direct.py", "DIRECT_ASSERT"), ("nested.py", "NESTED_ASSERT")): + reject(name, lambda name=name: frozen.run(name, []), + "AssertionError: " + marker, rejected, exact=False) + # This disposable source is changed only after Frozen.raw has returned. + # The script passed to the interpreter must remain the captured old bytes. + original_path, calls = frozen.path, {"count": 0} + def changed_path(name): + path = original_path(name) + calls["count"] += 1 + if calls["count"] == 2: + path.write_bytes(b"raise RuntimeError('REOPENED_CHANGED_SOURCE')\n") + return path + frozen.path = changed_path + try: + frozen.run("script with spaces.py", ["captured bytes", output]) + require(calls["count"] == 2 and json.loads(output.read_text()) == ["captured bytes"], + "captured authenticated source execution") + finally: + frozen.path = original_path + (root / "script with spaces.py").write_bytes(positive) + (root / "direct.py").write_bytes(b"PASS = True\n") + reject("changed_executable_source", lambda: frozen.run("direct.py", []), + "changed frozen input: direct.py", rejected) + (root / "direct.py").unlink() + reject("missing_executable_source", lambda: frozen.run("direct.py", []), + "missing regular input: direct.py", rejected) + reject("unregistered_source", lambda: frozen.run("absent.py", []), + "unregistered input: absent.py", rejected) + reject("absolute_path", lambda: frozen.path("/etc/passwd"), "unsafe package path", rejected) + reject("parent_escape", lambda: frozen.path("../outside"), "unsafe package path", rejected) + (root / "link.py").symlink_to(root / "nested.py") + reject("symlink_input", lambda: frozen.path("link.py"), + "missing regular input: link.py", rejected) + outside = temporary / "external" + outside.mkdir() + (outside / "data.json").write_text("{}") + (root / "outside").symlink_to(outside, target_is_directory=True) + reject("ancestor_symlink_escape", lambda: frozen.path("outside/data.json"), + "input escapes package", rejected) + reject("direct_runtime_requirement", lambda: v.require(False, "DIRECT_RUNTIME_GATE"), + "DIRECT_RUNTIME_GATE", rejected) + return {"rejections": rejected, "captured_source_survives_disposable_path_change": True, + "child_assertions_enabled": True, "file_and_argument_semantics_preserved": True} + + +def record_checks(v, temporary): + value = {"integer": 1, "boolean": True, "nested": {"ordered": [1, 2, 3]}} + raw = json.dumps(value).encode() + root = fixture(temporary / "record", {"expected.json": raw}) + frozen, rejected = v.Frozen(root), [] + frozen.compare("expected.json", raw) + 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={}), + "ordered_list_reorder": dict(value, nested={"ordered": [1, 3, 2]}), + "ordered_list_truncate": dict(value, nested={"ordered": [1, 2]}), + } + for label, changed in mutations.items(): + reject(label, lambda changed=changed: frozen.compare("expected.json", json.dumps(changed).encode()), + "complete typed record mismatch: expected.json", rejected) + reject("duplicate_json_key", lambda: v.data(b'{"a":1,"a":2}'), + "duplicate JSON key: a", rejected) + reject("nested_duplicate_json_key", lambda: v.data(b'{"n":{"a":1,"a":2}}'), + "duplicate JSON key: a", rejected) + for value_ in ("NaN", "Infinity", "-Infinity"): + reject("nonfinite_" + value_, lambda value_=value_: v.data(value_.encode()), + "nonfinite JSON constant: " + value_, rejected) + (root / "expected.json").unlink() + reject("missing_expected_record", lambda: frozen.compare("expected.json", raw), + "missing regular input: expected.json", rejected) + require(not (root / "expected.json").exists(), "missing expected record regenerated") + (root / "expected.json").write_bytes(raw) + saved = v.require + try: + v.require = lambda ok, message: None if message.startswith("complete typed record mismatch:") else saved(ok, message) + try: + reject("deleted_record_gate", + lambda: frozen.compare("expected.json", json.dumps(mutations["boolean_for_integer"]).encode()), + "complete typed record mismatch: expected.json", []) + except ValueError as error: + require(str(error) == "control accepted: deleted_record_gate", "record check-deletion sensitivity") + else: + raise ValueError("record check deletion not detected") + finally: + v.require = saved + return {"rejections": rejected, "named_record_gate_deletion_detected": True} + + +def compression_checks(v, temporary): + name, plain = "original.json.gz", b'{"original":[1,2,3]}\n' + root = fixture(temporary / "compression", {name: gzip.compress(plain, mtime=0)}, {name: plain}) + frozen, rejected = v.Frozen(root), [] + frozen.check_all() + changed = gzip.compress(b'{"original":[1,2,4]}\n', mtime=0) + (root / name).write_bytes(changed) + reject("changed_compressed_input", frozen.check_all, + "changed frozen input: " + name, rejected) + frozen.hashes[name] = sha(changed) + reject("changed_container_origin", frozen.check_all, + "origin digest mismatch: " + name, rejected) + frozen.origins[name]["sha256"] = sha(changed) + reject("changed_original_after_transport_rebinding", frozen.check_all, + "original decoded bytes changed: " + name, rejected) + same = gzip.compress(plain, mtime=17) + (root / name).write_bytes(same) + frozen.hashes[name] = frozen.origins[name]["sha256"] = sha(same) + frozen.check_all() + saved = frozen.origins + frozen.origins = {} + reject("omitted_origin", frozen.check_all, "frozen/origin inventory mismatch", rejected) + frozen.origins = saved + return {"rejections": rejected, "equivalent_recompression_accepted": True} + + +def coverage_checks(v, temporary): + rejected, counts = [], {} + for stage in ("construction", "forest", "wholeword"): + names = sorted(v.expected_records(stage)) + v.check_coverage(stage, names) + counts[stage] = len(names) + reject(stage + "_omission", lambda: v.check_coverage(stage, names[1:]), + "complete stage record coverage changed: " + stage, rejected) + reject(stage + "_duplicate", lambda: v.check_coverage(stage, names + names[:1]), + "complete stage record coverage changed: " + stage, rejected) + reject(stage + "_extra", lambda: v.check_coverage(stage, names + ["unexpected.json"]), + "complete stage record coverage changed: " + stage, rejected) + require(counts == {"construction": 13, "forest": 1, "wholeword": 1}, "stage inventory counts") + # Invoke the real dispatch code with a non-mathematical output fixture. + class GeneratedFixture: + def __init__(self, extra=False, omit=None): + self.root, self.compared, self.extra, self.omit = temporary, [], extra, omit + def run(self, script, arguments): + if script == "construct.py": + output = Path(arguments[arguments.index("--out") + 1]) + output.mkdir() + names = set(v.construction_names()) | ({"unexpected.json"} if self.extra else set()) + for name in names: + (output / name).write_text("{}") + else: + Path(arguments[arguments.index("--output") + 1]).write_text("{}") + def compare(self, name, raw): + if name != self.omit: + self.compared.append(name) + for stage in ("construction", "forest", "wholeword"): + scratch = temporary / ("dispatch-" + stage) + scratch.mkdir() + f = GeneratedFixture() + getattr(v, stage)(f, scratch) + v.check_coverage(stage, f.compared) + scratch = temporary / "dispatch-extra" + scratch.mkdir() + reject("extra_generated_construction_artifact", + lambda: v.construction(GeneratedFixture(extra=True), scratch), + "construction output inventory changed", rejected) + scratch = temporary / "dispatch-omission" + scratch.mkdir() + f = GeneratedFixture(omit="artifacts/DESIGN.json") + v.construction(f, scratch) + reject("deleted_actual_compare_call", lambda: v.check_coverage("construction", f.compared), + "complete stage record coverage changed: construction", rejected) + saved = v.require + try: + v.require = lambda ok, message: None if message.startswith("complete stage record coverage changed:") else saved(ok, message) + try: + reject("deleted_coverage_gate", lambda: v.check_coverage("construction", f.compared), + "complete stage record coverage changed: construction", []) + except ValueError as error: + require(str(error) == "control accepted: deleted_coverage_gate", "coverage deletion sensitivity") + else: + raise ValueError("coverage check deletion not detected") + finally: + v.require = saved + return {"rejections": rejected, "stage_counts": counts, + "real_dispatch_with_tiny_fixtures_passes": True, + "named_coverage_gate_deletion_detected": True} + + +def mathematical_checks(v, package): + frozen = v.Frozen(package) + mst = load_module(package / "independent_mst.py", frozen.raw("independent_mst.py")) + source = v.data(frozen.raw("frozen/inputs/SOURCE-base.json.gz")) + panel = v.data(frozen.raw("artifacts/TWO-SIDED-COMPENSATION-base.json.gz")) + helpers = {event[2] for event in source["compensation"]} + C = mst.sparse_matrix(source["compensation"], helpers) + live = sorted(set(range(704)) - set(source["removed"])) + expected = mst.expected_endpoint(C, live, "forward") + mst.complete_endpoint_gate(mst.endpoint(panel, live, "forward"), expected) + changed = copy.deepcopy(panel) + changed[0][3] *= -1 + actual = mst.endpoint(changed, live, "forward") + witness = mst.defect(actual, expected) + require(witness is not None, "actual target-basis sign mutation ineffective") + rejected = [] + reject("actual_target_basis_sign", lambda: mst.complete_endpoint_gate(actual, expected), + "complete arbitrary-input panel endpoint", rejected) + saved = mst.require + try: + mst.require = lambda ok, message: None if message == "complete arbitrary-input panel endpoint" else saved(ok, message) + try: + reject("deleted_actual_endpoint_gate", lambda: mst.complete_endpoint_gate(actual, expected), + "complete arbitrary-input panel endpoint", []) + except ValueError as error: + require(str(error) == "control accepted: deleted_actual_endpoint_gate", "actual endpoint deletion sensitivity") + else: + raise ValueError("actual endpoint check deletion not detected") + finally: + mst.require = saved + return {"rejections": rejected, "actual_authenticated_candidate": True, + "all_arbitrary_input_columns": len(live), "witness": witness, + "named_endpoint_gate_deletion_detected": True} + + +def nested_producer_checks(v, package, temporary): + frozen = v.Frozen(package) + whole = load_module(package / "check_word.py", frozen.raw("check_word.py")) + transport = temporary / "fixture transport.py" + emitter = temporary / "fixture emitter.py" + transport_raw = ( + b"from pathlib import Path\nimport gzip,json,sys\n" + b"assert __debug__ and sys.flags.optimize == 0, 'NESTED_OPTIMIZATION'\n" + b"p=Path(sys.argv[2]);p.mkdir()\n" + b"(p/'CANONICAL-WORD.json.gz').write_bytes(gzip.compress(b'{}',mtime=0))\n" + ) + emitter_raw = ( + b"from pathlib import Path\nimport gzip,json,sys,hashlib\n" + b"p=Path(sys.argv[1]);h=hashlib.sha256(b'[]').hexdigest()\n" + b"(p/'LOCAL-PROGRAMS.json.gz').write_bytes(gzip.compress(json.dumps({'forward':[],'backward':[]}).encode(),mtime=0))\n" + b"(p/'LOCAL-CHECKS.json').write_text(json.dumps({k:{'sha256':h} for k in ['forward','backward']}))\n" + ) + transport.write_bytes(transport_raw) + emitter.write_bytes(emitter_raw) + whole.PRODUCER_HASHES = {"transport": sha(transport_raw), "emitter": sha(emitter_raw)} + class ChangedAfterRead: + def __init__(self, path, raw): + self.path, self.raw, self.reads = path, raw, 0 + def __str__(self): + return str(self.path) + def read_bytes(self): + self.reads += 1 + self.path.write_bytes(b"raise RuntimeError('NESTED_REOPENED_SOURCE')\n") + return self.raw + changing = ChangedAfterRead(transport, transport_raw) + whole.produced_programs(temporary / "unused-word.json", changing, emitter, temporary / "nested-output") + require(changing.reads == 1, "nested producer capture was not reached") + bad = b"def inner():\n assert False, 'NESTED_PRODUCER_ASSERT'\ninner()\n" + transport.write_bytes(bad) + whole.PRODUCER_HASHES["transport"] = sha(bad) + rejected = [] + reject("nested_producer_assertion", + lambda: whole.produced_programs(temporary / "unused-word.json", transport, emitter, + temporary / "nested-never-written"), + "AssertionError: NESTED_PRODUCER_ASSERT", rejected, exact=False) + whole.PRODUCER_HASHES["transport"] = sha(transport_raw) + reject("nested_producer_changed_source", + lambda: whole.produced_programs(temporary / "unused-word.json", transport, emitter, + temporary / "nested-never-written"), + "producer execution buffer hash mismatch: transport", rejected) + return {"rejections": rejected, "nested_captured_source_survives_path_change": True, + "nested_producer_assertions_enabled": True} + + +def real_records(v, package): + frozen = v.Frozen(package) + names = sorted(set().union(*(v.expected_records(stage) + for stage in ("construction", "forest", "wholeword")))) + 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 index, child in enumerate(value): + yield from leaves(child, path + (index,)) + else: + yield path, value + records = [] + for name in names: + raw = frozen.raw(name) + value = v.data(raw) + frozen.compare(name, json.dumps(value).encode()) + path, old = max(leaves(value), key=lambda item: len(item[0])) + require(len(path) > 1, "actual record nested coverage") + changed, omitted = copy.deepcopy(value), copy.deepcopy(value) + parent, deletion_parent = changed, omitted + for key in path[:-1]: + parent, deletion_parent = parent[key], deletion_parent[key] + parent[path[-1]] = not old if type(old) is bool else old + 1 if type(old) is int else {"changed": True} + del deletion_parent[path[-1]] + rejected = [] + for label, candidate in (("nested_mutation", changed), ("nested_omission", omitted)): + reject(label, lambda candidate=candidate: frozen.compare(name, json.dumps(candidate).encode()), + "complete typed record mismatch: " + name, rejected) + records.append({"record": name, "sha256": sha(raw), "nested_path": list(path), + "rejections": rejected}) + require(len(records) == 15, "all fifteen complete records") + return records + + +def child(package): + v = load_module(package / "verify.py") + v.Frozen(package).check_all() + with tempfile.TemporaryDirectory(prefix="c01-compact-controls-") as directory: + temporary = Path(directory) + result = { + "loader": loader_checks(v, temporary), + "record_gate": record_checks(v, temporary), + "compression": compression_checks(v, temporary), + "coverage": coverage_checks(v, temporary), + "actual_mathematics": mathematical_checks(v, package), + "nested_producers": nested_producer_checks(v, package, temporary), + "real_records": real_records(v, package), + } + v.Frozen(package).check_all() + return {"parent_optimization": sys.flags.optimize, **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.output: + require(not args.output.resolve().is_relative_to(package), "control output must be external") + if args.child: + print(json.dumps(child(package), sort_keys=True)) + return + names = ["verify.py", "independent_mst.py", "check_word.py", + "FROZEN-SHA256.json", "ORIGINS.json"] + before = {name: sha((package / name).read_bytes()) for name in names} + results = [] + for optimized in (False, True): + command = [sys.executable, "-I", "-B"] + (["-O"] if optimized else []) + command += [str(Path(__file__).resolve()), "--package", str(package), "--child"] + completed = subprocess.run(command, capture_output=True, text=True) + require(completed.returncode == 0, completed.stdout + completed.stderr) + results.append(json.loads(completed.stdout)) + require(before == {name: sha((package / name).read_bytes()) for name in names}, + "reviewed source changed during controls") + comparable = [{key: value for key, value in run.items() if key != "parent_optimization"} + for run in results] + require(comparable[0] == comparable[1], "normal and optimized control receipts differ") + result = {"status": "PASS_C01_COMPACT_SOURCE_AND_MATHEMATICAL_GATES", + "source_hashes": before, "runs": results, + "normal_and_optimized_receipts_equal_except_mode": True, + "full_wholeword_or_edge_census_replayed": False, + "actual_single_compensation_panel_replayed": True, "no_new_kappa": True} + if args.output: + args.output.write_text(json.dumps(result, sort_keys=True, indent=2) + "\n") + print(json.dumps(result, sort_keys=True)) + + +if __name__ == "__main__": + main() diff --git a/research/staged-compensation-forests/frozen/history/C01-PROOF.md b/research/staged-compensation-forests/frozen/history/C01-PROOF.md new file mode 100644 index 0000000000..0644f6b475 --- /dev/null +++ b/research/staged-compensation-forests/frozen/history/C01-PROOF.md @@ -0,0 +1,244 @@ +# A shared compensation basis, and a bounded factory screen + +Status: locally checked finite construction and scoped negative screen. The +compensation word is exact and reduces a finite scalar bill. Its recursive +histogram is unchanged, so this work establishes no new conditional kappa. +No public action, repository edit, native replay or full release was performed. + +## Pins and input contract + +The immutable comparator is PR3605 head +`3efbb5de06a49ffeea6684482f2d3fe48cdca3fb`, scientific commit +`c006ddb034f5efcb0706a5d8207d38c367a99ace`, under canonical guidance +`20ecf2891d80b5acf18d980b2164fb44ea7faa90`. The two source blobs are +`research/staged-644-660-width-reduction/STAGED644-660-{base,extra}.json.gz`. +Their compressed SHA256 pins are respectively +`735c540b1fe29d0ceeb4d2f304ec941e5f2bd3bc92bafc8cce2b4f9a67a3b653` and +`886338fc32da14f3389a82c8120a1bcf9c5e2f0ec3e9b2d377fdae809e1d977f`. +The predecessor local package is `ac92a027c78b0c9bb0ada739b26959afda489d0e`; +its PR3133 word source is `51eb9c4ee9e4722010d308aa3309e039d3940cc2`. + +All 632 live source, target and helper inputs are arbitrary independent module +elements over the dyadic rationals. No helper is initialized to zero by this +rewrite. The source's 91 private cleanup buffers retain their zero-input and +zero-output contract. There are 112 targets and 408 actual live helper roles; +the historical R=480 field includes 72 removed identities. The ordered ports, +centers, native charts, helper identities, entrances and ends are unchanged. + +## Actual combined word and current compensation pullback + +Let y be the 112 target coordinates and z the other raw live coordinates at +the existing frame-zero compensation interface. The old word is + + (y,z) -> (y+Cz,z). + +Its 5736 literal additions aggregate to a rational matrix C of rank 56 on 207 +nonzero helper columns, in both providers. A 14-block division into the actual +eight-consecutive-target address ranges has summed block ranks 104. That sum +does not equal the joint rank and cannot be used to price independent bases. + +Choose 56 actual rows of C as a basis. For each remaining row write +`C_r = sum_s b_rs C_s`, where s runs over the chosen target rows. The producer +tries four fully specified row orders and selects the least literal gate +count among the dyadic bases obtained. Define E by + + y_r -= sum_s b_rs y_s (nonbasis r), + y_s unchanged (basis s). + +The support is bipartite: basis rows are never changed and nonbasis rows are +never read. Thus E is invertible and the inverse consists of the negated gates +in reverse order. Here E needs exactly 56 unit-coefficient additions. Every +one of these additions crosses two of the displayed eight-target ranges. +For example, the exact current rows satisfy + + C_125 = C_139 + C_190, C_133 = -C_123. + +Consequently the two beginning updates to target125 are +`125 -= 139; 125 -= 190`. Its correction is then supplied by the shared basis +rows and the final inverse updates. The already arbitrary dirt in targets +139 and 190 cancels exactly when E is reversed. + +Replace only the compensation section by the chronological word + + y <- E y; + y <- y+(E C)z; + y <- E^-1 y. + +The new correction is EC at this *current target-basis cut*. Using C there +would be a stale pullback. Direct multiplication gives + + E^-1(Ey+ECz) = y+Cz. + +The other live coordinates are fixed throughout. This block identity is valid +on arbitrary inputs over every dyadic module. Every independent noncommuting +invertible warp in the surrounding supplier is retained literally; the changed +subword is already equal before any surrounding operator is composed. It does +not assume commuting or identical warp operators. + +`SHARED-COMPENSATION-{base,extra}.json.gz` contains the entire new subword. +The replacement is identical in both providers, with decompressed SHA256 +`9f242abd5d2ed46a2e95dad46449d1d77c6fec330b5e0db6b324ac93fe756e62`. +`SHARED-WORD-{base,extra}.json.gz` contains each complete changed supplier. +All other fields, including the 5222-gate literal inverse cleanup, are copied +unchanged from the pinned word. The target-only replacement has the same full +interface, so the old helper row/column identities, arbitrary entering dirt +restoration and 91 cleared private buffers remain exactly the same. + +The inverse of the new subword is obtained by reversing it and inverting every +addition; equivalently it is E, followed by `-(EC)z`, followed by E^-1. The +same-chronology inverse-transpose has block response `z <- z-C^T y`. The +independent checker executes every literal gate in both orientations on all +632 input columns. The producer also rejects a stale C pullback and a missing +inverse basis gate; the independent checker rejects a literal final-gate sign +defect in both orientations. + +## Complete changed bill + +All new operations are at the existing frame-zero compensation interface. +The source transport and normalized wrapper words are retained with their +original constant charges. This does not make those charges zero. + +| Component | old additions | new additions | +| --- | ---: | ---: | +| Target basis E | 0 | 56 | +| Helper-to-target correction | 5736 | 3102 | +| Inverse target basis | 0 | 56 | +| Total | 5736 | 3214 | + +There are no added scale gates, helper roles, zero buffers, source queries, +native warps, or recursive children. The local profile remains +`{1:2439,2:726,3:224,4:102,5:20,8:8}` and the ordered helper widths remain +`{4:26,5:2,6:18,7:52,8:97,9:213}`. Thus Delta H=0, every helper-width delta +is zero, and the complete recursive moment is unchanged for every exponent. + +Under the stipulated cleared-work component price + + p(a/2^d) = 3 + floor(log2|a|) + popcount(|a|) + d + +for a reduced nonzero dyadic coefficient, the exact bill in *each* forward +or inverse-transpose orientation is + +| Component | primitive cost per real component | +| --- | ---: | +| Old compensation | 31214 | +| New basis | 224 | +| New correction | 16886 | +| New inverse basis | 224 | +| New total | 17334 | +| Difference | -13880 | + +With two real components, old/new totals are 62428/34668 and the saving is +27760 cleared-work primitives. The 112 total basis additions cost 448 per +component, or 896 across both real components, and are included above. The +entire signed coefficient histograms are in `INDEPENDENT-SHARED.json`; no +coefficient-changing operation is priced by logical-gate count alone. + +## Prefix bounds and remaining numerical gate + +The following are exact maximum prefix matrix norms for this component, from +the identity on the 632 live coordinates, including E and its inverse. + +| orientation | old max norm1 | new max norm1 | old/new max norm-infinity | +| --- | ---: | ---: | ---: | +| forward | 79 | 79 | 151/4 | +| inverse-transpose | 151/4 | 153/4 | 79 | + +The literal reverse-inverse word has the same new bounds in the respective +orientations. Every exact prefix coefficient has denominator dividing 2^3; +the maximum reduced numerator bit length is three. These depth bounds match +the old component. The dual norm1 increase of 1/2 is real. The *whole supplier* +prefix, adjoint weights, rounded grid reserve and finite controller/tape bill +have not been rebound to the replacement. These component bounds alone do +not certify an existing whole-word precision reserve. + +## Bounded factory and complement screens + +These screens were chosen to test a premise beyond the prior fixed584/590 +recovery and enlarged644/660 entrance routes. They do not imply a universal +source-factory obstruction. + +First, the exact full non-target maps P and P^-1 were computed over the free +group algebra of all independent warp letters. For every selected low-frame +output pool I and protected input set J, scalar row/column annihilation is +expanded separately for every formal operator word before taking rational +kernels. This is not a scalar projection of noncommuting operators. + +An equal-clean source/copy exchange whose row difference involves only cold +inputs preserves P[:,J], provided J protects true sources and entering helper +dirt and the suffix is fixed. A cold-only invertible input premix also preserves +that block. Hence these changes cannot enlarge L=leftker(P[I,J]). At the +current rank-four pools all 26 rows are already saturated. Every current pool +through rank seven has rank(LK)=dim L, so a swap-only change at those exact +pools cannot add a direction. A general changed complementary clean basis or +changed suffix falls outside this observation. + +The paid-tail screen protects all 91 existing ended helper inputs and excludes +their output rows, so it cannot re-count an existing end. Among the 100 +distinct joins of two current rank-six last frames having rank at most seven, +every complete low-supported pool has L=0. No cold direction is available by +only changing the cold input basis and appending a tail at these joins. +`JOIN-SCREEN.json` contains every exact pool and pairing dimension. + +The genuinely changed complement screen uses the 28 independent A-end +two-coordinate source pairs. Eight pairs have a native warp on a changed wire +and are excluded. For each of the other 20 pairs it inserts an invertible T +after A and conjugates *every* subsequent cut/B/restore read and producer by +T, retaining all warp letters on other wires. For an outside read the new +coefficient row is the old row times T^-1; for a producer it is T times the old +column. Mutable cells therefore remain in the current basis at every use. +Read combinations are merged only by checked commuting transpositions and +never across a warp sentinel. All old helper identities remain identities +under this change because the final non-target map is T P on the two source +rows only. Its cleanup is the reverse-inverse of the complete changed +non-target word, with the same ended-helper substitutions; an inherited old +cleanup is not asserted for a rejected candidate. + +The finite domain consists of the 20 original-coordinate bases and, for each +pair, both triangular shears with coefficient in +`{-4,-2,-1,-1/2,1/2,1,2,4}`: 340 candidates per provider. All 680 complete +forward contact patterns fail monotone native frames with the old target +cuts, native charts, 91 helper ends and chronological order retained. +`FRAME-WITNESSES.json.gz` stores a concrete increasing contact path for every +case, including the forced direction and endpoint cap. An independent small +GF(2) verifier checks consecutive shared-register contacts and a separating +normal at the endpoint. `FRAME-WITNESS-SUMMARY.json` records the exact domain +and decompressed witness hash. An arbitrary larger GL basis, changed chart, +target endpoint, source assignment or whole consumer network is not excluded. +Rejected candidates have no admitted paid profile; unknown adapter/native +costs are not assigned zero. + +## Reproduction and attribution + +The positive construction and independent check use Python's standard library: + + python3 -B shared_compensation.py + python3 -B check_shared.py + +The source blobs must be present at the exact Git head above. The screen scripts +reuse the frozen source frame engine, with its exact path and source pins in +the preserved script imports, and the existing local venv only for mpmath. +`frame_witnesses.py` rechecks the literal path certificates without relying on +the optimizer's cost output. `MANIFEST.json` binds the local evidence files. + +PR2857/Yiyang Lu's shared compensation-kernel method and PR2894/Jeremy Kothe's +preload composition are separate predecessor mechanisms. PR2696/Mason Hale and +PR2751/Tekalign supply the exact dirty source-recovery lessons. The historical +Gauge44 source/copy and complementary-basis construction is credited to +icekylinx with OpenAI GPT-6 Astra assistance, with its PR531/PR635/AtomScout and +native lineage retained. None of those historical results certifies this +changed word. The actual present source is dcharb78's PR3133 and Ross +Richardson's PR3605, with all credits and notices in their pinned packages. + +The new local contribution is the emitted shared target-basis compensation +word, its exact cleared-work and prefix bill, and this bounded full-suffix +conjugation screen. Prepared with substantial OpenAI Codex assistance. Separate +AI checks do not constitute independent human review or formal-kernel proof. + +Possible standalone publication requires checking the prior compensation +forest and two-sided target-basis literature against these exact words and +binding the whole finite scalar/numerical invoice. `PUBLICATION-OVERLAP-LEADS.json` +records cache leads, not novelty evidence. No publication is promised. Native +phase/compiler binding, whole-word precision, owner/physical admission, all-size +compiler/source access/hosting, SCALAR/COPY/CLEAR allocation, finite tape costs, +recursive rounding, bootstrap/PR559 recovery/analytic transfer and BIT H1-H5 +remain at their inherited scope. This work does not alter the selected record. diff --git a/research/staged-compensation-forests/frozen/inputs/HISTORICAL-base.json.gz b/research/staged-compensation-forests/frozen/inputs/HISTORICAL-base.json.gz new file mode 100644 index 0000000000..4c0905b320 Binary files /dev/null and b/research/staged-compensation-forests/frozen/inputs/HISTORICAL-base.json.gz differ diff --git a/research/staged-compensation-forests/frozen/inputs/HISTORICAL-extra.json.gz b/research/staged-compensation-forests/frozen/inputs/HISTORICAL-extra.json.gz new file mode 100644 index 0000000000..4c0905b320 Binary files /dev/null and b/research/staged-compensation-forests/frozen/inputs/HISTORICAL-extra.json.gz differ diff --git a/research/staged-compensation-forests/frozen/inputs/SOURCE-base.json.gz b/research/staged-compensation-forests/frozen/inputs/SOURCE-base.json.gz new file mode 100644 index 0000000000..dc6d321b1e Binary files /dev/null and b/research/staged-compensation-forests/frozen/inputs/SOURCE-base.json.gz differ diff --git a/research/staged-compensation-forests/frozen/inputs/SOURCE-extra.json.gz b/research/staged-compensation-forests/frozen/inputs/SOURCE-extra.json.gz new file mode 100644 index 0000000000..78e7b2bb06 Binary files /dev/null and b/research/staged-compensation-forests/frozen/inputs/SOURCE-extra.json.gz differ diff --git a/research/staged-compensation-forests/frozen/notices/CREDITS.md b/research/staged-compensation-forests/frozen/notices/CREDITS.md new file mode 100644 index 0000000000..24f00912d4 --- /dev/null +++ b/research/staged-compensation-forests/frozen/notices/CREDITS.md @@ -0,0 +1,19 @@ +# Credits + +- **PR #2908, Jeremy Diviney**: the paired input/output extraction, its compensation rule `C*S`, the exact two-sided certificate (`structure.py`, vendored unchanged) and the closed-adapter admission chain. +- **PR #2917, Mason Hale**: the nine paired extractions and 82-endpoint words under PR2942, the refit/compose producer model that stage 2 follows, the T74 chronology (ORDER/DISPATCH), the allocation checker, moment auditor, extension stage and adapter derivation reused here. +- **PR #2957 / #2948 / #2966, Jeremy Kothe (jeremykothe2)**: the fourteen declared exactness-preserving gate rewrites in five classes (R-retime, A3779-cut-start-read, PM-carrier-lender-entry, B-carrier-retime, A-commuting-swap) and their pure applier (`vendor/declared_rewrites.py`, vendored unchanged); stage 3 composes exactly these rewrites onto this package's stage-2 word (`data/REWRITES-2957.json`, re-addressed with exact preimages). PR2966 composed the same rewrites onto our PR2942 words. +- **PR #2969, Dugongue**: the PR2942 + PR2957 composition at T370 and its cap-level headline nomination, this package's comparator and moment baseline (`allocation/baseline/`). Our stage 3 composes the same fourteen rewrites, here onto the stage-2 word. +- **PR #2918 (research/helper408-rank7-pairing), RossRichardson**: the fixed-cut rank-seven obstruction for helper408; this package's census of fresh rank-7 extractions reproduces it exactly and is consistent with it. +- **PR #2894 / #2833, Jeremy Kothe**: the preload re-synthesis supplier, the frame accounting and inverse-reverse cleanup (`vendor/preload_move.py`), the source materializer and the inherited supplier lineage. +- **PR #2857 / #2848, Yiyang Lu (Lyy-iiis)**: the shared-kernel words, the staged native/overlay tooling and the chronological flow model and realization (edge colouring) used to construct the allocation; PR2843 (Marius-Paul Dumitrean) is that flow model's starting point. +- **PR #2863 / #2839, Dugongue**: the packing lineage and the PR2839 owner engine. +- **Tekalign**: the independent owner/chronology checker (`allocation/vendor/independent_owners.py`) and admission tooling. +- **icekylinx**: the exact free-operator auditor retained as `vendor/audit_local.py` (PR2833). +- **themilkman216**: the observation that a cap-level allocation of these inventories needs a T whose basic counts are integral, which the allocation's degenerate-face step builds on. +- **Gareth Davidson (bitplane), PR #1995 / #2013**: the fixed-word terminal-subspace bounds that frame stage 1's scope; earlier rank-seven helper ends on other words are in `research/complex-rank7-end-pair`, `research/k8-rank7-composition` and the PR1090/PR1104 lineage (credited there). +- **PR #2930 / #2942, Marius-Paul Dumitrean**: the cap allocation of PR2917's words, the four normal-45 extractions under these words, the relaxation tools and the overlay/producer conventions reused here. +- **PR #2979, Marius-Paul Dumitrean (with substantial AI assistance from Anthropic Claude via Claude Code)**: the codimension-2 census on paired-extraction words, the joint end-frame lowering of 22 restored helpers in five groups (stage 1), the five further extractions it makes profitable (stage 2), the exact composition with PR2957's rewrites (stage 3), the producer and local verification for all three stages, the overlay stage `rank7-joint-endframes` with its rebuild guards, the adapter generalization to six width classes, the literal T74 allocation of the changed inventory, its relaxation certificates and recorded gap, and the complete fresh replay. +- **PR #3015, Jeremy Kothe (jeremykothe2)**: the declared literal edit stage (`edits/`, `tools/build_edits.py`) with its independent review (`edits/edits_review.py`), and edit R1 on PR #2979's restore section (carrier 61 for register 63). +- **PR #3042, dcharb78 (with AI assistance)**: the six restore carrier/pivot skips (`R1_E42` at `restore[162:188]`, `26 -> 33` gates skipping `{22, 40, 54, 63}`, and `R2_E7` at `restore[190:203]`, `13 -> 15` gates skipping `{5, 73}`) on PR #2979's words that serve as the direct starting words for `B_586_438` and `B_588_440`. +- **New here (dcharb78, with AI assistance)**: the two coupled `B` + `restore` dying-helper carrier folds (`B_586_438` and `B_588_440`, `6` hunks / `6 -> 5` gates each) and `helper_final` lowerings on entering helpers `586` ($E_{30} \to V_{30,76,82}$) and `588` ($E_{30} \to V_{30,97,127}$) shifting the helper width inventory from `{4:26, 5:2, 6:16, 7:52, 8:99, 9:213}` to `{4:26, 5:2, 6:18, 7:50, 8:99, 9:213}` (`+665` net profit per helper, `+1,330` joint), the literal `T74_optimal_idle39` allocation (`allocation/FILL.json.gz`), the 21-control per-word edit review (`edits/edits_review.py`) and 100-control four-stage replay (`verify.py`), and the re-derived paid profile, cap certificate (`certificates/RELAX-CAP.json`), and complete fresh-native admission and release receipts. PR #2979 (mdumitrean), PR #3015 (jeremykothe2), and PR #3042 (dcharb78) are credited first. diff --git a/research/staged-compensation-forests/frozen/notices/LICENSE b/research/staged-compensation-forests/frozen/notices/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/staged-compensation-forests/frozen/notices/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/staged-compensation-forests/frozen/notices/NATIVE-LINEAGE-NOTICE b/research/staged-compensation-forests/frozen/notices/NATIVE-LINEAGE-NOTICE new file mode 100644 index 0000000000..380e979f0e --- /dev/null +++ b/research/staged-compensation-forests/frozen/notices/NATIVE-LINEAGE-NOTICE @@ -0,0 +1,14 @@ +Anticipatory dirty borrowing: PR2226 (Cinna Davis / 1337isnot1337, with substantial OpenAI Codex assistance) is credited first. Its alias rule, changed-reference K_G handoffs, initial compensation and exact free-operator replay (vendored under new/code/borrow/vendor, see new/code/borrow/NOTICE-PR2226.md) are applied here to the T74 pivot-566+554 words; the native lowering, window-exact owner fill and independent audit of the borrow words are new in this package. Bootstrap carried-cutoff repair: PR1956 (Josie Elliston); Lemma G label/adapter checks and X/Y/Z mutants: PR1964 (thakrarsagar), extended here with borrow warp/zero-buffer controls. + +New research prepared by Rohan Arun with substantial OpenAI Codex assistance. Apache-2.0. Parent words and build recipe method derive from Jeremy Kothe PR1274 and Rohan Arun PR1218, with lineage credited in README.md. All inherited mathematical qualifications are retained. +Additional pivot555 and567 composition by Rohan Arun with substantial OpenAI Codex assistance. + +T74 exact-fill owner construction by Rohan Arun with substantial OpenAI Codex assistance. + +PR1377 grid refinement credited to Jeremy Kothe. Outer witness refinement by Rohan Arun with OpenAI Codex assistance; construction unchanged. + +Pivot-566 kernel, words, edits, rebuild.py and rebind.py: PR1625 (mdumitrean). Endpoint/outer-witness stacking, fine_cache.py and oracle stage by jeremykothe2 with oh-my-pi assistance. + +The preceding paragraphs are inherited source notices, not attribution of this derivative. +This joint twelve-source construction, generator, independent replay, hosting composition and package: Tekalign (@tekuuu), with substantial OpenAI Codex assistance. No independent human review claimed. +Credits: Cinna Davis/PR2226 anticipatory dirty borrowing; Tekalign/PR2436 four lifted targets; Jeremy Kothe/PR2462,2588,2673 source pipeline, source-label swap and order/fill; zxv/PR2530 eight aliases; Mason Hale/PR2696 concentrated source-partner assignment and independent local interpreter; Philippe Van Velzen/PR2559,2679 evacuation, six pre-life hosts and refit/alias; themilkman216/PR2621 priority order; Marius-Paul Dumitrean/PR2733 independent concentrated/pre-life composition; Vlado Vojdanovski/PR2322 generator utilities. PR2720's fixed-old-path cut obstruction motivates the changed premise. The retained owner/native/bit/modern outer lineage and their notices remain in the pinned source. New work Apache-2.0. diff --git a/research/staged-compensation-forests/frozen/notices/NOTICE b/research/staged-compensation-forests/frozen/notices/NOTICE new file mode 100644 index 0000000000..89c20926ea --- /dev/null +++ b/research/staged-compensation-forests/frozen/notices/NOTICE @@ -0,0 +1,28 @@ +research/rank7-joint-endframes +Copyright 2026 Marius-Paul Dumitrean. Licensed under the Apache License, Version 2.0. +Prepared with substantial AI assistance (Anthropic Claude, via Claude Code). + +This package retains, byte-identical, Apache-2.0 files from: PR #2942 (Marius-Paul Dumitrean, head +a027b0f6fdb0ab2b42ba10fc31b53960166bf2bf, research/paired-extension-normal45): data/PARENT-base.json.gz and +data/PARENT-extra.json.gz (its data/WORD-*.json.gz), comparators/PR2942-CLAIM.json and tools/wordedit.py; PR #2917 +(Mason Hale, head 224bd5e56041c40078ff6b5fa7393733a215de5c, research/paired-helper-extension): structure.py (Jeremy +Diviney's PR2908 two-sided certificate checker), vendor/audit_local.py (PR2833's independent exact auditor, icekylinx +attribution), vendor/preload_move.py (Jeremy Kothe's PR2894 frame accounting and cleanup), allocation/ORDER.json, +allocation/DISPATCH.json and allocation/vendor/ (independent_owners.py: Tekalign's independent owner checker as vendored +by PR2839/PR2917; PLAN.json.gz, TEMPLATE.json.gz); PR #2957 (Jeremy Kothe, head b74b25f3ccc84c16e1a801d73b2f47e5ea764c78, +research/paired-extension-cap-fill-swaps): vendor/declared_rewrites.py (the pure applier of the fourteen declared +rewrites) and comparators/PR2957-CLAIM.json; PR #2966 (Jeremy Kothe, head e62d3eb9005117d82a9babcfa937ecc53237c490, +research/paired-extension-normal45-rewrites): comparators/PR2966-CLAIM.json; PR #2969 (Dugongue, head +e2ca469b08385d3d5e29a918d66dbefaf889e9f3, research/paired-swap-normal45): allocation/baseline/ (its CLAIM.json and its +allocation ORDER.json and PROFILE.json); and PR #2930 (head 81f3b5d12977eba09e06fbff729167d59faabe90): tools/relax.py, +tools/root.py, tools/relax_exact.py. +data/REWRITES-2957.json is Jeremy Kothe's PR2957 rewrite list, re-addressed to this package's stage-2 word with exact +preimages (every entry keeps a credit field). producer.py follows PR2917's producer.py (Mason Hale) for its paired steps; +verify.py, check_allocation.py, check_cap.py, run_registered.py and reproduce.py adapt our PR2942 versions of PR2917's and +PR2930's; tools/audit_allocation_moment.py is PR2917's exact moment auditor with only its authenticated baseline changed (to +the PR2969 headline); tools/derive_adapters.py generalizes PR2917's adapter derivation (PR2908, Jeremy Diviney); +tools/build_overlay.py follows the overlay conventions of PR2908's and PR2917's builders. construction/allocation/ retains +the flow model of PR2857/PR2843 (Yiyang Lu, Marius-Paul Dumitrean) as adapted for this allocation. All original notices of +the exported predecessor packages remain in force. + +Derived work (Apache-2.0): this package (`research/rank7-restore-carrier-skips`) builds on PR #2979 (Marius-Paul Dumitrean, head be191346, research/rank7-joint-endframes) and PR #3015 (Jeremy Kothe, jeremykothe2, research/rank7-joint-endframes-restore-edit), retained byte-identical except for the files named in README.md, plus two declared restore edit blocks (`R1_E42` and `R2_E7` in `edits/EDITS.json` and `edits/FINAL-WORD-*.json.gz`) and their re-derived certificates and complete fresh-native admission and release receipts by dcharb78, with AI assistance. PR #2979's own evidence is kept under evidence/pr2979/. diff --git a/research/staged-compensation-forests/frozen/prior/PR1080-CANONICAL-WORD.json.gz b/research/staged-compensation-forests/frozen/prior/PR1080-CANONICAL-WORD.json.gz new file mode 100644 index 0000000000..278a9df6a0 Binary files /dev/null and b/research/staged-compensation-forests/frozen/prior/PR1080-CANONICAL-WORD.json.gz differ diff --git a/research/staged-compensation-forests/frozen/prior/PR1080-RECIPE.json b/research/staged-compensation-forests/frozen/prior/PR1080-RECIPE.json new file mode 100644 index 0000000000..3da499553b --- /dev/null +++ b/research/staged-compensation-forests/frozen/prior/PR1080-RECIPE.json @@ -0,0 +1,3123 @@ +{ + "seed": 35, + "targets": [ + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135, + 136, + 137, + 138, + 139, + 140, + 141, + 142, + 143, + 144, + 145, + 146, + 147, + 148, + 149, + 150, + 151, + 152, + 153, + 154, + 155, + 156, + 157, + 158, + 159, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 174, + 175, + 176, + 177, + 178, + 179, + 180, + 181, + 182, + 183, + 184, + 185, + 186, + 187, + 188, + 189, + 190, + 191, + 192, + 193, + 194, + 195, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 210, + 211, + 212, + 213, + 214, + 215, + 216, + 217, + 218, + 219, + 220, + 221, + 222, + 223 + ], + "sources": [ + 224, + 226, + 228, + 230, + 231, + 232, + 233, + 235, + 236, + 237, + 238, + 239, + 240, + 242, + 244, + 246, + 247, + 248, + 249, + 251, + 252, + 253, + 254, + 255, + 256, + 258, + 260, + 262, + 263, + 264, + 265, + 267, + 268, + 269, + 270, + 271, + 272, + 274, + 276, + 278, + 279, + 280, + 281, + 283, + 284, + 285, + 286, + 287, + 288, + 290, + 292, + 294, + 295, + 296, + 297, + 299, + 300, + 301, + 302, + 303, + 304, + 306, + 308, + 310, + 312, + 313, + 315, + 316, + 317, + 318, + 319, + 320, + 322, + 324, + 326, + 328, + 329, + 331, + 332, + 333, + 334, + 335, + 336, + 338, + 340, + 342, + 343, + 344, + 345, + 347, + 348, + 349, + 350, + 351, + 352, + 354, + 356, + 358, + 359, + 360, + 361, + 363, + 364, + 365, + 366, + 367, + 368, + 370, + 372, + 374, + 375, + 376, + 377, + 379, + 380, + 381, + 382, + 383, + 384, + 386, + 388, + 390, + 391, + 392, + 393, + 395, + 396, + 397, + 398, + 399, + 400, + 402, + 404, + 406, + 407, + 408, + 409, + 411, + 412, + 413, + 414, + 415, + 416, + 418, + 420, + 422, + 423, + 424, + 425, + 427, + 428, + 429, + 430, + 431, + 432, + 434, + 436, + 438, + 439, + 440, + 441, + 443, + 444, + 445, + 446, + 447, + 462, + 463, + 464, + 465, + 466, + 467, + 468, + 469, + 474, + 475, + 476, + 477, + 478, + 479, + 480, + 481, + 490, + 491, + 492, + 493, + 494, + 495, + 502, + 503, + 504, + 505, + 506, + 507, + 511, + 514, + 515, + 516, + 517, + 519, + 523, + 526, + 527, + 528, + 529, + 531, + 542, + 554, + 558, + 559, + 560, + 561, + 570, + 572, + 582, + 584 + ], + "initial_target_forest": [ + [ + 42, + 41, + 1, + 8 + ], + [ + 41, + 106, + -1, + 7 + ], + [ + 53, + 106, + 1, + 7 + ], + [ + 69, + 97, + 1, + 7 + ], + [ + 105, + 52, + 1, + 7 + ], + [ + 2, + 72, + 1, + 6 + ], + [ + 28, + 75, + 1, + 6 + ], + [ + 52, + 14, + -1, + 6 + ], + [ + 79, + 25, + 1, + 6 + ], + [ + 97, + 5, + -1, + 6 + ], + [ + 106, + 14, + -1, + 6 + ], + [ + 5, + 68, + 1, + 5 + ], + [ + 14, + 15, + 1, + 5 + ], + [ + 25, + 9, + -1, + 5 + ], + [ + 37, + 20, + 1, + 5 + ], + [ + 60, + 84, + 1, + 5 + ], + [ + 72, + 9, + 1, + 5 + ], + [ + 75, + 82, + -1, + 5 + ], + [ + 76, + 0, + 1, + 5 + ], + [ + 0, + 27, + 1, + 4 + ], + [ + 3, + 66, + 1, + 4 + ], + [ + 4, + 65, + 1, + 4 + ], + [ + 9, + 89, + 1, + 4 + ], + [ + 13, + 78, + 1, + 4 + ], + [ + 15, + 89, + 1, + 4 + ], + [ + 16, + 43, + 1, + 4 + ], + [ + 18, + 40, + 1, + 4 + ], + [ + 20, + 110, + 1, + 4 + ], + [ + 44, + 99, + 1, + 4 + ], + [ + 46, + 47, + 1, + 4 + ], + [ + 49, + 34, + 1, + 4 + ], + [ + 54, + 101, + 1, + 4 + ], + [ + 58, + 93, + 1, + 4 + ], + [ + 59, + 30, + 1, + 4 + ], + [ + 68, + 65, + -1, + 4 + ], + [ + 73, + 83, + 1, + 4 + ], + [ + 82, + 6, + 1, + 4 + ], + [ + 84, + 83, + -1, + 4 + ], + [ + 98, + 48, + 1, + 4 + ], + [ + 111, + 110, + 1, + 4 + ], + [ + 1, + 86, + 1, + 3 + ], + [ + 6, + 86, + -1, + 3 + ], + [ + 12, + 100, + 1, + 3 + ], + [ + 19, + 102, + 1, + 3 + ], + [ + 27, + 81, + 1, + 3 + ], + [ + 30, + 29, + 1, + 3 + ], + [ + 32, + 24, + 1, + 3 + ], + [ + 34, + 108, + 1, + 3 + ], + [ + 40, + 39, + 1, + 3 + ], + [ + 43, + 104, + -1, + 3 + ], + [ + 47, + 36, + -1, + 3 + ], + [ + 48, + 24, + -1, + 3 + ], + [ + 50, + 109, + 1, + 3 + ], + [ + 65, + 64, + 1, + 3 + ], + [ + 66, + 67, + -1, + 3 + ], + [ + 70, + 71, + 1, + 3 + ], + [ + 74, + 29, + 1, + 3 + ], + [ + 78, + 104, + -1, + 3 + ], + [ + 83, + 29, + -1, + 3 + ], + [ + 87, + 7, + 1, + 3 + ], + [ + 89, + 61, + 1, + 3 + ], + [ + 90, + 10, + 1, + 3 + ], + [ + 93, + 86, + 1, + 3 + ], + [ + 96, + 64, + 1, + 3 + ], + [ + 99, + 104, + -1, + 3 + ], + [ + 101, + 39, + 1, + 3 + ], + [ + 110, + 36, + -1, + 3 + ], + [ + 7, + 92, + 1, + 2 + ], + [ + 10, + 63, + -1, + 2 + ], + [ + 11, + 91, + 1, + 2 + ], + [ + 17, + 103, + 1, + 2 + ], + [ + 24, + 45, + -1, + 2 + ], + [ + 29, + 45, + -1, + 2 + ], + [ + 36, + 21, + 1, + 2 + ], + [ + 38, + 56, + 1, + 2 + ], + [ + 39, + 55, + 1, + 2 + ], + [ + 61, + 94, + 1, + 2 + ], + [ + 64, + 103, + -1, + 2 + ], + [ + 67, + 80, + 1, + 2 + ], + [ + 71, + 91, + -1, + 2 + ], + [ + 81, + 92, + 1, + 2 + ], + [ + 85, + 35, + 1, + 2 + ], + [ + 86, + 22, + -1, + 2 + ], + [ + 95, + 8, + 1, + 2 + ], + [ + 100, + 31, + -1, + 2 + ], + [ + 102, + 55, + -1, + 2 + ], + [ + 104, + 51, + 1, + 2 + ], + [ + 108, + 22, + 1, + 2 + ], + [ + 109, + 33, + -1, + 2 + ], + [ + 8, + 26, + 1, + 1 + ], + [ + 21, + 57, + 1, + 1 + ], + [ + 22, + 23, + 1, + 1 + ], + [ + 31, + 77, + 1, + 1 + ], + [ + 33, + 23, + 1, + 1 + ], + [ + 35, + 107, + 1, + 1 + ], + [ + 45, + 107, + 1, + 1 + ], + [ + 51, + 62, + -1, + 1 + ], + [ + 55, + 26, + -1, + 1 + ], + [ + 56, + 77, + -1, + 1 + ], + [ + 63, + 62, + 1, + 1 + ], + [ + 80, + 26, + -1, + 1 + ], + [ + 88, + 26, + 1, + 1 + ], + [ + 91, + 62, + 1, + 1 + ], + [ + 92, + 57, + 1, + 1 + ], + [ + 94, + 57, + 1, + 1 + ], + [ + 103, + 77, + 1, + 1 + ] + ], + "initial_target_search": { + "edges": 12544, + "forest_edges": 106, + "roots": 6, + "max_depth": 8, + "price": 10883, + "census_sha256": "edaa8ce790449587a321591c871e5805c921b265302ae3aef94e22fea05b225d" + }, + "disjoint_helper_comparator": { + "cases": 92880, + "profitable": 684, + "selected_pairs": 86, + "census_sha256": "07b45b719482bbf564b478d872289e93eae98847fb1a408c3f762b5a37158e82", + "gain": 1916, + "panel_price": 8967, + "pairs": [ + [ + 144, + 152, + 1, + 74 + ], + [ + 132, + 140, + 1, + 69 + ], + [ + 84, + 92, + 1, + 64 + ], + [ + 120, + 128, + 1, + 64 + ], + [ + 96, + 104, + 1, + 64 + ], + [ + 156, + 164, + 1, + 62 + ], + [ + 108, + 116, + 1, + 59 + ], + [ + 73, + 80, + 1, + 54 + ], + [ + 14, + 22, + 1, + 54 + ], + [ + 26, + 34, + 1, + 54 + ], + [ + 117, + 105, + 1, + 51 + ], + [ + 78, + 77, + -1, + 49 + ], + [ + 62, + 69, + 1, + 44 + ], + [ + 2, + 10, + 1, + 42 + ], + [ + 32, + 31, + -1, + 39 + ], + [ + 67, + 66, + -1, + 39 + ], + [ + 56, + 55, + -1, + 39 + ], + [ + 38, + 46, + 1, + 39 + ], + [ + 50, + 58, + 1, + 39 + ], + [ + 60, + 64, + -1, + 38 + ], + [ + 129, + 93, + 1, + 37 + ], + [ + 23, + 141, + 1, + 36 + ], + [ + 44, + 43, + -1, + 34 + ], + [ + 20, + 19, + -1, + 34 + ], + [ + 48, + 53, + -1, + 29 + ], + [ + 114, + 113, + -1, + 29 + ], + [ + 36, + 41, + -1, + 29 + ], + [ + 142, + 153, + -1, + 27 + ], + [ + 154, + 165, + -1, + 26 + ], + [ + 94, + 82, + 1, + 23 + ], + [ + 95, + 98, + 1, + 22 + ], + [ + 24, + 29, + -1, + 22 + ], + [ + 12, + 17, + -1, + 22 + ], + [ + 35, + 59, + 1, + 21 + ], + [ + 159, + 47, + 1, + 21 + ], + [ + 119, + 122, + -1, + 21 + ], + [ + 71, + 81, + -1, + 20 + ], + [ + 6, + 7, + -1, + 20 + ], + [ + 131, + 134, + 1, + 20 + ], + [ + 126, + 125, + -1, + 19 + ], + [ + 25, + 28, + -1, + 19 + ], + [ + 90, + 89, + -1, + 19 + ], + [ + 138, + 137, + -1, + 19 + ], + [ + 102, + 101, + -1, + 19 + ], + [ + 150, + 149, + -1, + 19 + ], + [ + 143, + 146, + -1, + 17 + ], + [ + 163, + 161, + -1, + 16 + ], + [ + 72, + 200, + 1, + 16 + ], + [ + 107, + 110, + 1, + 16 + ], + [ + 158, + 155, + 1, + 14 + ], + [ + 167, + 176, + 1, + 14 + ], + [ + 0, + 11, + 1, + 14 + ], + [ + 106, + 118, + 1, + 13 + ], + [ + 13, + 16, + 1, + 11 + ], + [ + 171, + 68, + 1, + 10 + ], + [ + 178, + 100, + -1, + 10 + ], + [ + 83, + 86, + 1, + 10 + ], + [ + 183, + 91, + 1, + 9 + ], + [ + 174, + 168, + 1, + 9 + ], + [ + 37, + 40, + 1, + 9 + ], + [ + 170, + 151, + -1, + 6 + ], + [ + 179, + 87, + -1, + 6 + ], + [ + 173, + 99, + -1, + 5 + ], + [ + 189, + 57, + 1, + 5 + ], + [ + 49, + 52, + 1, + 5 + ], + [ + 204, + 185, + 1, + 5 + ], + [ + 196, + 115, + 1, + 5 + ], + [ + 180, + 88, + -1, + 5 + ], + [ + 162, + 157, + 1, + 4 + ], + [ + 1, + 4, + 1, + 4 + ], + [ + 61, + 194, + -1, + 4 + ], + [ + 8, + 3, + 1, + 4 + ], + [ + 175, + 169, + 1, + 4 + ], + [ + 177, + 166, + 1, + 4 + ], + [ + 33, + 139, + 1, + 3 + ], + [ + 212, + 210, + 1, + 3 + ], + [ + 208, + 213, + 1, + 3 + ], + [ + 193, + 205, + 1, + 1 + ], + [ + 197, + 191, + -1, + 1 + ], + [ + 188, + 45, + 1, + 1 + ], + [ + 172, + 79, + -1, + 1 + ], + [ + 75, + 70, + 1, + 1 + ], + [ + 202, + 103, + 1, + 1 + ], + [ + 184, + 203, + 1, + 1 + ], + [ + 195, + 201, + 1, + 1 + ], + [ + 30, + 54, + 1, + 1 + ] + ] + }, + "one_pass_helper_search": { + "edges": 46656, + "forest_edges": 138, + "roots": 78, + "max_depth": 5, + "panel_price": 8373, + "census_sha256": "0cc4a306cad834b301291e2c9ffa3ddb1f7ea18fb398a602d58c101fb312410c" + }, + "alternating_trajectory": [ + { + "step": "T0", + "kind": "target_forest", + "target_edges": 106, + "helper_edges": 0, + "residual_price": 10035, + "total_panel_price": 10883 + }, + { + "step": "H1", + "kind": "helper_forest", + "target_edges": 106, + "helper_edges": 138, + "residual_price": 6421, + "total_panel_price": 8373 + }, + { + "step": "T1", + "kind": "target_forest", + "target_edges": 100, + "helper_edges": 138, + "residual_price": 6316, + "total_panel_price": 8220 + }, + { + "step": "H2", + "kind": "helper_forest", + "target_edges": 100, + "helper_edges": 144, + "residual_price": 6155, + "total_panel_price": 8107 + }, + { + "step": "T2", + "kind": "target_forest", + "target_edges": 99, + "helper_edges": 144, + "residual_price": 6151, + "total_panel_price": 8095 + }, + { + "step": "H3", + "kind": "helper_forest", + "target_edges": 99, + "helper_edges": 149, + "residual_price": 6037, + "total_panel_price": 8021 + }, + { + "step": "T3", + "kind": "target_forest", + "target_edges": 99, + "helper_edges": 149, + "residual_price": 6024, + "total_panel_price": 8008 + }, + { + "step": "H4", + "kind": "helper_forest", + "target_edges": 99, + "helper_edges": 145, + "residual_price": 6010, + "total_panel_price": 7962 + }, + { + "step": "T4", + "kind": "target_forest", + "target_edges": 100, + "helper_edges": 145, + "residual_price": 5986, + "total_panel_price": 7946 + }, + { + "step": "H5", + "kind": "helper_forest", + "target_edges": 100, + "helper_edges": 148, + "residual_price": 5946, + "total_panel_price": 7930 + }, + { + "step": "T5", + "kind": "target_forest", + "target_edges": 100, + "helper_edges": 148, + "residual_price": 5946, + "total_panel_price": 7930 + } + ], + "target_forest": [ + [ + 42, + 41, + 1, + 6 + ], + [ + 76, + 0, + 1, + 6 + ], + [ + 0, + 81, + 1, + 5 + ], + [ + 7, + 87, + 1, + 5 + ], + [ + 41, + 53, + -1, + 5 + ], + [ + 106, + 53, + 1, + 5 + ], + [ + 3, + 66, + 1, + 4 + ], + [ + 46, + 47, + 1, + 4 + ], + [ + 53, + 15, + -1, + 4 + ], + [ + 69, + 97, + 1, + 4 + ], + [ + 81, + 27, + 1, + 4 + ], + [ + 84, + 60, + 1, + 4 + ], + [ + 87, + 92, + 1, + 4 + ], + [ + 105, + 52, + 1, + 4 + ], + [ + 12, + 100, + 1, + 3 + ], + [ + 15, + 14, + 1, + 3 + ], + [ + 17, + 103, + 1, + 3 + ], + [ + 19, + 102, + 1, + 3 + ], + [ + 20, + 37, + 1, + 3 + ], + [ + 27, + 57, + 1, + 3 + ], + [ + 32, + 24, + 1, + 3 + ], + [ + 36, + 21, + 1, + 3 + ], + [ + 38, + 56, + 1, + 3 + ], + [ + 47, + 21, + -1, + 3 + ], + [ + 49, + 34, + 1, + 3 + ], + [ + 52, + 14, + -1, + 3 + ], + [ + 60, + 73, + -1, + 3 + ], + [ + 66, + 67, + -1, + 3 + ], + [ + 90, + 10, + 1, + 3 + ], + [ + 92, + 57, + 1, + 3 + ], + [ + 94, + 61, + 1, + 3 + ], + [ + 97, + 5, + -1, + 3 + ], + [ + 99, + 44, + 1, + 3 + ], + [ + 101, + 54, + 1, + 3 + ], + [ + 2, + 72, + 1, + 2 + ], + [ + 5, + 68, + 1, + 2 + ], + [ + 6, + 82, + 1, + 2 + ], + [ + 8, + 95, + 1, + 2 + ], + [ + 10, + 11, + 1, + 2 + ], + [ + 13, + 78, + 1, + 2 + ], + [ + 14, + 9, + 1, + 2 + ], + [ + 16, + 43, + 1, + 2 + ], + [ + 21, + 110, + -1, + 2 + ], + [ + 22, + 108, + 1, + 2 + ], + [ + 24, + 35, + 1, + 2 + ], + [ + 30, + 59, + 1, + 2 + ], + [ + 34, + 33, + 1, + 2 + ], + [ + 37, + 110, + 1, + 2 + ], + [ + 40, + 18, + 1, + 2 + ], + [ + 44, + 104, + -1, + 2 + ], + [ + 45, + 107, + 1, + 2 + ], + [ + 48, + 98, + 1, + 2 + ], + [ + 50, + 109, + 1, + 2 + ], + [ + 54, + 55, + 1, + 2 + ], + [ + 56, + 31, + 1, + 2 + ], + [ + 57, + 110, + 1, + 2 + ], + [ + 61, + 9, + -1, + 2 + ], + [ + 63, + 62, + 1, + 2 + ], + [ + 64, + 96, + 1, + 2 + ], + [ + 67, + 80, + 1, + 2 + ], + [ + 71, + 70, + 1, + 2 + ], + [ + 73, + 83, + 1, + 2 + ], + [ + 75, + 28, + 1, + 2 + ], + [ + 79, + 25, + 1, + 2 + ], + [ + 93, + 58, + 1, + 2 + ], + [ + 100, + 31, + -1, + 2 + ], + [ + 102, + 55, + 1, + 2 + ], + [ + 103, + 31, + 1, + 2 + ], + [ + 1, + 86, + 1, + 1 + ], + [ + 4, + 65, + 1, + 1 + ], + [ + 9, + 89, + 1, + 1 + ], + [ + 11, + 91, + 1, + 1 + ], + [ + 18, + 39, + 1, + 1 + ], + [ + 25, + 89, + -1, + 1 + ], + [ + 28, + 86, + 1, + 1 + ], + [ + 31, + 77, + 1, + 1 + ], + [ + 33, + 23, + 1, + 1 + ], + [ + 35, + 85, + 1, + 1 + ], + [ + 43, + 51, + -1, + 1 + ], + [ + 55, + 39, + 1, + 1 + ], + [ + 58, + 86, + 1, + 1 + ], + [ + 59, + 29, + 1, + 1 + ], + [ + 62, + 91, + 1, + 1 + ], + [ + 68, + 65, + 1, + 1 + ], + [ + 70, + 91, + -1, + 1 + ], + [ + 72, + 89, + -1, + 1 + ], + [ + 74, + 29, + 1, + 1 + ], + [ + 78, + 51, + -1, + 1 + ], + [ + 80, + 26, + -1, + 1 + ], + [ + 82, + 86, + -1, + 1 + ], + [ + 83, + 29, + -1, + 1 + ], + [ + 88, + 26, + 1, + 1 + ], + [ + 95, + 26, + -1, + 1 + ], + [ + 96, + 65, + 1, + 1 + ], + [ + 98, + 85, + 1, + 1 + ], + [ + 104, + 51, + 1, + 1 + ], + [ + 107, + 85, + 1, + 1 + ], + [ + 108, + 23, + 1, + 1 + ], + [ + 109, + 23, + -1, + 1 + ], + [ + 110, + 111, + 1, + 1 + ] + ], + "helper_forest": [ + [ + 140, + 132, + 1, + 7 + ], + [ + 132, + 131, + -1, + 6 + ], + [ + 152, + 144, + 1, + 6 + ], + [ + 80, + 73, + 1, + 5 + ], + [ + 104, + 96, + 1, + 5 + ], + [ + 128, + 120, + 1, + 5 + ], + [ + 131, + 134, + 1, + 5 + ], + [ + 144, + 143, + -1, + 5 + ], + [ + 164, + 156, + 1, + 5 + ], + [ + 11, + 10, + -1, + 4 + ], + [ + 31, + 32, + -1, + 4 + ], + [ + 34, + 26, + 1, + 4 + ], + [ + 57, + 189, + 1, + 4 + ], + [ + 73, + 72, + -1, + 4 + ], + [ + 81, + 105, + 1, + 4 + ], + [ + 93, + 92, + -1, + 4 + ], + [ + 96, + 95, + -1, + 4 + ], + [ + 101, + 102, + -1, + 4 + ], + [ + 103, + 189, + 1, + 4 + ], + [ + 120, + 119, + -1, + 4 + ], + [ + 134, + 28, + 1, + 4 + ], + [ + 143, + 146, + 1, + 4 + ], + [ + 149, + 150, + -1, + 4 + ], + [ + 153, + 35, + 1, + 4 + ], + [ + 156, + 155, + -1, + 4 + ], + [ + 10, + 2, + 1, + 3 + ], + [ + 19, + 20, + -1, + 3 + ], + [ + 22, + 14, + 1, + 3 + ], + [ + 26, + 25, + -1, + 3 + ], + [ + 28, + 25, + -1, + 3 + ], + [ + 32, + 27, + -1, + 3 + ], + [ + 35, + 59, + 1, + 3 + ], + [ + 45, + 183, + 1, + 3 + ], + [ + 51, + 56, + 1, + 3 + ], + [ + 55, + 56, + -1, + 3 + ], + [ + 58, + 50, + 1, + 3 + ], + [ + 72, + 200, + 1, + 3 + ], + [ + 77, + 78, + -1, + 3 + ], + [ + 91, + 183, + 1, + 3 + ], + [ + 92, + 84, + 1, + 3 + ], + [ + 95, + 98, + 1, + 3 + ], + [ + 102, + 97, + 1, + 3 + ], + [ + 105, + 117, + 1, + 3 + ], + [ + 116, + 108, + 1, + 3 + ], + [ + 119, + 122, + 1, + 3 + ], + [ + 129, + 59, + 1, + 3 + ], + [ + 137, + 138, + -1, + 3 + ], + [ + 146, + 16, + 1, + 3 + ], + [ + 150, + 145, + -1, + 3 + ], + [ + 155, + 158, + 1, + 3 + ], + [ + 165, + 59, + 1, + 3 + ], + [ + 189, + 183, + 1, + 3 + ], + [ + 2, + 1, + -1, + 2 + ], + [ + 14, + 13, + -1, + 2 + ], + [ + 16, + 13, + -1, + 2 + ], + [ + 20, + 15, + -1, + 2 + ], + [ + 21, + 171, + 1, + 2 + ], + [ + 25, + 210, + 1, + 2 + ], + [ + 27, + 133, + 1, + 2 + ], + [ + 39, + 44, + 1, + 2 + ], + [ + 43, + 44, + -1, + 2 + ], + [ + 46, + 38, + 1, + 2 + ], + [ + 50, + 49, + -1, + 2 + ], + [ + 52, + 49, + 1, + 2 + ], + [ + 56, + 168, + 1, + 2 + ], + [ + 59, + 70, + 1, + 2 + ], + [ + 64, + 60, + -1, + 2 + ], + [ + 68, + 196, + 1, + 2 + ], + [ + 69, + 62, + 1, + 2 + ], + [ + 78, + 74, + 1, + 2 + ], + [ + 84, + 82, + -1, + 2 + ], + [ + 87, + 171, + -1, + 2 + ], + [ + 88, + 180, + -1, + 2 + ], + [ + 89, + 90, + -1, + 2 + ], + [ + 97, + 63, + 1, + 2 + ], + [ + 98, + 194, + 1, + 2 + ], + [ + 108, + 107, + -1, + 2 + ], + [ + 109, + 114, + -1, + 2 + ], + [ + 110, + 107, + 1, + 2 + ], + [ + 112, + 100, + 1, + 2 + ], + [ + 113, + 114, + -1, + 2 + ], + [ + 115, + 196, + 1, + 2 + ], + [ + 117, + 47, + 1, + 2 + ], + [ + 121, + 126, + -1, + 2 + ], + [ + 122, + 40, + 1, + 2 + ], + [ + 125, + 126, + -1, + 2 + ], + [ + 138, + 133, + -1, + 2 + ], + [ + 139, + 171, + 1, + 2 + ], + [ + 141, + 23, + 1, + 2 + ], + [ + 142, + 130, + 1, + 2 + ], + [ + 145, + 15, + 1, + 2 + ], + [ + 158, + 176, + -1, + 2 + ], + [ + 183, + 196, + 1, + 2 + ], + [ + 185, + 204, + 1, + 2 + ], + [ + 200, + 86, + 1, + 2 + ], + [ + 205, + 187, + 1, + 2 + ], + [ + 1, + 4, + -1, + 1 + ], + [ + 3, + 8, + -1, + 1 + ], + [ + 7, + 8, + -1, + 1 + ], + [ + 13, + 169, + 1, + 1 + ], + [ + 15, + 166, + 1, + 1 + ], + [ + 17, + 12, + -1, + 1 + ], + [ + 23, + 123, + 1, + 1 + ], + [ + 29, + 24, + -1, + 1 + ], + [ + 33, + 179, + 1, + 1 + ], + [ + 38, + 37, + -1, + 1 + ], + [ + 40, + 37, + 1, + 1 + ], + [ + 41, + 36, + -1, + 1 + ], + [ + 44, + 166, + 1, + 1 + ], + [ + 47, + 159, + 1, + 1 + ], + [ + 49, + 177, + 1, + 1 + ], + [ + 53, + 48, + -1, + 1 + ], + [ + 60, + 71, + 1, + 1 + ], + [ + 62, + 61, + -1, + 1 + ], + [ + 63, + 67, + -1, + 1 + ], + [ + 66, + 67, + -1, + 1 + ], + [ + 70, + 124, + -1, + 1 + ], + [ + 74, + 85, + 1, + 1 + ], + [ + 79, + 202, + 1, + 1 + ], + [ + 82, + 94, + 1, + 1 + ], + [ + 86, + 83, + 1, + 1 + ], + [ + 90, + 85, + -1, + 1 + ], + [ + 99, + 173, + -1, + 1 + ], + [ + 100, + 178, + -1, + 1 + ], + [ + 106, + 118, + 1, + 1 + ], + [ + 107, + 211, + 1, + 1 + ], + [ + 114, + 208, + 1, + 1 + ], + [ + 126, + 177, + 1, + 1 + ], + [ + 127, + 202, + 1, + 1 + ], + [ + 130, + 188, + 1, + 1 + ], + [ + 133, + 169, + -1, + 1 + ], + [ + 157, + 162, + -1, + 1 + ], + [ + 161, + 163, + -1, + 1 + ], + [ + 168, + 174, + 1, + 1 + ], + [ + 171, + 179, + 1, + 1 + ], + [ + 176, + 166, + 1, + 1 + ], + [ + 180, + 172, + 1, + 1 + ], + [ + 187, + 199, + 1, + 1 + ], + [ + 191, + 198, + 1, + 1 + ], + [ + 193, + 186, + -1, + 1 + ], + [ + 194, + 61, + 1, + 1 + ], + [ + 196, + 188, + 1, + 1 + ], + [ + 201, + 188, + 1, + 1 + ], + [ + 203, + 197, + 1, + 1 + ], + [ + 204, + 198, + 1, + 1 + ], + [ + 206, + 186, + 1, + 1 + ], + [ + 210, + 212, + 1, + 1 + ], + [ + 213, + 208, + 1, + 1 + ] + ], + "fixed_point_target_search": { + "edges": 12544, + "forest_edges": 100, + "roots": 12, + "max_depth": 6, + "price_with_helpers": 7930, + "census_sha256": "9d27c66a0c71c680188c9e4759670aeaec5d31b81928f2dff15f8c64ba002063" + }, + "fixed_point_helper_search": { + "edges": 46656, + "forest_edges": 148, + "roots": 68, + "max_depth": 7, + "price_with_targets": 7930, + "census_sha256": "b76fb5a7332f0cd174fb2aef68e896f5a82d4e61443f2887cca23274c49740a3" + }, + "baseline_panel_price": 34728, + "target_only_panel_price": 10883, + "disjoint_pair_panel_price": 8967, + "one_pass_biforest_panel_price": 8373, + "two_sided_biforest_panel_price": 7930, + "baseline_additions": 6320, + "candidate_additions": 1780, + "residual_additions": 1284, + "residual_quarters_sha256": "f07660d93fc301a840b420cb343dd1f2bf38765d3d365135dfa05d9c313b18fc", + "panel_sha256": "015be25bd22eed093e81be9da6ffa479752f44dce3573c27d9c165ae924e437d" +} diff --git a/research/staged-compensation-forests/frozen/producers/bw_emit.py b/research/staged-compensation-forests/frozen/producers/bw_emit.py new file mode 100644 index 0000000000..6d47f63ab7 --- /dev/null +++ b/research/staged-compensation-forests/frozen/producers/bw_emit.py @@ -0,0 +1,192 @@ +# Warp-aware copy of hpe_emit_local.py (GK / PR #433 lineage: icekylinx with Codex assistance; DreamingOfClouds with Claude Opus 5.5). +# BW: every change for anticipatory dirty borrowing (PR2226, Cinna Davis @1337isnot1337, with OpenAI Codex assistance) is marked "BW:". +# On a word without warps / zero buffers / twisted additions the behaviour equals hpe_emit_local.py. +"""Emit both local programs of a BORROW canonical word: scalar macros, climbs, centres, wrappers, monomial warps, zero buffers. + +A warp event ['warp', r, op, f0, f1] is the rank-zero logical reference change K_G^{+-1} of register r moving it from +frame f0 to frame f1 (G(f0) = f1 for op > 0, G^-1(f0) = f1 for op < 0). The same event stream serves both orientations: +the inverse-transpose of a monomial K_G is the monomial conj(K_G) (same permutation, conjugated phases), a different +formal symbol of the free operator algebra, and the exact column check of the physical product is run for both. +""" +if not __debug__: + raise RuntimeError('assertions must remain enabled') # every check of this stage is an assert +import sys as _sys, os as _os; _sys.path.insert(0, _os.path.dirname(_os.path.abspath(__file__))) +import gzip,hashlib,json +from collections import Counter +from fractions import Fraction as Q +from pathlib import Path + +OUT=Path(_sys.argv[1]);cp=OUT/'CANONICAL-WORD.json.gz' +c=json.load(gzip.open(cp)) +frames=c['frames'];v,R,h=c['v'],c['R'],c['h'];n=2*v+R +def digest(x):return hashlib.sha256(json.dumps(x,sort_keys=True,separators=(',',':')).encode()).hexdigest() +def basis(vs): + b={} + for x in vs: + for p in sorted(b,reverse=True): + if x>>p&1:x^=b[p] + if x: + p=x.bit_length()-1 + for q in b: + if b[q]>>p&1:b[q]^=x + b[p]=x + return tuple(b[p] for p in sorted(b,reverse=True)) +def reg(x):return list(x) if isinstance(x,list) else ['L',x] # BW: ['Z', c] is a private zero buffer +def dual(e): + e=list(e) + if e[0]=='add':e[1],e[2]=e[2],e[1];e[3]*=-1 + else:e[2],e[3]=e[3],e[2] + return e +def scalar(e,back): + e=dual(e) if back else list(e) + if e[0]=='add':return ['add',reg(e[1]),reg(e[2]),e[3],e[4]] + return ['scale',reg(e[1]),e[2],e[3]] +def primitive_bound(e): + if e[0] in ('clear','copy'):return 1 + q=Q(e[3],e[4]) if e[0]=='add' else Q(e[2],e[3]) + a,b=abs(q.numerator),q.denominator + assert b&(b-1)==0 + if e[0]=='scale': + assert a&(a-1)==0 + return abs(a.bit_length()-b.bit_length())+int(q<0) + return 3+(a.bit_length()-1)+a.bit_count()+(b.bit_length()-1) +def lregs(e):return [r for r in ([e[1]]+([e[2]] if e[0]=='add' else [])) if not isinstance(r,list)] + +def expand(e): + """BW: a twisted addition t += c*W(s) at frame zero: warp s by W, add, unwarp (all rank zero at frame 0).""" + if e[0]!='tadd':return [e] + _,t,s,word,a,b,f=e + return [['warp',s,op,0,0] for op in reversed(word)]+[['add',t,s,a,b,0]]+[['warp',s,-op,0,0] for op in word] + +def emit(back): + out=[];cur=c['start'].copy() + def event(e):out.append(e) + def scal(e,f):event(['scalar',e,f]) + def warp(e): + _,r,op,f0,f1=e + if isinstance(r,list):assert r[0]=='Z' and f0==f1==1 + else: + assert cur[r]==f0,('warp frame mismatch',r,cur[r],f0);cur[r]=f1 + event(['warp',reg(r),op,f0,f1]) + event(['phase','zero_frame_precondition']) + for e0 in c['precondition']+c['compensation']: + for e in expand(e0): + if e[0]=='warp':warp(e);continue + regs=lregs(e) + assert all(c['start'][r]==0 for r in regs) + scal(scalar(e,back),0) + event(['phase','entry_adapters']) + entering=[r for r,f in enumerate(c['start']) if r>=2*v and f!=0] + hpe={r for r in range(2*v,n) if c['final'][r]!=1} + wrapped=sorted(set(entering)|hpe) + for r,f in enumerate(c['start']): + if r in wrapped:event(['residual_adapter','pre',r,f]+([c['final'][r]] if c['final'][r]!=1 else [])) + else:event(['adapter','old_to_new',r,f]) + def climb(r,f,part): + old=cur[r] + if old==f:return + assert basis(frames[old]+frames[f])==tuple(frames[f]) + rank=len(frames[f])-len(frames[old]);assert rank>0 + event(['climb',part,r,old,f,rank]);cur[r]=f + for part in ('A','centers','B')+(('cleanup_tail',) if c.get('tail') else ())+('final',): + event(['phase',part]) + if part in ('A','B','cleanup_tail'): + for e in (c['tail'] if part=='cleanup_tail' else c[part]): + if e[0]=='warp':warp(e);continue # BW: monomial reference change, no climb + for r in lregs(e):climb(r,e[-1],part) + scal(scalar(e,back),e[-1]) + elif part=='centers': + lv=lambda r:c.get('target_levels',{}).get(str(r-v),0) + assert all(cur[r]==lv(r) for r in range(v,2*v)) + for k,r in enumerate(c['centers']): + cf=c['center_frames'][k];assert cur[r]==cf + terms=[e for e in c['cut'] if e[2]==r] + path=[cf]+sorted({lv(e[1]) for e in terms}-{cf},key=lambda x:-len(frames[x])) + C=['C',k] + if not back: + scal(['clear',C],cf);scal(['copy',C,['L',r]],cf) + for a in range(len(path)): + if a>0:event(['center',k,path[a-1],path[a],len(frames[path[a-1]])-len(frames[path[a]])]) + for e in terms: + if lv(e[1])==path[a]:scal(['add',['L',e[1]],C,e[3],e[4]],path[a]) + scal(['clear',C],path[-1]) + else: + scal(['clear',C],path[-1]) + for a in range(len(path)-1,-1,-1): + for e in terms: + if lv(e[1])==path[a]:scal(['add',C,['L',e[1]],e[3],e[4]],path[a]) + if a>0:event(['center',k,path[a],path[a-1],len(frames[path[a-1]])-len(frames[path[a]])]) + scal(['add',['L',r],C,-1,1],cf);scal(['clear',C],cf) + else: + for r,f in enumerate(c['final']):climb(r,f,part) + event(['phase','exit_adapters']) + for r,f in enumerate(c['final']): + if r not in hpe:event(['adapter','new_to_old',r,f]) + event(['phase','full_frame_cleanup']) + zb=c.get('zero_buffers',[]) + for z in zb:event(['zero_buffer','alloc',z]) # BW: private FULL-frame zero buffers stand in for the restored (hyperplane-ended) helpers + for e in c['cleanup']: + if e[0]=='warp':warp(e);continue + regs=lregs(e) + assert all(c['final'][r]==1 for r in regs) + assert all(r[0]=='Z' and r[1] in zb for r in [e[1]]+([e[2]] if e[0]=='add' else []) if isinstance(r,list)) + scal(scalar(e,back),1) + for z in zb:event(['zero_buffer','free',z]) + for r in wrapped:event(['residual_adapter','post',r,c['start'][r]]+([c['final'][r]] if r in hpe else [])) + event(['phase','done']) + return out + +def add_row(dst,src,q): + for j,x in src.items(): + z=dst.get(j,Q(0))+q*x + if z:dst[j]=z + else:dst.pop(j,None) +def warp_row(row,op): + out={} + for (var,word),x in row.items(): + word=word[1:] if word and word[0]==-op else (op,)+word + out[var,word]=x + return out + +def check_local(events,back): + # BW: literal scalar replay of the emitted stream in the free warp algebra (rows over (register, warp word)), centres and zero buffers. + state={('L',r):{(r,()):Q(1)} for r in range(n)};live=[];paid=Counter();prims=0;macros=0;zlive=set();nwarp=0 + for e in events: + if e[0]=='climb':assert not live;paid[e[5]]+=1 + elif e[0]=='center':assert live==[e[1]];paid[e[4]]+=1 + elif e[0]=='zero_buffer': + z=e[2] + if e[1]=='alloc':assert z not in zlive;zlive.add(z);state['Z',z]={} + else:assert not state['Z',z] and z in zlive;zlive.remove(z) + elif e[0]=='warp': + t=tuple(e[1]);nwarp+=1;state[t]=warp_row(state[t],e[2]) + elif e[0]=='scalar': + op=e[1];tag=op[0];t=tuple(op[1]);macros+=1;prims+=2*primitive_bound(op) + if tag=='clear': + state[t]={} + if t[0]=='C' and t[1] in live:live.remove(t[1]) + elif tag=='copy':state[t]={(var,w):x for (var,w),x in state.get(tuple(op[2]),{}).items()};live.append(t[1]) + elif tag=='scale':state[t]={j:Q(op[2],op[3])*x for j,x in state[t].items()} + else: + s=tuple(op[2]);q=Q(op[3],op[4]);row=state.setdefault(t,{}) + if t[0]=='C' and t[1] not in live:live.append(t[1]) + add_row(row,state.get(s,{}),q) + assert not live and not zlive and all(not row for r,row in state.items() if r[0] in 'CZ') + for r in range(n): + expected={(r,()):Q(1)} + if back and r> k & 1: + x ^= pivots[k] + if x: + k = x.bit_length() - 1 + for j in pivots: + if pivots[j] >> k & 1: + pivots[j] ^= x + pivots[k] = x + return tuple(pivots[k] for k in sorted(pivots, reverse=True)) + + +def span(b): + s = {0} + for x in b: + s |= {t ^ x for t in s} + return frozenset(s) + + +def rank_of(vs): + return len(basis(vs)) + + +def solve_G(cols, h): + """G given as images of e_i; returns (invertible?, image-of-subspace function).""" + def lin(x): + out = 0 + for i, c in enumerate(cols): + if x >> i & 1: + out ^= c + return out + return lin, rank_of(cols) == h + + +# ---- free operator algebra over the warps ------------------------------------------------------------------ +def add_row(dst, src, c): + for key, value in list(src.items()): + z = dst.get(key, Q(0)) + c * value + if z: + dst[key] = z + elif key in dst: + del dst[key] + + +def warp_row(row, op): + out = {} + for (var, word), value in row.items(): + word = word[1:] if word and word[0] == -op else (op,) + word + out[var, word] = value + return out + + +def is_dyadic(q): + return q.denominator & (q.denominator - 1) == 0 + + +def gate_regs(e): + if e[0] == 'add': + return [e[1], e[2]] + if e[0] == 'scale': + return [e[1]] + raise AssertionError(e[0]) + + +def dual(e): + e = list(e) + if e[0] == 'add': + e[1], e[2] = e[2], e[1] + e[3] = -e[3] + elif e[0] == 'scale': + e[2], e[3] = e[3], e[2] + return e + + +def apply_gate(e, rows, back): + if back: + e = dual(e) + if e[0] == 'scale': + q = Q(e[2], e[3]) + assert q + rows[e[1]] = {j: q * x for j, x in rows[e[1]].items()} + else: + assert e[1] != e[2] + add_row(rows[e[1]], rows[e[2]], Q(e[3], e[4])) + + +def run(word_path, out): + t0 = time.monotonic() + word = read(word_path) + assert word['kind'] == 'BORROW-WORD' + v, h, R0 = word['report']['v'], word['report']['h'], word['report']['R'] + assert h == 9 and v == 112 + n0 = 2 * v + R0 + removed = sorted(word['removed']) + assert all(2 * v <= r < n0 for r in removed) and len(set(removed)) == len(removed) + k = len(removed) + kept = [r for r in range(n0) if r not in set(removed)] + newid = {r: i for i, r in enumerate(kept)} + n = len(kept) + R = R0 - k + assert n == 2 * v + R + Zbase = n0 # builder convention: zero buffer of restored c is register n0 + c + ports = word['ports'] + assert len(set(ports)) == v + full = tuple(1 << i for i in range(h - 1, -1, -1)) + frames, frame_ids = [(), full], {(): 0, full: 1} + + def fid(vectors): + frame = basis(vectors) + if frame not in frame_ids: + frame_ids[frame] = len(frames) + frames.append(frame) + return frame_ids[frame] + + def R_(r): # register -> new register (int) or ['Z', c] + if isinstance(r, list): + return r + if r >= Zbase: + return ['Z', newid[r - Zbase]] + return newid[r] + + start = [fid([p]) for p in ports] + [0] * (v + R) + for r, frame in word['start_extra'].items(): + assert 2 * v <= int(r) < n0 and int(r) not in set(removed) + start[newid[int(r)]] = fid(frame) + final = [1] * v + [fid(x for x in range(1, 1 << h) if (x & p).bit_count() % 2 == 0) for p in ports] + [1] * R + helper_final = {} + for r, frame in word['helper_final'].items(): + assert 2 * v <= int(r) < n0 and int(r) not in set(removed) + helper_final[newid[int(r)]] = fid(frame) + final[newid[int(r)]] = helper_final[newid[int(r)]] + zero_buffers = sorted(helper_final) # every restored (hyperplane-ended) helper is replaced by a private zero buffer in the FULL cleanup + + def gate(e): + e = copy.deepcopy(e) + # Four-low lifted-target port (PR2436 mechanism): literal A-phase warp after the entry adapters. + if e[0] == 'warp': + assert len(e) == 5 + return ['warp', R_(e[1]), e[2], fid(e[3]), fid(e[4])] + if e[0] == 'add': + e[1], e[2] = R_(e[1]), R_(e[2]) + else: + e[1] = R_(e[1]) + e[-1] = None if e[-1] is None else fid(e[-1]) + return e + + # warps: operator table; op id = position + 1; G given by images of the basis vectors + warps = [] + for i, (pos, lender, G, frm, to) in enumerate(word['warps']): + warps.append({'op': i + 1, 'B_pos': pos, 'lender': newid[lender], 'G_columns': list(G), + 'from_frame': fid(frm), 'to_frame': fid(to)}) + byp = {} + for w_ in warps: + byp.setdefault(w_['B_pos'], []).append(w_) + + def warp_event(r, op, f0, f1): + return ['warp', r, op, f0, f1] + + # compensation (zero frame): initial corrections first, as twisted additions t += c * W(s) + pre = [] + for term in word['initial_corrections']: + q = Q(term['coefficient']) + pre.append(['tadd', newid[term['target']], newid[term['source']], list(term['operator_word']), + q.numerator, q.denominator, 0]) + precondition = pre + [gate(e) for e in word['precondition']] # the formal initial corrections come first (PR2226 order) + compensation = [gate(e) for e in word['compensation']] + A = [gate(e) for e in word['A']] + cut = [gate(e) for e in word['cut']] + B = [] + for p in range(len(word['B']) + 1): + for w_ in sorted(byp.get(p, []), key=lambda x: x['op']): + B.append(warp_event(w_['lender'], w_['op'], w_['from_frame'], w_['to_frame'])) + if p < len(word['B']): + B.append(gate(word['B'][p])) + assert sum(1 for e in B if e[0] == 'warp') == len(warps) + tail = [gate(e) for e in word['restore']] + cleanup = [] + for e in word['cleanup']: + if e[0] == 'warp': + cleanup.append(warp_event(R_(e[1]), e[2], 1, 1)) + assert basis(e[3]) == full + else: + cleanup.append(gate(e)) + centers = [newid[r] for r in word['centers']] + center_frames = [fid(f) for f in word['center_frames']] + levels = {str(t): fid(f) for t, f in word['target_levels'].items()} + + canonical = dict(h=h, v=v, R=R, ports=ports, frames=frames, start=start, final=final, + precondition=precondition, compensation=compensation, A=A, cut=cut, B=B, tail=tail, + cleanup=cleanup, centers=centers, center_frames=center_frames, target_levels=levels, + warps=warps, zero_buffers=zero_buffers, removed=removed, helper_origin=kept[2 * v:], + borrow=dict(k=k, base=word.get('base'), original_helpers=R0)) + # ---- exact scalar replay in the free algebra over the warps (both orientations) ----------------------------------- + nz = len(zero_buffers) + + def regkey(r): + return tuple(r) if isinstance(r, list) else ('L', r) + + def expand_tadd(e): + _, t, s, wordops, a, b, f = e + ev = [warp_event(s, op, 0, 0) for op in reversed(wordops)] + ev.append(['add', t, s, a, b, 0]) + ev += [warp_event(s, -op, 0, 0) for op in wordops] + return ev + + def program(): + yield 'pre', [x for e in precondition + compensation for x in (expand_tadd(e) if e[0] == 'tadd' else [e])] + yield 'A', A + yield 'A', cut + yield 'B', B + yield 'tail', tail + yield 'cleanup', cleanup + + def fullprog(): + return [(part, e) for part, es in program() for e in es] + prog = fullprog() + for back in (False, True): + rows = {regkey(r): {(r, ()): Q(1)} for r in range(n)} + for c in zero_buffers: + rows[('Z', c)] = {} + for part, e in prog: + if e[0] == 'warp': + key = ('L', e[1]) if not isinstance(e[1], list) else tuple(e[1]) + rows[key] = warp_row(rows[key], e[2]) + else: + if e[0] == 'add': + src, dst = regkey(e[2]), regkey(e[1]) + a, b = e[3], e[4] + if back: + src, dst, a = dst, src, -a + assert src != dst + add_row(rows[dst], rows[src], Q(a, b)) + else: + key = regkey(e[1]) + a, b = (e[3], e[2]) if back else (e[2], e[3]) + q = Q(a, b) + assert q + rows[key] = {j: q * x for j, x in rows[key].items()} + expected = {regkey(r): {(r, ()): Q(1)} for r in range(n)} + for t in range(v): + if back: + expected[('L', t)][(v + t, ())] = Q(-1) + else: + expected[('L', v + t)][(t, ())] = Q(1) + for c in zero_buffers: + expected[('Z', c)] = {} + bad = [key for key in expected if rows[key] != expected[key]] + assert not bad, ('arbitrary-input endpoint (free warp algebra)', back, bad[:8]) + # dyadic primitives + for part, e in prog: + if e[0] == 'add': + assert is_dyadic(Q(e[3], e[4])) + elif e[0] == 'scale': + q = Q(e[2], e[3]) + a = abs(q.numerator) + assert is_dyadic(q) and a and a & (a - 1) == 0 + + wrapped_regs = {r for r in range(2 * v, n) if start[r] != 0 or final[r] != 1} # entering or hyperplane-ended helpers carry wrappers + # ---- frame chains, paid profile, edges, warps ------------------------------------------------------------------- + contains = lambda a, b: basis(frames[a] + frames[b]) == tuple(frames[b]) + cur = start.copy() + paid, edges = Counter(), set() + wsum = {w_['op']: w_ for w_ in warps} + G_of = {} + for w_ in warps: + lin, inv_ = solve_G(w_['G_columns'], h) + assert inv_, ('non-invertible G', w_['op']) + img = basis([lin(x) for x in frames[w_['from_frame']]]) + assert img == tuple(frames[w_['to_frame']]), ('G does not map the from frame onto the to frame', w_['op']) + assert len(frames[w_['from_frame']]) == len(frames[w_['to_frame']]) + G_of[w_['op']] = lin + warp_edges = set() + + def regs_of(e): + return [r for r in gate_regs(e) if not isinstance(r, list)] + + def climb(r, f): + old = cur[r] + assert contains(old, f), ('nonmonotone', r, old, f) + if old != f: + degree = len(frames[f]) - len(frames[old]) + paid[degree] += 1 + edges.add((old, f)) + cur[r] = f + + def do_warp(e): + _, r, op, f0, f1 = e + if isinstance(r, list): + assert r[0] == 'Z' + assert f0 == f1 == 1 + return + assert cur[r] == f0, ('warp frame mismatch', r, op, cur[r], f0) + a = abs(op) + lin = G_of[a] + if op > 0: + ok = basis([lin(x) for x in frames[f0]]) == tuple(frames[f1]) + else: + ok = basis([lin(x) for x in frames[f1]]) == tuple(frames[f0]) + assert ok, ('warp G does not carry the frame', op, f0, f1) + cur[r] = f1 + warp_edges.add((1 if op > 0 else -1, a, f0, f1)) + + # zero-frame phase + for e in precondition + compensation: + if e[0] == 'tadd': + assert start[e[2]] == 0 and start[e[1]] == 0 and e[-1] == 0 and e[2] not in set(wrapped_regs) and all(op != 0 for op in e[3]) + for ev in expand_tadd(e): + if ev[0] == 'warp': + do_warp(ev) # frame 0 -> 0: K_G itself is the physical operator + continue + for r in regs_of(e): + assert start[r] == 0 and e[-1] == 0, ('zero-frame precondition on a nonzero entrance', e) + for part in ('A', 'B'): + if part == 'B': + assert all(cur[r] == f for r, f in zip(centers, center_frames)) + assert all(cur[v + t] == levels.get(str(t), 0) for t in range(v)) + for r, frame in zip(centers, center_frames): + served = {levels.get(str(e[1] - v), 0) for e in cut if e[2] == r} + old = frame + for f in sorted(served, key=lambda f: -len(frames[f])): + assert contains(f, old) + if old != f: + paid[len(frames[old]) - len(frames[f])] += 1 + edges.add((old, f)) + edges.add((f, old)) + old = f + for e in (A if part == 'A' else B): + if e[0] == 'warp': + do_warp(e) + else: + for r in regs_of(e): + climb(r, e[-1]) + for e in tail: + for r in regs_of(e): + climb(r, e[-1]) + for r, f in enumerate(final): + climb(r, f) + for e in cleanup: + if e[0] == 'warp': + do_warp(e) + continue + for r in gate_regs(e): + if isinstance(r, list): + assert r[0] == 'Z' and r[1] in set(zero_buffers) and e[-1] == 1 + else: + assert final[r] == 1 and e[-1] == 1, ('cleanup on a non-FULL end', e) + assert all(len(frames[final[r]]) < h for r in zero_buffers) + assert set(zero_buffers) == set(helper_final) + rep = word['report'] + assert dict(paid) == {int(r): c for r, c in rep['local_profile'].items()}, ('paid profile differs', dict(paid), rep['local_profile']) + canonical['local_profile'] = dict(sorted(paid.items())) + canonical['edges'] = sorted(edges) + canonical['warp_edges'] = sorted(warp_edges) + out.mkdir(parents=True, exist_ok=False) + payload = json.dumps(canonical, sort_keys=True, separators=(',', ':')).encode() + (out / 'CANONICAL-WORD.json.gz').write_bytes(gzip.compress(payload, mtime=0)) + raw = word_path.read_bytes() + (out / 'FULL-WORD.json.gz').write_bytes(gzip.compress(gzip.decompress(raw) if word_path.suffix == '.gz' else raw, mtime=0)) + receipt = dict(status='PASS_BORROW_WORD_FREE_ALGEBRA_ALL_COLUMNS_AND_NATIVE_FRAMES', + input_content_sha256=hashlib.sha256(gzip.decompress(raw) if word_path.suffix == '.gz' else raw).hexdigest(), + canonical_content_sha256=hashlib.sha256(payload).hexdigest(), + live_columns_each_orientation=n, helpers=R, original_helpers=R0, removed_helpers=k, + zero_buffers=nz, warps=len(warps), warp_events=sum(e[0] == 'warp' for part, e in prog), + initial_corrections=len(word['initial_corrections']), + scalar_operations=len([1 for p, e in prog if e[0] != 'warp']), + local_profile=dict(sorted(paid.items())), local_rank_mass=sum(r * z for r, z in paid.items()), + widths=[len(frames[final[r]]) - len(frames[start[r]]) for r in range(2 * v, n)], + frames=len(frames), directed_edges=len(edges), warp_edge_classes=len(warp_edges), + seconds=time.monotonic() - t0, + scope='Fresh exact forward and inverse-transpose replay over a free noncommutative warp algebra on every arbitrary input, native frame chains, dyadic primitives, zero buffers returned to zero. Physical Clifford exactness of every warp is checked by the local replay and the phase recipes.') + (out / 'SCALAR-FRAME-AUDIT.json').write_text(json.dumps(receipt, indent=2) + '\n') + print(json.dumps({k_: x for k_, x in receipt.items() if k_ != 'widths'}, indent=2), flush=True) + + +if __name__ == '__main__': + ap = argparse.ArgumentParser(description=__doc__) + ap.add_argument('word', type=Path) + ap.add_argument('out', type=Path) + a = ap.parse_args() + run(a.word, a.out) diff --git a/research/staged-compensation-forests/frozen/reviews/c01-design/SOURCE-DEPENDENCIES.json b/research/staged-compensation-forests/frozen/reviews/c01-design/SOURCE-DEPENDENCIES.json new file mode 100644 index 0000000000..f5692951cd --- /dev/null +++ b/research/staged-compensation-forests/frozen/reviews/c01-design/SOURCE-DEPENDENCIES.json @@ -0,0 +1,51 @@ +{ + "files": [ + { + "commit": "3efbb5de06a49ffeea6684482f2d3fe48cdca3fb", + "path": "source-references/bw_transport.py", + "repository_path": "research/t74-native-fast/vendor/native/new/code/borrow/bw_transport.py", + "sha256": "9818e08b819310b40f1441b89be8c4369584a5b3fa5dfe9b86b1df9a7f5d6a76", + "usage": "frame-contract provenance, not executed by design" + }, + { + "commit": "3efbb5de06a49ffeea6684482f2d3fe48cdca3fb", + "path": "source-references/bw_emit.py", + "repository_path": "research/t74-native-fast/vendor/native/new/code/borrow/bw_emit.py", + "sha256": "99b59a6fa3feda86785e4225157dcb1a6169d256cec4f5e0acc9cea7a701df76", + "usage": "frame-contract provenance, not executed by design" + }, + { + "commit": "3efbb5de06a49ffeea6684482f2d3fe48cdca3fb", + "path": "artifacts/SOURCE-base.json.gz", + "repository_path": "research/staged-644-660-width-reduction/STAGED644-660-base.json.gz", + "sha256": "735c540b1fe29d0ceeb4d2f304ec941e5f2bd3bc92bafc8cce2b4f9a67a3b653", + "usage": "design mathematical input" + }, + { + "commit": "3efbb5de06a49ffeea6684482f2d3fe48cdca3fb", + "path": "artifacts/SOURCE-extra.json.gz", + "repository_path": "research/staged-644-660-width-reduction/STAGED644-660-extra.json.gz", + "sha256": "886338fc32da14f3389a82c8120a1bcf9c5e2f0ec3e9b2d377fdae809e1d977f", + "usage": "design mathematical input" + }, + { + "path": "artifacts/HISTORICAL-SHARED-COMPENSATION.json.gz", + "preserved_source": "kappa-3605-successor-20261018T0940Z/major-frontier/word-factory/SHARED-COMPENSATION-base.json.gz", + "sha256": "e7bdb1e299a43a8fcbdad4c598b7161e504a94691df3940a9a4eaf638f5013f0", + "usage": "same-C historical rank-basis comparator" + }, + { + "commit": "803e080e181229a3af2196b7a13615c9d81ae10d", + "path": "PR1080-CANONICAL-WORD.json.gz", + "sha256": "387a2266ffe006d20042221d967f67a4b18d9bb8de1cd1e01d4031b539fa74a5", + "usage": "different-matrix frozen source comparison" + }, + { + "commit": "803e080e181229a3af2196b7a13615c9d81ae10d", + "path": "PR1080-RECIPE.json", + "sha256": "d526804d9d627cbd850b0e54c3de9aadc74646e1a9b6befb577f42240720750a", + "usage": "one fixed prior-recipe transfer test" + } + ], + "scope": "Full frozen inputs for the three design/pricing/prior-comparison commands; source-reference files substantiate unexecuted frame-contract premises." +} diff --git a/research/staged-compensation-forests/frozen/reviews/c01-design/VALIDATION.json b/research/staged-compensation-forests/frozen/reviews/c01-design/VALIDATION.json new file mode 100644 index 0000000000..f4c5579438 --- /dev/null +++ b/research/staged-compensation-forests/frozen/reviews/c01-design/VALIDATION.json @@ -0,0 +1,80 @@ +{ + "arbitrary_columns_per_operator": 632, + "design_outputs_compared_whole_bytes": [ + "DESIGN.json", + "SOURCE-base.json.gz", + "FOREST-COMPENSATION-base.json.gz", + "FOREST-WORD-base.json.gz", + "TWO-SIDED-COMPENSATION-base.json.gz", + "TWO-SIDED-WORD-base.json.gz", + "SOURCE-extra.json.gz", + "FOREST-COMPENSATION-extra.json.gz", + "FOREST-WORD-extra.json.gz", + "TWO-SIDED-COMPENSATION-extra.json.gz", + "TWO-SIDED-WORD-extra.json.gz" + ], + "executed": [ + { + "mode": "normal", + "script": "design.py", + "status": "PASS", + "stdout": "base 31214 13716 10633 pairs 88 eligible 207\nextra 31214 13716 10633 pairs 88 eligible 207" + }, + { + "mode": "normal", + "script": "price_replay.py", + "status": "PASS", + "stdout": "PASS_LITERAL_HORNER_PRICES 21 coefficients" + }, + { + "mode": "normal", + "script": "compare_prior.py", + "status": "PASS", + "stdout": "PASS_PR1080_FIXED_TRANSFER_CHECK target_recipe_price 22548 unavailable 4 nonzero 14 nonfull 16" + }, + { + "mode": "optimized", + "script": "design.py", + "status": "PASS", + "stdout": "base 31214 13716 10633 pairs 88 eligible 207\nextra 31214 13716 10633 pairs 88 eligible 207" + }, + { + "mode": "optimized", + "script": "price_replay.py", + "status": "PASS", + "stdout": "PASS_LITERAL_HORNER_PRICES 21 coefficients" + }, + { + "mode": "optimized", + "script": "compare_prior.py", + "status": "PASS", + "stdout": "PASS_PR1080_FIXED_TRANSFER_CHECK target_recipe_price 22548 unavailable 4 nonzero 14 nonfull 16" + } + ], + "helper_only_counterexample_columns": 520, + "inputs_unchanged": true, + "no_native_chain_executed": true, + "normal_optimized_and_relocated_outputs_identical": true, + "operator_mutations_per_provider": 9, + "orientations_per_mutation": 3, + "primitive_coefficients_checked": 21, + "python_version": "Python 3.12.14", + "source_after": { + "PR1080-CANONICAL-WORD.json.gz": "387a2266ffe006d20042221d967f67a4b18d9bb8de1cd1e01d4031b539fa74a5", + "PR1080-RECIPE.json": "d526804d9d627cbd850b0e54c3de9aadc74646e1a9b6befb577f42240720750a", + "artifacts/HISTORICAL-SHARED-COMPENSATION.json.gz": "e7bdb1e299a43a8fcbdad4c598b7161e504a94691df3940a9a4eaf638f5013f0", + "artifacts/SOURCE-base.json.gz": "735c540b1fe29d0ceeb4d2f304ec941e5f2bd3bc92bafc8cce2b4f9a67a3b653", + "artifacts/SOURCE-extra.json.gz": "886338fc32da14f3389a82c8120a1bcf9c5e2f0ec3e9b2d377fdae809e1d977f", + "source-references/bw_emit.py": "99b59a6fa3feda86785e4225157dcb1a6169d256cec4f5e0acc9cea7a701df76", + "source-references/bw_transport.py": "9818e08b819310b40f1441b89be8c4369584a5b3fa5dfe9b86b1df9a7f5d6a76" + }, + "source_before": { + "PR1080-CANONICAL-WORD.json.gz": "387a2266ffe006d20042221d967f67a4b18d9bb8de1cd1e01d4031b539fa74a5", + "PR1080-RECIPE.json": "d526804d9d627cbd850b0e54c3de9aadc74646e1a9b6befb577f42240720750a", + "artifacts/HISTORICAL-SHARED-COMPENSATION.json.gz": "e7bdb1e299a43a8fcbdad4c598b7161e504a94691df3940a9a4eaf638f5013f0", + "artifacts/SOURCE-base.json.gz": "735c540b1fe29d0ceeb4d2f304ec941e5f2bd3bc92bafc8cce2b4f9a67a3b653", + "artifacts/SOURCE-extra.json.gz": "886338fc32da14f3389a82c8120a1bcf9c5e2f0ec3e9b2d377fdae809e1d977f", + "source-references/bw_emit.py": "99b59a6fa3feda86785e4225157dcb1a6169d256cec4f5e0acc9cea7a701df76", + "source-references/bw_transport.py": "9818e08b819310b40f1441b89be8c4369584a5b3fa5dfe9b86b1df9a7f5d6a76" + } +} diff --git a/research/staged-compensation-forests/frozen/reviews/c01-wholeword/SOURCE-DEPENDENCIES.json b/research/staged-compensation-forests/frozen/reviews/c01-wholeword/SOURCE-DEPENDENCIES.json new file mode 100644 index 0000000000..d2a5360ff2 --- /dev/null +++ b/research/staged-compensation-forests/frozen/reviews/c01-wholeword/SOURCE-DEPENDENCIES.json @@ -0,0 +1,63 @@ +{ + "files": [ + { + "head": "3efbb5de06a49ffeea6684482f2d3fe48cdca3fb", + "repository_path": "research/t74-native-fast/vendor/native/new/code/borrow/bw_transport.py", + "path": "bw_transport.py", + "sha256": "9818e08b819310b40f1441b89be8c4369584a5b3fa5dfe9b86b1df9a7f5d6a76", + "bytes": 17646 + }, + { + "head": "3efbb5de06a49ffeea6684482f2d3fe48cdca3fb", + "repository_path": "research/t74-native-fast/vendor/native/new/code/borrow/bw_emit.py", + "path": "bw_emit.py", + "sha256": "99b59a6fa3feda86785e4225157dcb1a6169d256cec4f5e0acc9cea7a701df76", + "bytes": 10012 + } + ], + "checker_input_bindings": { + "candidate_base": { + "bytes": 63913, + "decoded_sha256": "225cfbdf657b7aca21536948a5a810462393fe80d55e8662ae585dfafcdfdf3c", + "sha256": "52f37fbd972cf70ca3ec5edcb9a8bdb4e0bcffa06aa7179dcff4c938a4e7265d" + }, + "candidate_extra": { + "bytes": 63910, + "decoded_sha256": "20b8b7779904f7c33832f426489c192bf4b1ea0b7e53e041a5841e144d521f31", + "sha256": "0591b5386589c43cd10e9c516477bed5ea55d3fb28ee5eab02399b8750c3735d" + }, + "emitter_source": { + "bytes": 10012, + "decoded_sha256": "99b59a6fa3feda86785e4225157dcb1a6169d256cec4f5e0acc9cea7a701df76", + "sha256": "99b59a6fa3feda86785e4225157dcb1a6169d256cec4f5e0acc9cea7a701df76" + }, + "historical_panel_base": { + "bytes": 9960, + "decoded_sha256": "9f242abd5d2ed46a2e95dad46449d1d77c6fec330b5e0db6b324ac93fe756e62", + "sha256": "e7bdb1e299a43a8fcbdad4c598b7161e504a94691df3940a9a4eaf638f5013f0" + }, + "historical_panel_extra": { + "bytes": 9960, + "decoded_sha256": "9f242abd5d2ed46a2e95dad46449d1d77c6fec330b5e0db6b324ac93fe756e62", + "sha256": "e7bdb1e299a43a8fcbdad4c598b7161e504a94691df3940a9a4eaf638f5013f0" + }, + "source_base": { + "bytes": 72570, + "decoded_sha256": "94d33db98720483f57efcd7bf50657f29f710554474e4f6b4b90617ad4500263", + "sha256": "735c540b1fe29d0ceeb4d2f304ec941e5f2bd3bc92bafc8cce2b4f9a67a3b653" + }, + "source_extra": { + "bytes": 72568, + "decoded_sha256": "ec4b2e15beaf99be4a96a6056fd6e92d09ea2382a4d0e8ab321f10bb2fc1dd10", + "sha256": "886338fc32da14f3389a82c8120a1bcf9c5e2f0ec3e9b2d377fdae809e1d977f" + }, + "transport_source": { + "bytes": 17646, + "decoded_sha256": "9818e08b819310b40f1441b89be8c4369584a5b3fa5dfe9b86b1df9a7f5d6a76", + "sha256": "9818e08b819310b40f1441b89be8c4369584a5b3fa5dfe9b86b1df9a7f5d6a76" + } + }, + "source_head": "3efbb5de06a49ffeea6684482f2d3fe48cdca3fb", + "historical_panel": "C01 word-factory SHARED-COMPENSATION-{base,extra}.json.gz; immutable same-matrix rank-basis comparator", + "candidate_origin": "Sibling c01-design/artifacts/TWO-SIDED-WORD-{base,extra}.json.gz; only compensation changed" +} diff --git a/research/staged-compensation-forests/frozen/reviews/c01-wholeword/VALIDATION.json b/research/staged-compensation-forests/frozen/reviews/c01-wholeword/VALIDATION.json new file mode 100644 index 0000000000..c1adb5627e --- /dev/null +++ b/research/staged-compensation-forests/frozen/reviews/c01-wholeword/VALIDATION.json @@ -0,0 +1,72 @@ +{ + "python": "Python 3.12.14", + "runs": [ + { + "mode": "normal", + "returncode": 0, + "seconds": 17.47155079100048, + "command": [ + "/Users/ross/.cache/codex-runtimes/codex-primary-runtime/dependencies/python/bin/python3", + "-I", + "-B", + "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/c01-wholeword/check.py", + "--source-base", + "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/c01-design/artifacts/SOURCE-base.json.gz", + "--candidate-base", + "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/c01-design/artifacts/TWO-SIDED-WORD-base.json.gz", + "--historical-panel-base", + "/Users/ross/git/math/.research-automation/runs/kappa-3605-successor-20261018T0940Z/major-frontier/word-factory/SHARED-COMPENSATION-base.json.gz", + "--source-extra", + "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/c01-design/artifacts/SOURCE-extra.json.gz", + "--candidate-extra", + "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/c01-design/artifacts/TWO-SIDED-WORD-extra.json.gz", + "--historical-panel-extra", + "/Users/ross/git/math/.research-automation/runs/kappa-3605-successor-20261018T0940Z/major-frontier/word-factory/SHARED-COMPENSATION-extra.json.gz", + "--transport-source", + "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/c01-wholeword/bw_transport.py", + "--emitter-source", + "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/c01-wholeword/bw_emit.py", + "--output", + "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/c01-wholeword/CHECKS.json" + ] + }, + { + "mode": "optimized", + "returncode": 0, + "seconds": 12.394257875013864, + "command": [ + "/Users/ross/.cache/codex-runtimes/codex-primary-runtime/dependencies/python/bin/python3", + "-I", + "-O", + "-B", + "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/c01-wholeword/check.py", + "--source-base", + "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/c01-design/artifacts/SOURCE-base.json.gz", + "--candidate-base", + "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/c01-design/artifacts/TWO-SIDED-WORD-base.json.gz", + "--historical-panel-base", + "/Users/ross/git/math/.research-automation/runs/kappa-3605-successor-20261018T0940Z/major-frontier/word-factory/SHARED-COMPENSATION-base.json.gz", + "--source-extra", + "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/c01-design/artifacts/SOURCE-extra.json.gz", + "--candidate-extra", + "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/c01-design/artifacts/TWO-SIDED-WORD-extra.json.gz", + "--historical-panel-extra", + "/Users/ross/git/math/.research-automation/runs/kappa-3605-successor-20261018T0940Z/major-frontier/word-factory/SHARED-COMPENSATION-extra.json.gz", + "--transport-source", + "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/c01-wholeword/bw_transport.py", + "--emitter-source", + "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/c01-wholeword/bw_emit.py", + "--output", + "/Users/ross/git/math/.research-automation/runs/unpublished-round2-20261020T1106Z/c01-wholeword/CHECKS-OPTIMIZED.json" + ] + } + ], + "byte_identical_normal_and_optimized": true, + "receipt_bytes": 1013816, + "receipt_sha256": "bd442037a8dc9c2a27f6a1b1e8b1e45e5c934cb7129cee2db2f85d1c20f26ec1", + "checker_sha256": "16cdeef8aabed919c066ad5da45450cfc524024814f550b3415368ed098a38c6", + "prior_checker_sha256": "793a5ad6ab49640f732aed19788e4eb30f7af6fe30709ac917ae07c80959f725", + "prior_receipt_sha256": "49d8a49ed821c5ef1556fe90a94d0779188b14205144de55365405921f8b7307", + "mathematical_receipt_identical_except_checker_sha256": true, + "loader_fix": "Execute the exact authenticated producer byte buffer through stdin; compile dont_inherit=True,optimize=0 with preserved __file__ and sys.argv." +} diff --git a/research/staged-compensation-forests/independent_mst.py b/research/staged-compensation-forests/independent_mst.py new file mode 100644 index 0000000000..ca3dda5476 --- /dev/null +++ b/research/staged-compensation-forests/independent_mst.py @@ -0,0 +1,534 @@ +#!/usr/bin/env python3 +"""Independent Fraction audit of the fixed C01 forest and helper basis. + +No builder or producer code is imported or executed. The producer's default +frame expressions are read from its pinned AST. All outputs must be external +to the two input directories. Prepared with substantial OpenAI Codex assistance. +""" +import argparse +import ast +from collections import Counter +from fractions import Fraction +from functools import lru_cache +import gzip +import hashlib +import heapq +import json +from pathlib import Path + +Q = Fraction +SOURCE_PINS = { + "base": "735c540b1fe29d0ceeb4d2f304ec941e5f2bd3bc92bafc8cce2b4f9a67a3b653", + "extra": "886338fc32da14f3389a82c8120a1bcf9c5e2f0ec3e9b2d377fdae809e1d977f", +} +TRANSPORT_PIN = "9818e08b819310b40f1441b89be8c4369584a5b3fa5dfe9b86b1df9a7f5d6a76" +TARGETS = tuple(range(112, 224)) + + +def require(ok, message): + if not ok: + raise ValueError(message) + + +def canonical(value): + return json.dumps(value, sort_keys=True, separators=(",", ":")).encode() + + +def digest(raw): + return hashlib.sha256(raw).hexdigest() + + +def load(path, bindings, label, pin=None): + raw = path.read_bytes() + if pin is not None: + require(digest(raw) == pin, "pinned input: " + label) + decoded = gzip.decompress(raw) if raw.startswith(b"\x1f\x8b") else raw + bindings[label] = {"sha256": digest(raw), "decoded_sha256": digest(decoded)} + return json.loads(decoded) + + +@lru_cache(maxsize=None) +def tariff(q): + """Count a literal cleared-work Horner program, using exact rationals.""" + if not q: + return 0 + work, count = Q(0), 1 # initial private CLEAR + digits = bin(abs(q.numerator))[2:] + for position, bit in enumerate(digits): + if position: + work *= 2 + count += 1 + if bit == "1": + work += 1 + count += 1 + denominator = q.denominator + while denominator != 1: + require(denominator % 2 == 0, "non-dyadic price") + work /= 2 + denominator //= 2 + count += 1 + require(work == abs(q), "Horner coefficient reconstruction") + return count + 2 # signed target ADD and final private CLEAR + + +def accumulate(dst, src, q): + for column, coefficient in src.items(): + value = dst.get(column, Q(0)) + q * coefficient + if value: + dst[column] = value + else: + dst.pop(column, None) + + +def difference(left, right, sign): + row = dict(left) + accumulate(row, right, -sign) + return row + + +def row_price(row): + return sum(tariff(q) for q in row.values()) + + +def gate(dst, src, q): + return ["add", dst, src, q.numerator, q.denominator, []] + + +def coefficient(event): + require(type(event) is list and len(event) == 6 and event[0] == "add" + and event[5] == [], "addition and ZERO-frame schema") + require(all(type(x) is int for x in event[1:5]) + and event[1] != event[2] and event[4] > 0, "addition coordinates") + q = Q(event[3], event[4]) + require(q != 0 and q.denominator & (q.denominator - 1) == 0, + "nonzero dyadic addition") + return q + + +def inverse(events): + return [gate(e[1], e[2], -coefficient(e)) for e in reversed(events)] + + +def sparse_matrix(events, helpers): + result = {t: {} for t in TARGETS} + for e in events: + q = coefficient(e) + require(e[1] in result and e[2] in helpers, "residual injection coordinates") + accumulate(result[e[1]], {e[2]: Q(1)}, q) + return result + + +def matrix_serial(matrix): + return [[r, [[c, str(q)] for c, q in sorted(row.items())]] + for r, row in sorted(matrix.items())] + + +def bill(events): + values = [coefficient(e) for e in events] + return {"logical_additions": len(events), + "component_primitives": sum(map(tariff, values)), + "coefficient_histogram": dict(sorted(Counter(map(str, values)).items()))} + + +def frame_contract(raw): + """Bind the reviewed default-frame formulas without running the producer.""" + require(digest(raw) == TRANSPORT_PIN, "pinned transport source") + tree = ast.parse(raw) + functions = [n for n in tree.body if isinstance(n, ast.FunctionDef) and n.name == "run"] + require(len(functions) == 1, "unique producer run") + expected = { + "start": "[fid([p]) for p in ports] + [0] * (v + R)", + "final": "[1] * v + [fid(x for x in range(1, 1 << h) if (x & p).bit_count() % 2 == 0) for p in ports] + [1] * R", + } + for name, expression in expected.items(): + nodes = [n.value for n in functions[0].body if isinstance(n, ast.Assign) + and any(isinstance(t, ast.Name) and t.id == name for t in n.targets)] + require(len(nodes) == 1, "unique default frame assignment") + require(ast.dump(nodes[0]) == ast.dump(ast.parse(expression, mode="eval").body), + "producer default frame expression") + return {"transport_sha256": TRANSPORT_PIN, + "helper_default_entrance": "ZERO", + "helper_default_terminal": "FULL", + "producer_executed": False} + + +def eligible_helpers(word, helpers): + require(word["report"]["v"] == 112 and word["report"]["h"] == 9, + "source geometry") + n = 224 + word["report"]["R"] + require(n == 704 and len(set(word["removed"])) == len(word["removed"]), + "source register inventory") + require(all(224 <= r < n for r in word["removed"]), "removed helper domain") + unavailable = set(word["removed"]) + extra = {int(k) for k in word["start_extra"]} + nonfull = {int(k) for k in word["helper_final"]} + require(all(224 <= h < n and h not in unavailable for h in helpers), + "active helper availability") + require(not (set(helpers) & extra), "helper ZERO entrance") + require(not (set(helpers) & nonfull), "helper FULL terminal") + return list(helpers) + + +def graph_certificate(C, record): + edges = [] + for t in TARGETS: + edges.append([row_price(C[t]), -1, t, 0]) + for t in TARGETS: + for p in TARGETS: + if p >= t: + break + for sign in (-1, 1): + edges.append([8 + row_price(difference(C[t], C[p], sign)), + p, t, sign]) + edges.sort() + require(len(edges) == 112 + 2 * (112 * 111 // 2) == 12544, "all signed graph edges") + require(record["edge_count"] == len(edges) + and record["edge_census_sha256"] == digest(canonical(edges)), + "builder edge census differs") + prices = {(a, b, s): cost for cost, a, b, s in edges} + nodes = (-1,) + TARGETS + adjacency = {v: [] for v in nodes} + tree = record["tree"] + require(len(tree) == 112 and len({tuple(e[1:]) for e in tree}) == 112, + "tree inventory") + for cost, a, b, sign in tree: + require(prices.get((a, b, sign)) == cost, "tree edge price") + adjacency[a].append((b, sign, cost)) + adjacency[b].append((a, sign, cost)) + parents, depths = {-1: None}, {-1: 0} + queue = [-1] + for node in queue: + for child, sign, cost in sorted(adjacency[node]): + if child not in parents: + parents[child] = [node, sign, cost] + depths[child] = depths[node] + 1 + queue.append(child) + require(len(parents) == 113, "tree spans every target") + require({str(k): v for k, v in parents.items()} == record["parent"], "tree parent record") + pathmax = {} + for start in nodes: + maximum, todo = {start: 0}, [start] + for node in todo: + for nxt, sign, cost in adjacency[node]: + if nxt not in maximum: + maximum[nxt] = max(maximum[node], cost) + todo.append(nxt) + pathmax[start] = maximum + slacks = [cost - pathmax[a][b] for cost, a, b, sign in edges] + require(all(s >= 0 for s in slacks), "MST cycle inequality") + # Independently solve with a heap-based Prim traversal of our priced graph. + graph = {v: [] for v in nodes} + for cost, a, b, sign in edges: + graph[a].append((cost, b)) + graph[b].append((cost, a)) + seen, heap, prim = {-1}, list(graph[-1]), 0 + heapq.heapify(heap) + while len(seen) < len(nodes): + require(bool(heap), "Prim graph connectivity") + cost, nxt = heapq.heappop(heap) + if nxt in seen: + continue + prim += cost + seen.add(nxt) + for item in graph[nxt]: + if item[1] not in seen: + heapq.heappush(heap, item) + require(prim == sum(e[0] for e in tree) == record["prim_cost"] == 13716, + "independent forest minimum") + return parents, depths, { + "edge_count": len(edges), "root_edges": 112, "signed_pair_edges": len(edges) - 112, + "edge_census_sha256": digest(canonical(edges)), + "all_cycle_inequalities_checked": len(slacks), + "cycle_slack_histogram": dict(sorted(Counter(slacks).items())), + "cycle_slacks_sha256": digest(canonical(slacks)), + "independent_heap_Prim_price": prim, + "tree": tree, "roots": sum(parents[t][0] == -1 for t in TARGETS), + "target_edges": sum(parents[t][0] != -1 for t in TARGETS), + "maximum_forest_depth": max(depths.values()) - 1, + } + + +def target_preparation(events, parents): + expected = {(t, parents[t][0], Q(-parents[t][1])) for t in TARGETS + if parents[t][0] != -1} + actual = [(e[1], e[2], coefficient(e)) for e in events] + require(set(actual) == expected and len(actual) == len(expected), + "target forest basis gates") + positions = {t: i for i, (t, p, q) in enumerate(actual)} + for t, p, q in actual: + require(p not in positions or positions[t] < positions[p], + "leaf before parent preparation") + + +def transformed_rows(C, parents): + return {t: dict(C[t]) if parents[t][0] == -1 + else difference(C[t], C[parents[t][0]], parents[t][1]) for t in TARGETS} + + +def helper_certificate(D, helpers, record): + columns = {h: {t: D[t][h] for t in TARGETS if h in D[t]} for h in helpers} + candidates = [] + for a in helpers: + for b in helpers: + if a == b: + continue + for sign in (-1, 1): + gain = row_price(columns[b]) - row_price(difference(columns[b], columns[a], sign)) - 8 + candidates.append([gain, a, b, sign]) + require(len(candidates) == 2 * 207 * 206 == 85284, "all helper candidate scores") + require(record["helper_candidate_count"] == len(candidates) + and record["helper_candidates_sha256"] == digest(canonical(candidates)), + "builder helper score census differs") + positive = sorted((e for e in candidates if e[0] > 0), + key=lambda e: (-e[0], e[1:])) + used, pairs = set(), [] + for gain, a, b, sign in positive: + if a not in used and b not in used: + pairs.append([gain, a, b, sign]) + used.update((a, b)) + require(pairs == record["pairs"] and len(pairs) == 88 and len(used) == 176, + "88 disjoint attaining helper pairs") + E = {t: dict(row) for t, row in D.items()} + for gain, a, b, sign in pairs: + for t in TARGETS: + value = D[t].get(b, Q(0)) - sign * D[t].get(a, Q(0)) + if value: + E[t][b] = value + else: + E[t].pop(b, None) + return pairs, E, { + "candidate_count": len(candidates), "candidate_sha256": digest(canonical(candidates)), + "positive_candidates": len(positive), "pairs": pairs, + "disjoint_helpers": len(used), "total_additive_saving": sum(e[0] for e in pairs), + "joint_optimum_claimed": False, + } + + +def endpoint(events, live, mode): + rows = {r: {r: Q(1)} for r in live} + stream = inverse(events) if mode == "inverse" else events + for e in stream: + q, dst, src = coefficient(e), e[1], e[2] + if mode == "dual": + dst, src, q = src, dst, -q + require(dst in rows and src in rows, "panel live register") + accumulate(rows[dst], rows[src], q) + return rows + + +def expected_endpoint(C, live, mode): + rows = {r: {r: Q(1)} for r in live} + for target, row in C.items(): + for helper, q in row.items(): + if mode == "dual": + rows[helper][target] = -q + else: + rows[target][helper] = q if mode == "forward" else -q + return rows + + +def defect(actual, expected): + for row in sorted(expected): + if actual[row] != expected[row]: + for column in sorted(set(actual[row]) | set(expected[row])): + if actual[row].get(column, 0) != expected[row].get(column, 0): + return {"row": row, "column": column, + "actual": str(actual[row].get(column, Q(0))), + "expected": str(expected[row].get(column, Q(0)))} + return None + + +def complete_endpoint_gate(actual, expected): + require(defect(actual, expected) is None, "complete arbitrary-input panel endpoint") + + +def rejects(label, action, expected_error): + try: + action() + except ValueError as error: + require(str(error) == expected_error, "wrong rejection for " + label + ": " + str(error)) + return {"name": label, "intended_gate": expected_error} + raise ValueError("control accepted: " + label) + + +def panel_controls(C, live, T, H, injection, Hi, Ti, parents, word, helpers): + global require + expected = expected_endpoint(C, live, "forward") + def flipped(events, index): + answer = [list(e) for e in events] + answer[index] = gate(events[index][1], events[index][2], -coefficient(events[index])) + return answer + original = [gate(t, h, q) for t, row in C.items() for h, q in row.items()] + variants = { + "omit_target_preparation": H + injection + Hi + Ti, + "wrong_target_basis_sign": flipped(T, 0) + H + injection + Hi + Ti, + "parent_before_child": list(reversed(T)) + H + injection + Hi + Ti, + "omit_helper_preparation": T + injection + Hi + Ti, + "wrong_helper_basis_sign": T + flipped(H, 0) + injection + Hi + Ti, + "stale_untransformed_residual": T + H + original + Hi + Ti, + "wrong_residual_sign": T + H + flipped(injection, 0) + Hi + Ti, + "omit_helper_restoration": T + H + injection + Ti, + "omit_target_restoration": T + H + injection + Hi, + "wrong_target_restoration_order": T + H + injection + Hi + list(reversed(Ti)), + } + controls = [] + for label, events in variants.items(): + actual = endpoint(events, live, "forward") + witness = defect(actual, expected) + require(witness is not None, "effective mathematical mutation: " + label) + record = rejects(label, lambda: complete_endpoint_gate(actual, expected), + "complete arbitrary-input panel endpoint") + record["witness"] = witness + controls.append(record) + controls.append(rejects("explicit_leaf_order_check", + lambda: target_preparation(list(reversed(T)), parents), + "leaf before parent preparation")) + changed = dict(word) + changed["start_extra"] = dict(word["start_extra"], **{str(helpers[0]): [1]}) + controls.append(rejects("nonzero_helper_entrance", + lambda: eligible_helpers(changed, helpers), "helper ZERO entrance")) + changed = dict(word) + changed["helper_final"] = dict(word["helper_final"], **{str(helpers[0]): [1]}) + controls.append(rejects("nonfull_helper_terminal", + lambda: eligible_helpers(changed, helpers), "helper FULL terminal")) + # Deliberately remove precisely the named endpoint requirement. The + # negative-control helper must then fail because the mutant was accepted. + saved = require + actual = endpoint(variants["omit_helper_restoration"], live, "forward") + try: + require = lambda ok, message: None if message == "complete arbitrary-input panel endpoint" else saved(ok, message) + try: + rejects("deleted_endpoint_gate", lambda: complete_endpoint_gate(actual, expected), + "complete arbitrary-input panel endpoint") + except ValueError as error: + saved(str(error) == "control accepted: deleted_endpoint_gate", "check-deletion sensitivity") + else: + raise ValueError("deleted endpoint gate was not detected") + finally: + require = saved + full = T + H + injection + Hi + Ti + paid_pair = [gate(TARGETS[0], helpers[0], Q(1)), gate(TARGETS[0], helpers[0], Q(-1))] + for mode in ("forward", "inverse", "dual"): + complete_endpoint_gate(endpoint(full + paid_pair, live, mode), expected_endpoint(C, live, mode)) + require(bill(full + paid_pair)["component_primitives"] == bill(full)["component_primitives"] + 8, + "positive cancelling pair must be paid") + omitted = endpoint(variants["omit_target_preparation"], live, "forward") + outside = [c for c in live if c not in TARGETS] + require(all(omitted[r].get(c, 0) == expected[r].get(c, 0) for r in live for c in outside), + "helper-only projection counterexample") + return {"rejections": controls, "named_endpoint_check_deletion_detected": True, + "paid_cancelling_pair": {"accepted_all_three_orientations": True, + "added_component_primitives": 8}, + "omitted_target_preparation_passes_helper_only_projection": True} + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--source-dir", type=Path, required=True) + parser.add_argument("--candidate-dir", type=Path, required=True) + parser.add_argument("--transport-source", type=Path, required=True) + parser.add_argument("--output", type=Path, required=True) + args = parser.parse_args() + require(not any(args.output.resolve().is_relative_to(p.resolve()) + for p in (args.source_dir, args.candidate_dir)), "output must be external") + bindings = {} + transport = args.transport_source.read_bytes() + defaults = frame_contract(transport) + bindings["transport"] = {"sha256": digest(transport)} + design = load(args.candidate_dir / "DESIGN.json", bindings, "DESIGN") + require(design["head"] == "3efbb5de06a49ffeea6684482f2d3fe48cdca3fb", "source Git pin") + providers, common, common_C = {}, None, None + for provider in ("base", "extra"): + word = load(args.source_dir / f"SOURCE-{provider}.json.gz", + bindings, "source-" + provider, SOURCE_PINS[provider]) + active = sorted({e[2] for e in word["compensation"]}) + require(len(active) == 207, "all active helper columns") + C = sparse_matrix(word["compensation"], set(active)) + require(sum(map(len, C.values())) == len(word["compensation"]) == 5736, + "unaggregated fixed compensation") + eligible = eligible_helpers(word, active) + record = design["providers"][provider] + require(record["active_helpers"] == active == record["eligible_helpers"], + "helper frame eligibility record") + if common is None: + parents, depths, graph = graph_certificate(C, record) + D = transformed_rows(C, parents) + pairs, E, helper = helper_certificate(D, eligible, record) + common = {"matrix_sha256": digest(canonical(matrix_serial(C))), + "target_residual_sha256": digest(canonical(matrix_serial(D))), + "two_sided_residual_sha256": digest(canonical(matrix_serial(E))), + "graph": graph, "helper_construction": helper} + common_C = C + core_record = {k: record[k] for k in ("tree", "parent", "pairs", "edge_census_sha256", + "helper_candidates_sha256", "prim_cost")} + else: + require(C == common_C, "same C in both providers") + require(core_record == {k: record[k] for k in core_record}, "same fixed construction") + live = sorted(set(range(704)) - set(word["removed"])) + nt, nh, ni = 95, 88, 1922 + panels, audits = {}, {} + for variant, M in (("FOREST", D), ("TWO-SIDED", E)): + panel = load(args.candidate_dir / f"{variant}-COMPENSATION-{provider}.json.gz", + bindings, variant + "-panel-" + provider) + candidate = load(args.candidate_dir / f"{variant}-WORD-{provider}.json.gz", + bindings, variant + "-word-" + provider) + require(set(candidate) == set(word) + and all(candidate[k] == word[k] for k in word if k != "compensation"), + "outside compensation unchanged") + require(candidate["compensation"] == panel, "whole word uses audited compensation") + T = panel[:nt] + target_preparation(T, parents) + # Applying the literal T to C independently recovers the stated TC. + literal_D = {t: dict(row) for t, row in C.items()} + for e in T: + accumulate(literal_D[e[1]], literal_D[e[2]], coefficient(e)) + require(literal_D == D, "literal target basis gives TC") + if variant == "FOREST": + injection, Ti = panel[nt:-nt], panel[-nt:] + require(Ti == inverse(T), "literal target inverse") + else: + H = panel[nt:nt+nh] + injection = panel[nt+nh:nt+nh+ni] + Hi = panel[nt+nh+ni:nt+2*nh+ni] + Ti = panel[nt+2*nh+ni:] + require(H == [gate(a, b, Q(sign)) for gain, a, b, sign in pairs], + "literal disjoint helper basis") + require(Hi == inverse(H) and Ti == inverse(T), "literal two-sided inverses") + require(sparse_matrix(injection, set(active)) == M + and len(injection) == sum(map(len, M.values())), + "complete residual TCH^-1") + checks = {} + for mode in ("forward", "inverse", "dual"): + rows = endpoint(panel, live, mode) + complete_endpoint_gate(rows, expected_endpoint(C, live, mode)) + checks[mode] = {"all_input_columns": len(live), + "operator_sha256": digest(canonical(matrix_serial(rows)))} + invoice = bill(panel) + name = "target_only_bill" if variant == "FOREST" else "two_sided_bill" + require(invoice == record[name], "complete literal bill") + audits[variant] = {"bill": invoice, "orientations": checks, + "residual_nonzeros": len(injection)} + panels[variant] = panel + require(bill(word["compensation"]) == record["original_bill"], "original full bill") + require([record[k]["component_primitives"] for k in + ("original_bill", "target_only_bill", "two_sided_bill")] == [31214, 13716, 10633], + "fixed price comparison") + require(13716 - common["helper_construction"]["total_additive_saving"] == 10633, + "helper scores include both basis directions") + controls = panel_controls(C, live, T, H, injection, Hi, Ti, parents, word, active) + providers[provider] = {"live_registers": len(live), "active_and_eligible_helpers": active, + "original_bill": bill(word["compensation"]), + "audits": audits, "controls": controls} + result = {"status": "PASS_INDEPENDENT_FRACTION_FOREST_AND_BASES", + "source_head": design["head"], "source_bindings": bindings, + "producer_default_frames": defaults, "common": common, "providers": providers, + "tariffs": {str(q): tariff(q) for q in sorted( + {coefficient(e) for panel in panels.values() for e in panel})}, + "scope": "Fixed single-parent signed-unit target forest minimum and a disjoint helper construction. All live input columns; no joint basis optimum, whole-word precision or new kappa claim."} + args.output.write_text(json.dumps(result, indent=2, sort_keys=True) + "\n") + print(result["status"], "edges=12544", "helper_scores=85284", "pairs=88", + "prices=31214,13716,10633") + + +if __name__ == "__main__": + main() diff --git a/research/staged-compensation-forests/price_replay.py b/research/staged-compensation-forests/price_replay.py new file mode 100644 index 0000000000..9e0a0a0c22 --- /dev/null +++ b/research/staged-compensation-forests/price_replay.py @@ -0,0 +1,115 @@ +"""Independent literal Horner price and three-symbol microcircuit replay.""" +import argparse +from collections import Counter +from fractions import Fraction as Q +import gzip +import hashlib +import json +from pathlib import Path + + +def require(ok, message): + if not ok: + raise ValueError(message) + + +def primitives(q): + require(q != 0, "zero coefficient is not emitted") + n = abs(q.numerator) + d = q.denominator + steps = [("clear", "w")] + for position, bit in enumerate(bin(n)[2:]): + if position: + steps.append(("double", "w")) + if bit == "1": + steps.append(("add", "w", "s", 1)) + while d > 1: + require(d % 2 == 0, "non-dyadic coefficient") + steps.append(("halve", "w")) + d //= 2 + steps.append(("add", "t", "w", 1 if q > 0 else -1)) + steps.append(("clear", "w")) + return steps + + +def check_microcircuit(q): + steps = primitives(q) + rows = {"s": [Q(1), Q(0), Q(0)], + "t": [Q(0), Q(1), Q(0)], + "w": [Q(0), Q(0), Q(1)]} + for step in steps: + op, dst, *rest = step + if op == "clear": + rows[dst] = [Q(0)] * 3 + elif op == "double": + rows[dst] = [2 * a for a in rows[dst]] + elif op == "halve": + rows[dst] = [a / 2 for a in rows[dst]] + elif op == "add": + src, sign = rest + rows[dst] = [a + sign * b for a, b in zip(rows[dst], rows[src])] + else: + raise ValueError(op) + require(rows == {"s": [Q(1), Q(0), Q(0)], + "t": [q, Q(1), Q(0)], + "w": [Q(0), Q(0), Q(0)]}, "coefficient microcircuit") + return len(steps) + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("--artifacts", type=Path, required=True) + parser.add_argument("--output", type=Path, required=True) + args = parser.parse_args() + require(args.artifacts.resolve() not in args.output.resolve().parents, + "output must be outside frozen artifact directory") + files = { + "original": ("SOURCE-base.json.gz", "compensation"), + "historical-rank-basis": ("HISTORICAL-SHARED-COMPENSATION.json.gz", None), + "forest": ("FOREST-COMPENSATION-base.json.gz", None), + "two-sided": ("TWO-SIDED-COMPENSATION-base.json.gz", None), + } + panels, digests = {}, {} + for name, (path, key) in files.items(): + raw = (args.artifacts / path).read_bytes() + decoded = gzip.decompress(raw) + value = json.loads(decoded) + panels[name] = value[key] if key else value + digests[name] = { + "input": path, + "compressed_sha256": hashlib.sha256(raw).hexdigest(), + "decoded_sha256": hashlib.sha256(decoded).hexdigest(), + } + require(digests["original"]["compressed_sha256"] == + "735c540b1fe29d0ceeb4d2f304ec941e5f2bd3bc92bafc8cce2b4f9a67a3b653", + "original source pin") + require(digests["historical-rank-basis"]["decoded_sha256"] == + "9f242abd5d2ed46a2e95dad46449d1d77c6fec330b5e0db6b324ac93fe756e62", + "historical same-C source pin") + coefficients = {Q(g[3], g[4]) for panel in panels.values() for g in panel} + costs = {q: check_microcircuit(q) for q in coefficients} + bills = { + name: {"logical_additions": len(panel), + "component_primitives": sum(costs[Q(g[3], g[4])] for g in panel), + "histogram": dict(sorted(Counter(str(Q(g[3], g[4])) for g in panel).items()))} + for name, panel in panels.items() + } + require([bills[k]["component_primitives"] for k in files] == + [31214, 17334, 13716, 10633], "complete independent literal prices") + results = { + "source_bindings": digests, + "microcircuit_coefficients": {str(q): costs[q] for q in sorted(costs)}, + "arbitrary_microcircuit_input_symbols": ["source", "target", "coefficient-work"], + "private_work_output": "zero", + "bills": bills, + "two_real_component_savings_vs_original": 41162, + "two_real_component_savings_vs_historical_rank_basis": 13402, + "two_real_component_savings_vs_target_forest": 6166, + "scope": "Independent emitted Horner microcircuit count; not a whole-supplier precision or tape invoice.", + } + args.output.write_text(json.dumps(results, sort_keys=True, indent=2) + "\n") + print("PASS_LITERAL_HORNER_PRICES", len(costs), "coefficients") + + +if __name__ == "__main__": + main() diff --git a/research/staged-compensation-forests/verify.py b/research/staged-compensation-forests/verify.py new file mode 100644 index 0000000000..dd1fc936f5 --- /dev/null +++ b/research/staged-compensation-forests/verify.py @@ -0,0 +1,208 @@ +#!/usr/bin/env python3 +"""Authenticate and replay the finite staged compensation package. + +Ross Richardson with substantial OpenAI Codex assistance. Apache-2.0. +""" +import argparse +import gzip +import hashlib +import json +from pathlib import Path, PurePosixPath +import subprocess +import sys +import tempfile + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def unique_object(pairs): + result = {} + for key, value in pairs: + require(key not in result, "duplicate JSON key: " + key) + result[key] = value + return result + + +def invalid_constant(value): + raise ValueError("nonfinite JSON constant: " + value) + + +def decoded(raw): + return gzip.decompress(raw) if raw.startswith(b"\x1f\x8b") else raw + + +def data(raw): + return json.loads(decoded(raw), object_pairs_hook=unique_object, + parse_constant=invalid_constant) + + +def canonical(value): + return json.dumps(value, sort_keys=True, separators=(",", ":"), + ensure_ascii=False, allow_nan=False) + + +def digest(raw): + return hashlib.sha256(raw).hexdigest() + + +class Frozen: + def __init__(self, root): + self.root = Path(root).resolve() + self.hashes = data((self.root / "FROZEN-SHA256.json").read_bytes()) + self.origins = data((self.root / "ORIGINS.json").read_bytes()) + self.compared = [] + + def path(self, name): + parts = PurePosixPath(name) + require(not parts.is_absolute() and ".." not in parts.parts, + "unsafe package path") + path = self.root / name + require(path.is_file() and not path.is_symlink(), "missing regular input: " + name) + require(path.resolve().is_relative_to(self.root), "input escapes package") + return path + + def raw(self, name): + require(name in self.hashes, "unregistered input: " + name) + raw = self.path(name).read_bytes() + require(digest(raw) == self.hashes[name], "changed frozen input: " + name) + return raw + + def check_all(self): + require(set(self.origins) == set(self.hashes), "frozen/origin inventory mismatch") + for name in self.hashes: + raw = self.raw(name) + origin = self.origins[name] + require(origin["sha256"] == digest(raw), "origin digest mismatch: " + name) + if "original_sha256" in origin: + require(digest(decoded(raw)) == origin["original_sha256"], + "original decoded bytes changed: " + name) + + def compare(self, expected, generated): + require(canonical(data(self.raw(expected))) == canonical(data(generated)), + "complete typed record mismatch: " + expected) + self.compared.append(expected) + + def run(self, script, arguments): + source = self.raw(script) + bootstrap = ( + "import sys\n" + "source = sys.stdin.buffer.read()\n" + "sys.argv = sys.argv[1:]\n" + "namespace = {'__name__': '__main__', '__file__': sys.argv[0]}\n" + "exec(compile(source, sys.argv[0], 'exec', dont_inherit=True, optimize=0), namespace)\n" + ) + completed = subprocess.run( + [sys.executable, "-I", "-B", "-c", bootstrap, + str(self.path(script)), *map(str, arguments)], + cwd=self.root, input=source, capture_output=True, check=False) + require(completed.returncode == 0, + "checker failed: " + script + "\n" + + completed.stdout.decode(errors="replace") + + completed.stderr.decode(errors="replace")) + + +def construction_names(): + names = {"DESIGN.json"} + for provider in ("base", "extra"): + names.add("SOURCE-" + provider + ".json.gz") + for family in ("FOREST", "TWO-SIDED"): + for kind in ("COMPENSATION", "WORD"): + names.add(f"{family}-{kind}-{provider}.json.gz") + return names + + +def expected_records(stage): + if stage == "construction": + return {"artifacts/" + name for name in construction_names()} | { + "artifacts/PRICES.json", "artifacts/PR1080-COMPARISON.json"} + return {"forest": {"artifacts/INDEPENDENT-FOREST.json.gz"}, + "wholeword": {"artifacts/WHOLE-WORD.json.gz"}}[stage] + + +def check_coverage(stage, compared): + expected = expected_records(stage) + require(set(compared) == expected and len(compared) == len(expected), + "complete stage record coverage changed: " + stage) + + +def construction(frozen, scratch): + output = scratch / "construction" + frozen.run("construct.py", [ + "--source-dir", frozen.root / "frozen/inputs", "--out", output]) + names = construction_names() + require({p.name for p in output.iterdir()} == names, + "construction output inventory changed") + for name in sorted(names): + frozen.compare("artifacts/" + name, (output / name).read_bytes()) + price = scratch / "prices.json" + frozen.run("price_replay.py", [ + "--artifacts", frozen.root / "artifacts", "--output", price]) + frozen.compare("artifacts/PRICES.json", price.read_bytes()) + prior = scratch / "prior.json" + frozen.run("compare_prior.py", [ + "--current-word", frozen.root / "frozen/inputs/SOURCE-base.json.gz", + "--prior-word", frozen.root / "frozen/prior/PR1080-CANONICAL-WORD.json.gz", + "--prior-recipe", frozen.root / "frozen/prior/PR1080-RECIPE.json", + "--output", prior]) + frozen.compare("artifacts/PR1080-COMPARISON.json", prior.read_bytes()) + + +def forest(frozen, scratch): + output = scratch / "forest.json" + frozen.run("independent_mst.py", [ + "--source-dir", frozen.root / "frozen/inputs", + "--candidate-dir", frozen.root / "artifacts", + "--transport-source", frozen.root / "frozen/producers/bw_transport.py", + "--output", output]) + frozen.compare("artifacts/INDEPENDENT-FOREST.json.gz", output.read_bytes()) + + +def wholeword(frozen, scratch): + output = scratch / "wholeword.json" + arguments = [] + for provider in ("base", "extra"): + arguments += ["--source-" + provider, + frozen.root / f"frozen/inputs/SOURCE-{provider}.json.gz", + "--candidate-" + provider, + frozen.root / f"artifacts/TWO-SIDED-WORD-{provider}.json.gz", + "--historical-panel-" + provider, + frozen.root / f"frozen/inputs/HISTORICAL-{provider}.json.gz"] + arguments += [ + "--transport-source", frozen.root / "frozen/producers/bw_transport.py", + "--emitter-source", frozen.root / "frozen/producers/bw_emit.py", + "--output", output] + frozen.run("check_word.py", arguments) + frozen.compare("artifacts/WHOLE-WORD.json.gz", output.read_bytes()) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--stage", required=True, + choices=("construction", "forest", "wholeword")) + parser.add_argument("--output", type=Path) + args = parser.parse_args() + root = Path(__file__).resolve().parent + if args.output: + output = args.output.resolve() + require(not output.is_relative_to(root), "output must be outside package") + require(not output.exists(), "output already exists") + frozen = Frozen(root) + frozen.check_all() + with tempfile.TemporaryDirectory(prefix="staged-compensation-") as temporary: + globals()[args.stage](frozen, Path(temporary)) + check_coverage(args.stage, frozen.compared) + frozen.check_all() + receipt = {"status": "PASS_STAGED_COMPENSATION_" + args.stage.upper(), + "complete_records": sorted(frozen.compared), + "frozen_inputs": len(frozen.hashes), "no_new_kappa": True} + if args.output: + args.output.parent.mkdir(parents=True, exist_ok=True) + args.output.write_text(json.dumps(receipt, indent=2) + "\n") + print(receipt["status"], "records=" + str(len(frozen.compared))) + + +if __name__ == "__main__": + main()