diff --git a/research/p104-full-frame-contact/PROOF.md b/research/p104-full-frame-contact/PROOF.md new file mode 100644 index 0000000000..013734fb2c --- /dev/null +++ b/research/p104-full-frame-contact/PROOF.md @@ -0,0 +1,169 @@ +# One full-frame contact in the productive P104 caller + +This package changes one contact in the exact word of +[PR5544](https://github.com/CrocSwap/integer-mult-bounds/pull/5544), at +`e2a6cce2f9db5a2c5f9714f4b9e5292dd3a10581`. The new conditional endpoint is +`kappa = 304117/100000000 = .00304117`. The gain over PR5544 is +`3/5000000 = .00000060`. The selected record stays unchanged. + +The five source assumptions remain: native all-column implementation, +owned erasure, the uniform compiler, precision and tape costs, and analytic +recovery. The ideal operator proof and the complete conditional price are +given below. The enormous uniform word and the rounded integer multiplier +are not materialized. + +## Exact source change + +Let `A=span(30,70,429)`, `B=span(13,19,70,416)`, and `D=F_2^9`. +These are source frames 739, 240 and 127, with `A < B < D` and dimensions +3, 4 and 9. The zero-based source events are: + +| Event | Source instruction | +| --- | --- | +| 16798 | Move register 345 from A to B | +| 16799 | `341 -= 345`, in B | +| 16800 | `341 *= -1`, in B | +| 17061 | Move register 341 from B to D | +| 17067 | Move register 345 from B to D | + +Register 341 is already in B at event 16798. It has no other read or write +before event 17061. Register 345 has no other read or write between events +16798 and 17067. The constructor checks the complete intervening event lists, +including source operands. Other registers can retain their original order. + +Replace event 16798 by moves `341: B -> D` and `345: A -> D`. Run events +16799 and 16800 in D. Remove events 17061 and 17067. Keep all other events +byte-equivalent as JSON records. The scalar coefficients, scalar order, +public boundaries, independent inputs and owned lifetimes stay the same. +The word has 25,310 events, one fewer than the source. + +## Uniform operator identity + +Use the source chart Phi_V at frame V. Put +`T_VU = Phi_V Phi_U^(-1)`. On logical values x and y, the old two-register +fragment ends with + +```text +register 341: Phi_D (y - x) +register 345: Phi_D y. +``` + +The new fragment first places both values in chart D, then performs the same +subtraction and sign. It has exactly these outputs. Equivalently, a common +linear transport on both operands commutes with a scalar ADD and SCALE. +The checked read intervals permit this equality inside the complete word. +The next reads of each register use D in both words. + +For every positive digit-column count, replace each chart by its prescribed +tensor power. The common-chart identity is still valid. Scalar coefficients +remain outside tensor powers. No sum of operators is tensor-powered. +The source native compiler lowers every candidate MOVE and helper boundary. +Its separate Gaussian interpreter checks signed Pauli images and absolute +phase. In particular, the new `A -> D` child has rank six, with its actual +monomial adapters. It is not an uncharged change of coordinates. + +The sparse rational interpreter checks all 743 endpoint rows. The independent +reverse interpreter uses dense integer columns and binary denominators. Both +cover all 552,049 public and owned coefficients. All 735 public inputs remain +arbitrary. The eight owned lifetimes still start and return at the declared +zero states, with peak occupancy one. + +## Complete cost and transfer + +The old fragment pays H1 + 2H5. The replacement pays H5 + H6. Thus + +```text +local paid delta: -H1 - H5 + H6 +complete paid delta: -18H1 - 18H5 + 18H6 +target delta: zero at every rank. +``` + +For `0 < t < 1`, strict subadditivity gives `6^t < 1 + 5^t`. Therefore the +complete signed recursive moment is strictly smaller at every such power. +Rank mass is unchanged. The standard signed-invoice comparator gives the +same conclusion for the actual complete histograms. This comparison uses +all helper targets and all thin and idle jobs, not a local cost alone. + +The new local profile is + +```text +{1:2428, 2:557, 3:389, 4:112, 5:107, 6:17, 7:13, 9:1}. +``` + +All 527 helper targets keep their source ranks +`{4:51, 5:36, 7:24, 8:122, 9:294}`. The 104-port caller, both orientations, +its 18 forward source invocations, 15 thin queries, 15 whole idles and +32 main banks are unchanged. The source's signed exchanges and central-square +translations still supply all backward interfaces. The full bill has 69,912 +paid calls and 12,814 productive fields, with rank surplus 760. The unused +helper 711 keeps both its paid H9 and its productive H9. + +`pricing.py` adapts the pinned PR5544 price engine. Its only mathematical +changes are the new paid-call count, claimed and tested endpoints, and the +comparison endpoint. It recomputes both complete histograms by two counts, +the raw crossing with rational intervals, and a second independent moment +enclosure. The tested saving is `.003041171`. Cutoff 17, floor 18, tail offset +1/5, reserve `10^-10`, power 1024 and logarithm power 1000 remain fixed. +All completion, splitting, capacity, compiler-grid, BIT-stock and 58 outer +predicates must pass. `RESULT.json` records their exact rational values. +The fixed-invoice crossing and its remaining headroom are reported there; +no global optimum or exclusion of other words is claimed. + +The new crossing is in `(.00304117181649, .00304117181650)`. Its increase +over the source crossing is in `(.00000059374018, .00000059374020)`. +The claimed endpoint is below the new crossing by between +`.00000000181649` and `.00000000181650`. The strict compiler gap is +`1/7000000000`; its independently checked integer height is +`H=337848000000000`, with test exponent 48264. The previous grid point fails. +The stated endpoint gain `.00000060` also reflects the different safety +margins below the two crossings; it is not the exact raw-root difference. + +This mixed-target caller is outside the historical fixed-rank packing model +in `research/complex-local-word-ceiling/ceiling.py`. It retains independent +productive helpers and targets of unequal ranks, rather than one target rank +and the old hosted coverage law. The replacement bound is the exact crossing +of this complete fixed invoice. The endpoint attains between +99.9999402697% and 99.9999402701% of that crossing. + +For this invoice the crossing is unique for `0 < kappa < 1`. To see this, +put `t=1-kappa` and divide its signed moment by `6^t`. The signed coefficients +at ranks 1 through 6 are negative; those at ranks 7 through 9 are positive. +Each of these normalized terms increases with t, except the constant rank-six +term. The other terms are 416 copies of `((r+1)/6)^t-(r/6)^t` for +`r=16,24,...,64`, 208 copies at r=72, and `208*(145/6)^t`. +They also increase for `t >= 0`: the derivative of each difference is positive +because `x^t*log(x)` increases for `x > 1`. The full normalized moment is +strictly increasing. Its values at t=0 and t=1 have opposite signs, since +the count difference is -57,098 and the rank surplus is 760. Thus the upper +crossing endpoint bounds the saving allowed by this fixed invoice. It does +not bound a changed word, caller, target contract or invoice. + +The local scalar program is unchanged. There is one fewer native call and +no new owned field. Native ranks stay at most nine locally; complete maximum +target and child ranks stay 145 and 72. The source's finite bound of fewer +than 26,000 events, scalar growth factor below `2^16` per event and total +local Gaussian rank 5,894 still applies. These bounds fund the reordered +prefix as well as the old prefix. All caller routes, private COPY paths, +returns, normalizers and matching remain in the complete ordinary allowance. +No precision or machine-operation cost is set to zero. + +## Controls and limits + +The checker rejects a one-operand retiming, a changed subtraction sign, an +intervening source read and an omitted paid charge. It also reruns the source +caller controls, exact phase control and adverse compiler/outer controls. +The dependency hashes are checked before the source modules are imported. + +These are author-side exact checks. They are not independent human review or +a proof-kernel verification. The source interpreters and mathematical +framework remain credited dependencies. No merge or selected-frontier update +is part of this contribution. + +Credit Ali Romman's PR5544 for the productive caller; Gareth Davidson's +PR2305, David Arias's PR2152 and Cinna Davis's PR2219 for the composed word. +The P104 shared-chart and dual-ADD retiming packages already use the standard +two-operand identity. The new result is this literal contact and its complete +conditional endpoint. Retain Jacob Alan Sussman's productive recursion, +Cinna Davis's controller, zxv's compiler and outer machinery, Cao Yifan's +pricing lineage, and all geometry, native, COPY and analytic source notices. +Prepared by Ali Romman with substantial OpenAI Codex assistance. Apache-2.0. diff --git a/research/p104-full-frame-contact/README.md b/research/p104-full-frame-contact/README.md new file mode 100644 index 0000000000..ace72d1358 --- /dev/null +++ b/research/p104-full-frame-contact/README.md @@ -0,0 +1,82 @@ +# Conditional kappa .00304117 from one P104 contact + +This contribution increases complete conditional kappa from **.00304057 in +[PR5544](https://github.com/CrocSwap/integer-mult-bounds/pull/5544)** to +**.00304117**, a gain of **.00000060**. It changes the recursive paid profile. +The selected record remains .003027288235 and is not edited. + +The change moves the subtraction on registers 341 and 345, and its sign, +from a four-dimensional frame to the full nine-dimensional frame. It replaces +H1 + H5 by H6 in each of 18 local calls. All scalar coefficients, public +boundaries, independent outputs and owned lifetimes remain unchanged. +The full bill has **69,912 paid calls and 12,814 productive fields**. + +Read [the proof](PROOF.md), [the five-site constructor](construct.py), +[the full receipt](RESULT.json), [the emitted word](WORD.json.gz), and +[the exact source pins](SOURCES.json). The raw crossing and remaining headroom +are recorded in the receipt. No global optimum is claimed. + +This is a focused successor to the released PR5544 at +`e2a6cce2f9db5a2c5f9714f4b9e5292dd3a10581`. Its original commit remains the +parent. The predecessor package is unchanged and is required for replay. +The research started at canonical main +`32890bc5de034ab8fc93ac88ead7279a6a416d04`, priority revision 7. + +## Replay and evidence + +Python 3.12 and the standard library suffice: + +```sh +python3 -B scripts/research_package.py --package research/p104-full-frame-contact +``` + +The scientific marker is `PASS_P104_CONTACT_COMPLETE_KAPPA_00304117`. +The normal and optimized commands reconstruct the source, apply the literal +change, check all 552,049 public/owned coefficients by two interpreters, check +all native maps and target phases, replay the complete physical caller and +compute both full histograms. Two rational moment engines, all compiler and +stock bounds, and all 54 strict plus four functional outer predicates run. +Controls reject a one-sided move, wrong sign, undeclared source read and +omitted cost. Saved compressed words are compared by decompressed JSON. + +[VALIDATION.md](VALIDATION.md) records the checks actually run and their limits. +The standard signed-invoice preflight is also recorded there. The first +search was a bounded common-contact descent on the exact source; the final +constructor contains only the one verified replacement, not that search. + +The five native all-column, owned-erasure, compiler, precision/tape and +analytic-recovery assumptions of PR5544 remain. The enormous uniform word and +complete rounded multiplier are not materialized. No independent human or +proof-kernel acceptance is claimed. The source libraries are inherited, +although their candidate checks run again. + +## Open next questions + +Independent review should check the five edited sites, source-read intervals, +all-width chart identity and complete cost join. Start with the literal +constructor and the before/after invoices. Human or proof-kernel acceptance +is still absent. A later cost improvement must change a paid path or target +contract and pass the same full checks; more digits of this crossing are not +another structural gain. See [TASK.json](TASK.json) for the structured handoff. + +## Credit + +Ali Romman's [PR5544](https://github.com/CrocSwap/integer-mult-bounds/pull/5544) +supplies the productive caller, two scalar interpreters and full price engine. +Gareth Davidson (@bitplane) supplied +[PR2305](https://github.com/CrocSwap/integer-mult-bounds/pull/2305), which joins +David Arias's (@DavidAriasC) +[PR2152](https://github.com/CrocSwap/integer-mult-bounds/pull/2152) coalesced word +and Cinna Davis's (@1337isnot1337) +[PR2219](https://github.com/CrocSwap/integer-mult-bounds/pull/2219) private reuse. +The retained [shared-chart retiming](../p104-shared-chart-retiming/README.md) +and [dual-ADD retiming](../p104-dual-add-retiming/README.md) already give the +two-operand transport method. This package claims the new source contact and +its complete conditional endpoint, not that general identity. + +Retain Jacob Alan Sussman, Cinna Davis, zxv, Cao Yifan and all geometry, +scalar, native, COPY, compiler, precision and analytic authors in the +[predecessor proof](../p104-productive-controller/PROOF.md) and +[native notices](../p104-native-channel/notices). +Prepared by Ali Romman with substantial OpenAI Codex assistance; no subagents. +New work is Apache-2.0. diff --git a/research/p104-full-frame-contact/RESULT.json b/research/p104-full-frame-contact/RESULT.json new file mode 100644 index 0000000000..a4daa8e3f1 --- /dev/null +++ b/research/p104-full-frame-contact/RESULT.json @@ -0,0 +1,326 @@ +{ + "complete_cost": { + "compiler": { + "H": 337848000000000, + "N": "2^337848000000000", + "eta": { + "lower": "0.000000185282065079605829383859", + "upper": "0.000000185282065079605829383860" + }, + "gap": "1/7000000000", + "integer_test_exponent": 48264, + "logarithm_power": 1000, + "theta": "63/64", + "uniform_saving": "5322049/1750000000", + "word_materialized": false + }, + "full_forward_calls": 18, + "gain": "3/5000000", + "kappa": "304117/100000000", + "kappa_decimal": ".00304117", + "margin_at_previous": { + "lower": "0.149437868133364955605863720182", + "upper": "0.149437868133364955605863720183" + }, + "negative_controls": { + "old_BIT": "Rejected by outer inequalities", + "old_cutoff": "Rejected by completion-tail ratio greater than one" + }, + "nonrecursive": { + "fixed_scalar_growth_bound": "At most 2^(16*26000) before native factors; a declared constant, not an attained norm.", + "local_routes": 5334000, + "local_scalar": 217428, + "peak_owned_fields": 1, + "raw_budget": 1000000000, + "raw_scalar_upper": 184647552, + "tensor_native_growth_bound": "Each rank-r Gaussian has row l1 norm at most 2^(rf); sum of local ranks is 5894." + }, + "ordinary_BIT": { + "admitted": "17/5000", + "after_cover": "69/20000", + "atom": "1/250", + "before_cover": "3459/1000000", + "ordinary_saving": "8590884599/2500000000000", + "prime_rule": "odd q > 2^26*N^5 avoiding all fixed denominators and rank witnesses" + }, + "outer": { + "functional_checks": { + "actual_new_BIT_stock_sublinear": "1742999999253/1750000000000", + "fixed_halo_explicit_metadata_branch": "134750000001/1750000000", + "new_BIT_row_stock_sublinear_in_active_group": "6978999997009/7000000000000", + "new_semantic_group_guard": "3/7000000000" + }, + "margins": { + "boundary_algebraic_matrix": "149017357978711807/49000000000000000000", + "fused_gaussian": "149017357936135421/49000000000000000000", + "global_coordinate_router": "10644097/3500000000", + "group_bit_router": "74508682468067709/24500000000000000000", + "group_scans": "3499999999/3500000000", + "main_transform": "149017350978711807/49000000000000000000", + "microbox_face_corrections": "134750000001/1750000000", + "polynomial_products": "6999999999/7000000000", + "sparse_union_movement": "20055267357978711807/49000000000000000000" + }, + "parameters": { + "a": "10644097/3500000000", + "b": "4257639/1400000000", + "beta": "6999999997/7000000000", + "bit_saving": "17/5000", + "cap_xi": "44555267350978711807/49000000000000000000", + "complex_uniform_saving": "5322049/1750000000", + "d": "1/7000000000", + "epsilon": "6999999999/7000000000", + "kappa": "304117/100000000", + "lambda_": "1993917659/2000000000", + "lambda_prime": "6978711807/7000000000", + "layout": "1/7000000000", + "q": "21288193/7000000000", + "r0": "1/70000000000", + "stop": "1/7000000000", + "tested_saving": "3041171/1000000000" + }, + "strict_checks": { + "actual_bit_above_effective": "1255903/3500000000", + "actual_logarithmic_gamma_guard": "1/7000000000", + "actual_logarithmic_group_guard": "4444732659521288193/24500000000000000000", + "alpha_logarithm_absorption": "1/70000000000", + "boundary_algebraic_matrix_above_kappa": "27978711807/49000000000000000000", + "cap_above_band": "20055267350978711807/49000000000000000000", + "cap_below_cell": "4444732642021288193/49000000000000000000", + "cap_below_phase_cell_power": "53444732649021288193/49000000000000000000", + "complex_above_effective": "1/7000000000", + "complex_below_one_over_32": "39492361/1400000000", + "complex_endpoint": "1/3500000000", + "epsilon_below_one": "1/7000000000", + "epsilon_positive": "6999999999/7000000000", + "fine_prime_halo_umbrella": "7/2", + "fused_gaussian_above_kappa": "27936135421/49000000000000000000", + "gaussian_above_main": "3478711807/24500000000000000000", + "global_coordinate_router_above_kappa": "1/1750000000", + "global_gamma_power_slack": "9/70000000000", + "group_below_dimension": "1/3500000000", + "group_bit_router_above_kappa": "17468067709/24500000000000000000", + "group_gauge_power_slack": "4444732659171288193/24500000000000000000", + "group_key_fits_record": "1/3500000000", + "group_positive": "6999999997/7000000000", + "group_scans_above_kappa": "27260593/27343750", + "halo_covers_generic_inverse_radius": "5", + "improvement_over_user_baseline": "655099790400418148631/500000000000000000000000", + "lambda_above_internal": "1/14000000000", + "lambda_above_sigma": "3/14000000000", + "lambda_above_tau": "1/14000000000", + "lambda_prime_above_lambda": "1/14000000000", + "lambda_prime_above_leaf": "2795742361/9800000000000000000", + "leaf_saving_above_effective": "1395742361/9800000000000000000", + "main_transform_above_kappa": "20978711807/49000000000000000000", + "membership_arithmetic_fits_record": "1/7000000000", + "microbox_face_corrections_above_kappa": "269489355907/3500000000", + "microbox_halo_volume": "553000000003/7000000000", + "new_complex_uniform_saving_above_b": "1/7000000000", + "new_semantic_guard_with_C1_one": "1/7000000000", + "polynomial_products_above_kappa": "6978711809/7000000000", + "positive_layout_slack": "1/7000000000", + "q_below_effective": "1/7000000000", + "q_below_internal": "1/7000000000", + "q_below_leaf": "2795742361/9800000000000000000", + "q_positive": "21288193/7000000000", + "short_record_fallback": "1395742361/1400000000", + "source_axis_superpolynomial": "1/7000000000", + "sparse_union_movement_above_kappa": "19906250027978711807/49000000000000000000", + "stop_below_one": "6999999999/7000000000", + "stop_positive": "1/7000000000", + "strassen_integer_power_gap": "1951441519231", + "support_router_span": "3/7000000000", + "theta_positive_polynomial_power": "2", + "union_header_fits_record": "3/7000000000", + "union_tag_work_per_visit_fits_record": "3/7000000000" + } + }, + "paid": { + "1": 45264, + "16": 416, + "2": 10026, + "24": 416, + "3": 7002, + "32": 416, + "4": 2016, + "40": 416, + "48": 416, + "5": 1926, + "56": 416, + "6": 306, + "64": 416, + "7": 234, + "72": 208, + "9": 18 + }, + "paid_calls": 69912, + "previous_open_pr5544": "304057/100000000", + "productive_fields": 12814, + "query_shears": 15, + "rank_mass_surplus": 760, + "raw_headroom": [ + "181649/100000000000000", + "3633/2000000000000" + ], + "raw_root_interval": [ + "304117181649/100000000000000", + "6082343633/2000000000000" + ], + "relative_gain_percent": "6000/304057", + "strictification": { + "alpha": { + "lower": "0.999999999145880726810628283573", + "upper": "0.999999999145880726810628283574" + }, + "cutoff": 17, + "delta": { + "lower": "0.963355080494670721016731077055", + "upper": "0.963355080494670721016731077056" + }, + "floor": 18, + "gamma": { + "lower": "0.965211488800306029729343582168", + "upper": "0.965211488800306029729343582169" + }, + "normalized_paid_upper": "5242880004882813/5242880536870912", + "power": 1024, + "reserve": "1/10000000000", + "tail_offset": "1/5", + "tested": "3041171/1000000000" + }, + "targets": { + "145": 208, + "17": 416, + "25": 416, + "33": 416, + "4": 918, + "41": 416, + "49": 416, + "5": 648, + "57": 416, + "65": 416, + "7": 432, + "73": 208, + "8": 2196, + "9": 5292 + }, + "whole_idle_jobs": 3120 + }, + "complete_paid_delta": { + "1": -18, + "5": -18, + "6": 18 + }, + "limits": [ + "The five framework assumptions of PR5544 remain.", + "The uniform compiler word and complete rounded multiplier are not materialized.", + "No independent human or proof-kernel acceptance is claimed." + ], + "local": { + "endpoint_coefficients": 552049, + "helpers": { + "4": 51, + "5": 36, + "7": 24, + "8": 122, + "9": 294 + }, + "owned_lifetimes": 8, + "paid": { + "1": 2428, + "2": 557, + "3": 389, + "4": 112, + "5": 107, + "6": 17, + "7": 13, + "9": 1 + }, + "peak_owned_fields": 1, + "public_inputs": 735, + "real_scalar_allowance": 217428 + }, + "local_paid_delta": { + "1": -1, + "5": -1, + "6": 1 + }, + "native": { + "distinct_maps": 2981, + "helper_normalizers": 1054, + "helpers": { + "4": 51, + "5": 36, + "7": 24, + "8": 122, + "9": 294 + }, + "main_adapters": 208, + "proof": "Every signed Pauli image and exact global phase; frame induction at every positive tensor width", + "recipe_payload_sha256": "5901f62355998c69803fb961c5b0d20415f7006880b2cefbb4a57fbdb982d9a4", + "wrong_phase_rejected": true + }, + "negative_controls": { + "intervening_source_read": "No intervening read or write", + "missing_central_translation": "Rejected by the complete Laurent endpoint", + "one_operand_only": "Common scalar chart", + "uncharged_call": "Complete field and call counts", + "wrong_contact_sign": "All 743 public and owned rows" + }, + "physical_caller": { + "central_square_columns": 53248, + "full_calls": 18, + "main_targets": { + "145": 208, + "17": 416, + "25": 416, + "33": 416, + "41": 416, + "49": 416, + "57": 416, + "65": 416, + "73": 208 + }, + "new_paid_jobs": 0, + "physical_contacts": 7488, + "ports": 104, + "route_payload_sha256": "7f4f0ca768ffbc4f93dcff575592c4c67411f46b4289e45b73f715a2ad47b142", + "tensor_rule": "Factorwise native maps; scalar signs stay outside the tensor power.", + "whole_idle_jobs": { + "16": 416, + "24": 416, + "32": 416, + "40": 416, + "48": 416, + "56": 416, + "64": 416, + "72": 208 + }, + "wrapper_sites": [ + 1, + 3, + 5, + 7, + 9, + 11, + 13, + 15, + 17, + 19, + 21, + 23, + 25, + 27, + 29, + 31 + ] + }, + "separate_columns": { + "arithmetic": "Dense integer rows with binary denominators; reverse chronology", + "coefficients": 552049, + "columns": 743 + }, + "source_inputs_authenticated": 22, + "status": "PASS_P104_CONTACT_COMPLETE_KAPPA_00304117" +} diff --git a/research/p104-full-frame-contact/SOURCES.json b/research/p104-full-frame-contact/SOURCES.json new file mode 100644 index 0000000000..5c136e714d --- /dev/null +++ b/research/p104-full-frame-contact/SOURCES.json @@ -0,0 +1,150 @@ +{ + "schema_version": 1, + "base_commit": "e2a6cce2f9db5a2c5f9714f4b9e5292dd3a10581", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "fc3d4ba105e1f097d0d7d051a308281e86ab1446", + "sha256": "66974efdced4083c00025f97d95d83909a226cdf801edb9301c195c6641f6903" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "f126dd2e2dad2b669e75d1d0d0bd05c600725602", + "sha256": "f7a48bfa2659b88378282a8eee7d9fe52cdf505594124c4d1686b58510fffd72" + }, + { + "path": "research/p104-productive-controller/CONTROLLER.json", + "usage": "input", + "git_blob": "cc539db709cf7a6c42872c4380902736ad453af3", + "sha256": "a84f6bbd547379597464e56c420cc665f96bc43a9a1351eed4b7cd0fce3cc4b9" + }, + { + "path": "research/p104-productive-controller/RESULT.json", + "usage": "input", + "git_blob": "5637130d4a3884948eda39c185e3b6e8f4b4717b", + "sha256": "03e9f8424b9166899d3ae3b188d9defb851162a3183ecab237fb783d78216782" + }, + { + "path": "research/p104-productive-controller/WORD.json.gz", + "usage": "input", + "git_blob": "70f954b346dcf5ee27d394f74d0804731deafd86", + "sha256": "e5e955d7c9d5ea5dfea49c0e093037df577aa43813dcad5427ebca41a4ad35ec" + }, + { + "path": "research/p104-productive-controller/caller.py", + "usage": "input", + "git_blob": "6ac5e735691555ecafe2afbcff71edd923178113", + "sha256": "300d40043953e4f6aecfde8f2d1004b8ad6dc5a79ec3c7666c9908c2466c91c8" + }, + { + "path": "research/p104-productive-controller/local.py", + "usage": "input", + "git_blob": "dbb3d56a4f5b733bb0c32a91249d1f6a7e1ab5d2", + "sha256": "878734dfd64c4b9d362d0ae476cc5c2a19fe93e48b7378763b23f3e0dd0a5a71" + }, + { + "path": "research/p104-productive-controller/price.py", + "usage": "input", + "git_blob": "6c856e173c58f2f201064a88745bb80052cd3875", + "sha256": "e46c1264c4acb037bae4df36ccdf3386980ef3d178aa7f0607dbd3f3333ed139" + }, + { + "path": "research/p104-coalesced-private-reuse/compose.py", + "usage": "input", + "git_blob": "402e0ff402bc9822288e1bf069f0b5712069c11e", + "sha256": "9ac1c0e5ac26ed98976148ef9fd73ee58533533f9581c701deaf26ced899ae9e" + }, + { + "path": "research/p104-coalesced-private-reuse/predecessor2152.tar.gz", + "usage": "input", + "git_blob": "cc1a5cb5735ee489388004c27b709a825faf59d1", + "sha256": "67867369c99212184c13d75369811ea928c89dca0e004287a9dcf0b2c93bcdb8" + }, + { + "path": "research/complex-block-rank-optimum/inputs/selected.json.gz", + "usage": "input", + "git_blob": "5f9ef680983b0b63a4c82a4ed909837b78e690cd", + "sha256": "16bc0ebb04b4be6c0ade74badc6a0c0cdba4215eda86e4ff9f13abf8ecebd219" + }, + { + "path": "research/frame-sa504/inputs/hamming/PROTOTYPE.json", + "usage": "input", + "git_blob": "9efe30ee107b9c67f15f1c726e1a1cb5cef03929", + "sha256": "327d2a868043e846381aa58a33053c24425e8cad522ff401b10ec8af1d649a3f" + }, + { + "path": "research/p104-native-channel/inputs/P104-FIXTURE.json", + "usage": "input", + "git_blob": "2e16f99b295bb386fd13bd8fbd57b42ef54143a9", + "sha256": "516c06f6ec3cb84be588c546108de897650288576dd5fbf5fe44b9c5546ad8a4" + }, + { + "path": "research/p104-native-channel/vendor/clifford_exact.py", + "usage": "input", + "git_blob": "166841a037f069249f6f7f6dedb89248812f59e2", + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962" + }, + { + "path": "research/p104-native-channel/vendor/native_verify.py", + "usage": "input", + "git_blob": "2c209dfa9cfade3bc20ac5fc9d876b433a147f8c", + "sha256": "3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38" + }, + { + "path": "research/kappa-0023-productive-jobs/dependencies/kappa-next-regime/direct-decoder/sources/DATA-PHASES.json", + "usage": "input", + "git_blob": "d9a4f84211182ca200c081ea061d724c8a2cfb70", + "sha256": "c5916ff312678f12aba403847643fbbc29f643acec60bdf836fa56cd3e8251fa" + }, + { + "path": "research/joint-helper-lattice/CONTROLLER.json", + "usage": "input", + "git_blob": "49a2f0675819f9deeea27ed77be2c2b6ff2e87e5", + "sha256": "1f5d6aa267e4e66048818714b5d3b5eae17a58abe91d15deeaa34574f7391a5f" + }, + { + "path": "research/higher-moment-strictification/verify.py", + "usage": "input", + "git_blob": "4b24a5096154736ce060474eb8c72dc64c303699", + "sha256": "0ce7e7137422d5ffeda22085c81fa88471bbe963100fdad62e659f1e3bf89326" + }, + { + "path": "research/kappa-rebuild/architecture/mixed_target_probe.py", + "usage": "input", + "git_blob": "4fc05ab08138218ba9f09e5c89b649afae7c914e", + "sha256": "011c3c9d0cf81103dc84d709a0e36793eb7c5ae3f23c85eac27650ef13afa04a" + }, + { + "path": "research/pr4359-p7-padding/dependencies/compiler-refill/endpoint.py", + "usage": "input", + "git_blob": "340e1f0ffb8a1a9c38fbbd9119580b6d23e01b59", + "sha256": "d097e55f06c3f244f2074ffd7c1a0a5f3c4b4b6a6accf9619d1dde5c0ae85e15" + }, + { + "path": "research/query-thinned-controllers/RESULT.json", + "usage": "input", + "git_blob": "e0695152c98d727edfd0d2034b58a1c7e8682c0c", + "sha256": "6ebfc8c0f09166f4834e9d7427410cb31aefff2cd4d4ce588c8e52c9c70e9a0f" + }, + { + "path": "research/pr4359-p7-padding/native_inventory.py", + "usage": "input", + "git_blob": "8d2d96e3998254c2333c43fe47cdfd074cbd811e", + "sha256": "65539acaf45bdfe8c5aee6830f9c9b3d1107c442a60842ef803fdd7688de8f32" + }, + { + "path": "research/p104-coalesced-private-reuse/RESULT.json", + "usage": "input", + "git_blob": "f4cb528c2cc413f34e2ac83c42225c7a1cf11bd3", + "sha256": "580adb3de7037acc6f7e41cc186e8a210463afaa696d57892643d55acd0040c8" + }, + { + "path": "research/p104-coalesced-private-reuse/SOURCES.json", + "usage": "input", + "git_blob": "58f245e194b794b7bacd8ea88f9814d373ed91c3", + "sha256": "232fc3ca3928acc704333def0b8391f94a8e8736ef045c1b5de5b396be37cdc2" + } + ] +} diff --git a/research/p104-full-frame-contact/TASK.json b/research/p104-full-frame-contact/TASK.json new file mode 100644 index 0000000000..c917d3fc0c --- /dev/null +++ b/research/p104-full-frame-contact/TASK.json @@ -0,0 +1,106 @@ +{ + "schema_version": 1, + "task_id": "scalar-to-moment", + "priority_revision": 7, + "base_commit": "e2a6cce2f9db5a2c5f9714f4b9e5292dd3a10581", + "original_card": { + "id": "scalar-to-moment", + "question": "Can a changed frame itinerary remove a paid transition beyond the already covered scalar A2 contractions?", + "starting_points": [ + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "research/staged544-a2-graph-rewrite/README.md", + "research/staged544-separated-a2/README.md", + "research/staged544-a2-composition-audit/README.md", + "research/staged544-a1858-contraction-audit/README.md" + ], + "methods": [ + "Derive the changed legal frame itinerary and exact child histogram.", + "Prove a scoped obstruction showing why that scalar gain cannot change the paid contract." + ], + "acceptance_gate": "An unchanged histogram is not a kappa gain; record any separate runtime or proof benefit explicitly.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read the A2 and separated-A2 constructions and their composition/contraction audits. Scalar contractions can preserve the complete recursive histogram; fewer ADDs alone do not justify further scans.", + "scope": "Source-binding orientation only; no scientific replay, theorem acceptance or supplier admission. Budget any heavy replay separately." + }, + "first_experiment": "Identify an actual paid transition to remove and construct a legal replacement frame itinerary, charging restoration, source windows and changed helpers. Compare complete before/after histograms. Stop if only scalar count changes; report that benefit honestly, without expanding the same scalar-only census.", + "bottleneck_link": "A legal change to the histogram, not addition count alone, is the bridge to an exponent gain.", + "allowed_variations": [ + "One existing scalar simplification and one proposed frame-path change." + ], + "scope_change_triggers": [ + "Submitting only another scalar count as completion of a paid-profile task." + ], + "overlap_terms": [ + "scalar simplification", + "paid profile", + "R439", + "3998", + "4019", + "4112", + "4152", + "staged544-a2-graph-rewrite", + "staged544-separated-a2", + "staged544-a2-composition-audit", + "staged544-a1858-contraction-audit" + ], + "existing_checks": [ + { + "scope": "PR #3998: consecutive A2 scalar contraction", + "evidence": "research/staged544-a2-graph-rewrite/README.md", + "remaining": "A genuinely changed paid itinerary or a distinct independent audit; no default scalar-only expansion.", + "status": "author-checked", + "source_commit": "389268a6b5e0373a3125d5c6fcd6995f4ea324f5", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4019: separated A2 sites with unchanged recursive histogram", + "evidence": "research/staged544-separated-a2/README.md", + "remaining": "A genuinely changed paid itinerary or a distinct independent audit; no default scalar-only expansion.", + "status": "author-checked", + "source_commit": "f408e09df300b575235f7f77f81948071397e16d", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4112: composition audit", + "evidence": "research/staged544-a2-composition-audit/README.md", + "remaining": "A genuinely changed paid itinerary or a distinct independent audit; no default scalar-only expansion.", + "status": "author-checked", + "source_commit": "205b7380656ba4b6316a8a493b1a3c679b8f7a0e", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4152: A1858 contraction audit", + "evidence": "research/staged544-a1858-contraction-audit/README.md", + "remaining": "A genuinely changed paid itinerary or a distinct independent audit; no default scalar-only expansion.", + "status": "author-checked", + "source_commit": "caaa14cde5962adc372fdca71f63d0f29e73c8b2", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + } + ] + }, + "scope_status": "refined", + "actual_scope": "Retime the register341/register345 P104 contact from the four-plane to the full frame, and certify a complete conditional kappa gain over PR5544.", + "scope_change_reason": "The donor requires a kappa gain. PR5544 released a new P104 productive caller during this investigation. The previous native-word and helper-boundary screens found no gain. This card classifies the resulting source-bound paid-path change; no task was rerolled.", + "bottleneck_link": "The exact local change -H1-H5+H6 reduces the complete paid moment at all 18 FULL sites with every productive target retained.", + "budget_minutes": null, + "stop_rule": "Accept only an exact arbitrary-input native replacement and a fully funded complete kappa above PR5544; otherwise release the finite candidate.", + "outcome": "completed", + "evidence": "See RESULT.json, PROOF.md and VALIDATION.md for executed checks and inherited assumptions.", + "author": "Ali Romman with OpenAI Codex assistance", + "ai_assistance": "Substantial OpenAI Codex assistance; no subagents.", + "open_questions": [ + { + "question": "Can an independent reviewer accept the exact contact replacement and its complete conditional funding?", + "why_it_matters": "All checks here are author-side; source libraries and the five framework assumptions remain inherited.", + "first_step": "Check the five source sites and read intervals, then replay the native endpoint and both complete moment engines.", + "blocked_by": "No technical dependency is missing; independent scientific review remains pending." + } + ] +} diff --git a/research/p104-full-frame-contact/VALIDATION.md b/research/p104-full-frame-contact/VALIDATION.md new file mode 100644 index 0000000000..f3237c2334 --- /dev/null +++ b/research/p104-full-frame-contact/VALIDATION.md @@ -0,0 +1,81 @@ +# Validation record + +Scientific base: canonical main +`32890bc5de034ab8fc93ac88ead7279a6a416d04`. +Immediate immutable predecessor: PR5544, +`e2a6cce2f9db5a2c5f9714f4b9e5292dd3a10581`. +Environment: macOS, bundled CPython 3.12.14, standard library only. +All scientific checks run serially in the isolated contribution worktree. + +The first full authoring replay passed with `--write`. It generated the new +receipt and word after all endpoint, native, caller and pricing checks. +The registered normal and optimized comparisons both passed. Each printed +`PASS_P104_CONTACT_COMPLETE_KAPPA_00304117`. The runner printed +`PASS_REGISTERED_RESEARCH_PACKAGE outcome=completed`. + +```sh +python3 -B scripts/research_package.py --package research/p104-full-frame-contact +python3 -B scripts/research_package.py --package research/p104-full-frame-contact --check-only +python3 -B scripts/check_research_commit.py --package research/p104-full-frame-contact +``` + +The source and candidate both pass the exact sparse rational endpoint. +The candidate also passes the separate dense integer transpose interpreter: +743 columns and 552,049 coefficients. All source inputs, all 527 helper +outputs and all eight owned lifetimes remain included. Native checks cover +2,981 distinct paid/helper maps, 208 main adapters, every helper normalizer, +7,488 caller boundary contacts and all main and idle target phases. + +Both rational moment engines pass. The full invoice has 69,912 paid jobs, +12,814 productive fields and rank surplus 760. Compiler height +`337848000000000`, the preceding failing grid point, all tail and capacity +conditions, ordinary BIT stock, and all 54 strict plus four functional outer +predicates pass. The one-sided move, wrong sign, undeclared source read, +missing paid charge, missing central translation and native phase controls +reject. The old cutoff and insufficient BIT controls also reject. + +The shared comparator read the complete before/after histograms extracted +from both `RESULT.json` files. With the same rank and caller contract, +`scripts/compare_recursive_invoices.py` reports `uniformly_better`. +The exact signed delta is `{1:-18,5:-18,6:18}`; targets are unchanged. +Its hinge values at ranks 0, 1, 5 and 6 are 0, -18, -18 and 0. Paid and +target rank masses are 239108 and 239868 in both constructions. This is a +separate integer arithmetic check, not a source or physical proof by itself. + +The earlier source PR5544 also passed its own +[hosted replay](https://github.com/CrocSwap/integer-mult-bounds/actions/runs/40177474279) +at the pinned head. That run does not test this new change. + +Publication checks: registered normal and optimized replay, metadata/pins +and whitespace checks passed. The committed-byte check passed for all 33 +package and declared input files at scientific commit +`bea205d91409506c794ababd81454ca42450d5d2`. The committed export and its +separate integrity check passed. + +The export then passed an optimized replay in a fresh directory without Git. +The environment had an empty PATH and no inherited Python or Git variables. +All exported files were read-only. The command used the absolute Python path +with `-I -O -B research/p104-full-frame-contact/verify.py`. It finished in +72.75 seconds. All 34 files, including the export manifest, kept the same +bytes and modes. A separate altered-source control failed at authentication +before source imports, with no scientific output. + +The fixed-invoice decomposition in PROOF.md was checked against the complete +saved histograms. Exact rational division also checked the stated fraction +of the crossing attained by the endpoint. This is a bound for this invoice, +not the historical fixed-rank packing model or other constructions. + +The optional full source-history preflight was attempted. It stopped because +this checkout is shallow, so no full-history pass is claimed. Direct Git +ancestry checks passed for canonical main and the immediate predecessor. +All declared source bytes and Git blob identities passed authentication and +the Git-free replay. Hosted status for this contribution is separate from +local validation. + +The five inherited framework assumptions remain. Independent human review, +formal-kernel verification, the enormous uniform compiler word and the full +rounded multiplier are not supplied. No selected-frontier or shared-source +file is changed. The predecessor commit is retained for a reproducible stack; +only this package is new in the successor commit. + +Prepared by Ali Romman with substantial OpenAI Codex assistance. Apache-2.0. diff --git a/research/p104-full-frame-contact/VERIFY.json b/research/p104-full-frame-contact/VERIFY.json new file mode 100644 index 0000000000..e6d663d6fd --- /dev/null +++ b/research/p104-full-frame-contact/VERIFY.json @@ -0,0 +1,51 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/p104-productive-controller/CONTROLLER.json", + "research/p104-productive-controller/RESULT.json", + "research/p104-productive-controller/WORD.json.gz", + "research/p104-productive-controller/caller.py", + "research/p104-productive-controller/local.py", + "research/p104-productive-controller/price.py", + "research/p104-coalesced-private-reuse/compose.py", + "research/p104-coalesced-private-reuse/predecessor2152.tar.gz", + "research/complex-block-rank-optimum/inputs/selected.json.gz", + "research/frame-sa504/inputs/hamming/PROTOTYPE.json", + "research/p104-native-channel/inputs/P104-FIXTURE.json", + "research/p104-native-channel/vendor/clifford_exact.py", + "research/p104-native-channel/vendor/native_verify.py", + "research/kappa-0023-productive-jobs/dependencies/kappa-next-regime/direct-decoder/sources/DATA-PHASES.json", + "research/joint-helper-lattice/CONTROLLER.json", + "research/higher-moment-strictification/verify.py", + "research/kappa-rebuild/architecture/mixed_target_probe.py", + "research/pr4359-p7-padding/dependencies/compiler-refill/endpoint.py", + "research/query-thinned-controllers/RESULT.json", + "research/pr4359-p7-padding/native_inventory.py", + "research/p104-coalesced-private-reuse/RESULT.json", + "research/p104-coalesced-private-reuse/SOURCES.json" + ], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 600, + "checks": "Verify the exact two-register retiming, complete scalar and native endpoints, productive caller, changed full invoice, two moment engines, compiler, BIT and all outer predicates. Reject one-sided transport, wrong sign, undeclared read and undercharged cost." + }, + { + "argv": [ + "{python}", + "-O", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 600, + "checks": "Verify the exact two-register retiming, complete scalar and native endpoints, productive caller, changed full invoice, two moment engines, compiler, BIT and all outer predicates. Reject one-sided transport, wrong sign, undeclared read and undercharged cost." + } + ] +} diff --git a/research/p104-full-frame-contact/WORD.json.gz b/research/p104-full-frame-contact/WORD.json.gz new file mode 100644 index 0000000000..1ce96b0130 Binary files /dev/null and b/research/p104-full-frame-contact/WORD.json.gz differ diff --git a/research/p104-full-frame-contact/construct.py b/research/p104-full-frame-contact/construct.py new file mode 100644 index 0000000000..416e5f5845 --- /dev/null +++ b/research/p104-full-frame-contact/construct.py @@ -0,0 +1,48 @@ +"""Move one P104 contact to the full frame. + +The two-operand transport identity is standard. The source is PR5544, +PR2305, David Arias's coalesced word and Cinna Davis's private reuse. +Ali Romman with OpenAI Codex assistance. Apache-2.0. +""" +from copy import deepcopy +import local as L + + +def construct(source): + word = deepcopy(source) + old = source['program'] + expected = { + 16798: ['MOVE', 345, 739, 240, False], + 16799: ['ADD', 341, 345, '-1', 240], + 16800: ['SCALE', 341, '-1', 240], + 17061: ['MOVE', 341, 240, 127, False], + 17067: ['MOVE', 345, 240, 127, False], + } + L.need(all(old[i] == e for i,e in expected.items()), 'Exact source contact') + L.need(source['frames'][739] == [30,70,429], 'Source three-plane') + L.need(source['frames'][240] == [13,19,70,416], 'Source four-plane') + L.need(source['frames'][127] == [1,2,4,8,16,32,64,128,256], 'Full frame') + for role, end in ((341,17061),(345,17067)): + touched = [] + for i in range(16798,end): + e = old[i] + used = e[1:3] if e[0] in ('ADD','COPY') else e[1:2] + if role in used: + touched.append(i) + L.need(touched == ([16799,16800] if role == 341 else [16798,16799]), + 'No intervening read or write') + replacement = { + 16798: [['MOVE',341,240,127,False], ['MOVE',345,739,127,False]], + 16799: [['ADD',341,345,'-1',127]], + 16800: [['SCALE',341,'-1',127]], + 17061: [], + 17067: [], + } + word['program'] = [e for i,old_event in enumerate(old) + for e in replacement.get(i,[deepcopy(old_event)])] + # Scalar coefficients and their order are equal in both words. + def scalars(program): + return [e[:-1] for e in program if e[0] != 'MOVE'] + L.need(scalars(word['program']) == scalars(old), 'Same scalar and owned word') + L.need(len(word['program']) == len(old)-1 == 25310, 'One fewer paid event') + return word diff --git a/research/p104-full-frame-contact/pricing.py b/research/p104-full-frame-contact/pricing.py new file mode 100644 index 0000000000..c88c425a2f --- /dev/null +++ b/research/p104-full-frame-contact/pricing.py @@ -0,0 +1,154 @@ +"""Complete mixed-target price, compiler and outer transfer. + +The interval and compiler bounds follow zxv and Cao Yifan. The productive +recursion is by Jacob Alan Sussman. The controller is by Cinna Davis. +Adapted from PR5544 for the H1+H5 to H6 contact change. +Ali Romman with substantial OpenAI Codex assistance. Apache-2.0. +""" +from collections import Counter +from fractions import Fraction as Q +import local as L + +KAPPA, TESTED = Q('.00304117'), Q('.003041171') +PREVIOUS = Q('.00304057') + + +def encode(x): + if isinstance(x,Q): + return str(x) + if isinstance(x,dict): + return {str(k):encode(v) for k,v in x.items()} + if isinstance(x,(list,tuple)): + return [encode(v) for v in x] + return x + + +def assemble(local, native, word, physical): + paid, targets = Counter(), Counter() + counts = Counter() + L.need(local['helpers'] == native['helpers'], 'Every productive helper has a native target') + for e in word['physical_events']: + counts[e[0]] += 1 + if e[0] == 'LOCAL': + L.need(e[3] is False, 'Every source invocation is forward') + paid.update(local['paid']) + targets.update(local['helpers']) + elif e[0] == 'QUERY_SHEAR': + paid[1] += 104 + elif e[0] == 'IDLE': + paid[8*len(e[2])] += 208 + main = Counter() + idle = Counter({8*len(e[2]):0 for e in word['physical_events'] if e[0] == 'IDLE'}) + for e in word['physical_events']: + if e[0] == 'IDLE': + idle[8*len(e[2])] += 208 + L.need(idle == physical['whole_idle_jobs'], 'Every whole idle has a native Gaussian and full rank') + for term in word['diagonal']: + main[1+8*sum(term[1:])] += 104 + L.need(main == physical['main_targets'], 'Every main target has its full native phase') + targets.update(main) + L.need(counts['LOCAL'] == 18 and counts['QUERY_SHEAR'] == counts['IDLE'] == 15, 'Complete call census') + # Recount by the two path lengths, without using emitted main diagonals. + second_t = Counter({r:18*n for r,n in local['helpers'].items()}) + second_p = Counter({r:18*n for r,n in local['paid'].items()}) + second_t[145] += 208 + second_p[1] += 15*104 + for length in (7,8): + for j in range(1,length+1): + second_t[1+8*(j+1)] += 208 + second_p[8*(j+1)] += 208 + L.need((targets,paid) == (second_t,second_p), 'Independent full invoice') + L.need(max(targets) == 145 and max(paid) == 72, 'Maximum recursive ranks') + L.need(sum(targets.values()) == 12814 and sum(paid.values()) == 69912, 'Complete field and call counts') + L.need(sum(r*n for r,n in targets.items())-sum(r*n for r,n in paid.items()) == 760, 'Complete rank surplus') + return targets,paid,counts + + +def run(local,native,word,physical): + T,P,counts = assemble(local,native,word,physical) + E = L.load(L.ROOT/'research/higher-moment-strictification/verify.py','p104_productive_intervals') + other = L.load(L.ROOT/'research/kappa-rebuild/architecture/mixed_target_probe.py','p104_productive_second_intervals') + def margin(k): + a,b = E.moment(T,1-k), E.moment(P,1-k) + return a[0]-b[1],a[1]-b[0] + lo,hi,grid = 0,10**12,10**14 + while hi-lo > 1: + m=(lo+hi)//2 + if margin(Q(m,grid))[0] > 0: + lo=m + else: + hi=m + lower,upper = Q(lo,grid),Q(hi,grid) + L.need(margin(lower)[0] > 0 and margin(upper)[1] < 0, 'Strict rational crossing enclosure') + L.need(PREVIOUS < KAPPA < TESTED < lower and margin(PREVIOUS)[0] > 0, 'Changed complete bill improves selected kappa') + t,u,v,c,b = 1-TESTED,Q(1,5),1024,17,18 + target,paid = E.moment(T,t),E.moment(P,t) + tl,th = other.moment(T,TESTED) + pl,ph = other.moment(P,TESTED) + L.need(tl > ph and max(tl,target[0]) <= min(th,target[1]) and max(pl,paid[0]) <= min(ph,paid[1]), 'Two exact moment engines') + alpha = E.divide(paid,target) + gamma = E.divide(E.moment(P,t+u),E.mul(E.power(c,u),target)) + delta = E.divide((Q(sum(T.values())*b),)*2,E.mul(E.power(c,TESTED),target)) + reserve,decay = Q(1,10**10),Q(97,100) + L.need(alpha[1] < 1-reserve and gamma[1] < decay and delta[1] < decay, 'All three charged tail ratios') + L.need(decay**128 < Q(1,16), 'Both tail decay blocks') + normalized = 1/(1+v*reserve)+Q(4,2**32) + L.need(normalized < 1 and c**64 < b**63, 'Full completion, splitting and rounding charges') + theta,power = Q(63,64),1000 + eta = E.scale(E.power(145,-v*TESTED),t) + L.need(2*(c**v)**64 <= (145**v)**63 and eta[0] > theta**power, 'Shifted exits and complement capacity') + L.need(E.power(145,v*TESTED)[1] < 2**power, 'Compiler initial range') + gap = (TESTED-KAPPA)/7 + L.need(gap.numerator == 1, 'Exact compiler integer grid') + step = gap.denominator + def wins(j): + return (step*j+1)**power < 2**j + left,right=1,2 + while not wins(right): + left,right=right,2*right + while right-left > 1: + m=(left+right)//2 + if wins(m): + right=m + else: + left=m + H=step*right + L.need(H > 8*v and wins(right) and not wins(right-1), 'Finite uniform threshold with predecessor rejection') + local_routes = (sum(local['paid'].values())+native['helper_normalizers']+native['main_adapters']+4*104+4*local['owned_lifetimes'])*1000 + L.need(local['real_scalar_allowance']+local_routes < 10**7, 'Every local scalar, route and owned operation is funded') + boundary = sum(len(word['boundaries'][side+'_program']) for side in ('left','right')) + raw = 18*10**7 + 15*1664 + 32*104*(len(word['physical_events'])+boundary) + raw += 32*104*(26+1000) + L.need(raw < 10**9, 'Complete nonrecursive raw bound') + bit = L.read(L.ROOT/'research/query-thinned-controllers/RESULT.json')['ordinary_BIT'] + atom = Q(bit['atom']) + ordinary=(1-atom)*Q(bit['after_cover'])+atom*Q('.0000384599') + admitted=Q(bit['admitted']) + L.need(atom > ordinary > admitted > TESTED and atom < 1-ordinary, 'Retained BIT admission and stock') + outer_module=L.load(L.ROOT/'research/pr4359-p7-padding/dependencies/compiler-refill/endpoint.py','p104_productive_outer') + params={'kappa':KAPPA,'tested_saving':TESTED,'complex_uniform_saving':KAPPA+6*gap, + 'b':KAPPA+5*gap,'a':KAPPA+4*gap,'q':KAPPA+3*gap,'bit_saving':admitted, + 'epsilon':1-gap,'beta':1-3*gap,'r0':gap/10,'stop':gap,'layout':gap,'d':gap} + outer=outer_module.ledger(params) + outer['functional_checks']['actual_new_BIT_stock_sublinear']=params['beta']*(1-atom) + L.need(len(outer['strict_checks']) == 54 and len(outer['functional_checks']) == 4, 'Complete outer predicate inventory') + L.need(all(x > 0 for key in ('strict_checks','functional_checks') for x in outer[key].values()), 'All outer inequalities strict') + wrong_cutoff = E.divide((Q(sum(T.values())*21),)*2,E.mul(E.power(20,TESTED),target)) + L.need(wrong_cutoff[0] > 1, 'Old cutoff fails with this helper inventory') + bad=outer_module.ledger(dict(params,bit_saving=Q('.0027'))) + L.need(any(x <= 0 for x in bad['strict_checks'].values()), 'Insufficient BIT contract rejected') + return encode({'kappa':KAPPA,'kappa_decimal':'.00304117','previous_open_pr5544':PREVIOUS,'gain':KAPPA-PREVIOUS, + 'relative_gain_percent':100*(KAPPA/PREVIOUS-1),'raw_root_interval':[lower,upper], + 'raw_headroom':[lower-KAPPA,upper-KAPPA],'margin_at_previous':E.display(margin(PREVIOUS)), + 'targets':T,'paid':P,'productive_fields':sum(T.values()),'paid_calls':sum(P.values()), + 'rank_mass_surplus':760,'full_forward_calls':18,'query_shears':15,'whole_idle_jobs':3120, + 'strictification':{'tested':TESTED,'power':v,'cutoff':c,'floor':b,'tail_offset':u,'reserve':reserve, + 'alpha':E.display(alpha),'gamma':E.display(gamma),'delta':E.display(delta),'normalized_paid_upper':normalized}, + 'compiler':{'theta':theta,'logarithm_power':power,'eta':E.display(eta),'gap':gap,'H':H,'N':'2^'+str(H), + 'integer_test_exponent':right,'uniform_saving':params['complex_uniform_saving'],'word_materialized':False}, + 'nonrecursive':{'local_scalar':local['real_scalar_allowance'],'local_routes':local_routes, + 'raw_scalar_upper':raw,'raw_budget':10**9,'peak_owned_fields':1, + 'fixed_scalar_growth_bound':'At most 2^(16*26000) before native factors; a declared constant, not an attained norm.', + 'tensor_native_growth_bound':'Each rank-r Gaussian has row l1 norm at most 2^(rf); sum of local ranks is 5894.'}, + 'ordinary_BIT':bit,'outer':outer, + 'negative_controls':{'old_cutoff':'Rejected by completion-tail ratio greater than one','old_BIT':'Rejected by outer inequalities'}}) diff --git a/research/p104-full-frame-contact/verify.py b/research/p104-full-frame-contact/verify.py new file mode 100644 index 0000000000..fb2d7f1a31 --- /dev/null +++ b/research/p104-full-frame-contact/verify.py @@ -0,0 +1,117 @@ +"""Check the contact, complete native caller and conditional kappa gain. + +Source interpreters and caller are immutable PR5544 dependencies. +Ali Romman with OpenAI Codex assistance. Apache-2.0. +""" +import argparse +from collections import Counter +from copy import deepcopy +from hashlib import sha1, sha256 +import gzip +import json +from pathlib import Path +import sys + +sys.dont_write_bytecode = True +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +SOURCE = ROOT/'research/p104-productive-controller' + + +def need(ok, why): + if not ok: + raise ValueError(why) + + +def authenticate(): + rows = json.loads((HERE/'SOURCES.json').read_bytes())['files'] + count = 0 + for row in rows: + if row['usage'] == 'input': + raw = (ROOT/row['path']).read_bytes() + need(sha256(raw).hexdigest() == row['sha256'], 'Changed source: '+row['path']) + need(sha1(b'blob '+str(len(raw)).encode()+b'\0'+raw).hexdigest() == row['git_blob'], + 'Source Git object: '+row['path']) + count += 1 + return count + + +def rejected(action): + try: + action() + except ValueError as error: + return str(error) + raise ValueError('A semantic control was accepted') + + +def run(): + pins = authenticate() + sys.path[:0] = [str(HERE),str(SOURCE)] + import local as L + import caller as C + import construct as R + import pricing as P + source = L.construct() + need(source == L.read(SOURCE/'WORD.json.gz'), 'Exact reconstructed PR5544 source') + baseline = L.replay(source) + word = R.construct(source) + local = L.replay(word) + columns = L.reverse_columns(word) + need(local['helpers'] == baseline['helpers'], 'All helper targets retained') + delta = Counter(local['paid']) + delta.subtract(baseline['paid']) + need({r:n for r,n in delta.items() if n} == {1:-1,5:-1,6:1}, 'Exact local paid delta') + print('PASS source, scalar endpoint, dense reverse columns and H1+H5 to H6',flush=True) + native = L.native(word) + controller = C.construct() + need(controller == L.read(SOURCE/'CONTROLLER.json'), 'Same literal caller') + physical = C.physical(controller,word) + print('PASS every native map, all productive targets and physical caller',flush=True) + costs = P.run(local,native,controller,physical) + controls = C.controls(controller) + bad = deepcopy(word) + event = next(e for e in bad['program'] if e == ['MOVE',345,739,127,False]) + event[3] = 240 + controls['one_operand_only'] = rejected(lambda:L.replay(bad)) + bad = deepcopy(word) + event = next(e for e in bad['program'] if e == ['ADD',341,345,'-1',127]) + event[3] = '1' + controls['wrong_contact_sign'] = rejected(lambda:L.replay(bad)) + bad = deepcopy(source) + bad['program'][16801] = ['ADD',400,341,'1',240] + controls['intervening_source_read'] = rejected(lambda:R.construct(bad)) + bad = deepcopy(local) + bad['paid'][1] -= 1 + controls['uncharged_call'] = rejected(lambda:P.assemble(bad,native,controller,physical)) + result = {'status':'PASS_P104_CONTACT_COMPLETE_KAPPA_00304117', + 'source_inputs_authenticated':pins,'local_paid_delta':{1:-1,5:-1,6:1}, + 'complete_paid_delta':{1:-18,5:-18,6:18}, + 'local':local,'separate_columns':columns,'native':native, + 'physical_caller':physical,'complete_cost':costs,'negative_controls':controls, + 'limits':['The five framework assumptions of PR5544 remain.', + 'The uniform compiler word and complete rounded multiplier are not materialized.', + 'No independent human or proof-kernel acceptance is claimed.']} + return P.encode(result),word + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--write',action='store_true') + args = parser.parse_args() + result,word = run() + for name,data in (('RESULT.json',result),('WORD.json.gz',word)): + path = HERE/name + if args.write: + raw = (json.dumps(data,sort_keys=True,indent=None if name.endswith('.gz') else 2)+'\n').encode() + path.write_bytes(gzip.compress(raw,mtime=0) if name.endswith('.gz') else raw) + else: + raw = path.read_bytes() + need(json.loads(gzip.decompress(raw) if name.endswith('.gz') else raw) == data, + 'Exact saved artifact: '+name) + print(result['status']) + print(json.dumps({k:result['complete_cost'][k] for k in + ('kappa','gain','raw_root_interval','productive_fields','paid_calls')},sort_keys=True)) + + +if __name__ == '__main__': + main() diff --git a/research/p104-productive-controller/CONTROLLER.json b/research/p104-productive-controller/CONTROLLER.json new file mode 100644 index 0000000000..cc539db709 --- /dev/null +++ b/research/p104-productive-controller/CONTROLLER.json @@ -0,0 +1,5480 @@ +{ + "ambient_rank": 145, + "boundaries": { + "left": [ + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "1", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "1", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "1", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "1", + "0", + "-1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "1", + "0", + "-1", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "1", + "0", + "-1", + "0", + "1", + "0", + "-1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "1", + "0", + "-1", + "0", + "1", + "0", + "-1", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "1", + "0", + "-1", + "0", + "1", + "0", + "-1", + "0", + "1", + "0", + "-1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "1", + "0", + "-1", + "0", + "1", + "0", + "-1", + "0", + "1", + "0", + "-1", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "1", + "0", + "-1", + "0", + "1", + "0", + "-1", + "0", + "1", + "0", + "-1", + "0", + "1", + "0", + "-1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + ], + "left_program": [ + [ + "SWAP", + 30, + 31 + ], + [ + "SWAP", + 29, + 30 + ], + [ + "SWAP", + 28, + 30 + ], + [ + "SWAP", + 27, + 29 + ], + [ + "SWAP", + 26, + 28 + ], + [ + "SWAP", + 25, + 30 + ], + [ + "SWAP", + 24, + 25 + ], + [ + "SWAP", + 23, + 26 + ], + [ + "SWAP", + 22, + 30 + ], + [ + "SWAP", + 20, + 26 + ], + [ + "SWAP", + 19, + 22 + ], + [ + "SWAP", + 18, + 29 + ], + [ + "SWAP", + 17, + 23 + ], + [ + "SWAP", + 16, + 27 + ], + [ + "SCALE", + 15, + "-1" + ], + [ + "SWAP", + 15, + 31 + ], + [ + "ADD", + 12, + 14, + "1" + ], + [ + "ADD", + 10, + 14, + "-1" + ], + [ + "ADD", + 8, + 14, + "1" + ], + [ + "ADD", + 6, + 14, + "-1" + ], + [ + "ADD", + 4, + 14, + "1" + ], + [ + "ADD", + 2, + 14, + "-1" + ], + [ + "ADD", + 0, + 14, + "1" + ], + [ + "SWAP", + 14, + 15 + ], + [ + "ADD", + 31, + 13, + "1" + ], + [ + "SWAP", + 13, + 30 + ], + [ + "ADD", + 10, + 12, + "1" + ], + [ + "ADD", + 8, + 12, + "-1" + ], + [ + "ADD", + 6, + 12, + "1" + ], + [ + "ADD", + 4, + 12, + "-1" + ], + [ + "ADD", + 2, + 12, + "1" + ], + [ + "ADD", + 0, + 12, + "-1" + ], + [ + "SWAP", + 12, + 14 + ], + [ + "ADD", + 31, + 11, + "-1" + ], + [ + "ADD", + 30, + 11, + "-1" + ], + [ + "SCALE", + 11, + "-1" + ], + [ + "SWAP", + 11, + 29 + ], + [ + "ADD", + 8, + 10, + "1" + ], + [ + "ADD", + 6, + 10, + "-1" + ], + [ + "ADD", + 4, + 10, + "1" + ], + [ + "ADD", + 2, + 10, + "-1" + ], + [ + "ADD", + 0, + 10, + "1" + ], + [ + "SWAP", + 10, + 13 + ], + [ + "ADD", + 31, + 9, + "1" + ], + [ + "ADD", + 30, + 9, + "1" + ], + [ + "ADD", + 29, + 9, + "1" + ], + [ + "SWAP", + 9, + 28 + ], + [ + "ADD", + 6, + 8, + "1" + ], + [ + "ADD", + 4, + 8, + "-1" + ], + [ + "ADD", + 2, + 8, + "1" + ], + [ + "ADD", + 0, + 8, + "-1" + ], + [ + "SWAP", + 8, + 12 + ], + [ + "ADD", + 31, + 7, + "-1" + ], + [ + "ADD", + 30, + 7, + "-1" + ], + [ + "ADD", + 29, + 7, + "-1" + ], + [ + "ADD", + 28, + 7, + "-1" + ], + [ + "SCALE", + 7, + "-1" + ], + [ + "SWAP", + 7, + 27 + ], + [ + "ADD", + 4, + 6, + "1" + ], + [ + "ADD", + 2, + 6, + "-1" + ], + [ + "ADD", + 0, + 6, + "1" + ], + [ + "SWAP", + 6, + 11 + ], + [ + "ADD", + 31, + 5, + "1" + ], + [ + "ADD", + 30, + 5, + "1" + ], + [ + "ADD", + 29, + 5, + "1" + ], + [ + "ADD", + 28, + 5, + "1" + ], + [ + "ADD", + 27, + 5, + "1" + ], + [ + "SWAP", + 5, + 26 + ], + [ + "ADD", + 2, + 4, + "1" + ], + [ + "ADD", + 0, + 4, + "-1" + ], + [ + "SWAP", + 4, + 10 + ], + [ + "ADD", + 31, + 3, + "-1" + ], + [ + "ADD", + 30, + 3, + "-1" + ], + [ + "ADD", + 29, + 3, + "-1" + ], + [ + "ADD", + 28, + 3, + "-1" + ], + [ + "ADD", + 27, + 3, + "-1" + ], + [ + "ADD", + 26, + 3, + "-1" + ], + [ + "SCALE", + 3, + "-1" + ], + [ + "SWAP", + 3, + 25 + ], + [ + "ADD", + 0, + 2, + "1" + ], + [ + "SWAP", + 2, + 9 + ], + [ + "ADD", + 31, + 1, + "1" + ], + [ + "ADD", + 30, + 1, + "1" + ], + [ + "ADD", + 29, + 1, + "1" + ], + [ + "ADD", + 28, + 1, + "1" + ], + [ + "ADD", + 27, + 1, + "1" + ], + [ + "ADD", + 26, + 1, + "1" + ], + [ + "ADD", + 25, + 1, + "1" + ], + [ + "SWAP", + 1, + 24 + ], + [ + "SWAP", + 0, + 8 + ] + ], + "right": [ + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "-1", + "1", + "-1", + "1", + "-1", + "1", + "-1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "-1", + "1", + "-1", + "1", + "-1", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "-1", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "-1", + "1", + "-1", + "1", + "-1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "-1", + "1", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "-1", + "1", + "-1", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "-1", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "-1", + "1", + "-1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "-1", + "1", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "-1", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "-1", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "-1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "-1", + "1", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "-1" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + ], + "right_program": [ + [ + "ADD", + 30, + 31, + "-1" + ], + [ + "ADD", + 29, + 31, + "-1" + ], + [ + "ADD", + 28, + 31, + "-1" + ], + [ + "ADD", + 27, + 31, + "-1" + ], + [ + "SCALE", + 31, + "-1" + ], + [ + "ADD", + 31, + 30, + "-1" + ], + [ + "ADD", + 29, + 30, + "-1" + ], + [ + "ADD", + 28, + 30, + "-1" + ], + [ + "ADD", + 27, + 30, + "-1" + ], + [ + "ADD", + 31, + 29, + "-1" + ], + [ + "ADD", + 28, + 29, + "-1" + ], + [ + "ADD", + 27, + 29, + "-1" + ], + [ + "SCALE", + 29, + "-1" + ], + [ + "ADD", + 31, + 28, + "-1" + ], + [ + "ADD", + 27, + 28, + "-1" + ], + [ + "SWAP", + 28, + 29 + ], + [ + "ADD", + 31, + 27, + "-1" + ], + [ + "SCALE", + 27, + "-1" + ], + [ + "SWAP", + 27, + 29 + ], + [ + "ADD", + 31, + 26, + "1" + ], + [ + "SWAP", + 26, + 29 + ], + [ + "ADD", + 29, + 25, + "-1" + ], + [ + "ADD", + 24, + 25, + "-1" + ], + [ + "SWAP", + 25, + 28 + ], + [ + "ADD", + 28, + 24, + "1" + ], + [ + "SWAP", + 23, + 29 + ], + [ + "SWAP", + 22, + 25 + ], + [ + "SWAP", + 20, + 23 + ], + [ + "SWAP", + 19, + 25 + ], + [ + "SWAP", + 18, + 27 + ], + [ + "SWAP", + 17, + 29 + ], + [ + "SWAP", + 16, + 31 + ], + [ + "ADD", + 14, + 15, + "-1" + ], + [ + "SWAP", + 15, + 30 + ], + [ + "ADD", + 13, + 14, + "-1" + ], + [ + "SWAP", + 14, + 30 + ], + [ + "ADD", + 12, + 13, + "-1" + ], + [ + "SWAP", + 13, + 22 + ], + [ + "ADD", + 11, + 12, + "-1" + ], + [ + "SWAP", + 12, + 30 + ], + [ + "ADD", + 10, + 11, + "-1" + ], + [ + "SWAP", + 11, + 18 + ], + [ + "ADD", + 9, + 10, + "-1" + ], + [ + "SWAP", + 10, + 22 + ], + [ + "ADD", + 8, + 9, + "-1" + ], + [ + "SWAP", + 9, + 26 + ], + [ + "SWAP", + 8, + 30 + ], + [ + "SWAP", + 7, + 16 + ], + [ + "SWAP", + 6, + 18 + ], + [ + "SWAP", + 5, + 20 + ], + [ + "SWAP", + 4, + 22 + ], + [ + "SWAP", + 3, + 24 + ], + [ + "SWAP", + 2, + 26 + ], + [ + "SWAP", + 1, + 28 + ], + [ + "SWAP", + 0, + 30 + ] + ] + }, + "diagonal": [ + [ + -1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1 + ], + [ + -1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 1 + ], + [ + -1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 1, + 1 + ], + [ + -1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 1 + ], + [ + -1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 1 + ], + [ + -1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 1 + ], + [ + -1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 1 + ], + [ + -1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 1 + ], + [ + -1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + -1, + 1, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + -1, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + -1, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + -1, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + -1, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + -1, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + -1, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 1 + ], + [ + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1 + ], + [ + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 1 + ], + [ + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 1, + 1 + ], + [ + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 1 + ], + [ + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 1 + ], + [ + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 1 + ], + [ + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 1 + ], + [ + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 1 + ], + [ + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 1, + 1, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 1, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 1, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 1, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 1, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 1, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 1, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 1 + ] + ], + "keep_mask": 35047648968703, + "kind": "complex", + "pairs": 16, + "physical_events": [ + [ + "LOCAL", + 0, + 0, + false + ], + [ + "Q_POWER", + 0, + -2 + ], + [ + "SIGNED_SWAP", + 0, + 1 + ], + [ + "LOCAL", + 1, + 0, + false + ], + [ + "Q_POWER", + 1, + 2 + ], + [ + "SIGNED_SWAP", + 1, + 0 + ], + [ + "IDLE", + 1, + [ + 0, + 1 + ] + ], + [ + "ADD", + 0, + 2, + 1 + ], + [ + "ADD", + 3, + 1, + -1 + ], + [ + "QUERY_SHEAR", + 2, + 0, + false + ], + [ + "ADD", + 0, + 2, + -1 + ], + [ + "ADD", + 3, + 1, + 1 + ], + [ + "Q_POWER", + 2, + -2 + ], + [ + "SIGNED_SWAP", + 2, + 3 + ], + [ + "LOCAL", + 3, + 1, + false + ], + [ + "Q_POWER", + 3, + 2 + ], + [ + "SIGNED_SWAP", + 3, + 2 + ], + [ + "IDLE", + 2, + [ + 0, + 1, + 3 + ] + ], + [ + "ADD", + 2, + 4, + 1 + ], + [ + "ADD", + 5, + 3, + -1 + ], + [ + "QUERY_SHEAR", + 4, + 1, + false + ], + [ + "ADD", + 2, + 4, + -1 + ], + [ + "ADD", + 5, + 3, + 1 + ], + [ + "Q_POWER", + 4, + -2 + ], + [ + "SIGNED_SWAP", + 4, + 5 + ], + [ + "LOCAL", + 5, + 2, + false + ], + [ + "Q_POWER", + 5, + 2 + ], + [ + "SIGNED_SWAP", + 5, + 4 + ], + [ + "IDLE", + 3, + [ + 0, + 1, + 3, + 5 + ] + ], + [ + "ADD", + 4, + 6, + 1 + ], + [ + "ADD", + 7, + 5, + -1 + ], + [ + "QUERY_SHEAR", + 6, + 2, + false + ], + [ + "ADD", + 4, + 6, + -1 + ], + [ + "ADD", + 7, + 5, + 1 + ], + [ + "Q_POWER", + 6, + -2 + ], + [ + "SIGNED_SWAP", + 6, + 7 + ], + [ + "LOCAL", + 7, + 3, + false + ], + [ + "Q_POWER", + 7, + 2 + ], + [ + "SIGNED_SWAP", + 7, + 6 + ], + [ + "IDLE", + 4, + [ + 0, + 1, + 3, + 5, + 7 + ] + ], + [ + "ADD", + 6, + 8, + 1 + ], + [ + "ADD", + 9, + 7, + -1 + ], + [ + "QUERY_SHEAR", + 8, + 3, + false + ], + [ + "ADD", + 6, + 8, + -1 + ], + [ + "ADD", + 9, + 7, + 1 + ], + [ + "Q_POWER", + 8, + -2 + ], + [ + "SIGNED_SWAP", + 8, + 9 + ], + [ + "LOCAL", + 9, + 4, + false + ], + [ + "Q_POWER", + 9, + 2 + ], + [ + "SIGNED_SWAP", + 9, + 8 + ], + [ + "IDLE", + 5, + [ + 0, + 1, + 3, + 5, + 7, + 9 + ] + ], + [ + "ADD", + 8, + 10, + 1 + ], + [ + "ADD", + 11, + 9, + -1 + ], + [ + "QUERY_SHEAR", + 10, + 4, + false + ], + [ + "ADD", + 8, + 10, + -1 + ], + [ + "ADD", + 11, + 9, + 1 + ], + [ + "Q_POWER", + 10, + -2 + ], + [ + "SIGNED_SWAP", + 10, + 11 + ], + [ + "LOCAL", + 11, + 5, + false + ], + [ + "Q_POWER", + 11, + 2 + ], + [ + "SIGNED_SWAP", + 11, + 10 + ], + [ + "IDLE", + 6, + [ + 0, + 1, + 3, + 5, + 7, + 9, + 11 + ] + ], + [ + "ADD", + 10, + 12, + 1 + ], + [ + "ADD", + 13, + 11, + -1 + ], + [ + "QUERY_SHEAR", + 12, + 5, + false + ], + [ + "ADD", + 10, + 12, + -1 + ], + [ + "ADD", + 13, + 11, + 1 + ], + [ + "Q_POWER", + 12, + -2 + ], + [ + "SIGNED_SWAP", + 12, + 13 + ], + [ + "LOCAL", + 13, + 6, + false + ], + [ + "Q_POWER", + 13, + 2 + ], + [ + "SIGNED_SWAP", + 13, + 12 + ], + [ + "IDLE", + 7, + [ + 0, + 1, + 3, + 5, + 7, + 9, + 11, + 13 + ] + ], + [ + "ADD", + 12, + 14, + 1 + ], + [ + "ADD", + 15, + 13, + -1 + ], + [ + "QUERY_SHEAR", + 14, + 6, + false + ], + [ + "ADD", + 12, + 14, + -1 + ], + [ + "ADD", + 15, + 13, + 1 + ], + [ + "Q_POWER", + 14, + -2 + ], + [ + "SIGNED_SWAP", + 14, + 15 + ], + [ + "LOCAL", + 15, + 7, + false + ], + [ + "Q_POWER", + 15, + 2 + ], + [ + "SIGNED_SWAP", + 15, + 14 + ], + [ + "ADD", + 14, + 16, + 1 + ], + [ + "ADD", + 17, + 15, + -1 + ], + [ + "QUERY_SHEAR", + 16, + 7, + false + ], + [ + "ADD", + 14, + 16, + -1 + ], + [ + "ADD", + 17, + 15, + 1 + ], + [ + "Q_POWER", + 16, + -2 + ], + [ + "SIGNED_SWAP", + 16, + 17 + ], + [ + "LOCAL", + 17, + 8, + false + ], + [ + "Q_POWER", + 17, + 2 + ], + [ + "SIGNED_SWAP", + 17, + 16 + ], + [ + "ADD", + 16, + 18, + 1 + ], + [ + "ADD", + 19, + 17, + -1 + ], + [ + "QUERY_SHEAR", + 18, + 8, + false + ], + [ + "ADD", + 16, + 18, + -1 + ], + [ + "ADD", + 19, + 17, + 1 + ], + [ + "Q_POWER", + 18, + -2 + ], + [ + "SIGNED_SWAP", + 18, + 19 + ], + [ + "LOCAL", + 19, + 9, + false + ], + [ + "Q_POWER", + 19, + 2 + ], + [ + "SIGNED_SWAP", + 19, + 18 + ], + [ + "ADD", + 18, + 20, + 1 + ], + [ + "ADD", + 21, + 19, + -1 + ], + [ + "QUERY_SHEAR", + 20, + 9, + false + ], + [ + "ADD", + 18, + 20, + -1 + ], + [ + "ADD", + 21, + 19, + 1 + ], + [ + "Q_POWER", + 20, + -2 + ], + [ + "SIGNED_SWAP", + 20, + 21 + ], + [ + "LOCAL", + 21, + 10, + false + ], + [ + "Q_POWER", + 21, + 2 + ], + [ + "SIGNED_SWAP", + 21, + 20 + ], + [ + "ADD", + 20, + 22, + 1 + ], + [ + "ADD", + 23, + 21, + -1 + ], + [ + "QUERY_SHEAR", + 22, + 10, + false + ], + [ + "ADD", + 20, + 22, + -1 + ], + [ + "ADD", + 23, + 21, + 1 + ], + [ + "Q_POWER", + 22, + -2 + ], + [ + "SIGNED_SWAP", + 22, + 23 + ], + [ + "LOCAL", + 23, + 11, + false + ], + [ + "Q_POWER", + 23, + 2 + ], + [ + "SIGNED_SWAP", + 23, + 22 + ], + [ + "ADD", + 22, + 24, + 1 + ], + [ + "ADD", + 25, + 23, + -1 + ], + [ + "QUERY_SHEAR", + 24, + 11, + false + ], + [ + "ADD", + 22, + 24, + -1 + ], + [ + "ADD", + 25, + 23, + 1 + ], + [ + "Q_POWER", + 24, + -2 + ], + [ + "SIGNED_SWAP", + 24, + 25 + ], + [ + "LOCAL", + 25, + 12, + false + ], + [ + "Q_POWER", + 25, + 2 + ], + [ + "SIGNED_SWAP", + 25, + 24 + ], + [ + "ADD", + 24, + 26, + 1 + ], + [ + "ADD", + 27, + 25, + -1 + ], + [ + "QUERY_SHEAR", + 26, + 12, + false + ], + [ + "ADD", + 24, + 26, + -1 + ], + [ + "ADD", + 27, + 25, + 1 + ], + [ + "Q_POWER", + 26, + -2 + ], + [ + "SIGNED_SWAP", + 26, + 27 + ], + [ + "LOCAL", + 27, + 13, + false + ], + [ + "Q_POWER", + 27, + 2 + ], + [ + "SIGNED_SWAP", + 27, + 26 + ], + [ + "ADD", + 26, + 28, + 1 + ], + [ + "ADD", + 29, + 27, + -1 + ], + [ + "QUERY_SHEAR", + 28, + 13, + false + ], + [ + "ADD", + 26, + 28, + -1 + ], + [ + "ADD", + 29, + 27, + 1 + ], + [ + "Q_POWER", + 28, + -2 + ], + [ + "SIGNED_SWAP", + 28, + 29 + ], + [ + "LOCAL", + 29, + 14, + false + ], + [ + "Q_POWER", + 29, + 2 + ], + [ + "SIGNED_SWAP", + 29, + 28 + ], + [ + "ADD", + 28, + 30, + 1 + ], + [ + "ADD", + 31, + 29, + -1 + ], + [ + "QUERY_SHEAR", + 30, + 14, + false + ], + [ + "ADD", + 28, + 30, + -1 + ], + [ + "ADD", + 31, + 29, + 1 + ], + [ + "Q_POWER", + 30, + -2 + ], + [ + "SIGNED_SWAP", + 30, + 31 + ], + [ + "LOCAL", + 31, + 15, + false + ], + [ + "Q_POWER", + 31, + 2 + ], + [ + "SIGNED_SWAP", + 31, + 30 + ], + [ + "LOCAL", + 32, + 15, + false + ], + [ + "IDLE", + 7, + [ + 17, + 19, + 21, + 23, + 25, + 27, + 29, + 31, + 32 + ] + ], + [ + "IDLE", + 8, + [ + 19, + 21, + 23, + 25, + 27, + 29, + 31, + 32 + ] + ], + [ + "IDLE", + 9, + [ + 21, + 23, + 25, + 27, + 29, + 31, + 32 + ] + ], + [ + "IDLE", + 10, + [ + 23, + 25, + 27, + 29, + 31, + 32 + ] + ], + [ + "IDLE", + 11, + [ + 25, + 27, + 29, + 31, + 32 + ] + ], + [ + "IDLE", + 12, + [ + 27, + 29, + 31, + 32 + ] + ], + [ + "IDLE", + 13, + [ + 29, + 31, + 32 + ] + ], + [ + "IDLE", + 14, + [ + 31, + 32 + ] + ], + [ + "ADD", + 30, + 28, + 1 + ], + [ + "ADD", + 29, + 31, + -1 + ], + [ + "ADD", + 28, + 26, + 1 + ], + [ + "ADD", + 27, + 29, + -1 + ], + [ + "ADD", + 26, + 24, + 1 + ], + [ + "ADD", + 25, + 27, + -1 + ], + [ + "ADD", + 24, + 22, + 1 + ], + [ + "ADD", + 23, + 25, + -1 + ], + [ + "ADD", + 22, + 20, + 1 + ], + [ + "ADD", + 21, + 23, + -1 + ], + [ + "ADD", + 20, + 18, + 1 + ], + [ + "ADD", + 19, + 21, + -1 + ], + [ + "ADD", + 18, + 16, + 1 + ], + [ + "ADD", + 17, + 19, + -1 + ], + [ + "ADD", + 16, + 14, + 1 + ], + [ + "ADD", + 15, + 17, + -1 + ], + [ + "ADD", + 14, + 12, + 1 + ], + [ + "ADD", + 13, + 15, + -1 + ], + [ + "ADD", + 12, + 10, + 1 + ], + [ + "ADD", + 11, + 13, + -1 + ], + [ + "ADD", + 10, + 8, + 1 + ], + [ + "ADD", + 9, + 11, + -1 + ], + [ + "ADD", + 8, + 6, + 1 + ], + [ + "ADD", + 7, + 9, + -1 + ], + [ + "ADD", + 6, + 4, + 1 + ], + [ + "ADD", + 5, + 7, + -1 + ], + [ + "ADD", + 4, + 2, + 1 + ], + [ + "ADD", + 3, + 5, + -1 + ], + [ + "ADD", + 2, + 0, + 1 + ], + [ + "ADD", + 1, + 3, + -1 + ], + [ + "SIGNED_SWAP", + 0, + 1 + ], + [ + "SIGNED_SWAP", + 2, + 3 + ], + [ + "SIGNED_SWAP", + 4, + 5 + ], + [ + "SIGNED_SWAP", + 6, + 7 + ], + [ + "SIGNED_SWAP", + 8, + 9 + ], + [ + "SIGNED_SWAP", + 10, + 11 + ], + [ + "SIGNED_SWAP", + 12, + 13 + ], + [ + "SIGNED_SWAP", + 14, + 15 + ], + [ + "SIGNED_SWAP", + 16, + 17 + ], + [ + "SIGNED_SWAP", + 18, + 19 + ], + [ + "SIGNED_SWAP", + 20, + 21 + ], + [ + "SIGNED_SWAP", + 22, + 23 + ], + [ + "SIGNED_SWAP", + 24, + 25 + ], + [ + "SIGNED_SWAP", + 26, + 27 + ], + [ + "SIGNED_SWAP", + 28, + 29 + ], + [ + "SIGNED_SWAP", + 30, + 31 + ] + ], + "prefix_pairs": 7, + "wrapper_sites": [ + 1, + 3, + 5, + 7, + 9, + 11, + 13, + 15, + 17, + 19, + 21, + 23, + 25, + 27, + 29, + 31 + ] +} diff --git a/research/p104-productive-controller/PROOF.md b/research/p104-productive-controller/PROOF.md new file mode 100644 index 0000000000..e0bb34fbef --- /dev/null +++ b/research/p104-productive-controller/PROOF.md @@ -0,0 +1,212 @@ +# Productive P104 caller and complete conditional cost + +This construction gives conditional `kappa = 304057/100000000 = 0.00304057`. +It changes the complete recursive profile. It does not change the selected +record. The five retained framework assumptions are native all-column +implementation, owned erasure, the uniform compiler, precision and tape cost, +and analytic recovery. This package checks the new finite interfaces and +all parameters of that conditional calculation. It does not claim an +unconditional integer multiplication theorem. + +## 1. The complete source word + +Use Gareth Davidson's PR2305 composition of David Arias's PR2152 coalesced +P104 word and Cinna Davis's PR2219 private reuse. `local.construct()` rebuilds +that exact word from its archived source and compares the full report with +PR2305. It does not run or reuse the old owner-price model. `WORD.json.gz` +contains the emitted word, all binary frames, all public boundaries and the +104 retained port indices. It has 25,311 events and 735 independent public +inputs. The 208 live main fields are X_r and Y_r for the 104 retained indices. +All other public fields are independent helpers, including the 16 punctured +main roles. Eight distinct owned lifetime labels can use one physical slot. + +At each frame V let Phi_V be the pinned nine-axis native chart. A register +in frame V contains Phi_V times its logical value. A MOVE applies +Phi_new Phi_old^(-1). Each ADD or SCALE uses the same frame on every operand. +COPY reads into a cleared owned field; each final private CLEAR uses the +retained owned-erasure contract. The exact endpoint is + +```text +X_r -> X_r +Y_r -> Y_r + X_r for every retained port r +h -> h for every one of the 527 helpers +owned -> 0 for all eight owned lifetime labels +``` + +The first interpreter checks this matrix on all 743 public and owned rows, +including arbitrary owned entrance values before initialization. A separate +interpreter applies the transposed instruction matrices in reverse order. +It uses dense integer rows with binary denominators. Both checks cover all +552,049 coefficients, including zeros. The private slot is initialized before +use and is cleared after use; its peak occupancy is one. It receives no +productive credit. The source word, correction and reuse are predecessor +results, not new local circuits. + +For each positive width f replace every chart by its factorwise tensor power. +Every common-chart scalar step still acts on the same logical values, with +its scalar coefficient outside the tensor power. The frame induction and +rational endpoint therefore hold at every f. Native phase checks include the +absolute scalar phase. Equality of an unsigned tableau alone is not used. +The pinned compiler produces each native recipe; a separate Gaussian +interpreter checks every Pauli image and the global phase. This establishes +the ideal linear identities. The retained all-column implementation and +rounded arithmetic hypotheses remain explicit. + +## 2. The local productive interface + +All public paths are nested. For each helper h, the complete boundary map +Phi_final Phi_initial^(-1) has Gaussian rank +`dim(final) - dim(initial)`. Native lowering checks this rank and supplies +its two monomial boundary maps. These maps give independent ordinary +Gaussian targets at these ranks: + +```text +helpers = {4:51, 5:36, 7:24, 8:122, 9:294} +paid = {1:2429, 2:557, 3:389, 4:112, 5:108, 6:16, 7:13, 9:1} +``` + +There are 527 helper targets and 3,625 paid calls. The paid rank mass is +5,894. Helper rank mass is 4,174. The main boundary progress is +`2*104*8 = 1664`, leaving 56 paid private-copy ranks. The unused helper 711 +keeps its paid H9 and its productive H9; they cancel in the moment. It is +not silently removed from one side of the calculation. + +The 2,981 distinct native maps include every paid occurrence and every helper +boundary. The 208 intrinsic main adapters have rank zero. Their phases give +these physical maps on port q: + +```math +Q_q=\frac{1+i}{2}I+\frac{1-i}{2}X_q,\qquad +F_s=D_s\begin{pmatrix}1&0\\Q_q^{-1}&1\end{pmatrix}. +``` + +At stage zero, `D_0=H9 Q_q^(-1)`. At later stages D_s acts on eight fresh +axes. The complete source accepts arbitrary main fields and arbitrary helper +fields, so this is a full interface, not a main-input subspace restriction. +Each full call uses a fresh independent helper inventory. + +## 3. A forward source supplies both caller orientations + +Retain Cinna Davis's literal p16/a7 controller from `joint-helper-lattice`. +Its 18 full sites formerly used two forward and sixteen backward interfaces. +Use the inverse of the direct wrapper in Ali Romman's PR5398. Put + +```math +R=\begin{pmatrix}0&1\\-Q^{-2}&0\end{pmatrix},\quad +B_s=R^{-1}F_sR + =D_s\begin{pmatrix}1&-Q\\0&1\end{pmatrix}. +``` + +For each backward site, the emitted execution order is + +```text +x <- Q^-2 x +(x,y) <- (y,-x) +execute the unchanged complete forward supplier +y <- Q^2 y +(x,y) <- (-y,x) +``` + +All 18 +full invocations now use the published forward word. No instruction-level +transpose of its COPY or CLEAR operations is needed. The wrapper acts only +on the two main fields; every helper and owned exit remains the source exit. + +Exact Gaussian arithmetic gives `Q^2=Q^-2=X_q`, with phase +1. It is a native +address translation, at every positive tensor width. Scalar minus signs stay +outside tensor substitution. D_s commutes with Q. Thus both signed exchanges +and both translations are ordinary operations. They add no Gaussian call. +The full Laurent replay retains Q as a formal invertible variable; it does +not impose Q^2=I to prove the caller identity. + +The physical check binds all 104 ports at all 18 full sites. It checks the +orthogonal route, inverse route, fixed central direction, four boundary +contacts and exact cross term. This gives 7,488 boundary contacts in the +265-axis layout. The 53,248 central-square column checks cover all nine-axis +columns at every port. Each route changes at most 17 axes. The phase check +also binds all 3,328 main targets and every whole idle job. If an idle includes +stage zero, its first eight axes are the actual orthonormal basis of +q-perpendicular; the residual translation is charged as ordinary work. +Unused fresh axes are spectators and can be deleted by an injective relabeling. + +The 15 thin queries keep the existing paid implementation: initialize an +owned field, COPY the source, perform Q or Q^-1, ADD to the target, and erase +the owned field. There is one paid rank-one call per port and no target +credit for that field. Q^-1 uses a positive Gaussian and its translation. +The one physical owned slot is reused sequentially by full and thin calls. + +## 4. The complete invoice + +For each full site add the local paid and helper profiles. For each thin +site add 104 H1 calls. For each idle with j stages add 208 H(8j) calls. +Each main Laurent diagonal gives 104 targets of rank `1+8j`. +A separate count from the two path lengths 7 and 8 gives the same invoice. +The resulting complete counts are + +```text +paid calls: 69930 +productive fields: 12814 = 18*527 + 32*104 +thin paid calls: 1560 +whole idle jobs: 3120 +rank mass surplus: 760 +maximum target: 145 +maximum paid rank: 72 +``` + +`RESULT.json` gives both full histograms. Every helper boundary and main target +has a native map. All COPY paths, source correction, cleanup, thin calls and +whole idles are included. The old fixed-window owner assignment is not used. +The retained mixed-target theorem supplies the productive matching and +uniform recursion from this complete field interface. No new helper output +is treated as free work without its corresponding paid path. + +Two rational interval engines check `sum(T_r*r^(1-k)) - sum(P_r*r^(1-k))`. +A sign-changing crossing is enclosed in +`(0.00304057807630, 0.00304057807631)`. This is a bound for the stated profile, +not an optimum over local words or controllers. The tested saving is +0.003040575. The claimed kappa 0.00304057 leaves more than 8.0763e-9 to this +crossing and improves selected 0.003027288235 by 0.000013281765. + +The complete tail calculation uses power 1024, cutoff 17, target floor 18, +offset 1/5, and reserve 1e-10. The paid ratio is less than +0.999999996781291. The higher-moment ratio is less than 0.965182173 and the +completion ratio is less than 0.963354733. Both tail ratios are below 0.97; +`0.97^128 < 1/16`. Splitting and rounding give the strict normalized bound +`5242880004882813/5242880536870912 < 1`. The old cutoff 20 fails for this +larger helper inventory and is rejected by a control. + +With complement factor 63/64 and logarithm power 1000, the compiler uses +`H=64215200000000` and `N=2^H`. The integer test exponent is 45,868; +`(H+1)^1000 < 2^45868`, and the preceding grid point fails. The arithmetic +checks all 54 strict outer predicates and four functional predicates. +The retained ordinary BIT saving is 0.0034, above the new complex requirement. +No stronger BIT result is needed. The uniform compiler word is specified by +the retained finite algorithm and is not materialized. + +## 5. Ordinary work, storage and precision boundary + +The source scalar allowance is 217,428 real operations. The route allowance +counts each paid map, both normalizers for every helper, all intrinsic main +adapters, all four fresh-stage contacts per port, and the eight owned +lifetimes. Each fixed map is on at most 17 active axes and has a 1,000-unit +allowance. The sum is below 10^7 per full call. The global raw allowance is +184,647,552, below the funded 10^9 bound. It includes thin COPY/ADD/erase, +scalar boundary programs, all signed exchanges and translations. One owned +field suffices in addition to the independent public fields. No helper +initialization assumes its arbitrary dirt is zero. + +The source checks fewer than 26,000 events and `1+abs(coefficient) < 2^16` +for every scalar update. A safe local scalar growth bound is 2^(16*26000). +Each rank-r tensor Gaussian has row l1 norm at most 2^(rf). The complete +raw implementation therefore has a conservative growth bound +`2^(10^9 + R*f)`, where R is the sum of the full paid ranks in RESULT.json. +Independent local defects can be bounded by the number of raw operations +and paid calls times this factor. These are finite upper bounds, not sharp +or attained norms. They include the intermediate growth in the three-ADD +signed exchange. They provide parameters for the retained precision/tape +contract; a complete rounded integer multiplier is not executed here. + +The claim retains the five framework assumptions stated at the start. +Normal and optimized Python checks, immutable source authentication, failure +controls and a Git-free export are verification of this conditional package. +They are not independent human acceptance or a proof-kernel theorem. diff --git a/research/p104-productive-controller/README.md b/research/p104-productive-controller/README.md new file mode 100644 index 0000000000..09dce91f62 --- /dev/null +++ b/research/p104-productive-controller/README.md @@ -0,0 +1,141 @@ +# Conditional kappa 0.00304057 from a productive P104 caller + +This construction gives **conditional kappa = 304057/100000000 = 0.00304057**. +It improves the selected +[PR #5413](https://github.com/CrocSwap/integer-mult-bounds/pull/5413) +value 0.003027288235 by **0.000013281765**, about **0.439%**. The complete +recursive profile changes. This is not extra precision on the old crossing. +The selected files and other contributors' work stay unchanged. + +The contribution binds the completed P104 word from +[PR #2305](https://github.com/CrocSwap/integer-mult-bounds/pull/2305) +to the current mixed-target recursion. Its 527 independent helper outputs +receive their actual Gaussian target ranks. An explicit caller uses that +published forward word at all 18 full sites. Signed exchanges and central-square +translations supply the sixteen backward interfaces. The word's COPY and +CLEAR operations do not need an instruction-level transpose. + +Read [the proof and full cost boundary](PROOF.md), +[the complete receipt](RESULT.json), [the emitted local word](WORD.json.gz), +[the emitted caller](CONTROLLER.json), and [exact source pins](SOURCES.json). +The source circuit and private reuse are credited predecessor results. +The new result is their physical caller and complete productive admission. + +| Verified quantity | Result | +| --- | ---: | +| Independent local public inputs | 735 | +| Productive helpers per full call | 527 | +| Owned lifetimes / peak owned fields | 8 / 1 | +| Full calls / thin calls / whole idle jobs | 18 / 15 / 3,120 | +| Complete paid calls / productive fields | 69,930 / 12,814 | +| Complete rank-mass surplus | 760 | +| Native paid and helper maps / main adapters | 2,981 / 208 | +| Physical caller boundary contacts | 7,488 | +| Crossing enclosure | (0.00304057807630, 0.00304057807631) | +| Tested saving | 0.003040575 | +| Claimed complete kappa | 0.00304057 | + +The proof checks both complete matrices with different arithmetic and +chronology, exact native phases, each helper boundary, all main targets and +whole idles, every owned lifetime, and all scalar and route charges. Two +rational interval engines check the moment. Cutoff 17 and floor 18 fund the +completion tails; the old cutoff 20 fails. The finite compiler threshold is +`N = 2^64215200000000`. All 54 strict outer inequalities and four functional +inequalities pass with the retained ordinary BIT saving 0.0034. + +## Reproduce + +Use Python 3.12 and the standard library, from the repository root: + +```sh +python3 -B scripts/research_package.py --package research/p104-productive-controller --check-only +python3 -B scripts/research_package.py --package research/p104-productive-controller +``` + +The registered hook runs the full verifier normally and with `-O`. Its final +marker is: + +```text +PASS_P104_PRODUCTIVE_COMPLETE_KAPPA_00304057 +``` + +Direct replay needs no Git, network or optimizer: + +```sh +python3 -I -B research/p104-productive-controller/verify.py +python3 -I -O -B research/p104-productive-controller/verify.py +``` + +The source archive is read and authenticated, then copied to temporary +storage for reconstruction. Normal replay does not write artifacts. The +explicit `--write` mode rebuilds the three local artifacts. Controls reject a +missing COPY, a wrong frame, a wrong native phase, an omitted central +translation, unearned helper credit, the old cutoff, and insufficient BIT +stock. The compiler grid check rejects its preceding integer point. + +## Scope and coordination + +The scientific base is canonical main +`32890bc5de034ab8fc93ac88ead7279a6a416d04`, priority revision 7. The +[canonical claim](https://github.com/CrocSwap/integer-mult-bounds/discussions/5125#discussioncomment-19154639) +records this changed cost model. The +[source handoff](https://github.com/CrocSwap/integer-mult-bounds/discussions/2299) +released the old composition scope and left global binding open. The initial +fresh cache covered 401 open PRs and 4,828 Discussion records. This scope does +not take literal-slot P104 repairs, original split-contact charts, global +border grading, the Global120 constructor or the p19 compiler. Full overlap +search is coordination evidence, not a novelty theorem. + +The bound retains the selected framework assumptions: native all-column +implementation, owned erasure, uniform compiler, precision and tape cost, +and analytic recovery. The package supplies ideal uniform frame identities, +finite growth bounds and all new parameter checks. It does not execute the +complete rounded multiplier, materialize the enormous uniform compiler word, +provide a proof-kernel theorem, or claim independent human acceptance. +No fixed-profile or global optimality claim is made. + +## Sources and credit + +- **Gareth Davidson**, verified as `bitplane` in the retained source notice, + supplied [PR #2305](https://github.com/CrocSwap/integer-mult-bounds/pull/2305), + mathematical head `335e78619a17b7c418e11306f86a72fd366de35b`: the exact + [composition](https://github.com/CrocSwap/integer-mult-bounds/blob/335e78619a17b7c418e11306f86a72fd366de35b/research/p104-coalesced-private-reuse/compose.py) + and its complete local boundary. Its old owner-window price is not reused. +- **David Arias** supplied the coalesced 735-register word in + [PR #2152](https://github.com/CrocSwap/integer-mult-bounds/pull/2152), + head `05f7aad0f08992ee48ec2dd93e896d9a4567847d`. The source archive retains + the original code, README and attribution unchanged. +- **Cinna Davis** supplied the private-query reuse in + [PR #2219](https://github.com/CrocSwap/integer-mult-bounds/pull/2219) + and the productive controller lineage. The pinned + [p16 caller](https://github.com/CrocSwap/integer-mult-bounds/blob/32890bc5de034ab8fc93ac88ead7279a6a416d04/research/joint-helper-lattice/CONTROLLER.json) + supplies the finite path and boundary matrices. +- **Ali Romman** supplied the direct conjugation identity in + [PR #5398](https://github.com/CrocSwap/integer-mult-bounds/pull/5398). + This package uses its inverse to admit only forward invocations. +- **Jacob Alan Sussman** supplied the mixed-target recursion lineage in + [PR #4268](https://github.com/CrocSwap/integer-mult-bounds/pull/4268). + **zxv** supplied the retained higher-moment/compiler and outer machinery; + **Cao Yifan** supplied the source pricing lineage. Their exact interval + engines and outer ledger stay unchanged. +- The P104 lineage retains **Rohan Arun**'s scalar channel, **Chafik Boukhalfa**'s + native binding, **Adam Gall**'s schedule, **Josie Elliston** and **Ali Romman**'s + geometry/decoder work, **icekylinx**'s frame compiler, and the PR1042/PR1094 + scalar architecture. The unchanged source archive and + [native notices](https://github.com/CrocSwap/integer-mult-bounds/tree/32890bc5de034ab8fc93ac88ead7279a6a416d04/research/p104-native-channel/notices) + retain their earlier contributors and licenses. + +New caller, productive binding, independent replay, full cost and package: +Ali Romman with substantial OpenAI Codex assistance. No subagents. Apache-2.0. + +## Open next questions + +Can the P104 local word reduce its paid profile under productive accounting? +Its original coalescing optimized a different owner model. Start from the +emitted word, check active claims, preserve every independent boundary, and +compare a fully paid change against this complete invoice. + +Can an independent review confirm this changed complete admission? The first +step is the registered cold replay, followed by review of the forward wrapper, +helper normalizers and compiler. [TASK.json](TASK.json) records these questions +and their current limits. Neither question reserves work in another chat. diff --git a/research/p104-productive-controller/RESULT.json b/research/p104-productive-controller/RESULT.json new file mode 100644 index 0000000000..5637130d4a --- /dev/null +++ b/research/p104-productive-controller/RESULT.json @@ -0,0 +1,315 @@ +{ + "complete_cost": { + "compiler": { + "H": 64215200000000, + "N": "2^64215200000000", + "eta": { + "lower": "0.000000185845792706621973271570", + "upper": "0.000000185845792706621973271571" + }, + "gap": "1/1400000000", + "integer_test_exponent": 45868, + "logarithm_power": 1000, + "theta": "63/64", + "uniform_saving": "1064201/350000000", + "word_materialized": false + }, + "full_forward_calls": 18, + "gain": "2656353/200000000000", + "kappa": "304057/100000000", + "kappa_decimal": ".00304057", + "margin_at_previous": { + "lower": "3.300756773058285958096643251393", + "upper": "3.300756773058285958096643251394" + }, + "negative_controls": { + "old_BIT": "Rejected by outer inequalities", + "old_cutoff": "Rejected by completion-tail ratio greater than one" + }, + "nonrecursive": { + "fixed_scalar_growth_bound": "At most 2^(16*26000) before native factors; a declared constant, not an attained norm.", + "local_routes": 5335000, + "local_scalar": 217428, + "peak_owned_fields": 1, + "raw_budget": 1000000000, + "raw_scalar_upper": 184647552, + "tensor_native_growth_bound": "Each rank-r Gaussian has row l1 norm at most 2^(rf); sum of local ranks is 5894." + }, + "ordinary_BIT": { + "admitted": "17/5000", + "after_cover": "69/20000", + "atom": "1/250", + "before_cover": "3459/1000000", + "ordinary_saving": "8590884599/2500000000000", + "prime_rule": "odd q > 2^26*N^5 avoiding all fixed denominators and rank witnesses" + }, + "outer": { + "functional_checks": { + "actual_new_BIT_stock_sublinear": "348599999253/350000000000", + "fixed_halo_explicit_metadata_branch": "26950000001/350000000", + "new_BIT_row_stock_sublinear_in_active_group": "1395799997009/1400000000000", + "new_semantic_group_guard": "3/1400000000" + }, + "margins": { + "boundary_algebraic_matrix": "5959522795743199/1960000000000000000", + "fused_gaussian": "5959522787229597/1960000000000000000", + "global_coordinate_router": "2128401/700000000", + "group_bit_router": "2979762093614797/980000000000000000", + "group_scans": "699999999/700000000", + "main_transform": "5959521395743199/1960000000000000000", + "microbox_face_corrections": "26950000001/350000000", + "polynomial_products": "1399999999/1400000000", + "sparse_union_movement": "802209522795743199/1960000000000000000" + }, + "parameters": { + "a": "2128401/700000000", + "b": "4256803/1400000000", + "beta": "1399999997/1400000000", + "bit_saving": "17/5000", + "cap_xi": "1782209521395743199/1960000000000000000", + "complex_uniform_saving": "1064201/350000000", + "d": "1/1400000000", + "epsilon": "1399999999/1400000000", + "kappa": "304057/100000000", + "lambda_": "398783771/400000000", + "lambda_prime": "1395743199/1400000000", + "layout": "1/1400000000", + "q": "4256801/1400000000", + "r0": "1/14000000000", + "stop": "1/1400000000", + "tested_saving": "121623/40000000" + }, + "strict_checks": { + "actual_bit_above_effective": "251599/700000000", + "actual_logarithmic_gamma_guard": "1/1400000000", + "actual_logarithmic_group_guard": "177790480704256801/980000000000000000", + "alpha_logarithm_absorption": "1/14000000000", + "boundary_algebraic_matrix_above_kappa": "5595743199/1960000000000000000", + "cap_above_band": "802209521395743199/1960000000000000000", + "cap_below_cell": "177790477204256801/1960000000000000000", + "cap_below_phase_cell_power": "2137790478604256801/1960000000000000000", + "complex_above_effective": "1/1400000000", + "complex_below_one_over_32": "39493197/1400000000", + "complex_endpoint": "1/700000000", + "epsilon_below_one": "1/1400000000", + "epsilon_positive": "1399999999/1400000000", + "fine_prime_halo_umbrella": "7/2", + "fused_gaussian_above_kappa": "5587229597/1960000000000000000", + "gaussian_above_main": "695743199/980000000000000000", + "global_coordinate_router_above_kappa": "1/350000000", + "global_gamma_power_slack": "9/14000000000", + "group_below_dimension": "1/700000000", + "group_bit_router_above_kappa": "3493614797/980000000000000000", + "group_gauge_power_slack": "177790480634256801/980000000000000000", + "group_key_fits_record": "1/700000000", + "group_positive": "1399999997/1400000000", + "group_scans_above_kappa": "1744679/1750000", + "halo_covers_generic_inverse_radius": "5", + "improvement_over_user_baseline": "654799790400418148631/500000000000000000000000", + "lambda_above_internal": "1/2800000000", + "lambda_above_sigma": "3/2800000000", + "lambda_above_tau": "1/2800000000", + "lambda_prime_above_lambda": "1/2800000000", + "lambda_prime_above_leaf": "2795743197/1960000000000000000", + "leaf_saving_above_effective": "1395743197/1960000000000000000", + "main_transform_above_kappa": "4195743199/1960000000000000000", + "membership_arithmetic_fits_record": "1/1400000000", + "microbox_face_corrections_above_kappa": "53897871603/700000000", + "microbox_halo_volume": "110600000003/1400000000", + "new_complex_uniform_saving_above_b": "1/1400000000", + "new_semantic_guard_with_C1_one": "1/1400000000", + "polynomial_products_above_kappa": "1395743201/1400000000", + "positive_layout_slack": "1/1400000000", + "q_below_effective": "1/1400000000", + "q_below_internal": "1/1400000000", + "q_below_leaf": "2795743197/1960000000000000000", + "q_positive": "4256801/1400000000", + "short_record_fallback": "1395743197/1400000000", + "source_axis_superpolynomial": "1/1400000000", + "sparse_union_movement_above_kappa": "796250005595743199/1960000000000000000", + "stop_below_one": "1399999999/1400000000", + "stop_positive": "1/1400000000", + "strassen_integer_power_gap": "1951441519231", + "support_router_span": "3/1400000000", + "theta_positive_polynomial_power": "2", + "union_header_fits_record": "3/1400000000", + "union_tag_work_per_visit_fits_record": "3/1400000000" + } + }, + "paid": { + "1": 45282, + "16": 416, + "2": 10026, + "24": 416, + "3": 7002, + "32": 416, + "4": 2016, + "40": 416, + "48": 416, + "5": 1944, + "56": 416, + "6": 288, + "64": 416, + "7": 234, + "72": 208, + "9": 18 + }, + "paid_calls": 69930, + "previous_selected": "605457647/200000000000", + "productive_fields": 12814, + "query_shears": 15, + "rank_mass_surplus": 760, + "raw_headroom": [ + "80763/10000000000000", + "807631/100000000000000" + ], + "raw_root_interval": [ + "30405780763/10000000000000", + "304057807631/100000000000000" + ], + "relative_gain_percent": "265635300/605457647", + "strictification": { + "alpha": { + "lower": "0.999999996781290806577194629544", + "upper": "0.999999996781290806577194629545" + }, + "cutoff": 17, + "delta": { + "lower": "0.963354732998265185478252854607", + "upper": "0.963354732998265185478252854608" + }, + "floor": 18, + "gamma": { + "lower": "0.965182172149361102612340648898", + "upper": "0.965182172149361102612340648899" + }, + "normalized_paid_upper": "5242880004882813/5242880536870912", + "power": 1024, + "reserve": "1/10000000000", + "tail_offset": "1/5", + "tested": "121623/40000000" + }, + "targets": { + "145": 208, + "17": 416, + "25": 416, + "33": 416, + "4": 918, + "41": 416, + "49": 416, + "5": 648, + "57": 416, + "65": 416, + "7": 432, + "73": 208, + "8": 2196, + "9": 5292 + }, + "whole_idle_jobs": 3120 + }, + "limits": [ + "Conditional on the retained native all-column, owned-erasure, compiler, precision/tape and analytic-recovery framework.", + "The winning uniform compiler word and complete integer multiplier are not materialized.", + "No proof-kernel check or independent human review is claimed." + ], + "local": { + "endpoint_coefficients": 552049, + "helpers": { + "4": 51, + "5": 36, + "7": 24, + "8": 122, + "9": 294 + }, + "owned_lifetimes": 8, + "paid": { + "1": 2429, + "2": 557, + "3": 389, + "4": 112, + "5": 108, + "6": 16, + "7": 13, + "9": 1 + }, + "peak_owned_fields": 1, + "public_inputs": 735, + "real_scalar_allowance": 217428 + }, + "native": { + "distinct_maps": 2981, + "helper_normalizers": 1054, + "helpers": { + "4": 51, + "5": 36, + "7": 24, + "8": 122, + "9": 294 + }, + "main_adapters": 208, + "proof": "Every signed Pauli image and exact global phase; frame induction at every positive tensor width", + "recipe_payload_sha256": "0a12b2a43238496b226b47dd0e790882d03d1b1b66107308ab37dd6ce21a0481", + "wrong_phase_rejected": true + }, + "negative_controls": { + "missing_central_translation": "Rejected by the complete Laurent endpoint", + "omitted_copy": "Rejected by full arbitrary-input endpoint", + "unearned_helper": "Rejected by native helper census", + "wrong_frame": "Rejected by literal source-frame check" + }, + "physical_caller": { + "central_square_columns": 53248, + "full_calls": 18, + "main_targets": { + "145": 208, + "17": 416, + "25": 416, + "33": 416, + "41": 416, + "49": 416, + "57": 416, + "65": 416, + "73": 208 + }, + "new_paid_jobs": 0, + "physical_contacts": 7488, + "ports": 104, + "route_payload_sha256": "7f4f0ca768ffbc4f93dcff575592c4c67411f46b4289e45b73f715a2ad47b142", + "tensor_rule": "Factorwise native maps; scalar signs stay outside the tensor power.", + "whole_idle_jobs": { + "16": 416, + "24": 416, + "32": 416, + "40": 416, + "48": 416, + "56": 416, + "64": 416, + "72": 208 + }, + "wrapper_sites": [ + 1, + 3, + 5, + 7, + 9, + 11, + 13, + 15, + 17, + 19, + 21, + 23, + 25, + 27, + 29, + 31 + ] + }, + "separate_columns": { + "arithmetic": "Dense integer rows with binary denominators; reverse chronology", + "coefficients": 552049, + "columns": 743 + }, + "source_inputs_authenticated": 16, + "status": "PASS_P104_PRODUCTIVE_COMPLETE_KAPPA_00304057" +} diff --git a/research/p104-productive-controller/SOURCES.json b/research/p104-productive-controller/SOURCES.json new file mode 100644 index 0000000000..ee8f34a8af --- /dev/null +++ b/research/p104-productive-controller/SOURCES.json @@ -0,0 +1,156 @@ +{ + "schema_version": 1, + "base_commit": "32890bc5de034ab8fc93ac88ead7279a6a416d04", + "files": [ + { + "path": "research/p104-coalesced-private-reuse/compose.py", + "usage": "input", + "git_blob": "402e0ff402bc9822288e1bf069f0b5712069c11e", + "sha256": "9ac1c0e5ac26ed98976148ef9fd73ee58533533f9581c701deaf26ced899ae9e" + }, + { + "path": "research/p104-coalesced-private-reuse/predecessor2152.tar.gz", + "usage": "input", + "git_blob": "cc1a5cb5735ee489388004c27b709a825faf59d1", + "sha256": "67867369c99212184c13d75369811ea928c89dca0e004287a9dcf0b2c93bcdb8" + }, + { + "path": "research/complex-block-rank-optimum/inputs/selected.json.gz", + "usage": "input", + "git_blob": "5f9ef680983b0b63a4c82a4ed909837b78e690cd", + "sha256": "16bc0ebb04b4be6c0ade74badc6a0c0cdba4215eda86e4ff9f13abf8ecebd219" + }, + { + "path": "research/frame-sa504/inputs/hamming/PROTOTYPE.json", + "usage": "input", + "git_blob": "9efe30ee107b9c67f15f1c726e1a1cb5cef03929", + "sha256": "327d2a868043e846381aa58a33053c24425e8cad522ff401b10ec8af1d649a3f" + }, + { + "path": "research/p104-native-channel/inputs/P104-FIXTURE.json", + "usage": "input", + "git_blob": "2e16f99b295bb386fd13bd8fbd57b42ef54143a9", + "sha256": "516c06f6ec3cb84be588c546108de897650288576dd5fbf5fe44b9c5546ad8a4" + }, + { + "path": "research/p104-native-channel/vendor/clifford_exact.py", + "usage": "input", + "git_blob": "166841a037f069249f6f7f6dedb89248812f59e2", + "sha256": "2982ead07721e83358dc67c6f49c2b4c16a236a6bebdfd72f58221be1f5d0962" + }, + { + "path": "research/p104-native-channel/vendor/native_verify.py", + "usage": "input", + "git_blob": "2c209dfa9cfade3bc20ac5fc9d876b433a147f8c", + "sha256": "3049471905b47b385c88378a1a3be7a18b8858aadd035b8a6da2f4a03b470f38" + }, + { + "path": "research/kappa-0023-productive-jobs/dependencies/kappa-next-regime/direct-decoder/sources/DATA-PHASES.json", + "usage": "input", + "git_blob": "d9a4f84211182ca200c081ea061d724c8a2cfb70", + "sha256": "c5916ff312678f12aba403847643fbbc29f643acec60bdf836fa56cd3e8251fa" + }, + { + "path": "research/joint-helper-lattice/CONTROLLER.json", + "usage": "input", + "git_blob": "49a2f0675819f9deeea27ed77be2c2b6ff2e87e5", + "sha256": "1f5d6aa267e4e66048818714b5d3b5eae17a58abe91d15deeaa34574f7391a5f" + }, + { + "path": "research/higher-moment-strictification/verify.py", + "usage": "input", + "git_blob": "4b24a5096154736ce060474eb8c72dc64c303699", + "sha256": "0ce7e7137422d5ffeda22085c81fa88471bbe963100fdad62e659f1e3bf89326" + }, + { + "path": "research/kappa-rebuild/architecture/mixed_target_probe.py", + "usage": "input", + "git_blob": "4fc05ab08138218ba9f09e5c89b649afae7c914e", + "sha256": "011c3c9d0cf81103dc84d709a0e36793eb7c5ae3f23c85eac27650ef13afa04a" + }, + { + "path": "research/pr4359-p7-padding/dependencies/compiler-refill/endpoint.py", + "usage": "input", + "git_blob": "340e1f0ffb8a1a9c38fbbd9119580b6d23e01b59", + "sha256": "d097e55f06c3f244f2074ffd7c1a0a5f3c4b4b6a6accf9619d1dde5c0ae85e15" + }, + { + "path": "research/query-thinned-controllers/RESULT.json", + "usage": "input", + "git_blob": "e0695152c98d727edfd0d2034b58a1c7e8682c0c", + "sha256": "6ebfc8c0f09166f4834e9d7427410cb31aefff2cd4d4ce588c8e52c9c70e9a0f" + }, + { + "path": "research/pr4359-p7-padding/native_inventory.py", + "usage": "input", + "git_blob": "8d2d96e3998254c2333c43fe47cdfd074cbd811e", + "sha256": "65539acaf45bdfe8c5aee6830f9c9b3d1107c442a60842ef803fdd7688de8f32" + }, + { + "path": "research/p104-coalesced-private-reuse/RESULT.json", + "usage": "input", + "git_blob": "f4cb528c2cc413f34e2ac83c42225c7a1cf11bd3", + "sha256": "580adb3de7037acc6f7e41cc186e8a210463afaa696d57892643d55acd0040c8" + }, + { + "path": "research/p104-coalesced-private-reuse/SOURCES.json", + "usage": "input", + "git_blob": "58f245e194b794b7bacd8ea88f9814d373ed91c3", + "sha256": "232fc3ca3928acc704333def0b8391f94a8e8736ef045c1b5de5b396be37cdc2" + }, + { + "path": "AGENTS.md", + "usage": "provenance", + "git_blob": "fa006ceb6b6b9d6c0e799f210963f4587ecfb162", + "sha256": "fbee67ab9e0ae4629a35fd9dba69c8f7e29e4a15392eb2d0f75d8768ffb65f40" + }, + { + "path": "autoresearch.md", + "usage": "provenance", + "git_blob": "2fe84a7b30b1e26e60ce0ec4775894eb1831c5d6", + "sha256": "d16f0d3bb4d4b213d06c128db6d6460b0fe9ec1ac5a6c1ea1febf1db40e7b60d" + }, + { + "path": "CONTRIBUTING.md", + "usage": "provenance", + "git_blob": "5185786f2ec00f215019fb5777d70979429690a9", + "sha256": "fcd1a8d0e52342a23b8ffa9e905e85ccc539fb084145ef016dfc93cedfb3d924" + }, + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "fc3d4ba105e1f097d0d7d051a308281e86ab1446", + "sha256": "66974efdced4083c00025f97d95d83909a226cdf801edb9301c195c6641f6903" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "f126dd2e2dad2b669e75d1d0d0bd05c600725602", + "sha256": "f7a48bfa2659b88378282a8eee7d9fe52cdf505594124c4d1686b58510fffd72" + }, + { + "path": "research/p104-coalesced-private-reuse/README.md", + "usage": "provenance", + "git_blob": "0ef79bfc5d978b8784b2d66cde113ffaf573c602", + "sha256": "dd1b9f28ee60887fbbecb7355417aa8fb72b697a771e4cdb37034a5710003d60" + }, + { + "path": "research/query-thinned-controllers/PROOF.md", + "usage": "provenance", + "git_blob": "9068f429896112082664455ab00bab083c99d1d8", + "sha256": "5ade59641f2ed70d045d6f60e89db7d979b1d1e9967f3acbe5c56eac81312841" + }, + { + "path": "research/kappa-backward-controller-20261023/README.md", + "usage": "provenance", + "git_blob": "c698f5b3e826b53c066d77fb22c091a5267a44cd", + "sha256": "e67cc6eb8f4bea9b1e83faeab9fb53ab91c427ea2fabd3cb1f746326e4c0b3c3" + }, + { + "path": "research/higher-moment-strictification/README.md", + "usage": "provenance", + "git_blob": "0a736ca89e1eafb73a30e1f2589cc45e6b5f76c3", + "sha256": "ebe80b68ff026ce90f71f274c31744f4c0b36132d15ebb7e39cf2d5df4df270d" + } + ] +} diff --git a/research/p104-productive-controller/TASK.json b/research/p104-productive-controller/TASK.json new file mode 100644 index 0000000000..6a31a94724 --- /dev/null +++ b/research/p104-productive-controller/TASK.json @@ -0,0 +1,153 @@ +{ + "schema_version": 1, + "task_id": "p104-side-correction", + "priority_revision": 7, + "base_commit": "32890bc5de034ab8fc93ac88ead7279a6a416d04", + "original_card": { + "id": "p104-side-correction", + "question": "Can a changed P104 producer/consumer contract escape the scoped slot, chart and completion obstructions with a favorable full bill?", + "starting_points": [ + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "research/p104-literal-slot-defect/README.md", + "research/p104-uniform-commutation-gap/README.md", + "research/p104-uniform-encoding-gap/README.md", + "research/p104-source-chart-shortcut/README.md", + "research/p104-fiber-tag-seam/README.md" + ], + "methods": [ + "Construct one side-correction word at an explicit chronological cut with the needed frames still available.", + "Derive a lower bound on the side correction and hosting costs that decides whether this channel can beat the selected budget." + ], + "acceptance_gate": "An exact arbitrary-input identity, source/target frame availability and restoration at the chosen cut, plus the complete channel+correction+idle/hosting bill or an explicit favorable bound. The native channel alone is not a supplier. A scoped local result may be retained without a complete supplier. Expanding it into further construction rounds requires the family-level budget and obligation gate in research-family-status.md; an optimistic passing relaxation alone is not acceptance.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read the named successor obstructions before extending #2981 static flags. Distinguish literal-slot action, commutation, uniform encoding, source-chart shortcut and fiber-tag seam scopes; none excludes all P104 mechanisms.", + "scope": "Source-binding orientation only; no scientific replay, theorem acceptance or supplier admission. Budget any heavy replay separately." + }, + "first_experiment": "Name one hypothesis changed from these exact interfaces. Write a literal producer-to-consumer timeline and an arbitrary-dirty-input positive/control pair, then charge acquisition, coefficients, completion, hosting and restoration. Stop if the same slot/fiber mismatch persists or the favorable full budget already fails. A scoped independent audit remains useful; another static count is not a new completion.", + "bottleneck_link": "Completing an already realized changed channel tests a concrete construction opportunity, instead of refining the incumbent packing. A positive local result still needs global and all-size admission.", + "allowed_variations": [ + "One correction factorization, one chronological cut, or one explicit hosting obstruction.", + "A changed correction schedule with an updated full bill and native frame contract." + ], + "scope_change_triggers": [ + "Recompiling the already certified low-rank channel without closing a new obligation.", + "Treating a pending ancestor, local histogram or unpriced side correction as an admitted global supplier.", + "Repeating a correction or physical conversion already supplied by a pending follow-up without adding independent coverage or a different unresolved obligation.", + "Repeating the 208-flag static matching or calling a static nested cover a chronological correction program. Independent audit of that certificate is distinct and remains useful.", + "Repeating a static cover, source-chart shortcut or fiber-tag seam without changing the hypothesis responsible for its obstruction." + ], + "overlap_terms": [ + "P104", + "I-G/2", + "side correction", + "native channel", + "1972", + "1991", + "2586", + "endpoint transport", + "physical dual", + "relay composition", + "2981", + "joint unit flags", + "acquisition delivery", + "static nesting", + "4133", + "4136", + "4140", + "4153", + "4154", + "p104-literal-slot-defect", + "p104-uniform-commutation-gap", + "p104-uniform-encoding-gap", + "p104-source-chart-shortcut", + "p104-fiber-tag-seam" + ], + "existing_checks": [ + { + "scope": "PR #4133: literal-slot defect", + "evidence": "research/p104-literal-slot-defect/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "88666f1dee93fbd85b31fd5d6f91a219e111b5f4", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4136: uniform commutation gap", + "evidence": "research/p104-uniform-commutation-gap/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "281ce601a8be9db470de630759179c23e1dfaa88", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4140: uniform encoding gap", + "evidence": "research/p104-uniform-encoding-gap/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "de25c6525aa866962309df5d107b32d55e6e5628", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4153: source-chart shortcut exhausts its optimistic allowance", + "evidence": "research/p104-source-chart-shortcut/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "9123241fea53df77e51ffe30d9aca1625d4bf3a8", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4154: fiber-tag seam mismatch", + "evidence": "research/p104-fiber-tag-seam/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "4ffcdaee5d6255a9cea1fe53a5424435068089d0", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + } + ] + }, + "scope_status": "changed", + "actual_scope": "Bind the completed PR2305 coalesced P104 word to the current productive p16/a7 caller, with all forward invocations, native helper normalization and complete conditional kappa 0.00304057.", + "scope_change_reason": "The old owner-window budget rejected this source. Its exact independent helper outputs can instead use the current mixed-target recursion. This is a changed complete consumer, not another static correction count.", + "bottleneck_link": "https://github.com/CrocSwap/integer-mult-bounds/discussions/5125#discussioncomment-19154639", + "budget_minutes": 240, + "stop_rule": "Finish only after the changed full invoice, native caller, compiler and outer calculation pass, then publish one focused reviewable PR. Do not change the selected frontier.", + "outcome": "completed", + "evidence": "PROOF.md, RESULT.json, WORD.json.gz, CONTROLLER.json; complete normal and optimized replay and Git-free export.", + "author": "Ali Romman", + "ai_assistance": "Substantial OpenAI Codex assistance; no subagents.", + "coordination": { + "claim": "https://github.com/CrocSwap/integer-mult-bounds/discussions/5125#discussioncomment-19154639", + "initial_open_prs": 401, + "initial_discussion_records": 4828, + "initial_refresh_utc": "2026-10-25T08:06:10.867121+00:00", + "source_scope_released": "https://github.com/CrocSwap/integer-mult-bounds/discussions/2299", + "excluded_scopes": [ + "Literal-slot P104 repairs", + "Original split-contact charts", + "Global border grading", + "Global120 constructor", + "p19 compiler" + ] + }, + "open_questions": [ + { + "question": "Can the complete P104 local word reduce its paid profile under productive accounting?", + "why_it_matters": "The current local word was optimized for the earlier fixed owner model.", + "first_step": "Refresh overlap, retain the exact arbitrary-helper boundary, and price a source-bound change against this complete invoice.", + "blocked_by": "No smaller native local word is proved here." + }, + { + "question": "Does an independent full replay confirm the new complete conditional bound?", + "why_it_matters": "Author verification does not provide independent admission.", + "first_step": "Run the registered commands from a clean source export and review the forward wrapper and productive helper interfaces.", + "blocked_by": "Independent maintainer review is pending." + } + ] +} diff --git a/research/p104-productive-controller/VERIFY.json b/research/p104-productive-controller/VERIFY.json new file mode 100644 index 0000000000..672efc1389 --- /dev/null +++ b/research/p104-productive-controller/VERIFY.json @@ -0,0 +1,45 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/p104-coalesced-private-reuse/compose.py", + "research/p104-coalesced-private-reuse/predecessor2152.tar.gz", + "research/complex-block-rank-optimum/inputs/selected.json.gz", + "research/frame-sa504/inputs/hamming/PROTOTYPE.json", + "research/p104-native-channel/inputs/P104-FIXTURE.json", + "research/p104-native-channel/vendor/clifford_exact.py", + "research/p104-native-channel/vendor/native_verify.py", + "research/kappa-0023-productive-jobs/dependencies/kappa-next-regime/direct-decoder/sources/DATA-PHASES.json", + "research/joint-helper-lattice/CONTROLLER.json", + "research/higher-moment-strictification/verify.py", + "research/kappa-rebuild/architecture/mixed_target_probe.py", + "research/pr4359-p7-padding/dependencies/compiler-refill/endpoint.py", + "research/query-thinned-controllers/RESULT.json", + "research/pr4359-p7-padding/native_inventory.py", + "research/p104-coalesced-private-reuse/RESULT.json", + "research/p104-coalesced-private-reuse/SOURCES.json" + ], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 600, + "checks": "Rebuild the exact P104 source; check all framed rows and reverse integer columns; certify all native calls and productive outputs; replay the physical forward caller, full invoice, two exact moment engines, compiler, ordinary BIT and all outer predicates; reject semantic controls." + }, + { + "argv": [ + "{python}", + "-O", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 600, + "checks": "Rebuild the exact P104 source; check all framed rows and reverse integer columns; certify all native calls and productive outputs; replay the physical forward caller, full invoice, two exact moment engines, compiler, ordinary BIT and all outer predicates; reject semantic controls with assertions disabled." + } + ] +} diff --git a/research/p104-productive-controller/WORD.json.gz b/research/p104-productive-controller/WORD.json.gz new file mode 100644 index 0000000000..70f954b346 Binary files /dev/null and b/research/p104-productive-controller/WORD.json.gz differ diff --git a/research/p104-productive-controller/caller.py b/research/p104-productive-controller/caller.py new file mode 100644 index 0000000000..6ac5e73569 --- /dev/null +++ b/research/p104-productive-controller/caller.py @@ -0,0 +1,175 @@ +"""An all-forward caller for the credited P104 supplier. + +The Laurent controller is by Cinna Davis. Its replay and signed-swap +identity follow Ali Romman's PR5398. This inverse wrapper and source binding +are by Ali Romman with substantial OpenAI Codex assistance. Apache-2.0. +""" +from copy import deepcopy +from fractions import Fraction as Q +from collections import Counter +from hashlib import sha256 +import json +import local as L +need = L.need + +def replay(word): + """Check the literal p16 word and both rational boundary programs.""" + need((word['kind'], word['pairs'], word['prefix_pairs'], word['ambient_rank']) == ('complex', 16, 7, 145), 'Source p16/a7 controller') + zero = (0,) * 34 + def plus(dst, src, q): + for k, v in src.items(): + value = dst.get(k, Q(0)) + q * v + if value: dst[k] = value + else: dst.pop(k, None) + def shifted(row, term, sign=1): + return [{tuple(a + b for a, b in zip(k, term)): sign * v for k, v in cell.items()} for cell in row] + for side in ('left', 'right'): + matrix = [[Q(i == j) for j in range(32)] for i in range(32)] + for e in word['boundaries'][side + '_program']: + if e[0] == 'SWAP': matrix[e[1]], matrix[e[2]] = matrix[e[2]], matrix[e[1]] + elif e[0] == 'SCALE': matrix[e[1]] = [Q(e[2]) * x for x in matrix[e[1]]] + else: + need(e[0] == 'ADD', 'Boundary scalar opcode') + matrix[e[1]] = [x + Q(e[3]) * y for x, y in zip(matrix[e[1]], matrix[e[2]])] + need(matrix == [[Q(x) for x in row] for row in word['boundaries'][side]], 'Exact scalar boundary program') + rows = [[{zero: Q(x)} if Q(x) else {} for x in row] for row in word['boundaries']['right']] + for e in word['physical_events']: + if e[0] in ('LOCAL', 'QUERY_SHEAR'): + _, stage, pair, back = e + x, y = 2 * pair, 2 * pair + 1 + if back: x, y = y, x + term = (1 if back else -1,) + (0,) * 33 + for dst, src in zip(rows[y], shifted(rows[x], term)): + plus(dst, src, Q(-1 if back else 1)) + if e[0] == 'LOCAL': + term = (0,) + tuple(int(s == stage) for s in range(33)) + for r in (x, y): rows[r] = shifted(rows[r], term) + elif e[0] == 'Q_POWER': + need(e[2] in (-2, 2), 'Only even central powers are free') + rows[e[1]] = shifted(rows[e[1]], (e[2],) + (0,) * 33) + elif e[0] == 'IDLE': + term = (0,) + tuple(int(s in e[2]) for s in range(33)) + for r in (2 * e[1], 2 * e[1] + 1): rows[r] = shifted(rows[r], term) + elif e[0] == 'ADD': + for dst, src in zip(rows[e[1]], rows[e[2]]): plus(dst, src, Q(e[3])) + else: + need(e[0] in ('SWAP', 'SIGNED_SWAP'), 'Controller physical opcode') + rows[e[1]], rows[e[2]] = rows[e[2]], shifted(rows[e[1]], zero, -1 if e[0] == 'SIGNED_SWAP' else 1) + out = [[{} for _ in range(32)] for _ in range(32)] + for i, row in enumerate(word['boundaries']['left']): + for k, q in enumerate(row): + if Q(q): + for j in range(32): plus(out[i][j], rows[k][j], Q(q)) + expected = [[{tuple(word['diagonal'][i]): Q(1)} if i == j else {} for j in range(32)] for i in range(32)] + need(out == expected, 'All p16 Laurent coefficients, central signs and boundary factors') + return word + + + +def construct(): + source = L.read(L.ROOT/'research/joint-helper-lattice/CONTROLLER.json') + replay(source) + word = deepcopy(source) + events, sites = [], [] + for e in source['physical_events']: + if e[0] == 'LOCAL' and e[3]: + _, stage, pair, _ = e + x, y = 2*pair, 2*pair+1 + events += [['Q_POWER',x,-2], ['SIGNED_SWAP',x,y], ['LOCAL',stage,pair,False], + ['Q_POWER',y,2], ['SIGNED_SWAP',y,x]] + sites.append(stage) + else: + events.append(deepcopy(e)) + word['physical_events'] = events + word['wrapper_sites'] = sites + word.pop('invoice') + need(len(sites) == 16 and all(not e[3] for e in events if e[0] == 'LOCAL'), 'Eighteen forward suppliers') + replay(word) + return word + + +def physical(word, local): + N = L.load(L.ROOT/'research/pr4359-p7-padding/native_inventory.py', 'productive_p104_phase_polynomial') + source = L.read(L.ROOT/'research/kappa-0023-productive-jobs/dependencies/kappa-next-regime/direct-decoder/sources/DATA-PHASES.json') + recipes = {r['q']:r for r in source['recipes']} + dimension = 265 + axes = tuple(1 << i for i in range(dimension)) + def completed(stage): + return N.norm((axis,1) for axis in axes[:9+8*stage]) + contacts, squares, target_profile = [], 0, Counter() + idle_jobs = Counter() + for _,stage,pair,back in (e for e in word['physical_events'] if e[0] == 'LOCAL'): + need(not back, 'No inverse-transpose local implementation') + spectator = N.norm((axis,1) for axis in axes[9:9+8*stage]) + for q in local['ports']: + basis = recipes[q]['idle_children'][0]['orthogonal_axes'][:8] + need(all((x&q).bit_count()%2 == 0 for x in basis), 'Fresh-block basis fixes central port') + need(all((a&b).bit_count()%2 == int(i==j) for i,a in enumerate(basis) for j,b in enumerate(basis)), 'Actual orthonormal basis') + swaps = [] if stage == 0 else [b ^ axes[9+8*(stage-1)+i] for i,b in enumerate(basis)] + route = tuple(e ^ N.act(swaps,sum(((e&v).bit_count()%2) << i for i,v in enumerate(swaps))) for e in axes) + need(all(N.act(route,route[i]) == axes[i] for i in range(dimension)), 'Route inverse') + need(all((a&b).bit_count()%2 == int(i==j) for i,a in enumerate(route) for j,b in enumerate(route)), 'Orthogonal physical route') + need(N.act(route,q) == q, 'Route preserves Q') + raw_x = N.norm([(q,1)]) if stage == 0 else completed(stage-1) + raw_y = () if stage == 0 else N.norm(list(raw_x)+[(q,-1)]) + entry_x, entry_y = N.norm(list(spectator)+[(q,1)]), spectator + out0 = N.norm(list(spectator)+[(axis,1) for axis in axes[:9]]) + exit_x, exit_y = out0, N.norm(list(out0)+[(q,-1)]) + out_x, out_y = completed(stage), N.norm(list(completed(stage))+[(q,-1)]) + maps = [N.contact(a,b,route,dimension) for a,b in [(raw_x,entry_x),(raw_y,entry_y),(exit_x,out_x),(exit_y,out_y)]] + delta = N.norm([(axis,1) for axis in axes[:9]]+[(q,-1)]) if stage == 0 else N.norm((axis,1) for axis in axes[9+8*(stage-1):9+8*stage]) + for incoming,outgoing in [(raw_x,out_x),(raw_y,out_y)]: + need(N.polynomial(N.norm(list(outgoing)+[(a,-c) for a,c in incoming]),dimension) == N.polynomial(delta,dimension), 'Actual diagonal D_s') + cross = N.norm(list(out_y)+[(a,-c) for a,c in raw_x]) + need(N.polynomial(cross,dimension) == N.polynomial(N.norm(list(delta)+[(q,-1)]),dimension), 'Actual cross term D_s Q^-1') + need(sum(route[i] != axes[i] for i in range(dimension)) <= 17 and all(m['translation'].bit_count() <= 17 and m['inverse_translation'].bit_count() <= 17 for m in maps), 'Fixed seventeen-axis route allowance') + contacts.append([stage,q,maps]) + for q in local['ports']: + # Multiply the Gaussian pair twice with exact real and imaginary parts. + a,b = (Q(1,2),Q(1,2)), (Q(1,2),Q(-1,2)) + mul = lambda z,w: (z[0]*w[0]-z[1]*w[1],z[0]*w[1]+z[1]*w[0]) + plus = lambda z,w: (z[0]+w[0],z[1]+w[1]) + diagonal,off = plus(mul(a,a),mul(b,b)), plus(mul(a,b),mul(b,a)) + need(diagonal == (0,0) and off == (1,0), 'Q^2 is translation with phase +1') + for address in range(512): + need({address:diagonal,address^q:off}[address^q] == (1,0), 'Every central square column') + squares += 1 + for term in word['diagonal']: + qp,selected = term[0],term[1:] + physical = N.norm([(q,qp)]+[(axis,1) for s,yes in enumerate(selected) if yes for axis in (axes[:9] if s == 0 else axes[9+8*(s-1):9+8*s])]+[(q,-1)]*selected[0]) + positive = list(axes[:9]) if selected[0] else [q] + positive += [axis for s in range(1,len(selected)) if selected[s] for axis in axes[9+8*(s-1):9+8*s]] + need(N.polynomial(physical,dimension) == N.polynomial(N.norm([(x,1) for x in positive]+[(q,2)]*(qp == -1)),dimension), 'Full main output phase and rank') + target_profile[len(positive)] += 1 + for e in word['physical_events']: + if e[0] != 'IDLE': + continue + stages = e[2] + need(len(stages) == len(set(stages)), 'Whole idle has no repeated stage') + for q in local['ports']: + positive, physical = [], [] + for stage in stages: + if stage == 0: + positive += recipes[q]['idle_children'][0]['orthogonal_axes'][:8] + physical += [(x,1) for x in axes[:9]]+[(q,-1)] + else: + block = axes[9+8*(stage-1):9+8*stage] + positive += block + physical += [(x,1) for x in block] + need(len(positive) == 8*len(stages), 'All idle Gaussian axes') + need(all((a&b).bit_count()%2 == int(i==j) for i,a in enumerate(positive) for j,b in enumerate(positive)), 'Independent orthonormal idle axes') + N.contact(N.norm(physical),N.norm((x,1) for x in positive),axes,dimension) + idle_jobs[len(positive)] += 2 + return {'ports':104,'full_calls':18,'physical_contacts':4*len(contacts),'central_square_columns':squares, + 'main_targets':dict(target_profile),'whole_idle_jobs':dict(idle_jobs),'route_payload_sha256':sha256(json.dumps(contacts,separators=(',',':')).encode()).hexdigest(), + 'wrapper_sites':word['wrapper_sites'],'new_paid_jobs':0,'tensor_rule':'Factorwise native maps; scalar signs stay outside the tensor power.'} + + +def controls(word): + bad = deepcopy(word) + bad['physical_events'].remove(next(e for e in bad['physical_events'] if e[0] == 'Q_POWER')) + try: + replay(bad) + except ValueError: + return {'missing_central_translation':'Rejected by the complete Laurent endpoint'} + raise ValueError('Missing central translation accepted') diff --git a/research/p104-productive-controller/local.py b/research/p104-productive-controller/local.py new file mode 100644 index 0000000000..dbb3d56a4f --- /dev/null +++ b/research/p104-productive-controller/local.py @@ -0,0 +1,264 @@ +"""Replay the credited P104 word and its complete native interfaces. + +David Arias supplied the coalesced word. Cinna Davis supplied private reuse. +Gareth Davidson supplied their composition. Ali Romman prepared this caller +with substantial OpenAI Codex assistance. Apache-2.0. +""" +from collections import Counter +from fractions import Fraction as Q +from functools import lru_cache +from hashlib import sha256 +from pathlib import Path +import gzip +import importlib.util +import json +import sys +import tarfile +import tempfile + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +PREFIX = 'research/p104-coalesced-private-reuse/' +GEOMETRY = ('research/complex-block-rank-optimum/inputs/selected.json.gz', + 'research/frame-sa504/inputs/hamming/PROTOTYPE.json', + 'research/p104-native-channel/inputs/P104-FIXTURE.json') + + +def need(ok, why): + if not ok: + raise ValueError(why) + + +def read(path): + raw = path.read_bytes() + return json.loads(gzip.decompress(raw) if path.suffix == '.gz' else raw) + + +def load(path, name): + spec = importlib.util.spec_from_file_location(name, path) + module = importlib.util.module_from_spec(spec) + sys.modules[name] = module + spec.loader.exec_module(module) + return module + + +def add(dst, src, q): + for k, v in tuple(src.items()): + value = dst.get(k, 0) + q*v + if value: + dst[k] = value + else: + dst.pop(k, None) + + +def span(basis): + out = {0} + for v in basis: + need(type(v) is int and 0 < v < 512 and v not in out, 'Independent binary basis') + out |= {x ^ v for x in tuple(out)} + return frozenset(out) + + +def construct(): + """Rebuild the published source without its obsolete owner-price engine.""" + manifest = read(ROOT / (PREFIX+'SOURCES.json')) + archive, = manifest['archives'] + raw = (ROOT / (PREFIX+'predecessor2152.tar.gz')).read_bytes() + need(sha256(raw).hexdigest() == archive['sha256'], 'Exact predecessor archive') + pins = {x['path']: x for x in archive['members']} + with tempfile.TemporaryDirectory(prefix='p104-source-') as tmp: + root = Path(tmp) + with tarfile.open(ROOT / (PREFIX+'predecessor2152.tar.gz')) as data: + members = data.getmembers() + need(len(members) == len(pins) == 11 and {m.name for m in members} == set(pins), 'Archive inventory') + for m in members: + need(m.isfile() and not Path(m.name).is_absolute() and '..' not in Path(m.name).parts, 'Archive file') + raw = data.extractfile(m).read() + need(sha256(raw).hexdigest() == pins[m.name]['sha256'], 'Archive member pin') + path = root/m.name + path.parent.mkdir(parents=True, exist_ok=True) + path.write_bytes(raw) + for path in GEOMETRY: + target = root/path + target.parent.mkdir(parents=True, exist_ok=True) + target.write_bytes((ROOT/path).read_bytes()) + C = load(root/'research/p104-interleaved-search/coalesced.py', 'productive_p104_coalesced') + A = load(ROOT/(PREFIX+'compose.py'), 'productive_p104_composition') + built = A.construct(C, C.construct()) + need(built['report'] == read(ROOT/(PREFIX+'RESULT.json'))['composition'], 'Published complete source report') + frames, numbers = [], {} + def frame(basis): + key = tuple(basis) + if key not in numbers: + numbers[key] = len(frames) + frames.append(list(key)) + return numbers[key] + initial = [frame(C.F.basis(x)) for x in built['initial']] + final = [frame(C.F.basis(x)) for x in built['final']] + live = [r for r in range(112) if len(built['initial'][r]) == 2] + edges = built['transport_edges'] + program = [] + for e in built['scalar_operations']: + op = e['kind'] + if op == 'transport': + edge = edges[e['occurrence']] + program.append(['MOVE', edge['register'], frame(edge['source_frame']), frame(edge['target_frame']), edge['private']]) + elif op in ('private_init', 'private_discard'): + program.append(['INIT' if op == 'private_init' else 'CLEAR', e['register'], frame(e['frame'])]) + else: + program.append([{'add':'ADD', 'scale':'SCALE', 'private_copy':'COPY'}[op], *e['registers'], e['coefficient'], frame(e['frame'])]) + return {'schema':'p104-productive-source/1', 'public':735, 'live':live, 'ports':built['ports'], + 'frames':frames, 'initial':initial, 'final':final, 'program':program} + + +def replay(w): + need(len(w['program']) < 26000, 'Fixed operation bound') + frames = [span(x) for x in w['frames']] + rows = [{r:Q(1)} for r in range(743)] + current = list(w['initial']) + [None]*8 + paid, scalar, live_owned, peak = Counter(), 0, set(), 0 + for e in w['program']: + op, r = e[:2] + need(0 <= r < 743, 'Role index') + if op == 'MOVE': + _, r, a, b, private = e + need(current[r] == a and (r in live_owned) == private, 'Transport source and ownership') + need(frames[b] < frames[a] if private else frames[a] < frames[b], 'Nested chronological transport') + paid[abs(len(w['frames'][b])-len(w['frames'][a]))] += 1 + current[r] = b + elif op == 'INIT': + need(r >= 735 and r not in live_owned, 'Owned initialization') + live_owned.add(r) + peak = max(peak, len(live_owned)) + rows[r] = {} + current[r] = e[2] + scalar += 2 + elif op == 'CLEAR': + need(r in live_owned and current[r] == e[2], 'Owned erasure at declared frame') + rows[r] = {} + current[r] = None + live_owned.remove(r) + scalar += 2 + else: + q, f = Q(e[-2]), e[-1] + need(q and current[r] == f, 'Scalar destination and coefficient') + n, d = abs(q.numerator), q.denominator + need(d & (d-1) == 0, 'Dyadic scalar coefficient') + need(abs(q)+1 < 2**16, 'Fixed scalar growth bound') + if op == 'SCALE': + need(n & (n-1) == 0, 'Dyadic unit SCALE') + rows[r] = {k:q*x for k,x in rows[r].items()} + scalar += 2*(abs(n.bit_length()-d.bit_length()) + int(q < 0)) + else: + s = e[2] + need(s != r and 0 <= s < 743 and current[s] == f, 'Common scalar chart') + if op == 'COPY': + need(r in live_owned and not rows[r], 'COPY into cleared owned field') + rows[r] = {k:q*x for k,x in rows[s].items()} + else: + need(op == 'ADD', 'Scalar opcode') + add(rows[r], rows[s], q) + scalar += 2*(3+n.bit_length()-1+n.bit_count()+d.bit_length()-1) + need(not live_owned and peak == 1 and current[:735] == w['final'], 'All public and owned exits') + live = set(w['live']) + for r,row in enumerate(rows): + expected = {r:Q(1)} if r < 735 else {} + if r-112 in live: + expected[r-112] = Q(1) + need(row == expected, 'All 743 public and owned rows') + main = live | {r+112 for r in live} + helpers = Counter(len(w['frames'][w['final'][r]])-len(w['frames'][w['initial'][r]]) for r in range(735) if r not in main) + need(len(live) == len(w['ports']) == 104 and len(main) == 208 and min(helpers) > 0, 'Independent productive inputs') + return {'paid':dict(paid), 'helpers':dict(helpers), 'public_inputs':735, 'owned_lifetimes':8, + 'peak_owned_fields':peak, 'real_scalar_allowance':scalar, 'endpoint_coefficients':743*743} + + +def reverse_columns(w): + """Check the transpose with dense dyadic rows and the reverse chronology.""" + n = 743 + rows = [[int(i == j) for j in range(n)] for i in range(n)] + exponents = [0]*n + for e in reversed(w['program']): + op,r = e[:2] + if op == 'MOVE': + continue + if op in ('INIT','CLEAR'): + rows[r] = [0]*n + exponents[r] = 0 + continue + q = Q(e[-2]) + qe = q.denominator.bit_length()-1 + if op == 'SCALE': + rows[r] = [q.numerator*x for x in rows[r]] + exponents[r] += qe + else: + s = e[2] + level = max(exponents[s], exponents[r]+qe) + a, b = 1 << (level-exponents[s]), q.numerator << (level-exponents[r]-qe) + rows[s] = [a*x+b*y for x,y in zip(rows[s],rows[r])] + exponents[s] = level + if op == 'COPY': + rows[r] = [0]*n + exponents[r] = 0 + r = s + while exponents[r] and not any(x & 1 for x in rows[r]): + rows[r] = [x//2 for x in rows[r]] + exponents[r] -= 1 + for r,row in enumerate(rows): + expected = [0]*n + if r < 735: + expected[r] = 1 << exponents[r] + if r in w['live']: + expected[r+112] = 1 << exponents[r] + need(row == expected, 'Independent dense transpose columns') + return {'columns':n, 'coefficients':n*n, 'arithmetic':'Dense integer rows with binary denominators; reverse chronology'} + + +def native(w): + C = load(ROOT/'research/p104-native-channel/vendor/clifford_exact.py', 'p104_productive_clifford') + V = load(ROOT/'research/p104-native-channel/vendor/native_verify.py', 'p104_productive_gaussian') + @lru_cache(None) + def chart(i): + return C.canonical_frame(9, tuple(w['frames'][i])) + recipes = {} + def check(a,b): + if (a,b) not in recipes: + recipe,_ = C.lower_child(chart(a).adjoint().then(chart(b))) + expected = V.adjoint(V.frame(w['frames'][a],9)) + V.frame(w['frames'][b],9) + V.equal(V.recipe(recipe),expected,'Native chart change and exact global phase') + need(recipe['rank'] == abs(len(w['frames'][a])-len(w['frames'][b])), 'Native boundary rank') + recipes[a,b] = recipe + return recipes[a,b] + for e in w['program']: + if e[0] == 'MOVE': + check(e[2],e[3]) + main = set(w['live']) | {r+112 for r in w['live']} + helper_profile = Counter() + for r in range(735): + if r not in main: + helper_profile[check(w['initial'][r],w['final'][r])['rank']] += 1 + adapters = [] + for r,q in zip(w['live'],w['ports']): + need(w['frames'][w['initial'][r]] == [q], 'Literal central port') + need(span(w['frames'][w['final'][r+112]]) == frozenset(x for x in range(512) if not (x&q).bit_count()%2), 'Literal output hyperplane') + tests = [ + (C.cgate(9,q,1).adjoint().then(chart(w['initial'][r])), V.adjoint((('C',q,1),))+V.frame(w['frames'][w['initial'][r]],9)), + (chart(w['final'][r+112]).adjoint().then(C.cgate(9,q,-1).then(C.fourier(9))), V.adjoint(V.frame(w['frames'][w['final'][r+112]],9))+(('C',q,-1),)+V.fourier(9))] + for actual,expected in tests: + recipe,_ = C.lower_child(actual) + need(recipe['rank'] == 0, 'Free intrinsic main adapter') + V.equal(V.recipe(recipe),expected,'Main endpoint phase') + adapters.append(recipe) + bad = json.loads(json.dumps(next(iter(recipes.values())))) + bad['left']['phase'] = (bad['left']['phase']+1)%4 + a,b = next(iter(recipes)) + try: + V.equal(V.recipe(bad),V.adjoint(V.frame(w['frames'][a],9))+V.frame(w['frames'][b],9),'Wrong phase control') + except ValueError: + pass + else: + raise ValueError('Wrong native phase accepted') + payload = [[a,b,recipes[a,b]] for a,b in sorted(recipes)] + adapters + return {'distinct_maps':len(recipes),'main_adapters':len(adapters),'helper_normalizers':2*sum(helper_profile.values()), + 'helpers':dict(helper_profile),'recipe_payload_sha256':sha256(json.dumps(payload,sort_keys=True,separators=(',',':')).encode()).hexdigest(), + 'wrong_phase_rejected':True, 'proof':'Every signed Pauli image and exact global phase; frame induction at every positive tensor width'} diff --git a/research/p104-productive-controller/price.py b/research/p104-productive-controller/price.py new file mode 100644 index 0000000000..6c856e173c --- /dev/null +++ b/research/p104-productive-controller/price.py @@ -0,0 +1,153 @@ +"""Complete mixed-target price, compiler and outer transfer. + +The interval and compiler bounds follow zxv and Cao Yifan. The productive +recursion is by Jacob Alan Sussman. The controller is by Cinna Davis. +Ali Romman with substantial OpenAI Codex assistance. Apache-2.0. +""" +from collections import Counter +from fractions import Fraction as Q +import local as L + +KAPPA, TESTED = Q('.00304057'), Q('.003040575') +PREVIOUS = Q('605457647/200000000000') + + +def encode(x): + if isinstance(x,Q): + return str(x) + if isinstance(x,dict): + return {str(k):encode(v) for k,v in x.items()} + if isinstance(x,(list,tuple)): + return [encode(v) for v in x] + return x + + +def assemble(local, native, word, physical): + paid, targets = Counter(), Counter() + counts = Counter() + L.need(local['helpers'] == native['helpers'], 'Every productive helper has a native target') + for e in word['physical_events']: + counts[e[0]] += 1 + if e[0] == 'LOCAL': + L.need(e[3] is False, 'Every source invocation is forward') + paid.update(local['paid']) + targets.update(local['helpers']) + elif e[0] == 'QUERY_SHEAR': + paid[1] += 104 + elif e[0] == 'IDLE': + paid[8*len(e[2])] += 208 + main = Counter() + idle = Counter({8*len(e[2]):0 for e in word['physical_events'] if e[0] == 'IDLE'}) + for e in word['physical_events']: + if e[0] == 'IDLE': + idle[8*len(e[2])] += 208 + L.need(idle == physical['whole_idle_jobs'], 'Every whole idle has a native Gaussian and full rank') + for term in word['diagonal']: + main[1+8*sum(term[1:])] += 104 + L.need(main == physical['main_targets'], 'Every main target has its full native phase') + targets.update(main) + L.need(counts['LOCAL'] == 18 and counts['QUERY_SHEAR'] == counts['IDLE'] == 15, 'Complete call census') + # Recount by the two path lengths, without using emitted main diagonals. + second_t = Counter({r:18*n for r,n in local['helpers'].items()}) + second_p = Counter({r:18*n for r,n in local['paid'].items()}) + second_t[145] += 208 + second_p[1] += 15*104 + for length in (7,8): + for j in range(1,length+1): + second_t[1+8*(j+1)] += 208 + second_p[8*(j+1)] += 208 + L.need((targets,paid) == (second_t,second_p), 'Independent full invoice') + L.need(max(targets) == 145 and max(paid) == 72, 'Maximum recursive ranks') + L.need(sum(targets.values()) == 12814 and sum(paid.values()) == 69930, 'Complete field and call counts') + L.need(sum(r*n for r,n in targets.items())-sum(r*n for r,n in paid.items()) == 760, 'Complete rank surplus') + return targets,paid,counts + + +def run(local,native,word,physical): + T,P,counts = assemble(local,native,word,physical) + E = L.load(L.ROOT/'research/higher-moment-strictification/verify.py','p104_productive_intervals') + other = L.load(L.ROOT/'research/kappa-rebuild/architecture/mixed_target_probe.py','p104_productive_second_intervals') + def margin(k): + a,b = E.moment(T,1-k), E.moment(P,1-k) + return a[0]-b[1],a[1]-b[0] + lo,hi,grid = 0,10**12,10**14 + while hi-lo > 1: + m=(lo+hi)//2 + if margin(Q(m,grid))[0] > 0: + lo=m + else: + hi=m + lower,upper = Q(lo,grid),Q(hi,grid) + L.need(margin(lower)[0] > 0 and margin(upper)[1] < 0, 'Strict rational crossing enclosure') + L.need(PREVIOUS < KAPPA < TESTED < lower and margin(PREVIOUS)[0] > 0, 'Changed complete bill improves selected kappa') + t,u,v,c,b = 1-TESTED,Q(1,5),1024,17,18 + target,paid = E.moment(T,t),E.moment(P,t) + tl,th = other.moment(T,TESTED) + pl,ph = other.moment(P,TESTED) + L.need(tl > ph and max(tl,target[0]) <= min(th,target[1]) and max(pl,paid[0]) <= min(ph,paid[1]), 'Two exact moment engines') + alpha = E.divide(paid,target) + gamma = E.divide(E.moment(P,t+u),E.mul(E.power(c,u),target)) + delta = E.divide((Q(sum(T.values())*b),)*2,E.mul(E.power(c,TESTED),target)) + reserve,decay = Q(1,10**10),Q(97,100) + L.need(alpha[1] < 1-reserve and gamma[1] < decay and delta[1] < decay, 'All three charged tail ratios') + L.need(decay**128 < Q(1,16), 'Both tail decay blocks') + normalized = 1/(1+v*reserve)+Q(4,2**32) + L.need(normalized < 1 and c**64 < b**63, 'Full completion, splitting and rounding charges') + theta,power = Q(63,64),1000 + eta = E.scale(E.power(145,-v*TESTED),t) + L.need(2*(c**v)**64 <= (145**v)**63 and eta[0] > theta**power, 'Shifted exits and complement capacity') + L.need(E.power(145,v*TESTED)[1] < 2**power, 'Compiler initial range') + gap = (TESTED-KAPPA)/7 + L.need(gap.numerator == 1, 'Exact compiler integer grid') + step = gap.denominator + def wins(j): + return (step*j+1)**power < 2**j + left,right=1,2 + while not wins(right): + left,right=right,2*right + while right-left > 1: + m=(left+right)//2 + if wins(m): + right=m + else: + left=m + H=step*right + L.need(H > 8*v and wins(right) and not wins(right-1), 'Finite uniform threshold with predecessor rejection') + local_routes = (sum(local['paid'].values())+native['helper_normalizers']+native['main_adapters']+4*104+4*local['owned_lifetimes'])*1000 + L.need(local['real_scalar_allowance']+local_routes < 10**7, 'Every local scalar, route and owned operation is funded') + boundary = sum(len(word['boundaries'][side+'_program']) for side in ('left','right')) + raw = 18*10**7 + 15*1664 + 32*104*(len(word['physical_events'])+boundary) + raw += 32*104*(26+1000) + L.need(raw < 10**9, 'Complete nonrecursive raw bound') + bit = L.read(L.ROOT/'research/query-thinned-controllers/RESULT.json')['ordinary_BIT'] + atom = Q(bit['atom']) + ordinary=(1-atom)*Q(bit['after_cover'])+atom*Q('.0000384599') + admitted=Q(bit['admitted']) + L.need(atom > ordinary > admitted > TESTED and atom < 1-ordinary, 'Retained BIT admission and stock') + outer_module=L.load(L.ROOT/'research/pr4359-p7-padding/dependencies/compiler-refill/endpoint.py','p104_productive_outer') + params={'kappa':KAPPA,'tested_saving':TESTED,'complex_uniform_saving':KAPPA+6*gap, + 'b':KAPPA+5*gap,'a':KAPPA+4*gap,'q':KAPPA+3*gap,'bit_saving':admitted, + 'epsilon':1-gap,'beta':1-3*gap,'r0':gap/10,'stop':gap,'layout':gap,'d':gap} + outer=outer_module.ledger(params) + outer['functional_checks']['actual_new_BIT_stock_sublinear']=params['beta']*(1-atom) + L.need(len(outer['strict_checks']) == 54 and len(outer['functional_checks']) == 4, 'Complete outer predicate inventory') + L.need(all(x > 0 for key in ('strict_checks','functional_checks') for x in outer[key].values()), 'All outer inequalities strict') + wrong_cutoff = E.divide((Q(sum(T.values())*21),)*2,E.mul(E.power(20,TESTED),target)) + L.need(wrong_cutoff[0] > 1, 'Old cutoff fails with this helper inventory') + bad=outer_module.ledger(dict(params,bit_saving=Q('.0027'))) + L.need(any(x <= 0 for x in bad['strict_checks'].values()), 'Insufficient BIT contract rejected') + return encode({'kappa':KAPPA,'kappa_decimal':'.00304057','previous_selected':PREVIOUS,'gain':KAPPA-PREVIOUS, + 'relative_gain_percent':100*(KAPPA/PREVIOUS-1),'raw_root_interval':[lower,upper], + 'raw_headroom':[lower-KAPPA,upper-KAPPA],'margin_at_previous':E.display(margin(PREVIOUS)), + 'targets':T,'paid':P,'productive_fields':sum(T.values()),'paid_calls':sum(P.values()), + 'rank_mass_surplus':760,'full_forward_calls':18,'query_shears':15,'whole_idle_jobs':3120, + 'strictification':{'tested':TESTED,'power':v,'cutoff':c,'floor':b,'tail_offset':u,'reserve':reserve, + 'alpha':E.display(alpha),'gamma':E.display(gamma),'delta':E.display(delta),'normalized_paid_upper':normalized}, + 'compiler':{'theta':theta,'logarithm_power':power,'eta':E.display(eta),'gap':gap,'H':H,'N':'2^'+str(H), + 'integer_test_exponent':right,'uniform_saving':params['complex_uniform_saving'],'word_materialized':False}, + 'nonrecursive':{'local_scalar':local['real_scalar_allowance'],'local_routes':local_routes, + 'raw_scalar_upper':raw,'raw_budget':10**9,'peak_owned_fields':1, + 'fixed_scalar_growth_bound':'At most 2^(16*26000) before native factors; a declared constant, not an attained norm.', + 'tensor_native_growth_bound':'Each rank-r Gaussian has row l1 norm at most 2^(rf); sum of local ranks is 5894.'}, + 'ordinary_BIT':bit,'outer':outer, + 'negative_controls':{'old_cutoff':'Rejected by completion-tail ratio greater than one','old_BIT':'Rejected by outer inequalities'}}) diff --git a/research/p104-productive-controller/verify.py b/research/p104-productive-controller/verify.py new file mode 100644 index 0000000000..9b4c4d61e6 --- /dev/null +++ b/research/p104-productive-controller/verify.py @@ -0,0 +1,86 @@ +"""Check the complete conditional P104 improvement and its immutable evidence. + +Ali Romman with substantial OpenAI Codex assistance. Apache-2.0. +""" +import argparse +from copy import deepcopy +from hashlib import sha1,sha256 +import gzip +import json +import sys +from pathlib import Path +sys.dont_write_bytecode = True +sys.path.insert(0, str(Path(__file__).resolve().parent)) +import local as L +import caller as C +import price as P + + +def authenticate(): + count=0 + for row in L.read(L.HERE/'SOURCES.json')['files']: + if row['usage'] == 'input': + raw=(L.ROOT/row['path']).read_bytes() + L.need(sha256(raw).hexdigest() == row['sha256'], 'Changed source: '+row['path']) + L.need(sha1(b'blob '+str(len(raw)).encode()+b'\0'+raw).hexdigest() == row['git_blob'], 'Source Git object') + count+=1 + return count + + +def rejected(action,label): + try: + action() + except ValueError: + return label + raise ValueError('Control accepted: '+label) + + +def run(): + pins=authenticate() + word=L.construct() + local=L.replay(word) + columns=L.reverse_columns(word) + print('PASS complete source rows, reverse integer columns and owned lifetimes',flush=True) + native=L.native(word) + print('PASS every native paid map, productive helper and main adapter',flush=True) + controller=C.construct() + physical=C.physical(controller,word) + costs=P.run(local,native,controller,physical) + controls=C.controls(controller) + bad=deepcopy(word) + bad['program'].remove(next(e for e in bad['program'] if e[0] == 'COPY')) + controls['omitted_copy']=rejected(lambda:L.replay(bad),'Rejected by full arbitrary-input endpoint') + bad=deepcopy(word) + e=next(e for e in bad['program'] if e[0] == 'MOVE') + e[2]=e[3] + controls['wrong_frame']=rejected(lambda:L.replay(bad),'Rejected by literal source-frame check') + bad=deepcopy(local) + bad['helpers'][9]+=1 + controls['unearned_helper']=rejected(lambda:P.assemble(bad,native,controller,physical),'Rejected by native helper census') + result={'status':'PASS_P104_PRODUCTIVE_COMPLETE_KAPPA_00304057','source_inputs_authenticated':pins, + 'local':local,'separate_columns':columns,'native':native,'physical_caller':physical, + 'complete_cost':costs,'negative_controls':controls, + 'limits':['Conditional on the retained native all-column, owned-erasure, compiler, precision/tape and analytic-recovery framework.', + 'The winning uniform compiler word and complete integer multiplier are not materialized.', + 'No proof-kernel check or independent human review is claimed.']} + return P.encode(result),word,controller + + +def main(): + parser=argparse.ArgumentParser(description=__doc__) + parser.add_argument('--write',action='store_true') + args=parser.parse_args() + result,word,controller=run() + for name,data in [('RESULT.json',result),('WORD.json.gz',word),('CONTROLLER.json',controller)]: + path=L.HERE/name + if args.write: + raw=(json.dumps(data,indent=None if name.endswith('.gz') else 2,sort_keys=True)+'\n').encode() + path.write_bytes(gzip.compress(raw,mtime=0) if name.endswith('.gz') else raw) + else: + L.need(L.read(path) == data,'Exact frozen artifact: '+name) + print(result['status']) + print(json.dumps({k:result['complete_cost'][k] for k in ('kappa','gain','raw_root_interval','productive_fields','paid_calls')},sort_keys=True)) + + +if __name__ == '__main__': + main()