diff --git a/research/p104-rung-carrier-break-even/README.md b/research/p104-rung-carrier-break-even/README.md new file mode 100644 index 0000000000..ef56f28516 --- /dev/null +++ b/research/p104-rung-carrier-break-even/README.md @@ -0,0 +1,85 @@ +# Break-even price of a carrier for a third frame-593 rung removal + +**Scoped negative result in the raw-moment relaxation; no new κ.** + +DreamingOfClouds's open [PR #6030](https://github.com/CrocSwap/integer-mult-bounds/pull/6030) +removes helper 470's frame-593 rung, the twin of #5907's helper-468 removal, and +notes that removing helper 469's or 471's rung is exclusive with both "unless a +new carrier of that content is added". This package prices that escape route. + +Grant a third removal for free, with exactly #6030's per-LOCAL profile delta +again (paid ranks 1 −2, 2 +1, 3 −2, 4 +1, 6 +1, 7 −1, 8 +1; credited helper ranks +1 −1, 2 +1, 3 −1, 6 +1, 7 −1, 8 +1, each times the 18 LOCAL invocations). Then: + +- With a free carrier, the raw crossing would rise from + (.00312581155791, .00312581155792) to (.00312633419236, .00312633419237), + a gain of at least 5.2263e-7. +- **One added paid call of any rank 1..145, anywhere in the complete invoice, + defeats it.** For each of those 145 ranks the edited profile's crossing is + certified below #6030's lower endpoint. One added rank-1 call alone moves + #6030's crossing to (.00312167101310, .00312167101311). That loss is at least + 7.92 times the free repeat's gain. +- A carrier inside the local word is paid once per LOCAL. One added paid call + per LOCAL, of any rank 1..145, also defeats the repeat. One rank-1 call per + LOCAL moves #6030's crossing to (.00305129298944, .00305129298945). + +So a carrier is useful only if its paid cost is zero, or if it also earns +productive target credit or enables further savings worth more than one paid call. +A twin-sized rung removal cannot fund a single extra paid Gaussian call. + +## Claim type and scope + +This is a **finite certificate** about hypothetical profile edits in the raw +moment model `Σ_r T_r r^(1-k) − Σ_r P_r r^(1-k)` that #5827/#5907/#6030 bisect. It +is not a word, not a construction, and not a complete multiplication theorem. +The free third removal is a hypothesis: no rung removal for helpers 469 or 471 +is constructed, and its true delta may differ. The tail ratios, compiler and outer +checks that a complete bill also needs are not evaluated. They only add +conditions, so they cannot rescue an edit that already fails the raw crossing. +The analysis does not cover a carrier that also adds productive targets. + +The profile is copied as a literal from #6030's `RESULT.json` at head +`772dd10a5859a1d15f4851feb371519789213ad8` +(`research/p104-helper470-twin-rung-removal/RESULT.json`, SHA256 +`84fcbe2a0b64307b5703c363408042bdd91555b0419509aa50daa43b3b1924ad`), whose +`complete_cost.targets` and `complete_cost.paid` it reproduces. That PR head is +not on main, so it cannot be a Git pin here. As positive controls, the +verifier reproduces #6030's published crossing enclosure and, after removing +the stated delta once, #5907's enclosure (.00312528909884, .00312528909885). It +also checks the published counts: 13,444 targets, 66,834 paid calls, rank surplus 760. +These are consistency checks of this package's pricing, not a review of either PR. + +Signs are certified with Python's correctly rounded `Decimal` `ln`/`exp` at 60 +digits and an explicit relative error allowance of 10^-50 per moment. Every +checked sign must clear that allowance. Three damaged profiles must be rejected. + +## Reproduce + +From the repository root, with CPython 3.12 and the standard library: + +```sh +python3.12 -B research/p104-rung-carrier-break-even/verify.py +python3.12 -B scripts/research_package.py --package research/p104-rung-carrier-break-even +``` + +Expected last line: `PASS_P104_RUNG_CARRIER_BREAK_EVEN`. It runs in about one +second. `--write` regenerates `RESULT.json`. + +## Open next questions + +- Can a carrier for the content of sources 703/704 be a productive helper itself, + so its target credit offsets its paid call? This matters because that is the + only escape this package leaves. First step: name the helper rank and the + frame at which helper 469 or 471 would read it. Then price target plus + paid deltas with this verifier's `edit`/`crossing` before building a word. +- Is there an existing paid call in #6030's word whose content could carry 703 + or 704 to frame 593 without adding a call? This would be a zero-cost carrier. + First step: list the helpers live at frame 593 that read 703 or 704. Blocker: + this package does not parse the word. + +## Credit + +Produced by Nick Petalas. The rung removals and the profile are by +DreamingOfClouds (#6030, #5907). They edit Ali Romman's #5827 word and its lineage +back to #5565, whose credit is retained in those packages. The raw moment +crossing follows the pricing of that line. Apache-2.0. diff --git a/research/p104-rung-carrier-break-even/RESULT.json b/research/p104-rung-carrier-break-even/RESULT.json new file mode 100644 index 0000000000..0b34f4ad89 --- /dev/null +++ b/research/p104-rung-carrier-break-even/RESULT.json @@ -0,0 +1,36 @@ +{ + "claim": "Raw-moment relaxation only; hypothetical edits of the PR #6030 published profile.", + "controls": { + "pr5907_crossing": [ + "0.00312528909884", + "0.00312528909885" + ], + "pr6030_crossing": [ + "0.00312581155791", + "0.00312581155792" + ] + }, + "free_twin_repeat_crossing": [ + "0.00312633419236", + "0.00312633419237" + ], + "free_twin_repeat_gain_lower": "5.2263444E-7", + "one_extra_rank1_call_crossing": [ + "0.00312167101310", + "0.00312167101311" + ], + "one_extra_rank1_call_loss_over_twin_gain_lower": "7.92", + "one_extra_rank1_call_per_local_crossing": [ + "0.00305129298944", + "0.00305129298945" + ], + "ranks_checked_for_added_call": [ + 1, + 145 + ], + "rejected_controls": [ + "paid_count", + "target_rank_moved", + "paid_rank_swapped" + ] +} diff --git a/research/p104-rung-carrier-break-even/SOURCES.json b/research/p104-rung-carrier-break-even/SOURCES.json new file mode 100644 index 0000000000..d596e2e530 --- /dev/null +++ b/research/p104-rung-carrier-break-even/SOURCES.json @@ -0,0 +1,18 @@ +{ + "schema_version": 1, + "base_commit": "19fdb086ea96af9a9f87936a2b888e10af4ed810", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "581f8d87008354eb5b869f7ed9de1317ad837ce8", + "sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81" + } + ] +} diff --git a/research/p104-rung-carrier-break-even/TASK.json b/research/p104-rung-carrier-break-even/TASK.json new file mode 100644 index 0000000000..375c177ad2 --- /dev/null +++ b/research/p104-rung-carrier-break-even/TASK.json @@ -0,0 +1,123 @@ +{ + "schema_version": 1, + "task_id": "p104-side-correction", + "priority_revision": 8, + "base_commit": "19fdb086ea96af9a9f87936a2b888e10af4ed810", + "original_card": { + "id": "p104-side-correction", + "question": "Can joint helper bases and a legal causal split improve the complete P104 productive/paid invoice?", + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "research/p104-helper-subspace-splits/README.md", + "research/dyadic-helper-channel-capacity/README.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "acceptance_gate": "An exact arbitrary-input identity, source/target frame availability and restoration at the chosen cut, plus the complete channel+correction+idle/hosting bill or an explicit favorable bound. The native channel alone is not a supplier. A scoped local result may be retained without a complete supplier. Expanding it into further construction rounds requires the family-level budget and obligation gate in research-family-status.md; an optimistic passing relaxation alone is not acceptance.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "Start with the selected #5599 emitted word and review pending #5718 distinct input/output bases plus #5717/#5719 coverage before claiming work. Pick one uncovered source word, helper group and cut region. Prove the arbitrary-input relation and legal entry/exit corrections, then compare full target and paid profiles. Reject if completion, owned lifetimes or consumer costs repay the gain. A static pairing rank alone is not a physical split.", + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "overlap_terms": [ + "P104", + "helper basis", + "helper split", + "5718", + "dyadic capacity" + ], + "existing_checks": [ + { + "scope": "PR #4133: literal-slot defect", + "evidence": "research/p104-literal-slot-defect/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "88666f1dee93fbd85b31fd5d6f91a219e111b5f4", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4136: uniform commutation gap", + "evidence": "research/p104-uniform-commutation-gap/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "281ce601a8be9db470de630759179c23e1dfaa88", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4140: uniform encoding gap", + "evidence": "research/p104-uniform-encoding-gap/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "de25c6525aa866962309df5d107b32d55e6e5628", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4153: source-chart shortcut exhausts its optimistic allowance", + "evidence": "research/p104-source-chart-shortcut/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "9123241fea53df77e51ffe30d9aca1625d4bf3a8", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4154: fiber-tag seam mismatch", + "evidence": "research/p104-fiber-tag-seam/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "4ffcdaee5d6255a9cea1fe53a5424435068089d0", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + }, + "scope_status": "changed", + "actual_scope": "Break-even paid cost of a new carrier that would let a third frame-593 rung removal (helper 469 or 471) repeat PR #6030's per-LOCAL profile delta, in the raw moment relaxation of PR #6030's published complete profile.", + "scope_change_reason": "PR #6030 leaves the carrier route open; pricing it before anyone builds a carrier word tells the next contributor which carriers can pay.", + "bottleneck_link": "Complex P104 supplier binds the selected κ; rung removals are the current hill-climbing route on that supplier, and this prices their only noted continuation.", + "budget_minutes": 60, + "stop_rule": "Stop after certifying the free-repeat gain and the cost of one added paid call at every rank 1..145; do not construct a word.", + "outcome": "negative-result", + "evidence": "verify.py certifies all signs with correctly rounded Decimal arithmetic and an explicit error allowance; RESULT.json is regenerated by verify.py --write and compared on every run.", + "author": "Nick Petalas", + "ai_assistance": "Independent human and formal proof-kernel review are unclaimed.", + "open_questions": [ + { + "question": "Can a carrier for sources 703/704 itself earn productive target credit that offsets its paid call?", + "why_it_matters": "It is the only escape this raw-crossing certificate leaves for a third rung removal.", + "first_step": "Name the carrier helper rank and frame, then price target and paid deltas with this verifier before building a word.", + "blocked_by": "No candidate carrier word exists." + }, + { + "question": "Does an existing paid call in the #6030 word already carry 703 or 704 content near frame 593?", + "why_it_matters": "A zero-cost carrier would make the third removal additive.", + "first_step": "List helpers live at frame 593 that read 703 or 704.", + "blocked_by": "This package does not parse the word." + } + ] +} diff --git a/research/p104-rung-carrier-break-even/VERIFY.json b/research/p104-rung-carrier-break-even/VERIFY.json new file mode 100644 index 0000000000..52eb030464 --- /dev/null +++ b/research/p104-rung-carrier-break-even/VERIFY.json @@ -0,0 +1,18 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Positive controls reproduce the #6030 and #5907 crossings; certified free-repeat gain; one added paid call of every rank 1..145, in total or per LOCAL, defeats it; RESULT.json equality; three damaged profiles rejected." + } + ] +} diff --git a/research/p104-rung-carrier-break-even/verify.py b/research/p104-rung-carrier-break-even/verify.py new file mode 100644 index 0000000000..fadb3329f4 --- /dev/null +++ b/research/p104-rung-carrier-break-even/verify.py @@ -0,0 +1,159 @@ +"""Break-even price of a carrier for a third frame-593 rung removal. + +Prices hypothetical edits of the complete target/paid profile published by +DreamingOfClouds's PR #6030 with the raw moment crossing used by that line: +the root of sum_r T_r r^(1-k) - sum_r P_r r^(1-k). Every sign is certified +with correctly rounded decimal ln/exp and an explicit error allowance. +Standard library only. Nick Petalas. Apache-2.0. +""" +import json +import sys +from decimal import Decimal as D, localcontext +from pathlib import Path + +HERE = Path(__file__).resolve().parent +PREC = 60 +# Relative error allowance per moment: ln, one product and exp are each +# correctly rounded at PREC digits, and |t ln r| < 6, so every term has +# relative error below 10^(8-PREC); summing nonnegative terms keeps that bound. +REL = D(10) ** (10 - PREC) + +# Complete profile of PR #6030, head 772dd10a5859a1d15f4851feb371519789213ad8, +# research/p104-helper470-twin-rung-removal/RESULT.json, complete_cost. +T6030 = {1: 252, 2: 144, 3: 72, 4: 1926, 5: 252, 6: 36, 7: 162, 8: 342, 9: 6930, + 17: 416, 25: 416, 33: 416, 41: 416, 49: 416, 57: 416, 65: 416, 73: 208, + 145: 208} +P6030 = {1: 41502, 2: 8226, 3: 8928, 4: 1800, 5: 2934, 6: 198, 7: 108, 8: 18, + 16: 416, 24: 416, 32: 416, 40: 416, 48: 416, 56: 416, 64: 416, 72: 208} +LOCALS = 18 +# PR #6030's stated per-LOCAL deltas against #5907 (paid profile, credited helpers). +DP = {1: -2, 2: 1, 3: -2, 4: 1, 6: 1, 7: -1, 8: 1} +DT = {1: -1, 2: 1, 3: -1, 6: 1, 7: -1, 8: 1} +# Published raw crossing enclosures used as positive controls. +C6030 = (D('0.00312581155791'), D('0.00312581155792')) +C5907 = (D('0.00312528909884'), D('0.00312528909885')) + + +def need(ok, label): + if not ok: + raise SystemExit(f'FAIL: {label}') + + +def edit(prof, delta, times): + out = dict(prof) + for r, c in delta.items(): + out[r] = out.get(r, 0) + times * c + need(out[r] >= 0, f'nonnegative count at rank {r}') + return {r: n for r, n in out.items() if n} + + +def moment(prof, t): + with localcontext() as ctx: + ctx.prec = PREC + return sum((n * (t * D(r).ln()).exp() for r, n in prof.items()), D(0)) + + +def sign(T, P, k): + """Certified sign of sum T r^(1-k) - sum P r^(1-k) at a decimal k.""" + with localcontext() as ctx: + ctx.prec = PREC + t = 1 - k + a, b = moment(T, t), moment(P, t) + gap, slack = a - b, REL * (a + b) + need(abs(gap) > slack, f'sign resolved at k={k}') + return 1 if gap > 0 else -1 + + +def crossing(T, P, digits=14): + """Certified enclosure (lo, lo+10^-digits) of the unique raw crossing in (0, 1/20).""" + step = D(10) ** -digits + lo, hi = 0, 5 * 10 ** (digits - 2) + need(sign(T, P, D(0)) > 0 and sign(T, P, hi * step) < 0, 'crossing bracketed') + while hi - lo > 1: + m = (lo + hi) // 2 + if sign(T, P, m * step) > 0: + lo = m + else: + hi = m + return lo * step, hi * step + + +def below(T, P, k): + """True when the crossing of (T, P) is certified to lie below k.""" + return sign(T, P, k) < 0 + + +def run(mutate=None): + T, P = dict(T6030), dict(P6030) + if mutate: + mutate(T, P) + need(sum(T.values()) == 13444 and sum(P.values()) == 66834, 'published field and call counts') + need(sum(r * n for r, n in T.items()) - sum(r * n for r, n in P.items()) == 760, + 'published rank surplus') + need(sum(DP.values()) == -1 and sum(DT.values()) == 0, 'stated per-LOCAL deltas') + need(not below(T, P, C6030[0]) and below(T, P, C6030[1]), 'reproduces #6030 crossing') + prev = (edit(T, {r: LOCALS * c for r, c in DT.items()}, -1), + edit(P, {r: LOCALS * c for r, c in DP.items()}, -1)) + need(not below(*prev, C5907[0]) and below(*prev, C5907[1]), 'reproduces #5907 crossing') + + twin = (edit(T, {r: LOCALS * c for r, c in DT.items()}, 1), + edit(P, {r: LOCALS * c for r, c in DP.items()}, 1)) + twin_cross = crossing(*twin) + need(twin_cross[0] > C6030[1], 'a free repeat of the twin delta would gain') + + # Any one added paid call, of any rank 1..145, defeats a twin-sized repeat. + ranks = range(1, 146) + total_fail = [r for r in ranks if not below(twin[0], edit(twin[1], {r: 1}, 1), C6030[0])] + need(total_fail == [], 'one added paid call of every rank defeats the repeat') + local_fail = [r for r in ranks if not below(twin[0], edit(twin[1], {r: LOCALS}, 1), C6030[0])] + need(local_fail == [], 'one added paid call per LOCAL of every rank defeats the repeat') + + one_call = crossing(T, edit(P, {1: 1}, 1)) + need(one_call[1] < C6030[0], 'one added rank-1 call lowers the crossing') + per_local = crossing(T, edit(P, {1: LOCALS}, 1)) + return { + 'claim': 'Raw-moment relaxation only; hypothetical edits of the PR #6030 published profile.', + 'controls': {'pr6030_crossing': [str(x) for x in C6030], + 'pr5907_crossing': [str(x) for x in C5907]}, + 'free_twin_repeat_crossing': [str(x) for x in twin_cross], + 'free_twin_repeat_gain_lower': str(twin_cross[0] - C6030[1]), + 'one_extra_rank1_call_crossing': [str(x) for x in one_call], + 'one_extra_rank1_call_per_local_crossing': [str(x) for x in per_local], + 'ranks_checked_for_added_call': [1, 145], + 'one_extra_rank1_call_loss_over_twin_gain_lower': str( + ((C6030[0] - one_call[1]) / (twin_cross[1] - C6030[0])).quantize(D('0.01'), rounding='ROUND_FLOOR')), + } + + +def controls(): + """Each damaged input must fail a named check.""" + damages = { + 'paid_count': lambda T, P: P.__setitem__(1, P[1] + 1), + 'target_rank_moved': lambda T, P: (T.__setitem__(9, T[9] - 1), T.__setitem__(10, 1)), + 'paid_rank_swapped': lambda T, P: (P.__setitem__(2, P[2] - 1), P.__setitem__(3, P[3] + 1), + P.__setitem__(1, P[1] + 1), P.__setitem__(4, P[4] - 1)), + } + rejected = [] + for name, damage in damages.items(): + try: + run(damage) + except SystemExit: + rejected.append(name) + need(rejected == list(damages), 'every damaged profile is rejected') + return rejected + + +def main(): + result = run() + result['rejected_controls'] = controls() + if '--write' in sys.argv: + (HERE / 'RESULT.json').write_text(json.dumps(result, indent=2, sort_keys=True) + '\n') + else: + expected = json.loads((HERE / 'RESULT.json').read_text()) + need(result == expected, 'RESULT.json matches the recomputation') + print(json.dumps(result, indent=2, sort_keys=True)) + print('PASS_P104_RUNG_CARRIER_BREAK_EVEN') + + +if __name__ == '__main__': + main()