diff --git a/research/p104-delayed-shared-relay/COMPOSITION.md b/research/p104-delayed-shared-relay/COMPOSITION.md new file mode 100644 index 0000000000..c5997c88e2 --- /dev/null +++ b/research/p104-delayed-shared-relay/COMPOSITION.md @@ -0,0 +1,60 @@ +# Composition and ownership accounting + +Start from PR5608's authenticated parent construction: the shared587 relay with +the PR5565 commuting cascade. Apply the source-pinned delayed696 construction +before splitting. Every735-input endpoint and chart must agree, with exact +paid change `H4+H7-H5-H6` and unchanged target histogram. + +The13 retained PR5608 helper split witnesses keep the same rational vectors, +pivots, charts and rank declarations. Only event cuts move. PR5599's retained +split checker recomputes every full prefix functional and suffix direction +before each application, and all independent endpoints are replayed after each +split. This is essential: an old endpoint proof alone does not authenticate a +new intermediate cut. + +Next apply the four exact declarations from PR5601. Three scalar contacts move +to the declared common charts and helper307's endpoint changes from rank5 to4. +The unique-contact adapter rebuilds only affected public MOVE segments. Full +replay verifies the paid delta `-2H2+2H3-2H4+H5` and target delta `H4-H5`. + +Finally apply Scratch-net's PR5606 preparation to the retained rank-two prefix573. +At its two actual destination charts, exact current-value identities are + +`current573-current572+2current732 = -2 original573`, + +`current573-current572-2current710 = -2 original573`. + +The verifier derives these identities over all748 source inputs before removing +the573 coordinate. Preparing that role at zero makes each value reconstructible +by coframed COPY/ADD operations. Its two H1 transports disappear, and its H2 +productive target is debited. The independent rank-seven successor is retained. +The573 slot is now an owned role, with explicit initialization, reset and final +return. It is not simultaneously credited as an independent input. + +The resulting interface has747 independent inputs and nine owned roles in756 +slots. There are11 owned lifetimes and peak occupancy two. The exact checker +validates every field, frame, owned lifetime and final row, including arbitrary +initial dirty-owned coordinates and every required zero return. Native evaluation +checks every remaining paid map and source endpoint normalization; the retired +H2 target and its two external normalizers are then explicitly removed, matching +PR5606's declared accounting contract. + +Relative to PR5608, the complete local changes are + +`Delta paid = -2H1-2H2+2H3-H4-H6+H7`, + +`Delta targets = -H2+H4-H5`. + +The full caller invokes these changes18 times. The complete bill is66,636 paid +calls and13,030 targets with surplus760. It includes all queries, whole idles, +main adapters, helper normalization, ordinary scalar work and routes. The +owned-lifetime count and peak are actual replay outputs, not inherited literals. + +The primary exact interval engine encloses the raw crossing, and an independent +engine checks overlap and positive funding at0.0031029905. Completion, compiler +and all58 outer predicates are checked with the retained power1024 parameters. +The claimed conditional endpoint is0.00310299. The inherited theorem assumptions +and unmaterialized uniform word remain stated in README.md. + +Prepared for flyingviper with substantial OpenAI Codex assistance and independent +agents, retaining the predecessor attribution. Apache-2.0. diff --git a/research/p104-delayed-shared-relay/MECHANISM.md b/research/p104-delayed-shared-relay/MECHANISM.md new file mode 100644 index 0000000000..d083dc907a --- /dev/null +++ b/research/p104-delayed-shared-relay/MECHANISM.md @@ -0,0 +1,121 @@ +# Delaying public preparation through a shared component + +This construction continues the verified shared587 relay and148 contraction. +Its source is `contracted-587-relay-WORD.json`, with canonical sorted-key JSON +SHA256 `95078b95bae0c56927f6daaa4430457cc43862c24a9db3b015bb1366e3381055`. +The underlying frozen word is PR5580, head +`6efa248cf456d6101d757e9d09ba29711d18a13a`. + +This note proves the new component. The package verifier separately checks the +composed word, complete native/caller/ordinary bill and analytic predicates. + +## The changed preparation + +Write `P` for the public133 value copied into owned738. At its final line597, +public734 contains `x734-P/2`. All `x` variables below are arbitrary original +inputs; none is assumed zero. + +At frame1031, before the relevant producer preparation, let the current public +values699,701,702,703 be `a,b,c,d`. The original preparation forms + +* `696 = x696-a+b+c`; +* `700 = x700-b-c`, later updated to `700-d`. + +The opposite coefficients of `b+c` permit a useful retiming. Public700 retains +that component after701 and702 have ascended and after `P` has become available. +Consequently696 need not ascend early just to read701 and702 separately. + +After the last original zero-frame read of696, add `x700-x734` to696 while +all three fields remain at frame3. Delete its original ascent3-to1031 and +the original three additions from699,701,702. Immediately after734 receives +the owned value at597, perform + +1. `MOVE 696,3,597`; `ADD 696,734,+1`; +2. `MOVE 696,597,1031`; +3. `ADD 696,699,-1`; `ADD 696,700,-1`. + +The resulting value is exactly the original696 value minus `P/2`: + +`x696+x700-x734 + (x734-P/2) - a - (x700-b-c)`. + +The changed itinerary uses existing frames. The two new ascent ranks are1 +and4, replacing the original rank5. + +## Coupling the two later butterfly inputs + +At this point, still before the original `700 -= 703` update, define + +`S = current696 + current700 + current699 = Z-P/2`, +`Z = x696+x700`. + +Add `S` into703 using three ordinary ADDs. Then add the same old `S` into700 +using `SCALE 700,2`, `ADD 700,696,+1`, and `ADD 700,699,+1`. The subsequent +unchanged `700 -= 703` update cancels700's entire added quantity. + +Thus the later696/703 butterfly receives perturbations `-P/2` and `Z-P/2` +in its two inputs. Its sum delivered to159 changes by `Z-P`. Its complementary +output delivered to222 changes by `-Z`. All other live-input effects cancel. + +Delete the remaining owned738 read into159. That read originally added +`P/2`, later scaled by159's factor `-2`, so deleting it adds `P` to the final159 +value. Combining the deletion with the changed butterfly leaves only + +`out159 += Z`, `out222 -= Z` + +on outputs whose final frames have dimension below nine. + +Four initial common-zero-frame ADDs cancel these nuisance terms: subtract +both `x696` and `x700` from159, and add both into222. These are distinct +source and destination coordinates. Exact arbitrary-input replay verifies +the cancellation; it does not rely on clean helper inputs. + +Owned738 now goes directly from591 to597, a rank7 descent. The intermediate +rank7 frame565 and its scalar contact are removed. + +## Full-frame cleanup + +Immediately before the original `ADD 133,288,1/2` at full frame127, exactly +five public rows still differ. Let `L=Z-P/2`. Their errors are + +| Role | Error | +| --- | --- | +|696|`-P/2`| +|697|`L`| +|698|`-L`| +|700|`L`| +|703|`L`| + +At this cut, the actual current rows satisfy + +`133=P`, `696=x696-P/2`, `700=x696+2*x700-P/2`, + +so `L=(current696+current700)/2`. All six involved rows are at127. First +subtract half of each carrier696 and700 from697 and703; add half of each +to698. Next scale700 by1/2 and subtract696/2, restoring `x700`. Finally add +133/2 to696, restoring `x696`. These nine operations restore every row +before the unchanged suffix. Source identities and operation ordering are +checked over all735 original-input columns. + +## Invoice and exact verification + +The public preparation replaces `H5` by `H1+H4`. Removing the last owned +contact replaces `H1+H6` by `H7`. The net paid change relative to the +shared587 candidate is therefore + +`H4 + H7 - H5 - H6`. + +For `H_r=r^t`, `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':'.00309871','previous_open_pr5599':PREVIOUS,'gain':KAPPA-PREVIOUS, ++ return encode({'kappa':KAPPA,'kappa_decimal':'.00310299','previous_open_pr5608':PREVIOUS,'gain':KAPPA-PREVIOUS, + 'relative_gain_percent':100*(KAPPA/PREVIOUS-1),'raw_root_interval':[lower,upper], + 'raw_headroom':[lower-KAPPA,upper-KAPPA], + 'raw_ceiling':{'interval':[Q(0),cap],'derivative_upper':derivative_upper},'margin_at_previous':E.display(margin(PREVIOUS)), diff --git a/research/p104-delayed-shared-relay/PRICING-EDITS.json b/research/p104-delayed-shared-relay/PRICING-EDITS.json new file mode 100644 index 0000000000..1c88700c44 --- /dev/null +++ b/research/p104-delayed-shared-relay/PRICING-EDITS.json @@ -0,0 +1,22 @@ +[ + [ + "KAPPA, TESTED = Q('.00309871'), Q('.0030987101')", + "KAPPA, TESTED = Q('.00310299'), Q('.0031029905')" + ], + [ + "PREVIOUS = Q('.00309839')", + "PREVIOUS = Q('.00310184')" + ], + [ + "sum(targets.values()) == 13066 and sum(paid.values()) == 66816", + "sum(targets.values()) == 13030 and sum(paid.values()) == 66636" + ], + [ + "'kappa_decimal':'.00309871'", + "'kappa_decimal':'.00310299'" + ], + [ + "previous_open_pr5599", + "previous_open_pr5608" + ] +] diff --git a/research/p104-delayed-shared-relay/README.md b/research/p104-delayed-shared-relay/README.md new file mode 100644 index 0000000000..39eb46193d --- /dev/null +++ b/research/p104-delayed-shared-relay/README.md @@ -0,0 +1,111 @@ +# Conditional kappa 0.00310299 from delayed shared preparation + +This construction raises complete conditional kappa from **0.00310184** in +[PR #5608](https://github.com/CrocSwap/integer-mult-bounds/pull/5608) to +**0.00310299**, a gain of **0.00000115**. Its new mechanism delays the +preparation of public helper696 by reusing a complementary component already +present in helper700. Coupled corrections remove the remaining owned738 +delivery into159. Every retained independent helper input is preserved exactly. + +The new mechanism has paid delta `H4+H7-H5-H6`, strictly negative for +`Hr=r^t`, `0 2^26*N^5 avoiding all fixed denominators and rank witnesses" + }, + "outer": { + "functional_checks": { + "actual_new_BIT_stock_sublinear": "3485999999253/3500000000000", + "fixed_halo_explicit_metadata_branch": "269500000001/3500000000", + "new_BIT_row_stock_sublinear_in_active_group": "13957999997009/14000000000000", + "new_semantic_group_guard": "3/14000000000" + }, + "margins": { + "boundary_algebraic_matrix": "608186095956558137/196000000000000000000", + "fused_gaussian": "608186095869674411/196000000000000000000", + "global_coordinate_router": "5430233/1750000000", + "group_bit_router": "76023263733709301/24500000000000000000", + "group_scans": "6999999999/7000000000", + "main_transform": "608186081956558137/196000000000000000000", + "microbox_face_corrections": "269500000001/3500000000", + "polynomial_products": "13999999999/14000000000", + "sparse_union_movement": "80233186095956558137/196000000000000000000" + }, + "parameters": { + "a": "5430233/1750000000", + "b": "8688373/2800000000", + "beta": "13999999997/14000000000", + "bit_saving": "17/5000", + "cap_xi": "178233186081956558137/196000000000000000000", + "complex_uniform_saving": "21720933/7000000000", + "d": "1/14000000000", + "epsilon": "13999999999/14000000000", + "kappa": "310299/100000000", + "lambda_": "3987588039/4000000000", + "lambda_prime": "13956558137/14000000000", + "layout": "1/14000000000", + "q": "43441863/14000000000", + "r0": "1/140000000000", + "stop": "1/14000000000", + "tested_saving": "6205981/2000000000" + }, + "strict_checks": { + "actual_bit_above_effective": "519767/1750000000", + "actual_logarithmic_gamma_guard": "1/14000000000", + "actual_logarithmic_group_guard": "17766813939043441863/98000000000000000000", + "alpha_logarithm_absorption": "1/140000000000", + "boundary_algebraic_matrix_above_kappa": "55956558137/196000000000000000000", + "cap_above_band": "80233186081956558137/196000000000000000000", + "cap_below_cell": "17766813904043441863/196000000000000000000", + "cap_below_phase_cell_power": "213766813918043441863/196000000000000000000", + "complex_above_effective": "1/14000000000", + "complex_below_one_over_32": "78811627/2800000000", + "complex_endpoint": "1/7000000000", + "epsilon_below_one": "1/14000000000", + "epsilon_positive": "13999999999/14000000000", + "fine_prime_halo_umbrella": "7/2", + "fused_gaussian_above_kappa": "55869674411/196000000000000000000", + "gaussian_above_main": "6956558137/98000000000000000000", + "global_coordinate_router_above_kappa": "1/3500000000", + "global_gamma_power_slack": "9/140000000000", + "group_below_dimension": "1/7000000000", + "group_bit_router_above_kappa": "8733709301/24500000000000000000", + "group_gauge_power_slack": "17766813938343441863/98000000000000000000", + "group_key_fits_record": "1/7000000000", + "group_positive": "13999999997/14000000000", + "group_scans_above_kappa": "6978279069/7000000000", + "halo_covers_generic_inverse_radius": "5", + "improvement_over_user_baseline": "686009790400418148631/500000000000000000000000", + "lambda_above_internal": "1/28000000000", + "lambda_above_sigma": "3/28000000000", + "lambda_above_tau": "1/28000000000", + "lambda_prime_above_lambda": "1/28000000000", + "lambda_prime_above_leaf": "5591311627/39200000000000000000", + "leaf_saving_above_effective": "2791311627/39200000000000000000", + "main_transform_above_kappa": "41956558137/196000000000000000000", + "membership_arithmetic_fits_record": "1/14000000000", + "microbox_face_corrections_above_kappa": "16843071221/218750000", + "microbox_halo_volume": "1106000000003/14000000000", + "new_complex_uniform_saving_above_b": "1/14000000000", + "new_semantic_guard_with_C1_one": "1/14000000000", + "polynomial_products_above_kappa": "13956558139/14000000000", + "positive_layout_slack": "1/14000000000", + "q_below_effective": "1/14000000000", + "q_below_internal": "1/14000000000", + "q_below_leaf": "5591311627/39200000000000000000", + "q_positive": "43441863/14000000000", + "short_record_fallback": "2791311627/2800000000", + "source_axis_superpolynomial": "1/14000000000", + "sparse_union_movement_above_kappa": "79625000055956558137/196000000000000000000", + "stop_below_one": "13999999999/14000000000", + "stop_positive": "1/14000000000", + "strassen_integer_power_gap": "1951441519231", + "support_router_span": "3/14000000000", + "theta_positive_polynomial_power": "2", + "union_header_fits_record": "3/14000000000", + "union_tag_work_per_visit_fits_record": "3/14000000000" + } + }, + "paid": { + "1": 41160, + "16": 416, + "2": 8208, + "24": 416, + "3": 8892, + "32": 416, + "4": 1638, + "40": 416, + "48": 416, + "5": 3024, + "56": 416, + "6": 324, + "64": 416, + "7": 270, + "72": 208 + }, + "paid_calls": 66636, + "previous_open_pr5608": "38773/12500000", + "productive_fields": 13030, + "query_shears": 15, + "rank_mass_surplus": 760, + "raw_ceiling": { + "derivative_upper": "-370519173374437907631942238998608487483221308111401125306333455/1569275433846670190958947355801916604025588861116008628224", + "interval": [ + "0", + "17/5000" + ] + }, + "raw_headroom": [ + "359333/100000000000000", + "179667/50000000000000" + ], + "raw_root_interval": [ + "310299359333/100000000000000", + "155149679667/50000000000000" + ], + "relative_gain_percent": "2875/77546", + "strictification": { + "alpha": { + "lower": "0.999999996856386327029278153746", + "upper": "0.999999996856386327029278153747" + }, + "cutoff": 17, + "delta": { + "lower": "0.971086804240977903538051748614", + "upper": "0.971086804240977903538051748615" + }, + "floor": 18, + "gamma": { + "lower": "0.967707833553141201331584924357", + "upper": "0.967707833553141201331584924358" + }, + "normalized_paid_upper": "5242880004882813/5242880536870912", + "power": 1024, + "reserve": "1/10000000000", + "tail_block": 128, + "tail_decay": "39/40", + "tail_offset": "1/5", + "tested": "6205981/2000000000" + }, + "targets": { + "1": 36, + "145": 208, + "17": 416, + "2": 72, + "25": 416, + "33": 416, + "4": 1620, + "41": 416, + "49": 416, + "5": 180, + "57": 416, + "65": 416, + "7": 90, + "73": 208, + "8": 288, + "9": 7416 + }, + "whole_idle_jobs": 3120 + }, + "controls": { + "missing_final_shared_cleanup": "All 756 public and owned rows", + "missing_owned_initialization": "Scalar destination and coefficient", + "missing_owned_return": "All public and owned exits", + "retired_target_credited": "Every productive helper has a native target", + "unpaid_transport": "Complete field and call counts" + }, + "events": 25529, + "local": { + "endpoint_coefficients": 571536, + "helpers": { + "1": 2, + "2": 4, + "4": 90, + "5": 10, + "7": 5, + "8": 16, + "9": 412 + }, + "owned_lifetimes": 11, + "paid": { + "1": 2200, + "2": 456, + "3": 494, + "4": 91, + "5": 168, + "6": 18, + "7": 15 + }, + "peak_owned_fields": 2, + "public_inputs": 747, + "real_scalar_allowance": 220720 + }, + "local_paid_delta_vs_pr5608": { + "1": -2, + "2": -2, + "3": 2, + "4": -1, + "6": -1, + "7": 1 + }, + "local_target_delta_vs_pr5608": { + "2": -1, + "4": 1, + "5": -1 + }, + "native": { + "distinct_maps": 2917, + "helper_normalizers": 1078, + "helpers": { + "1": 2, + "2": 4, + "4": 90, + "5": 10, + "7": 5, + "8": 16, + "9": 412 + }, + "main_adapters": 208, + "proof": "Every signed Pauli image and exact global phase; frame induction at every positive tensor width", + "recipe_payload_sha256": "93be400a7ad26a4ec5a95de46ae510b434a94ed06b9272988cd4275da9543ad3", + "retired_helper": 573, + "wrong_phase_rejected": true + }, + "physical": { + "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 + ] + }, + "prepared_relations": [ + { + "combination": [ + [ + 573, + 1 + ], + [ + 572, + -1 + ], + [ + 732, + 2 + ] + ], + "move": [ + "MOVE", + 573, + 3, + 595, + false + ], + "original_input_relation": { + "573": "-2" + }, + "source_event": 13687 + }, + { + "combination": [ + [ + 573, + 1 + ], + [ + 572, + -1 + ], + [ + 710, + -2 + ] + ], + "move": [ + "MOVE", + 573, + 595, + 603, + false + ], + "original_input_relation": { + "573": "-2" + }, + "source_event": 13713 + } + ], + "splits": [ + { + "cut_after": 13795, + "pivot": 648, + "public": 736 + }, + { + "cut_after": 13785, + "pivot": 592, + "public": 737 + }, + { + "cut_after": 13726, + "pivot": 664, + "public": 738 + }, + { + "cut_after": 13693, + "pivot": 680, + "public": 739 + }, + { + "cut_after": 12542, + "pivot": 259, + "public": 740 + }, + { + "cut_after": 12464, + "pivot": 432, + "public": 741 + }, + { + "cut_after": 13981, + "pivot": 722, + "public": 742 + }, + { + "cut_after": 13665, + "pivot": 14, + "public": 743 + }, + { + "cut_after": 13666, + "pivot": 76, + "public": 744 + }, + { + "cut_after": 13666, + "pivot": 345, + "public": 745 + }, + { + "cut_after": 13655, + "pivot": 573, + "public": 746 + }, + { + "cut_after": 12094, + "pivot": 405, + "public": 747 + }, + { + "cut_after": 12626, + "pivot": 225, + "public": 748 + } + ], + "status": "PASS_P104_DELAYED_SHARED_RELAY_KAPPA_00310299", + "transpose": { + "arithmetic": "Dense integer rows with binary denominators; reverse chronology", + "coefficients": 571536, + "columns": 756 + } +} diff --git a/research/p104-delayed-shared-relay/SOURCES.json b/research/p104-delayed-shared-relay/SOURCES.json new file mode 100644 index 0000000000..4e7fa4ba58 --- /dev/null +++ b/research/p104-delayed-shared-relay/SOURCES.json @@ -0,0 +1,105 @@ +{ + "schema_version": 1, + "base_commit": "5e0052ca0aa3036a3afa8b0438927377c8d97d53", + "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-delayed-shared-relay/inputs/pr5601-CHANGES.json", + "usage": "input", + "pin": "head:13e0c9cf5834154ec6a46d93cf3f7283ed780535:research/p104-delayed-shared-relay/inputs/pr5601-CHANGES.json", + "sha256": "cc9c3088d509e56362b552cd79875bce45531c2183f3ac0b83a6d75e0d462467", + "git_blob": "a46098f911d6483fcba9e3c89ac2d24e24cb1a74" + }, + { + "path": "research/p104-delayed-shared-relay/inputs/pr5601-construct.py", + "usage": "input", + "pin": "head:13e0c9cf5834154ec6a46d93cf3f7283ed780535:research/p104-delayed-shared-relay/inputs/pr5601-construct.py", + "sha256": "40aa1dd9aa9faca1a4faae7f923e90f216dc74267a92922e02d495222f07abdc", + "git_blob": "2506f4bdc82be48ea3e97e3eabc1f96cd0f61329" + }, + { + "path": "research/p104-delayed-shared-relay/inputs/pr5606-construct.py", + "usage": "input", + "pin": "head:13e0c9cf5834154ec6a46d93cf3f7283ed780535:research/p104-delayed-shared-relay/inputs/pr5606-construct.py", + "sha256": "037d5f00f1c92b6f59020f90f11345251b429ba2bb2c39a65966b5e73094756a", + "git_blob": "e2c1473be00e78b91b4139493e31e47b591ac0df" + }, + { + "path": "research/p104-delayed-shared-relay/inputs/pr5606-prepared.py", + "usage": "input", + "pin": "head:13e0c9cf5834154ec6a46d93cf3f7283ed780535:research/p104-delayed-shared-relay/inputs/pr5606-prepared.py", + "sha256": "166d3362f5a776d422412efc5e905fb3ace13caa1e715b870b175295e145a4eb", + "git_blob": "6eae5764287d6325ad372400480a0447a12568a7" + }, + { + "path": "research/p104-delayed-shared-relay/inputs/pr5606-pricing.py", + "usage": "input", + "pin": "head:13e0c9cf5834154ec6a46d93cf3f7283ed780535:research/p104-delayed-shared-relay/inputs/pr5606-pricing.py", + "sha256": "c7e2a95c1a285982e0db9a9b881154ecda1ee76031cf216909e30b4939dd841a", + "git_blob": "02efc04ddec40b9cec9f785b00fd20841be6009d" + }, + { + "path": "research/p104-delayed-shared-relay/inputs/pr5608-source.tar.gz", + "usage": "input", + "pin": "head:13e0c9cf5834154ec6a46d93cf3f7283ed780535:research/p104-delayed-shared-relay/inputs/pr5608-source.tar.gz", + "sha256": "dbded26ad3b6f7800c6e3b76aaee4df3e86dcb2278bb882d97fe3007f76e0712", + "git_blob": "404e95f089c10ea0589934ea45160d8604468b68" + } + ], + "external_inputs": [ + { + "local_path": "inputs/pr5601-CHANGES.json", + "source_commit": "8f7e870b22885a367b347dc12791da98fd53f83d", + "source_path": "research/p104-coupled-frame-step/CHANGES.json", + "sha256": "cc9c3088d509e56362b552cd79875bce45531c2183f3ac0b83a6d75e0d462467", + "git_blob": "a46098f911d6483fcba9e3c89ac2d24e24cb1a74" + }, + { + "local_path": "inputs/pr5601-construct.py", + "source_commit": "8f7e870b22885a367b347dc12791da98fd53f83d", + "source_path": "research/p104-coupled-frame-step/construct.py", + "sha256": "40aa1dd9aa9faca1a4faae7f923e90f216dc74267a92922e02d495222f07abdc", + "git_blob": "2506f4bdc82be48ea3e97e3eabc1f96cd0f61329" + }, + { + "local_path": "inputs/pr5606-prepared.py", + "source_commit": "cd7d89345c6c5d2114625e5ce912a52ecd5e1d27", + "source_path": "research/p104-prepared-split-reuse/prepared.py", + "sha256": "166d3362f5a776d422412efc5e905fb3ace13caa1e715b870b175295e145a4eb", + "git_blob": "6eae5764287d6325ad372400480a0447a12568a7" + }, + { + "local_path": "inputs/pr5606-pricing.py", + "source_commit": "cd7d89345c6c5d2114625e5ce912a52ecd5e1d27", + "source_path": "research/p104-prepared-split-reuse/pricing.py", + "sha256": "c7e2a95c1a285982e0db9a9b881154ecda1ee76031cf216909e30b4939dd841a", + "git_blob": "02efc04ddec40b9cec9f785b00fd20841be6009d" + }, + { + "local_path": "inputs/pr5606-construct.py", + "source_commit": "cd7d89345c6c5d2114625e5ce912a52ecd5e1d27", + "source_path": "research/p104-prepared-split-reuse/construct.py", + "sha256": "037d5f00f1c92b6f59020f90f11345251b429ba2bb2c39a65966b5e73094756a", + "git_blob": "e2c1473be00e78b91b4139493e31e47b591ac0df" + } + ], + "source_export": { + "local_path": "inputs/pr5608-source.tar.gz", + "sha256": "dbded26ad3b6f7800c6e3b76aaee4df3e86dcb2278bb882d97fe3007f76e0712", + "commit": "5ec3b5b3ee4738f896e823c1dfc04e7ff1789ffb", + "package": "research/p104-relay-split-composition", + "files": 24, + "source_url": "https://github.com/CrocSwap/integer-mult-bounds/pull/5608" + } +} diff --git a/research/p104-delayed-shared-relay/SPLITS.json b/research/p104-delayed-shared-relay/SPLITS.json new file mode 100644 index 0000000000..c72bf47dd5 --- /dev/null +++ b/research/p104-delayed-shared-relay/SPLITS.json @@ -0,0 +1,407 @@ +[ + { + "cut_after": 13795, + "frame": 120, + "pivot": 648, + "a": { + "652": "1" + }, + "b": { + "652": "1", + "648": "-1", + "650": "1", + "649": "-1" + }, + "c": { + "652": "1" + }, + "d": { + "652": "1", + "205": "-2", + "648": "-1", + "650": "1", + "649": "-1" + }, + "ranks": [ + 5, + 4 + ] + }, + { + "cut_after": 13785, + "frame": 1053, + "pivot": 592, + "a": { + "596": "1" + }, + "b": { + "596": "1", + "594": "1", + "592": "-1", + "593": "1" + }, + "c": { + "596": "1" + }, + "d": { + "596": "1", + "594": "1", + "188": "-1", + "592": "-1", + "593": "1" + }, + "ranks": [ + 5, + 4 + ] + }, + { + "cut_after": 13726, + "frame": 1051, + "pivot": 664, + "a": { + "668": "1" + }, + "b": { + "668": "1", + "665": "1", + "666": "-1", + "664": "1" + }, + "c": { + "668": "1" + }, + "d": { + "668": "1", + "115": "2", + "665": "1", + "666": "-1", + "664": "1" + }, + "ranks": [ + 5, + 4 + ] + }, + { + "cut_after": 13693, + "frame": 1049, + "pivot": 680, + "a": { + "684": "1" + }, + "b": { + "684": "1", + "681": "1", + "680": "-1", + "682": "1" + }, + "c": { + "684": "1" + }, + "d": { + "684": "1", + "681": "1", + "126": "2", + "680": "-1", + "682": "1" + }, + "ranks": [ + 5, + 4 + ] + }, + { + "cut_after": 12542, + "frame": 306, + "pivot": 259, + "a": { + "261": "1", + "256": "1/2", + "9": "1/2", + "259": "2" + }, + "b": { + "259": "1/2" + }, + "c": { + "259": "2", + "61": "2", + "265": "2" + }, + "d": { + "262": "1/2", + "270": "-1/2", + "265": "1/2", + "264": "1/2", + "256": "-1/2", + "271": "-1/2", + "263": "1/2" + }, + "ranks": [ + 4, + 5 + ] + }, + { + "cut_after": 12464, + "frame": 516, + "pivot": 432, + "a": { + "437": "1", + "20": "-1", + "435": "-1/2" + }, + "b": { + "432": "1", + "20": "-1" + }, + "c": { + "435": "-1", + "21": "-1" + }, + "d": { + "443": "1/2", + "434": "-1", + "432": "1/2", + "442": "1/2", + "439": "1/2", + "435": "-1", + "444": "-1/2", + "438": "1/2", + "445": "-1/2", + "433": "1/2" + }, + "ranks": [ + 4, + 5 + ] + }, + { + "cut_after": 13981, + "frame": 424, + "pivot": 722, + "a": { + "722": "1", + "3": "1/4", + "67": "1/8" + }, + "b": { + "722": "1" + }, + "c": { + "3": "1/4" + }, + "d": { + "722": "1", + "115": "-4", + "3": "4", + "372": "-4", + "370": "-4" + }, + "ranks": [ + 2, + 7 + ] + }, + { + "cut_after": 13665, + "frame": 462, + "pivot": 14, + "a": { + "52": "1", + "14": "-1/2" + }, + "b": { + "727": "-1/4", + "52": "1/2", + "14": "-1" + }, + "c": { + "14": "-1" + }, + "d": { + "727": "-1/4", + "14": "-1", + "403": "1", + "126": "1", + "402": "1" + }, + "ranks": [ + 2, + 7 + ] + }, + { + "cut_after": 13666, + "frame": 252, + "pivot": 76, + "a": { + "87": "1", + "76": "-1/2" + }, + "b": { + "717": "-1/4", + "87": "1/2", + "76": "-1" + }, + "c": { + "76": "-1" + }, + "d": { + "717": "-1/4", + "76": "-1", + "227": "1", + "188": "1", + "226": "1" + }, + "ranks": [ + 2, + 7 + ] + }, + { + "cut_after": 13666, + "frame": 391, + "pivot": 345, + "a": { + "351": "1", + "345": "-1/2" + }, + "b": { + "712": "-1/4", + "351": "1/2", + "345": "-1" + }, + "c": { + "93": "-1" + }, + "d": { + "712": "-1/4", + "351": "-1/2", + "344": "1/2", + "205": "1", + "350": "-1/2", + "343": "1/2", + "93": "-1", + "341": "-1", + "347": "1/2", + "349": "1/2", + "348": "1/2", + "345": "1/2" + }, + "ranks": [ + 2, + 7 + ] + }, + { + "cut_after": 13655, + "frame": 603, + "pivot": 573, + "a": { + "710": "1", + "573": "-1/2", + "572": "1/2" + }, + "b": { + "710": "1/2", + "573": "-1" + }, + "c": { + "573": "-1/2", + "572": "1/2" + }, + "d": { + "710": "1/2", + "115": "1", + "572": "1", + "498": "2", + "306": "-1", + "499": "1", + "502": "-1", + "457": "-2", + "249": "1", + "243": "-1", + "242": "1", + "456": "2", + "252": "-1", + "247": "-1", + "311": "-2", + "205": "-1", + "126": "-1", + "573": "-1", + "317": "-1", + "503": "1" + }, + "ranks": [ + 2, + 7 + ] + }, + { + "cut_after": 12094, + "frame": 477, + "pivot": 405, + "a": { + "405": "1", + "42": "-1", + "403": "-1/2" + }, + "b": { + "405": "1", + "41": "2" + }, + "c": { + "403": "-1" + }, + "d": { + "415": "1", + "403": "-1", + "402": "-1", + "405": "-1", + "400": "2", + "404": "-1", + "414": "1", + "409": "-1", + "408": "-1" + }, + "ranks": [ + 8, + 1 + ] + }, + { + "cut_after": 12626, + "frame": 267, + "pivot": 225, + "a": { + "234": "1", + "224": "-1/4", + "81": "1/4", + "225": "-1/2", + "57": "1/4", + "92": "1/4" + }, + "b": { + "225": "-2" + }, + "c": { + "227": "1" + }, + "d": { + "229": "1", + "226": "1", + "230": "-1", + "225": "-1", + "224": "-1", + "231": "-1", + "228": "1", + "227": "1" + }, + "ranks": [ + 8, + 1 + ] + } +] diff --git a/research/p104-delayed-shared-relay/TASK.json b/research/p104-delayed-shared-relay/TASK.json new file mode 100644 index 0000000000..21951bc2c7 --- /dev/null +++ b/research/p104-delayed-shared-relay/TASK.json @@ -0,0 +1,112 @@ +{ + "schema_version": 1, + "task_id": "scalar-to-moment", + "priority_revision": 7, + "base_commit": "5e0052ca0aa3036a3afa8b0438927377c8d97d53", + "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": "Delay shared public preparation to remove the remaining owned delivery, then compose exact split, frame and prepared-prefix changes and verify the complete conditional bound.", + "scope_change_reason": "The user assigned changed dependencies and shared owned blocks; the new current-value identity escapes fixed-contact obstructions and composes with credited concurrent components.", + "bottleneck_link": "The complete changed paid and target invoice supports .00310299 above .00310184 in PR5608.", + "budget_minutes": 240, + "stop_rule": "Freeze the exact candidate and complete independent checks/publication before the user account reaches30percentremaining; do not start another search without remaining budget.", + "outcome": "completed", + "evidence": "MECHANISM.md, COMPOSITION.md, source-pinned constructors and RESULT.json:every construction stage, thirteen cuts,747 independent inputs, nine owned roles, exact native/caller/price/compiler and58 outer predicates.", + "author": "flyingviper with substantial OpenAI Codex assistance and independent agents", + "ai_assistance": "Substantial OpenAI Codex assistance. Independent agents derived the delayed public identity, verified cleanup, checked split/frame composition and prepared ownership, and audited the final package. No independent human or proof-kernel acceptance claimed.", + "open_questions": [ + { + "question": "Can another owned consumer be served by delayed complementary public expressions?", + "why_it_matters": "This changes paid transport beyond fixed-contact minima.", + "first_step": "Find an exact current-value identity and prove its live-input endpoint response before constructing nuisance cleanup.", + "blocked_by": "All preparation, transport, restoration and target effects must be accounted for." + }, + { + "question": "Can another independent split prefix be prepared and reconstructed at every paid contact?", + "why_it_matters": "A target debit can be outweighed by removing its paid calls.", + "first_step": "Test exact coframed reconstruction modulo that prefix original input, then replay a complete owned implementation.", + "blocked_by": "Causal source availability, owned occupancy and the complete target/paid bill remain decisive." + } + ] +} diff --git a/research/p104-delayed-shared-relay/VERIFY.json b/research/p104-delayed-shared-relay/VERIFY.json new file mode 100644 index 0000000000..5c2d2100f9 --- /dev/null +++ b/research/p104-delayed-shared-relay/VERIFY.json @@ -0,0 +1,41 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/p104-delayed-shared-relay/inputs/pr5601-CHANGES.json", + "research/p104-delayed-shared-relay/inputs/pr5601-construct.py", + "research/p104-delayed-shared-relay/inputs/pr5606-prepared.py", + "research/p104-delayed-shared-relay/inputs/pr5606-pricing.py", + "research/p104-delayed-shared-relay/inputs/pr5606-construct.py", + "research/p104-delayed-shared-relay/inputs/pr5608-source.tar.gz" + ], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 540, + "checks": "Authenticate source export and all nested payloads; reconstruct every stage, thirteen exact cuts,747 independent inputs and nine owned roles; check dense transpose, signed native maps, complete physical caller, paid/target/ordinary bill, two interval engines, compiler and58 outer predicates; reject five corruptions and compare complete receipt." + }, + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "-O", + "{package}/verify.py" + ], + "timeout_seconds": 540, + "checks": "Authenticate source export and all nested payloads; reconstruct every stage, thirteen exact cuts,747 independent inputs and nine owned roles; check dense transpose, signed native maps, complete physical caller, paid/target/ordinary bill, two interval engines, compiler and58 outer predicates; reject five corruptions and compare complete receipt." + } + ] +} diff --git a/research/p104-delayed-shared-relay/WORD.json.gz b/research/p104-delayed-shared-relay/WORD.json.gz new file mode 100644 index 0000000000..2b9c5fcd90 Binary files /dev/null and b/research/p104-delayed-shared-relay/WORD.json.gz differ diff --git a/research/p104-delayed-shared-relay/coupled_frames.py b/research/p104-delayed-shared-relay/coupled_frames.py new file mode 100644 index 0000000000..eb8a4cc781 --- /dev/null +++ b/research/p104-delayed-shared-relay/coupled_frames.py @@ -0,0 +1,56 @@ +"""Compose the exact PR5601 component with an already changed public word. + +Adapted from Ali Romman's PR5601 constructor, using the event-lattice method +credited to DreamingOfClouds and the PR5565 cascade by Pierre-Loic Doulcet. +Literal unique scalar contacts replace stale source sequence offsets. All +other details of the public-anchor reassembly are retained. Prepared for +flyingviper with OpenAI Codex assistance; Apache-2.0. +""" +from collections import defaultdict +from copy import deepcopy + + +def need(ok,why): + if not ok:raise ValueError(why) + + +def construct(source,declaration): + need(len(declaration['changes'])==4,'Four retained PR5601 declarations') + need(len(source['frames'])==1089,'Unchanged predecessor frame inventory') + word=deepcopy(source) + word['frames'].extend(declaration['frames']) + old,new=source['program'],word['program'] + for change in declaration['changes']: + if 'event' in change: + need(old.count(change['old'])==1,'Unique retained scalar contact') + i=old.index(change['old']) + new[i][-1]=change['new_frame'] + else: + key,r=change['endpoint'],change['register'] + need(word[key][r]==change['old_frame'],'Retained productive endpoint') + word[key][r]=change['new_frame'] + anchors={r:[(-1,source['initial'][r],word['initial'][r])] + for r in range(source['public'])} + moves=defaultdict(list) + for i,event in enumerate(old): + op,r=event[:2] + if op=='MOVE':moves[r].append(i) + elif op in ('ADD','COPY','SCALE'): + registers=event[1:3] if op!='SCALE' else event[1:2] + for r in registers: + if r in anchors:anchors[r].append((i,event[-1],new[i][-1])) + remove,before=set(),defaultdict(list) + for r,visits in anchors.items(): + visits.append((len(old),source['final'][r],word['final'][r])) + for (i,a,x),(j,b,y) in zip(visits,visits[1:]): + if (a,b)==(x,y):continue + remove.update(k for k in moves[r] if i 0, 'Independent productive inputs') + return {'paid':dict(paid), 'helpers':dict(helpers), 'public_inputs':749, 'owned_lifetimes':lifetimes, + 'peak_owned_fields':peak, 'real_scalar_allowance':scalar, 'endpoint_coefficients':758*758} + + +def reverse_columns(w): + """Check the transpose with dense dyadic rows and the reverse chronology.""" + n = 758 + 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 < 750 and r != 573: + 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'} diff --git a/research/p104-delayed-shared-relay/inputs/pr5606-pricing.py b/research/p104-delayed-shared-relay/inputs/pr5606-pricing.py new file mode 100644 index 0000000000..02efc04dde --- /dev/null +++ b/research/p104-delayed-shared-relay/inputs/pr5606-pricing.py @@ -0,0 +1,169 @@ +"""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 Ali Romman's PR5544/5545 for the two coupled contact changes. +Successor choices were prepared for thu-nmrc with OpenAI Codex assistance. +Helper-subspace targets were added by Ali Romman with OpenAI Codex assistance. +Ali Romman's complete caller/price proof and all predecessor credit are retained. +Apache-2.0. +""" +from collections import Counter +from fractions import Fraction as Q +import local as L + +KAPPA, TESTED = Q('.00309871'), Q('.0030987101') +PREVIOUS = Q('.00309839') + + +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()) == 13066 and sum(paid.values()) == 66816, '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) + signed = Counter(T) + signed.subtract(P) + cap = Q('.0034') + derivative_upper = Q(0) + for rank, count in signed.items(): + logarithm = E.log_bounds(rank) + low = E.mul(E.power(rank, 1-cap), logarithm)[0] + high = rank*logarithm[1] + derivative_upper -= count*(low if count >= 0 else high) + L.need(derivative_upper < 0, 'Unique raw crossing below the retained BIT cap') + 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(39,40) + 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),1024 + 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':'.00309871','previous_open_pr5599':PREVIOUS,'gain':KAPPA-PREVIOUS, + 'relative_gain_percent':100*(KAPPA/PREVIOUS-1),'raw_root_interval':[lower,upper], + 'raw_headroom':[lower-KAPPA,upper-KAPPA], + 'raw_ceiling':{'interval':[Q(0),cap],'derivative_upper':derivative_upper},'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,'tail_decay':decay,'tail_block':128, + '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':local['peak_owned_fields'], + 'fixed_scalar_growth_bound':'At most 2^(16*26000) before native factors; a declared constant, not an attained norm.', + 'local_paid_rank_mass':sum(r*n for r,n in local['paid'].items()), + 'tensor_native_growth_bound':'Each rank-r Gaussian has row l1 norm at most 2^(rf); use local_paid_rank_mass for the whole word.'}, + '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-delayed-shared-relay/inputs/pr5608-source.tar.gz b/research/p104-delayed-shared-relay/inputs/pr5608-source.tar.gz new file mode 100644 index 0000000000..404e95f089 Binary files /dev/null and b/research/p104-delayed-shared-relay/inputs/pr5608-source.tar.gz differ diff --git a/research/p104-delayed-shared-relay/prepare.py b/research/p104-delayed-shared-relay/prepare.py new file mode 100644 index 0000000000..ccef6e0ec8 --- /dev/null +++ b/research/p104-delayed-shared-relay/prepare.py @@ -0,0 +1,62 @@ +"""Compose Scratch-net's PR5606 prepared573 retirement with the frozen new word. + +PR5606 supplies the elementary preparation mechanism and checker; source bytes +are pinned in SOURCES.json and verify.py checks the exact checker adaptation. +Ali Romman's split machinery and all predecessor notices remain credited. +Adaptation and independent checks prepared with OpenAI Codex for flyingviper. +Apache-2.0. +""" +from pathlib import Path +from copy import deepcopy +from collections import Counter +from fractions import Fraction as Q +import gzip,json,hashlib +import prepared573_local as R + +HERE=Path(__file__).resolve().parent + +def source_relations(source): + n=source['public'];P=source['program'] + R.need(n==748 and source['initial'][573]==3 and source['final'][573]==603,'Exact retained rank-two split573') + sites={} + for event,terms in [(['MOVE',573,3,595,False],[(573,1),(572,-1),(732,2)]), + (['MOVE',573,595,603,False],[(573,1),(572,-1),(710,-2)])]: + R.need(P.count(event)==1,'Unique paid reconstruction site') + sites[P.index(event)]=(event,terms) + rows=[{r:Q(1)} for r in range(n+8)];receipts=[] + current=source['initial']+[None]*8 + for i,e in enumerate(P): + if i in sites: + event,terms=sites[i];v={} + for r,q in terms:R.add(v,rows[r],Q(q)) + R.need(v=={573:Q(-2)},'Fresh full-input source identity at'+str(i)) + R.need(all(current[r]==event[3] for r,q in terms if r!=573),'Actual reconstruction sources coframed') + receipts.append({'source_event':i,'move':event,'combination':terms,'original_input_relation':{'573':'-2'}}) + op,r=e[:2] + if op=='MOVE':current[r]=e[3] + elif op in ('INIT','CLEAR'): + rows[r]={};current[r]=e[2] if op=='INIT' else None + elif op=='SCALE':rows[r]={k:Q(e[-2])*v for k,v in rows[r].items()} + elif op=='COPY':rows[r]={k:Q(e[-2])*v for k,v in rows[e[2]].items()} + elif op=='ADD':R.add(rows[r],rows[e[2]],Q(e[-2])) + else:raise ValueError(op) + # Check the full incoming arbitrary-input/owned endpoint map as well. + live=set(source['live']) + for r,row in enumerate(rows): + wanted={r:Q(1)} if r 0, 'Independent productive inputs') + return {'paid':dict(paid), 'helpers':dict(helpers), 'public_inputs':747, 'owned_lifetimes':lifetimes, + 'peak_owned_fields':peak, 'real_scalar_allowance':scalar, 'endpoint_coefficients':756*756} + + +def reverse_columns(w): + """Check the transpose with dense dyadic rows and the reverse chronology.""" + n = 756 + 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 < 748 and r != 573: + 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'} diff --git a/research/p104-delayed-shared-relay/pricing.py b/research/p104-delayed-shared-relay/pricing.py new file mode 100644 index 0000000000..29702c3c6b --- /dev/null +++ b/research/p104-delayed-shared-relay/pricing.py @@ -0,0 +1,169 @@ +"""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 Ali Romman's PR5544/5545 for the two coupled contact changes. +Successor choices were prepared for thu-nmrc with OpenAI Codex assistance. +Helper-subspace targets were added by Ali Romman with OpenAI Codex assistance. +Ali Romman's complete caller/price proof and all predecessor credit are retained. +Apache-2.0. +""" +from collections import Counter +from fractions import Fraction as Q +import local as L + +KAPPA, TESTED = Q('.00310299'), Q('.0031029905') +PREVIOUS = Q('.00310184') + + +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()) == 13030 and sum(paid.values()) == 66636, '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) + signed = Counter(T) + signed.subtract(P) + cap = Q('.0034') + derivative_upper = Q(0) + for rank, count in signed.items(): + logarithm = E.log_bounds(rank) + low = E.mul(E.power(rank, 1-cap), logarithm)[0] + high = rank*logarithm[1] + derivative_upper -= count*(low if count >= 0 else high) + L.need(derivative_upper < 0, 'Unique raw crossing below the retained BIT cap') + 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(39,40) + 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),1024 + 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':'.00310299','previous_open_pr5608':PREVIOUS,'gain':KAPPA-PREVIOUS, + 'relative_gain_percent':100*(KAPPA/PREVIOUS-1),'raw_root_interval':[lower,upper], + 'raw_headroom':[lower-KAPPA,upper-KAPPA], + 'raw_ceiling':{'interval':[Q(0),cap],'derivative_upper':derivative_upper},'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,'tail_decay':decay,'tail_block':128, + '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':local['peak_owned_fields'], + 'fixed_scalar_growth_bound':'At most 2^(16*26000) before native factors; a declared constant, not an attained norm.', + 'local_paid_rank_mass':sum(r*n for r,n in local['paid'].items()), + 'tensor_native_growth_bound':'Each rank-r Gaussian has row l1 norm at most 2^(rf); use local_paid_rank_mass for the whole word.'}, + '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-delayed-shared-relay/sources.py b/research/p104-delayed-shared-relay/sources.py new file mode 100644 index 0000000000..fce090a6b7 --- /dev/null +++ b/research/p104-delayed-shared-relay/sources.py @@ -0,0 +1,42 @@ +"""Authenticate the official PR5608 export before importing its source closure. + +Prepared for flyingviper with substantial OpenAI Codex assistance. Apache-2.0. +Source-export format and payload checks follow the retained repository exporter. +""" +from contextlib import contextmanager +from hashlib import sha256,sha1 +from pathlib import Path,PurePosixPath +import gzip,importlib.util,io,json,sys,tarfile,tempfile +HERE=Path(__file__).resolve().parent +def need(ok,why): + if not ok:raise ValueError(why) +def read(path): + raw=Path(path).read_bytes();return json.loads(gzip.decompress(raw) if str(path).endswith('.gz') else raw) +def load(path,name): + spec=importlib.util.spec_from_file_location(name,path);m=importlib.util.module_from_spec(spec);sys.modules[name]=m;spec.loader.exec_module(m);return m +@contextmanager +def sources(): + pins=read(HERE/'SOURCES.json') + for p in pins['external_inputs']: + raw=(HERE/p['local_path']).read_bytes() + need(sha256(raw).hexdigest()==p['sha256'],'Pinned source SHA256 '+p['local_path']) + need(sha1(('blob '+str(len(raw))+'\0').encode()+raw).hexdigest()==p['git_blob'],'Pinned source blob '+p['local_path']) + pin=pins['source_export'];raw=(HERE/pin['local_path']).read_bytes() + need(sha256(raw).hexdigest()==pin['sha256'],'Exact published export archive') + with tempfile.TemporaryDirectory(prefix='p104-composed-source-') as directory: + root=Path(directory) + with tarfile.open(fileobj=io.BytesIO(gzip.decompress(raw))) as bundle: + names=[] + for m in bundle.getmembers(): + p=PurePosixPath(m.name) + need(m.isfile() and not p.is_absolute() and '..' not in p.parts and '\\' not in m.name and ':' not in m.name,'Regular relative source file') + need(m.name not in names,'Unique export path');names.append(m.name) + target=root.joinpath(*p.parts);target.parent.mkdir(parents=True,exist_ok=True);target.write_bytes(bundle.extractfile(m).read()) + manifest=read(root/'.research-export.json') + need(manifest['commit']==pin['commit'] and len(manifest['files'])==pin['files'],'Exact published source inventory') + need(set(names)=={'.research-export.json'}|{r['path'] for r in manifest['files']},'No omitted or extra source payload') + for r in manifest['files']: + b=(root/r['path']).read_bytes();need(len(b)==r['size'] and sha256(b).hexdigest()==r['sha256'],'Authenticated source payload '+r['path']) + package=root/pin['package'] + common=load(package/'common.py','retained_source_common') + with common.closure() as framework:yield package,framework diff --git a/research/p104-delayed-shared-relay/verify.py b/research/p104-delayed-shared-relay/verify.py new file mode 100644 index 0000000000..233f4c0719 --- /dev/null +++ b/research/p104-delayed-shared-relay/verify.py @@ -0,0 +1,88 @@ +"""Full verification of delayed696 plus coupled frames and prepared573. + +Prepared for flyingviper with substantial OpenAI Codex assistance and independent +agents. Retain Ali Romman, Pierre-Loic Doulcet, Scratch-net and all predecessor +native/caller/compiler notices. Apache-2.0. Not a proof-kernel verification. +""" +from collections import Counter +from copy import deepcopy +from fractions import Fraction as Q +from pathlib import Path +import json,sys +sys.dont_write_bytecode=True +HERE=Path(__file__).resolve().parent;sys.path.insert(0,str(HERE)) +from sources import sources,load,need,read +import delayed,coupled_frames,prepare,prepared573_local as R + +def difference(a,b):return {r:a.get(r,0)-b.get(r,0) for r in a.keys()|b.keys() if a.get(r,0)!=b.get(r,0)} +def reject(action): + try:action() + except ValueError as error:return str(error) + raise ValueError('Invalid control accepted') +def main(): + text=(HERE/'inputs/pr5606-pricing.py').read_text() + for before,after in read(HERE/'PRICING-EDITS.json'): + need(text.count(before)==1,'Unique declared pricing edit');text=text.replace(before,after) + need(text==(HERE/'pricing.py').read_text(),'Only declared price edits') + # Preserve the exact source checker except declared interface constants, + # attribution, inlined need and an ownership-direction hardening. + original=(HERE/'inputs/pr5606-prepared.py').read_text();adapted=(HERE/'prepared573_local.py').read_text() + original=original[original.index('def add('):] + for before,after in [('750','748'),('758','756'),('749','747'),('ascending = r < 748','ascending = not private')]:original=original.replace(before,after) + need(original==adapted[adapted.index('def add('):],'Exact scoped prepared checker adaptation') + with sources() as (prior,framework): + L=load(prior/'inputs/pr5599-local.py','local');L.ROOT=framework + S=load(prior/'inputs/pr5599-construct.py','retained_split_final') + C0=load(prior/'construct.py','retained_composition_construct') + base=read(prior/'inputs/pr5580-WORD.json.gz') + parent=C0.construct_parent(base);first=delayed.construct(parent) + before=L.replay(parent);after=L.replay(first) + need(difference(after['paid'],before['paid'])=={4:1,5:-1,6:-1,7:1} and after['helpers']==before['helpers'],'Exact delayed shared-component saving') + kept=read(HERE/'SPLITS.json');old=read(prior/'SPLITS.json') + need(len(kept)==len(old)==13,'Thirteen same split channels') + word=first;cuts=[] + for h,p in zip(kept,old): + need({k:v for k,v in h.items() if k!='cut_after'}=={k:v for k,v in p.items() if k!='cut_after'},'Only cut indices change') + word=S.split(word,h);state=L.replay(word) + need(state['paid']==after['paid'],'Each split preserves the paid profile') + cuts.append({'pivot':h['pivot'],'cut_after':h['cut_after'],'public':word['public']}) + stage=L.replay(word) + word=coupled_frames.construct(word,read(HERE/'inputs/pr5601-CHANGES.json')) + frame_stage=L.replay(word) + need(difference(frame_stage['paid'],stage['paid'])=={2:-2,3:2,4:-2,5:1} and difference(frame_stage['helpers'],stage['helpers'])=={4:1,5:-1},'Exact coupled-frame paid and target change') + prepared,relations=prepare.construct(word) + local=R.replay(prepared) + need(prepared==read(HERE/'WORD.json.gz'),'Entire regenerated final payload') + need(difference(local['paid'],frame_stage['paid'])=={1:-2} and difference(local['helpers'],frame_stage['helpers'])=={2:-1},'Prepared helper transport deletion and target debit') + need((local['public_inputs'],local['owned_lifetimes'],local['peak_owned_fields'])==(747,11,2),'Independent interface and owned occupancy') + print('PASS source pins, all construction stages, thirteen fresh cuts and747 independent inputs',flush=True) + columns=R.reverse_columns(prepared) + print('PASS all756 dense transpose columns',flush=True) + native=L.native(prepared) + need(native['helpers']==frame_stage['helpers'],'Historical endpoint census before explicit retirement') + native['helpers'][2]-=1;native['helper_normalizers']-=2;native['retired_helper']=573 + print('PASS every signed native map and retired-target debit',native['distinct_maps'],flush=True) + C=load(framework/'research/p104-productive-controller/caller.py','delayed_final_caller') + caller=C.construct();need(caller==read(framework/'research/p104-productive-controller/CONTROLLER.json'),'Same complete caller') + physical=C.physical(caller,prepared) + print('PASS complete physical caller',flush=True) + P=load(HERE/'pricing.py','delayed_final_price');price=P.run(local,native,caller,physical) + print('PASS complete price, two interval engines, compiler and58 outer predicates',price['raw_root_interval'],flush=True) + controls={} + for label,event in [('missing_owned_initialization',['INIT',573,3]),('missing_owned_return',['CLEAR',573,603]),('missing_final_shared_cleanup',['ADD',696,133,'1/2',127])]: + bad=deepcopy(prepared);need(bad['program'].count(event)==1,'Unique negative control site');bad['program'].remove(event) + controls[label]=reject(lambda:R.replay(bad)) + bad=deepcopy(local);bad['helpers'][2]+=1 + controls['retired_target_credited']=reject(lambda:P.assemble(bad,native,caller,physical)) + bad=deepcopy(local);bad['paid'][1]-=1 + controls['unpaid_transport']=reject(lambda:P.assemble(bad,native,caller,physical)) + oldlocal=L.replay(read(prior/'WORD.json.gz')) + pd=difference(local['paid'],oldlocal['paid']);td=difference(local['helpers'],oldlocal['helpers']) + need(pd=={1:-2,2:-2,3:2,4:-1,6:-1,7:1} and td=={2:-1,4:1,5:-1},'Complete delta against PR5608') + result=P.encode({'status':'PASS_P104_DELAYED_SHARED_RELAY_KAPPA_00310299','events':len(prepared['program']), + 'splits':cuts,'prepared_relations':relations,'local_paid_delta_vs_pr5608':pd,'local_target_delta_vs_pr5608':td, + 'local':local,'transpose':columns,'native':native,'physical':physical,'complete_cost':price,'controls':controls}) + if '--write' in sys.argv:(HERE/'RESULT.json').write_text(json.dumps(result,indent=2,sort_keys=True)+'\n',encoding='utf-8',newline='\n') + else:need(result==read(HERE/'RESULT.json'),'Exact saved complete receipt') + print(result['status'],flush=True) +if __name__=='__main__':main()