Skip to content

feat(research): exact integer idle-histogram ceiling for the selected complex word - #3729

Open
petalas wants to merge 2 commits into
CrocSwap:mainfrom
petalas:research/w10-1018-idle-integrality-ceiling
Open

petalas wants to merge 2 commits into
CrocSwap:mainfrom
petalas:research/w10-1018-idle-integrality-ceiling

Conversation

@petalas

@petalas petalas commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Summary

research/complex-local-word-ceiling bounds how much any repacking of the selected complex supplier can gain. Its proof puts a call's entire idle remainder into (1646/51) fractional rank-51 children, which minimises the per-call moment over all non-negative real counts. That is the right optimistic relaxation, so a < 0.001690054109089 is valid but not tight: a real packing uses an integer multiset of children, because each rank-r child is an object. The package's only integer control is 25 sampled histograms.

This PR replaces the relaxation with the attained optimum over integer idle histograms, computed by dynamic programming on the mass axis, and certifies the tighter bracket from both sides. The published ceiling becomes a statement about every realizable integer packing rather than about an unattainable fractional ideal.

Scoped bound inside the existing ceiling model. No new κ, no supplier, no construction, selected record unchanged. The result removes headroom from the incumbent word.

Result

Model inputs unchanged and re-derived from the pinned certificate: paid local word {1:2412, 2:418, 3:432, 4:142, 5:82, 8:8} per call, m = 73, 2·4·112 live data families per nine-stage replica (w = 896/9), centre charge 64, coverage identity mass = 72·W + 64·N, outer halving guard R = 51. The only addition is that idle counts are integers summing to 1646 rank units per call.

Quantity Fractional relaxation (existing) Attained integer optimum (this PR)
Best idle histogram 32.2745 rank-51 (fractional) 32 rank-51 + 1 rank-14 (1632+14 = 1646)
Ceiling a < 0.001690054109089 < 0.001688603446527
κ bound (κ < a/(1+a)) 0.00168720264532540190 0.00168575687166350251
Max gain over selected κ +0.869420% +0.782985%

Integrality costs 1.4507e-06 in a — 0.0858% of the relaxation ceiling — and removes 0.0864 percentage points of the claimed packing headroom. The selected word's residual packing headroom is +0.783%, not +0.869%.

Why the bracket is certified in both directions

ceiling.py supplies outward-rounded enclosures (lo_r, hi_r) of (r/73)^(1-a). The DP returns

  • DP_lower(a) = min over integer histograms of Σ n_r·lo_r, a certified lower bound on the attained moment. DP_lower(a)/w > 1 rejects a: no integer histogram of any shape fits.
  • moment_upper(H(a)) = Σ_{r∈H(a)} n_r·hi_r for the argmin, a certified upper bound on that histogram's true moment. < 1 accepts a: H(a) is a genuine witness.

Bisection yields a ∈ [0.001688603446526, 0.001688603446527]. Witness moment at the low end 0.999999999999998779; certified lower bound at the high end 1.00000000000000178. Neither vacuous nor one-sided.

Same correction on the centre-free lever

Lever a, fractional a, integer κ cap, fractional κ cap, integer
selected word (baseline) 0.001690054109089 0.001688603446527 0.00168720 0.00168576
centre path free 0.004737653470 0.004733592412 0.00471531 0.00471129

The fractional column reproduces levers.py exactly, which is the cross-check that both rows use one model.

Not re-priced: the two-unpaid-coordinates row (3.77×). With unpaid = 2 the per-call paid mass is 71·(896/9)+64 = 64192/9, so per-call idle mass is 13918/9, not an integer. A single call's child multiset cannot have non-integral rank mass, so under this per-call model that premise admits no integer packing at all; its published κ cap is a fractional-relaxation figure on a premise the parent README already labels a what-if. Reported, not exploited.

Controls

13 recorded in RESULT.json. Highlights:

  • DP agrees exactly with an independent exhaustive enumeration (descending recursion over counts, no shared code path) at idle mass 30/cap 7, 36/cap 8, 45/cap 9.
  • Certified integrality gap positive on a 20-point grid of a ∈ (0, ceiling]; smallest certified slack 2.10e-07.
  • Rank cap 48 strictly worse than cap 51 (search is not silently truncated); integer moment strictly increasing in a; optimum conserves idle mass and stays inside the guard; bracket witnessed both sides; integer ceiling strictly below the relaxation; tightened guard and one extra rank-1 child each lower the ceiling; 25 sampled histograms never beat the optimum.
  • Largest-first greedy happens to equal the DP optimum here and never beats it. Greedy optimality is not assumed — the DP is the proof.

Relation to adjacent integrality work

research/community-efficient500-audit records #1436's integrality gap and states it gave no ceiling for the later selected layout — that is the gap filled here. research/selected-t16-pattern-dual concerns integrality of pattern multiplicities in a pooled LP and yields strict nonattainment "not a quantitative integrality gap".

Open peer PR #3701 sweeps the ceiling of the paid local mass (5,586) over rank caps 1..51, with a fractional upper bound and a greedy(5586, s) integer lower bound. Different degree of freedom: the idle remainder (1,646) of the incumbent word at the guard cap, where the question is what the incumbent's published ceiling is. This PR searches the histogram space, so its integer figure is an attained optimum with a two-sided certificate rather than a lower bound. No conflict; integrality.best_idle is also the tool that would settle a greedy assumption on any such class.

Verification (run locally, not CI-certified)

Interpreter ~/git/integer-mult-bounds/.venv/bin/python3.12 (CPython 3.12.15, not on PATH). Base 20ecf2891d80b5acf18d980b2164fb44ea7faa90, canonical main, fetched this round.

PASS_RESEARCH_BASELINE_BINDINGS_ONLY            # scripts/research_baseline.py
PASS_COMPLEX_IDLE_INTEGRALITY_CEILING a_ceiling 0.00168860344652699995 kappa<= 0.00168575687166350251 headroom 0.782985%
PASS_REGISTERED_RESEARCH_PACKAGE research/complex-idle-integrality-ceiling outcome=completed
PASS_PACKAGE_METADATA_AND_PINS                  # --check-only
PASS_RESEARCH_COMMIT_BYTES {"commit": "c7c68f89e020f9e62f38514afdfc99dda01430d4", "files": 12, ...}

Reproduce: python3 -I -B research/complex-idle-integrality-ceiling/verify.py (~35 s) and python3 scripts/research_package.py --package research/complex-idle-integrality-ceiling. verify.py --write regenerates RESULT.json; the package pins research/complex-local-word-ceiling/ceiling.py as a live input and imports it rather than copying it, so the repository's registered replay job can certify the same arithmetic in CI.

No proof obligation is left unrun.

Scope and limits

Bound within the existing ceiling model: one fixed paid local profile, m = 73, 896 families over nine stages, centre charge 64, the coverage law, the halving guard. Not a bound for other local words, port counts, templates, coverage laws or outer recipes, and it still allows every repacking without checking physical realizability. The DP optimum is an optimum over that combinatorial model, not a constructible circuit. The integrality constraint is sound only where per-call paid mass is integral (baseline and centre-free rows; not unpaid = 2). The local word's contribution is taken fixed and exact from the pinned certificate; only the idle remainder is re-optimised. No κ claimed, no supplier admitted, no change to the selected frontier.

Credit

Prepared by Nick Petalas with AI assistance. Apache-2.0. The ceiling model, coverage identity (PR1012), fixed-word packing-ceiling lineage (static44, PR525, PR643), the local word and the selected record are Douglas Colkitt's and his credited predecessors'; this PR imports ceiling.py unmodified and preserves all of those credit lines.

Card complex-new-helper-inventory (priority revision 6), scope_status = changed: the card's screening tool returns a fractional ceiling, so this first repairs that shared instrument rather than synthesizing a candidate profile. Details and the three open next questions are in TASK.json.

…ct integer one

The selected complex word's packing ceiling is derived from a fractional
relaxation: all 1646 idle rank units per call are placed in 1646/51 rank-51
children, which minimises the moment over non-negative real counts. Real
packings use integer child counts, so the published +0.869% headroom is
optimistic by an unquantified amount and its only integer control is 25
sampled histograms.

This computes the attained optimum over every feasible integer idle histogram
by dynamic programming on the mass axis, and certifies the tighter bracket on
both sides: the DP lower bound rejects an a for which no integer packing of any
shape fits, and the argmin's upper enclosure witnesses an a that one does.

Attained optimum per call is 32 rank-51 children plus one rank-14 child
(1632 + 14 = 1646). The ceiling drops from a < 0.001690054109089 to
a < 0.001688603446527, so kappa <= 0.00168575687166350251 and the residual
packing headroom of the selected word is +0.783%, not +0.869%. Integrality
costs 0.0858% of the ceiling and removes 0.0864 percentage points of headroom.

The centre-free lever row takes the same correction (kappa cap 0.00471531 ->
0.00471129), reproducing levers.py's fractional figure exactly as a
cross-check. The two-unpaid-coordinates row is reported but not re-priced: its
per-call idle mass is 13918/9, so under this per-call model it admits no
integer packing at all.

Scoped bound inside the existing ceiling model, with one fixed paid local
profile, m = 73, 896 families over nine stages, centre charge 64, the coverage
law and the halving guard. No new kappa, no supplier admitted, no change to the
selected frontier: the result removes headroom from the incumbent word.
…egrality work

The selected layout's idle remainder (1,646) at the guard cap is a different
degree of freedom from a rank-cap sweep of the paid local mass (5,586), and the
attained optimum here is a two-sided certificate rather than a greedy lower
bound. Names CrocSwap#1436's recorded gap for the later selected layout and the pooled
pattern-multiplicity result, and points at best_idle as the tool that would
settle a greedy assumption on any such class.
@Arham-Tahir64

Arham-Tahir64 commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Independent aggregation-boundary finding at head c7c68f89e020f9e62f38514afdfc99dda01430d4 (work in progress, canonical claim):

The selected invoice has 144 calls, W=14336, and aggregate idle mass 237024 = 144*1646. Its actual idle histogram {1:2276,3:377,7:7,48:4866} already has nonintegral normalized counts after division by 144. Aggregate integrality therefore does not supply an integral per-call histogram.

At the published upper endpoint a=0.001688603446527, the aggregate integer histogram {51:4647,27:1}, already proved optimal in PR1685's retained package, obeys the aggregate mass/guard constraints and gives a complete moment enclosed near 0.999995815381823361 < 1. This includes all 144*local paid children. In comparison 144*{51:32,14:1} gives 1.00000000000000178 > 1. Both signs are certified by the unchanged exact ceiling.py intervals, not by those rounded displays.

Thus the DP arithmetic can be valid for the extra restriction that each call separately receives exactly 1646 idle rank units, but its stronger ceiling does not follow for every packing allowed by the predecessor's aggregate relaxation. Normalizing an integer aggregate invoice creates rational averages. Likewise, a fractional average mass in the two-unpaid lever is not by itself an integer-packing impossibility.

This is a counterexample in the stated combinatorial relaxation, not a proposed physical owner packing and not a new supplier or kappa. An actual source-bound equal-mass/per-call decomposition theorem could justify the narrower domain, but that obligation needs to be explicit. I am preparing a small reproducible audit rather than altering this PR or frozen inputs. Credit remains with your DP, Penguin/OpenAI–Maximus Putnam's aggregate optimum, Douglas Colkitt/Claude's exact arithmetic and the selected construction lineage. Substantial OpenAI Codex assistance at Arham Tahir's direction.

Published follow-up: PR3747, exact head 98847f9aba65ba835a15725c9f173c04a98788b3, now retains the source-bound audit, corrected fixed-144-call root bracket (0.001690044548222, 0.001690044548223), a separate exact positive-binomial sign check and reproducible failure controls. Final finding and remaining physical obligation. This preserves the distinction between a valid equal-mass-per-call DP result and the stronger aggregate/physical scope claim.

petalas added a commit to petalas/integer-mult-bounds that referenced this pull request Oct 19, 2026
…ckages

Numeric cross-checks against open peers: the shared inherited ceiling
0.001690054109089 lies inside the baseline bracket; CrocSwap#3729's attained integer
ceiling sits below it and its 0.0858% integrality-loss column recomputes
against the grid cap; CrocSwap#3799's 8.0916x full-elimination ratio reproduces;
CrocSwap#3805's quoted kappa bound matches to 12 decimals; CrocSwap#3811's cap-8 integer-idle
row and cap-16 parent-row control are directionally and transitively consistent.
No package data changed; RESULT.json unchanged and verify still passes.
Mister-Meeseeks pushed a commit that referenced this pull request Oct 20, 2026
PRs #3737, #3747 and #3749 independently reach the same aggregate-versus-per-call
contrast on the baseline unpaid=1 word, so credit for that observation is theirs.
Note the overlap and state plainly that the unpaid=2 integrality rescue in Result 2
is the part none of them covers: #3729 reports that premise as admitting no integer
packing at all, which holds per call and fails pooled.
@rcfc-jreed

Copy link
Copy Markdown
Contributor

Independent scoped audit of the integer idle-histogram ceiling package at c7c68f89: no defect found in the finite Fraction / histogram / control layer

Code-disjoint reimplementation; does not import package verify.py / integrality.py / ceiling.py. Package bytes from head c7c68f89e020f9e62f38514afdfc99dda01430d4 via GitHub contents API. CLAIM. Package pins base_commit to 20ecf289…. Remote SOURCES inputs and live DP enclosure arithmetic against ceiling.py were not re-fetched/re-run.

What passes (13 of 13):

  1. Pins / honesty. VERIFY ready; RESULT PASS_COMPLEX_IDLE_INTEGRALITY_CEILING; README no new κ.
  2. Ceilings. Fractional a=1690054109089/1e15 > integer 1688603446527/1e15; gap 1450662562/1e15; witnessed-below is one 1e-15 ulp under the integer ceiling.
  3. Histogram. Idle mass 1646, R=51, m=73; optimum {51:32,14:1}; largest-first greedy recovers it; fractional ideal is 1646/51 rank-51 children.
  4. Controls. Nine 'yes' strings; mass/ranks flags; DP↔exhaustive on (30,7)/(36,8)/(45,9); two-unpaid mass 13918/9 non-integer.

Not covered: live verify re-execution; remote certificate/audit/ceiling.py auth; certified outward-rounded moment enclosures; new κ.

This is a finite replay of committed receipts, not a formal proof.

check_3729.py
#!/usr/bin/env python3
"""Independent finite controls for PR3729 (integer idle-histogram ceiling).

Recomputes Fraction ceiling identities and largest-first histogram recovery.
Does not import package verify.py / integrality.py / ceiling.py.

Package head c7c68f89e020f9e62f38514afdfc99dda01430d4 via GitHub API.
Package base_commit is 20ecf289… .

James Reed (@rcfc-jreed), with substantial AI assistance (Claude, in Cursor).
Apache-2.0.
"""
from __future__ import annotations

import argparse, json, sys
from fractions import Fraction as Q
from pathlib import Path

HEAD = "c7c68f89e020f9e62f38514afdfc99dda01430d4"
BASE = "20ecf2891d80b5acf18d980b2164fb44ea7faa90"
results = []


def check(name, ok, detail=""):
    results.append((name, bool(ok), detail))
    print(("PASS " if ok else "FAIL ") + name + ((": " + str(detail)) if detail else ""), flush=True)
    return bool(ok)


def load(pkg, name):
    return json.loads((pkg / name).read_text(encoding="utf-8"))


def greedy_largest_first(mass: int, R: int) -> dict[int, int]:
    hist: dict[int, int] = {}
    rem = mass
    for r in range(R, 0, -1):
        n, rem = divmod(rem, r)
        if n:
            hist[r] = n
    assert rem == 0
    return hist


def run(pkg: Path):
    sources = load(pkg, "SOURCES.json")
    result = load(pkg, "RESULT.json")
    verify = load(pkg, "VERIFY.json")
    task = load(pkg, "TASK.json")

    check("I1 SOURCES/TASK base_commit == 20ecf289…; VERIFY ready",
          sources["base_commit"] == BASE == task["base_commit"]
          and verify["status"] == "ready")
    readme = (pkg / "README.md").read_text()
    check("I2 RESULT PASS_COMPLEX_IDLE_INTEGRALITY_CEILING; README says no new κ",
          result["status"] == "PASS_COMPLEX_IDLE_INTEGRALITY_CEILING"
          and ("No new κ" in readme or "no new κ" in readme.lower()))

    ic = result["integer_ceiling"]
    fc = result["fractional_relaxation_ceiling"]
    model = result["model"]
    ai = Q(ic["a_ceiling"])
    af = Q(fc["a_ceiling"])
    check("C1 fractional a_ceiling 1690054109089/1e15 > integer 1688603446527/1e15",
          af == Q(1690054109089, 10**15)
          and ai == Q(1688603446527, 10**15)
          and af > ai)
    check("C2 integrality gap af-ai == 1450662562/1e15 matches recorded relaxation_minus_integer_a",
          af - ai == Q(1450662562, 10**15)
          and abs(float(af - ai) - float(result["comparison"]["relaxation_minus_integer_a"])) < 1e-18)
    below = Q(ic["a_witnessed_below"])
    check("C3 a_witnessed_below == ai − 1/1e15 (strictly below integer ceiling)",
          below == ai - Q(1, 10**15) == Q(844301723263, 5 * 10**14))

    hist = {int(k): int(v) for k, v in ic["optimal_idle_histogram"].items()}
    mass = int(model["idle_mass_per_call"])
    R = int(model["idle_rank_cap"])
    check("H1 model idle_mass=1646, R=51, m=73; histogram mass conserved",
          mass == 1646 and R == 51 and model["m"] == 73
          and sum(r * n for r, n in hist.items()) == mass
          and hist == {14: 1, 51: 32}
          and max(hist) <= R)
    greedy = greedy_largest_first(mass, R)
    check("H2 largest-first greedy recovers claimed optimum {51:32, 14:1} (matches RESULT control)",
          greedy == hist
          and result["controls"]["largest_first_greedy_matches_dynamic_program"] == "yes")
    check("H3 fractional description is mass/R = 1646/51 ≈ 32.2745098039 rank-51 children",
          Q(mass, R) == Q(1646, 51)
          and "32.2745098039" in fc["optimal_idle_histogram"]
          and "rank 51" in fc["optimal_idle_histogram"])

    ctrl = result["controls"]
    yes_keys = [k for k, v in ctrl.items() if isinstance(v, str) and v == "yes"]
    check("K1 controls: 9×'yes' strings; mass/ranks true; DP↔exhaustive on (30,7)/(36,8)/(45,9); gap float present",
          len(yes_keys) == 9
          and ctrl["optimal_histogram_mass_conserved"] is True
          and ctrl["optimal_histogram_ranks_within_guard"] is True
          and isinstance(ctrl["integer_optimum_strictly_above_fractional_relaxation"], str)
          and float(ctrl["integer_optimum_strictly_above_fractional_relaxation"]) > 0
          and len(ctrl["dp_matches_exhaustive_enumeration"]) == 3
          and all(row["agrees"] is True for row in ctrl["dp_matches_exhaustive_enumeration"])
          and {(row["idle_mass"], row["rank_cap"]) for row in ctrl["dp_matches_exhaustive_enumeration"]}
          == {(30, 7), (36, 8), (45, 9)})
    check("K2 two-unpaid lever idle mass 13918/9 is explicitly non-integer (out of integer DP scope)",
          result["comparison"]["two_unpaid_coordinate_idle_mass"] == "13918/9"
          and result["comparison"]["two_unpaid_coordinate_idle_mass_is_integer"] is False
          and Q("13918/9").denominator != 1)

    check("S1 SOURCES lists 5 inputs + 1 provenance; VERIFY inputs match the five scientific inputs",
          sum(1 for f in sources["files"] if f["usage"] == "input") == 5
          and set(verify["inputs"]) == {f["path"] for f in sources["files"] if f["usage"] == "input"})
    check("N1 scope is attained-optimum idle packing under fixed local profile; remote SOURCES not re-fetched",
          "Attained-optimum" in result["scope"] or "attained" in result["scope"].lower()
          and "integer" in result["scope"].lower())

    failed = [name for name, ok, _ in results if not ok]
    print(f"\n{len(results) - len(failed)}/{len(results)} PASS", flush=True)
    if failed:
        print("FAILED:", ", ".join(failed), flush=True)
        return 1
    return 0


def main():
    ap = argparse.ArgumentParser()
    ap.add_argument("--pkg", required=True)
    ap.add_argument("--expect-head", default=HEAD)
    args = ap.parse_args()
    check("HEAD pin recorded (API fetch)", args.expect_head == HEAD, args.expect_head)
    return run(Path(args.pkg))


if __name__ == "__main__":
    sys.exit(main())

James Reed (@rcfc-jreed), with substantial AI assistance (Claude, in Cursor).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants