diff --git a/research/p104-prepared-split-reuse/PRICING-EDITS.json b/research/p104-prepared-split-reuse/PRICING-EDITS.json new file mode 100644 index 0000000000..bafa67c7c8 --- /dev/null +++ b/research/p104-prepared-split-reuse/PRICING-EDITS.json @@ -0,0 +1,34 @@ +[ + [ + "Q('.00309839'), Q('.0030983905')", + "Q('.00309871'), Q('.0030987101')" + ], + [ + "PREVIOUS = Q('.00308189')", + "PREVIOUS = Q('.00309839')" + ], + [ + "13084", + "13066" + ], + [ + "66852", + "66816" + ], + [ + "'kappa_decimal':'.00309839'", + "'kappa_decimal':'.00309871'" + ], + [ + "previous_open_pr5580", + "previous_open_pr5599" + ], + [ + "'peak_owned_fields':1", + "'peak_owned_fields':local['peak_owned_fields']" + ], + [ + "'local_paid_rank_mass':local['paid_rank_mass']", + "'local_paid_rank_mass':sum(r*n for r,n in local['paid'].items())" + ] +] diff --git a/research/p104-prepared-split-reuse/PROOF.md b/research/p104-prepared-split-reuse/PROOF.md new file mode 100644 index 0000000000..8171eafacb --- /dev/null +++ b/research/p104-prepared-split-reuse/PROOF.md @@ -0,0 +1,149 @@ +# Two paid queries replaced by a prepared split helper + +Use PR5599's exact complete word at +`0644592d421b375c221045954fdf13932575ffa8`. +Its fifteen helper splits, scalar bases, phase conventions and caller remain +credited to that source. This construction changes only the preparation +and two queries described below. + +## Exact source-version identities + +Write `h_r` for original input r and `x_r` for its current normalized value. +The source has 750 independent productive inputs and eight owned roles. +Fresh exact replay, before any preparation, proves: + +| Source event | Current-value identity | Paid source operation | +| --- | --- | --- | +| 13670 | `x573-x572+2*x732 = -2*h573` | `MOVE 573: 3 -> 595`, rank 1 | +| 13691 | `x573-x572-2*x710 = -2*h573` | `MOVE 573: 595 -> 603`, rank 1 | + +The identities include every source input coefficient and current data version. +They are derived by `verify.py:source_relations`, rather than read from a +saved relation table. The source scalar basis changes are included in replay. + +Source helper 573 starts at frame 3, the zero subspace, and finishes at +frame 603, a two-dimensional subspace. It is the rank-two prefix target +created by PR5599's eleventh split. The rank-seven successor has its own +independent input and remains in the word. + +Declare role 573 owned and initialize it to zero before the source's entry +basis program. Its arbitrary dirty entry is erased. Thus `h573=0` is an +internal preparation, not a promise on any retained productive input. +Remove its rank-two target from the productive invoice. + +All other source output rows are independent of `h573`. Exact replay of the +new word checks all 749 retained independent inputs, 208 main outputs, +541 helper outputs and every owned return. A dense integer transpose checks +the same complete linear map through a separate arithmetic path. + +## Explicit replacements + +At source event 13670, roles 572 and 732 are already at frame 595. +Replace the rank-one MOVE with: + +```text +CLEAR 573 at 3 +INIT 573 at 595 +COPY 573 <- 572 +ADD 573 += -2*732 +``` + +The first identity proves that this gives the required value in frame 595. +Keep the following source ADD and every later source instruction. + +At source event 13691, roles 572 and 710 are already at frame 603. +Replace the rank-one MOVE with: + +```text +CLEAR 573 at 595 +INIT 573 at 603 +COPY 573 <- 572 +ADD 573 += 2*710 +``` + +The second identity proves that this gives the required value in frame 603. +In particular, the following source SCALE and split basis operations remain +unchanged. No operation is moved across their reads or writes. + +After the source program, clear role 573 at frame 603. Its exact output was +already zero because its prepared input was zero. The eight original owned +roles retain their source operations and cleanup. + +The word has 758 total roles, nine owned roles, eleven owned lifetimes and +peak owned occupancy two. All nine original dirty owned columns vanish from +all outputs. The new instructions use only the source INIT, CLEAR, COPY and +ADD operations. Neither a zero retag nor a new Gaussian operator is needed. + +## Native meaning and every positive width + +The normalized row in a frame denotes a linear combination of arbitrary +original fields under that frame's native operator. Both reconstructed +values use sources already in the required physical frame. +The COPY and scalar ADD operations therefore act on the actual physical +fields, with no omitted transport or phase correction. + +For each legal positive tensor width f, substitute the tensor power of every +source native chart. Keep rational scalar coefficients outside the tensor +power. Equal charts commute with these whole-field scalar combinations. +The two source identities therefore prove both replacements at every width, +under the same native premise as the source. + +No retained independent input is copied into another productive input slot. +Role 573 is owned and receives no target credit. Its old external entrance +normalizer can be omitted because its input is replaced by zero. Its old +exit normalizer can be omitted because its output is owned zero. +All other helper normalizers and both main interfaces remain unchanged. + +The verifier checks that every retained paid-map pair occurs in the source. +The source native evaluator rechecks the signed Pauli images and absolute +phase anchors of all those maps, all original helper endpoints, and the +208 main adapters. Checking the discarded helper endpoint is harmless extra +evidence; its target and two unused normalizers are removed from accounting. + +## Complete invoice and conditional bound + +The local paid profile is: + +```text +{1:2209, 2:459, 3:494, 4:94, 5:164, 6:18, 7:14}. +``` + +The retained productive helper profile is: + +```text +{1:4, 2:4, 4:90, 5:10, 7:5, 8:18, 9:410}. +``` + +Relative to PR5599, the local paid delta is `-2 H1`, and the target delta +is `-H2`. For `00`. At t=1 the delta is zero. + +The unchanged physical controller has 18 local calls, 15 thin query stages +and 15 whole idle stages. Each call uses its own 541 fresh helper inputs. +It invokes the complete new supplier, which returns all owned storage zero. +The global deltas are `-36 H1` paid and `-18 H2` productive. +There are 66,816 paid jobs and 13,066 independent productive fields. +The complete rank surplus stays 760. + +The new word has 25,510 instructions and scalar allowance 220,432. +All initialization, erasure, copying, scalar operations and routes are charged. +The route allowance includes eleven owned lifetimes and peak occupancy two. +The local cap 10^7 and global cap 10^9 remain sufficient. +The added owned role replaces a productive role, so the total field count +stays 758. The native paid-rank sum is recomputed from the changed word. + +All scalar coefficients are dyadic and satisfy the source growth bound. +There are fewer than 26,000 operations, each with growth below 2^16. +The same precision and tape premise covers this explicit finite template +with its charged constants. The rounded multiplier is not materialized. + +The source pricing code is retained with the exact edits listed in +`PRICING-EDITS.json`. The target debit is included in both completion tails. +The source's tail decay 39/40 and compiler logarithm power 1024 are retained. +Two rational moment engines test saving 0.0030987101 and fund the claim +**kappa=0.00309871**. They also reproduce PR5599's predecessor crossing. +The same run checks the compiler threshold, BIT stock, 54 strict outer +predicates and four functional predicates. + +The five inherited framework assumptions remain. This is an author-checked +conditional construction, without independent human or proof-kernel acceptance. diff --git a/research/p104-prepared-split-reuse/README.md b/research/p104-prepared-split-reuse/README.md new file mode 100644 index 0000000000..4e255f9bd8 --- /dev/null +++ b/research/p104-prepared-split-reuse/README.md @@ -0,0 +1,84 @@ +# Prepared split helper: conditional kappa 0.00309871 + +This construction raises the complete conditional bound from +**0.00309839 to 0.00309871**. It composes an owned-helper preparation with +Ali Romman's fifteen independent helper splits in +[PR5599](https://github.com/CrocSwap/integer-mult-bounds/pull/5599), pinned at +`0644592d421b375c221045954fdf13932575ffa8`. +The selected repository record remains unchanged. + +The exact crossing lies in `(0.00309871051439, 0.00309871051440)`. +It exceeds PR5599's crossing by between `0.00000031699227` and +`0.00000031699229`. + +The rank-two prefix helper 573 becomes owned storage, initialized to zero. +Two exact source relations then replace its two rank-one queries with +ordinary copies and additions. Its rank-two output is debited. The independent +rank-seven successor from PR5599 remains productive. +For every `00`. + +The complete caller applies the change in all 18 local calls. It has +**66,816 paid jobs and 13,066 independent productive fields**, with rank +surplus 760. The local interface has 749 independent productive inputs and +nine owned roles. All owned roles return zero; peak occupancy is two. +There are no new paid native maps or new instruction types. + +The word keeps the source register numbers. Its legacy `public` slot limit +is 750; `independent_public` lists the 749 actual productive inputs. +`owned_roles` includes role 573 and the eight original owned roles. + +These are conditional, author-checked results. The five inherited framework +assumptions remain: native implementation at every width, owned erasure, +uniform compilation, precision and tape costs, and analytic recovery. +The complete uniform word and rounded multiplier are not materialized. +Independent human review, proof-kernel acceptance and frontier promotion +are not claimed. + +Read [PROOF.md](PROOF.md) for the source identities and physical implementation. +[construct.py](construct.py) emits the complete word. +[RESULT.json](RESULT.json) records the exact checks and complete bill. +[VALIDATION.md](VALIDATION.md) records the executed validation. + +Reproduce with Python 3.12 and the standard library: + +```sh +python3 -B scripts/research_package.py --package research/p104-prepared-split-reuse +``` + +The verifier checks all 758 endpoint rows and independent transpose columns. +It derives both relations before specializing the source input. +It checks every retained native map with absolute phase, the full physical +caller, two rational moment engines and all 58 outer predicates. +Seven semantic controls test initialization, reconstruction, chart matching, +owned cleanup, paid accounting and the productive debit. + +[SOURCES.json](SOURCES.json) pins the complete PR5599 word, its local and +pricing code, its split witnesses, proof and notices. The unchanged PR5545 +export supplies 33 authenticated runtime files. Replay needs no network, +solver or pending Git objects. The source scalar basis programs remain intact. + +This changes the independent-input contract and actual paid word. It falls +outside the fixed-input passive-history obstruction in +[PR5598](https://github.com/CrocSwap/integer-mult-bounds/pull/5598). +No global optimality or worldwide novelty claim is made. + +Ali Romman supplied PR5599's fifteen splits, PR5580, and the P104 caller and +pricing machinery. GamingPuzzled supplied PR5569; DreamingOfClouds supplied +PR5561; thu-nmrc supplied PR5551. David Arias, Cinna Davis and Gareth Davidson +supplied the underlying P104 word and private-copy construction. +The preparation and two query replacements are by Scratch-net, with +substantial OpenAI Codex assistance. No subagents were used. + +The reuse question comes from Dugongue's PR5586 atlas. Cached-relation +precedents include Ali Romman's PR5383 and Dillon Amburgey's PR5402. +Retain Chris R/Clear1nsight's review and native interpreter, Cao Yifan's +native lineage, Jacob Alan Sussman's productive recursion, zxv's compiler +and outer machinery, and all authors in the source closure and +[retained PR5599 notice](inputs/pr5599-NOTICE). New work is Apache-2.0. + +## Open next questions + +Independent review should check the changed owned interface and the two +reconstruction identities, then replay the full caller and funding checks. +All source dependencies are present. The five framework assumptions and +independent scientific acceptance remain open. diff --git a/research/p104-prepared-split-reuse/RESULT.json b/research/p104-prepared-split-reuse/RESULT.json new file mode 100644 index 0000000000..8ec1588b55 --- /dev/null +++ b/research/p104-prepared-split-reuse/RESULT.json @@ -0,0 +1,399 @@ +{ + "complete_cost": { + "compiler": { + "H": 3707270000000000, + "N": "2^3707270000000000", + "eta": { + "lower": "0.000000138184849856214717112421", + "upper": "0.000000138184849856214717112422" + }, + "gap": "1/70000000000", + "integer_test_exponent": 52961, + "logarithm_power": 1024, + "theta": "63/64", + "uniform_saving": "108454853/35000000000", + "word_materialized": false + }, + "full_forward_calls": 18, + "gain": "1/3125000", + "kappa": "309871/100000000", + "kappa_decimal": ".00309871", + "margin_at_previous": { + "lower": "0.078090305301714006099166595492", + "upper": "0.078090305301714006099166595493" + }, + "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_paid_rank_mass": 6011, + "local_routes": 5202000, + "local_scalar": 220432, + "peak_owned_fields": 2, + "raw_budget": 1000000000, + "raw_scalar_upper": 184647552, + "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": { + "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": "17429999999253/17500000000000", + "fixed_halo_explicit_metadata_branch": "1347500000001/17500000000", + "new_BIT_row_stock_sublinear_in_active_group": "69789999997009/70000000000000", + "new_semantic_group_guard": "3/70000000000" + }, + "margins": { + "boundary_algebraic_matrix": "15183679279783090297/4900000000000000000000", + "fused_gaussian": "15183679279349270891/4900000000000000000000", + "global_coordinate_router": "27113713/8750000000", + "group_bit_router": "1897959918668658861/612500000000000000000", + "group_scans": "34999999999/35000000000", + "main_transform": "15183679209783090297/4900000000000000000000", + "microbox_face_corrections": "1347500000001/17500000000", + "polynomial_products": "69999999999/70000000000", + "sparse_union_movement": "2005808679279783090297/4900000000000000000000" + }, + "parameters": { + "a": "27113713/8750000000", + "b": "43381941/14000000000", + "beta": "69999999997/70000000000", + "bit_saving": "17/5000", + "cap_xi": "4455808679209783090297/4900000000000000000000", + "complex_uniform_saving": "108454853/35000000000", + "d": "1/70000000000", + "epsilon": "69999999999/70000000000", + "kappa": "309871/100000000", + "lambda_": "19938025799/20000000000", + "lambda_prime": "69783090297/70000000000", + "layout": "1/70000000000", + "q": "216909703/70000000000", + "r0": "1/700000000000", + "stop": "1/70000000000", + "tested_saving": "30987101/10000000000" + }, + "strict_checks": { + "actual_bit_above_effective": "2636287/8750000000", + "actual_logarithmic_gamma_guard": "1/70000000000", + "actual_logarithmic_group_guard": "444191320895216909703/2450000000000000000000", + "alpha_logarithm_absorption": "1/700000000000", + "boundary_algebraic_matrix_above_kappa": "279783090297/4900000000000000000000", + "cap_above_band": "2005808679209783090297/4900000000000000000000", + "cap_below_cell": "444191320720216909703/4900000000000000000000", + "cap_below_phase_cell_power": "5344191320790216909703/4900000000000000000000", + "complex_above_effective": "1/70000000000", + "complex_below_one_over_32": "394118059/14000000000", + "complex_endpoint": "1/35000000000", + "epsilon_below_one": "1/70000000000", + "epsilon_positive": "69999999999/70000000000", + "fine_prime_halo_umbrella": "7/2", + "fused_gaussian_above_kappa": "279349270891/4900000000000000000000", + "gaussian_above_main": "34783090297/2450000000000000000000", + "global_coordinate_router_above_kappa": "1/17500000000", + "global_gamma_power_slack": "9/700000000000", + "group_below_dimension": "1/35000000000", + "group_bit_router_above_kappa": "43668658861/612500000000000000000", + "group_gauge_power_slack": "444191320891716909703/2450000000000000000000", + "group_key_fits_record": "1/35000000000", + "group_positive": "69999999997/70000000000", + "group_scans_above_kappa": "34891545149/35000000000", + "halo_covers_generic_inverse_radius": "5", + "improvement_over_user_baseline": "683869790400418148631/500000000000000000000000", + "lambda_above_internal": "1/140000000000", + "lambda_above_sigma": "3/140000000000", + "lambda_above_tau": "1/140000000000", + "lambda_prime_above_lambda": "1/140000000000", + "lambda_prime_above_leaf": "27956618059/980000000000000000000", + "leaf_saving_above_effective": "13956618059/980000000000000000000", + "main_transform_above_kappa": "209783090297/4900000000000000000000", + "membership_arithmetic_fits_record": "1/70000000000", + "microbox_face_corrections_above_kappa": "42107680393/546875000", + "microbox_halo_volume": "5530000000003/70000000000", + "new_complex_uniform_saving_above_b": "1/70000000000", + "new_semantic_guard_with_C1_one": "1/70000000000", + "polynomial_products_above_kappa": "69783090299/70000000000", + "positive_layout_slack": "1/70000000000", + "q_below_effective": "1/70000000000", + "q_below_internal": "1/70000000000", + "q_below_leaf": "27956618059/980000000000000000000", + "q_positive": "216909703/70000000000", + "short_record_fallback": "13956618059/14000000000", + "source_axis_superpolynomial": "1/70000000000", + "sparse_union_movement_above_kappa": "1990625000279783090297/4900000000000000000000", + "stop_below_one": "69999999999/70000000000", + "stop_positive": "1/70000000000", + "strassen_integer_power_gap": "1951441519231", + "support_router_span": "3/70000000000", + "theta_positive_polynomial_power": "2", + "union_header_fits_record": "3/70000000000", + "union_tag_work_per_visit_fits_record": "3/70000000000" + } + }, + "paid": { + "1": 41322, + "16": 416, + "2": 8262, + "24": 416, + "3": 8892, + "32": 416, + "4": 1692, + "40": 416, + "48": 416, + "5": 2952, + "56": 416, + "6": 324, + "64": 416, + "7": 252, + "72": 208 + }, + "paid_calls": 66816, + "previous_open_pr5599": "309839/100000000", + "productive_fields": 13066, + "query_shears": 15, + "rank_mass_surplus": 760, + "raw_ceiling": { + "derivative_upper": "-742100245715967511149716780577104922095135269819678091458976993/3138550867693340381917894711603833208051177722232017256448", + "interval": [ + "0", + "17/5000" + ] + }, + "raw_headroom": [ + "51439/100000000000000", + "643/1250000000000" + ], + "raw_root_interval": [ + "309871051439/100000000000000", + "3873388143/1250000000000" + ], + "relative_gain_percent": "3200/309839", + "strictification": { + "alpha": { + "lower": "0.999999999578292072038375809916", + "upper": "0.999999999578292072038375809917" + }, + "cutoff": 17, + "delta": { + "lower": "0.973765859980091620271755326286", + "upper": "0.973765859980091620271755326287" + }, + "floor": 18, + "gamma": { + "lower": "0.967444782528747362754547724047", + "upper": "0.967444782528747362754547724048" + }, + "normalized_paid_upper": "5242880004882813/5242880536870912", + "power": 1024, + "reserve": "1/10000000000", + "tail_block": 128, + "tail_decay": "39/40", + "tail_offset": "1/5", + "tested": "30987101/10000000000" + }, + "targets": { + "1": 72, + "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": 324, + "9": 7380 + }, + "whole_idle_jobs": 3120 + }, + "controls": { + "missing_initialization": "Scalar destination and coefficient", + "missing_owned_cleanup": "All public and owned exits", + "missing_owned_reset": "Owned initialization", + "omitted_paid_job": "Complete field and call counts", + "retired_target_still_credited": "Every productive helper has a native target", + "wrong_delivery_frame": "Scalar destination and coefficient", + "wrong_second_reconstruction": "All 758 public and owned rows" + }, + "limits": [ + "The five inherited framework assumptions remain.", + "The complete uniform compiler word and rounded multiplier are not materialized.", + "No independent human review, proof-kernel acceptance or selected promotion is claimed." + ], + "local": { + "endpoint_coefficients": 574564, + "helpers": { + "1": 4, + "2": 4, + "4": 90, + "5": 10, + "7": 5, + "8": 18, + "9": 410 + }, + "owned_lifetimes": 11, + "paid": { + "1": 2209, + "2": 459, + "3": 494, + "4": 94, + "5": 164, + "6": 18, + "7": 14 + }, + "peak_owned_fields": 2, + "public_inputs": 749, + "real_scalar_allowance": 220432 + }, + "local_moment_gain": [ + "13467880596335628131206688903334566152146706173779035875/3138550867693340381917894711603833208051177722232017256448", + "26935761192671256262413377806669132304293412347558071941/6277101735386680763835789423207666416102355444464034512896" + ], + "local_paid_delta": { + "1": -2 + }, + "local_target_delta": { + "2": -1 + }, + "native": { + "distinct_maps": 2926, + "helper_normalizers": 1082, + "helpers": { + "1": 4, + "2": 4, + "4": 90, + "5": 10, + "7": 5, + "8": 18, + "9": 410 + }, + "main_adapters": 208, + "proof": "Every signed Pauli image and exact global phase; frame induction at every positive tensor width", + "recipe_payload_sha256": "7a9003650ed834a233a0f7416976e245c0df0bf93db8eab3a03a462475eb021e", + "retired_helper": 573, + "wrong_phase_rejected": true + }, + "parent_raw_interval": [ + "309839352211/100000000000000", + "77459838053/25000000000000" + ], + "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 + ] + }, + "raw_gain_interval": [ + "31699227/100000000000000", + "31699229/100000000000000" + ], + "source_commit": "0644592d421b375c221045954fdf13932575ffa8", + "source_relations": [ + { + "combination": [ + [ + 573, + 1 + ], + [ + 572, + -1 + ], + [ + 732, + 2 + ] + ], + "original_input_relation": [ + [ + 573, + "-2" + ] + ], + "source_event": 13670 + }, + { + "combination": [ + [ + 573, + 1 + ], + [ + 572, + -1 + ], + [ + 710, + -2 + ] + ], + "original_input_relation": [ + [ + 573, + "-2" + ] + ], + "source_event": 13691 + } + ], + "status": "PASS_P104_PREPARED_SPLIT_KAPPA_00309871", + "transpose": { + "arithmetic": "Dense integer rows with binary denominators; reverse chronology", + "coefficients": 574564, + "columns": 758 + } +} diff --git a/research/p104-prepared-split-reuse/SOURCES.json b/research/p104-prepared-split-reuse/SOURCES.json new file mode 100644 index 0000000000..0cbf0efb38 --- /dev/null +++ b/research/p104-prepared-split-reuse/SOURCES.json @@ -0,0 +1,94 @@ +{ + "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" + } + ], + "retained_source": { + "path": "research/p104-prepared-split-reuse/inputs/pr5545-source-closure.tar.gz", + "sha256": "59768da554e11b11fae52d07f520f50684cc7a9ee0bec2873edbcd6b63814837", + "export_manifest_sha256": "0a20358f9c089be1f5606c78077314e30a72998fb3c5123848d921a8d1814e76", + "commit": "18968423711fd902aaee1099979497d55603e1dc", + "files": 33, + "source_url": "https://github.com/CrocSwap/integer-mult-bounds/pull/5545", + "note": "Byte-identical copy of the capsule retained by PR5551/PR5561; used UNMODIFIED (the hand-off word keeps 735 public inputs)." + }, + "external_inputs": [ + { + "local_path": "common.py", + "source_repository": "aliromman/integer-mult-bounds", + "source_commit": "6efa248cf456d6101d757e9d09ba29711d18a13a", + "source_path": "research/p104-event-contact-step/common.py", + "sha256": "e7c1bd9bfc0060d2d55da5c6e61cd3fae756e0fc8facacc2a074061d2f73c800", + "git_blob": "bd244313fc023a737055415f87003f2963c290f6" + }, + { + "local_path": "inputs/pr5599-WORD.json.gz", + "source_repository": "aliromman/integer-mult-bounds", + "source_commit": "0644592d421b375c221045954fdf13932575ffa8", + "source_path": "research/p104-helper-subspace-splits/WORD.json.gz", + "sha256": "4924640fa7fcbb3895a43bf5f07e7274260feac06ecc95285f77dd8eaee30fa1", + "git_blob": "d9ebf6cace13279bba2fd662d941ddebb4c61278" + }, + { + "local_path": "inputs/pr5599-local.py", + "source_repository": "aliromman/integer-mult-bounds", + "source_commit": "0644592d421b375c221045954fdf13932575ffa8", + "source_path": "research/p104-helper-subspace-splits/local.py", + "sha256": "ef430511ce36fc658ab711bd84cd2d7b484b8af173238ff89cbfec6139fefbad", + "git_blob": "e6e28bacdad7cb51400d827b9a6e02f2b605d357" + }, + { + "local_path": "inputs/pr5599-pricing.py", + "source_repository": "aliromman/integer-mult-bounds", + "source_commit": "0644592d421b375c221045954fdf13932575ffa8", + "source_path": "research/p104-helper-subspace-splits/pricing.py", + "sha256": "473e10cbd92b06736d33d80c0ef742f12f2d08cfeba9e698b1de6c3648bbb217", + "git_blob": "fe03d7eebec36acb0d9f79b376cd020ec6245f84" + }, + { + "local_path": "inputs/pr5599-README.md", + "source_repository": "aliromman/integer-mult-bounds", + "source_commit": "0644592d421b375c221045954fdf13932575ffa8", + "source_path": "research/p104-helper-subspace-splits/README.md", + "sha256": "cb4bbe7be7d94862226804d581e6a53e63fd7867feaaa93ffc66ee6d86d052fa", + "git_blob": "50d2b36104256ba7c8e935c5b954d66426a9da8c" + }, + { + "local_path": "inputs/pr5599-PROOF.md", + "source_repository": "aliromman/integer-mult-bounds", + "source_commit": "0644592d421b375c221045954fdf13932575ffa8", + "source_path": "research/p104-helper-subspace-splits/PROOF.md", + "sha256": "f2ad7e80f97a404985a6c6d97105a65f9db5498c7f6d197b01e743c7a14e8849", + "git_blob": "e479b15351f6cf921e80f00904494428ef6f5196" + }, + { + "local_path": "inputs/pr5599-NOTICE", + "source_repository": "aliromman/integer-mult-bounds", + "source_commit": "0644592d421b375c221045954fdf13932575ffa8", + "source_path": "research/p104-helper-subspace-splits/NOTICE", + "sha256": "9c019607279d3ce6817abbf2e7c3371b454ca770f250ce0446ea45d0f11dd74a", + "git_blob": "a3f5136a05e3584342b855bd5ad1ec621379cf7b" + }, + { + "local_path": "inputs/pr5599-SPLITS.json", + "source_repository": "aliromman/integer-mult-bounds", + "source_commit": "0644592d421b375c221045954fdf13932575ffa8", + "source_path": "research/p104-helper-subspace-splits/SPLITS.json", + "sha256": "9ab3ff3ef83d74aae3ae43e8c622d70c81879d1e9881cbe623e71c389b5e7bc5", + "git_blob": "81e7f0ad221cc295a2a6f970644b48a3b64ede50" + } + ], + "retained_source_scope": "The unchanged PR5545 official source export is an executable dependency. All 33 payloads, the inventory and archive hash are checked before import. This source is not new work." +} diff --git a/research/p104-prepared-split-reuse/TASK.json b/research/p104-prepared-split-reuse/TASK.json new file mode 100644 index 0000000000..50072d3433 --- /dev/null +++ b/research/p104-prepared-split-reuse/TASK.json @@ -0,0 +1,106 @@ +{ + "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": "changed", + "actual_scope": "Prepare PR5599 prefix helper 573 as owned zero, replace its two rank-one queries, debit its rank-two target, and certify the complete conditional kappa beyond PR5599.", + "scope_change_reason": "The user requests a larger kappa. The publication refresh supplied PR5599; exact source relations compose the new paid-query replacement with its fifteen independent splits.", + "bottleneck_link": "The complete local gain is 2-2^t>0 for 0(a+b)^t`. Each split strictly increases the target moment and leaves +the paid moment fixed. The signed local target change is + +```math +4H_1+5H_2+7H_4+5H_5+5H_7+3H_8-14H_9. +``` + +Its rank mass is zero, as required. A source-bound complete caller, not a +standalone packing relaxation, supplies the resulting exponent claim. + +## 4. Native maps and the caller + +The exact signed-Pauli and phase verifiers check every paid chart change, +every helper target and every main adapter. The local replay checks a strict +nested chart relation on each public move and the source's descending owned +moves. Each helper target is strictly productive. + +Cinna Davis's p16/a7 controller and Ali Romman's all-forward implementation +from PR5544 remain literal inputs. All 18 full calls use the new local word +with fresh independent helpers. Sixteen backward main interfaces use the +retained signed exchanges and central-square translations. These wrappers +act only on the main pair. They do not alter a new helper output. + +The physical caller check retains all 104 central ports, 7,488 boundary +contacts, 53,248 central-square column checks, 3,328 main Gaussian targets, +15 thin query sites and 3,120 whole idle jobs. It checks native routes, +spectators, exact phases and every whole target. The complete counts are + +```text +paid calls: 66852 +productive fields: 13084 = 18*542 + 32*104 +rank mass surplus: 760 +maximum target: 145 +maximum paid rank: 72 +``` + +The invoice is counted twice, once from literal events and once from the +controller path lengths. Input and output normalizers, added scalar basis +operations, routes, owned allocation and erasure, queries and idles are all +included. The new independent field count enters the completion-tail bound. +It is not left at the old 12,814 value. + +## 5. Strictification, compiler and outer transfer + +Two independent rational interval engines evaluate the complete moments. +The exact raw crossing is in (0.00309839352211, 0.00309839352212). +`RESULT.json` gives its rational endpoints and the strict tested margin. The claimed kappa is 0.00309839 and the tested saving is +0.0030983905. Their gap funds the finite compiler and outer parameters. An exact negative +derivative bound on [0,0.0034] makes this crossing the raw ceiling for this +fixed invoice under the retained BIT cap. It is not a global optimum. + +Power 1024, cutoff 17, target floor 18 and tail offset 1/5 are retained. +The extra independent fields require a different tail bound: both charged +tail ratios are below 39/40, and `(39/40)^128 < 1/16`. Eight such blocks still +give the retained `2^-32` remainder. The fixed reserve is `10^-10`. +The complete normalized cost is strictly less than one. The old cutoff 20 +fails and is retained as a control. + +The compiler checks its finite integer threshold, initial range, shifted +exits, complement capacity, logarithm power 1024 and predecessor integer point. The old logarithm +power 1000 does not meet the new complement-capacity inequality. +The ordinary BIT saving remains 0.0034. All 54 strict outer conditions and +four functional conditions are checked with exact rational arithmetic. +The scalar growth bound uses fewer than 26,000 local operations and the +retained per-operation bound. The native growth bound uses the actual sum +of local paid ranks. The complete ordinary-work allowance remains below +`10^9`; the local scalar and route allowance remains below `10^7` per call. + +## 6. Scope of acceptance + +The five selected framework assumptions remain: native implementation at +all widths, owned erasure, uniform compiler closure, precision and tape +cost, and analytic integer recovery. The source helper-endpoint contract +also remains. This package proves the new finite interface, the chart +identities and every new numerical condition within that framework. + +The enormous uniform word and complete rounded multiplier are not +materialized. These are author-side checks by the same AI-assisted author. +They are not independent human acceptance or a proof-kernel theorem. +Two greedy cut orders on PR5569 reached the same fifteen-split histogram. +That observation does not prove a maximum over bases, cuts, scalar programs, +frames, controllers or multiplication algorithms. diff --git a/research/p104-prepared-split-reuse/inputs/pr5599-README.md b/research/p104-prepared-split-reuse/inputs/pr5599-README.md new file mode 100644 index 0000000000..50d2b36104 --- /dev/null +++ b/research/p104-prepared-split-reuse/inputs/pr5599-README.md @@ -0,0 +1,157 @@ +# Conditional kappa 0.00309839 from independent helper splits + +This construction raises complete conditional **kappa to 0.00309839**. +The gain over [PR5580](https://github.com/CrocSwap/integer-mult-bounds/pull/5580) +(0.00308189) is **0.00001650**, about **0.5354%**. The gain over selected +0.003027288235 is **0.000071101765**. The selected record is unchanged. + +The mechanism changes the independent helper basis. At a common-frame cut, +one helper combination can finish early and a fresh independent input can +use the remaining program. Fifteen explicit splits replace 527 helper +jobs by 542 helper jobs. They add 362 scalar events and no recursive Gaussian +call. Both input and output support are checked over every field; a local +pure row alone does not earn a new target. + +Read the [proof](PROOF.md), [exact cuts](SPLITS.json), [complete word](WORD.json.gz), +[receipt](RESULT.json), [source pins](SOURCES.json), and [validation record](VALIDATION.md). +The first split is an explicit 20-ADD change from one H9 target to independent +H5 and H4 targets. The complete caller uses the new word at all 18 full sites. + +| Quantity | Result | +| --- | ---: | +| Local public inputs | 750 | +| Independent helpers per full call | 542 | +| Owned lifetimes / peak owned fields | 8 / 1 | +| Local events | 25,502 | +| Complete paid calls | 66,852, unchanged | +| Complete productive fields | 13,084 | +| Complete rank-mass surplus | 760, unchanged | +| Tested saving | 0.0030983905 | +| Complete conditional kappa | 0.00309839 | +| Raw crossing | (0.00309839352211, 0.00309839352212) | +| Exact native maps | 2,926 | + +The added helpers enter the complete completion-tail calculation. The tail +bound changes to 39/40, with `(39/40)^128 < 1/16`. The compiler logarithm +power changes from 1000 to 1024. Every native map, helper normalizer, main +adapter, scalar basis operation, route, COPY/CLEAR cost, thin query and +whole idle is included. The ordinary BIT saving remains 0.0034. Two exact +moment engines and all 54 strict plus four functional outer conditions are +checked. The receipt gives the raw crossing and the finite compiler threshold. +A negative derivative bound supplies the raw ceiling for this fixed invoice +on [0,0.0034]; it does not bound other constructions. + +## Reproduce + +Use Python 3.12 and the standard library, from the repository root: + +```sh +python3 -B scripts/research_package.py --package research/p104-helper-subspace-splits --check-only +python3 -B scripts/research_package.py --package research/p104-helper-subspace-splits +``` + +The registered hook runs normally and with `-O`. Its success markers are +`PASS_P104_HELPER_SUBSPACE_KAPPA_00309839` and +`PASS_REGISTERED_RESEARCH_PACKAGE`. Direct replay needs no Git or network: + +```sh +python3 -I -B research/p104-helper-subspace-splits/verify.py +python3 -I -O -B research/p104-helper-subspace-splits/verify.py +``` + +Normal replay is read-only. `--write` explicitly regenerates the two result +artifacts. Inputs are authenticated before imported source code executes. +Each replay uses a fresh bytecode-cache path. The checks reject contaminated +prefix and suffix vectors, missing boundary basis operations, an unearned +whole target, extra helper credit, a missing paid call, a wrong native phase, +a missing central translation, an inadequate cutoff and insufficient BIT stock. + +## Scope and coordination + +The scientific base is canonical main +`5e0052ca0aa3036a3afa8b0438927377c8d97d53`, priority revision 7. +The [canonical claim](https://github.com/CrocSwap/integer-mult-bounds/discussions/5125#discussioncomment-19183208) +records the changed question and local screens. The final publication overlap +cache covered 334 open PRs and 4,863 Discussion records, with complete remote +pagination and incomplete sparse local coverage. Source and coverage details +are coordination evidence, not a novelty proof. + +The consumed PR5580 word is pinned to +`6efa248cf456d6101d757e9d09ba29711d18a13a`. It retains the released PR5569 +handoff and PR5561 helper endpoints. The new basis splits were first found +on PR5569. Two different greedy cut orders reached the same fifteen-split +histogram. All fifteen were then composed with PR5580 and checked again. The exact +source copy is retained in this branch at commit +`29fe88ba218b5d2192d8e31f07a01d1141afdacd`. Its SHA256 and Git blob match the +recorded PR5580 source. Registered replay needs only this branch history; +it does not need cached objects from unmerged PR branches. +No new Gaussian itinerary is introduced. Active frame-extension work in +[Discussion5575](https://github.com/CrocSwap/integer-mult-bounds/discussions/5575) +is a separate investigation. + +The final refresh also found [parallel coupled-basis and handoff work](https://github.com/CrocSwap/integer-mult-bounds/discussions/5125#discussioncomment-19154639). +It uses the same rank-one mechanism and separately changes paid boundary +work. The [public composition handoff](https://github.com/CrocSwap/integer-mult-bounds/discussions/5125#discussioncomment-19183908) +releases these fifteen cuts and leaves the six paid-boundary changes with +the parallel claim. No exclusive method novelty or combined gain is claimed. +The new scalar contacts and input count change the hypotheses of +[PR5590](https://github.com/CrocSwap/integer-mult-bounds/pull/5590)’s fixed-contact floor. + +The scope changes the scalar word, the input count and the target contract. +It therefore differs from a scalar-only simplification or a fixed-input +helper stop. The unchanged paid histogram now supports a different, +fully independent target histogram. + +The five selected framework assumptions remain: native implementation at +all widths, owned erasure, uniform compiler closure, precision and tape cost, +and analytic recovery. The helper-endpoint contract also remains. +The complete rounded multiplier and enormous uniform compiler word are not +materialized. The same AI-assisted author constructed and checked this +package. Independent human review, proof-kernel acceptance and global +optimality are not claimed. + +## Sources and credit + +- **Ali Romman**: [PR5580](https://github.com/CrocSwap/integer-mult-bounds/pull/5580) + supplies the exact source word; [PR5544](https://github.com/CrocSwap/integer-mult-bounds/pull/5544) + and [PR5545](https://github.com/CrocSwap/integer-mult-bounds/pull/5545) supply + the complete P104 caller and source replay. +- **Joel Pulikkan / GamingPuzzled**: [PR5569](https://github.com/CrocSwap/integer-mult-bounds/pull/5569) + supplies the priced helper handoff; [PR5472](https://github.com/CrocSwap/integer-mult-bounds/pull/5472) + supplies an earlier successor-handoff construction. +- **DreamingOfClouds**: [PR5561](https://github.com/CrocSwap/integer-mult-bounds/pull/5561) + supplies free helper endpoints and PR5568 supplies search tools. + **thu-nmrc** supplies the PR5551 contact improvements. +- **Gareth Davidson / bitplane**, **David Arias** and **Cinna Davis** supply + the PR2305 composition, PR2152 coalesced word and PR2219 private reuse. + Cinna Davis also supplies the controller lineage. +- **Jacob Alan Sussman** supplies productive mixed-target recursion. + **zxv** and **Cao Yifan** supply the retained interval, compiler and + native/pricing lineage. Source notices preserve earlier geometry, BIT + and analytic credit. + +The elementary rank-one basis identity is not claimed as a new general +linear-algebra theorem. The contribution is this explicit independent-target +construction and its complete conditional price. New work is by Ali Romman +with substantial OpenAI Codex assistance; no subagents. Apache-2.0. +See [NOTICE](NOTICE). + +## Open next questions + +An independent reviewer can check the first split and then replay the complete +package. Further gains could use a different compatible cut order, basis or +frame itinerary. Both prefix and suffix support must be proved before a +new target receives credit. The two greedy runs do not establish a global +maximum. [TASK.json](TASK.json) gives the first checks and remaining obligations. + +The optional continuation screen is reproducible with: + +```sh +python3 -I -B research/p104-helper-subspace-splits/search.py +``` + +It tests exact elimination-basis pairs at cuts immediately after MOVE events, +inside equal-boundary helper groups. On the final word it finds no further +candidate in 53 groups. This result covers those tested pairs. It does not +exclude different cut sequences, arbitrary basis combinations or new frames. +The complete-kappa verifier does not depend on a discovery search failure. diff --git a/research/p104-prepared-split-reuse/inputs/pr5599-SPLITS.json b/research/p104-prepared-split-reuse/inputs/pr5599-SPLITS.json new file mode 100644 index 0000000000..81e7f0ad22 --- /dev/null +++ b/research/p104-prepared-split-reuse/inputs/pr5599-SPLITS.json @@ -0,0 +1,457 @@ +[ + { + "cut_after": 13778, + "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": 13768, + "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": 13709, + "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": 13676, + "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": 12526, + "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": 12448, + "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": 13967, + "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": 13642, + "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": 13643, + "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": 13643, + "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": 13632, + "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": 13779, + "frame": 597, + "pivot": 649, + "a": { + "649": "1", + "648": "-1" + }, + "b": { + "650": "-1", + "649": "1", + "198": "-1" + }, + "c": { + "649": "1" + }, + "d": { + "650": "-1", + "649": "1" + }, + "ranks": [ + 1, + 8 + ] + }, + { + "cut_after": 12079, + "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": 12611, + "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 + ] + }, + { + "cut_after": 13817, + "frame": 597, + "pivot": 648, + "a": { + "652": "1" + }, + "b": { + "652": "1", + "648": "-1", + "198": "-1/2", + "650": "1", + "649": "-1" + }, + "c": { + "648": "1" + }, + "d": { + "648": "1" + }, + "ranks": [ + 1, + 4 + ] + } +] diff --git a/research/p104-prepared-split-reuse/inputs/pr5599-WORD.json.gz b/research/p104-prepared-split-reuse/inputs/pr5599-WORD.json.gz new file mode 100644 index 0000000000..d9ebf6cace Binary files /dev/null and b/research/p104-prepared-split-reuse/inputs/pr5599-WORD.json.gz differ diff --git a/research/p104-prepared-split-reuse/inputs/pr5599-local.py b/research/p104-prepared-split-reuse/inputs/pr5599-local.py new file mode 100644 index 0000000000..e6e28bacda --- /dev/null +++ b/research/p104-prepared-split-reuse/inputs/pr5599-local.py @@ -0,0 +1,206 @@ +"""Check the complete P104 word with an independent helper inventory. + +Adapted from Ali Romman's PR5544/5545. David Arias supplied the word; +Cinna Davis supplied private reuse; Gareth Davidson supplied composition. +Prepared by Ali Romman 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 + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] + +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 replay(w): + public = w['public'] + need(type(public) is int and 735 <= public <= 750, 'Public inventory bound') + need(len(w['initial']) == len(w['final']) == public, 'Public boundary size') + need(len(w['program']) < 26000, 'Fixed operation bound') + frames = [span(x) for x in w['frames']] + rows = [{r:Q(1)} for r in range(public+8)] + current = list(w['initial']) + [None]*8 + paid, scalar, live_owned, peak = Counter(), 0, set(), 0 + lifetimes = 0 + for e in w['program']: + op, r = e[:2] + need(0 <= r < public+8, '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 >= public and r not in live_owned, 'Owned initialization') + live_owned.add(r) + lifetimes += 1 + 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 < public+8 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[:public] == w['final'], 'All public and owned exits') + live = set(w['live']) + for r,row in enumerate(rows): + expected = {r:Q(1)} if r < public else {} + if r-112 in live: + expected[r-112] = Q(1) + need(row == expected, 'All 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(public) 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':public, 'owned_lifetimes':lifetimes, + 'peak_owned_fields':peak, 'real_scalar_allowance':scalar, 'endpoint_coefficients':(public+8)*(public+8), + 'paid_rank_mass':sum(r*count for r,count in paid.items())} + +def reverse_columns(w): + """Check the transpose with dense dyadic rows and the reverse chronology.""" + public = w['public'] + n = public+8 + 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 < public: + 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): + n = w['public'] + 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(n): + 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-prepared-split-reuse/inputs/pr5599-pricing.py b/research/p104-prepared-split-reuse/inputs/pr5599-pricing.py new file mode 100644 index 0000000000..fe03d7eebe --- /dev/null +++ b/research/p104-prepared-split-reuse/inputs/pr5599-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('.00309839'), Q('.0030983905') +PREVIOUS = Q('.00308189') + + +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()) == 13084 and sum(paid.values()) == 66852, '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':'.00309839','previous_open_pr5580':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':1, + 'fixed_scalar_growth_bound':'At most 2^(16*26000) before native factors; a declared constant, not an attained norm.', + 'local_paid_rank_mass':local['paid_rank_mass'], + '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-prepared-split-reuse/prepared.py b/research/p104-prepared-split-reuse/prepared.py new file mode 100644 index 0000000000..6eae576428 --- /dev/null +++ b/research/p104-prepared-split-reuse/prepared.py @@ -0,0 +1,134 @@ +"""Exact endpoints for the prepared P104 helper. + +Adapted from Ali Romman's P104 local.py; retained native sources are unchanged. +Changes: one retired helper, arbitrary owned roles, two ordinary reconstructions, +and 758 total fields. Scratch-net with OpenAI Codex assistance. Apache-2.0. +""" +from collections import Counter +from fractions import Fraction as Q +from common import need + +def add(dst, src, q): + for k,v in tuple(src.items()): + z=dst.get(k,Q(0))+q*v + if z:dst[k]=z + else:dst.pop(k,None) + +def span(basis): + out={0} + for v in basis: + need(type(v) is int and 0 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-prepared-split-reuse/pricing.py b/research/p104-prepared-split-reuse/pricing.py new file mode 100644 index 0000000000..02efc04dde --- /dev/null +++ b/research/p104-prepared-split-reuse/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-prepared-split-reuse/verify.py b/research/p104-prepared-split-reuse/verify.py new file mode 100644 index 0000000000..bdd4bc2d5c --- /dev/null +++ b/research/p104-prepared-split-reuse/verify.py @@ -0,0 +1,180 @@ +"""Verify the prepared-helper construction and complete conditional bound. + +Scratch-net with substantial OpenAI Codex assistance. Apache-2.0. +Native/caller/pricing machinery retains its source authors and notices. +""" +import argparse +from collections import Counter +from copy import deepcopy +from fractions import Fraction as Q +from hashlib import sha256, sha1 +from pathlib import Path +import gzip +import json +import sys + +sys.dont_write_bytecode = True +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) +from common import closure, load, need, read +from construct import construct +import prepared + + +def reject(fn): + try: + fn() + except ValueError as error: + return str(error) + raise ValueError('A semantic corruption was accepted') + + +def controls(word): + out = {} + mutations = { + "missing_initialization": (["INIT",573,3], None), + "wrong_second_reconstruction": (["ADD",573,710,"2",603], ["ADD",573,710,"4",603]), + "missing_owned_cleanup": (["CLEAR",573,603], None), + "missing_owned_reset": (["CLEAR",573,3], None), + "wrong_delivery_frame": (["COPY",573,572,"1",595], ["COPY",573,572,"1",603]), + } + for name,(old,new) in mutations.items(): + bad = deepcopy(word) + need(bad['program'].count(old) == 1, 'Unique control site '+name) + at = bad['program'].index(old) + if new is None: + bad['program'].pop(at) + else: + bad['program'][at] = new + out[name] = reject(lambda: prepared.replay(bad)) + return out + + +def source_relations(source): + """Derive each replacement relation before specializing any input.""" + rows = [{r:Q(1)} for r in range(758)] + sites = {13670:[(573,1),(572,-1),(732,2)], + 13691:[(573,1),(572,-1),(710,-2)]} + checked = [] + for i,e in enumerate(source['program']): + if i in sites: + row = {} + for r,q in sites[i]: + prepared.add(row,rows[r],Q(q)) + need(row == {573:Q(-2)}, 'Exact source-version relation '+str(i)) + checked.append({'source_event':i,'combination':sites[i], + 'original_input_relation':[[573,'-2']]}) + op,r = e[:2] + if op in ('INIT','CLEAR'): + rows[r] = {} + 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': + prepared.add(rows[r],rows[e[2]],Q(e[-2])) + else: + need(op == 'MOVE','Known source opcode') + need(len(checked) == 2,'Both causal relations') + return checked + + +def run(): + pins = read(HERE/'SOURCES.json') + for pin in pins['external_inputs']: + raw = (HERE/pin['local_path']).read_bytes() + need(sha256(raw).hexdigest() == pin['sha256'], 'Source SHA256 '+pin['local_path']) + need(sha1(('blob '+str(len(raw))+'\0').encode()+raw).hexdigest() == pin['git_blob'], + 'Source Git blob '+pin['local_path']) + price = (HERE/'inputs/pr5599-pricing.py').read_text() + for old,new in read(HERE/'PRICING-EDITS.json'): + need(price.count(old) == 1, 'Unique declared price edit '+old) + price = price.replace(old,new) + need(price == (HERE/'pricing.py').read_text(), 'Declared pricing changes only') + source = read(HERE/'inputs/pr5599-WORD.json.gz') + relations = source_relations(source) + word = construct(source) + local = prepared.replay(word) + columns = prepared.reverse_columns(word) + rejected = controls(word) + print('PASS prepared construction, all 758 endpoints, transpose and five controls', flush=True) + with closure() as root: + L = load(HERE/'inputs/pr5599-local.py','local') + L.ROOT = root + parent = L.replay(source) + delta = Counter(local['paid']); delta.subtract(parent['paid']) + need({r:n for r,n in delta.items() if n} == {1:-2}, 'Exact paid deletion') + targets = Counter(parent['helpers']); targets[2] -= 1 + need(dict(targets) == local['helpers'], 'One rank-two target is retired') + old_maps = {(e[2],e[3]) for e in source['program'] if e[0] == 'MOVE'} + new_maps = {(e[2],e[3]) for e in word['program'] if e[0] == 'MOVE'} + need(new_maps <= old_maps, 'No new paid native map') + # The inherited native evaluator checks all remaining maps, every main + # adapter and every original helper endpoint. Remove the retired target + # and its two unused external normalizers from the complete new bill. + native = L.native(word) + need(native['helpers'] == parent['helpers'], 'Original native endpoint inventory') + native['helpers'][2] -= 1 + native['helper_normalizers'] -= 2 + native['retired_helper'] = 573 + print('PASS every remaining native map and exact phase', flush=True) + C = load(root/'research/p104-productive-controller/caller.py','prepared_caller') + caller = C.construct() + need(caller == read(root/'research/p104-productive-controller/CONTROLLER.json'), 'Exact full caller') + physical = C.physical(caller,word) + P = load(HERE/'pricing.py','prepared_pricing') + result = P.run(local,native,caller,physical) + print('PASS complete invoice, two moment engines, compiler and all outer predicates', flush=True) + bad = deepcopy(local); bad['paid'][1] -= 1 + rejected['omitted_paid_job'] = reject(lambda:P.assemble(bad,native,caller,physical)) + bad = deepcopy(local); bad['helpers'][2] += 1 + rejected['retired_target_still_credited'] = reject(lambda:P.assemble(bad,native,caller,physical)) + E = L.load(root/'research/higher-moment-strictification/verify.py','prepared_intervals') + new_t = {int(r):n for r,n in result['targets'].items()} + new_p = {int(r):n for r,n in result['paid'].items()} + old_t,old_p = dict(new_t),dict(new_p) + old_t[2] += 18; old_p[1] += 36 + parent_interval = [Q('.00309839352211'),Q('.00309839352212')] + signs = [] + for k in parent_interval: + a,b = E.moment(old_t,1-k),E.moment(old_p,1-k) + signs.append((a[0]-b[1],a[1]-b[0])) + need(signs[0][0] > 0 > signs[1][1], 'Exact predecessor crossing reproduced') + lo,hi = map(Q,result['raw_root_interval']) + gain = [lo-parent_interval[1],hi-parent_interval[0]] + need(gain[0] > 0, 'Strict increase over predecessor raw crossing') + at = 1-P.TESTED + two = E.power(2,at) + local_gain = (2-two[1],2-two[0]) + need(local_gain[0] > 0, 'Full local paid-minus-target trade is profitable') + receipt = P.encode(dict(status='PASS_P104_PREPARED_SPLIT_KAPPA_00309871', + source_commit='0644592d421b375c221045954fdf13932575ffa8', + local_paid_delta={1:-2},local_target_delta={2:-1}, + local=local,source_relations=relations,transpose=columns,native=native,physical=physical, + parent_raw_interval=parent_interval,raw_gain_interval=gain, + local_moment_gain=local_gain,controls=rejected,complete_cost=result, + limits=['The five inherited framework assumptions remain.', + 'The complete uniform compiler word and rounded multiplier are not materialized.', + 'No independent human review, proof-kernel acceptance or selected promotion is claimed.'])) + return receipt,word + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--write',action='store_true') + args = parser.parse_args() + receipt,word = run() + for name,data in [('RESULT.json',receipt),('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: + need(read(path) == data, 'Saved semantic artifact '+name) + print(receipt['status'],flush=True) + print(json.dumps({k:receipt['complete_cost'][k] for k in + ('kappa','raw_root_interval','productive_fields','paid_calls')},sort_keys=True),flush=True) + + +if __name__ == '__main__': + main()