From b0181971c2364744d1dd9b0c2d4ee1ea532b8bb6 Mon Sep 17 00:00:00 2001 From: Ali Romman <226877337+aliromman@users.noreply.github.com> Date: Tue, 13 Oct 2026 12:27:35 -0500 Subject: [PATCH] Research: lower the complete complex factory to 38 paid primitives --- research/complex-factory-fusion/CIRCUIT.json | 269 + research/complex-factory-fusion/CLAIM.json | 25 + research/complex-factory-fusion/EXPECTED.json | 9008 +++++++++++++++++ research/complex-factory-fusion/OVERLAP.json | 124 + research/complex-factory-fusion/PROOF.md | 260 + research/complex-factory-fusion/README.md | 156 + research/complex-factory-fusion/SOURCES.json | 52 + .../complex-factory-fusion/VALIDATION.json | 42 + research/complex-factory-fusion/VALIDATION.md | 69 + research/complex-factory-fusion/circuit.py | 220 + research/complex-factory-fusion/comparator.py | 111 + research/complex-factory-fusion/full.py | 276 + research/complex-factory-fusion/host.py | 228 + .../sources/pr999-lower.py | 309 + .../complex-factory-fusion/test_package.py | 81 + research/complex-factory-fusion/verify.py | 262 + 16 files changed, 11492 insertions(+) create mode 100644 research/complex-factory-fusion/CIRCUIT.json create mode 100644 research/complex-factory-fusion/CLAIM.json create mode 100644 research/complex-factory-fusion/EXPECTED.json create mode 100644 research/complex-factory-fusion/OVERLAP.json create mode 100644 research/complex-factory-fusion/PROOF.md create mode 100644 research/complex-factory-fusion/README.md create mode 100644 research/complex-factory-fusion/SOURCES.json create mode 100644 research/complex-factory-fusion/VALIDATION.json create mode 100644 research/complex-factory-fusion/VALIDATION.md create mode 100644 research/complex-factory-fusion/circuit.py create mode 100644 research/complex-factory-fusion/comparator.py create mode 100644 research/complex-factory-fusion/full.py create mode 100644 research/complex-factory-fusion/host.py create mode 100644 research/complex-factory-fusion/sources/pr999-lower.py create mode 100644 research/complex-factory-fusion/test_package.py create mode 100644 research/complex-factory-fusion/verify.py diff --git a/research/complex-factory-fusion/CIRCUIT.json b/research/complex-factory-fusion/CIRCUIT.json new file mode 100644 index 0000000000..7f282284aa --- /dev/null +++ b/research/complex-factory-fusion/CIRCUIT.json @@ -0,0 +1,269 @@ +{ + "format": "exact-unit-add-factory-v1", + "levels": [ + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 1, + 1, + 1 + ], + "dual_flow": [ + 1, + -1, + -1, + 0, + -1, + 0, + -1, + 1, + 1, + 0, + -1, + 0, + -1, + 0, + 1, + -1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -1, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + -1, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + -1, + 1, + 0, + 1, + 0, + 1, + 1, + 0, + 0, + -1, + 0, + -1, + 0 + ], + "primitives": [ + [ + "double", + 5 + ], + [ + "subtract", + 5, + 0 + ], + [ + "subtract", + 3, + 5 + ], + [ + "subtract", + 2, + 0 + ], + [ + "double", + 7 + ], + [ + "add", + 5, + 7 + ], + [ + "double", + 4 + ], + [ + "subtract", + 4, + 7 + ], + [ + "add", + 2, + 7 + ], + [ + "subtract", + 1, + 7 + ], + [ + "double", + 6 + ], + [ + "add", + 6, + 7 + ], + [ + "subtract", + 7, + 6 + ], + [ + "add", + 6, + 7 + ], + [ + "subtract", + 6, + 5 + ], + [ + "subtract", + 5, + 2 + ], + [ + "add", + 0, + 2 + ], + [ + "add", + 2, + 4 + ], + [ + "subtract", + 1, + 4 + ], + [ + "add", + 4, + 1 + ], + [ + "subtract", + 2, + 7 + ], + [ + "add", + 0, + 1 + ], + [ + "add", + 1, + 6 + ], + [ + "halve", + 5 + ], + [ + "add", + 6, + 5 + ], + [ + "subtract", + 3, + 7 + ], + [ + "add", + 7, + 5 + ], + [ + "subtract", + 3, + 0 + ], + [ + "double", + 0 + ], + [ + "add", + 0, + 3 + ], + [ + "double", + 1 + ], + [ + "subtract", + 1, + 0 + ], + [ + "double", + 2 + ], + [ + "add", + 2, + 1 + ], + [ + "halve", + 4 + ], + [ + "negate", + 5 + ], + [ + "negate", + 7 + ] + ] +} diff --git a/research/complex-factory-fusion/CLAIM.json b/research/complex-factory-fusion/CLAIM.json new file mode 100644 index 0000000000..900dd5f5df --- /dev/null +++ b/research/complex-factory-fusion/CLAIM.json @@ -0,0 +1,25 @@ +{ + "lane": "B complex_factory", + "base": "8bddbee377e2f3ce1f1247196c4b290d55767d20", + "created_at": "2026-10-13T16:11:30.981941+00:00", + "seed": null, + "candidates": [ + "Four-operation exact contractions beyond PR922 triple neighborhood", + "Source-scale excursion lowering with same-frame consumers and exact source restoration", + "Transport combined PR922/924 into complete raw factory hosting" + ], + "chosen": "Exact source-scale excursion lowering for the fixed PR924 eight-wire map, with complete arbitrary-input restoration and paid whole-word/hosted cost", + "method": "Preserve fixed local map and physical frame/recursive profile; compare PR696 and clean-work lowerings; emit and replay exact primitives. No owner, decoder or COPY changes.", + "expected_finish": "2026-10-13T18:35:00Z", + "result": "38 primitives per real component including work clearing, versus 44 for the combined persistent-work and small-integer comparator; 24192 additional primitives saved across the fixed 72-call host.", + "search_domain": "One fixed 26-ADD topology. Twenty-six unrestricted real level variables and sixty absolute-distance variables; the integer witness and integer dual certify the exact value nine for all integer levels.", + "nomination": "One deterministic SciPy HiGHS linear program, one worker. No random seed. Solver output was converted to integer data and independently checked.", + "stopping_rule": "Stop after one integer witness meets the exact dual lower bound, then run the complete source, frame, native, primitive and hosted checks.", + "not_claimed": [ + "global circuit optimality", + "new kappa", + "selected-provider transport", + "runtime improvement" + ], + "comparison_census": "39424 one-scale magnitude placements in each of four orientations; source-version coefficient cache, repeated unit adds, and source excursions restored at each macro. Minimum 44 in this class; no arbitrary-circuit floor." +} diff --git a/research/complex-factory-fusion/EXPECTED.json b/research/complex-factory-fusion/EXPECTED.json new file mode 100644 index 0000000000..54bda92b4a --- /dev/null +++ b/research/complex-factory-fusion/EXPECTED.json @@ -0,0 +1,9008 @@ +{ + "base_commit": "8bddbee377e2f3ce1f1247196c4b290d55767d20", + "controls": { + "factory_placement": [ + "climb_crosses_live_register_use" + ], + "hosting": [ + "missing_call", + "aliased_owner", + "wrong_complement", + "unbound_program", + "missing_bridge", + "stale_bank_range", + "unpaid_translation", + "wrong_bridge_sign", + "private_alias", + "changed_data_port_order" + ], + "local": { + "certificate_controls": 4, + "deletion_families": [ + { + "single_primitive_deletions_rejected": 38, + "variant": "main" + }, + { + "single_primitive_deletions_rejected": 38, + "variant": "cleanup" + }, + { + "single_primitive_deletions_rejected": 38, + "variant": "dual_main" + }, + { + "single_primitive_deletions_rejected": 38, + "variant": "dual_cleanup" + } + ] + }, + "whole_word": [ + "wrong_primitive_frame" + ] + }, + "extra_saved_hosted": 24192, + "extra_saved_vs_strong_per_call": { + "backward": 336, + "forward": 336 + }, + "hosted": { + "accumulated": { + "admission": { + "bank_complement_rank": 1, + "banks": 4428, + "calls": 72, + "helper_roles": 35424, + "orientation_counts": { + "backward": 32, + "forward": 40 + }, + "profile": { + "1": 150156, + "16": 3584, + "2": 54720, + "3": 21600, + "32": 3584, + "4": 12096, + "48": 3584, + "5": 12096, + "6": 3168, + "8": 5952 + }, + "rank_deficit": 2560, + "rank_mass": 843948 + }, + "controller_sha256": "f19fc1a9f8dfc91c64eb6e9b3597ee335567ca0ef913edaf2a65de0990dd8e08", + "invoice": { + "all_paid_children": 270540, + "bridge_sweeps": 72, + "charged_payload_bits": 512, + "compiler": 25934336, + "factory_adapter_reserve_per_block_retained": 512, + "factory_new_frame_conversions": 0, + "global_prefix_bits": 206, + "hosted_operand_reads": 8877248, + "hosted_scalar_primitives": 8879552, + "literal_bits": 35284, + "local_adapters": 319104, + "local_children": 3472, + "local_macro_slots_retained": 15456, + "local_primitive_bound": 8275750478280, + "outside_adapter_reserve": 1527568, + "per_cover_vertex_bound": 635470497023116, + "physical_row_coefficient": 16469, + "physical_stock_bits": 2642, + "router_bits": 7984, + "strict_checks": { + "halving": true, + "literal": true, + "local": true, + "logical": true, + "mass": true, + "precision": true, + "prefix": true, + "router": true, + "row": true, + "tape": true + }, + "wrapper_factors": 0 + } + }, + "cache": { + "admission": { + "bank_complement_rank": 1, + "banks": 4428, + "calls": 72, + "helper_roles": 35424, + "orientation_counts": { + "backward": 32, + "forward": 40 + }, + "profile": { + "1": 150156, + "16": 3584, + "2": 54720, + "3": 21600, + "32": 3584, + "4": 12096, + "48": 3584, + "5": 12096, + "6": 3168, + "8": 5952 + }, + "rank_deficit": 2560, + "rank_mass": 843948 + }, + "controller_sha256": "965d481a0bb7fb5170b30f98a902e7591813b8cc8129d4b6f5a3d893683cc694", + "invoice": { + "all_paid_children": 270540, + "bridge_sweeps": 72, + "charged_payload_bits": 512, + "compiler": 25934336, + "factory_adapter_reserve_per_block_retained": 512, + "factory_new_frame_conversions": 0, + "global_prefix_bits": 206, + "hosted_operand_reads": 8872768, + "hosted_scalar_primitives": 8774272, + "literal_bits": 35284, + "local_adapters": 319104, + "local_children": 3472, + "local_macro_slots_retained": 15456, + "local_primitive_bound": 8275750476880, + "outside_adapter_reserve": 1527568, + "per_cover_vertex_bound": 635470496917836, + "physical_row_coefficient": 16469, + "physical_stock_bits": 2642, + "router_bits": 7984, + "strict_checks": { + "halving": true, + "literal": true, + "local": true, + "logical": true, + "mass": true, + "precision": true, + "prefix": true, + "router": true, + "row": true, + "tape": true + }, + "wrapper_factors": 0 + } + }, + "candidate": { + "admission": { + "bank_complement_rank": 1, + "banks": 4428, + "calls": 72, + "helper_roles": 35424, + "orientation_counts": { + "backward": 32, + "forward": 40 + }, + "profile": { + "1": 150156, + "16": 3584, + "2": 54720, + "3": 21600, + "32": 3584, + "4": 12096, + "48": 3584, + "5": 12096, + "6": 3168, + "8": 5952 + }, + "rank_deficit": 2560, + "rank_mass": 843948 + }, + "controller_sha256": "f864aa32815e5fc7c3530270d51accdde36a9d10c474f3bba5e571eda1e7a6ec", + "invoice": { + "all_paid_children": 270540, + "bridge_sweeps": 72, + "charged_payload_bits": 512, + "compiler": 25934336, + "factory_adapter_reserve_per_block_retained": 512, + "factory_new_frame_conversions": 0, + "global_prefix_bits": 206, + "hosted_operand_reads": 8836928, + "hosted_scalar_primitives": 8716544, + "literal_bits": 35284, + "local_adapters": 319104, + "local_children": 3472, + "local_macro_slots_retained": 15456, + "local_primitive_bound": 8275750476016, + "outside_adapter_reserve": 1527568, + "per_cover_vertex_bound": 635470496860108, + "physical_row_coefficient": 16469, + "physical_stock_bits": 2642, + "router_bits": 7984, + "strict_checks": { + "halving": true, + "literal": true, + "local": true, + "logical": true, + "mass": true, + "precision": true, + "prefix": true, + "router": true, + "row": true, + "tape": true + }, + "wrapper_factors": 0 + } + }, + "pr696": { + "admission": { + "bank_complement_rank": 1, + "banks": 4428, + "calls": 72, + "helper_roles": 35424, + "orientation_counts": { + "backward": 32, + "forward": 40 + }, + "profile": { + "1": 150156, + "16": 3584, + "2": 54720, + "3": 21600, + "32": 3584, + "4": 12096, + "48": 3584, + "5": 12096, + "6": 3168, + "8": 5952 + }, + "rank_deficit": 2560, + "rank_mass": 843948 + }, + "controller_sha256": "730b821f81ea8180664246fea9d87148a90a8d03ad4bf03573b5bba39d1900c7", + "invoice": { + "all_paid_children": 270540, + "bridge_sweeps": 72, + "charged_payload_bits": 512, + "compiler": 25934336, + "factory_adapter_reserve_per_block_retained": 512, + "factory_new_frame_conversions": 0, + "global_prefix_bits": 206, + "hosted_operand_reads": 8877248, + "hosted_scalar_primitives": 8879552, + "literal_bits": 35284, + "local_adapters": 319104, + "local_children": 3472, + "local_macro_slots_retained": 15456, + "local_primitive_bound": 8275750478280, + "outside_adapter_reserve": 1527568, + "per_cover_vertex_bound": 635470497023116, + "physical_row_coefficient": 16469, + "physical_stock_bits": 2642, + "router_bits": 7984, + "strict_checks": { + "halving": true, + "literal": true, + "local": true, + "logical": true, + "mass": true, + "precision": true, + "prefix": true, + "router": true, + "row": true, + "tape": true + }, + "wrapper_factors": 0 + } + }, + "strong": { + "admission": { + "bank_complement_rank": 1, + "banks": 4428, + "calls": 72, + "helper_roles": 35424, + "orientation_counts": { + "backward": 32, + "forward": 40 + }, + "profile": { + "1": 150156, + "16": 3584, + "2": 54720, + "3": 21600, + "32": 3584, + "4": 12096, + "48": 3584, + "5": 12096, + "6": 3168, + "8": 5952 + }, + "rank_deficit": 2560, + "rank_mass": 843948 + }, + "controller_sha256": "a515f3be253c8c6c27acd74338b6fdf7e49efcec77a576f17cad1b50217df55d", + "invoice": { + "all_paid_children": 270540, + "bridge_sweeps": 72, + "charged_payload_bits": 512, + "compiler": 25934336, + "factory_adapter_reserve_per_block_retained": 512, + "factory_new_frame_conversions": 0, + "global_prefix_bits": 206, + "hosted_operand_reads": 8877248, + "hosted_scalar_primitives": 8740736, + "literal_bits": 35284, + "local_adapters": 319104, + "local_children": 3472, + "local_macro_slots_retained": 15456, + "local_primitive_bound": 8275750476352, + "outside_adapter_reserve": 1527568, + "per_cover_vertex_bound": 635470496884300, + "physical_row_coefficient": 16469, + "physical_stock_bits": 2642, + "router_bits": 7984, + "strict_checks": { + "halving": true, + "literal": true, + "local": true, + "logical": true, + "mass": true, + "precision": true, + "prefix": true, + "router": true, + "row": true, + "tape": true + }, + "wrapper_factors": 0 + } + } + }, + "local": { + "cleanup": { + "cached_work": { + "fractional_depth": 2, + "operand_reads": 71, + "peak_row_l1": "8", + "primitives": 46 + }, + "candidate": { + "fractional_depth": 2, + "operand_reads": 63, + "original_87_macro_boundary": true, + "peak_row_l1": "8", + "primitives": 38 + }, + "extended_gauge_census": { + "cache_rule": "same_source_version_up_to_binary_scale", + "minimum": 44, + "placements": 39424, + "scope": "one_net_magnitude_scale_per_nonunit_wire", + "winning_magnitude_slots": [ + [ + 2, + 2, + 1, + 6, + 8 + ] + ], + "wires": [ + 0, + 1, + 2, + 6, + 7 + ] + }, + "pr696": { + "fractional_depth": 2, + "operand_reads": 73, + "peak_row_l1": "8", + "primitives": 73 + }, + "strong": { + "fractional_depth": 2, + "operand_reads": 73, + "peak_row_l1": "8", + "primitives": 44 + } + }, + "dual_cleanup": { + "cached_work": { + "fractional_depth": 1, + "operand_reads": 73, + "peak_row_l1": "12", + "primitives": 48 + }, + "candidate": { + "fractional_depth": 1, + "operand_reads": 63, + "original_87_macro_boundary": true, + "peak_row_l1": "11", + "primitives": 38 + }, + "extended_gauge_census": { + "cache_rule": "same_source_version_up_to_binary_scale", + "minimum": 44, + "placements": 39424, + "scope": "one_net_magnitude_scale_per_nonunit_wire", + "winning_magnitude_slots": [ + [ + 2, + 2, + 1, + 6, + 8 + ] + ], + "wires": [ + 0, + 1, + 2, + 6, + 7 + ] + }, + "pr696": { + "fractional_depth": 1, + "operand_reads": 73, + "peak_row_l1": "12", + "primitives": 73 + }, + "strong": { + "fractional_depth": 1, + "operand_reads": 73, + "peak_row_l1": "12", + "primitives": 44 + } + }, + "dual_main": { + "cached_work": { + "fractional_depth": 2, + "operand_reads": 73, + "peak_row_l1": "10", + "primitives": 48 + }, + "candidate": { + "fractional_depth": 2, + "operand_reads": 63, + "original_87_macro_boundary": true, + "peak_row_l1": "10", + "primitives": 38 + }, + "extended_gauge_census": { + "cache_rule": "same_source_version_up_to_binary_scale", + "minimum": 44, + "placements": 39424, + "scope": "one_net_magnitude_scale_per_nonunit_wire", + "winning_magnitude_slots": [ + [ + 5, + 5, + 6, + 0, + 2 + ] + ], + "wires": [ + 0, + 1, + 2, + 6, + 7 + ] + }, + "pr696": { + "fractional_depth": 2, + "operand_reads": 73, + "peak_row_l1": "10", + "primitives": 73 + }, + "strong": { + "fractional_depth": 2, + "operand_reads": 73, + "peak_row_l1": "10", + "primitives": 44 + } + }, + "main": { + "cached_work": { + "fractional_depth": 1, + "operand_reads": 71, + "peak_row_l1": "12", + "primitives": 46 + }, + "candidate": { + "fractional_depth": 1, + "operand_reads": 63, + "original_87_macro_boundary": true, + "peak_row_l1": "12", + "primitives": 38 + }, + "extended_gauge_census": { + "cache_rule": "same_source_version_up_to_binary_scale", + "minimum": 44, + "placements": 39424, + "scope": "one_net_magnitude_scale_per_nonunit_wire", + "winning_magnitude_slots": [ + [ + 5, + 5, + 6, + 0, + 2 + ] + ], + "wires": [ + 0, + 1, + 2, + 6, + 7 + ] + }, + "pr696": { + "fractional_depth": 1, + "operand_reads": 73, + "peak_row_l1": "12", + "primitives": 73 + }, + "strong": { + "fractional_depth": 1, + "operand_reads": 73, + "peak_row_l1": "12", + "primitives": 44 + } + } + }, + "native": { + "canonical_json_sha256": "e2651aae7b91258f695feb747a2b1513f03a1335cd5f1d7e5393250b95bac512", + "emitted": { + "backward": { + "all_columns": 716, + "events": 20369, + "paid_profile": { + "1": 2024, + "2": 760, + "3": 300, + "4": 168, + "5": 168, + "6": 44, + "8": 8 + }, + "private_centers_cleared": true, + "private_coefficient_stream_cleared_after_each_macro": true, + "real_component_primitive_bound": 159784, + "scalar_macros": 15456, + "sha256": "4071d81916ccc1d87b4cf53862c89d27fe98e345ad7defaba26d785a70c1becc" + }, + "forward": { + "all_columns": 716, + "events": 20369, + "paid_profile": { + "1": 2024, + "2": 760, + "3": 300, + "4": 168, + "5": 168, + "6": 44, + "8": 8 + }, + "private_centers_cleared": true, + "private_coefficient_stream_cleared_after_each_macro": true, + "real_component_primitive_bound": 159736, + "scalar_macros": 15456, + "sha256": "0b47d551dccbb97ef0a1f43811586c4fc411f511e3fbc0081de4b629ce3f6aad" + } + }, + "local": { + "entering_helpers": 0, + "helpers": 492, + "local": { + "backward": { + "all_exact_columns": 716, + "charged_payload_bits": 192, + "prefix_bits_upper": 21, + "prefix_l1_upper": "1301331", + "private_work_erased": true + }, + "forward": { + "all_exact_columns": 716, + "charged_payload_bits": 192, + "prefix_bits_upper": 16, + "prefix_l1_upper": "39090", + "private_work_erased": true + } + }, + "negative_controls_rejected": [ + "wrong_scale", + "missing_center", + "wrong_common_frame", + "wrong_child_rank" + ], + "paid_profiles": { + "backward": { + "1": 2024, + "2": 760, + "3": 300, + "4": 168, + "5": 168, + "6": 44, + "8": 8 + }, + "forward": { + "1": 2024, + "2": 760, + "3": 300, + "4": 168, + "5": 168, + "6": 44, + "8": 8 + } + }, + "scope": "Literal forward and inverse-transpose replay on every arbitrary data/helper column, physical frame incidence, ordered paid wrappers, cleared private work and prefix coefficients. Global hosting and outer exponent are separate.", + "status": "PASS_INDEPENDENT_LOCAL_SCALAR_FRAME_AND_WRAPPER_REPLAY", + "v": 112 + }, + "native": { + "canonical_content_sha256": "e2651aae7b91258f695feb747a2b1513f03a1335cd5f1d7e5393250b95bac512", + "center_rank_sum": 64, + "compensation_additions": 10632, + "directed_edges": 3110, + "frames": 1124, + "helpers": 492, + "input_content_sha256": "974b1e29a840f0d5cbed7a8a23b8d3846fba4762c1e31e33f1bd5759ef4e6479", + "live_columns_each_orientation": 716, + "local_profile": { + "1": 2024, + "2": 760, + "3": 300, + "4": 168, + "5": 168, + "6": 44, + "8": 8 + }, + "local_rank_mass": 6284, + "routing_content_sha256": "5226194a7beae50e9c43009df698959d596fdfb081346f32428aee798bdc1851", + "scalar_operations": 15432, + "scope": "Fresh exact forward and inverse-transpose scalar replay on every arbitrary input; all native frame chains and dyadic primitives. Phase lowering, wrappers, global owners and global assembly are separate.", + "status": "PASS_CHANGED_WORD_ALL_COLUMNS_AND_NATIVE_FRAMES", + "target_port_order_matches_baseline": true, + "tau": 43, + "widths": [ + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9 + ] + }, + "programs_json_sha256": "9ed1e57be0eb65d41221afd8e6d0d0dd6f97208a36c0983c5211b0c745bb35d4" + }, + "new_kappa": false, + "phase": { + "all_child_equalities_include_global_phase": true, + "baseline_recipe_sha256": "1f37afd5a9e14b113ba56e0ac8a5200a6b41c695d2cd308dc0fd6ec46a4c73d2", + "baseline_review_sha256": "468a5df1937e82a0b8e8c1c2540e18480f354154325353c5596c68e7435c89c2", + "compiler_sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962", + "directed_edges": 3110, + "endpoint_adapters": 224, + "frames": 1124, + "fresh_edge_ids": [ + [ + 0, + 10 + ], + [ + 0, + 13 + ], + [ + 0, + 20 + ], + [ + 0, + 21 + ], + [ + 0, + 22 + ], + [ + 0, + 23 + ], + [ + 0, + 24 + ], + [ + 0, + 25 + ], + [ + 0, + 26 + ], + [ + 0, + 27 + ], + [ + 0, + 28 + ], + [ + 0, + 29 + ], + [ + 0, + 39 + ], + [ + 0, + 42 + ], + [ + 0, + 49 + ], + [ + 0, + 50 + ], + [ + 0, + 51 + ], + [ + 0, + 52 + ], + [ + 0, + 53 + ], + [ + 0, + 54 + ], + [ + 0, + 55 + ], + [ + 0, + 56 + ], + [ + 0, + 57 + ], + [ + 0, + 58 + ], + [ + 0, + 68 + ], + [ + 0, + 71 + ], + [ + 0, + 78 + ], + [ + 0, + 79 + ], + [ + 0, + 80 + ], + [ + 0, + 81 + ], + [ + 0, + 82 + ], + [ + 0, + 83 + ], + [ + 0, + 84 + ], + [ + 0, + 85 + ], + [ + 0, + 86 + ], + [ + 0, + 87 + ], + [ + 0, + 97 + ], + [ + 0, + 100 + ], + [ + 0, + 107 + ], + [ + 0, + 108 + ], + [ + 0, + 109 + ], + [ + 0, + 110 + ], + [ + 0, + 111 + ], + [ + 0, + 112 + ], + [ + 0, + 113 + ], + [ + 0, + 114 + ], + [ + 0, + 115 + ], + [ + 0, + 116 + ], + [ + 0, + 126 + ], + [ + 0, + 129 + ], + [ + 0, + 136 + ], + [ + 0, + 137 + ], + [ + 0, + 138 + ], + [ + 0, + 139 + ], + [ + 0, + 140 + ], + [ + 0, + 141 + ], + [ + 0, + 142 + ], + [ + 0, + 143 + ], + [ + 0, + 144 + ], + [ + 0, + 145 + ], + [ + 0, + 155 + ], + [ + 0, + 158 + ], + [ + 0, + 165 + ], + [ + 0, + 166 + ], + [ + 0, + 167 + ], + [ + 0, + 168 + ], + [ + 0, + 171 + ], + [ + 0, + 172 + ], + [ + 0, + 173 + ], + [ + 0, + 174 + ], + [ + 0, + 184 + ], + [ + 0, + 187 + ], + [ + 0, + 194 + ], + [ + 0, + 195 + ], + [ + 0, + 196 + ], + [ + 0, + 197 + ], + [ + 0, + 200 + ], + [ + 0, + 201 + ], + [ + 0, + 202 + ], + [ + 0, + 203 + ], + [ + 0, + 213 + ], + [ + 0, + 216 + ], + [ + 0, + 223 + ], + [ + 0, + 224 + ], + [ + 0, + 225 + ], + [ + 0, + 226 + ], + [ + 0, + 227 + ], + [ + 0, + 228 + ], + [ + 0, + 229 + ], + [ + 0, + 230 + ], + [ + 0, + 231 + ], + [ + 0, + 232 + ], + [ + 0, + 242 + ], + [ + 0, + 245 + ], + [ + 0, + 252 + ], + [ + 0, + 253 + ], + [ + 0, + 254 + ], + [ + 0, + 255 + ], + [ + 0, + 260 + ], + [ + 0, + 261 + ], + [ + 0, + 271 + ], + [ + 0, + 274 + ], + [ + 0, + 281 + ], + [ + 0, + 282 + ], + [ + 0, + 283 + ], + [ + 0, + 284 + ], + [ + 0, + 285 + ], + [ + 0, + 286 + ], + [ + 0, + 289 + ], + [ + 0, + 290 + ], + [ + 0, + 300 + ], + [ + 0, + 303 + ], + [ + 0, + 310 + ], + [ + 0, + 311 + ], + [ + 0, + 312 + ], + [ + 0, + 313 + ], + [ + 0, + 316 + ], + [ + 0, + 317 + ], + [ + 0, + 318 + ], + [ + 0, + 319 + ], + [ + 0, + 329 + ], + [ + 0, + 332 + ], + [ + 0, + 339 + ], + [ + 0, + 340 + ], + [ + 0, + 343 + ], + [ + 0, + 344 + ], + [ + 0, + 347 + ], + [ + 0, + 348 + ], + [ + 0, + 358 + ], + [ + 0, + 361 + ], + [ + 0, + 368 + ], + [ + 0, + 369 + ], + [ + 0, + 370 + ], + [ + 0, + 371 + ], + [ + 0, + 372 + ], + [ + 0, + 373 + ], + [ + 0, + 374 + ], + [ + 0, + 375 + ], + [ + 0, + 376 + ], + [ + 0, + 377 + ], + [ + 0, + 387 + ], + [ + 0, + 390 + ], + [ + 0, + 397 + ], + [ + 0, + 398 + ], + [ + 0, + 399 + ], + [ + 0, + 400 + ], + [ + 0, + 403 + ], + [ + 0, + 404 + ], + [ + 0, + 405 + ], + [ + 0, + 406 + ], + [ + 0, + 512 + ], + [ + 0, + 513 + ], + [ + 0, + 514 + ], + [ + 0, + 515 + ], + [ + 0, + 517 + ], + [ + 0, + 518 + ], + [ + 0, + 519 + ], + [ + 0, + 520 + ], + [ + 0, + 521 + ], + [ + 0, + 524 + ], + [ + 0, + 525 + ], + [ + 0, + 526 + ], + [ + 0, + 527 + ], + [ + 0, + 528 + ], + [ + 0, + 529 + ], + [ + 0, + 532 + ], + [ + 0, + 533 + ], + [ + 0, + 534 + ], + [ + 0, + 535 + ], + [ + 0, + 536 + ], + [ + 0, + 537 + ], + [ + 0, + 540 + ], + [ + 0, + 541 + ], + [ + 0, + 542 + ], + [ + 0, + 543 + ], + [ + 0, + 544 + ], + [ + 0, + 545 + ], + [ + 0, + 546 + ], + [ + 0, + 547 + ], + [ + 0, + 548 + ], + [ + 0, + 549 + ], + [ + 0, + 550 + ], + [ + 0, + 551 + ], + [ + 0, + 552 + ], + [ + 0, + 553 + ], + [ + 0, + 554 + ], + [ + 0, + 555 + ], + [ + 0, + 644 + ], + [ + 0, + 645 + ], + [ + 0, + 646 + ], + [ + 0, + 647 + ], + [ + 0, + 648 + ], + [ + 0, + 649 + ], + [ + 0, + 650 + ], + [ + 0, + 651 + ], + [ + 0, + 652 + ], + [ + 0, + 653 + ], + [ + 0, + 654 + ], + [ + 0, + 655 + ], + [ + 0, + 656 + ], + [ + 0, + 657 + ], + [ + 0, + 658 + ], + [ + 0, + 659 + ], + [ + 0, + 660 + ], + [ + 0, + 661 + ], + [ + 0, + 662 + ], + [ + 0, + 663 + ], + [ + 0, + 664 + ], + [ + 0, + 665 + ], + [ + 0, + 666 + ], + [ + 0, + 667 + ], + [ + 0, + 668 + ], + [ + 0, + 669 + ], + [ + 0, + 670 + ], + [ + 0, + 671 + ], + [ + 0, + 672 + ], + [ + 0, + 673 + ], + [ + 0, + 674 + ], + [ + 0, + 675 + ], + [ + 0, + 676 + ], + [ + 0, + 677 + ], + [ + 0, + 678 + ], + [ + 0, + 679 + ], + [ + 0, + 680 + ], + [ + 0, + 681 + ], + [ + 0, + 682 + ], + [ + 0, + 683 + ], + [ + 0, + 684 + ], + [ + 0, + 685 + ], + [ + 0, + 686 + ], + [ + 0, + 687 + ], + [ + 0, + 688 + ], + [ + 0, + 689 + ], + [ + 0, + 690 + ], + [ + 0, + 691 + ], + [ + 0, + 692 + ], + [ + 0, + 693 + ], + [ + 0, + 694 + ], + [ + 0, + 695 + ], + [ + 0, + 696 + ], + [ + 0, + 697 + ], + [ + 0, + 698 + ], + [ + 0, + 699 + ], + [ + 0, + 700 + ], + [ + 0, + 701 + ], + [ + 0, + 702 + ], + [ + 0, + 703 + ], + [ + 0, + 704 + ], + [ + 0, + 705 + ], + [ + 0, + 706 + ], + [ + 0, + 707 + ], + [ + 0, + 708 + ], + [ + 0, + 709 + ], + [ + 0, + 710 + ], + [ + 0, + 711 + ], + [ + 0, + 712 + ], + [ + 0, + 713 + ], + [ + 0, + 714 + ], + [ + 0, + 715 + ], + [ + 0, + 716 + ], + [ + 0, + 717 + ], + [ + 0, + 718 + ], + [ + 0, + 719 + ], + [ + 0, + 720 + ], + [ + 0, + 721 + ], + [ + 0, + 722 + ], + [ + 0, + 723 + ], + [ + 0, + 724 + ], + [ + 0, + 725 + ], + [ + 0, + 726 + ], + [ + 0, + 727 + ], + [ + 0, + 728 + ], + [ + 0, + 729 + ], + [ + 0, + 730 + ], + [ + 0, + 731 + ], + [ + 0, + 732 + ], + [ + 0, + 733 + ], + [ + 0, + 734 + ], + [ + 0, + 735 + ], + [ + 0, + 736 + ], + [ + 0, + 737 + ], + [ + 0, + 738 + ], + [ + 0, + 739 + ], + [ + 0, + 740 + ], + [ + 0, + 741 + ], + [ + 0, + 742 + ], + [ + 0, + 743 + ], + [ + 0, + 744 + ], + [ + 0, + 745 + ], + [ + 0, + 746 + ], + [ + 0, + 747 + ], + [ + 0, + 748 + ], + [ + 0, + 749 + ], + [ + 0, + 750 + ], + [ + 0, + 751 + ], + [ + 0, + 752 + ], + [ + 0, + 753 + ], + [ + 0, + 754 + ], + [ + 0, + 755 + ], + [ + 10, + 557 + ], + [ + 10, + 559 + ], + [ + 13, + 448 + ], + [ + 13, + 556 + ], + [ + 20, + 419 + ], + [ + 20, + 558 + ], + [ + 21, + 416 + ], + [ + 21, + 445 + ], + [ + 22, + 568 + ], + [ + 22, + 576 + ], + [ + 23, + 570 + ], + [ + 23, + 578 + ], + [ + 24, + 584 + ], + [ + 24, + 592 + ], + [ + 25, + 586 + ], + [ + 25, + 594 + ], + [ + 26, + 600 + ], + [ + 26, + 608 + ], + [ + 27, + 602 + ], + [ + 27, + 610 + ], + [ + 28, + 616 + ], + [ + 28, + 624 + ], + [ + 29, + 618 + ], + [ + 29, + 626 + ], + [ + 39, + 561 + ], + [ + 39, + 563 + ], + [ + 42, + 466 + ], + [ + 42, + 469 + ], + [ + 42, + 560 + ], + [ + 49, + 417 + ], + [ + 49, + 562 + ], + [ + 50, + 418 + ], + [ + 50, + 467 + ], + [ + 50, + 468 + ], + [ + 51, + 668 + ], + [ + 51, + 684 + ], + [ + 52, + 669 + ], + [ + 52, + 685 + ], + [ + 53, + 676 + ], + [ + 53, + 692 + ], + [ + 54, + 677 + ], + [ + 54, + 693 + ], + [ + 55, + 700 + ], + [ + 55, + 716 + ], + [ + 56, + 701 + ], + [ + 56, + 717 + ], + [ + 57, + 708 + ], + [ + 57, + 724 + ], + [ + 58, + 709 + ], + [ + 58, + 725 + ], + [ + 68, + 565 + ], + [ + 68, + 567 + ], + [ + 71, + 494 + ], + [ + 71, + 564 + ], + [ + 78, + 416 + ], + [ + 78, + 418 + ], + [ + 78, + 566 + ], + [ + 79, + 417 + ], + [ + 79, + 419 + ], + [ + 79, + 493 + ], + [ + 80, + 670 + ], + [ + 80, + 694 + ], + [ + 81, + 671 + ], + [ + 81, + 695 + ], + [ + 82, + 678 + ], + [ + 82, + 686 + ], + [ + 83, + 679 + ], + [ + 83, + 687 + ], + [ + 84, + 710 + ], + [ + 84, + 718 + ], + [ + 85, + 711 + ], + [ + 85, + 719 + ], + [ + 86, + 702 + ], + [ + 86, + 726 + ], + [ + 87, + 703 + ], + [ + 87, + 727 + ], + [ + 97, + 571 + ], + [ + 97, + 575 + ], + [ + 100, + 570 + ], + [ + 100, + 573 + ], + [ + 107, + 569 + ], + [ + 107, + 574 + ], + [ + 108, + 568 + ], + [ + 108, + 572 + ], + [ + 109, + 652 + ], + [ + 109, + 684 + ], + [ + 110, + 653 + ], + [ + 110, + 685 + ], + [ + 111, + 660 + ], + [ + 111, + 694 + ], + [ + 112, + 661 + ], + [ + 112, + 695 + ], + [ + 113, + 704 + ], + [ + 113, + 732 + ], + [ + 114, + 705 + ], + [ + 114, + 733 + ], + [ + 115, + 714 + ], + [ + 115, + 740 + ], + [ + 116, + 715 + ], + [ + 116, + 741 + ], + [ + 126, + 579 + ], + [ + 126, + 583 + ], + [ + 129, + 578 + ], + [ + 129, + 581 + ], + [ + 136, + 577 + ], + [ + 136, + 582 + ], + [ + 137, + 576 + ], + [ + 137, + 580 + ], + [ + 138, + 654 + ], + [ + 138, + 692 + ], + [ + 139, + 655 + ], + [ + 139, + 693 + ], + [ + 140, + 662 + ], + [ + 140, + 686 + ], + [ + 141, + 663 + ], + [ + 141, + 687 + ], + [ + 142, + 712 + ], + [ + 142, + 734 + ], + [ + 143, + 713 + ], + [ + 143, + 735 + ], + [ + 144, + 706 + ], + [ + 144, + 742 + ], + [ + 145, + 707 + ], + [ + 145, + 743 + ], + [ + 155, + 587 + ], + [ + 155, + 591 + ], + [ + 158, + 586 + ], + [ + 158, + 589 + ], + [ + 165, + 585 + ], + [ + 165, + 590 + ], + [ + 166, + 584 + ], + [ + 166, + 588 + ], + [ + 167, + 652 + ], + [ + 167, + 668 + ], + [ + 168, + 653 + ], + [ + 168, + 669 + ], + [ + 169, + 662 + ], + [ + 169, + 678 + ], + [ + 170, + 663 + ], + [ + 170, + 679 + ], + [ + 171, + 720 + ], + [ + 171, + 736 + ], + [ + 172, + 721 + ], + [ + 172, + 737 + ], + [ + 173, + 730 + ], + [ + 173, + 746 + ], + [ + 174, + 731 + ], + [ + 174, + 747 + ], + [ + 184, + 595 + ], + [ + 184, + 599 + ], + [ + 187, + 594 + ], + [ + 187, + 597 + ], + [ + 194, + 593 + ], + [ + 194, + 598 + ], + [ + 195, + 592 + ], + [ + 195, + 596 + ], + [ + 196, + 654 + ], + [ + 196, + 676 + ], + [ + 197, + 655 + ], + [ + 197, + 677 + ], + [ + 198, + 660 + ], + [ + 198, + 670 + ], + [ + 199, + 661 + ], + [ + 199, + 671 + ], + [ + 200, + 728 + ], + [ + 200, + 738 + ], + [ + 201, + 729 + ], + [ + 201, + 739 + ], + [ + 202, + 722 + ], + [ + 202, + 744 + ], + [ + 203, + 723 + ], + [ + 203, + 745 + ], + [ + 213, + 603 + ], + [ + 213, + 607 + ], + [ + 216, + 602 + ], + [ + 216, + 605 + ], + [ + 223, + 601 + ], + [ + 223, + 606 + ], + [ + 224, + 600 + ], + [ + 224, + 604 + ], + [ + 225, + 656 + ], + [ + 225, + 716 + ], + [ + 226, + 657 + ], + [ + 226, + 717 + ], + [ + 227, + 666 + ], + [ + 227, + 726 + ], + [ + 228, + 667 + ], + [ + 228, + 727 + ], + [ + 229, + 672 + ], + [ + 229, + 732 + ], + [ + 230, + 673 + ], + [ + 230, + 733 + ], + [ + 231, + 682 + ], + [ + 231, + 742 + ], + [ + 232, + 683 + ], + [ + 232, + 743 + ], + [ + 242, + 611 + ], + [ + 242, + 615 + ], + [ + 245, + 610 + ], + [ + 245, + 613 + ], + [ + 252, + 609 + ], + [ + 252, + 614 + ], + [ + 253, + 608 + ], + [ + 253, + 612 + ], + [ + 254, + 658 + ], + [ + 254, + 724 + ], + [ + 255, + 659 + ], + [ + 255, + 725 + ], + [ + 256, + 664 + ], + [ + 256, + 718 + ], + [ + 257, + 665 + ], + [ + 257, + 719 + ], + [ + 258, + 680 + ], + [ + 258, + 734 + ], + [ + 259, + 681 + ], + [ + 259, + 735 + ], + [ + 260, + 674 + ], + [ + 260, + 740 + ], + [ + 261, + 675 + ], + [ + 261, + 741 + ], + [ + 271, + 619 + ], + [ + 271, + 623 + ], + [ + 274, + 618 + ], + [ + 274, + 621 + ], + [ + 281, + 617 + ], + [ + 281, + 622 + ], + [ + 282, + 616 + ], + [ + 282, + 620 + ], + [ + 283, + 656 + ], + [ + 283, + 700 + ], + [ + 284, + 657 + ], + [ + 284, + 701 + ], + [ + 285, + 664 + ], + [ + 285, + 710 + ], + [ + 286, + 665 + ], + [ + 286, + 711 + ], + [ + 287, + 688 + ], + [ + 287, + 736 + ], + [ + 288, + 689 + ], + [ + 288, + 737 + ], + [ + 289, + 698 + ], + [ + 289, + 744 + ], + [ + 290, + 699 + ], + [ + 290, + 745 + ], + [ + 300, + 627 + ], + [ + 300, + 631 + ], + [ + 303, + 626 + ], + [ + 303, + 629 + ], + [ + 310, + 625 + ], + [ + 310, + 630 + ], + [ + 311, + 624 + ], + [ + 311, + 628 + ], + [ + 312, + 658 + ], + [ + 312, + 708 + ], + [ + 313, + 659 + ], + [ + 313, + 709 + ], + [ + 314, + 666 + ], + [ + 314, + 702 + ], + [ + 315, + 667 + ], + [ + 315, + 703 + ], + [ + 316, + 696 + ], + [ + 316, + 738 + ], + [ + 317, + 697 + ], + [ + 317, + 739 + ], + [ + 318, + 690 + ], + [ + 318, + 746 + ], + [ + 319, + 691 + ], + [ + 319, + 747 + ], + [ + 329, + 633 + ], + [ + 329, + 635 + ], + [ + 332, + 465 + ], + [ + 332, + 467 + ], + [ + 332, + 632 + ], + [ + 339, + 440 + ], + [ + 339, + 634 + ], + [ + 340, + 445 + ], + [ + 340, + 464 + ], + [ + 340, + 468 + ], + [ + 341, + 672 + ], + [ + 341, + 704 + ], + [ + 342, + 673 + ], + [ + 342, + 705 + ], + [ + 343, + 680 + ], + [ + 343, + 712 + ], + [ + 344, + 681 + ], + [ + 344, + 713 + ], + [ + 345, + 688 + ], + [ + 345, + 720 + ], + [ + 346, + 689 + ], + [ + 346, + 721 + ], + [ + 347, + 696 + ], + [ + 347, + 728 + ], + [ + 348, + 697 + ], + [ + 348, + 729 + ], + [ + 358, + 637 + ], + [ + 358, + 639 + ], + [ + 361, + 493 + ], + [ + 361, + 636 + ], + [ + 368, + 448 + ], + [ + 368, + 638 + ], + [ + 369, + 440 + ], + [ + 369, + 488 + ], + [ + 370, + 674 + ], + [ + 370, + 714 + ], + [ + 371, + 675 + ], + [ + 371, + 715 + ], + [ + 372, + 682 + ], + [ + 372, + 706 + ], + [ + 373, + 683 + ], + [ + 373, + 707 + ], + [ + 374, + 698 + ], + [ + 374, + 722 + ], + [ + 375, + 699 + ], + [ + 375, + 723 + ], + [ + 376, + 690 + ], + [ + 376, + 730 + ], + [ + 377, + 691 + ], + [ + 377, + 731 + ], + [ + 387, + 641 + ], + [ + 387, + 643 + ], + [ + 390, + 494 + ], + [ + 390, + 640 + ], + [ + 397, + 465 + ], + [ + 397, + 466 + ], + [ + 397, + 642 + ], + [ + 398, + 464 + ], + [ + 398, + 469 + ], + [ + 398, + 488 + ], + [ + 399, + 573 + ], + [ + 399, + 621 + ], + [ + 400, + 575 + ], + [ + 400, + 623 + ], + [ + 401, + 589 + ], + [ + 401, + 605 + ], + [ + 402, + 591 + ], + [ + 402, + 607 + ], + [ + 403, + 597 + ], + [ + 403, + 613 + ], + [ + 404, + 599 + ], + [ + 404, + 615 + ], + [ + 405, + 581 + ], + [ + 405, + 629 + ], + [ + 406, + 583 + ], + [ + 406, + 631 + ], + [ + 416, + 423 + ], + [ + 416, + 425 + ], + [ + 417, + 421 + ], + [ + 417, + 424 + ], + [ + 418, + 425 + ], + [ + 418, + 426 + ], + [ + 419, + 424 + ], + [ + 419, + 428 + ], + [ + 420, + 421 + ], + [ + 420, + 426 + ], + [ + 421, + 427 + ], + [ + 421, + 432 + ], + [ + 422, + 423 + ], + [ + 422, + 428 + ], + [ + 423, + 430 + ], + [ + 423, + 431 + ], + [ + 424, + 429 + ], + [ + 424, + 432 + ], + [ + 425, + 430 + ], + [ + 425, + 433 + ], + [ + 426, + 427 + ], + [ + 426, + 433 + ], + [ + 427, + 434 + ], + [ + 427, + 437 + ], + [ + 428, + 429 + ], + [ + 428, + 431 + ], + [ + 429, + 436 + ], + [ + 429, + 439 + ], + [ + 430, + 435 + ], + [ + 430, + 438 + ], + [ + 431, + 436 + ], + [ + 431, + 438 + ], + [ + 432, + 437 + ], + [ + 432, + 439 + ], + [ + 433, + 434 + ], + [ + 433, + 435 + ], + [ + 434, + 1 + ], + [ + 434, + 846 + ], + [ + 435, + 1 + ], + [ + 435, + 852 + ], + [ + 436, + 1 + ], + [ + 436, + 848 + ], + [ + 437, + 1 + ], + [ + 437, + 844 + ], + [ + 438, + 1 + ], + [ + 438, + 850 + ], + [ + 439, + 1 + ], + [ + 439, + 854 + ], + [ + 440, + 442 + ], + [ + 440, + 451 + ], + [ + 441, + 442 + ], + [ + 441, + 446 + ], + [ + 442, + 455 + ], + [ + 442, + 458 + ], + [ + 443, + 449 + ], + [ + 443, + 451 + ], + [ + 444, + 447 + ], + [ + 444, + 450 + ], + [ + 445, + 446 + ], + [ + 445, + 447 + ], + [ + 446, + 453 + ], + [ + 446, + 455 + ], + [ + 447, + 453 + ], + [ + 447, + 454 + ], + [ + 448, + 449 + ], + [ + 448, + 450 + ], + [ + 449, + 452 + ], + [ + 449, + 457 + ], + [ + 450, + 454 + ], + [ + 450, + 457 + ], + [ + 451, + 452 + ], + [ + 451, + 458 + ], + [ + 452, + 460 + ], + [ + 452, + 463 + ], + [ + 453, + 456 + ], + [ + 453, + 459 + ], + [ + 454, + 459 + ], + [ + 454, + 462 + ], + [ + 455, + 456 + ], + [ + 455, + 461 + ], + [ + 456, + 1 + ], + [ + 456, + 894 + ], + [ + 457, + 460 + ], + [ + 457, + 462 + ], + [ + 458, + 461 + ], + [ + 458, + 463 + ], + [ + 459, + 1 + ], + [ + 459, + 892 + ], + [ + 460, + 1 + ], + [ + 460, + 888 + ], + [ + 461, + 1 + ], + [ + 461, + 847 + ], + [ + 462, + 1 + ], + [ + 462, + 890 + ], + [ + 463, + 1 + ], + [ + 463, + 844 + ], + [ + 464, + 470 + ], + [ + 464, + 471 + ], + [ + 465, + 473 + ], + [ + 465, + 474 + ], + [ + 466, + 474 + ], + [ + 466, + 481 + ], + [ + 467, + 473 + ], + [ + 467, + 475 + ], + [ + 468, + 471 + ], + [ + 468, + 475 + ], + [ + 469, + 470 + ], + [ + 469, + 481 + ], + [ + 470, + 472 + ], + [ + 470, + 482 + ], + [ + 471, + 472 + ], + [ + 471, + 476 + ], + [ + 472, + 477 + ], + [ + 472, + 483 + ], + [ + 473, + 478 + ], + [ + 473, + 480 + ], + [ + 474, + 480 + ], + [ + 474, + 484 + ], + [ + 475, + 476 + ], + [ + 475, + 478 + ], + [ + 476, + 477 + ], + [ + 476, + 479 + ], + [ + 477, + 1 + ], + [ + 477, + 898 + ], + [ + 478, + 479 + ], + [ + 478, + 486 + ], + [ + 479, + 1 + ], + [ + 479, + 851 + ], + [ + 480, + 485 + ], + [ + 480, + 486 + ], + [ + 481, + 482 + ], + [ + 481, + 484 + ], + [ + 482, + 483 + ], + [ + 482, + 487 + ], + [ + 483, + 1 + ], + [ + 483, + 891 + ], + [ + 484, + 485 + ], + [ + 484, + 487 + ], + [ + 485, + 1 + ], + [ + 485, + 888 + ], + [ + 486, + 1 + ], + [ + 486, + 896 + ], + [ + 487, + 1 + ], + [ + 487, + 848 + ], + [ + 488, + 490 + ], + [ + 488, + 500 + ], + [ + 489, + 490 + ], + [ + 489, + 506 + ], + [ + 490, + 504 + ], + [ + 490, + 509 + ], + [ + 491, + 495 + ], + [ + 491, + 496 + ], + [ + 492, + 498 + ], + [ + 492, + 500 + ], + [ + 493, + 496 + ], + [ + 493, + 506 + ], + [ + 494, + 495 + ], + [ + 494, + 498 + ], + [ + 495, + 497 + ], + [ + 495, + 499 + ], + [ + 496, + 497 + ], + [ + 496, + 507 + ], + [ + 497, + 503 + ], + [ + 497, + 508 + ], + [ + 498, + 499 + ], + [ + 498, + 501 + ], + [ + 499, + 502 + ], + [ + 499, + 503 + ], + [ + 500, + 501 + ], + [ + 500, + 504 + ], + [ + 501, + 502 + ], + [ + 501, + 505 + ], + [ + 502, + 1 + ], + [ + 502, + 895 + ], + [ + 503, + 1 + ], + [ + 503, + 892 + ], + [ + 504, + 505 + ], + [ + 504, + 511 + ], + [ + 505, + 1 + ], + [ + 505, + 852 + ], + [ + 506, + 507 + ], + [ + 506, + 509 + ], + [ + 507, + 508 + ], + [ + 507, + 510 + ], + [ + 508, + 1 + ], + [ + 508, + 896 + ], + [ + 509, + 510 + ], + [ + 509, + 511 + ], + [ + 510, + 1 + ], + [ + 510, + 899 + ], + [ + 511, + 1 + ], + [ + 511, + 855 + ], + [ + 512, + 1 + ], + [ + 512, + 560 + ], + [ + 512, + 564 + ], + [ + 513, + 1 + ], + [ + 513, + 632 + ], + [ + 513, + 636 + ], + [ + 514, + 1 + ], + [ + 514, + 556 + ], + [ + 514, + 565 + ], + [ + 515, + 1 + ], + [ + 515, + 634 + ], + [ + 515, + 640 + ], + [ + 516, + 1 + ], + [ + 516, + 557 + ], + [ + 516, + 561 + ], + [ + 517, + 1 + ], + [ + 517, + 638 + ], + [ + 517, + 642 + ], + [ + 518, + 1 + ], + [ + 518, + 577 + ], + [ + 518, + 776 + ], + [ + 519, + 1 + ], + [ + 519, + 579 + ], + [ + 519, + 778 + ], + [ + 520, + 1 + ], + [ + 520, + 620 + ], + [ + 520, + 821 + ], + [ + 521, + 1 + ], + [ + 521, + 622 + ], + [ + 521, + 823 + ], + [ + 522, + 1 + ], + [ + 522, + 569 + ], + [ + 522, + 768 + ], + [ + 523, + 1 + ], + [ + 523, + 571 + ], + [ + 523, + 770 + ], + [ + 524, + 1 + ], + [ + 524, + 628 + ], + [ + 524, + 829 + ], + [ + 525, + 1 + ], + [ + 525, + 630 + ], + [ + 525, + 831 + ], + [ + 526, + 1 + ], + [ + 526, + 593 + ], + [ + 526, + 792 + ], + [ + 527, + 1 + ], + [ + 527, + 595 + ], + [ + 527, + 794 + ], + [ + 528, + 1 + ], + [ + 528, + 604 + ], + [ + 528, + 805 + ], + [ + 529, + 1 + ], + [ + 529, + 606 + ], + [ + 529, + 807 + ], + [ + 530, + 1 + ], + [ + 530, + 585 + ], + [ + 530, + 784 + ], + [ + 531, + 1 + ], + [ + 531, + 587 + ], + [ + 531, + 786 + ], + [ + 532, + 1 + ], + [ + 532, + 612 + ], + [ + 532, + 813 + ], + [ + 533, + 1 + ], + [ + 533, + 614 + ], + [ + 533, + 815 + ], + [ + 534, + 1 + ], + [ + 534, + 609 + ], + [ + 534, + 808 + ], + [ + 535, + 1 + ], + [ + 535, + 611 + ], + [ + 535, + 810 + ], + [ + 536, + 1 + ], + [ + 536, + 588 + ], + [ + 536, + 789 + ], + [ + 537, + 1 + ], + [ + 537, + 590 + ], + [ + 537, + 791 + ], + [ + 538, + 1 + ], + [ + 538, + 601 + ], + [ + 538, + 800 + ], + [ + 539, + 1 + ], + [ + 539, + 603 + ], + [ + 539, + 802 + ], + [ + 540, + 1 + ], + [ + 540, + 596 + ], + [ + 540, + 797 + ], + [ + 541, + 1 + ], + [ + 541, + 598 + ], + [ + 541, + 799 + ], + [ + 542, + 1 + ], + [ + 542, + 625 + ], + [ + 542, + 824 + ], + [ + 543, + 1 + ], + [ + 543, + 627 + ], + [ + 543, + 826 + ], + [ + 544, + 1 + ], + [ + 544, + 572 + ], + [ + 544, + 773 + ], + [ + 545, + 1 + ], + [ + 545, + 574 + ], + [ + 545, + 775 + ], + [ + 546, + 1 + ], + [ + 546, + 617 + ], + [ + 546, + 816 + ], + [ + 547, + 1 + ], + [ + 547, + 619 + ], + [ + 547, + 818 + ], + [ + 548, + 1 + ], + [ + 548, + 580 + ], + [ + 548, + 781 + ], + [ + 549, + 1 + ], + [ + 549, + 582 + ], + [ + 549, + 783 + ], + [ + 550, + 1 + ], + [ + 550, + 558 + ], + [ + 550, + 637 + ], + [ + 551, + 1 + ], + [ + 551, + 562 + ], + [ + 551, + 641 + ], + [ + 552, + 1 + ], + [ + 552, + 559 + ], + [ + 552, + 633 + ], + [ + 553, + 1 + ], + [ + 553, + 566 + ], + [ + 553, + 643 + ], + [ + 554, + 1 + ], + [ + 554, + 563 + ], + [ + 554, + 635 + ], + [ + 555, + 1 + ], + [ + 555, + 567 + ], + [ + 555, + 639 + ], + [ + 556, + 756 + ], + [ + 556, + 764 + ], + [ + 557, + 757 + ], + [ + 557, + 760 + ], + [ + 558, + 758 + ], + [ + 558, + 836 + ], + [ + 559, + 759 + ], + [ + 559, + 832 + ], + [ + 560, + 760 + ], + [ + 560, + 765 + ], + [ + 561, + 756 + ], + [ + 561, + 761 + ], + [ + 562, + 762 + ], + [ + 562, + 840 + ], + [ + 563, + 763 + ], + [ + 563, + 834 + ], + [ + 564, + 761 + ], + [ + 564, + 764 + ], + [ + 565, + 757 + ], + [ + 565, + 765 + ], + [ + 566, + 766 + ], + [ + 566, + 842 + ], + [ + 567, + 767 + ], + [ + 567, + 838 + ], + [ + 568, + 768 + ], + [ + 568, + 777 + ], + [ + 569, + 644 + ], + [ + 569, + 769 + ], + [ + 570, + 770 + ], + [ + 570, + 779 + ], + [ + 571, + 645 + ], + [ + 571, + 771 + ], + [ + 572, + 748 + ], + [ + 572, + 772 + ], + [ + 573, + 773 + ], + [ + 573, + 820 + ], + [ + 574, + 749 + ], + [ + 574, + 774 + ], + [ + 575, + 775 + ], + [ + 575, + 822 + ], + [ + 576, + 769 + ], + [ + 576, + 776 + ], + [ + 577, + 644 + ], + [ + 577, + 777 + ], + [ + 578, + 771 + ], + [ + 578, + 778 + ], + [ + 579, + 645 + ], + [ + 579, + 779 + ], + [ + 580, + 754 + ], + [ + 580, + 780 + ], + [ + 581, + 781 + ], + [ + 581, + 828 + ], + [ + 582, + 755 + ], + [ + 582, + 782 + ], + [ + 583, + 783 + ], + [ + 583, + 830 + ], + [ + 584, + 784 + ], + [ + 584, + 793 + ], + [ + 585, + 646 + ], + [ + 585, + 785 + ], + [ + 586, + 786 + ], + [ + 586, + 795 + ], + [ + 587, + 647 + ], + [ + 587, + 787 + ], + [ + 588, + 750 + ], + [ + 588, + 788 + ], + [ + 589, + 789 + ], + [ + 589, + 804 + ], + [ + 590, + 751 + ], + [ + 590, + 790 + ], + [ + 591, + 791 + ], + [ + 591, + 806 + ], + [ + 592, + 785 + ], + [ + 592, + 792 + ], + [ + 593, + 646 + ], + [ + 593, + 793 + ], + [ + 594, + 787 + ], + [ + 594, + 794 + ], + [ + 595, + 647 + ], + [ + 595, + 795 + ], + [ + 596, + 752 + ], + [ + 596, + 796 + ], + [ + 597, + 797 + ], + [ + 597, + 812 + ], + [ + 598, + 753 + ], + [ + 598, + 798 + ], + [ + 599, + 799 + ], + [ + 599, + 814 + ], + [ + 600, + 800 + ], + [ + 600, + 809 + ], + [ + 601, + 648 + ], + [ + 601, + 801 + ], + [ + 602, + 802 + ], + [ + 602, + 811 + ], + [ + 603, + 649 + ], + [ + 603, + 803 + ], + [ + 604, + 750 + ], + [ + 604, + 804 + ], + [ + 605, + 788 + ], + [ + 605, + 805 + ], + [ + 606, + 751 + ], + [ + 606, + 806 + ], + [ + 607, + 790 + ], + [ + 607, + 807 + ], + [ + 608, + 801 + ], + [ + 608, + 808 + ], + [ + 609, + 648 + ], + [ + 609, + 809 + ], + [ + 610, + 803 + ], + [ + 610, + 810 + ], + [ + 611, + 649 + ], + [ + 611, + 811 + ], + [ + 612, + 752 + ], + [ + 612, + 812 + ], + [ + 613, + 796 + ], + [ + 613, + 813 + ], + [ + 614, + 753 + ], + [ + 614, + 814 + ], + [ + 615, + 798 + ], + [ + 615, + 815 + ], + [ + 616, + 816 + ], + [ + 616, + 825 + ], + [ + 617, + 650 + ], + [ + 617, + 817 + ], + [ + 618, + 818 + ], + [ + 618, + 827 + ], + [ + 619, + 651 + ], + [ + 619, + 819 + ], + [ + 620, + 748 + ], + [ + 620, + 820 + ], + [ + 621, + 772 + ], + [ + 621, + 821 + ], + [ + 622, + 749 + ], + [ + 622, + 822 + ], + [ + 623, + 774 + ], + [ + 623, + 823 + ], + [ + 624, + 817 + ], + [ + 624, + 824 + ], + [ + 625, + 650 + ], + [ + 625, + 825 + ], + [ + 626, + 819 + ], + [ + 626, + 826 + ], + [ + 627, + 651 + ], + [ + 627, + 827 + ], + [ + 628, + 754 + ], + [ + 628, + 828 + ], + [ + 629, + 780 + ], + [ + 629, + 829 + ], + [ + 630, + 755 + ], + [ + 630, + 830 + ], + [ + 631, + 782 + ], + [ + 631, + 831 + ], + [ + 632, + 832 + ], + [ + 632, + 837 + ], + [ + 633, + 758 + ], + [ + 633, + 833 + ], + [ + 634, + 834 + ], + [ + 634, + 841 + ], + [ + 635, + 762 + ], + [ + 635, + 835 + ], + [ + 636, + 833 + ], + [ + 636, + 836 + ], + [ + 637, + 759 + ], + [ + 637, + 837 + ], + [ + 638, + 838 + ], + [ + 638, + 843 + ], + [ + 639, + 766 + ], + [ + 639, + 839 + ], + [ + 640, + 835 + ], + [ + 640, + 840 + ], + [ + 641, + 763 + ], + [ + 641, + 841 + ], + [ + 642, + 839 + ], + [ + 642, + 842 + ], + [ + 643, + 767 + ], + [ + 643, + 843 + ], + [ + 644, + 1 + ], + [ + 644, + 900 + ], + [ + 644, + 908 + ], + [ + 645, + 1 + ], + [ + 645, + 903 + ], + [ + 645, + 911 + ], + [ + 646, + 1 + ], + [ + 646, + 906 + ], + [ + 646, + 914 + ], + [ + 647, + 1 + ], + [ + 647, + 907 + ], + [ + 647, + 915 + ], + [ + 648, + 1 + ], + [ + 648, + 906 + ], + [ + 648, + 915 + ], + [ + 649, + 1 + ], + [ + 649, + 907 + ], + [ + 649, + 914 + ], + [ + 650, + 1 + ], + [ + 650, + 900 + ], + [ + 650, + 911 + ], + [ + 651, + 1 + ], + [ + 651, + 903 + ], + [ + 651, + 908 + ], + [ + 652, + 1 + ], + [ + 652, + 916 + ], + [ + 652, + 924 + ], + [ + 653, + 1 + ], + [ + 653, + 919 + ], + [ + 653, + 927 + ], + [ + 654, + 1 + ], + [ + 654, + 922 + ], + [ + 654, + 930 + ], + [ + 655, + 1 + ], + [ + 655, + 923 + ], + [ + 655, + 931 + ], + [ + 656, + 1 + ], + [ + 656, + 922 + ], + [ + 656, + 931 + ], + [ + 657, + 1 + ], + [ + 657, + 923 + ], + [ + 657, + 930 + ], + [ + 658, + 1 + ], + [ + 658, + 916 + ], + [ + 658, + 927 + ], + [ + 659, + 1 + ], + [ + 659, + 919 + ], + [ + 659, + 924 + ], + [ + 660, + 1 + ], + [ + 660, + 932 + ], + [ + 660, + 940 + ], + [ + 661, + 1 + ], + [ + 661, + 935 + ], + [ + 661, + 943 + ], + [ + 662, + 1 + ], + [ + 662, + 938 + ], + [ + 662, + 946 + ], + [ + 663, + 1 + ], + [ + 663, + 939 + ], + [ + 663, + 947 + ], + [ + 664, + 1 + ], + [ + 664, + 938 + ], + [ + 664, + 947 + ], + [ + 665, + 1 + ], + [ + 665, + 939 + ], + [ + 665, + 946 + ], + [ + 666, + 1 + ], + [ + 666, + 932 + ], + [ + 666, + 943 + ], + [ + 667, + 1 + ], + [ + 667, + 935 + ], + [ + 667, + 940 + ], + [ + 668, + 1 + ], + [ + 668, + 948 + ], + [ + 668, + 956 + ], + [ + 669, + 1 + ], + [ + 669, + 951 + ], + [ + 669, + 959 + ], + [ + 670, + 1 + ], + [ + 670, + 954 + ], + [ + 670, + 962 + ], + [ + 671, + 1 + ], + [ + 671, + 955 + ], + [ + 671, + 963 + ], + [ + 672, + 1 + ], + [ + 672, + 954 + ], + [ + 672, + 963 + ], + [ + 673, + 1 + ], + [ + 673, + 955 + ], + [ + 673, + 962 + ], + [ + 674, + 1 + ], + [ + 674, + 948 + ], + [ + 674, + 959 + ], + [ + 675, + 1 + ], + [ + 675, + 951 + ], + [ + 675, + 956 + ], + [ + 676, + 1 + ], + [ + 676, + 964 + ], + [ + 676, + 972 + ], + [ + 677, + 1 + ], + [ + 677, + 967 + ], + [ + 677, + 975 + ], + [ + 678, + 1 + ], + [ + 678, + 970 + ], + [ + 678, + 978 + ], + [ + 679, + 1 + ], + [ + 679, + 971 + ], + [ + 679, + 979 + ], + [ + 680, + 1 + ], + [ + 680, + 970 + ], + [ + 680, + 979 + ], + [ + 681, + 1 + ], + [ + 681, + 971 + ], + [ + 681, + 978 + ], + [ + 682, + 1 + ], + [ + 682, + 964 + ], + [ + 682, + 975 + ], + [ + 683, + 1 + ], + [ + 683, + 967 + ], + [ + 683, + 972 + ], + [ + 684, + 1 + ], + [ + 684, + 980 + ], + [ + 684, + 988 + ], + [ + 685, + 1 + ], + [ + 685, + 983 + ], + [ + 685, + 991 + ], + [ + 686, + 1 + ], + [ + 686, + 986 + ], + [ + 686, + 994 + ], + [ + 687, + 1 + ], + [ + 687, + 987 + ], + [ + 687, + 995 + ], + [ + 688, + 1 + ], + [ + 688, + 986 + ], + [ + 688, + 995 + ], + [ + 689, + 1 + ], + [ + 689, + 987 + ], + [ + 689, + 994 + ], + [ + 690, + 1 + ], + [ + 690, + 980 + ], + [ + 690, + 991 + ], + [ + 691, + 1 + ], + [ + 691, + 983 + ], + [ + 691, + 988 + ], + [ + 692, + 1 + ], + [ + 692, + 996 + ], + [ + 692, + 1004 + ], + [ + 693, + 1 + ], + [ + 693, + 999 + ], + [ + 693, + 1007 + ], + [ + 694, + 1 + ], + [ + 694, + 1002 + ], + [ + 694, + 1010 + ], + [ + 695, + 1 + ], + [ + 695, + 1003 + ], + [ + 695, + 1011 + ], + [ + 696, + 1 + ], + [ + 696, + 1002 + ], + [ + 696, + 1011 + ], + [ + 697, + 1 + ], + [ + 697, + 1003 + ], + [ + 697, + 1010 + ], + [ + 698, + 1 + ], + [ + 698, + 996 + ], + [ + 698, + 1007 + ], + [ + 699, + 1 + ], + [ + 699, + 999 + ], + [ + 699, + 1004 + ], + [ + 700, + 1 + ], + [ + 700, + 1012 + ], + [ + 700, + 1020 + ], + [ + 701, + 1 + ], + [ + 701, + 1015 + ], + [ + 701, + 1023 + ], + [ + 702, + 1 + ], + [ + 702, + 1018 + ], + [ + 702, + 1026 + ], + [ + 703, + 1 + ], + [ + 703, + 1019 + ], + [ + 703, + 1027 + ], + [ + 704, + 1 + ], + [ + 704, + 1018 + ], + [ + 704, + 1027 + ], + [ + 705, + 1 + ], + [ + 705, + 1019 + ], + [ + 705, + 1026 + ], + [ + 706, + 1 + ], + [ + 706, + 1012 + ], + [ + 706, + 1023 + ], + [ + 707, + 1 + ], + [ + 707, + 1015 + ], + [ + 707, + 1020 + ], + [ + 708, + 1 + ], + [ + 708, + 1028 + ], + [ + 708, + 1036 + ], + [ + 709, + 1 + ], + [ + 709, + 1031 + ], + [ + 709, + 1039 + ], + [ + 710, + 1 + ], + [ + 710, + 1034 + ], + [ + 710, + 1042 + ], + [ + 711, + 1 + ], + [ + 711, + 1035 + ], + [ + 711, + 1043 + ], + [ + 712, + 1 + ], + [ + 712, + 1034 + ], + [ + 712, + 1043 + ], + [ + 713, + 1 + ], + [ + 713, + 1035 + ], + [ + 713, + 1042 + ], + [ + 714, + 1 + ], + [ + 714, + 1028 + ], + [ + 714, + 1039 + ], + [ + 715, + 1 + ], + [ + 715, + 1031 + ], + [ + 715, + 1036 + ], + [ + 716, + 1 + ], + [ + 716, + 1044 + ], + [ + 716, + 1052 + ], + [ + 717, + 1 + ], + [ + 717, + 1047 + ], + [ + 717, + 1055 + ], + [ + 718, + 1 + ], + [ + 718, + 1050 + ], + [ + 718, + 1058 + ], + [ + 719, + 1 + ], + [ + 719, + 1051 + ], + [ + 719, + 1059 + ], + [ + 720, + 1 + ], + [ + 720, + 1050 + ], + [ + 720, + 1059 + ], + [ + 721, + 1 + ], + [ + 721, + 1051 + ], + [ + 721, + 1058 + ], + [ + 722, + 1 + ], + [ + 722, + 1044 + ], + [ + 722, + 1055 + ], + [ + 723, + 1 + ], + [ + 723, + 1047 + ], + [ + 723, + 1052 + ], + [ + 724, + 1 + ], + [ + 724, + 1060 + ], + [ + 724, + 1068 + ], + [ + 725, + 1 + ], + [ + 725, + 1063 + ], + [ + 725, + 1071 + ], + [ + 726, + 1 + ], + [ + 726, + 1066 + ], + [ + 726, + 1074 + ], + [ + 727, + 1 + ], + [ + 727, + 1067 + ], + [ + 727, + 1075 + ], + [ + 728, + 1 + ], + [ + 728, + 1066 + ], + [ + 728, + 1075 + ], + [ + 729, + 1 + ], + [ + 729, + 1067 + ], + [ + 729, + 1074 + ], + [ + 730, + 1 + ], + [ + 730, + 1060 + ], + [ + 730, + 1071 + ], + [ + 731, + 1 + ], + [ + 731, + 1063 + ], + [ + 731, + 1068 + ], + [ + 732, + 1 + ], + [ + 732, + 1076 + ], + [ + 732, + 1084 + ], + [ + 733, + 1 + ], + [ + 733, + 1079 + ], + [ + 733, + 1087 + ], + [ + 734, + 1 + ], + [ + 734, + 1082 + ], + [ + 734, + 1090 + ], + [ + 735, + 1 + ], + [ + 735, + 1083 + ], + [ + 735, + 1091 + ], + [ + 736, + 1 + ], + [ + 736, + 1082 + ], + [ + 736, + 1091 + ], + [ + 737, + 1 + ], + [ + 737, + 1083 + ], + [ + 737, + 1090 + ], + [ + 738, + 1 + ], + [ + 738, + 1076 + ], + [ + 738, + 1087 + ], + [ + 739, + 1 + ], + [ + 739, + 1079 + ], + [ + 739, + 1084 + ], + [ + 740, + 1 + ], + [ + 740, + 1092 + ], + [ + 740, + 1100 + ], + [ + 741, + 1 + ], + [ + 741, + 1095 + ], + [ + 741, + 1103 + ], + [ + 742, + 1 + ], + [ + 742, + 1098 + ], + [ + 742, + 1106 + ], + [ + 743, + 1 + ], + [ + 743, + 1099 + ], + [ + 743, + 1107 + ], + [ + 744, + 1 + ], + [ + 744, + 1098 + ], + [ + 744, + 1107 + ], + [ + 745, + 1 + ], + [ + 745, + 1099 + ], + [ + 745, + 1106 + ], + [ + 746, + 1 + ], + [ + 746, + 1092 + ], + [ + 746, + 1103 + ], + [ + 747, + 1 + ], + [ + 747, + 1095 + ], + [ + 747, + 1100 + ], + [ + 748, + 1 + ], + [ + 748, + 1108 + ], + [ + 748, + 1116 + ], + [ + 749, + 1 + ], + [ + 749, + 1111 + ], + [ + 749, + 1119 + ], + [ + 750, + 1 + ], + [ + 750, + 1114 + ], + [ + 750, + 1122 + ], + [ + 751, + 1 + ], + [ + 751, + 1115 + ], + [ + 751, + 1123 + ], + [ + 752, + 1 + ], + [ + 752, + 1114 + ], + [ + 752, + 1123 + ], + [ + 753, + 1 + ], + [ + 753, + 1115 + ], + [ + 753, + 1122 + ], + [ + 754, + 1 + ], + [ + 754, + 1108 + ], + [ + 754, + 1119 + ], + [ + 755, + 1 + ], + [ + 755, + 1111 + ], + [ + 755, + 1116 + ], + [ + 756, + 1 + ], + [ + 756, + 845 + ], + [ + 757, + 1 + ], + [ + 757, + 847 + ], + [ + 758, + 1 + ], + [ + 758, + 845 + ], + [ + 759, + 1 + ], + [ + 759, + 846 + ], + [ + 760, + 1 + ], + [ + 760, + 849 + ], + [ + 761, + 1 + ], + [ + 761, + 851 + ], + [ + 762, + 1 + ], + [ + 762, + 849 + ], + [ + 763, + 1 + ], + [ + 763, + 850 + ], + [ + 764, + 1 + ], + [ + 764, + 853 + ], + [ + 765, + 1 + ], + [ + 765, + 855 + ], + [ + 766, + 1 + ], + [ + 766, + 853 + ], + [ + 767, + 1 + ], + [ + 767, + 854 + ], + [ + 768, + 1 + ], + [ + 768, + 858 + ], + [ + 769, + 1 + ], + [ + 769, + 856 + ], + [ + 770, + 1 + ], + [ + 770, + 857 + ], + [ + 771, + 1 + ], + [ + 771, + 859 + ], + [ + 772, + 1 + ], + [ + 772, + 859 + ], + [ + 773, + 1 + ], + [ + 773, + 856 + ], + [ + 774, + 1 + ], + [ + 774, + 857 + ], + [ + 775, + 1 + ], + [ + 775, + 858 + ], + [ + 776, + 1 + ], + [ + 776, + 862 + ], + [ + 777, + 1 + ], + [ + 777, + 860 + ], + [ + 778, + 1 + ], + [ + 778, + 861 + ], + [ + 779, + 1 + ], + [ + 779, + 863 + ], + [ + 780, + 1 + ], + [ + 780, + 863 + ], + [ + 781, + 1 + ], + [ + 781, + 860 + ], + [ + 782, + 1 + ], + [ + 782, + 861 + ], + [ + 783, + 1 + ], + [ + 783, + 862 + ], + [ + 784, + 1 + ], + [ + 784, + 866 + ], + [ + 785, + 1 + ], + [ + 785, + 864 + ], + [ + 786, + 1 + ], + [ + 786, + 865 + ], + [ + 787, + 1 + ], + [ + 787, + 867 + ], + [ + 788, + 1 + ], + [ + 788, + 867 + ], + [ + 789, + 1 + ], + [ + 789, + 864 + ], + [ + 790, + 1 + ], + [ + 790, + 865 + ], + [ + 791, + 1 + ], + [ + 791, + 866 + ], + [ + 792, + 1 + ], + [ + 792, + 870 + ], + [ + 793, + 1 + ], + [ + 793, + 868 + ], + [ + 794, + 1 + ], + [ + 794, + 869 + ], + [ + 795, + 1 + ], + [ + 795, + 871 + ], + [ + 796, + 1 + ], + [ + 796, + 871 + ], + [ + 797, + 1 + ], + [ + 797, + 868 + ], + [ + 798, + 1 + ], + [ + 798, + 869 + ], + [ + 799, + 1 + ], + [ + 799, + 870 + ], + [ + 800, + 1 + ], + [ + 800, + 874 + ], + [ + 801, + 1 + ], + [ + 801, + 872 + ], + [ + 802, + 1 + ], + [ + 802, + 873 + ], + [ + 803, + 1 + ], + [ + 803, + 875 + ], + [ + 804, + 1 + ], + [ + 804, + 875 + ], + [ + 805, + 1 + ], + [ + 805, + 872 + ], + [ + 806, + 1 + ], + [ + 806, + 873 + ], + [ + 807, + 1 + ], + [ + 807, + 874 + ], + [ + 808, + 1 + ], + [ + 808, + 878 + ], + [ + 809, + 1 + ], + [ + 809, + 876 + ], + [ + 810, + 1 + ], + [ + 810, + 877 + ], + [ + 811, + 1 + ], + [ + 811, + 879 + ], + [ + 812, + 1 + ], + [ + 812, + 879 + ], + [ + 813, + 1 + ], + [ + 813, + 876 + ], + [ + 814, + 1 + ], + [ + 814, + 877 + ], + [ + 815, + 1 + ], + [ + 815, + 878 + ], + [ + 816, + 1 + ], + [ + 816, + 882 + ], + [ + 817, + 1 + ], + [ + 817, + 880 + ], + [ + 818, + 1 + ], + [ + 818, + 881 + ], + [ + 819, + 1 + ], + [ + 819, + 883 + ], + [ + 820, + 1 + ], + [ + 820, + 883 + ], + [ + 821, + 1 + ], + [ + 821, + 880 + ], + [ + 822, + 1 + ], + [ + 822, + 881 + ], + [ + 823, + 1 + ], + [ + 823, + 882 + ], + [ + 824, + 1 + ], + [ + 824, + 886 + ], + [ + 825, + 1 + ], + [ + 825, + 884 + ], + [ + 826, + 1 + ], + [ + 826, + 885 + ], + [ + 827, + 1 + ], + [ + 827, + 887 + ], + [ + 828, + 1 + ], + [ + 828, + 887 + ], + [ + 829, + 1 + ], + [ + 829, + 884 + ], + [ + 830, + 1 + ], + [ + 830, + 885 + ], + [ + 831, + 1 + ], + [ + 831, + 886 + ], + [ + 832, + 1 + ], + [ + 832, + 889 + ], + [ + 833, + 1 + ], + [ + 833, + 891 + ], + [ + 834, + 1 + ], + [ + 834, + 889 + ], + [ + 835, + 1 + ], + [ + 835, + 890 + ], + [ + 836, + 1 + ], + [ + 836, + 893 + ], + [ + 837, + 1 + ], + [ + 837, + 895 + ], + [ + 838, + 1 + ], + [ + 838, + 893 + ], + [ + 839, + 1 + ], + [ + 839, + 894 + ], + [ + 840, + 1 + ], + [ + 840, + 897 + ], + [ + 841, + 1 + ], + [ + 841, + 899 + ], + [ + 842, + 1 + ], + [ + 842, + 897 + ], + [ + 843, + 1 + ], + [ + 843, + 898 + ], + [ + 900, + 901 + ], + [ + 900, + 902 + ], + [ + 903, + 904 + ], + [ + 903, + 905 + ], + [ + 906, + 901 + ], + [ + 906, + 905 + ], + [ + 907, + 902 + ], + [ + 907, + 904 + ], + [ + 908, + 909 + ], + [ + 908, + 910 + ], + [ + 911, + 912 + ], + [ + 911, + 913 + ], + [ + 914, + 910 + ], + [ + 914, + 912 + ], + [ + 915, + 909 + ], + [ + 915, + 913 + ], + [ + 916, + 917 + ], + [ + 916, + 918 + ], + [ + 919, + 920 + ], + [ + 919, + 921 + ], + [ + 922, + 917 + ], + [ + 922, + 921 + ], + [ + 923, + 918 + ], + [ + 923, + 920 + ], + [ + 924, + 925 + ], + [ + 924, + 926 + ], + [ + 927, + 928 + ], + [ + 927, + 929 + ], + [ + 930, + 926 + ], + [ + 930, + 928 + ], + [ + 931, + 925 + ], + [ + 931, + 929 + ], + [ + 932, + 933 + ], + [ + 932, + 934 + ], + [ + 935, + 936 + ], + [ + 935, + 937 + ], + [ + 938, + 933 + ], + [ + 938, + 937 + ], + [ + 939, + 934 + ], + [ + 939, + 936 + ], + [ + 940, + 941 + ], + [ + 940, + 942 + ], + [ + 943, + 944 + ], + [ + 943, + 945 + ], + [ + 946, + 942 + ], + [ + 946, + 944 + ], + [ + 947, + 941 + ], + [ + 947, + 945 + ], + [ + 948, + 949 + ], + [ + 948, + 950 + ], + [ + 951, + 952 + ], + [ + 951, + 953 + ], + [ + 954, + 949 + ], + [ + 954, + 953 + ], + [ + 955, + 950 + ], + [ + 955, + 952 + ], + [ + 956, + 957 + ], + [ + 956, + 958 + ], + [ + 959, + 960 + ], + [ + 959, + 961 + ], + [ + 962, + 958 + ], + [ + 962, + 960 + ], + [ + 963, + 957 + ], + [ + 963, + 961 + ], + [ + 964, + 965 + ], + [ + 964, + 966 + ], + [ + 967, + 968 + ], + [ + 967, + 969 + ], + [ + 970, + 965 + ], + [ + 970, + 969 + ], + [ + 971, + 966 + ], + [ + 971, + 968 + ], + [ + 972, + 973 + ], + [ + 972, + 974 + ], + [ + 975, + 976 + ], + [ + 975, + 977 + ], + [ + 978, + 974 + ], + [ + 978, + 976 + ], + [ + 979, + 973 + ], + [ + 979, + 977 + ], + [ + 980, + 981 + ], + [ + 980, + 982 + ], + [ + 983, + 984 + ], + [ + 983, + 985 + ], + [ + 986, + 981 + ], + [ + 986, + 985 + ], + [ + 987, + 982 + ], + [ + 987, + 984 + ], + [ + 988, + 989 + ], + [ + 988, + 990 + ], + [ + 991, + 992 + ], + [ + 991, + 993 + ], + [ + 994, + 990 + ], + [ + 994, + 992 + ], + [ + 995, + 989 + ], + [ + 995, + 993 + ], + [ + 996, + 997 + ], + [ + 996, + 998 + ], + [ + 999, + 1000 + ], + [ + 999, + 1001 + ], + [ + 1002, + 997 + ], + [ + 1002, + 1001 + ], + [ + 1003, + 998 + ], + [ + 1003, + 1000 + ], + [ + 1004, + 1005 + ], + [ + 1004, + 1006 + ], + [ + 1007, + 1008 + ], + [ + 1007, + 1009 + ], + [ + 1010, + 1006 + ], + [ + 1010, + 1008 + ], + [ + 1011, + 1005 + ], + [ + 1011, + 1009 + ], + [ + 1012, + 1013 + ], + [ + 1012, + 1014 + ], + [ + 1015, + 1016 + ], + [ + 1015, + 1017 + ], + [ + 1018, + 1013 + ], + [ + 1018, + 1017 + ], + [ + 1019, + 1014 + ], + [ + 1019, + 1016 + ], + [ + 1020, + 1021 + ], + [ + 1020, + 1022 + ], + [ + 1023, + 1024 + ], + [ + 1023, + 1025 + ], + [ + 1026, + 1022 + ], + [ + 1026, + 1024 + ], + [ + 1027, + 1021 + ], + [ + 1027, + 1025 + ], + [ + 1028, + 1029 + ], + [ + 1028, + 1030 + ], + [ + 1031, + 1032 + ], + [ + 1031, + 1033 + ], + [ + 1034, + 1029 + ], + [ + 1034, + 1033 + ], + [ + 1035, + 1030 + ], + [ + 1035, + 1032 + ], + [ + 1036, + 1037 + ], + [ + 1036, + 1038 + ], + [ + 1039, + 1040 + ], + [ + 1039, + 1041 + ], + [ + 1042, + 1038 + ], + [ + 1042, + 1040 + ], + [ + 1043, + 1037 + ], + [ + 1043, + 1041 + ], + [ + 1044, + 1045 + ], + [ + 1044, + 1046 + ], + [ + 1047, + 1048 + ], + [ + 1047, + 1049 + ], + [ + 1050, + 1045 + ], + [ + 1050, + 1049 + ], + [ + 1051, + 1046 + ], + [ + 1051, + 1048 + ], + [ + 1052, + 1053 + ], + [ + 1052, + 1054 + ], + [ + 1055, + 1056 + ], + [ + 1055, + 1057 + ], + [ + 1058, + 1054 + ], + [ + 1058, + 1056 + ], + [ + 1059, + 1053 + ], + [ + 1059, + 1057 + ], + [ + 1060, + 1061 + ], + [ + 1060, + 1062 + ], + [ + 1063, + 1064 + ], + [ + 1063, + 1065 + ], + [ + 1066, + 1061 + ], + [ + 1066, + 1065 + ], + [ + 1067, + 1062 + ], + [ + 1067, + 1064 + ], + [ + 1068, + 1069 + ], + [ + 1068, + 1070 + ], + [ + 1071, + 1072 + ], + [ + 1071, + 1073 + ], + [ + 1074, + 1070 + ], + [ + 1074, + 1072 + ], + [ + 1075, + 1069 + ], + [ + 1075, + 1073 + ], + [ + 1076, + 1077 + ], + [ + 1076, + 1078 + ], + [ + 1079, + 1080 + ], + [ + 1079, + 1081 + ], + [ + 1082, + 1077 + ], + [ + 1082, + 1081 + ], + [ + 1083, + 1078 + ], + [ + 1083, + 1080 + ], + [ + 1084, + 1085 + ], + [ + 1084, + 1086 + ], + [ + 1087, + 1088 + ], + [ + 1087, + 1089 + ], + [ + 1090, + 1086 + ], + [ + 1090, + 1088 + ], + [ + 1091, + 1085 + ], + [ + 1091, + 1089 + ], + [ + 1092, + 1093 + ], + [ + 1092, + 1094 + ], + [ + 1095, + 1096 + ], + [ + 1095, + 1097 + ], + [ + 1098, + 1093 + ], + [ + 1098, + 1097 + ], + [ + 1099, + 1094 + ], + [ + 1099, + 1096 + ], + [ + 1100, + 1101 + ], + [ + 1100, + 1102 + ], + [ + 1103, + 1104 + ], + [ + 1103, + 1105 + ], + [ + 1106, + 1102 + ], + [ + 1106, + 1104 + ], + [ + 1107, + 1101 + ], + [ + 1107, + 1105 + ], + [ + 1108, + 1109 + ], + [ + 1108, + 1110 + ], + [ + 1111, + 1112 + ], + [ + 1111, + 1113 + ], + [ + 1114, + 1109 + ], + [ + 1114, + 1113 + ], + [ + 1115, + 1110 + ], + [ + 1115, + 1112 + ], + [ + 1116, + 1117 + ], + [ + 1116, + 1118 + ], + [ + 1119, + 1120 + ], + [ + 1119, + 1121 + ], + [ + 1122, + 1118 + ], + [ + 1122, + 1120 + ], + [ + 1123, + 1117 + ], + [ + 1123, + 1121 + ] + ], + "fresh_edges": 1879, + "ranks": { + "1": 1752, + "2": 704, + "3": 300, + "4": 168, + "5": 126, + "6": 44, + "8": 16 + }, + "recipe_sha256": "f4720d94c66eef3a6a323a2a05740a083100744701f60a2ff02e6e1f962f7113", + "reused_edges": 1231, + "reused_endpoint_adapters": 224, + "scope": "Only previously unseen ordered pairs of actual canonical subspaces were freshly lowered. Identical baseline pairs and all endpoint adapters reuse the pinned phase certificates; no full cold replay was performed.", + "status": "PASS_REUSED_AND_FRESH_EXACT_LOCAL_PHASE_RECIPES", + "vector_arithmetic": "Exact checked int64 Gaussian dyadics; cached permutations and Z4 phase actions. No floating-point equality." + }, + "pr999_saved_outside_factories": { + "backward": 0, + "forward": 0 + }, + "programs": { + "backward": { + "accumulated": { + "all_columns": 725, + "exact_peak_row_l1": "107", + "fractional_depth": 2, + "operand_reads": 123304, + "paid_profile": { + "1": 2024, + "2": 760, + "3": 300, + "4": 168, + "5": 168, + "6": 44, + "8": 8 + }, + "positive_peak": "1301331", + "primitive_tags": { + "add": 15416, + "clear": 30352, + "copy": 24192, + "double": 780, + "halve": 37356, + "negate": 336, + "subtract": 14904 + }, + "real_primitives": 123336, + "restored_dirty_helpers": 492, + "word_sha256": "22f7555721b86f797745cc42858bc1215fe70d12662fdfd14f8b174a1124adf1" + }, + "cache": { + "all_columns": 725, + "exact_peak_row_l1": "107", + "fractional_depth": 2, + "operand_reads": 123304, + "paid_profile": { + "1": 2024, + "2": 760, + "3": 300, + "4": 168, + "5": 168, + "6": 44, + "8": 8 + }, + "positive_peak": "1301331", + "primitive_tags": { + "add": 15416, + "clear": 28952, + "copy": 24192, + "double": 780, + "halve": 37356, + "negate": 336, + "subtract": 14904 + }, + "real_primitives": 121936, + "restored_dirty_helpers": 492, + "word_sha256": "58382957e206a14f1632290aabe8b9d05cecf1ac811848b952e0385a5aed0696" + }, + "candidate": { + "all_columns": 725, + "exact_peak_row_l1": "64", + "fractional_depth": 2, + "operand_reads": 122744, + "paid_profile": { + "1": 2024, + "2": 760, + "3": 300, + "4": 168, + "5": 168, + "6": 44, + "8": 8 + }, + "positive_peak": "1301331", + "primitive_tags": { + "add": 15656, + "clear": 28952, + "copy": 23496, + "double": 364, + "halve": 37300, + "negate": 336, + "subtract": 14968 + }, + "real_primitives": 121072, + "restored_dirty_helpers": 492, + "word_sha256": "0f7d44fc113982e91f2398ef891068cb84d2386c5ecd71f1324f14ea33b98133" + }, + "pr696": { + "all_columns": 725, + "exact_peak_row_l1": "107", + "fractional_depth": 2, + "operand_reads": 123304, + "paid_profile": { + "1": 2024, + "2": 760, + "3": 300, + "4": 168, + "5": 168, + "6": 44, + "8": 8 + }, + "positive_peak": "1301331", + "primitive_tags": { + "add": 15416, + "clear": 30352, + "copy": 24192, + "double": 780, + "halve": 37356, + "negate": 336, + "subtract": 14904 + }, + "real_primitives": 123336, + "restored_dirty_helpers": 492, + "word_sha256": "3250afd59ae6edf1c4fcaf7128588125417e264d693b5fa539b3939edae1f9dd" + }, + "strong": { + "all_columns": 725, + "exact_peak_row_l1": "95", + "fractional_depth": 2, + "operand_reads": 123304, + "paid_profile": { + "1": 2024, + "2": 760, + "3": 300, + "4": 168, + "5": 168, + "6": 44, + "8": 8 + }, + "positive_peak": "1301331", + "primitive_tags": { + "add": 15768, + "clear": 28952, + "copy": 23496, + "double": 420, + "halve": 37356, + "negate": 336, + "subtract": 15080 + }, + "real_primitives": 121408, + "restored_dirty_helpers": 492, + "word_sha256": "976d04af1cc3b579c7d637846395581a16ed3de0be8c4ab9659512a1131c3f6c" + } + }, + "forward": { + "accumulated": { + "all_columns": 725, + "exact_peak_row_l1": "124", + "fractional_depth": 2, + "operand_reads": 123288, + "paid_profile": { + "1": 2024, + "2": 760, + "3": 300, + "4": 168, + "5": 168, + "6": 44, + "8": 8 + }, + "positive_peak": "39090", + "primitive_tags": { + "add": 15112, + "clear": 30336, + "copy": 24208, + "double": 780, + "halve": 37356, + "negate": 336, + "subtract": 15192 + }, + "real_primitives": 123320, + "restored_dirty_helpers": 492, + "word_sha256": "f60e37824e531a46bc9e1dc65fdab52ecfabebe2e649026dc3e69a52f2708018" + }, + "cache": { + "all_columns": 725, + "exact_peak_row_l1": "124", + "fractional_depth": 2, + "operand_reads": 123176, + "paid_profile": { + "1": 2024, + "2": 760, + "3": 300, + "4": 168, + "5": 168, + "6": 44, + "8": 8 + }, + "positive_peak": "39090", + "primitive_tags": { + "add": 15112, + "clear": 28936, + "copy": 24152, + "double": 724, + "halve": 37356, + "negate": 336, + "subtract": 15192 + }, + "real_primitives": 121808, + "restored_dirty_helpers": 492, + "word_sha256": "fc74d0bab8482733f7492f5208a9aee307d46da89a455f68a881ffe45ff7c4e4" + }, + "candidate": { + "all_columns": 725, + "exact_peak_row_l1": "124", + "fractional_depth": 2, + "operand_reads": 122728, + "paid_profile": { + "1": 2024, + "2": 760, + "3": 300, + "4": 168, + "5": 168, + "6": 44, + "8": 8 + }, + "positive_peak": "39090", + "primitive_tags": { + "add": 15176, + "clear": 28936, + "copy": 23512, + "double": 364, + "halve": 37300, + "negate": 336, + "subtract": 15432 + }, + "real_primitives": 121056, + "restored_dirty_helpers": 492, + "word_sha256": "79ba5b2611b8f499939c15241ee165c7805f71ebf9566631bea44d5fd3594e4a" + }, + "pr696": { + "all_columns": 725, + "exact_peak_row_l1": "124", + "fractional_depth": 2, + "operand_reads": 123288, + "paid_profile": { + "1": 2024, + "2": 760, + "3": 300, + "4": 168, + "5": 168, + "6": 44, + "8": 8 + }, + "positive_peak": "39090", + "primitive_tags": { + "add": 15112, + "clear": 30336, + "copy": 24208, + "double": 780, + "halve": 37356, + "negate": 336, + "subtract": 15192 + }, + "real_primitives": 123320, + "restored_dirty_helpers": 492, + "word_sha256": "decc04e620ac0863fc51ea27a44c0922ddb06d528b16d2ae09328a134a695b2f" + }, + "strong": { + "all_columns": 725, + "exact_peak_row_l1": "124", + "fractional_depth": 2, + "operand_reads": 123288, + "paid_profile": { + "1": 2024, + "2": 760, + "3": 300, + "4": 168, + "5": 168, + "6": 44, + "8": 8 + }, + "positive_peak": "39090", + "primitive_tags": { + "add": 15288, + "clear": 28936, + "copy": 23512, + "double": 420, + "halve": 37356, + "negate": 336, + "subtract": 15544 + }, + "real_primitives": 121392, + "restored_dirty_helpers": 492, + "word_sha256": "4a21acadb13cc51b14da23081b47c9b72401a8d101a26652e5c8eb3d31dd904e" + } + } + }, + "saved_vs_pr696_per_call": { + "backward": 2264, + "forward": 2264 + }, + "small_integer_saved_outside_factories": { + "backward": 304, + "forward": 304 + }, + "status": "PASS_EXACT_COMPLEX_FACTORY_FUSION" +} diff --git a/research/complex-factory-fusion/OVERLAP.json b/research/complex-factory-fusion/OVERLAP.json new file mode 100644 index 0000000000..20970ecad5 --- /dev/null +++ b/research/complex-factory-fusion/OVERLAP.json @@ -0,0 +1,124 @@ +{ + "checked_utc": "2026-10-13 17:25:09 UTC", + "scope": "Fixed PR924 eight-register map; raw PR622 reconstruction only.", + "pull_requests": [ + { + "number": 681, + "head": "e536f6fc8aad65adef8ac4682d13625598a5c3f9", + "state": "closed", + "merged": true, + "title": "Consolidate six circuit PRs: 31.72% fewer bit ADDs and 22\u201325% fewer complex primitives", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/681", + "updated_at": "2026-10-13T06:10:35Z" + }, + { + "number": 696, + "head": "5a3f983715027c4fd83f50bc9001d4b18463bed1", + "state": "closed", + "merged": true, + "title": "Research: lower selected complex scalar primitives by 22\u201325% (no new kappa)", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/696", + "updated_at": "2026-10-13T06:44:21Z" + }, + { + "number": 922, + "head": "efd5643c0016b6c6dac26e9ed7dee8a75295ff2a", + "state": "open", + "merged": false, + "title": "Research: fuse complex factory to 32 operations (no new kappa)", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/922", + "updated_at": "2026-10-13T12:44:22Z" + }, + { + "number": 924, + "head": "d02d83332581f6a23616c1366c6b3901d42f4b06", + "state": "open", + "merged": false, + "title": "Research: compose PR922 factory fusions with PR924 rescaling", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/924", + "updated_at": "2026-10-13T13:29:56Z" + }, + { + "number": 999, + "head": "fd38a824adb3a5c60c101a86c950a6d590454adf", + "state": "open", + "merged": false, + "title": "Research: bounded target accumulation saves additional complex primitives (no new kappa)", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/999", + "updated_at": "2026-10-13T16:13:31Z" + }, + { + "number": 1004, + "head": "1974578f82a30158dd5fcdcdf226b83df8e7196f", + "state": "open", + "merged": false, + "title": "Conditional \u03ba = 0.001664233607446043: mutable-leaver all-K cells, U8 hybrids and frame re-optimisation on PR799's word", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1004", + "updated_at": "2026-10-13T17:20:52Z" + }, + { + "number": 1005, + "head": "779e80aef469bc3a28b19f1adde199871a9a22e3", + "state": "open", + "merged": false, + "title": "Conditional \u03ba = 0.001671387264390146: all eight mutable-leaver all-K cells, U8 hybrids and frame re-optimisation on PR799's word", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1005", + "updated_at": "2026-10-13T17:20:53Z" + }, + { + "number": 1011, + "head": "e978aa0ca28612afe47f487be7c7f102cfabe9b9", + "state": "open", + "merged": false, + "title": "Research: jointly restored X4 target shears save 256 beyond a one-shear baseline", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1011", + "updated_at": "2026-10-13T16:28:14Z" + }, + { + "number": 1027, + "head": "ebc027e26a7018b73a5a452eae269a9bfeaabce9", + "state": "open", + "merged": false, + "title": "Finite R480 construction: 252 shortest quad12 circuits, 24 fewer ADDs (no new kappa)", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1027", + "updated_at": "2026-10-13T16:54:33Z" + }, + { + "number": 1032, + "head": "d12585673cb30deabad6df7f5da78f86c7ca3121", + "state": "open", + "merged": false, + "title": "Research: exact persistent-work floors for the contracted complex factory", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1032", + "updated_at": "2026-10-13T16:58:55Z" + }, + { + "number": 1033, + "head": "20b584994d99da1acd866b12eebc59e561ea3e15", + "state": "open", + "merged": false, + "title": "Scoped negative result: exact short-window minima for the complex factory (no new kappa)", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1033", + "updated_at": "2026-10-13T16:59:07Z" + }, + { + "number": 1036, + "head": "c4ad801099d0813ffac56f0b517a908cd8ae0c6a", + "state": "open", + "merged": false, + "title": "Research: exact two-register CK coefficient frontier (no new kappa)", + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1036", + "updated_at": "2026-10-13T17:03:17Z" + } + ], + "distinctions": { + "999": "Pinned exact lowerer is executed on both complete raw words. It ties PR696 on these inputs.", + "1011": "Different X4 target compensation panel and restored target-shear mechanism.", + "1027": "Bit-supplier six-wire R480 quad12 circuit census and native admission; different arithmetic and factory boundary.", + "922/924": "Input circuit. New work changes the joint primitive lowering and temporary source scales.", + "1004/1005": "Changed all-K delivery cells, helper inventories and frames on the PR799 lineage. No transport or exponent comparison is claimed.", + "1032": "Persistent-work floors 46/46/48/48 for fixed one-scale gauges. Credited historical baseline; our strong comparator also includes PR1036 direct routes and per-macro restored-source routes, reaching 44.", + "1033": "Finite four-to-six-macro local sections with restricted support and per-ADD lowering. Different from the complete joint primitive implementation.", + "1036": "Two-register coefficient frontier. Its elementary small-integer routes are included in both complete programs. Extra factory saving is measured against the combined 44-operation comparison." + } +} diff --git a/research/complex-factory-fusion/PROOF.md b/research/complex-factory-fusion/PROOF.md new file mode 100644 index 0000000000..3382901c26 --- /dev/null +++ b/research/complex-factory-fusion/PROOF.md @@ -0,0 +1,260 @@ +# Circuit, substitution and complete cost + +## 1. Exact circuit and restricted shift minimum + +The input is the complete PR924 factory on eight arbitrary registers. Keep +its 26 ordered ADD pairs. Move all original diagonal factors to the output +by conjugation. The output factors, in wire order, are + +`(2, 2, 2, 1, 1, -1, 2, -2)`. + +Write each normalized ADD as `y_t += sigma*2^e*y_s`. Its sign is `sigma`. +Represent wire r physically as `x_r = 2^p_r*y_r`. To implement this ADD by +one unit signed ADD, its two exponents must satisfy + +`p_t = l_j, p_s = l_j + e`. + +For consecutive uses a and b of the same wire, let their offsets be u and v. +The necessary shift distance is `|l_b-l_a-(u-v)|`. Include the start exponent +zero and the required final exponent as fixed boundary uses. The eight wire +paths produce 60 such terms. The objective is the sum of their distances. + +`CIRCUIT.json` contains 26 integer levels and a signed integer flow on these +60 edges. For every edge ab let its offset be c_ab and flow be f_ab. The +checker verifies `|f_ab| <= 1` and zero divergence at all 26 variable nodes. +Thus, for every real level vector l, and hence for every integer vector, + +``` +sum |l_b-l_a-c_ab| + >= sum f_ab*(l_b-l_a-c_ab) + = -sum f_ab*c_ab + = 9. +``` + +The supplied integer levels attain nine. No floating-point solver result is +trusted. The optimum is valid for arbitrary integer scale levels, not just +the levels zero and one used by the witness. Two output wires also require +a negative sign. With signs transported by the same diagonal conjugation, +each needs at least one sign change. The witness uses two. + +The resulting word has 26 unit ADDs, nine doubles/halves and two negations. +A final clear gives 38 primitives with the required arbitrary-work boundary. +This minimum concerns the fixed ordered pairs, diagonal conjugation and +unit-ADD class just defined. It is not a minimum over arbitrary circuits, +new pairs, reordered ADDs, extra work, or another complementary basis. + +The primary checker uses exact `Fraction` rows to compare all nine input +columns against the original macro circuit. The ninth column is arbitrary +private coefficient work. It is erased only by the charged final clear. +It also checks the inverse, inverse transpose and transpose. Their complete +eight-register maps are equal to the corresponding original maps. + +## 2. Temporary sources and the actual frame boundary + +PR681's pinned extractor identifies fourteen disjoint windows in the original +PR622 word. Its unchanged binder checks their original 87-operation template. +The constructor replaces each with the pinned PR924 map and rebuilds the +entire non-target inverse cleanup. The original transport, native checks and +emitter then run on this complete changed word. + +In each emitted orientation, `locate` finds every main and cleanup interval +by exact ordered scalar operations and register IDs. It requires 28 disjoint +matches. An interval may contain only these scalar operations and climbs. +Each internal climb must act on a register not yet used in that interval, +and must end at the interval's scalar frame F. Such a climb commutes left +past the preceding scalar operations, since none touches its register. +The verifier moves the same climbs, in the same order, to the interval entry. +No climb is removed or added. Their complete non-scalar order is unchanged. + +After this move all eight registers have frame F. A register without a moved +climb must already have F: it has no frame change before its first checked +use. There is no other operation or outside consumer inside the interval. +The new primitive circuit touches only these eight distinct registers and +clears private work at its end. This admits the temporary source scales at +the actual program boundary, even for the three wires that are source data +rather than dirty helpers. It does not assume that source data are read-only +inside a block whose complete source transformation is already admitted. + +For completeness, let T_F be the fixed invertible operator of frame F. +Physical and scalar register values satisfy `h_r = T_F*x_r`. A unit ADD +satisfies `h_t +/- h_s = T_F*(x_t +/- x_s)`. A double, half or sign change +commutes with T_F. A clear gives `0 = T_F*0`. Therefore any exact scalar +identity on the eight registers lifts to their common physical frame. This +argument uses the entire matrix, not only the rows used for the delivery. +At the exit, every outside consumer and the complementary source basis see +exactly the old values. The inverse cleanup and the dual orientation use +the exact inverse and inverse transpose of the same primitive word. + +The complete replay is separate from the local Fraction check. It uses sparse +integer rows on a `2^256` grid. Every halving checks exact divisibility. +It checks all 716 logical input columns, eight arbitrary center columns and +one arbitrary coefficient-work column. The data shear is exact, all 492 +logical helper columns are restored, and all private columns are erased. +The physical helper residuals remain the original width-nine children; +restored logical dirt does not mean an unpaid physical identity. + +The common-frame checks run at every actual primitive. All original frame +endpoints, child ranks, phase events and adapters remain. The unchanged phase +checker verifies the changed native word's edge set, including global phase. +Its 1,879 fresh edge checks and 1,231 pinned reused checks are stated separately. + +## 3. Adapter and source-access accounting + +The compiler takes the original 32-macro interval as one admitted block and +uses the checked 37-operation scalar implementation inside it. It does not +submit 37 new macros to the old per-macro invoice. The 26 ordered binary +operand pairs are unchanged. Every new non-ADD operation is a scalar on one +of the same registers. + +A scalar multiple commutes with a register's coordinate permutation and +linear phase adapter. It can run directly in that register's current physical +coordinates. It needs no alignment with another register. Thus the new unary +source scales require no new frame conversion, child, phase adapter, owner +chart or borrowed family. The original binary operand interfaces and all +32 macro adapter reserves can be retained. The preceding common-frame proof +shows why no intermediate Fourier conversion is needed. A Fourier frame +operator is not being assigned the cheaper monomial-compiler price. + +This is the changed compiler rule relative to the fixed per-macro gauge floor. +That floor correctly rules out adding a separately billed logical SCALE. +It does not rule out the explicit joint primitive implementation here. +The emitted primitive word, boundary identity and unchanged non-scalar +inventory certify this refinement. The legacy emitter itself is unchanged; +it supplies the logical contract, which the new checker implements. + +Every actual double, half, negate, add, subtract, copy and clear is counted. +An ADD or subtract reads two operands; a unary operation or copy reads one; +a clear reads none. The checker also reports the complete operand-read count. +There is no extra public helper and no private source cache in the candidate. +The existing work family remains in the stock bill and its exit clear is paid. +The two real components are charged separately. + +## 4. Strong comparison and precision + +PR696 and the pinned PR999 lowerer are executed on the complete raw words. +They tie at 123,320 forward and 123,336 backward. The verifier also checks +that PR999 emits exactly the old 73-operation word on every factory variant. +This equality is specific to this raw word, not a claim about PR999's other +CK/JP8 inputs. + +PR1032 gives exact minima 46/46/48/48 for a just-in-time coefficient cache +on all one-scale magnitude placements. The historical cache comparison here +reproduces those values on the original PR924 placement. Work can remain live +between additions and is cleared once at exit. These savings are prior work. + +The strong comparison also permits repeated unit additions and a temporary +source scale followed by an ADD and the inverse source scale. The source is +restored before the next macro. For each fixed original macro, the dynamic +program has the full exact work row as its state. Its routes are: + +- Copy the current source into work, shift work, then add or subtract work. +- If the cached row is an exact signed binary multiple of the required row, + shift work and use the appropriate ADD sign. +- Apply the coefficient with repeated unit additions when it is an integer. +- Scale the source, add or subtract it, then restore the source. + +A SCALE macro has its original paid unary implementation. At each step, +all routes produce the same data rows. Therefore only the work row and cost +are needed to compare future routes. The program keeps a shortest prefix +for each such row and pays one exit clear from arbitrary incoming work. +The minimum in this declared per-macro route class is 44 in every orientation. +Each emitted winning word is checked on all nine arbitrary columns. +This is not an unrestricted arithmetic circuit minimum. + +A second finite census considers all 39,424 one-scale magnitude placements +in each orientation. It permits the same direct routes but uses a narrower +cache rule: the cached row must have the same source-version label, up to a +signed binary scale. Each ADD gives its target a fresh label. Unary scales +change only the exponent; they do not change the label. A state is the cached +label and its exponent. A fresh copy or a cache shift produces the required +source state; a direct route retains the old cache. These are all transitions +in this stated class. The fixed scale costs and final work clear are added. +Signs have no effect on this cost because either unit ADD sign is available. +This census also has minimum 44 in each orientation. Its unique magnitude +placement is the original PR924 placement. It does not identify different +source versions whose exact rows happen to be proportional, allow arbitrary +extra scales, reorder ADDs, or search other topologies. + +Outside each factory, both the strong comparison and candidate choose the +shorter of PR999 and signed repeated additions followed by a work clear. +The only strict replacements have coefficient magnitude two or three. +They save 304 real-component primitives per complete orientation here. +These elementary routes and their CK application are credited to PR1036. +They are applied equally and are excluded from the new circuit's extra gain. + +The candidate costs 38 per component in all four cases. It permits source +scales to persist across original macro boundaries, within the checked full +factory boundary. The complete-call saving over the strong comparison is + +`14*2*(44-38)*2 = 336` in each orientation. + +The local exact row-l1 peaks are 12, 8, 10 and 11; their depths are 1, 2, 2 and +1. The old peaks are 12, 8, 10 and 12. Complete-program positive replay also +checks the actual incoming rows and magnitudes. Its bounds remain 39,090 and +1,301,331, with fractional depth two. These fit the inherited local reserve. +The global prefix recount below retains the larger 512-bit allowance. +Exact replay and these bounds do not prove a rounded physical execution or +remove the inherited precision and exact-recovery assumptions. + +## 5. Fixed banked repetition and all remaining charges + +Use the existing nine-stage, eight-replica dedicated-bank host. Its data calls, +224 data owners per call, phase references, recipe, bridge signs, idle children +and execution order are pinned. No new owner arrangement is sought. The verifier checks that the data-port +order and all data entry/exit frames match the retained host. Replace only the helper count by the raw supplier's 492 and bind each literal call to +its checked complete primitive program and native/phase contract. + +For stage s and helper h, use family `7168 + 492*s + h`. Replica r uses its +nine-axis chart `[2,r]`, with axes `9*r` through `9*r+8`. These eight blocks +are disjoint. They cover axes 0 through 71. Pay the one-axis complement 72 +once per bank. Each complete call has 716 distinct owners. All 35,424 helper +roles and all 4,428 complements are listed and checked. Dirty helper inputs +may be correlated: the complete local map was checked on every input column. + +There are 7,168 data families, 4,428 bank families and 11,596 live families. +Reserve another 492 tableau families, eight center families and two coefficient +families, giving 12,098 physical families. The serialized schedule includes all +72 local sweeps, 72 bridges, idle sweeps, terminal operations, bank complements +and the final translation of every live family. The audit checks each field +against the retained schedule after the literal replica expansion. + +The complete paid profile is + +``` +rank: 1 2 3 4 5 6 8 16 32 48 +count: 150156 54720 21600 12096 12096 3168 5952 3584 3584 3584 +``` + +It has 270,540 children and mass 843,948. The mass deficit is exactly 2,560. +All raw helpers start at zero and end at FULL, so there is no residual wrapper. +The unchanged data-phase and dedicated-bank realization remain inherited. +This audit does not replace them with a new all-size hosting proof. + +Use the original conservative invoice with + +``` +C = 64*74^3 = 25934336 +M = 15456; K = 3472; n = 716; centers = 8 +A = 16*(M+K+n+centers) + 64*73 = 319104 +local_bound = max(P_forward,P_backward) + A*C +``` + +The candidate local bound is 8,275,750,476,016. The original outside adapter +reserve is 1,527,568. It includes source/data access, helper interfaces, idle +children, complements, bridges, shifts, moves, all live families and physical +stock. The same reserve is used for all compared lowerings. + +The host uses 40 forward and 32 backward calls. Hence its extra saving over +the strong comparison is `72*336 = 24192`. Its complete per-cover-vertex +bound falls from 635,470,496,884,300 to 635,470,496,860,108. The saving is solely +in the actual scalar primitive sum; no reserve is removed to create it. + +The original cover-size formula then gives physical stock of 2,642 bits, +router size of 7,984 bits, literal size of 35,284 bits and row coefficient +16,469. The strict local, logical, router, literal, mass, precision, tape, row, +halving and prefix guards all pass. The prefix requirement is 206 bits; the charged allowance +is 512 bits. Every numerical quantity is recomputed by `host.py`. + +No homogeneous child-cost term is improved. The selected assembly, bit supplier +and exponent are unchanged. Transport to other factory maps, helper inventories, +owner schedules or optimized suppliers requires a separate admission. diff --git a/research/complex-factory-fusion/README.md b/research/complex-factory-fusion/README.md new file mode 100644 index 0000000000..c48f96268d --- /dev/null +++ b/research/complex-factory-fusion/README.md @@ -0,0 +1,156 @@ +# Unit-add lowering of the exact complex factory + +This construction implements the complete PR924 eight-register factory with +**37 real-component primitives, plus one charged work clear**. It uses 26 unit +additions, nine binary shifts and two sign changes. It has no new helper. +Temporary source scales are restored at the exact factory boundary. + +A source-scale certificate gives a nine-shift minimum in the stated fixed +unit-add class. This is a compiler refinement of a 32-macro block. It is not +a 37-macro replacement under a per-macro adapter invoice. + +The verifier installs the circuit in all fourteen raw PR622 factory windows +and their inverse cleanups. It checks both complete orientations, all 725 +input columns, the native frames and all repeated calls in the existing +conservative dedicated-bank host. + +| Complete raw program | PR696 / PR999 | Persistent cache | Strong comparison | New circuit | Extra saving | +|---|---:|---:|---:|---:|---:| +| Forward | 123,320 | 121,808 | 121,392 | 121,056 | 336 | +| Inverse transpose | 123,336 | 121,936 | 121,408 | 121,072 | 336 | +| 40 forward + 32 inverse-transpose calls | 8,879,552 | 8,774,272 | 8,740,736 | 8,716,544 | **24,192** | + +Counts include both real components. They are instruction counts, not measured +runtime gains. The strong comparison combines persistent coefficient work, +small-integer accumulation and source scales restored at each macro boundary. +It costs **44 per component in all four factory orientations**, versus 38 for +the new circuit. Both complete programs also use the small-integer routes +outside the factories. Their 304-operation saving per call is credited to +the elementary routes used in PR1036, and is excluded from the extra saving. + +The historical cache column uses PR999 outside each factory. It reproduces +PR1032's local costs of 46/46/48/48. PR999 itself ties PR696 on these complete +raw words; its gains on other CK/JP8 words are not claimed here. The package +also checks all 39,424 one-scale magnitude placements per orientation under +a source-version cache policy with the added direct routes. The minimum is +44 in this finite class. No global circuit minimum is claimed. + +## Reproduce + +Use Python 3.11 or later with NumPy installed. Run from the repository root: + +```sh +OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 \ +python3 -I -B research/complex-factory-fusion/verify.py +``` + +The command generates the raw word with the pinned constructor, runs the +unchanged native and emitted-word checks, checks the phase recipes, then +checks all ten complete primitive programs and five complete invoices. +It compares the result with `EXPECTED.json`. Expected final line: + +```text +PASS_EXACT_COMPLEX_FACTORY_FUSION primitives=44->38 columns=725 calls=72 extra_vs_strong=24192 no_new_kappa +``` + +The default command uses a temporary directory. `--out NEW_DIRECTORY` retains +all complete primitive streams, factory bindings, native/phase artifacts and +host schedules. `--write NEW_FILE` writes a new development receipt. Existing +output paths are refused. No solver, network access or source regeneration +outside the output directory is required. + +The proof and limits are in [PROOF.md](PROOF.md). Source pins are in +[SOURCES.json](SOURCES.json), the integer witness in [CIRCUIT.json](CIRCUIT.json), +and executed checks in [VALIDATION.md](VALIDATION.md). + +## Mechanism and physical boundary + +Normalize the original scales to the outputs. At each addition, choose the +scale of its target and source so that its coefficient is `+1` or `-1`. +Keep these scales between additions and pay each actual change. The circuit +never copies a source into coefficient work. It clears that work at exit, +including an arbitrary incoming work column. + +The emitted factory has some climbs between scalar operations. Each such +climb acts on a register that has not yet been used in that factory. The +verifier checks this condition before moving the climb to the block entry. +All eight registers then have one common frame. The new circuit runs in this +frame. It has no internal frame change or external consumer. At exit its +complete eight-register map equals PR924, including the complementary basis. +Every later consumer therefore receives the same value. + +This is the changed assumption relative to the scale-placement floor in +`complex-factory-scale-frontier27`: that result fixes a clear after every ADD +and prices each extra SCALE as another logical macro. This construction +instead lowers the entire admitted block. Its extra unary primitive scales +need no coordinate alignment. The original 32 logical interface slots and +all their adapter reserves remain paid. [PROOF.md](PROOF.md) gives the +common-frame and adapter argument; it does not price a Fourier conversion +as a monomial adapter. + +## Complete charge and limits + +The fixed host has 72 literal calls, 4,428 width-nine helper banks, 11,596 live +families and 12,098 physical families. It pays all 35,424 helper roles, all +72 bridge sweeps, all idle children, and one rank-one complement per bank. +No owner or replica arrangement is optimized. + +The paid rank mass is 843,948. Its deficit is `73*11596 - 843948 = 2560`. +The local adapter reserve remains 319,104. The candidate's complete bound +per cover vertex is 635,470,496,860,108, which is 24,192 below the strong +comparison. All ten retained finite guards pass. The global prefix allowance +is 512 bits; the recomputed requirement is 206 bits. + +Exact complete-program row-l1 peaks are 124 forward and 64 backward. Their +positive bounds remain 39,090 and 1,301,331. The fractional depth remains two. +The phase check verifies 1,879 new edge recipes and reuses 1,231 pinned edge +certificates and 224 endpoint adapters. It includes exact global phase. + +This result applies to the reconstructed **raw 492-helper PR622 supplier**. +It does not claim transport to the current T37 supplier, PR1004/1005's changed +mutable-leaver inventories, or a new conditional exponent. It does not alter +`certificates/selected-result.json` or `upstream/`. + +All-size compilation, the common-label mutable-source realization, physical +hosting, precision/tape recovery and analytic transfer remain inherited +conditions. This is a finite construction with written proofs and exact +checks. It is not a Lean proof or a full integer-multiplication theorem. + +## Prior work and attribution + +Prepared for **Ali Romman (@aliromman)** with substantial **OpenAI Codex** +assistance in the circuit, proof, code, verification and text. Apache-2.0; +see the repository [LICENSE](../../LICENSE). No independent human review is +claimed. All predecessor files and notices remain unchanged. + +- **Alluri / alluri-ritual, PR681**: the exact eight-register boundary, + fourteen-window extraction and complete raw native replay. +- **CubeJerry, PR922 and PR924**: the 32-macro contraction and scale placement + used as the input circuit. +- **Ross Richardson, scale-frontier27**: the fixed per-ADD-lowering floor, + which states the restriction changed here. +- **Sagar Thakrar / thakrarsagar, PR696**: the copy-Horner/unit lowerer. +- **woklerx, PR1032**: the persistent-work factory comparison and its exact + fixed-gauge floors. The historical cache figures are credited to this work. +- **Hanson Sun / bbMisk, PR1036**: the two-register coefficient frontier and + its complete application of the elementary small-integer routes. +- **Seb / ZK-Snarky, PR999**: the bounded target-accumulation lowerer. Its exact + source and notice are retained in `sources/pr999-lower.py` for comparison. +- **Jeremy Kothe / jeremykothe2, PR622**, and **Chafik Boukhalfa / chafreaky, + PR626**: the constructor, retained native checks and host lineage. +- **icekylinx, PR425/433/531**: the common-frame scalar interface, phase + compiler, original banked host and finite invoice. +- **DreamingOfClouds**, **Dugongue** and the earlier contributors retain the + credits in the [predecessor notice](../complex-k492-owner-repair/NOTICE.md). + +Related PR839/755/793/811/830 remove or reuse work in other words. The strong +comparison includes block-wide clear removal, exact scaled-work reuse and +PR1036's direct routes. PR1032 retains one magnitude scale per nonunit wire; +this circuit permits more scales and retains their effects across macros. +PR1033 checks short macro sections under a fixed per-ADD lowering. It does +not cover this complete joint primitive lowering. +PR975/1011 concern X4 target panels. PR1004/1005 change all-K delivery cells, +helper stock and frames. Those are different construction boundaries; their +claimed global exponents are not used as evidence for this local result. +PR1027 is a bit-supplier R480 quad12 result on six wires. Its arithmetic and +factory boundary are different. [OVERLAP.json](OVERLAP.json) records the heads. diff --git a/research/complex-factory-fusion/SOURCES.json b/research/complex-factory-fusion/SOURCES.json new file mode 100644 index 0000000000..4a100bd11e --- /dev/null +++ b/research/complex-factory-fusion/SOURCES.json @@ -0,0 +1,52 @@ +{ + "base_commit": "8bddbee377e2f3ce1f1247196c4b290d55767d20", + "dependency_heads": { + "622": "f69477f4f6d3c7eb1f740b166881bffed4ffa9f6", + "626": "660de893d27bb7abd1d5b01b1640207528a5c851", + "681": "e536f6fc8aad65adef8ac4682d13625598a5c3f9", + "696": "5a3f983715027c4fd83f50bc9001d4b18463bed1", + "922": "efd5643c0016b6c6dac26e9ed7dee8a75295ff2a", + "924": "d02d83332581f6a23616c1366c6b3901d42f4b06", + "999": "fd38a824adb3a5c60c101a86c950a6d590454adf" + }, + "factory_source": "research/complex-factory-scale-frontier27/sources/PR924-COMPOSITION.json", + "files": { + "docs/research/community-k492-review.md": "3b731d30e80010b15408a289b0b32192700885474c8b36d48ee3320a7a8c5c47", + "research/community-k492-audit/pr626/replay/ASSEMBLY.json": "6127732e2fcdd470dab349c1c51d03cd9f0787ad0309b1b4a7c811a908028f4e", + "research/complex-dyadic-lowering/lower.py": "eb37d00063dc09323e9aca041d23da749ce17fbd71dade9aaf1c059cab0b9753", + "research/complex-factory-fusion/sources/pr999-lower.py": "bc7a235ea303efe2ffc69634d2bb86bfd3d1a017527e7cf66d8a72965a8317fc", + "research/complex-factory-scale-frontier27/sources/PR924-COMPOSITION.json": "f9341322c278901c34aa55876978fe58b05e7056bb4402a3db7f9c8f16fa7d53", + "research/complex-factory5-resynthesis/BLOCKS.json": "c41e9acf610ce662b5b753b0b2ac984c573877fe2757a3a8b8331560201ae6e8", + "research/complex-factory5-resynthesis/CIRCUIT.json": "f64a9e88491af13fe564f0512e8455eb268d1732a978b1b4fe3b93e601b59f71", + "research/complex-factory5-resynthesis/extract.py": "9941d420f2bc278ea24c992c4a5a592bd080a4407f8adc4a604d7f0aa7ff4fa2", + "research/complex-factory5-resynthesis/verify.py": "edbae43b68c0e4f65978a2f9b9a739867128f4ef19d8bbe81d06ed2e5bc165f1", + "research/complex-k492-owner-repair/NOTICE.md": "e7e934433919b73f6088a68a444eed4cea029638ae7b0df3fde15099d5369fd1", + "research/complex-k492-owner-repair/PROOF-NOTE.md": "337d70fe7abd9afca1d90954c23bde87f4dc27888cc1a6b4bb80506fd6fbf8c5", + "research/complex-k492-owner-repair/code/construct_k_triangle.py": "66fc460df8eb8067efe3d8a3f9e97a7244aacd7bf11650a6ce656e868ce053da", + "research/complex-k492-owner-repair/code/hpe_audit_and_transport.py": "c9a05ff291016b870b4fc925b317abd9c3a604c73ffc8920dfdbbeb475e20aa3", + "research/complex-k492-owner-repair/code/hpe_audit_local.py": "6bd9a1e279c9c9e4f3767d9f82e537b559292906feb2ddab02f380fb6523a810", + "research/complex-k492-owner-repair/code/hpe_emit_local.py": "7e4a6fbc38c8228157b6311457d1496bf460291393043932d2c365f004f77805", + "research/complex-k492-owner-repair/code/invoice_allcold.py": "141bd2fd58bbfb5b8d0fc8f56f61c45586d5608a5af3487c6b883dd987f998ec", + "research/complex-k492-owner-repair/data/TRI-SCHEDULE.json": "94da9d5575f5b237097a77ac7dd09aff594322dd9c35138bfd34ffc5e1a7a51e", + "research/direct-delivery504-global/SOURCES.json": "9e8182e6e659f4671fe0873e324b622cc871df7344157093df40476c8687be5f", + "research/direct-delivery504-global/code/invoice_final.py": "96b6bed96ca8b60dfc064cd1c7962c45a5cb53c4e52cd90aaea6ccf8d109db97", + "research/direct-delivery504-global/code/phases_delta.py": "15723107eff03013b2e797fd9fa3635b1b46c5d1c8112d19fada98c178d4acb6", + "research/direct-delivery504-global/code/prepare_supplier_base.py": "f5eae94aca965d0008bc07cff8245ccb7509042ccad457d3bcb7d51c1e9409f0", + "research/direct-delivery504-global/inputs/data-base/split-centres/CANONICAL-WORD.json.gz": "5226194a7beae50e9c43009df698959d596fdfb081346f32428aee798bdc1851", + "research/direct-delivery504-global/inputs/data-base/split-centres/GLOBAL-TEMPLATE.json.gz": "7e8299995f7a86e558f9074e86b7138f5cc32a60df90be652570f3c4bfb94285", + "research/direct-delivery504-global/inputs/data-base/work/complex-nine-native/DATA-PHASES.json": "c5916ff312678f12aba403847643fbbc29f643acec60bdf836fa56cd3e8251fa", + "research/direct-delivery504-global/inputs/hamming/PACKET-PROGRAMS.json.gz": "7137eb04cf099bbbe5d420bc23336e87448f23a587c67701dfb4c208546c5821", + "research/direct-delivery504-global/inputs/hamming/PROTOTYPE.json": "327d2a868043e846381aa58a33053c24425e8cad522ff401b10ec8af1d649a3f", + "research/direct-delivery504-global/inputs/phase-baseline/CANONICAL-WORD.json.gz": "5226194a7beae50e9c43009df698959d596fdfb081346f32428aee798bdc1851", + "research/direct-delivery504-global/inputs/phase-baseline/CLIFFORD-RECIPES.json": "1f37afd5a9e14b113ba56e0ac8a5200a6b41c695d2cd308dc0fd6ec46a4c73d2", + "research/direct-delivery504-global/inputs/phase-baseline/CLIFFORD-REVIEW.json": "468a5df1937e82a0b8e8c1c2540e18480f354154325353c5596c68e7435c89c2", + "research/direct-delivery504-global/proof/LOCAL-CONSTRUCTION.md": "3b1fc44f6f8290361cb24526cf91c3174c734f5da3cc9fb94559a96168d39e70", + "research/direct-delivery504-global/vendor/clifford/clifford_exact.py": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962" + }, + "hash_rule": "SHA256 of source bytes; decompressed payload for gzip inputs", + "comparison_heads": { + "1032": "d12585673cb30deabad6df7f5da78f86c7ca3121", + "1033": "20b584994d99da1acd866b12eebc59e561ea3e15", + "1036": "c4ad801099d0813ffac56f0b517a908cd8ae0c6a" + } +} diff --git a/research/complex-factory-fusion/VALIDATION.json b/research/complex-factory-fusion/VALIDATION.json new file mode 100644 index 0000000000..cca2fd65c8 --- /dev/null +++ b/research/complex-factory-fusion/VALIDATION.json @@ -0,0 +1,42 @@ +{ + "base_commit": "8bddbee377e2f3ce1f1247196c4b290d55767d20", + "child_max_rss": 412450816, + "child_system_seconds": 0.465227, + "child_user_seconds": 29.739906, + "code_sha256": { + "circuit.py": "1954428ef75c53b0e9c329c0eca395a63b5411bfe656b171db453448c44c64b5", + "comparator.py": "d50f4a8878dead712505340fa2fc8281c165db6c2332ae7ce464953cc238a5a2", + "full.py": "32bff4f87ea91ff0f3c641b66d6636f4f8656f1c7c752a1e4ed8d47e15e06f6a", + "host.py": "300059fd311857637b3181bd824cde6cbb0a8bf3f167f5e18542d3d45a10789a", + "sources/pr999-lower.py": "bc7a235ea303efe2ffc69634d2bb86bfd3d1a017527e7cf66d8a72965a8317fc", + "test_package.py": "0125abfff225a922c9b182a73f4d731188c7dfd3ac5abde803db99bef5535422", + "verify.py": "45fd59a2b465ae68b495465f0e055fa17004b8ce50b9d764ec4da9195cd0325b" + }, + "command": [ + "/Users/aliromman/Projects/IntegerMultiplicationBounds/work/autonomous-kappa-run/venv/bin/python", + "-I", + "-B", + "research/complex-factory-fusion/verify.py" + ], + "elapsed_seconds": 31.139, + "expected_semantic_sha256": "d009aa4737dea47f21dccaec9b2f2d8d5c294e2583ab15fd5c389e0176c6bc1b", + "numpy": "2.5.4", + "package_tests": { + "command": [ + "/Users/aliromman/Projects/IntegerMultiplicationBounds/work/autonomous-kappa-run/venv/bin/python", + "-I", + "-B", + "research/complex-factory-fusion/test_package.py" + ], + "elapsed_seconds": 31.166, + "minimal_isolated_optimized_replay": true, + "output_preservation_controls": 2, + "returncode": 0, + "source_and_certificate_corruption_controls": 2 + }, + "platform": "macOS-26.6.1-arm64-arm-64bit-Mach-O", + "python": "Python 3.14.7", + "returncode": 0, + "selected_record_check": "python3 -B scripts/verify_selected_result.py\nPASS selected record, exact kappa, original source inventory and proof supplement: 1661960547713947/1000000000000000000", + "selected_record_returncode": 0 +} diff --git a/research/complex-factory-fusion/VALIDATION.md b/research/complex-factory-fusion/VALIDATION.md new file mode 100644 index 0000000000..782b5842cd --- /dev/null +++ b/research/complex-factory-fusion/VALIDATION.md @@ -0,0 +1,69 @@ +# Executed validation + +The base is `8bddbee377e2f3ce1f1247196c4b290d55767d20`. Checks ran on +2026-10-13 with CPython 3.14.7, NumPy 2.5.4 and macOS 26.6.1 arm64. +BLAS and OpenMP worker counts were one. The final checks used the existing +project virtual environment. No dependency was installed. The exact interpreter +path and source hashes are in `VALIDATION.json`. + +The final source passed the following commands with that interpreter: + +```sh +OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 \ +python3 -I -B research/complex-factory-fusion/verify.py +python3 -I -B research/complex-factory-fusion/test_package.py +make selected-record-check +``` + +All three commands returned zero. The primary command matched every field +of `EXPECTED.json`. It took 31.139 seconds in this environment. The maximum +child resident set was 412,450,816 bytes. These are verification resources, +not a multiplication runtime benchmark. + +Coverage: + +- Exact integer lower-bound certificate and four complete factory maps, + compared with both the original 87-macro map and PR924. +- Strong 44-operation comparison and all 39,424 one-scale magnitude + placements in each orientation under the declared source-version policy. + Small-integer routes are applied outside the factories in both programs. +- Fresh raw constructor extraction, all fourteen window bindings, native + frame/compensation audit and unchanged emitted-word checks. +- Exact phase lowering of 1,879 fresh edges; 1,231 edge certificates and + 224 endpoint adapters reused from pinned sources, with global phase. +- Ten complete primitive streams, 725 arbitrary columns in each, 492 + restored logical helper columns and all private columns erased. +- Every call and field in five complete 72-call host schedules, data-port + and endpoint-frame binding, disjoint bank footprints and complements. +- All scalar, operand-read, helper, stock, source/interface, adapter, wrapper, + bridge, idle, precision, tape and routing terms in the fixed host invoice. +- All ten strict finite guards and the unchanged selected record. + +There are 168 new mathematical rejection cases: all 152 single-primitive +omissions, four certificate controls, a climb moved across a live register +use, a primitive with a wrong frame, and ten host defects. The host defects +include a missing call, an alias, a wrong complement, an unbound program, +a missing bridge, stale bank coverage, an unpaid translation, a wrong +bridge sign, a private-family alias and a changed data-port order. The +unchanged native auditor also runs its four retained rejection controls. + +The package command took 31.166 seconds. It passes a full `-I -O -B` replay in a minimal path with +spaces, outside the source checkout. It copies only declared sources and +this package. It then rejects two corruptions and preserves two existing +output locations. The inherited assertion-based scripts run in separate +`-I -B` subprocesses, so top-level optimization does not disable their checks. +Generated gzip headers and temporary paths are absent from expected identities. +The committed phase-baseline container retains its original exact certificate. + +An initial run with the system Python stopped because NumPy was absent. +The final checks used the existing project virtual environment and passed. +An earlier `/usr/bin/time -l` wrapper returned status one because the sandbox +refused `kern.clockrate`, after the package checks printed PASS. A direct +rerun passed. The final time and memory use Python's `time` and `resource` +APIs. These environment failures are retained in the lane archive. + +Not executed: a full cold phase replay of reused edges, the current selected +supplier's cold replay, repository-wide `make verify`, Linux/remote CI, Lean, +or a physical integer-multiplication runtime benchmark. The dedicated-bank +host is the historical raw supplier's host. No optimized-provider transport, +owner search or outer exponent assembly is claimed. diff --git a/research/complex-factory-fusion/circuit.py b/research/complex-factory-fusion/circuit.py new file mode 100644 index 0000000000..a94cd353bd --- /dev/null +++ b/research/complex-factory-fusion/circuit.py @@ -0,0 +1,220 @@ +"""Compile the fixed PR924 factory with unit additions and binary scales. + +Prepared for Ali Romman with substantial OpenAI Codex assistance. +Apache-2.0. See SOURCES.json and README.md for predecessor credit. +""" +from fractions import Fraction as Q + + +def need(condition, message): + if not condition: + raise ValueError(message) + + +def exponent(q): + q = abs(q) + need(q and q.numerator & (q.numerator - 1) == 0 + and q.denominator & (q.denominator - 1) == 0, + "coefficient is not a signed power of two") + return q.numerator.bit_length() - q.denominator.bit_length() + + +def normalize(word): + """Move the original diagonal factors to the output.""" + magnitudes, signs, additions = [0] * 8, [1] * 8, [] + for op in word: + tag, target = op[:2] + need(type(target) is int and 0 <= target < 8, "invalid target") + if tag == "scale": + q = Q(op[2], op[3]) + magnitudes[target] += exponent(q) + signs[target] *= -1 if q < 0 else 1 + else: + need(tag == "add", "invalid factory operation") + source = op[2] + need(type(source) is int and 0 <= source < 8 and source != target, + "invalid source") + q = Q(op[3], op[4]) + additions.append((target, source, + exponent(q) + magnitudes[source] - magnitudes[target], + (-1 if q < 0 else 1) * signs[source] * signs[target])) + return additions, magnitudes, signs + + +def edges(additions, final): + """Build the scale-distance terms on the eight register paths.""" + prior, result = [(-1, 0)] * 8, [] + for index, (target, source, power, _) in enumerate(additions): + for register, offset in ((target, 0), (source, power)): + previous, previous_offset = prior[register] + result.append((previous, index, previous_offset - offset, register)) + prior[register] = (index, offset) + for register, (previous, offset) in enumerate(prior): + result.append((previous, -1, offset - final[register], register)) + return result + + +def compile_factory(word, certificate): + need(certificate["format"] == "exact-unit-add-factory-v1", "certificate format") + additions, final, signs = normalize(word) + levels, flow = certificate["levels"], certificate["dual_flow"] + need(len(additions) == 26 and len(levels) == 26, "wrong addition count") + need(all(type(x) is int for x in levels + flow), "noninteger certificate") + terms = edges(additions, final) + need(len(flow) == len(terms), "wrong dual length") + divergence = [0] * len(additions) + lower_bound = 0 + shift_count = 0 + value = lambda i: levels[i] if i >= 0 else 0 + for (a, b, offset, _), f in zip(terms, flow): + need(abs(f) <= 1, "dual capacity") + if a >= 0: + divergence[a] -= f + if b >= 0: + divergence[b] += f + lower_bound -= f * offset + shift_count += abs(value(b) - value(a) - offset) + need(not any(divergence), "dual conservation") + need(shift_count == lower_bound == 9, "scale optimum certificate") + physical, result = [0] * 8, [] + for index, (target, source, power, sign) in enumerate(additions): + for register, goal in ((target, levels[index]), (source, levels[index] + power)): + tag = "double" if goal > physical[register] else "halve" + result.extend([(tag, register)] * abs(goal - physical[register])) + physical[register] = goal + result.append(("add" if sign > 0 else "subtract", target, source)) + for register in range(8): + tag = "double" if final[register] > physical[register] else "halve" + result.extend([(tag, register)] * abs(final[register] - physical[register])) + if signs[register] < 0: + result.append(("negate", register)) + need(len(result) == 37, "wrong primitive count") + supplied = certificate["primitives"] + need(all(type(op) is list and type(op[0]) is str + and all(type(r) is int for r in op[1:]) for op in supplied), + "primitive certificate types") + need([list(x) for x in result] == supplied, "certificate word") + return result + + +def variants(word, primitive=False): + def invert(op): + op = list(op) + if primitive: + op[0] = {"add": "subtract", "subtract": "add", "double": "halve", + "halve": "double", "negate": "negate"}[op[0]] + elif op[0] == "add": + op[3] = -op[3] + else: + op[2], op[3] = op[3], op[2] + return op + + def dual(op): + result = invert(op) + if result[0] in ("add", "subtract"): + result[1], result[2] = result[2], result[1] + return result + + inverse = [invert(op) for op in reversed(word)] + return {"main": [list(op) for op in word], "cleanup": inverse, + "dual_main": [dual(op) for op in word], + "dual_cleanup": [dual(op) for op in inverse]} + + +def step(rows, op): + tag, target = op[:2] + if tag == "clear": + rows[target] = {} + elif tag == "copy": + rows[target] = rows[op[2]].copy() + elif tag in ("double", "halve", "negate"): + factor = {"double": Q(2), "halve": Q(1, 2), "negate": Q(-1)}[tag] + rows[target] = {j: factor * x for j, x in rows[target].items()} + else: + need(tag in ("add", "subtract") and target != op[2], "invalid primitive") + row = rows[target] + for j, value in list(rows[op[2]].items()): + value = row.get(j, Q(0)) + (value if tag == "add" else -value) + if value: + row[j] = value + else: + row.pop(j, None) + + +def macro_step(rows, op): + tag, target = op[:2] + if tag == "scale": + factor = Q(op[2], op[3]) + rows[target] = {j: factor * x for j, x in rows[target].items()} + else: + source, factor = op[2], Q(op[3], op[4]) + for j, value in list(rows[source].items()): + value = rows[target].get(j, Q(0)) + factor * value + if value: + rows[target][j] = value + else: + rows[target].pop(j, None) + + +def reference(word, reuse=False): + """Use PR696 or a stronger cleared-once coefficient-cache comparator.""" + result, rows, work = [], {i: {i: Q(1)} for i in range(9)}, 8 + for op in word: + tag, target = op[:2] + if tag == "scale": + q = Q(op[2], op[3]) + power = exponent(q) + part = [("double" if power > 0 else "halve", target)] * abs(power) + if q < 0: + part.append(("negate", target)) + else: + source, q = op[2], Q(op[3], op[4]) + power = exponent(q) + if power == 0: + part = [("add" if q > 0 else "subtract", target, source)] + else: + part = [("copy", work, source)] + part += [("double" if power > 0 else "halve", work)] * abs(power) + sign = 1 if q > 0 else -1 + desired = {j: abs(q) * v for j, v in rows[source].items()} + cached = rows[work] + if reuse and cached and cached.keys() == desired.keys(): + pivot = next(iter(cached)) + ratio = desired[pivot] / cached[pivot] + if all(desired[j] == ratio * cached[j] for j in cached): + try: + shift = exponent(ratio) + except ValueError: + pass + else: + route = [("double" if shift > 0 else "halve", work)] * abs(shift) + if len(route) < len(part): + part = route + sign *= -1 if ratio < 0 else 1 + part.append(("add" if sign > 0 else "subtract", target, work)) + if not reuse: + part.append(("clear", work)) + for primitive in part: + step(rows, primitive) + result.extend(part) + if reuse: + result.append(("clear", work)) + return result + + +def local_check(word, primitives): + expected = {i: {i: Q(1)} for i in range(9)} + for op in word: + macro_step(expected, op) + expected[8] = {} + rows = {i: {i: Q(1)} for i in range(9)} + peak, depth, reads = Q(1), 0, 0 + for op in primitives: + step(rows, op) + peak = max(peak, *(sum(map(abs, row.values())) for row in rows.values())) + depth = max(depth, *(v.denominator.bit_length() - 1 + for row in rows.values() for v in row.values())) + reads += 2 if op[0] in ("add", "subtract") else int(op[0] != "clear") + need(rows == expected, "exact factory boundary or work clearing") + return {"primitives": len(primitives), "peak_row_l1": str(peak), + "fractional_depth": depth, "operand_reads": reads} diff --git a/research/complex-factory-fusion/comparator.py b/research/complex-factory-fusion/comparator.py new file mode 100644 index 0000000000..c777e2b83a --- /dev/null +++ b/research/complex-factory-fusion/comparator.py @@ -0,0 +1,111 @@ +"""Compare paid cache routes on the fixed factory map. + +Prepared for Ali Romman with substantial OpenAI Codex assistance. +PR1032 supplies the persistent-work comparison. PR1036 supplies the +small-integer accumulation routes. See README.md for full credit. +""" +from fractions import Fraction as Q +from itertools import product + +from circuit import exponent, macro_step, need, normalize + + +def shifts(register, power): + return [("double" if power > 0 else "halve", register)] * abs(power) + + +def cache_word(word): + """Find a shortest route in the stated macro-by-macro cache class.""" + rows = {i: {i: Q(1)} for i in range(8)} + states = {((8, Q(1)),): []} + for op in word: + tag, target = op[:2] + if tag == "scale": + q = Q(op[2], op[3]) + part = shifts(target, exponent(q)) + ([("negate", target)] if q < 0 else []) + states = {cache: path + part for cache, path in states.items()} + else: + source, q = op[2], Q(op[3], op[4]) + power = exponent(q) + add = "add" if q > 0 else "subtract" + desired = {j: abs(q) * value for j, value in rows[source].items()} + fresh = shifts(8, power) + updated = {} + for cache, path in states.items(): + # This route restores the source before the next macro. + direct = shifts(source, power) + [(add, target, source)] + shifts(source, -power) + if q.denominator == 1 and abs(q.numerator) < len(direct): + direct = [(add, target, source)] * abs(q.numerator) + routes = [(cache, direct), + (tuple(sorted(desired.items())), + [("copy", 8, source)] + fresh + [(add, target, 8)])] + cached = dict(cache) + if cached and cached.keys() == desired.keys(): + pivot = next(iter(cached)) + ratio = desired[pivot] / cached[pivot] + if ratio and all(desired[j] == ratio * cached[j] for j in cached): + try: + shift = exponent(ratio) + except ValueError: + pass + else: + sign = (1 if q > 0 else -1) * (1 if ratio > 0 else -1) + end = tuple(sorted((j, value * abs(ratio)) for j, value in cached.items())) + routes.append((end, shifts(8, shift) + + [("add" if sign > 0 else "subtract", target, 8)])) + for end, part in routes: + candidate = path + part + if end not in updated or len(candidate) < len(updated[end]): + updated[end] = candidate + states = updated + macro_step(rows, op) + return min(states.values(), key=len) + [("clear", 8)] + + +def gauge_census(word): + """Check all one-scale magnitude placements with a source-version cache.""" + additions, final, signs = normalize(word) + uses = [0] * 8 + for target, source, _, _ in additions: + uses[target] += 1 + uses[source] += 1 + wires = [r for r in range(8) if final[r]] + placements, best, winners = 0, None, [] + fixed_cost = sum(abs(e) + int(s < 0) for e, s in zip(final, signs)) + 1 + for slots in product(*(range(uses[r] + 1) for r in wires)): + placements += 1 + scheduled = dict(zip(wires, slots)) + seen, level, power = [0] * 8, [0] * 8, [0] * 8 + version = list(range(8)) + states = {(-1, 0): 0} + for index, (target, source, e, _) in enumerate(additions): + for r in (target, source): + if scheduled.get(r, -1) == seen[r]: + level[r] = final[r] + power[r] += final[r] + e += level[target] - level[source] + desired = (version[source], power[source] + e) + updated = {} + for cache, cost in states.items(): + prep = 1 + abs(e) + if cache[0] == desired[0]: + prep = min(prep, abs(cache[1] - desired[1])) + updated[desired] = min(updated.get(desired, 10**9), cost + prep + 1) + direct = 2 * abs(e) + 1 + if e >= 0: + direct = min(direct, 2**e) + updated[cache] = min(updated.get(cache, 10**9), cost + direct) + states = updated + version[target], power[target] = 8 + index, 0 + seen[target] += 1 + seen[source] += 1 + cost = min(states.values()) + fixed_cost + if best is None or cost < best: + best, winners = cost, [] + if cost == best: + winners.append(list(slots)) + need(placements == 39424 and best == 44, "extended gauge comparison") + return {"placements": placements, "minimum": best, "wires": wires, + "winning_magnitude_slots": winners, + "cache_rule": "same_source_version_up_to_binary_scale", + "scope": "one_net_magnitude_scale_per_nonunit_wire"} diff --git a/research/complex-factory-fusion/full.py b/research/complex-factory-fusion/full.py new file mode 100644 index 0000000000..55a260c454 --- /dev/null +++ b/research/complex-factory-fusion/full.py @@ -0,0 +1,276 @@ +"""Bind the factory circuit to the complete raw PR622 program. + +Prepared for Ali Romman with substantial OpenAI Codex assistance. +Apache-2.0. The PR681 extraction and native checks retain their source notices. +""" +import copy +from collections import Counter +from fractions import Fraction as Q +import gzip +import hashlib +import importlib.util +import json +from pathlib import Path + +from circuit import need, variants, reference +from comparator import cache_word + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +WORK = ("W", 0) + + +def load_module(name, path): + spec = importlib.util.spec_from_file_location(name, path) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +def read(path): + data = path.read_bytes() + return json.loads(gzip.decompress(data) if path.suffix == ".gz" else data) + + +def canonical(value): + return json.dumps(value, sort_keys=True, separators=(",", ":")).encode() + + +def digest(value): + return hashlib.sha256(canonical(value)).hexdigest() + + +def write(path, value): + data = canonical(value) + path.write_bytes(gzip.compress(data, mtime=0) if path.suffix == ".gz" else data + b"\n") + + +def build(out, word): + prior = load_module("factory681", ROOT / "research/complex-factory5-resynthesis/verify.py") + folder = ROOT / "research/complex-factory5-resynthesis" + prior.run(folder / "extract.py", [out / "original"], out / "constructor.log") + windows = read(out / "original/WINDOWS.json") + blocks, original = read(folder / "BLOCKS.json"), read(folder / "CIRCUIT.json") + prior.bind_blocks(blocks, windows, original) + raw = read(out / "original/FULL-WORD.json.gz") + changed = copy.deepcopy(raw) + for block in reversed(blocks): + registers = [r - 16 if r >= 240 else r - 8 + for r in block["registers_before_112_port_restriction"]] + new = copy.deepcopy(word) + for op in new: + op[1] = registers[op[1]] + if op[0] == "add": + op[2] = registers[op[2]] + op[-1] = block["frame"] + begin, end = block["A_window_zero_based"] + changed["A"][begin:end] = new + changed["cleanup"] = prior.inverse([e for e in changed["A"] + changed["B"] + if not 112 <= e[1] < 224]) + for op in changed["cleanup"]: + op[-1] = [256, 128, 64, 32, 16, 8, 4, 2, 1] + raw_path = out / "COMBINED-RAW.json.gz" + write(raw_path, changed) + local = out / "local" + receipt, native = prior.native(raw_path, local, out) + programs = read(local / "LOCAL-PROGRAMS.json.gz") + # The native transport keeps helper identifiers and permutes the data ports. + mapping = {} + for old, new in zip(changed["A"] + changed["B"], native["A"] + native["B"]): + for index in (1, 2) if old[0] == "add" else (1,): + key, value = old[index], new[index] + need(key not in mapping or mapping[key] == value, "inconsistent native transport") + mapping[key] = value + bindings = [] + for block in blocks: + raw_registers = [r - 16 if r >= 240 else r - 8 + for r in block["registers_before_112_port_restriction"]] + registers = [mapping[r] for r in raw_registers] + bindings.append({"block": block["index"], "registers": registers}) + need(native["R"] == 492 and not any(native["start"][224:]), "unexpected helper contract") + return native, programs, bindings, receipt + + +def scalar_pattern(word, registers): + result = [] + for op in word: + if op[0] == "add": + result.append(["add", ["L", registers[op[1]]], ["L", registers[op[2]]], + op[3], op[4]]) + else: + result.append(["scale", ["L", registers[op[1]]], op[2], op[3]]) + return result + + +def locate(events, word, bindings, orientation): + """Identify every complete block from its exact ordered scalar operators.""" + scalar = [(i, event) for i, event in enumerate(events) if event[0] == "scalar"] + candidates = variants(word) + found = [] + for binding in bindings: + registers = binding["registers"] + for suffix in ("main", "cleanup"): + name = ("dual_" if orientation == "backward" else "") + suffix + pattern = scalar_pattern(candidates[name], registers) + matches = [j for j in range(len(scalar) - len(pattern) + 1) + if scalar[j][1][1] == pattern[0] + and [e[1] for _, e in scalar[j:j + len(pattern)]] == pattern] + need(len(matches) == 1, "factory occurrence is not unique") + j = matches[0] + begin, end = scalar[j][0], scalar[j + len(pattern) - 1][0] + 1 + # Include the climbs immediately before the first scalar operator. + while begin and events[begin - 1][0] == "climb": + begin -= 1 + frame = scalar[j][1][2] + seen, climbs = set(), [] + for event in events[begin:end]: + if event[0] == "climb": + need(event[2] in registers and event[2] not in seen + and event[4] == frame, "climb cannot move to the block entry") + climbs.append(event) + else: + need(event[0] == "scalar" and event[2] == frame, + "opaque event or frame change inside a factory block") + op = event[1] + operands = op[1:3] if op[0] == "add" else op[1:2] + seen.update(r[1] for r in operands) + need(seen == set(registers), "incomplete factory register support") + found.append({"begin": begin, "end": end, "frame": frame, "name": name, + "registers": registers, "climbs": climbs, "block": binding["block"]}) + found.sort(key=lambda x: x["begin"]) + need(len(found) == 28 and all(a["end"] <= b["begin"] for a, b in zip(found, found[1:])), + "factory coverage or overlap") + return found + + +def lower_program(events, windows, word, candidate, mode): + original_lower = load_module("factory696", ROOT / "research/complex-dyadic-lowering/lower.py").lower + accumulated_lower = load_module("factory999", HERE / "sources/pr999-lower.py").lower + def lower(op): + if mode == "pr696": + return original_lower(op) + part = accumulated_lower(op)[1] + if mode in ("strong", "candidate") and op[0] == "add": + q = Q(op[3], op[4]) + if q.denominator == 1 and abs(q.numerator) + 1 < len(part): + add = "add" if q > 0 else "subtract" + part = [(add, tuple(op[1]), tuple(op[2]))] * abs(q.numerator) + part.append(("clear", WORK)) + return part + scalar_words, primitive_words = variants(word), variants(candidate, True) + by_start = {w["begin"]: w for w in windows} + result, index = [], 0 + while index < len(events): + window = by_start.get(index) + if window and mode != "accumulated": + name, frame, registers = window["name"], window["frame"], window["registers"] + result.extend(copy.deepcopy(window["climbs"])) + if mode == "candidate": + circuit = primitive_words[name] + [["clear", 8]] + elif mode == "strong": + circuit = cache_word(scalar_words[name]) + else: + circuit = reference(scalar_words[name], reuse=(mode == "cache")) + for op in circuit: + args = [WORK if r == 8 else ("L", registers[r]) for r in op[1:]] + result.append(["primitive", [op[0], *args], frame]) + index = window["end"] + else: + event = events[index] + if event[0] == "scalar": + for primitive in lower(event[1]): + result.append(["primitive", list(primitive), event[2]]) + else: + result.append(copy.deepcopy(event)) + index += 1 + need([e for e in result if e[0] != "primitive"] == + [e for e in events if e[0] != "scalar"], "non-scalar event inventory changed") + return result + + +def replay(events, native, orientation): + """Replay every input column on an exact integer dyadic grid.""" + n, centers, grid_bits = 716, 8, 256 + grid = 1 << grid_bits + registers = [("L", r) for r in range(n)] + [("C", r) for r in range(centers)] + [WORK] + rows = {r: {j: grid} for j, r in enumerate(registers)} + envelope = {r: grid for r in registers} + current = native["start"].copy() + center_frames = {} + paid, counts = Counter(), Counter() + exact_peak, positive_peak, depth, reads = grid, grid, 0, 0 + for event in events: + tag = event[0] + if tag == "climb": + _, _, register, old, new, rank = event + need(current[register] == old, "wrong climb source frame") + need(rank == len(native["frames"][new]) - len(native["frames"][old]), "wrong climb rank") + current[register] = new + paid[rank] += 1 + elif tag == "center": + _, register, old, new, rank = event + need(center_frames[register] == old, "wrong center source frame") + center_frames[register] = new + paid[rank] += 1 + elif tag == "primitive": + op, frame = event[1:] + name, target = op[0], tuple(op[1]) + operands = [tuple(r) for r in op[1:]] + for register in operands: + if register[0] == "L": + need(current[register[1]] == frame, "primitive outside its live common frame") + elif register[0] == "C": + if name == "clear" and register == target: + center_frames[register[1]] = frame + need(center_frames.get(register[1]) == frame, "wrong private center frame") + else: + need(register == WORK, "unknown private register") + row = rows[target] + if name == "clear": + rows[target], envelope[target] = {}, 0 + elif name == "copy": + source = tuple(op[2]) + rows[target], envelope[target] = rows[source].copy(), envelope[source] + elif name in ("double", "halve", "negate"): + if name == "halve": + need(all(value % 2 == 0 for value in row.values()) + and envelope[target] % 2 == 0, "inexact integer-grid halving") + rows[target] = {j: value // 2 for j, value in row.items()} + envelope[target] //= 2 + else: + factor = 2 if name == "double" else -1 + rows[target] = {j: factor * value for j, value in row.items()} + envelope[target] *= abs(factor) + else: + need(name in ("add", "subtract") and target != tuple(op[2]), "invalid primitive") + source = tuple(op[2]) + for j, value in list(rows[source].items()): + value = row.get(j, 0) + (value if name == "add" else -value) + if value: + row[j] = value + else: + row.pop(j, None) + envelope[target] += envelope[source] + counts[name] += 2 + reads += 2 * (2 if name in ("add", "subtract") else int(name != "clear")) + exact_peak = max(exact_peak, sum(map(abs, rows[target].values()))) + positive_peak = max(positive_peak, envelope[target]) + for value in rows[target].values(): + depth = max(depth, grid_bits - ((abs(value) & -abs(value)).bit_length() - 1)) + else: + need(tag in ("phase", "adapter", "residual_adapter"), "unknown opaque event") + for r in range(n): + expected = {r: grid} + if orientation == "forward" and 112 <= r < 224: + expected[r - 112] = grid + elif orientation == "backward" and r < 112: + expected[r + 112] = -grid + need(rows["L", r] == expected, "whole-word shear or dirty restoration") + need(all(not rows[r] for r in registers[n:]), "private input not erased") + need(current == native["final"], "wrong final frame inventory") + need(dict(paid) == {int(k): v for k, v in native["local_profile"].items()}, "paid child profile") + return {"all_columns": len(registers), "restored_dirty_helpers": 492, + "real_primitives": sum(counts.values()), "primitive_tags": dict(sorted(counts.items())), + "operand_reads": reads, "exact_peak_row_l1": str(Q(exact_peak, grid)), + "positive_peak": str(Q(positive_peak, grid)), "fractional_depth": max(depth, 0), + "paid_profile": dict(sorted(paid.items())), "word_sha256": digest(events)} diff --git a/research/complex-factory-fusion/host.py b/research/complex-factory-fusion/host.py new file mode 100644 index 0000000000..9cb5ca8899 --- /dev/null +++ b/research/complex-factory-fusion/host.py @@ -0,0 +1,228 @@ +"""Price the existing dedicated-bank repetition of the raw factory. + +Prepared for Ali Romman with substantial OpenAI Codex assistance. +Apache-2.0. The schedule and price formulas follow the PR531/PR622 lineage. +This module does not search or change an owner layout. +""" +import copy +from collections import Counter +from fractions import Fraction as Q + +from circuit import need +from full import ROOT, read, digest + +PARENT = ROOT / "research/direct-delivery504-global/inputs/data-base/split-centres/GLOBAL-TEMPLATE.json.gz" + +GEOMETRY = ("adapter_policy", "cover", "cover_final_correction", "loop_order", + "port_restriction", "route_semantics") + + +def construct(native, programs, physical_contract): + parent = read(PARENT) + v, helpers, stages, replicas, dimension = 112, 492, 9, 8, 73 + data = 2 * 4 * replicas * v + live = data + stages * helpers + need(native["R"] == helpers and native["v"] == v + and all(native["start"][r] == 0 and native["final"][r] == 1 + for r in range(2 * v, 2 * v + helpers)), "raw helper bank contract") + calls = [] + for old in parent["calls"]: + call = copy.deepcopy(old) + call["owners"] = call["owners"][:2 * v] + [ + [data + call["stage"] * helpers + helper, [2, call["replica"]]] + for helper in range(helpers)] + call["local_program_sha256"] = programs[call["orientation"]]["word_sha256"] + calls.append(call) + schedule = [] + for old in parent["execution_schedule"]: + if old["kind"] in ("local_cover_sweep", "bridge"): + for replica in range(replicas): + event = copy.deepcopy(old) + event.pop("replicas", None) + event["replica"] = replica + schedule.append(event) + else: + event = copy.deepcopy(old) + if event["kind"] == "bank_padding_cover_sweep": + event["families"] = [data, live] + elif event["kind"] == "translate_every_live_family": + event["families"] = [0, live] + event["charged_calls_per_cover"] = live + schedule.append(event) + banks = [{"family": data + stage * helpers + helper, + "stage": stage, "helper": helper, "complement_axes": [72]} + for stage in range(stages) for helper in range(helpers)] + return {"format": "raw-factory-dedicated-bank-host-v1", "m": dimension, + "v": v, "helpers": helpers, "live": live, "physical": live + helpers + 10, + "parent_template_sha256": digest(parent), "recipe": parent["recipe"], + "geometry": {key: parent[key] for key in GEOMETRY}, + "physical_contract": physical_contract, + "data_phase_sha256": parent["exact_data_phase_recipe_sha256"], + "calls": calls, "execution_schedule": schedule, "banks": banks, + "idle_children": parent["idle_children"], + "local_programs": programs, + "private_namespace": {"centers": [live, live + 8], + "reserved_tableau": [live + 8, live + 8 + helpers], + "coefficient": [live + helpers + 8, live + helpers + 10]}} + + +def audit(host, native): + """Check each literal role and each bank's complete coordinate partition.""" + parent = read(PARENT) + data, v, helpers, dimension = 7168, 112, 492, 73 + old_native = read(PARENT.parent / "CANONICAL-WORD.json.gz") + need(native["v"] == 112 and native["h"] == 9 and native["R"] == 492 + and native["ports"] == old_native["ports"], "changed hosted data ports") + for endpoint in ("start", "final"): + need(all(native["frames"][native[endpoint][r]] == + old_native["frames"][old_native[endpoint][r]] for r in range(224)), + "changed hosted data frame") + need(all(native["start"][r] == 0 and native["final"][r] == 1 for r in range(224, 716)) + and len(native["frames"][1]) == 9, "changed hosted helper boundary") + need(host["physical_contract"]["native_word_sha256"] == digest(native), + "unbound native physical contract") + need(host["parent_template_sha256"] == digest(parent) + and host["recipe"] == parent["recipe"] + and host["idle_children"] == parent["idle_children"], "changed parent recipe") + need(host["data_phase_sha256"] == parent["exact_data_phase_recipe_sha256"], + "changed data phase source") + need(host["geometry"] == {key: parent[key] for key in GEOMETRY}, "changed host geometry") + need(len(host["calls"]) == 72 and len(host["banks"]) == 4428, "missing hosted work") + covered, addresses, used = set(), {}, {} + for call, old in zip(host["calls"], parent["calls"]): + stage, replica = call["stage"], call["replica"] + need(type(stage) is int and type(replica) is int and 0 <= stage < 9 and 0 <= replica < 8, + "invalid call address") + need((stage, replica) not in covered, "duplicate complete call") + covered.add((stage, replica)) + need(stage == old["stage"] and replica == old["replica"], "changed call address") + need(call["orientation"] == old["orientation"] + and call["owners"][:224] == old["owners"][:224] + and call["window"] == old["window"] and call["pair"] == old["pair"], + "changed data call") + need(call["local_program_sha256"] == host["local_programs"][call["orientation"]]["word_sha256"], + "unbound local program") + need(len(call["owners"]) == 716 + and len({family for family, _ in call["owners"]}) == 716, + "aliased complete-invocation owner") + for helper, (family, route) in enumerate(call["owners"][224:]): + need(family == data + stage * helpers + helper and route == [2, replica], + "wrong helper bank or chart") + axes = set(range(9 * replica, 9 * replica + 9)) + need(not used.get(family, set()).intersection(axes), "overlapping bank footprint") + used.setdefault(family, set()).update(axes) + addresses[family] = (stage, helper) + need(covered == {(s, r) for s in range(9) for r in range(8)}, "missing call address") + need({b["family"] for b in host["banks"]} == set(used), "bank complement inventory") + for bank in host["banks"]: + family = bank["family"] + need(addresses[family] == (bank["stage"], bank["helper"]) + and bank["complement_axes"] == [72], "wrong bank complement") + need(used[family].isdisjoint(bank["complement_axes"]) + and used[family] | set(bank["complement_axes"]) == set(range(dimension)), + "incomplete bank restoration") + sweeps = [e for e in host["execution_schedule"] if e["kind"] == "local_cover_sweep"] + need([(e["stage"], e["replica"]) for e in sweeps] == + [(c["stage"], c["replica"]) for c in host["calls"]], "wrong execution chronology") + need(sum(e["kind"] == "bridge" for e in host["execution_schedule"]) == 72, + "bridge repetition") + need(host["live"] == 11596 and host["physical"] == 12098, "physical family bill") + padding = [e for e in host["execution_schedule"] if e["kind"] == "bank_padding_cover_sweep"] + final = [e for e in host["execution_schedule"] if e["kind"] == "translate_every_live_family"] + need(len(padding) == len(final) == 1 and padding[0]["families"] == [data, host["live"]] + and padding[0]["axis"] == 72 and padding[0]["rank"] == 1, "stale bank sweep") + need(final[0]["families"] == [0, host["live"]] + and final[0]["charged_calls_per_cover"] == host["live"], "unpaid final translation") + # Check every retained schedule field, including bridge signs and adapters. + index = 0 + for old in parent["execution_schedule"]: + repeated = old["kind"] in ("local_cover_sweep", "bridge") + count = 8 if repeated else 1 + group = host["execution_schedule"][index:index + count] + need(len(group) == count, "incomplete schedule") + for replica, event in enumerate(group): + restored = copy.deepcopy(event) + if repeated: + need(restored.pop("replica") == replica, "changed schedule replica") + if "replicas" in old: + restored["replicas"] = old["replicas"] + elif old["kind"] == "bank_padding_cover_sweep": + restored["families"] = old["families"] + elif old["kind"] == "translate_every_live_family": + restored["families"] = old["families"] + restored["charged_calls_per_cover"] = old["charged_calls_per_cover"] + need(restored == old, "changed schedule operation") + index += count + need(index == len(host["execution_schedule"]), "extra schedule operation") + need(host["private_namespace"] == { + "centers": [11596, 11604], "reserved_tableau": [11604, 12096], + "coefficient": [12096, 12098]}, "private namespace overlap") + profile = Counter({1: len(host["banks"])}) + for call in host["calls"]: + profile.update({int(k): value for k, value in native["local_profile"].items()}) + for child in host["idle_children"]: + profile[child["rank"]] += child["replicas"] + mass = sum(rank * count for rank, count in profile.items()) + need(73 * host["live"] - mass == 2560, "banked rank-mass identity") + return {"calls": 72, "helper_roles": 35424, "banks": len(host["banks"]), + "bank_complement_rank": 1, "profile": dict(sorted(profile.items())), + "rank_mass": mass, "rank_deficit": 2560, + "orientation_counts": dict(Counter(c["orientation"] for c in host["calls"]))} + + +def invoice(host, admission, checks): + """Retain every generic adapter, router, tape and precision allowance.""" + m, v, helpers, centers, replicas, stages = 73, 112, 492, 8, 8, 9 + local = host["local_programs"] + macro_slots = max(c["scalar_macros"] for c in checks.values()) + children = sum(admission["profile"].values()) + local_children = sum(local["forward"]["paid_profile"].values()) + compiler = 64 * (m + 1) ** 3 + adapters = 16 * (macro_slots + local_children + 716 + centers) + 64 * m + # The block retains all original scalar interfaces and frame transitions. + # Its added unary scales commute with coordinate adapters. See PROOF.md. + local_bound = max(p["real_primitives"] for p in local.values()) + adapters * compiler + scalar = sum(local[c["orientation"]]["real_primitives"] for c in host["calls"]) + bridges = 72 + bridge_additions, shifts, moves = 2 * v * bridges, 4 * v * replicas, 8 * v * replicas + live, physical = host["live"], host["physical"] + nonlocal_items = (4 * v * replicas * stages + 2 * v * replicas * stages + + 2 * 72 * helpers + sum(x["replicas"] for x in host["idle_children"]) + + len(host["banks"]) + bridge_additions + shifts + moves + + live + physical) + outside = 8 * nonlocal_items + 64 * m + per_vertex = (scalar + bridge_additions + shifts + moves + live + + (72 * adapters + outside) * compiler + 64 * physical) + group = 2 ** (36 * 36) + for i in range(1, 37): + group *= 2 ** (2 * i) - 1 + stock, streamed_mass = group * physical, group * admission["rank_mass"] + logical = group * per_vertex + 64 + router = compiler * (logical + 1) * (stock + 1) ** 2 + total_mass = streamed_mass + 2 ** 100000 + literal = 2 * 2 ** 30000 * stock ** 2 + 8 * streamed_mass + 4 * stock + 4 + 32 * m + payload = 512 + row = 2 * stock.bit_length() + 9909 + 252 + 2 * payload + maximum_child = max(admission["profile"]) + local_bits = max(Q(p["positive_peak"]).numerator.bit_length() + - Q(p["positive_peak"]).denominator.bit_length() + 1 + for p in local.values()) + required_prefix = local_bits + 37 + 72 + bridges + 4 + strict = {"local": local_bound < 2 ** 48, "logical": logical < 2 ** 6050, + "router": router < 2 ** 30000, "literal": literal < 2 ** 100000, + "mass": total_mass < 2 ** 100001, "precision": 32 * m * total_mass ** 2 < 2 ** 210000, + "tape": 2 * total_mass + 18 < 2 ** 210000, "row": row < 20161, + "halving": m * m > 2 * maximum_child ** 2, "prefix": required_prefix < payload} + need(all(strict.values()), "complete paid finite charge") + return {"local_macro_slots_retained": macro_slots, "local_children": local_children, + "all_paid_children": children, "compiler": compiler, "local_adapters": adapters, + "factory_new_frame_conversions": 0, + "factory_adapter_reserve_per_block_retained": 16 * 32, + "local_primitive_bound": local_bound, "hosted_scalar_primitives": scalar, + "hosted_operand_reads": sum(local[c["orientation"]]["operand_reads"] for c in host["calls"]), + "outside_adapter_reserve": outside, "wrapper_factors": 0, + "per_cover_vertex_bound": per_vertex, "bridge_sweeps": bridges, + "global_prefix_bits": required_prefix, "charged_payload_bits": payload, + "physical_stock_bits": stock.bit_length(), "router_bits": router.bit_length(), + "literal_bits": literal.bit_length(), "physical_row_coefficient": row, + "strict_checks": strict} diff --git a/research/complex-factory-fusion/sources/pr999-lower.py b/research/complex-factory-fusion/sources/pr999-lower.py new file mode 100644 index 0000000000..e3cbf7be8f --- /dev/null +++ b/research/complex-factory-fusion/sources/pr999-lower.py @@ -0,0 +1,309 @@ +"""Exact bounded-accumulator lowering of the selected complex scalar words. + +Prepared for Seb (@ZK-Snarky) with substantial OpenAI Codex assistance. +Apache-2.0. The primitive vocabulary is from icekylinx's PR425/433/531 +lineage. Copy-Horner/unit lowering and the sparse replay structure follow +Sagar Thakrar's PR696 (5a3f983715027c4fd83f50bc9001d4b18463bed1). +The two target-accumulation circuits and their prefix check are new here. +""" +import argparse +from collections import Counter +from fractions import Fraction as Q +from functools import lru_cache +import gzip +import hashlib +import json +from pathlib import Path + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +PROVIDERS = ROOT / "research/community-k492-audit/pr626/replay/mixed-global/base/providers" +WORK = ("W", 0) + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def power_two(n): + return n > 0 and n & (n - 1) == 0 + + +def shifts(register, exponent): + return [("double" if exponent > 0 else "halve", register)] * abs(exponent) + + +@lru_cache(maxsize=None) +def addition(q): + """Choose the shortest of three explicit circuits, keeping Horner on ties. + + Abstract registers T/S/W are target/source/private coefficient work. + Every candidate has exact endpoint T += q*S, S unchanged, W = 0. + """ + a, b = abs(q.numerator), q.denominator + require(a and power_two(b), "addition requires a nonzero dyadic") + accumulate = "add" if q > 0 else "subtract" + if a == b: + return "unit", ((accumulate, "T", "S"), ("clear", "W")) + k, d = a.bit_length() - 1, b.bit_length() - 1 + horner = [("copy", "W", "S")] + for bit in bin(a)[3:]: + horner.append(("double", "W")) + if bit == "1": + horner.append(("add", "W", "S")) + horner += shifts("W", -d) + [(accumulate, "T", "W"), ("clear", "W")] + + # Descending positive binary summands: every target prefix lies in [0,q] + # (or [q,0]) and the work never exceeds the leading power of two. + binary = [("copy", "W", "S")] + shifts("W", k - d) + for i in range(k, -1, -1): + if a >> i & 1: + binary.append((accumulate, "T", "W")) + if i: + binary.append(("halve", "W")) + binary.append(("clear", "W")) + + # Non-adjacent signed digits. Split a too-large leading work value into + # two visits to its half; this matters for integral coefficients only. + digits, n = [], a + while n: + digit = 2 - n % 4 if n & 1 else 0 + digits.append(digit) + n = (n - digit) // 2 + if 1 << (len(digits) - 1) > a * b: + top = digits.pop() + digits[-1] += 2 * top + signed = [("copy", "W", "S")] + shifts("W", -d) + for i, digit in enumerate(digits): + operation = "add" if (digit > 0) == (q > 0) else "subtract" + signed += [(operation, "T", "W")] * abs(digit) + if i + 1 < len(digits): + signed.append(("double", "W")) + signed.append(("clear", "W")) + candidates = (("horner", horner), ("binary_descending", binary), + ("signed_ascending", signed)) + method, word = min(candidates, key=lambda item: len(item[1])) + return method, tuple(word) + + +def lower(op, work=WORK): + """Lower one scalar macro; caller executes all primitives at its frame.""" + tag, target = op[0], tuple(op[1]) + require(target != work, "work aliases target") + if tag == "clear": + return "clear", [("clear", target)] + if tag == "scale": + q = Q(op[2], op[3]) + require(power_two(abs(q.numerator)) and power_two(q.denominator), + "scale requires a signed power of two") + word = shifts(target, abs(q.numerator).bit_length() - q.denominator.bit_length()) + return "scale", word + ([("negate", target)] if q < 0 else []) + require(tag in ("add", "copy"), "unknown macro") + source = tuple(op[2]) + require(source not in (target, work), "source aliases target or work") + if tag == "copy": + return "copy", [("copy", target, source)] + method, word = addition(Q(op[3], op[4])) + registers = {"T": target, "S": source, "W": work} + return method, [(p[0], *(registers[r] for r in p[1:])) for p in word] + + +def step(rows, op): + """Exact sparse row interpreter; executes primitives, not scalar macros.""" + tag, target = op[:2] + if tag == "clear": + rows[target] = {} + elif tag == "copy": + rows[target] = rows[op[2]].copy() + elif tag in ("double", "halve", "negate"): + q = {"double": Q(2), "halve": Q(1, 2), "negate": Q(-1)}[tag] + rows[target] = {j: q * x for j, x in rows[target].items()} + elif tag in ("add", "subtract"): + for j, x in list(rows[op[2]].items()): + value = rows[target].get(j, Q(0)) + (x if tag == "add" else -x) + if value: + rows[target][j] = value + else: + rows[target].pop(j, None) + else: + raise ValueError("unknown primitive") + + +def check_addition(q, word): + """Independently check arbitrary T,S,W and the reference prefix envelope.""" + rows = {r: {r: Q(1)} for r in ("T", "S", "W")} + for primitive in word: + step(rows, primitive) + require(rows["S"] == {"S": Q(1)}, "source changed") + t, w = rows["T"], rows["W"] + require(t.get("T") == 1 and set(t) <= {"T", "S"} + and abs(t.get("S", 0)) <= abs(q), "target prefix envelope") + require(w == {"W": Q(1)} or + (set(w) <= {"S"} and abs(w.get("S", 0)) <= abs(q.numerator)), + "work prefix envelope") + require(rows == {"T": {"T": Q(1), "S": q}, "S": {"S": Q(1)}, "W": {}}, + "endpoint or dirty-work cleanup") + + +def baseline_count(op): + if op[0] in ("clear", "copy"): + return 1 + q = Q(op[3], op[4]) if op[0] == "add" else Q(op[2], op[3]) + a, b = abs(q.numerator), q.denominator + if op[0] == "scale": + 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 read(path): + raw = path.read_bytes() + return json.loads(gzip.decompress(raw) if path.suffix == ".gz" else raw) + + +def digest(data): + return hashlib.sha256(data).hexdigest() + + +def controls(): + q = Q(63, 8) + _, word = addition(q) + word = list(word) + mutations = { + "missing_cleanup": word[:-1], + "dirty_source_copy_omitted": word[1:], + "wrong_accumulation_sign": [ + ("add", *p[1:]) if p[0] == "subtract" else p for p in word], + "endpoint_neutral_source_growth": [("double", "S"), ("halve", "S")] + word, + "endpoint_neutral_target_growth": [("add", "T", "S")] * 8 + + [("subtract", "T", "S")] * 8 + word, + "endpoint_neutral_work_growth": [("copy", "W", "S")] + + [("double", "W")] * 6 + [("halve", "W")] * 6 + word, + } + rejected = [] + for name, mutant in mutations.items(): + try: + check_addition(q, mutant) + except ValueError: + rejected.append(name) + else: + raise ValueError("accepted mutation: " + name) + for name, op in { + "nondyadic": ["add", ["T", 0], ["S", 0], 1, 3], + "zero_coefficient": ["add", ["T", 0], ["S", 0], 0, 1], + "source_alias": ["add", ["T", 0], ["T", 0], 1, 1], + "work_alias": ["add", ["T", 0], list(WORK), 1, 1], + }.items(): + try: + lower(op) + except ValueError: + rejected.append(name) + else: + raise ValueError("accepted invalid macro: " + name) + return rejected + + +def replay(events, checks, inherited, orientation): + n, v = 716, 112 + rows = {("L", r): {r: Q(1)} for r in range(n)} + rows[WORK] = {n: Q(1)} + paid, methods, primitives, coefficients = Counter(), Counter(), Counter(), set() + original = predecessor = macro_count = 0 + circuit_hash = hashlib.sha256() + for event in events: + if event[0] == "climb": + paid[event[5]] += 1 + elif event[0] == "center": + paid[event[4]] += 1 + elif event[0] == "scalar": + op, frame = event[1:] + method, word = lower(op) + methods[method] += 1 + macro_count += 1 + old = baseline_count(op) + original += 2 * old + predecessor += 2 * old + if op[0] == "add": + q = Q(op[3], op[4]) + coefficients.add(q) + predecessor -= 2 * (1 + (abs(q) == 1)) + rows.setdefault(tuple(op[1]), {}) + for primitive in word: + step(rows, primitive) + primitives[primitive[0]] += 2 + circuit_hash.update(json.dumps([frame, primitive], separators=(",", ":")).encode() + b"\n") + if op[0] == "add": + require(not rows[WORK], "private coefficient work survived") + else: + require(event[0] in ("phase", "adapter", "residual_adapter"), "unknown event") + for r in range(n): + expected = {r: Q(1)} + if orientation == "forward" and v <= r < 2 * v: + expected[r - v] = Q(1) + if orientation == "backward" and r < v: + expected[r + v] = Q(-1) + require(rows[("L", r)] == expected, "full arbitrary-input endpoint at " + str(r)) + require(all(not row for r, row in rows.items() if r[0] != "L"), "private work not zero") + require(original == checks["real_component_primitive_bound"], "original primitive count") + require(macro_count == checks["scalar_macros"], "scalar count") + require(dict(paid) == {int(k): v for k, v in checks["paid_profile"].items()}, "paid profile") + total = sum(primitives.values()) + return { + "original_real_primitives": original, + "pr696_real_primitives": predecessor, + "new_real_primitives": total, + "saved_vs_pr696": predecessor - total, + "saved_vs_original": original - total, + "all_input_columns": n, + "extra_dirty_work_column": 1, + "scalar_macros": macro_count, + "methods": dict(sorted(methods.items())), + "primitives": dict(sorted(primitives.items())), + "primitive_word_sha256": circuit_hash.hexdigest(), + "paid_profile": {str(k): v for k, v in sorted(paid.items())}, + "inherited_prefix_l1_upper": inherited["prefix_l1_upper"], + "charged_payload_bits": inherited["charged_payload_bits"], + }, coefficients + + +def certificate(): + pins = read(HERE / "SOURCES.json") + for name, expected in pins["files"].items(): + path = ROOT / name + data = path.read_bytes() + if path.suffix == ".gz": + data = gzip.decompress(data) + require(digest(data) == expected, "source pin: " + name) + results, coefficients = {}, set() + for provider in ("ck", "jp8"): + directory = PROVIDERS / provider + programs = read(directory / "LOCAL-PROGRAMS.json.gz") + checks = read(directory / "LOCAL-CHECKS.json") + inherited = read(directory / "INDEPENDENT-LOCAL-REPLAY.json") + for orientation in ("forward", "backward"): + events = programs[orientation] + require(digest(json.dumps(events, sort_keys=True, separators=(",", ":")).encode()) + == checks[orientation]["sha256"], "program semantic hash") + key = provider + "/" + orientation + results[key], used = replay(events, checks[orientation], + inherited["local"][orientation], orientation) + coefficients.update(used) + for q in sorted(coefficients): + _, word = addition(q) + check_addition(q, word) + return {"status": "PASS_COMPLEX_COEFFICIENT_ACCUMULATION", "programs": results, + "distinct_coefficients": len(coefficients), "controls": controls()} + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--write-certificate", type=Path, help="write to a NEW file instead of checking EXPECTED.json") + args = parser.parse_args() + result = certificate() + if args.write_certificate: + with args.write_certificate.open("x") as out: + out.write(json.dumps(result, indent=2, sort_keys=True) + "\n") + else: + require(result == read(HERE / "EXPECTED.json"), "expected certificate differs") + savings = ",".join(str(p["saved_vs_pr696"]) for p in result["programs"].values()) + print(f"PASS_COMPLEX_COEFFICIENT_ACCUMULATION programs=4 columns=716 extra_savings={savings} controls={len(result['controls'])}") diff --git a/research/complex-factory-fusion/test_package.py b/research/complex-factory-fusion/test_package.py new file mode 100644 index 0000000000..8f2485b98f --- /dev/null +++ b/research/complex-factory-fusion/test_package.py @@ -0,0 +1,81 @@ +#!/usr/bin/env python3 +"""Check relocation, source integrity and output preservation. + +Prepared for Ali Romman with substantial OpenAI Codex assistance. +Apache-2.0. The mathematical rejection controls are in verify.py. +""" +import json +import os +from pathlib import Path +import shutil +import subprocess +import sys +import tempfile + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] + + +def need(condition, message): + if not condition: + raise ValueError(message) + + +def main(): + pins = json.loads((HERE / "SOURCES.json").read_text()) + with tempfile.TemporaryDirectory(prefix="factory fusion ") as directory: + checkout = Path(directory) / "minimal checkout" + package = checkout / HERE.relative_to(ROOT) + files = set(pins["files"]) + files.update(str(p.relative_to(ROOT)) for p in HERE.rglob("*") + if p.is_file() and "__pycache__" not in p.parts) + for name in files: + target = checkout / name + target.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(ROOT / name, target) + command = [sys.executable, "-I", "-O", "-B", str(package / "verify.py")] + environment = os.environ.copy() + for name in ("OMP_NUM_THREADS", "OPENBLAS_NUM_THREADS", "MKL_NUM_THREADS"): + environment[name] = "1" + + def run(extra=(), reason=None): + result = subprocess.run(command + list(extra), cwd=directory, + env=environment, text=True, stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, timeout=300) + if reason is None: + need(result.returncode == 0 and "PASS_EXACT_COMPLEX_FACTORY_FUSION" in result.stdout, + "relocated check failed:\n" + result.stdout[-4000:]) + else: + need(result.returncode != 0 and reason in result.stdout, + "wrong failure:\n" + result.stdout[-2000:]) + + run() + print("PASS minimal offline relocation with isolated optimized Python", flush=True) + path = checkout / "research/complex-dyadic-lowering/lower.py" + original = path.read_bytes() + path.write_bytes(original + b"\n") + run(reason="source pin:") + path.write_bytes(original) + path = package / "CIRCUIT.json" + original = path.read_bytes() + changed = json.loads(original) + changed["levels"][0] = True + path.write_text(json.dumps(changed)) + run(reason="noninteger certificate") + path.write_bytes(original) + receipt = Path(directory) / "existing receipt.json" + receipt.write_bytes(b"user-owned result\n") + run(["--write", str(receipt)], "receipt output already exists") + need(receipt.read_bytes() == b"user-owned result\n", "receipt overwritten") + occupied = Path(directory) / "existing artifacts" + occupied.mkdir() + marker = occupied / "retain.txt" + marker.write_bytes(b"retain\n") + run(["--out", str(occupied)], "artifact output already exists") + need(list(occupied.iterdir()) == [marker] and marker.read_bytes() == b"retain\n", + "artifact directory changed") + print("PASS_FACTORY_FUSION_PACKAGE relocation=1 corruption=2 output_preservation=2") + + +if __name__ == "__main__": + main() diff --git a/research/complex-factory-fusion/verify.py b/research/complex-factory-fusion/verify.py new file mode 100644 index 0000000000..d667c695a5 --- /dev/null +++ b/research/complex-factory-fusion/verify.py @@ -0,0 +1,262 @@ +#!/usr/bin/env python3 +"""Verify the exact factory, every raw-word column and the fixed banked bill. + +Prepared for Ali Romman with substantial OpenAI Codex assistance. +Apache-2.0. This finite check does not prove the multiplication theorem. +""" +import argparse +import copy +import hashlib +import json +from pathlib import Path +import sys +import tempfile + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) +from circuit import compile_factory, local_check, need, reference, variants +from comparator import cache_word, gauge_census +from full import ROOT, build, canonical, digest, load_module, locate, lower_program, read, replay, scalar_pattern, write +import host + + +def check_pins(): + pins = read(HERE / "SOURCES.json") + for name, expected in pins["files"].items(): + path = ROOT / name + data = path.read_bytes() + if path.suffix == ".gz": + import gzip + data = gzip.decompress(data) + need(hashlib.sha256(data).hexdigest() == expected, "source pin: " + name) + return pins + + +def check_local(word, candidate): + result = {} + accumulated = load_module("local_factory999", HERE / "sources/pr999-lower.py") + originals = variants(read(ROOT / "research/complex-factory5-resynthesis/CIRCUIT.json")["original"]) + for name, scalar in variants(word).items(): + baseline = local_check(scalar, reference(scalar)) + current = [] + for op in scalar_pattern(scalar, list(range(8))): + for primitive in accumulated.lower(op)[1]: + current.append([primitive[0], *[8 if r[0] == "W" else r[1] for r in primitive[1:]]]) + need(current == [list(op) for op in reference(scalar)], "PR999 changed factory comparison") + cached = local_check(scalar, reference(scalar, reuse=True)) + strong = local_check(scalar, cache_word(scalar)) + census = gauge_census(scalar) + implementation = variants(candidate, True)[name] + [["clear", 8]] + fresh = local_check(scalar, implementation) + local_check(originals[name], implementation) + fresh["original_87_macro_boundary"] = True + need(fresh["primitives"] == 38 < strong["primitives"] == 44 + and strong["primitives"] < cached["primitives"] < baseline["primitives"], + "factory cost did not improve the strong comparator") + from fractions import Fraction as Q + need(Q(fresh["peak_row_l1"]) <= Q(baseline["peak_row_l1"]) + and fresh["fractional_depth"] <= baseline["fractional_depth"], + "factory precision guard") + result[name] = {"pr696": baseline, "cached_work": cached, "strong": strong, + "extended_gauge_census": census, "candidate": fresh} + return result + + +def rejection(action, reason): + try: + action() + except ValueError as error: + need(reason in str(error), "control failed for another reason: " + str(error)) + return + raise ValueError("accepted negative control: " + reason) + + +def local_controls(word, candidate, certificate): + controls = [] + for name, scalar in variants(word).items(): + primitives = variants(candidate, True)[name] + [["clear", 8]] + for index in range(len(primitives)): + mutant = primitives[:index] + primitives[index + 1:] + rejection(lambda: local_check(scalar, mutant), "exact factory boundary") + controls.append({"variant": name, "single_primitive_deletions_rejected": len(primitives)}) + altered = copy.deepcopy(certificate) + altered["levels"][0] = True + rejection(lambda: compile_factory(word, altered), "noninteger certificate") + altered = copy.deepcopy(certificate) + altered["dual_flow"][0] = 2 + rejection(lambda: compile_factory(word, altered), "dual capacity") + altered = copy.deepcopy(certificate) + altered["dual_flow"][0] = 0 + rejection(lambda: compile_factory(word, altered), "dual conservation") + altered = copy.deepcopy(certificate) + altered["primitives"][3][1] = True + rejection(lambda: compile_factory(word, altered), "primitive certificate types") + return {"deletion_families": controls, "certificate_controls": 4} + + +def host_controls(good, native): + mutants = {} + bad = copy.deepcopy(good) + bad["calls"].pop() + mutants["missing_call"] = (bad, "missing hosted work") + bad = copy.deepcopy(good) + bad["calls"][1]["owners"][224] = bad["calls"][1]["owners"][225] + mutants["aliased_owner"] = (bad, "aliased complete-invocation owner") + bad = copy.deepcopy(good) + bad["banks"][0]["complement_axes"] = [71] + mutants["wrong_complement"] = (bad, "wrong bank complement") + bad = copy.deepcopy(good) + bad["calls"][0]["local_program_sha256"] = "0" * 64 + mutants["unbound_program"] = (bad, "unbound local program") + bad = copy.deepcopy(good) + index = next(i for i, e in enumerate(bad["execution_schedule"]) if e["kind"] == "bridge") + bad["execution_schedule"].pop(index) + mutants["missing_bridge"] = (bad, "bridge repetition") + bad = copy.deepcopy(good) + next(e for e in bad["execution_schedule"] if e["kind"] == "bank_padding_cover_sweep")["families"][1] += 1 + mutants["stale_bank_range"] = (bad, "stale bank sweep") + bad = copy.deepcopy(good) + next(e for e in bad["execution_schedule"] if e["kind"] == "translate_every_live_family")["charged_calls_per_cover"] -= 1 + mutants["unpaid_translation"] = (bad, "unpaid final translation") + bad = copy.deepcopy(good) + next(e for e in bad["execution_schedule"] if e["kind"] == "bridge")["coefficient"] *= -1 + mutants["wrong_bridge_sign"] = (bad, "changed schedule operation") + bad = copy.deepcopy(good) + bad["private_namespace"]["coefficient"][0] -= 1 + mutants["private_alias"] = (bad, "private namespace overlap") + for bad, reason in mutants.values(): + rejection(lambda: host.audit(bad, native), reason) + bad = copy.deepcopy(native) + bad["ports"][0], bad["ports"][1] = bad["ports"][1], bad["ports"][0] + rejection(lambda: host.audit(good, bad), "changed hosted data ports") + return list(mutants) + ["changed_data_port_order"] + + +def phase_replay(out): + prior = load_module("factory681_phases", ROOT / "research/complex-factory5-resynthesis/verify.py") + prior.run(ROOT / "research/direct-delivery504-global/code/phases_delta.py", + ["--local", out / "local", "--baseline", + ROOT / "research/direct-delivery504-global/inputs/phase-baseline", + "--compiler", ROOT / "research/direct-delivery504-global/vendor/clifford"], + out / "phases.log") + receipt = read(out / "local/CLIFFORD-REVIEW.json") + receipt.pop("seconds") + receipt.pop("canonical_word_sha256") + need(receipt["all_child_equalities_include_global_phase"] + and receipt["directed_edges"] == 3110 and receipt["endpoint_adapters"] == 224, + "incomplete phase replay") + return receipt + + +def verify(out): + pins = check_pins() + word = read(ROOT / pins["factory_source"])["replacement"] + certificate = read(HERE / "CIRCUIT.json") + candidate = compile_factory(word, certificate) + local = check_local(word, candidate) + controls = {"local": local_controls(word, candidate, certificate)} + native, programs, bindings, inherited = build(out, word) + print("PASS factory and native bindings", flush=True) + phases = phase_replay(out) + print("PASS exact phase recipes", flush=True) + results, emitted = {}, {} + for orientation, events in programs.items(): + windows = locate(events, word, bindings, orientation) + write(out / (orientation + "-FACTORY-WINDOWS.json"), windows) + # A climb on a wire already read in the interval cannot be moved left. + if orientation == "forward": + mutant = copy.deepcopy(events) + window = next(w for w in windows if any(e[0] == "climb" + for e in events[w["begin"] + 3:w["end"]])) + first = next(i for i in range(window["begin"], window["end"]) + if mutant[i][0] == "scalar") + later = next((i for i in range(first + 1, window["end"]) + if mutant[i][0] == "climb"), None) + need(later is not None, "missing climb control site") + mutant[later][2] = mutant[first][1][1][1] + rejection(lambda: locate(mutant, word, bindings, orientation), "climb cannot move") + controls["factory_placement"] = ["climb_crosses_live_register_use"] + results[orientation], emitted[orientation] = {}, {} + for mode in ("pr696", "accumulated", "cache", "strong", "candidate"): + stream = lower_program(events, windows, word, candidate, mode) + results[orientation][mode] = replay(stream, native, orientation) + emitted[orientation][mode] = stream + write(out / (orientation + "-" + mode + "-PRIMITIVES.json.gz"), stream) + from fractions import Fraction as Q + need(Q(results[orientation]["candidate"]["positive_peak"]) <= + Q(inherited["local"]["local"][orientation]["prefix_l1_upper"]), + "whole-word precision reserve exceeded") + for mode in ("cache", "strong", "candidate"): + need(results[orientation][mode]["real_primitives"] < + results[orientation]["accumulated"]["real_primitives"], "no whole-word saving") + need(results["forward"]["pr696"]["real_primitives"] == 123320 + and results["backward"]["pr696"]["real_primitives"] == 123336, + "pinned PR924 complete primitive bill") + # A wrong physical frame must fail at the actual emitted primitive. + mutant = copy.deepcopy(emitted["forward"]["candidate"]) + first = next(e for e in mutant if e[0] == "primitive" and e[2] != 0 and e[1][1][0] == "L") + first[2] = 0 + rejection(lambda: replay(mutant, native, "forward"), "live common frame") + controls["whole_word"] = ["wrong_primitive_frame"] + print("PASS all ten complete primitive projections", flush=True) + checks = read(out / "local/LOCAL-CHECKS.json") + physical = {"native_word_sha256": digest(native), + "clifford_recipes_sha256": digest(read(out / "local/CLIFFORD-RECIPES.json")), + "phase_check_sha256": digest(phases)} + hosting = {} + for mode in ("pr696", "accumulated", "cache", "strong", "candidate"): + descriptions = {o: results[o][mode] for o in programs} + controller = host.construct(native, descriptions, physical) + admission = host.audit(controller, native) + hosting[mode] = {"admission": admission, "invoice": host.invoice(controller, admission, checks), + "controller_sha256": digest(controller)} + write(out / (mode + "-HOST.json.gz"), controller) + if mode == "candidate": + controls["hosting"] = host_controls(controller, native) + strong, fresh = (hosting[x]["invoice"] for x in ("strong", "candidate")) + saving = strong["per_cover_vertex_bound"] - fresh["per_cover_vertex_bound"] + need(saving == strong["hosted_scalar_primitives"] - fresh["hosted_scalar_primitives"] + and saving == 24192, "hosted saving or retained outside bill") + result = {"status": "PASS_EXACT_COMPLEX_FACTORY_FUSION", "base_commit": pins["base_commit"], + "local": local, "native": inherited, "phase": phases, "programs": results, + "hosted": hosting, "controls": controls, + "saved_vs_pr696_per_call": {o: results[o]["pr696"]["real_primitives"] + - results[o]["candidate"]["real_primitives"] for o in programs}, + "pr999_saved_outside_factories": {o: results[o]["pr696"]["real_primitives"] + - results[o]["accumulated"]["real_primitives"] for o in programs}, + "extra_saved_vs_strong_per_call": {o: results[o]["strong"]["real_primitives"] + - results[o]["candidate"]["real_primitives"] for o in programs}, + "small_integer_saved_outside_factories": { + o: results[o]["cache"]["real_primitives"] - results[o]["strong"]["real_primitives"] + - sum(28 * (local[name]["cached_work"]["primitives"] - 44) + for name in (("main", "cleanup") if o == "forward" else + ("dual_main", "dual_cleanup"))) for o in programs}, + "extra_saved_hosted": saving, "new_kappa": False} + return json.loads(json.dumps(result)) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--out", type=Path, help="retain artifacts in a new directory") + parser.add_argument("--write", type=Path, help="write a new development receipt") + args = parser.parse_args() + need(args.write is None or not args.write.exists(), "receipt output already exists") + if args.out: + need(not args.out.exists(), "artifact output already exists") + args.out.mkdir(parents=True) + result = verify(args.out.resolve()) + else: + with tempfile.TemporaryDirectory(prefix="complex-factory-fusion-") as directory: + result = verify(Path(directory)) + if args.write: + with args.write.open("x") as output: + json.dump(result, output, indent=2, sort_keys=True) + output.write("\n") + else: + need(canonical(result) == canonical(read(HERE / "EXPECTED.json")), "complete expected receipt") + print("PASS_EXACT_COMPLEX_FACTORY_FUSION primitives=44->38 columns=725 " + "calls=72 extra_vs_strong=" + str(result["extra_saved_hosted"]) + " no_new_kappa") + + +if __name__ == "__main__": + main()