From 77dc486aafa0ce89c0af8b7bc012adb40a933fda Mon Sep 17 00:00:00 2001 From: "Douglas R. Colkitt" Date: Tue, 13 Oct 2026 16:52:46 -0400 Subject: [PATCH 1/2] Certify the packing ceiling and target budget of the selected complex word Under PR1012's coverage identity (mass = 72W + 64N) and the outer halving guard, any hosting, owner or idle repacking of the #1094 local word has a < 0.001690054109089 (kappa < 0.0016872, +0.869%). At a = 1/99, the word's excess spend is 20.4 times the per-call budget. ceiling.py screens any proposed local profile with exact standard-library interval arithmetic. No new kappa. Co-Authored-By: Claude Opus 5.5 (1M context) --- research/complex-local-word-ceiling/README.md | 92 ++++++++++ .../complex-local-word-ceiling/RESULT.json | 108 +++++++++++ .../complex-local-word-ceiling/SOURCES.json | 30 +++ research/complex-local-word-ceiling/TASK.json | 66 +++++++ .../complex-local-word-ceiling/VERIFY.json | 25 +++ .../complex-local-word-ceiling/ceiling.py | 151 ++++++++++++++++ research/complex-local-word-ceiling/verify.py | 171 ++++++++++++++++++ 7 files changed, 643 insertions(+) create mode 100644 research/complex-local-word-ceiling/README.md create mode 100644 research/complex-local-word-ceiling/RESULT.json create mode 100644 research/complex-local-word-ceiling/SOURCES.json create mode 100644 research/complex-local-word-ceiling/TASK.json create mode 100644 research/complex-local-word-ceiling/VERIFY.json create mode 100644 research/complex-local-word-ceiling/ceiling.py create mode 100644 research/complex-local-word-ceiling/verify.py diff --git a/research/complex-local-word-ceiling/README.md b/research/complex-local-word-ceiling/README.md new file mode 100644 index 0000000000..4138a56a9f --- /dev/null +++ b/research/complex-local-word-ceiling/README.md @@ -0,0 +1,92 @@ +# Packing ceiling and target budget for the selected complex local word + +**Scoped obstruction and planning tool. No new κ; the selected record is unchanged.** + +The selected complex supplier (#1094) fixes a local word with this paid profile per call: +`{1:2412, 2:418, 3:432, 4:142, 5:82, 8:8}`, local mass 5,586. Everything else in the record is +idle-remainder packing on 896 live data families per nine-stage replica (2 × 4 pairs × 112 ports, +all 492 helpers hosted). + +Under PR1012's coverage identity, paid mass is exactly `72·W + 64·N`, so each call carries 1,646 units +of idle mass. Every child of rank `r` costs `(r/73)^(1−a) = r·r^(−a)·73^(a−1)`, which is non-increasing +per unit of mass in `r`. So **no** idle histogram beats putting all idle mass into (fractional) children +of the largest rank allowed by the outer halving guard, `R = 51` (73² > 2·51²). + +## Results (exact rational intervals, `verify.py`) + +| Quantity | Value | +|---|---| +| Ceiling for any hosting, owner packing or idle-remainder change of this word | **a < 0.001690054109089** | +| Implied κ bound (`κ < a/(1+a)` when the complex side binds) | **κ < 0.0016872026453254** | +| Maximum gain over the selected κ 0.001672660197076918 | **+0.869%** | +| Selected endpoint / relaxation at the endpoint | below the ceiling; actual moment ≥ relaxation | +| Previous record #1042 | same local word plus an admissible idle histogram (derived idle `{1:2249, 2:1, 3:400, 7:3, 16:47, 48:4850}` matches its README); endpoint below the same ceiling | + +This updates the fixed-word ceilings computed for earlier words +([static44](../static44-packing-ceiling/README.md), PR525, PR643) to the selected hosted T16/T37 line. It +uses the coverage law instead of a dual certificate. All of #1042→#1094's gain was packing at this +fixed word, and less than 0.87% of such headroom remains. + +### What a local word must pay for the planning target a = 1/99 + +Rewrite `relax(a) ≤ 1` as `Σ n_r p_r(a) ≤ B(a)`. Here `p_r(a) = (r/73)^(1−a) − r(51/73)^(1−a)/51` is the +excess of a local rank-r child over ideal idle mass, and `B(a) = w − (72w+64)(51/73)^(1−a)/51` is the +budget per call. + +| a | Budget B | Selected word's excess spend | Ratio | +|---|---:|---:|---:| +| selected endpoint 0.0016755 | 0.42752 | 0.42330 | 0.990 | +| target 1/99 | 0.12753 | 2.59681 | **20.4** | + +At a = 1/99, the selected word's excess spend is 20.4 times the budget. **Even deleting all 2,412 rank-1 +children per call, with everything else fixed, cannot reach it.** The allowed rank-1 count is negative. +With 112 ports and this nine-stage template, a target-scale gain needs a local word whose fully priced +excess spend is about 95% lower. Otherwise the coverage law itself must change: more unpaid coordinates +per family, a smaller 64-per-call centre charge, or more families per call. Helper-inventory proposals +can be screened against these numbers before any network is built: `ceiling.ceiling(local, 73, 896, 9, 64)` +takes a per-call local profile. + +## Scope and limits + +- The bound holds for one local word (paid profile per call), 112 ports, the nine-stage four-pair + template, the coverage law and the outer halving guard. It allows fractional counts and every repacking, + without checking physical realizability. +- It does **not** bound other local words. Many open claims above the selected κ (for example #1148's + joint-entrance word and its descendants, all ≤ 0.0016759) change the local word, so they are outside it. + Changed port counts, templates, coverage laws, centre charges or outer recipes are also outside it. +- `κ < a/(1+a)` is the retained balanced reduction's planning ceiling. The actual seven-step recipe gives + slightly less. +- Four controls run: + - an idle-rank cap of 52 is rejected; + - a local mass beyond the coverage law is rejected; + - one extra rank-1 child lowers the ceiling; + - 25 sampled integer idle histograms all have exact moment above one at the ceiling. + +## Reproduce + +```sh +python3 -I -B research/complex-local-word-ceiling/verify.py # ~10 s, PASS_COMPLEX_LOCAL_WORD_CEILING +python3 scripts/research_package.py --package research/complex-local-word-ceiling +``` + +`verify.py --write` regenerates `RESULT.json`. The exact arithmetic in `ceiling.py` uses the standard +library only: atanh logarithm chains, Taylor exponentials with remainder, and outward rounding to 2⁻²⁵⁶. + +## Open next questions + +- **What is the ceiling of each pending local word?** The ceiling separates packing headroom from + word gains in the review queue. A first step is to run `ceiling()` on the per-call local profiles of + #1148/#1169/#1218, after subtracting their idle histograms. The blocker is that each claim's idle + histogram must be extracted from its package. +- **How does the target budget scale with the port count V?** `B(a)` grows linearly with families per call. + Whether a decoder's excess spend grows more slowly decides if wider words can help. A first step is to + fit `Σ n_r p_r` against V across the recorded complex words (R439–R560 lineage). The blocker is per-call + local profiles for different V on a comparable template. + +## Credit + +The coverage identity is PR1012's. The fixed-word packing-ceiling idea comes from the static44, PR525 and +PR643 lineage, and the catalogue mixture bound from Ali Romman's +[heterogeneous-owner-assembly](../heterogeneous-owner-assembly/README.md). The selected construction +credits are in its review. Prepared by Douglas Colkitt with substantial Claude (Anthropic) assistance. +Apache-2.0. diff --git a/research/complex-local-word-ceiling/RESULT.json b/research/complex-local-word-ceiling/RESULT.json new file mode 100644 index 0000000000..77f55043a6 --- /dev/null +++ b/research/complex-local-word-ceiling/RESULT.json @@ -0,0 +1,108 @@ +{ + "at_selected_endpoint": { + "budget_B": [ + "0.427516482255611063", + "0.427516482255611063" + ], + "excess_price_by_rank": { + "1": "9.0593779e-05", + "2": "0.00014915902", + "3": "0.00019566114", + "4": "0.00023433531", + "5": "0.0002671916", + "8": "0.00034085369" + }, + "local_excess_spend": [ + "0.423298432057444218", + "0.423298432057444218" + ], + "max_rank1_per_call_others_fixed": "2458.56", + "rank1_price": "9.05937788742848158e-05", + "spend_over_budget_lower": "0.99013359630975617" + }, + "ceiling": { + "a_ceiling": "1690054109089/1000000000000000", + "a_ceiling_decimal": "0.00169005410908900006", + "a_relaxation_achievable": "52814190909/31250000000000", + "kappa_upper_bound": "0.0016872026453254019", + "max_kappa_gain_percent": "0.86942", + "selected_moment_at_ceiling_lower": "1.00004273855344605" + }, + "controls": { + "idle_rank_52_violates_halving_guard": "rejected: idle rank cap violates the halving guard", + "local_mass_exceeds_coverage": "rejected: local word pays more mass than the coverage law allows", + "one_more_rank1_child_lowers_ceiling": "yes", + "sampled_idle_histograms_above_one_at_ceiling": "yes" + }, + "model": { + "centre_per_call": 64, + "coverage_identity": "mass = 72 W + 64 N (checked on the selected profile)", + "idle_rank_cap": 51, + "live_families_per_call": "896/9", + "m": 73, + "pairs": 4, + "ports": 112, + "stages": 9 + }, + "previous_record_same_local_word": { + "below_ceiling": true, + "complex_lower": "418747253984418082117/250000000000000000000000", + "idle_histogram": { + "1": 2249, + "16": 47, + "2": 1, + "3": 400, + "48": 4850, + "7": 3 + }, + "kappa": "1672188119205421/1000000000000000000", + "record": "certificates/checkpoints/frontier1042.json" + }, + "scope": "Bound for the selected local word (paid profile per call), 2*4*112 live data families per nine-stage replica, the coverage law and the outer halving guard. It is not a bound for other local words, port counts, templates, coverage laws or outer recipes, and allows fractional idle counts and every repacking without checking physical realizability.", + "selected": { + "calls": 144, + "complex_lower": "67018507072324140917/40000000000000000000000", + "idle_histogram": { + "1": 2276, + "3": 377, + "48": 4866, + "7": 7 + }, + "idle_mass_per_call": "1646", + "kappa": "836330098538459/500000000000000000", + "live": 14336, + "local_mass_per_call": "5586", + "local_profile_per_call": { + "1": 2412, + "2": 418, + "3": 432, + "4": 142, + "5": 82, + "8": 8 + }, + "rank_mass": 1041408 + }, + "status": "PASS_COMPLEX_LOCAL_WORD_CEILING", + "target": { + "a": "1/99", + "budget_B": [ + "0.127529653671111354", + "0.127529653671111354" + ], + "excess_price_by_rank": { + "1": "0.00055700884", + "2": "0.00091439983", + "3": "0.0011974157", + "4": "0.0014323494", + "5": "0.0016316381", + "8": "0.0020773305" + }, + "local_excess_spend": [ + "2.59681461996869167", + "2.59681461996869167" + ], + "max_rank1_per_call_others_fixed": "-2021.1163", + "rank1_price": "0.000557008840686534388", + "spend_over_budget_lower": "20.3624376387445238" + } +} diff --git a/research/complex-local-word-ceiling/SOURCES.json b/research/complex-local-word-ceiling/SOURCES.json new file mode 100644 index 0000000000..c45a9995fe --- /dev/null +++ b/research/complex-local-word-ceiling/SOURCES.json @@ -0,0 +1,30 @@ +{ + "schema_version": 1, + "base_commit": "e3bb23b4c6bae16ba277f9443e11257a0a37780a", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "input", + "git_blob": "ae6a99f28aa468649eb66a361e764d769363bf11", + "sha256": "10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "c05fafaa25ba95b2d5af86b1800427198e3d20eb", + "sha256": "89b5928bc92c81e2647b6d702a7ad85a6795b8f44e2eb267b2ff3145d8f2b2ce" + }, + { + "path": "research/community-frontier1094-audit/ASSEMBLY.json", + "usage": "input", + "git_blob": "5fd676df060f3b450782fdf5ff5f6beb63a5eeb0", + "sha256": "1122cb3a575f8c788345fc1bf4c108ac7c3250fb81a5988671f5eb04b3ab3045" + }, + { + "path": "research/community-frontier1094-audit/INDEPENDENT1094.json", + "usage": "input", + "git_blob": "009a385e26858058a18188364078d162aa6f9519", + "sha256": "301fb8a0e4ab7e3c383ff974c54c08178283b2a3453c5282757f692a3c7a4bfd" + } + ] +} diff --git a/research/complex-local-word-ceiling/TASK.json b/research/complex-local-word-ceiling/TASK.json new file mode 100644 index 0000000000..9352d69472 --- /dev/null +++ b/research/complex-local-word-ceiling/TASK.json @@ -0,0 +1,66 @@ +{ + "schema_version": 1, + "task_id": "complex-new-helper-inventory", + "priority_revision": 2, + "base_commit": "e3bb23b4c6bae16ba277f9443e11257a0a37780a", + "original_card": { + "id": "complex-new-helper-inventory", + "question": "Can a new local cost interface change the deficit-to-recursive-cost ratio beyond current packing?", + "starting_points": [ + "research/heterogeneous-owner-assembly/README.md", + "certificates/selected-result.json" + ], + "methods": [ + "Propose a changed helper inventory and derive an optimistic exact moment.", + "Design a small completed instance and independently verify its endpoint and rank bill." + ], + "acceptance_gate": "A new physically realizable contract, not another mixture already covered by the frozen catalogue.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read the frozen catalogue bound exclusions and select one genuinely different helper endpoint inventory.", + "scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay." + }, + "first_experiment": "Write the complete optimistic child histogram and reject it immediately if even the relaxation has insufficient headroom.", + "bottleneck_link": "Helper inventory changes can improve the moment; repacking a covered cost interface cannot evade its scoped bound.", + "allowed_variations": [ + "Narrow to one changed boundary or helper type with explicit counts." + ], + "scope_change_triggers": [ + "Mixing only providers already inside the pinned catalogue." + ], + "overlap_terms": [ + "helper inventory", + "heterogeneous-owner", + "mutable leaver" + ] + }, + "scope_status": "refined", + "actual_scope": "For the selected #1094 complex local word, certify the best saving any hosting/owner/idle repacking can reach under the coverage law and halving guard. Then compute the local-word excess-spend budget a changed helper inventory needs for a = 1/99.", + "scope_change_reason": "This is the card's first experiment (an optimistic exact relaxation that rejects routes with insufficient headroom), applied to packing of the incumbent word and turned into a screening calculator for proposed inventories. No new inventory was synthesized.", + "bottleneck_link": "The complex side binds. This shows packing of the incumbent word has under 0.87% headroom, and that a target-scale gain needs about 95% less local excess spend or a changed coverage law.", + "budget_minutes": 60, + "stop_rule": "Stop after the selected word, the previous record and the 1/99 budget. Pending words are left as an open question.", + "outcome": "completed", + "evidence": "RESULT.json: a ceiling 0.001690054109089 (kappa < 0.0016872026453254, +0.869%); at a=1/99 the excess spend is 20.4 times the budget; 4 controls.", + "author": "Douglas Colkitt", + "ai_assistance": "Substantial: Claude (Anthropic, Claude Code) chose the relaxation, wrote ceiling.py and verify.py, and drafted the README.", + "open_questions": [ + { + "question": "What is the packing ceiling of each pending local word (#1148/#1169/#1218 lineage)?", + "why_it_matters": "It separates packing headroom from local-word gains in the review queue.", + "first_step": "Run ceiling() on each claim's per-call local profile after subtracting its idle histogram.", + "blocked_by": "Each claim's idle histogram must be extracted from its package." + }, + { + "question": "How does the a=1/99 budget scale with the port count V relative to a decoder's excess spend?", + "why_it_matters": "It decides whether wider words can reach target-scale gains.", + "first_step": "Fit sum n_r p_r against V across recorded complex words.", + "blocked_by": "Per-call local profiles for different V on a comparable template." + } + ] +} diff --git a/research/complex-local-word-ceiling/VERIFY.json b/research/complex-local-word-ceiling/VERIFY.json new file mode 100644 index 0000000000..f89287910c --- /dev/null +++ b/research/complex-local-word-ceiling/VERIFY.json @@ -0,0 +1,25 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "certificates/checkpoints/frontier1042.json", + "certificates/selected-result.json", + "research/community-frontier1042-audit/ASSEMBLY.json", + "research/community-frontier1094-audit/ASSEMBLY.json", + "research/community-frontier1094-audit/INDEPENDENT1094.json" + ], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Coverage identity and local-word split of the selected and previous records; exact ceiling bracket; 1/99 budget; RESULT.json byte match; four controls" + } + ] +} diff --git a/research/complex-local-word-ceiling/ceiling.py b/research/complex-local-word-ceiling/ceiling.py new file mode 100644 index 0000000000..2c63fbbeed --- /dev/null +++ b/research/complex-local-word-ceiling/ceiling.py @@ -0,0 +1,151 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Packing-independent ceiling for a complex local word under the hosted nine-stage coverage law. + +Model (all inputs explicit): + * per replica the template has `families` live data families and `stages` invocations, so + w = families / stages live families per call; on the selected T37/T16 line all helpers are + hosted on data families, so w = 2 * pairs * V / stages is fixed by the port count V; + * coverage identity (PR1012, re-checked here on the selected profile): paid rank mass equals + (m - 1) * W + centre * N, i.e. every live family keeps exactly one unpaid coordinate and every + call pays its centre path; + * the local word fixes its own paid child profile `local` (per call); + * every remaining unit of mass is an idle/remainder child of rank at most R, where the outer + recipe's halving guard m^2 > 2 R^2 bounds R (R = 51 for m = 73). + +Lemma. For a >= 0, a child of rank r costs (r/m)^(1-a) = r * c(r), with c(r) = r^(-a) m^(a-1) +non-increasing in r. Hence, with idle mass M fixed and idle ranks <= R, every idle histogram has +moment >= the relaxation that puts all of M into (possibly fractional) rank-R children: + + relax(a) = [ sum_local n_r (r/m)^(1-a) + (M/R) (R/m)^(1-a) ] / w (per call). + +The moment is increasing in a. So relax(a*) > 1 certifies that no hosting, owner packing or +idle-remainder change of the given local word, template and outer recipe certifies a saving +>= a*. Under the retained reduction kappa < a/(1+a) when the complex side binds, so +a*/(1+a*) also bounds kappa. This is a bound for the stated model, not for other local words, +templates, coverage laws or outer recipes. + +Exact rational intervals: ln k from atanh chains, exp by Taylor with Lagrange remainder, +outward rounding to 2^-PREC. Standard library only. Douglas Colkitt, with Claude (Anthropic) +assistance. +""" +from fractions import Fraction as Q +from functools import lru_cache +from math import isqrt + +PREC = 256 + + +def require(ok, why): + if not ok: + raise ValueError(why) + + +def down(x): + return Q((x.numerator << PREC) // x.denominator, 1 << PREC) + + +def up(x): + return -down(-x) + + +@lru_cache(None) +def atanh(t): + """Enclosure of atanh(t) for rational 0 < t <= 1/3.""" + require(0 < t <= Q(1, 3), 'atanh range') + s, p, k = Q(0), t, 0 + while True: + term = p / (2 * k + 1) + s += term + p *= t * t + k += 1 + tail = p / ((2 * k + 1) * (1 - t * t)) + if tail < Q(1, 1 << (PREC + 8)): + return down(s), up(s + tail) + + +@lru_cache(None) +def ln(k): + """Enclosure of ln k for an integer k >= 1: ln k = ln(k-1) + 2 atanh(1/(2k-1)).""" + require(isinstance(k, int) and k >= 1, 'ln domain') + if k == 1: + return Q(0), Q(0) + lo, hi = ln(k - 1) + a, b = atanh(Q(1, 2 * k - 1)) + return down(lo + 2 * a), up(hi + 2 * b) + + +def exp(lo, hi): + """Enclosure of exp([lo, hi]) for 0 <= lo <= hi <= 1/2.""" + require(0 <= lo <= hi <= Q(1, 2), 'exp range') + def series(y, upper): + s, t, k = Q(1), Q(1), 0 + while True: + k += 1 + t = t * y / k + s += t + if t * y < Q(1, 1 << (PREC + 8)): + return up(s + 2 * t * y / (k + 1)) if upper else down(s) + return series(lo, False), series(hi, True) + + +def child_cost(r, m, a): + """Enclosure of (r/m)^(1-a) = (r/m) exp(a ln(m/r)).""" + lm, um = ln(m) + lr, ur = ln(r) + e = exp(max(Q(0), a * (lm - ur)), a * (um - lr)) + return down(Q(r, m) * e[0]), up(Q(r, m) * e[1]) + + +def max_idle_rank(m): + """Largest R with m^2 > 2 R^2 (outer halving guard).""" + R = isqrt((m * m - 1) // 2) + while 2 * (R + 1) ** 2 < m * m: + R += 1 + while 2 * R * R >= m * m: + R -= 1 + return R + + +def model(local, m, families, stages, centre, R=None): + """Per-call quantities. local: {rank: count per call (Fraction ok)}.""" + R = max_idle_rank(m) if R is None else R + require(2 * R * R < m * m, 'idle rank cap violates the halving guard') + require(all(0 < r < m for r in local) and all(n >= 0 for n in local.values()), 'local profile') + w = Q(families, stages) + total = (m - 1) * w + centre + local_mass = sum(r * Q(n) for r, n in local.items()) + idle = total - local_mass + require(idle >= 0, 'local word pays more mass than the coverage law allows') + return dict(R=R, w=w, total_mass=total, local_mass=local_mass, idle_mass=idle, deficit=w - centre) + + +def relax(local, m, families, stages, centre, a, R=None): + """Enclosure of the per-call relaxation moment at saving a.""" + q = model(local, m, families, stages, centre, R) + lo = hi = Q(0) + for r, n in local.items(): + c = child_cost(r, m, a) + lo, hi = lo + Q(n) * c[0], hi + Q(n) * c[1] + c = child_cost(q['R'], m, a) + k = q['idle_mass'] / q['R'] + lo, hi = lo + k * c[0], hi + k * c[1] + return down(lo / q['w']), up(hi / q['w']) + + +def ceiling(local, m, families, stages, centre, grid=Q(1, 10 ** 15), R=None): + """Grid bracket [a_lo, a_hi]: relax(a_lo) < 1 < relax(a_hi), certified. a_hi is the ceiling.""" + lo, hi = Q(0), Q(1, 20) + require(relax(local, m, families, stages, centre, hi, R)[0] > 1, 'search window too small') + require(relax(local, m, families, stages, centre, lo, R)[1] < 1, 'relaxation has no positive saving') + while hi - lo > grid: + mid = Q(int((lo + hi) / 2 / grid)) * grid + if mid <= lo: + mid = lo + grid + v = relax(local, m, families, stages, centre, mid, R) + if v[1] < 1: + lo = mid + elif v[0] > 1: + hi = mid + else: + raise ValueError('enclosure too wide to separate the grid point') + return lo, hi diff --git a/research/complex-local-word-ceiling/verify.py b/research/complex-local-word-ceiling/verify.py new file mode 100644 index 0000000000..069f09de38 --- /dev/null +++ b/research/complex-local-word-ceiling/verify.py @@ -0,0 +1,171 @@ +#!/usr/bin/env python3 +"""Certify the packing-independent ceiling of the selected complex local word, and the +local-word budget needed for the a = 1/99 planning target. Writes or checks RESULT.json. + +usage: verify.py [--write] +Douglas Colkitt, with Claude (Anthropic) assistance. Apache-2.0. +""" +import json, random, sys +from fractions import Fraction as Q +from pathlib import Path + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +sys.path.insert(0, str(HERE)) +import ceiling as C # noqa: E402 + +M, PAIRS, PORTS, STAGES, CENTRE = 73, 4, 112, 9, 64 +FAMILIES = 2 * PAIRS * PORTS # live data families per replica (all helpers hosted) +TARGET = Q(1, 99) + + +def dec(x, digits=18): + return f'{float(x):.{digits}g}' + + +def exact_moment(H, W, a): + lo = hi = Q(0) + for r, n in H.items(): + c = C.child_cost(r, M, a) + lo, hi = lo + n * c[0], hi + n * c[1] + return lo / W, hi / W + + +def selected(): + rec = json.loads((ROOT / 'certificates/selected-result.json').read_text()) + asm = json.loads((ROOT / rec['certificate']).read_text()) + ind = json.loads((ROOT / 'research/community-frontier1094-audit/INDEPENDENT1094.json').read_text()) + H = {int(r): n for r, n in asm['complex_profile'].items()} + idle = {int(r): n for r, n in ind['owner']['idle'].items()} + N, W = ind['price']['calls'], ind['price']['live'] + C.require(H == {int(r): n for r, n in ind['owner']['profile'].items()}, 'profile mismatch') + C.require(N % STAGES == 0 and W == FAMILIES * (N // STAGES), 'live stock is not 2*pairs*V per replica') + mass = sum(r * n for r, n in H.items()) + C.require(mass == (M - 1) * W + CENTRE * N, 'coverage identity mass = 72W + 64N fails') + local = {} + for r, n in H.items(): + k = n - idle.get(r, 0) + C.require(k >= 0 and k % N == 0, f'local rank {r} not uniform per call') + if k: + local[r] = k // N + return rec, asm, H, idle, N, W, local + + +def previous_record(rec, local, N, a_hi): + """The previous record must split as the same local word plus an admissible idle histogram, + and its complex endpoint must lie below the same ceiling.""" + prev = json.loads((ROOT / rec['previous_record']).read_text()) + asm = json.loads((ROOT / prev['certificate']).read_text()) + H = {int(r): n for r, n in asm['complex_profile'].items()} + idle = {r: H.get(r, 0) - N * local.get(r, 0) for r in set(H) | set(local)} + C.require(all(v >= 0 for v in idle.values()), 'previous record does not contain the local word') + idle = {r: v for r, v in idle.items() if v} + q = C.model(local, M, FAMILIES, STAGES, CENTRE) + C.require(sum(r * v for r, v in idle.items()) == N * q['idle_mass'], 'previous idle mass differs') + C.require(max(idle) <= q['R'], 'previous idle rank above the guard') + b = Q(asm['complex_lower']) + C.require(b < a_hi, 'previous endpoint above the ceiling') + return dict(record=rec['previous_record'], kappa=prev['kappa'], complex_lower=asm['complex_lower'], + idle_histogram={str(r): v for r, v in sorted(idle.items())}, below_ceiling=True) + + +def budget(local, a): + """Necessary condition relax(a) <= 1 rewritten as sum_r n_r p_r(a) <= B(a), with excess price + p_r = (r/m)^(1-a) - r (R/m)^(1-a)/R of a local rank-r child over ideal idle mass.""" + q = C.model(local, M, FAMILIES, STAGES, CENTRE) + R = q['R'] + cR = C.child_cost(R, M, a) + B = (q['w'] - q['total_mass'] * cR[1] / R, q['w'] - q['total_mass'] * cR[0] / R) + price = {} + for r in sorted(set(local) | {1}): + c = C.child_cost(r, M, a) + price[r] = (c[0] - r * cR[1] / R, c[1] - r * cR[0] / R) + spend = (sum(n * price[r][0] for r, n in local.items()), sum(n * price[r][1] for r, n in local.items())) + others = (spend[0] - local.get(1, 0) * price[1][1], spend[1] - local.get(1, 0) * price[1][0]) + max_rank1 = (B[0] - others[1]) / price[1][1] + return dict(budget_B=[dec(B[0]), dec(B[1])], local_excess_spend=[dec(spend[0]), dec(spend[1])], + spend_over_budget_lower=dec(spend[0] / B[1]), rank1_price=dec(price[1][0]), + max_rank1_per_call_others_fixed=dec(max_rank1, 8), + excess_price_by_rank={str(r): dec(p[0], 8) for r, p in price.items()}) + + +def controls(local): + out = {} + def rejects(name, f): + try: + f(); out[name] = 'ACCEPTED' + except ValueError as e: + out[name] = 'rejected: ' + str(e) + rejects('idle_rank_52_violates_halving_guard', lambda: C.model(local, M, FAMILIES, STAGES, CENTRE, R=52)) + rejects('local_mass_exceeds_coverage', lambda: C.model({1: 7300}, M, FAMILIES, STAGES, CENTRE)) + lo0, hi0 = C.ceiling(local, M, FAMILIES, STAGES, CENTRE) + worse = dict(local); worse[1] += 1 + lo1, hi1 = C.ceiling(worse, M, FAMILIES, STAGES, CENTRE) + out['one_more_rank1_child_lowers_ceiling'] = 'yes' if hi1 < hi0 else 'NO' + # dominance: integer idle histograms with ranks <= 51 and the exact idle mass never beat the relaxation + q = C.model(local, M, FAMILIES, STAGES, CENTRE) + rng = random.Random(1094) + worst = None + for _ in range(25): + left, idle = int(q['idle_mass']), {} + while left: + r = min(left, rng.choice([1, 2, 3, 7, 13, 24, 40, 48, 51])) + idle[r] = idle.get(r, 0) + 1 + left -= r + Hc = dict(local) + for r, n in idle.items(): + Hc[r] = Hc.get(r, 0) + n + val = exact_moment(Hc, q['w'], hi0)[0] + worst = val if worst is None else min(worst, val) + out['sampled_idle_histograms_above_one_at_ceiling'] = 'yes' if worst > 1 else 'NO' + C.require(all(v.startswith('rejected') or v == 'yes' for v in out.values()), f'control failed: {out}') + return out + + +def main(): + rec, asm, H, idle, N, W, local = selected() + b = Q(asm['complex_lower']) + lo, hi = C.ceiling(local, M, FAMILIES, STAGES, CENTRE) + C.require(b < lo, 'selected endpoint above the relaxation') + act = exact_moment(H, W, hi) + C.require(act[0] > 1, 'selected profile not above one at the ceiling') + rel_b = C.relax(local, M, FAMILIES, STAGES, CENTRE, b) + C.require(rel_b[1] < exact_moment(H, W, b)[0], 'relaxation must not exceed the actual moment') + prev = previous_record(rec, local, N, hi) + kappa_cap = hi / (1 + hi) + q = C.model(local, M, FAMILIES, STAGES, CENTRE) + out = dict( + status='PASS_COMPLEX_LOCAL_WORD_CEILING', + model=dict(m=M, pairs=PAIRS, ports=PORTS, stages=STAGES, centre_per_call=CENTRE, + live_families_per_call=str(q['w']), idle_rank_cap=q['R'], + coverage_identity='mass = 72 W + 64 N (checked on the selected profile)'), + selected=dict(calls=N, live=W, rank_mass=sum(r * n for r, n in H.items()), + local_profile_per_call={str(r): n for r, n in sorted(local.items())}, + idle_histogram={str(r): n for r, n in sorted(idle.items())}, + local_mass_per_call=str(q['local_mass']), idle_mass_per_call=str(q['idle_mass']), + complex_lower=asm['complex_lower'], kappa=rec['kappa']), + ceiling=dict(a_relaxation_achievable=str(lo), a_ceiling=str(hi), a_ceiling_decimal=dec(hi), + kappa_upper_bound=dec(kappa_cap), + max_kappa_gain_percent=dec(100 * (kappa_cap / Q(rec['kappa']) - 1), 6), + selected_moment_at_ceiling_lower=dec(act[0])), + previous_record_same_local_word=prev, + target=dict(a=str(TARGET), **budget(local, TARGET)), + at_selected_endpoint=budget(local, b), + controls=controls(local), + scope='Bound for the selected local word (paid profile per call), 2*4*112 live data families per ' + 'nine-stage replica, the coverage law and the outer halving guard. It is not a bound for other ' + 'local words, port counts, templates, coverage laws or outer recipes, and allows fractional idle ' + 'counts and every repacking without checking physical realizability.') + text = json.dumps(out, indent=1, sort_keys=True) + '\n' + if sys.argv[1:] == ['--write']: + (HERE / 'RESULT.json').write_text(text) + else: + C.require((HERE / 'RESULT.json').read_text() == text, 'RESULT.json differs') + print(out['status'], 'a_ceiling', out['ceiling']['a_ceiling_decimal'], 'kappa<=', out['ceiling']['kappa_upper_bound']) + + +if __name__ == '__main__': + try: + main() + except ValueError as e: + print('FAIL:', e); sys.exit(1) From 1e136b8c4a552050820334ad113628775182f08c Mon Sep 17 00:00:00 2001 From: "Douglas R. Colkitt" Date: Tue, 13 Oct 2026 17:31:06 -0400 Subject: [PATCH 2/2] Add ideal lever budgets and an unpaid-coordinate what-if to the ceiling model levers.py reports one-at-a-time favorable relaxations: centre path free (2.80x), shared by two calls (1.90x), rank-16 local children (2.31x), two unpaid coordinates per family (3.77x), and centre free plus rank-16 (6.51x, kappa cap 0.0109). The default model and RESULT.json are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) --- research/complex-local-word-ceiling/README.md | 15 +++++++ .../complex-local-word-ceiling/ceiling.py | 21 ++++----- research/complex-local-word-ceiling/levers.py | 43 +++++++++++++++++++ 3 files changed, 69 insertions(+), 10 deletions(-) create mode 100644 research/complex-local-word-ceiling/levers.py diff --git a/research/complex-local-word-ceiling/README.md b/research/complex-local-word-ceiling/README.md index 4138a56a9f..8c189f2770 100644 --- a/research/complex-local-word-ceiling/README.md +++ b/research/complex-local-word-ceiling/README.md @@ -46,6 +46,20 @@ per family, a smaller 64-per-call centre charge, or more families per call. Help can be screened against these numbers before any network is built: `ceiling.ceiling(local, 73, 896, 9, 64)` takes a per-call local profile. +### Ideal lever budgets + +`levers.py` changes one premise at a time and reports the packing ceiling. These are favorable relaxations +that omit the costs of realizing each lever. + +| Lever | Ceiling × | κ cap | +|---|---:|---:| +| Centre path free (no rank-8 copies, no 64-per-call charge) | 2.80 | 0.00472 | +| Centre path shared by two calls | 1.90 | 0.00320 | +| Local mass as rank-16 children | 2.31 | 0.00389 | +| Local mass as rank-8 children | 1.62 | 0.00273 | +| Two unpaid coordinates per live family | 3.77 | 0.00634 | +| Centre free and rank-16 children | 6.51 | 0.01089 | + ## Scope and limits - The bound holds for one local word (paid profile per call), 112 ports, the nine-stage four-pair @@ -67,6 +81,7 @@ takes a per-call local profile. ```sh python3 -I -B research/complex-local-word-ceiling/verify.py # ~10 s, PASS_COMPLEX_LOCAL_WORD_CEILING python3 scripts/research_package.py --package research/complex-local-word-ceiling +python3 -I -B research/complex-local-word-ceiling/levers.py # ~5 s, planning budgets ``` `verify.py --write` regenerates `RESULT.json`. The exact arithmetic in `ceiling.py` uses the standard diff --git a/research/complex-local-word-ceiling/ceiling.py b/research/complex-local-word-ceiling/ceiling.py index 2c63fbbeed..6c0f54527d 100644 --- a/research/complex-local-word-ceiling/ceiling.py +++ b/research/complex-local-word-ceiling/ceiling.py @@ -7,7 +7,7 @@ hosted on data families, so w = 2 * pairs * V / stages is fixed by the port count V; * coverage identity (PR1012, re-checked here on the selected profile): paid rank mass equals (m - 1) * W + centre * N, i.e. every live family keeps exactly one unpaid coordinate and every - call pays its centre path; + call pays its centre path (`unpaid` > 1 is a what-if for a changed coverage law only); * the local word fixes its own paid child profile `local` (per call); * every remaining unit of mass is an idle/remainder child of rank at most R, where the outer recipe's halving guard m^2 > 2 R^2 bounds R (R = 51 for m = 73). @@ -106,22 +106,23 @@ def max_idle_rank(m): return R -def model(local, m, families, stages, centre, R=None): +def model(local, m, families, stages, centre, R=None, unpaid=1): """Per-call quantities. local: {rank: count per call (Fraction ok)}.""" R = max_idle_rank(m) if R is None else R require(2 * R * R < m * m, 'idle rank cap violates the halving guard') require(all(0 < r < m for r in local) and all(n >= 0 for n in local.values()), 'local profile') w = Q(families, stages) - total = (m - 1) * w + centre + require(1 <= unpaid < m, 'unpaid coordinates per family') + total = (m - unpaid) * w + centre local_mass = sum(r * Q(n) for r, n in local.items()) idle = total - local_mass require(idle >= 0, 'local word pays more mass than the coverage law allows') - return dict(R=R, w=w, total_mass=total, local_mass=local_mass, idle_mass=idle, deficit=w - centre) + return dict(R=R, w=w, total_mass=total, local_mass=local_mass, idle_mass=idle, deficit=unpaid * w - centre) -def relax(local, m, families, stages, centre, a, R=None): +def relax(local, m, families, stages, centre, a, R=None, unpaid=1): """Enclosure of the per-call relaxation moment at saving a.""" - q = model(local, m, families, stages, centre, R) + q = model(local, m, families, stages, centre, R, unpaid) lo = hi = Q(0) for r, n in local.items(): c = child_cost(r, m, a) @@ -132,16 +133,16 @@ def relax(local, m, families, stages, centre, a, R=None): return down(lo / q['w']), up(hi / q['w']) -def ceiling(local, m, families, stages, centre, grid=Q(1, 10 ** 15), R=None): +def ceiling(local, m, families, stages, centre, grid=Q(1, 10 ** 15), R=None, unpaid=1): """Grid bracket [a_lo, a_hi]: relax(a_lo) < 1 < relax(a_hi), certified. a_hi is the ceiling.""" lo, hi = Q(0), Q(1, 20) - require(relax(local, m, families, stages, centre, hi, R)[0] > 1, 'search window too small') - require(relax(local, m, families, stages, centre, lo, R)[1] < 1, 'relaxation has no positive saving') + require(relax(local, m, families, stages, centre, hi, R, unpaid)[0] > 1, 'search window too small') + require(relax(local, m, families, stages, centre, lo, R, unpaid)[1] < 1, 'relaxation has no positive saving') while hi - lo > grid: mid = Q(int((lo + hi) / 2 / grid)) * grid if mid <= lo: mid = lo + grid - v = relax(local, m, families, stages, centre, mid, R) + v = relax(local, m, families, stages, centre, mid, R, unpaid) if v[1] < 1: lo = mid elif v[0] > 1: diff --git a/research/complex-local-word-ceiling/levers.py b/research/complex-local-word-ceiling/levers.py new file mode 100644 index 0000000000..e6aee6ce11 --- /dev/null +++ b/research/complex-local-word-ceiling/levers.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python3 +"""Ideal one-at-a-time lever budgets for the selected complex word (planning numbers, not constructions). + +Each row changes one premise of the ceiling model and reports the packing ceiling (ideal idle +packing, halving guard R = 51) relative to the selected word's ceiling. These are favorable +relaxations: every row omits whatever cost realizing the lever would add elsewhere. + +usage: levers.py +Douglas Colkitt, with Claude (Anthropic) assistance. Apache-2.0. +""" +import sys +from fractions import Fraction as Q +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +import ceiling as C # noqa: E402 + +M, FAM, ST = 73, 896, 9 +WORD = {1: 2412, 2: 418, 3: 432, 4: 142, 5: 82, 8: 8} + + +def cap(local, centre=64, unpaid=1, families=FAM): + return C.ceiling(local, M, families, ST, centre, grid=Q(1, 10 ** 12), unpaid=unpaid)[1] + + +def main(): + base = cap(WORD) + mass = sum(r * n for r, n in WORD.items()) + rows = [ + ('selected word (baseline)', base), + ('centre path free: no 8 rank-8 copies, centre charge 0', cap({r: n for r, n in WORD.items() if r != 8}, centre=0)), + ('centre path shared by 2 calls (copies and charge halved)', cap({**WORD, 8: 4}, centre=32)), + ('local mass delivered as rank-16 children', cap({16: Q(mass, 16)})), + ('local mass delivered as rank-8 children', cap({8: Q(mass, 8)})), + ('two unpaid coordinates per live family', cap(WORD, unpaid=2)), + ('centre free and rank-16 children combined', cap({16: Q(mass - 64, 16)}, centre=0)), + ] + for name, a in rows: + print(f'{name:58s} a_cap={float(a):.6f} x{float(a / base):.2f} kappa_cap={float(a / (1 + a)):.6f}') + + +if __name__ == '__main__': + main()