diff --git a/research/two-full-exact-width-gate/OVERLAP.json b/research/two-full-exact-width-gate/OVERLAP.json new file mode 100644 index 0000000000..f403569c61 --- /dev/null +++ b/research/two-full-exact-width-gate/OVERLAP.json @@ -0,0 +1,71 @@ +{ + "schema_version": 1, + "publication_base": "32890bc5de034ab8fc93ac88ead7279a6a416d04", + "coordination": "Assigned continuation of the released exact-execution source scope. The coordinator handles external posts and final publication checks.", + "cache_coverage": { + "fetched_through": "2026-10-25T06:43:44Z", + "open_prs": 383, + "closed_prs": 4682, + "discussion_records": 4804, + "complete_pagination": true + }, + "later_coordinator_checks": "The coordinator fetched canonical main at 2026-10-25 06:39 UTC. Main, selection and guidance remain at the publication base. The complete overlap refresh and a focused reading of the four new related PR bodies found no duplicate of this fixed-cut two-band tariff.", + "distinct_scopes": [ + { + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/4966", + "relationship": "Source caller, moving-frame checker and independent-error precision tariff. This package changes the premise to ideal exact operators and independent input amplitudes." + }, + { + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/4983", + "relationship": "Additivity required by unchanged scalar gates, not a two-band integer width census." + }, + { + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/5106", + "relationship": "Coherent rank-gauge countermodel, not exact input-width charging." + }, + { + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/5444", + "relationship": "Rounded inverse fibers, relative output precision and repeated history, not literal source-cut numerator width." + }, + { + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/3854", + "relationship": "Integer upper inequalities for a Gaussian interval routine, not this lower width gate." + }, + { + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/5450", + "relationship": "Coordinator checked the standalone bit-flip paid-return span threshold; different input and cost model." + }, + { + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/5454", + "relationship": "Coordinator checked cube-zero multiplication outer-product cost with free GL2; different representation and tariff." + }, + { + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/5492", + "relationship": "Actual fixed-grid reversible-lifting frame-cycle defect. This tests a rounded operator interface, not exact independent input-band width." + }, + { + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/5479", + "relationship": "Uniform conditioning for the production-scale untruncated Gaussian cell. This does not count the retained caller register ranges." + }, + { + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/5500", + "relationship": "Rounded old-H Schur elimination and source LU factor growth. This uses a different source and boundary model." + }, + { + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/5518", + "relationship": "Authentication of native scientific-product commitments. This is a verifier-normalization audit, not a width theorem." + } + ], + "historical_local_evidence": { + "path": "work/exact-coefficient", + "status": "Preserved unchanged in the originating worktree; not a runtime dependency of this package.", + "sha256": { + "EXACT-LATTICE.md": "174f8d996cccff7425d26f60592c96754bab7da6d22c4d5fae3eb4ecff6a0d3d", + "exact_lattice.py": "25ff2e768fde4c2c9c827a215a51f45c76e541ea2eb0399698796ca90bff12fb", + "exact_lattice.json": "e5e25dfe2523898e45d29d8e8cf89f07c91c1e91276f088fe52969cebdf7a329", + "invariant_screen.py": "623ea96fb548aafb25b5dda7c2c975957b87081470cffa9e8d420f682fa47139", + "invariant_screen.json": "b16ba37b7e2b4ad045559ba28a46a052b0165b3245f99be07902c9cdca4127c0" + } + }, + "limits": "No match is not a worldwide novelty proof. This is a source-specific application of classical valuation and counting." +} diff --git a/research/two-full-exact-width-gate/PROOF.md b/research/two-full-exact-width-gate/PROOF.md new file mode 100644 index 0000000000..59e9498b32 --- /dev/null +++ b/research/two-full-exact-width-gate/PROOF.md @@ -0,0 +1,209 @@ +# An exact width gate for one two-FULL caller + +This is a source-specific negative result. It concerns a literal exact integer +representation and a uniform width tariff. It does not exclude every exact +implementation, every BIT controller, or the two-FULL idea itself. It gives no +new kappa. + +## Declared model + +Use the retained round-three source at base +`32890bc5de034ab8fc93ac88ead7279a6a416d04`. Its decompressed payload SHA256 is +`cfcd36b40326d7a5815e1db5313444379b3fb756b27d5201c561574c085cc0dd`. +The two calls use the forward and backward source orientations. Each call keeps +all 632 persistent roles, 408 independent helper inputs and outputs, and the +single reused owned center C0. Each orientation has 3,298 paid occurrences. +The two helper banks are distinct. + +The caller is read from right to left: + +```text +S_e D2 U(Q) D1 L(-Q^-1) B S_e^-1, +B = [[1,-1],[1,0]], S_e = diag(1,e), e = 2^-k. +``` + +Q is the common one-axis Gaussian. D1 and D2 act on separate fresh eight-axis +blocks. The operators and the retained boundary maps are ideal and exact. +The source charts and the declared target invoice are inherited from +[PR #4966](https://github.com/CrocSwap/integer-mult-bounds/pull/4966). +No independent operator errors are introduced. + +The width policy has four premises: + +1. At each paid occurrence, store the full exact register value as integer + numerators. A fixed denominator or one shared exponent is permitted. +2. Choose that occurrence's width before the data is known. It must hold for + every permitted input at that occurrence. Different occurrences can have + different widths. +3. The raw invoice funds leading width `k+o(k)` at each occurrence. The leading + recursive charge is linear in this width. +4. Take `k -> infinity` at fixed native rank and fixed fiber/column + multiplicity f. A separately funded width comparable with k is outside + this comparison. + +The multiplicity f is fixed as well as the rank. A tensor frame can add a +denominator-width offset of order f. Thus this proof does not infer the same +leading charge when f grows with k. No growing-multiplicity limit is claimed. + +These are cost-model premises, not conclusions about every arithmetic method. +In particular, the sum below is a sum of uniform site charges. A separate +worst-case witness for each site does not prove the same sum for an adaptive +per-input width policy. + +## The two-band lemma + +Let p and q be fixed, nonzero dyadic rational numbers. Let + +```text +c = max(0, v2(p) - v2(q)). +z(A,B) = p A / 2^k + q B, +0 <= A < 2^(k-c), 0 <= B < 2^k, k > c. +``` + +There are exactly `2^(2k-c)` distinct values z. For if two values are equal, + +```text +p (A-A') = -2^k q (B-B'). +``` + +If `B=B'`, then `A=A'`. Otherwise the 2-adic valuation gives +`v2(A-A') >= k + v2(q) - v2(p) >= k-c`. Thus `A-A'` is a multiple of +`2^(k-c)`. Its absolute value is smaller than this number. It is zero, and +then `B-B'` is zero. This proves injectivity for every integer `k>c`. + +Any injective exact encoding of this scalar range needs at least `2k-c` +information bits. This is a classical counting argument applied to the two +independent source amplitudes. It is not a new general information theorem. + +For literal integer numerators, a shared exponent cannot remove the leading +width. Write `p=2^a u` and `q=2^b v`, where u and v are odd integers. Take +`A=1` and `B=2^(k-1)`. For all sufficiently large k, + +```text +z = 2^(a-k) [u + v 2^(2k-1+b-a)]. +``` + +The quantity in brackets is an odd integer. Its bit length is `2k-O(1)`: +the nonzero second term has this bit length and the first term is fixed. +For `k>a`, the displayed numerator is already reduced. Any other integer +numerator for the same dyadic value, with a power-of-two denominator, is at +least as wide. A common exponent for more than one component can add zeros; +it cannot shorten this reduced numerator. Thus a uniform literal numerator +width at this site is at least `2k-O(1)`. + +Multiplication by a fixed nonzero Gaussian dyadic vector preserves the number +of distinct values. At least one real or imaginary component is a fixed +nonzero dyadic multiple of z, so the same leading numerator bound holds there. +At fixed multiplicity, boundary denominators change only the constant term. They are not +set to zero or granted for free. + +## Binding the lemma to the source + +The live dependency +`research/two-full-border-paid-precision/independent-review/invariance/check_invariance.py` +checks every one of the 42,898 source events. It checks all common-frame scalar +contacts, paid frame changes, warp incidences, final frames, owned-center +rules, and boundary markers. It verifies all 72 binary warp matrices and all +four signed/oriented zero-address phases. + +Under its inherited exact moving-frame semantics, a paid transition changes +the physical frame and leaves the logical value unchanged. Each logical warp +has a homogeneous binary address map and a quadratic phase with no constant +term. It fixes `delta_0` with phase one. The `phase` records are section labels. +Boundary adapters change the physical reference, not the logical value. +The audit retains the 82 early, identity X-exit markers per orientation. It +does not silently assume that these markers occur in their final frame. + +It follows by induction that logical multiples of `delta_0` follow the exact +rational scalar program. This is a logical-frame invariant. It does not say +that every physical map fixes physical `delta_0`. The inherited interpretation +of the primitives as exact Gaussian operations is not a new physical replay. + +Set the original main X input to zero. The first call has a main input channel +scaled by `e^-1`. At one port, a suitable original Y input is a scalar multiple +of `Q delta_0`; it makes source logical X a multiple of `delta_0` and logical +Y zero. For the second call, use a scalar multiple of `Q D1^-1 delta_0`. +It makes both source logical main inputs equal multiples of `delta_0`, up to +a common sign. These are the retained unitary boundary substitutions from +PR #4966. Each is a separate allowed input choice. + +Choose that main amplitude as B after the `e^-1` scaling. The original main +amplitude is then `B/2^k`. Choose one fresh helper input in that call's entrance +frame with logical amplitude `A/2^k`. The helper boundary has no e factor. +The two amplitudes vary independently. Other input channels can be zero. +A fixed rescaling puts their joint norm below one if required and leaves the +leading width bound unchanged. + +For each source orientation, the new checker propagates 520 independent +columns: 112 main channels in this restricted caller pattern and all 408 +helper inputs. It checks the complete endpoint on this subspace and every +helper return. This is not a new full 632-input endpoint proof. +Immediately before each paid occurrence, it records the first nonzero main +coefficient q and helper coefficient p, when both exist. The logical value +on this input slice is `p A/2^k + q B`. The physical frame is invertible, so it +does not identify two such values. + +The census gives: + +| Source orientation | H1 | H2 | H3 | H4 | H5 | H8 | +| --- | ---: | ---: | ---: | ---: | ---: | ---: | +| Forward | 1587 | 258 | 362 | 70 | 28 | 8 | +| Backward | 1576 | 148 | 380 | 95 | 12 | 0 | +| Total | 3163 | 406 | 742 | 165 | 40 | 8 | + +The certificate contains all 4,524 witnesses, with source event, owner, input +indices, exact coefficients and c. In all of them, `c<=2`. A single input is +not claimed to maximize all these occurrences. The uniform site-width premise +is what permits the sum of their separate required widths. + +## Complete declared invoice + +Both source calls retain all their productive helper targets. Their combined +helper profile is twice `{4:28,7:7,8:47,9:326}`. The declared main target adds +224 rank-17 outputs. The disjoint-axis splits are `4=3+1`, `5=3+2` and +`8=3+3+2`. They give: + +```text +targets = {4:56,7:14,8:94,9:652,17:224}, mass 10750; +raw paid = {1:4656,2:920,3:1386}, mass 10654; +width-charged = {1:7819,2:920,3:1386}, mass 13817. +``` + +The extra charge is only one leading H1 at each of the 3,163 witnessed +original rank-one occurrences. No width claim for an internal factor of a +higher-rank split is needed. The other wide-cut counts remain information +only. Scalar work, storage and routing cannot reduce this lower invoice. + +For the power tariff `r^t`, `0<=t<=1`, every target rank is at least four and +every charged paid rank is at most three. Therefore + +```text +T_t <= 4^(t-1) * 10750, +P_t >= 3^(t-1) * 13817, +T_t/P_t <= (4/3)^(t-1) * 10750/13817 <= 10750/13817 < 1. +``` + +This rejects every such moment for the stated uniform width policy. It does +not depend on a numerical root or an independent-error model. + +## Evidence and limits + +The written valuation and numerator arguments cover every sufficiently large +k under the stated premises. The verifier gives finite corroboration for all +75 coefficient pairs in the source certificate. It checks injectivity at k=5, +exact reduced numerators at k=32 and k=64, and six separate paid-cut executions +with four scalar inputs each. Removing all independent helper inputs removes +every two-band witness. Four in-process controls reject a false valuation +loss, a zero band, a missing final owned clear and a float in an exact receipt. +Isolated normal and optimized processes reject changed source bytes and a +changed witness coefficient. + +The result leaves open adaptive widths, joint symbolic state, changed scalar +words, changed helper boundaries, another cost law, and already funded larger +widths. It does not prove Gaussian/frame compatibility for recursively +substituted approximate children. No full physical Gaussian implementation, +uniform compiler, outer multiplication replay, or new kappa is supplied. + +Prepared by Ali Romman, with substantial OpenAI Codex assistance. The actual +source, caller, moving-frame audit and earlier contributors retain their credit +as stated in README.md and the pinned source files. Apache-2.0. diff --git a/research/two-full-exact-width-gate/README.md b/research/two-full-exact-width-gate/README.md new file mode 100644 index 0000000000..06f3cf2735 --- /dev/null +++ b/research/two-full-exact-width-gate/README.md @@ -0,0 +1,108 @@ +# Exact numerator width at two-FULL source cuts + +Exact arithmetic does not make the declared two-FULL border affordable under +one uniform width policy. The actual source has 4,524 paid cuts with two +independent integer bands. At each such cut, a literal exact numerator needs +leading width 2k rather than the budgeted k. Charging only the 3,163 original +rank-one cuts gives paid mass 13,817 versus target mass 10,750. Every power +moment with exponent in [0,1] then fails. **The complete kappa calculation +does not improve.** + +Read [the proof](PROOF.md), [exact result](RESULT.json), +[all occurrence witnesses](WITNESSES.json.gz), and [source pins](SOURCES.json). +The publication base is `32890bc5de034ab8fc93ac88ead7279a6a416d04`. + +## Exact scope + +The source operations are ideal and exact. The two integer amplitudes are +independent inputs; there are no independent operator faults. Each paid +occurrence has a width fixed for all its permitted inputs. The raw bill funds +`k+o(k)` bits and charges linearly in width, at fixed native rank and fixed +fiber/column multiplicity. Tensor-frame denominator offsets can grow with that +multiplicity; no limit with growing multiplicity is claimed. + +This is a source-specific gate for literal numerators, including a shared +exponent. It is not a lower bound for adaptive per-input width charges, joint +symbolic storage, different words, or a baseline that already funds a larger +leading width. Separate worst-case site witnesses do not prove one input +incurs their sum under an adaptive policy. + +The new census uses the retained moving-frame audit as a pinned live input. +That audit checks all 42,898 events and the zero-address phase of all 72 warp +matrices. The new code checks the 520-column restricted caller input space, +all independent helper returns, all 4,524 recorded cuts, and the full declared +helper and main target debit. It does not rerun physical Gaussian compilation. +The rank-split wide profile is informational; the rejection uses original H1 +cuts only. + +## Reproduce + +Use Python 3.12 and its standard library: + +```sh +python3 -B research/two-full-exact-width-gate/verify.py +python3 -O -B research/two-full-exact-width-gate/verify.py +python3 -B research/two-full-exact-width-gate/test_mutations.py +python3 -B scripts/research_package.py --package research/two-full-exact-width-gate +``` + +Expected direct output: + +```text +PASS_TWO_FULL_EXACT_WIDTH_GATE wide_sites=4524 extra_H1=3163 ratio_upper=10750/13817 new_kappa=false +PASS_TWO_FULL_WIDTH_MUTATIONS checks=4 normal_and_optimized=true +``` + +Default replay is read-only. `verify.py --write` rebuilds the certificate and +receipt. Regeneration compares decompressed canonical JSON, not gzip headers. +The source archive and inherited frame checker have exact byte pins. The two +live input paths in VERIFY.json must be present in a standalone export. No +Git or network access is needed by either direct scientific check. + +The controls reject an understated valuation loss, a zero band coefficient, +a missing final C0 clear, a float in an exact receipt, changed source bytes, +and a changed witness coefficient. The last two use isolated normal and +optimized subprocesses. The finite checks support the written proof; they +do not replace its all-k argument. + +## Related work and credit + +Cao Yifan supplied the retained round-three source and its full profile in the +[PR #4610 lineage](https://github.com/CrocSwap/integer-mult-bounds/pull/4610). +The [pinned source proof](https://github.com/CrocSwap/integer-mult-bounds/blob/32890bc5de034ab8fc93ac88ead7279a6a416d04/research/kappa-round3-warp-20261022/PROOF.md) +retains the native, helper and compiler lineage. + +Yiyang (@Lyy-iiis) supplied the actual caller, source boundary calculation and +moving-frame audit in [PR #4966](https://github.com/CrocSwap/integer-mult-bounds/pull/4966). +The [pinned caller proof](https://github.com/CrocSwap/integer-mult-bounds/blob/32890bc5de034ab8fc93ac88ead7279a6a416d04/research/two-full-border-paid-precision/paid-sensitivity/PROOF.md) +rejects a different, independent-error policy. Its +[pinned invariant audit](https://github.com/CrocSwap/integer-mult-bounds/blob/32890bc5de034ab8fc93ac88ead7279a6a416d04/research/two-full-border-paid-precision/independent-review/invariance/REVIEW.md) +supplies the exact logical-frame semantics reused here. Dillon's earlier +[PR #4623](https://github.com/CrocSwap/integer-mult-bounds/pull/4623) retains +credit for the border and recovery question. + +Cinna Davis's [PR #4983](https://github.com/CrocSwap/integer-mult-bounds/pull/4983) +concerns additive scalar compatibility. JoyboyBrian's +[PR #5106](https://github.com/CrocSwap/integer-mult-bounds/pull/5106) concerns a +coherent rank gauge. Neither argument is used as an exact width lower bound. +The rounded inverse and history frontier in +[PR #5444](https://github.com/CrocSwap/integer-mult-bounds/pull/5444) concerns +output-grid fibers and repeated recoding, not this source-cut numerator bill. +[OVERLAP.json](OVERLAP.json) records these distinctions and coverage limits. + +The new source census, width proof, checker and package were prepared by +Ali Romman (@aliromman), with substantial OpenAI Codex assistance. Parallel +agents are part of the author process, not independent human review. +Classical valuation, injective counting and rank separation are not claimed +as new general mathematics. New files are Apache-2.0. The source notices and +retained contributors remain unchanged. + +## Open next questions + +A changed exact representation needs a literal caller and a complete cost +comparison. Start with one paid cut and state where both independent bands +are stored, how its Gaussian action is computed, and what the input and return +costs are. Joint symbolic state, adaptive widths and larger funded baselines +are outside this theorem and need their own proofs. Recursive child +compatibility remains a separate obligation. [TASK.json](TASK.json) gives the +scoped follow-up and stop rule. diff --git a/research/two-full-exact-width-gate/RESULT.json b/research/two-full-exact-width-gate/RESULT.json new file mode 100644 index 0000000000..a46e31c12e --- /dev/null +++ b/research/two-full-exact-width-gate/RESULT.json @@ -0,0 +1,959 @@ +{ + "all_power_moments_ratio_upper": "10750/13817", + "baseline_paid": { + "1": 4656, + "2": 920, + "3": 1386 + }, + "charged_paid": { + "1": 7819, + "2": 920, + "3": 1386 + }, + "complete_targets": { + "4": 56, + "7": 14, + "8": 94, + "9": 652, + "17": 224 + }, + "direct_cut_checks": [ + { + "direction": "forward", + "event": 8200, + "samples": 4 + }, + { + "direction": "forward", + "event": 13513, + "samples": 4 + }, + { + "direction": "forward", + "event": 19172, + "samples": 4 + }, + { + "direction": "backward", + "event": 8148, + "samples": 4 + }, + { + "direction": "backward", + "event": 12436, + "samples": 4 + }, + { + "direction": "backward", + "event": 15235, + "samples": 4 + } + ], + "entropy_constant_max": 2, + "finite_injectivity": [ + { + "coarse": "-1", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "-1", + "k": 5, + "reduced_numerator_bits": { + "32": 64, + "64": 128 + } + }, + { + "coarse": "-1/2", + "constant_loss": 1, + "distinct_values": 512, + "fine": "-1", + "k": 5, + "reduced_numerator_bits": { + "32": 63, + "64": 127 + } + }, + { + "coarse": "-2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "-1", + "k": 5, + "reduced_numerator_bits": { + "32": 65, + "64": 129 + } + }, + { + "coarse": "1", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "-1", + "k": 5, + "reduced_numerator_bits": { + "32": 63, + "64": 127 + } + }, + { + "coarse": "1/2", + "constant_loss": 1, + "distinct_values": 512, + "fine": "-1", + "k": 5, + "reduced_numerator_bits": { + "32": 62, + "64": 126 + } + }, + { + "coarse": "-1", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "-1/2", + "k": 5, + "reduced_numerator_bits": { + "32": 65, + "64": 129 + } + }, + { + "coarse": "-1/2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "-1/2", + "k": 5, + "reduced_numerator_bits": { + "32": 64, + "64": 128 + } + }, + { + "coarse": "-1/4", + "constant_loss": 1, + "distinct_values": 512, + "fine": "-1/2", + "k": 5, + "reduced_numerator_bits": { + "32": 63, + "64": 127 + } + }, + { + "coarse": "-2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "-1/2", + "k": 5, + "reduced_numerator_bits": { + "32": 66, + "64": 130 + } + }, + { + "coarse": "-3/2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "-1/2", + "k": 5, + "reduced_numerator_bits": { + "32": 65, + "64": 129 + } + }, + { + "coarse": "1", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "-1/2", + "k": 5, + "reduced_numerator_bits": { + "32": 64, + "64": 128 + } + }, + { + "coarse": "1/2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "-1/2", + "k": 5, + "reduced_numerator_bits": { + "32": 63, + "64": 127 + } + }, + { + "coarse": "1/4", + "constant_loss": 1, + "distinct_values": 512, + "fine": "-1/2", + "k": 5, + "reduced_numerator_bits": { + "32": 62, + "64": 126 + } + }, + { + "coarse": "2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "-1/2", + "k": 5, + "reduced_numerator_bits": { + "32": 65, + "64": 129 + } + }, + { + "coarse": "-1", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "-1/4", + "k": 5, + "reduced_numerator_bits": { + "32": 66, + "64": 130 + } + }, + { + "coarse": "-1/2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "-1/4", + "k": 5, + "reduced_numerator_bits": { + "32": 65, + "64": 129 + } + }, + { + "coarse": "-1/4", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "-1/4", + "k": 5, + "reduced_numerator_bits": { + "32": 64, + "64": 128 + } + }, + { + "coarse": "1", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "-1/4", + "k": 5, + "reduced_numerator_bits": { + "32": 65, + "64": 129 + } + }, + { + "coarse": "1/2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "-1/4", + "k": 5, + "reduced_numerator_bits": { + "32": 64, + "64": 128 + } + }, + { + "coarse": "1/4", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "-1/4", + "k": 5, + "reduced_numerator_bits": { + "32": 63, + "64": 127 + } + }, + { + "coarse": "-1/2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "-1/8", + "k": 5, + "reduced_numerator_bits": { + "32": 66, + "64": 130 + } + }, + { + "coarse": "-1/4", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "-1/8", + "k": 5, + "reduced_numerator_bits": { + "32": 65, + "64": 129 + } + }, + { + "coarse": "1/2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "-1/8", + "k": 5, + "reduced_numerator_bits": { + "32": 65, + "64": 129 + } + }, + { + "coarse": "1/4", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "-1/8", + "k": 5, + "reduced_numerator_bits": { + "32": 64, + "64": 128 + } + }, + { + "coarse": "-1", + "constant_loss": 1, + "distinct_values": 512, + "fine": "-2", + "k": 5, + "reduced_numerator_bits": { + "32": 63, + "64": 127 + } + }, + { + "coarse": "-2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "-2", + "k": 5, + "reduced_numerator_bits": { + "32": 64, + "64": 128 + } + }, + { + "coarse": "1", + "constant_loss": 1, + "distinct_values": 512, + "fine": "-2", + "k": 5, + "reduced_numerator_bits": { + "32": 62, + "64": 126 + } + }, + { + "coarse": "-1/2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "-3/2", + "k": 5, + "reduced_numerator_bits": { + "32": 64, + "64": 128 + } + }, + { + "coarse": "-3/2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "-3/2", + "k": 5, + "reduced_numerator_bits": { + "32": 65, + "64": 129 + } + }, + { + "coarse": "-1/2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "-3/4", + "k": 5, + "reduced_numerator_bits": { + "32": 65, + "64": 129 + } + }, + { + "coarse": "1/2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "-3/4", + "k": 5, + "reduced_numerator_bits": { + "32": 64, + "64": 128 + } + }, + { + "coarse": "1/2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "-3/8", + "k": 5, + "reduced_numerator_bits": { + "32": 65, + "64": 129 + } + }, + { + "coarse": "-1", + "constant_loss": 2, + "distinct_values": 256, + "fine": "-4", + "k": 5, + "reduced_numerator_bits": { + "32": 62, + "64": 126 + } + }, + { + "coarse": "1", + "constant_loss": 2, + "distinct_values": 256, + "fine": "-4", + "k": 5, + "reduced_numerator_bits": { + "32": 61, + "64": 125 + } + }, + { + "coarse": "-1", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "1", + "k": 5, + "reduced_numerator_bits": { + "32": 63, + "64": 127 + } + }, + { + "coarse": "-1/2", + "constant_loss": 1, + "distinct_values": 512, + "fine": "1", + "k": 5, + "reduced_numerator_bits": { + "32": 62, + "64": 126 + } + }, + { + "coarse": "-2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "1", + "k": 5, + "reduced_numerator_bits": { + "32": 64, + "64": 128 + } + }, + { + "coarse": "-5/2", + "constant_loss": 1, + "distinct_values": 512, + "fine": "1", + "k": 5, + "reduced_numerator_bits": { + "32": 65, + "64": 129 + } + }, + { + "coarse": "1", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "1", + "k": 5, + "reduced_numerator_bits": { + "32": 64, + "64": 128 + } + }, + { + "coarse": "1/2", + "constant_loss": 1, + "distinct_values": 512, + "fine": "1", + "k": 5, + "reduced_numerator_bits": { + "32": 63, + "64": 127 + } + }, + { + "coarse": "2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "1", + "k": 5, + "reduced_numerator_bits": { + "32": 65, + "64": 129 + } + }, + { + "coarse": "3/2", + "constant_loss": 1, + "distinct_values": 512, + "fine": "1", + "k": 5, + "reduced_numerator_bits": { + "32": 64, + "64": 128 + } + }, + { + "coarse": "5/2", + "constant_loss": 1, + "distinct_values": 512, + "fine": "1", + "k": 5, + "reduced_numerator_bits": { + "32": 65, + "64": 129 + } + }, + { + "coarse": "7/2", + "constant_loss": 1, + "distinct_values": 512, + "fine": "1", + "k": 5, + "reduced_numerator_bits": { + "32": 65, + "64": 129 + } + }, + { + "coarse": "-1", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "1/2", + "k": 5, + "reduced_numerator_bits": { + "32": 64, + "64": 128 + } + }, + { + "coarse": "-1/2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "1/2", + "k": 5, + "reduced_numerator_bits": { + "32": 63, + "64": 127 + } + }, + { + "coarse": "-1/4", + "constant_loss": 1, + "distinct_values": 512, + "fine": "1/2", + "k": 5, + "reduced_numerator_bits": { + "32": 62, + "64": 126 + } + }, + { + "coarse": "-2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "1/2", + "k": 5, + "reduced_numerator_bits": { + "32": 65, + "64": 129 + } + }, + { + "coarse": "1", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "1/2", + "k": 5, + "reduced_numerator_bits": { + "32": 65, + "64": 129 + } + }, + { + "coarse": "1/2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "1/2", + "k": 5, + "reduced_numerator_bits": { + "32": 64, + "64": 128 + } + }, + { + "coarse": "1/4", + "constant_loss": 1, + "distinct_values": 512, + "fine": "1/2", + "k": 5, + "reduced_numerator_bits": { + "32": 63, + "64": 127 + } + }, + { + "coarse": "3/2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "1/2", + "k": 5, + "reduced_numerator_bits": { + "32": 65, + "64": 129 + } + }, + { + "coarse": "-1", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "1/4", + "k": 5, + "reduced_numerator_bits": { + "32": 65, + "64": 129 + } + }, + { + "coarse": "-1/2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "1/4", + "k": 5, + "reduced_numerator_bits": { + "32": 64, + "64": 128 + } + }, + { + "coarse": "-1/4", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "1/4", + "k": 5, + "reduced_numerator_bits": { + "32": 63, + "64": 127 + } + }, + { + "coarse": "-5/8", + "constant_loss": 1, + "distinct_values": 512, + "fine": "1/4", + "k": 5, + "reduced_numerator_bits": { + "32": 65, + "64": 129 + } + }, + { + "coarse": "1", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "1/4", + "k": 5, + "reduced_numerator_bits": { + "32": 66, + "64": 130 + } + }, + { + "coarse": "1/2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "1/4", + "k": 5, + "reduced_numerator_bits": { + "32": 65, + "64": 129 + } + }, + { + "coarse": "1/4", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "1/4", + "k": 5, + "reduced_numerator_bits": { + "32": 64, + "64": 128 + } + }, + { + "coarse": "3/8", + "constant_loss": 1, + "distinct_values": 512, + "fine": "1/4", + "k": 5, + "reduced_numerator_bits": { + "32": 64, + "64": 128 + } + }, + { + "coarse": "5/8", + "constant_loss": 1, + "distinct_values": 512, + "fine": "1/4", + "k": 5, + "reduced_numerator_bits": { + "32": 65, + "64": 129 + } + }, + { + "coarse": "-1/2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "1/8", + "k": 5, + "reduced_numerator_bits": { + "32": 65, + "64": 129 + } + }, + { + "coarse": "1/2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "1/8", + "k": 5, + "reduced_numerator_bits": { + "32": 66, + "64": 130 + } + }, + { + "coarse": "1/4", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "1/8", + "k": 5, + "reduced_numerator_bits": { + "32": 65, + "64": 129 + } + }, + { + "coarse": "-1", + "constant_loss": 1, + "distinct_values": 512, + "fine": "2", + "k": 5, + "reduced_numerator_bits": { + "32": 62, + "64": 126 + } + }, + { + "coarse": "-2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "2", + "k": 5, + "reduced_numerator_bits": { + "32": 63, + "64": 127 + } + }, + { + "coarse": "1", + "constant_loss": 1, + "distinct_values": 512, + "fine": "2", + "k": 5, + "reduced_numerator_bits": { + "32": 63, + "64": 127 + } + }, + { + "coarse": "-2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "3", + "k": 5, + "reduced_numerator_bits": { + "32": 64, + "64": 128 + } + }, + { + "coarse": "-1/2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "3/2", + "k": 5, + "reduced_numerator_bits": { + "32": 63, + "64": 127 + } + }, + { + "coarse": "1", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "3/2", + "k": 5, + "reduced_numerator_bits": { + "32": 65, + "64": 129 + } + }, + { + "coarse": "-1/2", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "3/4", + "k": 5, + "reduced_numerator_bits": { + "32": 64, + "64": 128 + } + }, + { + "coarse": "1", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "3/4", + "k": 5, + "reduced_numerator_bits": { + "32": 66, + "64": 130 + } + }, + { + "coarse": "-1/4", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "3/8", + "k": 5, + "reduced_numerator_bits": { + "32": 64, + "64": 128 + } + }, + { + "coarse": "1", + "constant_loss": 2, + "distinct_values": 256, + "fine": "4", + "k": 5, + "reduced_numerator_bits": { + "32": 62, + "64": 126 + } + }, + { + "coarse": "1", + "constant_loss": 0, + "distinct_values": 1024, + "fine": "5/4", + "k": 5, + "reduced_numerator_bits": { + "32": 66, + "64": 130 + } + } + ], + "frame_audit": { + "all_contacts_and_transports_checked": true, + "events": 42898, + "status": "PASS_INDEPENDENT_LOGICAL_ZERO_ADDRESS_AND_FRAMES", + "warp_matrices": 72 + }, + "negative_controls": [ + { + "name": "understated_valuation_loss", + "reason": "The declared two-band map is not injective", + "result": "REJECT" + }, + { + "name": "zero_band_coefficient", + "reason": "The valuation needs a nonzero number", + "result": "REJECT" + }, + { + "name": "removed_final_owned_clear", + "reason": "The owned center does not return to zero", + "result": "REJECT" + }, + { + "name": "integer_to_float_receipt", + "reason": "The retained exact receipt differs", + "result": "REJECT" + } + ], + "new_kappa": false, + "no_helper_controls": [ + { + "direction": "forward", + "wide_sites": 0 + }, + { + "direction": "backward", + "wide_sites": 0 + } + ], + "omitted": [ + "Adaptive-width sum bound", + "Joint symbolic-state lower bound", + "A limit with growing fiber/column multiplicity", + "Full physical Gaussian execution", + "Recursive child compatibility", + "Compiler and outer multiplication replay" + ], + "original_paid_sites": 6596, + "original_wide_profile": { + "1": 3163, + "2": 406, + "3": 742, + "4": 165, + "5": 40, + "8": 8 + }, + "policy": { + "baseline_width": "k+o(k)", + "limit": "k tends to infinity at fixed native rank and fixed fiber/column multiplicity", + "representation": "Literal exact per-register numerator; one shared exponent is allowed", + "site_width": "Uniform over all permitted inputs at each paid occurrence", + "width_tariff": "Linear in the leading width" + }, + "rank_masses": { + "baseline": 10654, + "charged": 13817, + "target": 10750 + }, + "restricted_independent_columns_per_call": 520, + "schema": "two-full-exact-width-gate/v1", + "source_payload_sha256": "cfcd36b40326d7a5815e1db5313444379b3fb756b27d5201c561574c085cc0dd", + "split_wide_profile_information_only": { + "1": 3328, + "2": 454, + "3": 963 + }, + "status": "PASS_TWO_FULL_EXACT_WIDTH_GATE", + "wide_sites": 4524, + "witness_payload_sha256": "a1247f0c63c5687c048d18210cc215a269d5b46fce6590baa03f2817329da838" +} diff --git a/research/two-full-exact-width-gate/SOURCES.json b/research/two-full-exact-width-gate/SOURCES.json new file mode 100644 index 0000000000..a09a4cd39c --- /dev/null +++ b/research/two-full-exact-width-gate/SOURCES.json @@ -0,0 +1,60 @@ +{ + "schema_version": 1, + "base_commit": "32890bc5de034ab8fc93ac88ead7279a6a416d04", + "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/kappa-round3-warp-20261022/ACTUAL-WORD.json.gz", + "usage": "input", + "git_blob": "46d929df83817b85a5387bcdb9745e0627d6366e", + "sha256": "7679daa4ec6a40f56fc7f0202379a6f454310e94945aba4f48beaaaafb838d05" + }, + { + "path": "research/two-full-border-paid-precision/independent-review/invariance/check_invariance.py", + "usage": "input", + "git_blob": "0c0206973d92113e117bab4370202b7113d47451", + "sha256": "7d134b9a2d16eae37654da5877353a70bb5a9bbde5bf368d8f6ceed0adef1433" + }, + { + "path": "research/kappa-round3-warp-20261022/PROOF.md", + "usage": "provenance", + "git_blob": "97f1d19ad423fe5540cc2986fb51af24a251d57c", + "sha256": "19178996b776a33f94c8df905b2ef07cc3069e4b6004180f8ec58e140f0c7f7c" + }, + { + "path": "research/two-full-border-paid-precision/paid-sensitivity/PROOF.md", + "usage": "provenance", + "git_blob": "f2260e452a301c86238ac88976fba16fae69456a", + "sha256": "8b47f2a6c6bd8e6ef035e0faeced6877037a6beac3b8cb535617988d0c3088b3" + }, + { + "path": "research/two-full-border-paid-precision/independent-review/invariance/REVIEW.md", + "usage": "provenance", + "git_blob": "5db51dcfa27f6b67ce246edfdfd42caac2d53395", + "sha256": "3bb8701b7b032c6350736ca418b0f22c69a9ea816ddeaa64d0d000199cbe008d" + }, + { + "path": "research/coherent-frame-additivity/PROOF.md", + "usage": "provenance", + "git_blob": "67dd02c9d31d77be390a9e3fdfc09c7dd8de56c2", + "sha256": "0f72ad943e6f1803d6cdc5749f6b6880463fc8dba8ce57e8de3c3550a8eaea79" + }, + { + "path": "research/two-full-fresh-d-coherent-pair/PROOF.md", + "usage": "provenance", + "git_blob": "d2325a97a7bc67428111b016b3c4f2adcca84f42", + "sha256": "300da0c914c097c4ea2e3a26d071221a5b25f652f1191ed25098ed189ae99f6e" + } + ] +} diff --git a/research/two-full-exact-width-gate/TASK.json b/research/two-full-exact-width-gate/TASK.json new file mode 100644 index 0000000000..3a8ac50c3a --- /dev/null +++ b/research/two-full-exact-width-gate/TASK.json @@ -0,0 +1,96 @@ +{ + "schema_version": 1, + "task_id": "joint-query-controller", + "priority_revision": 7, + "base_commit": "32890bc5de034ab8fc93ac88ead7279a6a416d04", + "original_card": { + "id": "joint-query-controller", + "question": "Can the installed QQ16 caller win a complete matched protocol bill, or can a changed demand eliminate actual paid work?", + "starting_points": [ + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "research/qq16-caller-install/README.md" + ], + "methods": [ + "Derive the matched whole-caller physical bill for installed and baseline protocols.", + "Change the actual demanded observations and prove a cheaper legal producer/consumer contract." + ], + "acceptance_gate": "Name the changed premise of the fixed F0/B1 observation obstruction. Show exactly which query is recovered, legal native reads and restoration, and a full favorable budget including cover maps, helpers and endpoints. Local inverse identities alone do not close the global controller. A scoped local result may be retained without a complete supplier. Expanding it into further construction rounds requires the family-level budget and obligation gate in research-family-status.md; an optimistic passing relaxation alone is not acceptance.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read #4166 COST.md and ADMISSION.json. An actual caller connection is now proposed. Its native-component profile loses; parent park/restore versus external-call costs remain unresolved. Retain the producer and recovery lineage rather than rebuild it.", + "scope": "Source-binding orientation only; no scientific replay, theorem acceptance or supplier admission. Budget any heavy replay separately." + }, + "first_experiment": "At the actual installed cut, compare matched complete parent park/restore and external input/return protocols at the same bank/packet geometry, including every later root call and service cost. Alternatively pin both bridge observations and derive a genuinely smaller source-compatible demand. Stop if the complete necessary inequality fails or an essential cost is unknown; no larger decoder scan from a local tape-action saving.", + "bottleneck_link": "The native local words exist; retained query information and its physical access are the missing link to a composed recursive interface.", + "allowed_variations": [ + "One paid query, one changed first pair, or one precisely specified affine helper state.", + "A counterexample or lower bound for that exact proposed repair.", + "One unresolved obligation of a newer local decoder, with exact source heads and a distinct claim/domain." + ], + "scope_change_triggers": [ + "Retaining the fixed first pair and ordinary schedule while allowing only homogeneous selected-only control, already excluded by the witness.", + "Treating cover-map counts as zero-cost physical address operations.", + "Recreating the pending complete local decoder or early-record/output-bank coalescing already under investigation without a distinct audit or changed premise.", + "Treating a completed-output defect inequality as a producer-interior, dirty-range or physical-cost certificate.", + "Recreating completed-output recovery or caller wiring already supplied by #4166 without new independent coverage.", + "Dropping retained later root calls or claiming native-profile dominance from the isolated publication saving." + ], + "overlap_terms": [ + "QQ16", + "joint-query", + "changing-chart controller", + "selected observation", + "1969", + "2540", + "early record", + "output-bank retention", + "complete native decoder", + "2965", + "producer defect", + "dirty-helper range", + "F17 consumer", + "4166", + "qq16-caller-install" + ], + "existing_checks": [ + { + "scope": "PR #4166: author-checked installed producer/service/return/bridge connection; native-component comparison loses.", + "evidence": "research/qq16-caller-install/README.md", + "remaining": "Complete matched physical protocol bill, or changed source-compatible demand/circuit; no affordable supplier yet.", + "status": "author-checked", + "source_commit": "0b082d22a0e9a442d264ab0633e35ef26c790630", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + } + ] + }, + "scope_status": "changed", + "actual_scope": "Prove the exact two-band numerator width gate for the retained two-FULL caller under uniform per-occurrence linear width charges, at fixed rank and fixed fiber/column multiplicity.", + "scope_change_reason": "The user assigned publication of a saved source-specific exact-execution result. This package does not pursue the historical QQ16 installation card or start another search.", + "bottleneck_link": "Exact arithmetic removes independent rounding faults, but a literal register still combines independently scaled input bands. The source census tests whether the declared k-bit budget pays for that exact value.", + "budget_minutes": 60, + "stop_rule": "Complete the uniform-site width theorem, exact source census, rejected controls and portable replay. Do not infer an adaptive-width or universal arithmetic lower bound.", + "outcome": "negative-result", + "evidence": "PROOF.md, WITNESSES.json.gz, RESULT.json, and the registered source-bound checks.", + "author": "Ali Romman, with substantial OpenAI Codex assistance", + "ai_assistance": "Substantial OpenAI Codex assistance in the original census, proof, code and writing. Parallel agent review is part of the author process; no independent human or proof-kernel review is claimed.", + "open_questions": [ + { + "question": "Can a changed exact representation or adaptive policy close one actual paid caller at a favorable complete bill?", + "why_it_matters": "The present rejection applies only to literal exact numerators and uniform site widths.", + "first_step": "Choose one marked source cut and specify its two-band representation, Gaussian action, input access, return and complete width cost.", + "blocked_by": "No such complete alternate caller or adaptive sum bound is supplied." + }, + { + "question": "Can recursively substituted approximate children preserve the exact frame and fresh-D identities at this caller?", + "why_it_matters": "One ideal exact execution does not prove the recursive compatibility needed by the border.", + "first_step": "State one concrete child contract and check the actual common-frame scalar and free-warp relations.", + "blocked_by": "The package uses inherited ideal operator semantics and performs no recursive physical replay." + } + ] +} diff --git a/research/two-full-exact-width-gate/VERIFY.json b/research/two-full-exact-width-gate/VERIFY.json new file mode 100644 index 0000000000..16e876aa8c --- /dev/null +++ b/research/two-full-exact-width-gate/VERIFY.json @@ -0,0 +1,30 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/kappa-round3-warp-20261022/ACTUAL-WORD.json.gz", + "research/two-full-border-paid-precision/independent-review/invariance/check_invariance.py" + ], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 180, + "checks": "Retained moving-frame audit; exact 4524-cut census; 75 coefficient pairs; six direct cut checks; four internal rejection controls; full declared target and uniform width bill." + }, + { + "argv": [ + "{python}", + "-B", + "{package}/test_mutations.py" + ], + "timeout_seconds": 300, + "checks": "Changed source bytes and witness coefficients are rejected in isolated normal and optimized processes." + } + ] +} diff --git a/research/two-full-exact-width-gate/WITNESSES.json.gz b/research/two-full-exact-width-gate/WITNESSES.json.gz new file mode 100644 index 0000000000..f8e0a762bd Binary files /dev/null and b/research/two-full-exact-width-gate/WITNESSES.json.gz differ diff --git a/research/two-full-exact-width-gate/test_mutations.py b/research/two-full-exact-width-gate/test_mutations.py new file mode 100644 index 0000000000..b75c96099b --- /dev/null +++ b/research/two-full-exact-width-gate/test_mutations.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python3 +"""Reject changed source and witness bytes in isolated exact replays.""" +import gzip +import json +import os +from pathlib import Path +import shutil +import subprocess +import sys +import tempfile + +PACKAGE = Path(__file__).resolve().parent +ROOT = PACKAGE.parents[1] + + +def need(condition, message): + if not condition: + raise ValueError(message) + + +def main(): + inputs = json.loads((PACKAGE / 'VERIFY.json').read_text())['inputs'] + checks = [] + with tempfile.TemporaryDirectory(prefix='two-band-width-mutations-') as temp: + root = Path(temp) + package = root / 'research' / PACKAGE.name + shutil.copytree(PACKAGE, package, copy_function=shutil.copyfile, + ignore=shutil.ignore_patterns('__pycache__')) + for name in inputs: + target = root / name + target.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(ROOT / name, target) + source = root / inputs[0] + certificate = package / 'WITNESSES.json.gz' + original_source, original_certificate = source.read_bytes(), certificate.read_bytes() + witness = json.loads(gzip.decompress(original_certificate)) + witness['calls'][0]['sites'][0]['helper_coefficient'] = '2' + changed_certificate = gzip.compress(json.dumps(witness).encode(), mtime=0) + mutations = [ + ('source_bytes', source, original_source[:-1] + bytes([original_source[-1] ^ 1]), + 'A pinned live source changed'), + ('witness_coefficient', certificate, changed_certificate, + 'The retained exact receipt differs'), + ] + env = os.environ.copy() + env.pop('PYTHONOPTIMIZE', None) + for name, target, changed, message in mutations: + for optimized in (False, True): + source.write_bytes(original_source) + certificate.write_bytes(original_certificate) + target.write_bytes(changed) + command = [sys.executable, '-I', '-B'] + if optimized: + command.append('-O') + command.append(str(package / 'verify.py')) + result = subprocess.run(command, cwd=root, env=env, capture_output=True, + text=True, timeout=120) + need(result.returncode != 0 and message in result.stderr, + 'A changed scientific input was not rejected: ' + name) + checks.append({'mutation': name, 'optimized': optimized, 'result': 'REJECT'}) + need(len(checks) == 4, 'The mutation coverage differs') + print('PASS_TWO_FULL_WIDTH_MUTATIONS checks=4 normal_and_optimized=true') + + +if __name__ == '__main__': + main() diff --git a/research/two-full-exact-width-gate/verify.py b/research/two-full-exact-width-gate/verify.py new file mode 100644 index 0000000000..8aad7e4c4a --- /dev/null +++ b/research/two-full-exact-width-gate/verify.py @@ -0,0 +1,305 @@ +#!/usr/bin/env python3 +"""Check the exact two-band census and its uniform width-policy consequence.""" +import argparse +from collections import Counter +from copy import deepcopy +from fractions import Fraction as F +import gzip +from hashlib import sha256 +import importlib.util +import json +from pathlib import Path + +PACKAGE = Path(__file__).resolve().parent +ROOT = PACKAGE.parents[1] +SOURCE_PATH = 'research/kappa-round3-warp-20261022/ACTUAL-WORD.json.gz' +FRAME_CHECK_PATH = 'research/two-full-border-paid-precision/independent-review/invariance/check_invariance.py' +PAYLOAD_SHA = 'cfcd36b40326d7a5815e1db5313444379b3fb756b27d5201c561574c085cc0dd' +PROFILE = {1: 2201, 2: 412, 3: 510, 4: 127, 5: 40, 8: 8} +SPLIT = {1: (1,), 2: (2,), 3: (3,), 4: (3, 1), 5: (3, 2), 8: (3, 3, 2)} + + +def need(condition, message): + if not condition: + raise ValueError(message) + + +def canonical(value): + # Convert histogram keys to JSON strings before their canonical sort. + normalized = json.loads(json.dumps(value)) + return json.dumps(normalized, sort_keys=True, separators=(',', ':')).encode() + + +def load_source(): + sources = json.loads((PACKAGE / 'SOURCES.json').read_text()) + pins = {row['path']: row for row in sources['files'] if row['usage'] == 'input'} + for name in (SOURCE_PATH, FRAME_CHECK_PATH): + need(sha256((ROOT / name).read_bytes()).hexdigest() == pins[name]['sha256'], + 'A pinned live source changed: ' + name) + spec = importlib.util.spec_from_file_location('retained_frame_audit', ROOT / FRAME_CHECK_PATH) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + frame_result = module.run(ROOT / SOURCE_PATH) + raw = gzip.decompress((ROOT / SOURCE_PATH).read_bytes()) + need(sha256(raw).hexdigest() == PAYLOAD_SHA, 'The native payload changed') + return json.loads(raw), frame_result + + +def owner(ref): + need(ref[0] in ('L', 'C'), 'Unknown source owner') + if ref[0] == 'L': + need(type(ref[1]) is int and 0 <= ref[1] < 632, 'Invalid persistent owner') + return ref[1] + need(ref[1] == 0, 'Only the retained center C0 is present') + return 632 + + +def valuation(value): + value = F(value) + need(value != 0, 'The valuation needs a nonzero number') + a, b = abs(value.numerator), value.denominator + return (a & -a).bit_length() - (b & -b).bit_length() + + +def loss(fine, coarse): + return max(0, valuation(fine) - valuation(coarse)) + + +def execute(program, direction, include_helpers=True): + rows = [{} for _ in range(633)] + for i in range(112): + rows[i] = {i: F(1)} + if direction == 'backward': + rows[112 + i] = {i: F(1)} + if include_helpers: + for i in range(224, 632): + rows[i] = {i: F(1)} + profile, wide, split = Counter(), Counter(), Counter() + sites = [] + for index, event in enumerate(program): + if event[0] in ('climb', 'center'): + r = event[2] if event[0] == 'climb' else 632 + rank = event[-1] + need(type(rank) is int and rank in SPLIT, 'Invalid paid rank') + profile[rank] += 1 + high = sorted((i, x) for i, x in rows[r].items() if i < 112) + low = sorted((i, x) for i, x in rows[r].items() if i >= 224) + if high and low: + main, coarse = high[0] + helper, fine = low[0] + wide[rank] += 1 + split.update(SPLIT[rank]) + sites.append({'event': index, 'source_event': event, 'owner': r, + 'rank': rank, 'main_input': main, + 'main_coefficient': str(coarse), 'helper_input': helper, + 'helper_coefficient': str(fine), + 'entropy_constant_loss': loss(fine, coarse)}) + if event[0] != 'scalar': + need(event[0] in ('climb', 'center', 'warp', 'phase', 'adapter'), + 'An unhandled source event is present') + continue + gate = event[1] + r = owner(gate[1]) + if gate[0] == 'clear': + rows[r] = {} + elif gate[0] == 'copy': + rows[r] = dict(rows[owner(gate[2])]) + elif gate[0] == 'scale': + rows[r] = {i: x * F(gate[2], gate[3]) for i, x in rows[r].items()} + elif gate[0] == 'add': + s = owner(gate[2]) + need(s != r, 'A scalar ADD has the same source and target') + for i, x in rows[s].items(): + value = rows[r].get(i, F()) + x * F(gate[3], gate[4]) + if value: + rows[r][i] = value + else: + rows[r].pop(i, None) + else: + raise ValueError('Unknown scalar operation') + need(dict(profile) == PROFILE, 'The complete source profile differs') + for i in range(112): + need(rows[i] == ({i: F(1)} if direction == 'forward' else {}), + 'The restricted main X endpoint differs') + need(rows[112 + i] == {i: F(1)}, 'The restricted main Y endpoint differs') + for i in range(224, 632): + need(rows[i] == ({i: F(1)} if include_helpers else {}), + 'An independent helper return differs') + need(not rows[632], 'The owned center does not return to zero') + return {'direction': direction, 'paid_sites': sum(profile.values()), + 'wide_profile': dict(sorted(wide.items())), + 'wide_split_profile': dict(sorted(split.items())), 'sites': sites} + + +def direct_cut(program, site, direction, a, b, k): + values = [F() for _ in range(633)] + main, helper = site['main_input'], site['helper_input'] + values[main] = F(b) + if direction == 'backward': + values[112 + main] = F(b) + values[helper] = F(a, 1 << k) + for index, event in enumerate(program): + if index == site['event']: + return values[event[2] if event[0] == 'climb' else 632] + if event[0] != 'scalar': + continue + gate = event[1] + r = owner(gate[1]) + if gate[0] == 'clear': + values[r] = F() + elif gate[0] == 'copy': + values[r] = values[owner(gate[2])] + elif gate[0] == 'scale': + values[r] *= F(gate[2], gate[3]) + else: + need(gate[0] == 'add', 'Unknown direct scalar operation') + values[r] += values[owner(gate[2])] * F(gate[3], gate[4]) + raise ValueError('The requested paid cut is absent') + + +def finite_injectivity(fine, coarse, k, constant): + need(k > constant >= 0, 'Invalid finite band sizes') + low_count = 1 << (k - constant) + values = {fine * F(a, 1 << k) + coarse * b + for a in range(low_count) for b in range(1 << k)} + need(len(values) == low_count * (1 << k), 'The declared two-band map is not injective') + return len(values) + + +def rejected(name, operation): + try: + operation() + except ValueError as error: + return {'name': name, 'result': 'REJECT', 'reason': str(error)} + raise ValueError('A negative control passed: ' + name) + + +def same_receipt(actual, retained): + need(canonical(actual) == canonical(retained), 'The retained exact receipt differs') + + +def run(): + word, frames = load_source() + calls, direct_checks = [], [] + no_helpers = [] + for direction in ('forward', 'backward'): + program = word['programs'][direction] + call = execute(program, direction) + empty = execute(program, direction, include_helpers=False) + need(not empty['sites'], 'A two-band witness survived removal of all helper inputs') + no_helpers.append({'direction': direction, 'wide_sites': 0}) + for site in [call['sites'][0], call['sites'][len(call['sites']) // 2], call['sites'][-1]]: + fine, coarse = F(site['helper_coefficient']), F(site['main_coefficient']) + k = 5 + for a, b in ((0, 1), (1, 0), (3, 5), (7, 31)): + need(direct_cut(program, site, direction, a, b, k) + == fine * F(a, 1 << k) + coarse * b, + 'The separate scalar cut evaluation differs') + direct_checks.append({'direction': direction, 'event': site['event'], 'samples': 4}) + calls.append(call) + pairs = sorted({(s['helper_coefficient'], s['main_coefficient']) for c in calls for s in c['sites']}) + finite = [] + for fine_text, coarse_text in pairs: + fine, coarse = F(fine_text), F(coarse_text) + c = loss(fine, coarse) + need(all(x.denominator & (x.denominator - 1) == 0 for x in (fine, coarse)), + 'A band coefficient is not dyadic') + numerator_bits = {} + for k in (32, 64): + a, b = valuation(fine), valuation(coarse) + u, v = fine / (F(2) ** a), coarse / (F(2) ** b) + shift = 2 * k - 1 + b - a + need(u.denominator == v.denominator == 1 and shift >= 1 and k > a, + 'The canonical numerator fixture is outside its stated range') + value = fine / (1 << k) + coarse * (1 << (k - 1)) + numerator = int(u) + int(v) * (1 << shift) + need(value.numerator == numerator and numerator & 1, + 'The exact reduced numerator identity differs') + numerator_bits[str(k)] = abs(numerator).bit_length() + finite.append({'fine': fine_text, 'coarse': coarse_text, 'constant_loss': c, + 'k': 5, 'distinct_values': finite_injectivity(fine, coarse, 5, c), + 'reduced_numerator_bits': numerator_bits}) + original, split, baseline, targets = Counter(), Counter(), Counter(), Counter() + for call in calls: + original.update(call['wide_profile']) + split.update(call['wide_split_profile']) + for rank, count in PROFILE.items(): + for child in SPLIT[rank]: + baseline[child] += 2 * count + c = word['canonical'] + for i in range(224, 632): + rank = len(c['frames'][c['final'][i]]) - len(c['frames'][c['start'][i]]) + targets[rank] += 2 + targets[17] += 224 + need(dict(baseline) == {1: 4656, 2: 920, 3: 1386}, 'The baseline split invoice differs') + need(dict(targets) == {4: 56, 7: 14, 8: 94, 9: 652, 17: 224}, 'The complete target invoice differs') + need(dict(original) == {1: 3163, 2: 406, 3: 742, 4: 165, 5: 40, 8: 8}, 'The wide-cut census differs') + charged = baseline.copy() + charged[1] += original[1] + mass = lambda profile: sum(r * n for r, n in profile.items()) + need(mass(targets) == 10750 and mass(baseline) == 10654 and mass(charged) == 13817, + 'The rank masses differ') + need(max(charged) == 3 and min(targets) == 4, 'The rank-separation proof does not apply') + need(mass(targets) < mass(charged), 'The uniform linear-width tariff is not rejected') + damaged = deepcopy(word['programs']['forward']) + last_clear = max(i for i, e in enumerate(damaged) if e[0] == 'scalar' and e[1][0] == 'clear') + damaged.pop(last_clear) + controls = [ + rejected('understated_valuation_loss', lambda: finite_injectivity(F(4), F(1), 5, 0)), + rejected('zero_band_coefficient', lambda: loss(F(0), F(1))), + rejected('removed_final_owned_clear', lambda: execute(damaged, 'forward')), + rejected('integer_to_float_receipt', lambda: same_receipt({'wide_H1': 3163}, {'wide_H1': 3163.0})), + ] + witnesses = {'schema': 'two-full-exact-width-witnesses/v1', 'calls': calls} + result = { + 'schema': 'two-full-exact-width-gate/v1', + 'status': 'PASS_TWO_FULL_EXACT_WIDTH_GATE', 'new_kappa': False, + 'source_payload_sha256': PAYLOAD_SHA, + 'witness_payload_sha256': sha256(canonical(witnesses)).hexdigest(), + 'frame_audit': {'status': frames['status'], 'events': sum(x['events'] for x in frames['orientations'].values()), + 'warp_matrices': len(frames['warp_checks']), + 'all_contacts_and_transports_checked': True}, + 'restricted_independent_columns_per_call': 520, + 'original_paid_sites': 6596, 'wide_sites': sum(original.values()), + 'original_wide_profile': dict(sorted(original.items())), + 'split_wide_profile_information_only': dict(sorted(split.items())), + 'entropy_constant_max': max(x['constant_loss'] for x in finite), + 'complete_targets': dict(sorted(targets.items())), + 'baseline_paid': dict(sorted(baseline.items())), 'charged_paid': dict(sorted(charged.items())), + 'rank_masses': {'target': mass(targets), 'baseline': mass(baseline), 'charged': mass(charged)}, + 'all_power_moments_ratio_upper': str(F(mass(targets), mass(charged))), + 'policy': {'site_width': 'Uniform over all permitted inputs at each paid occurrence', + 'representation': 'Literal exact per-register numerator; one shared exponent is allowed', + 'baseline_width': 'k+o(k)', 'width_tariff': 'Linear in the leading width', + 'limit': 'k tends to infinity at fixed native rank and fixed fiber/column multiplicity'}, + 'finite_injectivity': finite, 'direct_cut_checks': direct_checks, + 'no_helper_controls': no_helpers, 'negative_controls': controls, + 'omitted': ['Adaptive-width sum bound', 'Joint symbolic-state lower bound', + 'A limit with growing fiber/column multiplicity', + 'Full physical Gaussian execution', 'Recursive child compatibility', + 'Compiler and outer multiplication replay'], + } + return witnesses, result + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--write', action='store_true', help='Write the rebuilt package certificate and receipt') + parser.add_argument('--output', type=Path, help='Write the checked exact receipt to this path') + args = parser.parse_args() + witnesses, result = run() + certificate = PACKAGE / 'WITNESSES.json.gz' + receipt = PACKAGE / 'RESULT.json' + if args.write: + certificate.write_bytes(gzip.compress(canonical(witnesses), mtime=0)) + receipt.write_text(json.dumps(result, indent=2, sort_keys=True) + '\n') + else: + same_receipt(witnesses, json.loads(gzip.decompress(certificate.read_bytes()))) + same_receipt(result, json.loads(receipt.read_text())) + if args.output: + args.output.write_text(json.dumps(result, indent=2, sort_keys=True) + '\n') + print('PASS_TWO_FULL_EXACT_WIDTH_GATE wide_sites=4524 extra_H1=3163 ratio_upper=10750/13817 new_kappa=false') + + +if __name__ == '__main__': + main()