From 9c43cc2d4f2419bbad47ee0c158526a7f6f22d3d Mon Sep 17 00:00:00 2001 From: Quantum Pickle Date: Tue, 13 Oct 2026 23:34:50 +0200 Subject: [PATCH 1/2] Research: exact ceiling for #1094 idle rank-48 repartitions, PR1252 recount and star-move lead (no new kappa) Prices the PR1252 pair class, a disjoint-star move class (kappa 0.001672987659462603) and the ceiling over every within-group repartition (0.001673151843213755) of the 4,866 unhosted idle rank-48 children of the frozen #1094 replay. The star overlay is structurally verified, not admitted. Co-Authored-By: Claude Opus 5.5 --- .../frontier1094-idle-star-ceiling/README.md | 111 ++++++ .../RESULT.json | 174 ++++++++++ .../SOURCES.json | 54 +++ .../STAR-AUDIT.json | 42 +++ .../STAR-MOVES.json.gz | Bin 0 -> 9790 bytes .../frontier1094-idle-star-ceiling/TASK.json | 72 ++++ .../VERIFY.json | 35 ++ .../frontier1094-idle-star-ceiling/analyze.py | 324 ++++++++++++++++++ .../frontier1094-idle-star-ceiling/verify.py | 164 +++++++++ 9 files changed, 976 insertions(+) create mode 100644 research/frontier1094-idle-star-ceiling/README.md create mode 100644 research/frontier1094-idle-star-ceiling/RESULT.json create mode 100644 research/frontier1094-idle-star-ceiling/SOURCES.json create mode 100644 research/frontier1094-idle-star-ceiling/STAR-AUDIT.json create mode 100644 research/frontier1094-idle-star-ceiling/STAR-MOVES.json.gz create mode 100644 research/frontier1094-idle-star-ceiling/TASK.json create mode 100644 research/frontier1094-idle-star-ceiling/VERIFY.json create mode 100644 research/frontier1094-idle-star-ceiling/analyze.py create mode 100644 research/frontier1094-idle-star-ceiling/verify.py diff --git a/research/frontier1094-idle-star-ceiling/README.md b/research/frontier1094-idle-star-ceiling/README.md new file mode 100644 index 0000000000..025c6b7fdb --- /dev/null +++ b/research/frontier1094-idle-star-ceiling/README.md @@ -0,0 +1,111 @@ +# Idle rank-48 repartitions on #1094: exact ceiling, PR1252 recount and a star-move lead + +**Scoped finding; no new selected κ and no admitted construction.** For one named +residual subproblem of the selected #1094 packing, the idle rank-48 remainder, this +package gives an exact price ceiling, an independent recount of PR1252's matching +maximum, and the exact optimum of a broader move class with an explicit overlay. The +overlay is structurally verified but has **not** been through the controller, invoice +or strict assembly admission that PR1252 ran. The selected record, `upstream/` and +every frozen input are unchanged. + +## Object + +The frozen #1094 replay (`research/community-frontier1094-audit/selected-replay.tar.gz`, +`candidate/strict/global/hosted/IDLE-REMAINDER-FRAMES.json.gz`) has **4,866 idle +rank-48 children** that are unhosted, have no pending offset and are absent from the +T16 owner map. They lie in **1,792 (replica, port) groups** of sizes +`{1: 45, 2: 703, 3: 761, 4: 283}`. The rest of the idle remainder (hosted rank-1/3/7 +children) and all local-word children are held fixed. + +PR1252 (Gonzalo-Mier, head `1b9db2fa`) moves 3 commuting axes inside 1,825 disjoint +pairs, `48 + 48 → 45 + 51`. Its open questions ask for an independent reproduction of +the matching maximum and for coordinated moves among more than two children. + +## Result + +Exact native prices from the pinned multicold `moment`/`base_two_moment`/`outer` engines +(the price and outer recipe are PR1252's `math_support.price`, restated): + +| Profile | 48-children become | κ (native) | Gain over #1094 | Share of ceiling gain | +|---|---|---|---:|---:| +| #1094 selected | 4,866 × 48 | 0.001672660197076918 | — | 0% | +| PR1252 pair class (independent recount: **1,825**) | 1,825×45, 1,216×48, 1,825×51 | 0.001672846574134982 | 1.864e-7 | 37.9% | +| **Disjoint-star class optimum** | 796×42, 765×45, 948×48, 2,357×51 | **0.001672987659462603** | 3.275e-7 | 66.6% | +| **Ceiling: any within-group repartition** | 283×39, 761×42, 703×45, 45×48, 3,074×51 | **0.001673151843213755** | 4.916e-7 | 100% | + +Conservative prices are 0.001672660194225008 (matches the selected record), 0.001672846571282754 +(matches PR1252), 0.001672987656610135 and 0.001673151840361007. + +1. **Ceiling.** In a group of `k` such children the mass is `48k`. No child can be + deleted, because `48k > 51(k−1)` for `k ≤ 16`, and splitting a child only raises the + subadditive moment. The halving guard caps ranks at 51 (`73² > 2·51²`). The main + moment `Σ r^(1−a)` is Schur-concave at a fixed child count, so the + majorization-maximal vector `(51^(k−1), 51−3k)` minimizes it. With the outer recipe + unchanged, **no within-group repartition of these children, under any commuting rule, + can exceed κ = 0.001673151843213755**. As a control, four deterministic random + repartitions are priced and all stay below the ceiling. This bounds PR1252's + "multi-child moves" route at about **+0.00000049** κ, which is 3.4% of PR1240's + fixed-word packing headroom (κ < 0.0016872026). Larger gains need hosted or + local-word mass, which PR1240 covers, or a different word. +2. **PR1252 recount.** Under PR1252's rule, an independent per-group exhaustive + matching finds exactly **1,825** pairs. Under the same rule, this reproduces its κ + at both native and conservative precision. +3. **Star class.** A centre child sends up to 3 axes to each of several leaves, and + leaves reach 51. Every moved axis satisfies the per-axis PR1252 rule: it commutes + with all original leaf axes, every stage entry/exit X and Y, the terminal Y + translation and the terminal translations of both centre and leaf. The class + contains the pair class. The exact per-group optimum comes from enumerating set + partitions × centres with bipartite b-matching of axes, and the choice is invariant + between `a = 0.0016756` and `a = 0.01`. It yields **2,357 moves from 1,561 + centres** and κ = 0.001672987659462603. This is +1.41e-7 over PR1252 and two + thirds of the ceiling gain. The moves are in `STAR-MOVES.json.gz`. + +## Verification + +```sh +python3 -B research/frontier1094-idle-star-ceiling/analyze.py --check # ~5 s +python3 -B research/frontier1094-idle-star-ceiling/verify.py # ~2 s +python3.12 scripts/research_package.py --package research/frontier1094-idle-star-ceiling +``` + +`analyze.py --check` recomputes everything from the committed replay archive and +requires byte-identical `RESULT.json` and star payloads. Each price asserts acceptance +at its exact endpoint, rejection at endpoint+1e-24, all 47 strict outer constraints, +and rejection of the next 1e-18 κ grid point. `verify.py` does not import +`analyze.py`. It re-derives every move's commuting conditions and checks the orthonormal +resulting axis sets, unchanged per-group axis multisets (hence each group's Z4 phase +polynomial), disjoint stars, the rank cap, the absence of hosted and owner children, and +the profile. Seven mutation controls must be rejected: a non-commuting axis, an axis +moved twice, a reused leaf, a rank-52 leaf, a foreign axis, a hosted leaf and a centre +that is also a leaf. Its receipt is `STAR-AUDIT.json`. + +**Not checked:** the serialized controller/owner audit, the mixed-provider invoice and +the strict global assembly with its negative controls, for the star overlay. The +soundness of composing PR1252 transfers into stars is inherited from PR1252's pair +argument and not proved here (see the open questions). The all-size compiler, +common-label/mutable-source realization, hosting, precision/tape and analytic-transfer +obligations of the selected record remain conditional. + +## Open next questions + +The structured list is in [TASK.json](TASK.json): + +- **Admission of the star overlay.** Generalize PR1252's `audit_allcold_idle_overlay.py` + from pairs to `(centre, leaf, moved_axes)` records, re-pin the SPEC and rerun its + controller and assembly controls. This is blocked on PR1252 being unmerged. +- **Contract for multi-leaf moves.** Does a moved idle axis need to commute with + anything beyond the donor and receiver? The first step is to state the controller + contract. +- **Stacking on stronger words.** Apply the same analysis to the idle remainders of the + open X54 / mixed-T37 candidates (PR1218/PR1261, κ ≈ 0.0016758), since the gain is + additive in the moment. + +## Credit + +Gonzalo-Mier's PR1252 provides the move, the commuting rule and the pricing recipe, and +its open questions define this scope. The #1094 replay, T16 owner map and engines are +those of the selected review and its retained supplier ancestry. PR1240 (Douglas Colkitt) +provides the broader fixed-word packing ceiling. Coordination is in +[Discussion #1265](https://github.com/CrocSwap/integer-mult-bounds/discussions/1265). +This package was prepared in a donated session (GitHub: PatatePatatePatate) with +substantial Claude (Anthropic) assistance. Apache-2.0. diff --git a/research/frontier1094-idle-star-ceiling/RESULT.json b/research/frontier1094-idle-star-ceiling/RESULT.json new file mode 100644 index 0000000000..c167053e7a --- /dev/null +++ b/research/frontier1094-idle-star-ceiling/RESULT.json @@ -0,0 +1,174 @@ +{ + "status": "PASS_IDLE48_REPARTITION_CEILING", + "replay_archive": { + "research/community-frontier1094-audit/selected-replay.tar.gz": "f1da80610bf33c58527f18ad63b4350d0b864e1d4486141ee17ac9bed4d529d6" + }, + "inputs": { + "hosted/IDLE-REMAINDER-FRAMES.json.gz": "650c14a1de75015fdae5c02ea18f1d0fd2de35d249b5ff2cd77f3b1afe604985", + "base/work/complex-nine-native/DATA-PHASES.json": "c5916ff312678f12aba403847643fbbc29f643acec60bdf836fa56cd3e8251fa", + "audit/OWNERS-AND-PROFILE.json": "30bafff060afcfb3644e951214d66cfaffe58242881c652e28003958b42127cc", + "research/complex-t16-rare-pattern-exchanges/OWNERS.json.gz": "87902c528dfab7d503dcf8a784260e3ab6fb7424c418a1820f7261f25be7b6bc", + "research/community-frontier1094-audit/ASSEMBLY.json": "1122cb3a575f8c788345fc1bf4c108ac7c3250fb81a5988671f5eb04b3ab3045" + }, + "eligible_children": 4866, + "owner_slot_rank48_children": 0, + "groups": 1792, + "group_size_histogram": { + "1": 45, + "2": 703, + "3": 761, + "4": 283 + }, + "pair_class_maximum_pairs": 1825, + "star_vector_invariant_between_a": [ + 0.0016756, + 0.01 + ], + "star_vector_invariant": true, + "star_rank_histogram": { + "42": 796, + "45": 765, + "48": 948, + "51": 2357 + }, + "relaxation_rank_histogram": { + "39": 283, + "42": 761, + "45": 703, + "48": 45, + "51": 3074 + }, + "profiles": { + "baseline_1094": { + "1": 349604, + "2": 60192, + "3": 62585, + "4": 20448, + "5": 11808, + "7": 7, + "8": 1152, + "48": 4866 + }, + "pair_class_max (PR1252 rule, independent recount)": { + "1": 349604, + "2": 60192, + "3": 62585, + "4": 20448, + "5": 11808, + "7": 7, + "8": 1152, + "45": 1825, + "48": 1216, + "51": 1825 + }, + "star_class_optimum": { + "1": 349604, + "2": 60192, + "3": 62585, + "4": 20448, + "5": 11808, + "7": 7, + "8": 1152, + "42": 796, + "45": 765, + "48": 948, + "51": 2357 + }, + "relaxation_ceiling": { + "1": 349604, + "2": 60192, + "3": 62585, + "4": 20448, + "5": 11808, + "7": 7, + "8": 1152, + "39": 283, + "42": 761, + "45": 703, + "48": 45, + "51": 3074 + } + }, + "prices": { + "baseline_1094": { + "native": { + "endpoint": "67018507072324140917/40000000000000000000000", + "endpoint_decimal": "0.001675462676808103522925", + "kappa": "836330098538459/500000000000000000", + "kappa_decimal": "0.001672660197076918" + }, + "conservative": { + "endpoint": "1675462673946628390003/1000000000000000000000000", + "endpoint_decimal": "0.001675462673946628390003", + "kappa": "104541262139063/62500000000000000", + "kappa_decimal": "0.001672660194225008" + } + }, + "pair_class_max (PR1252 rule, independent recount)": { + "native": { + "endpoint": "104728104934992539263/62500000000000000000000", + "endpoint_decimal": "0.001675649678959880628208", + "kappa": "836423287067491/500000000000000000", + "kappa_decimal": "0.001672846574134982" + }, + "conservative": { + "endpoint": "1675649676098086086493/1000000000000000000000000", + "endpoint_decimal": "0.001675649676098086086493", + "kappa": "836423285641377/500000000000000000", + "kappa_decimal": "0.001672846571282754" + } + }, + "star_class_optimum": { + "native": { + "endpoint": "1675791237522814605259/1000000000000000000000000", + "endpoint_decimal": "0.001675791237522814605259", + "kappa": "1672987659462603/1000000000000000000", + "kappa_decimal": "0.001672987659462603" + }, + "conservative": { + "endpoint": "167579123466077825869/100000000000000000000000", + "endpoint_decimal": "0.001675791234660778258690", + "kappa": "334597531322027/200000000000000000", + "kappa_decimal": "0.001672987656610135" + } + }, + "relaxation_ceiling": { + "native": { + "endpoint": "837977986018757511763/500000000000000000000000", + "endpoint_decimal": "0.001675955972037515023526", + "kappa": "334630368642751/200000000000000000", + "kappa_decimal": "0.001673151843213755" + }, + "conservative": { + "endpoint": "1675955969175197279329/1000000000000000000000000", + "endpoint_decimal": "0.001675955969175197279329", + "kappa": "1673151840361007/1000000000000000000", + "kappa_decimal": "0.001673151840361007" + } + } + }, + "random_repartition_controls": [ + { + "max_rank": 51, + "kappa": "836429700237559/500000000000000000", + "below_ceiling": true + }, + { + "max_rank": 51, + "kappa": "836432225741851/500000000000000000", + "below_ceiling": true + }, + { + "max_rank": 51, + "kappa": "1672865883743733/1000000000000000000", + "below_ceiling": true + }, + { + "max_rank": 51, + "kappa": "418215852699067/250000000000000000", + "below_ceiling": true + } + ], + "star_moves": 2357, + "star_moves_payload_sha256": "d6d46d2acf47ce7e65434685d86a0542bed92b879579d81d5a115fa4c0f6f2dd" +} diff --git a/research/frontier1094-idle-star-ceiling/SOURCES.json b/research/frontier1094-idle-star-ceiling/SOURCES.json new file mode 100644 index 0000000000..a5eceac04d --- /dev/null +++ b/research/frontier1094-idle-star-ceiling/SOURCES.json @@ -0,0 +1,54 @@ +{ + "schema_version": 1, + "base_commit": "dadfea6e8a78ff6ba901705f87532a71c6f5bbb8", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "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/selected-replay.tar.gz", + "usage": "input", + "git_blob": "c24daf067f9c543421d89ca2eeaa4eb78a57fb6f", + "sha256": "f1da80610bf33c58527f18ad63b4350d0b864e1d4486141ee17ac9bed4d529d6" + }, + { + "path": "research/complex-k492-owner-repair/vendor/multicold/engines/base_two_moment.py", + "usage": "input", + "git_blob": "14a90fa0e788217856f070382c9e61bd7c603c61", + "sha256": "aee70c242a2f1d225528fabe2002e1564d1dc884797c07d28a831c7878ee9098" + }, + { + "path": "research/complex-k492-owner-repair/vendor/multicold/engines/moment.py", + "usage": "input", + "git_blob": "7d697cb45203fe72d97037403d6da41f71f3b7fd", + "sha256": "81cbc864e106418fc7854322746f72180cb8110ff39f74450a3b8d55a82c1482" + }, + { + "path": "research/complex-k492-owner-repair/vendor/multicold/engines/outer.py", + "usage": "input", + "git_blob": "43007488ad2c43187c77cc6798beff8b1cd76ad2", + "sha256": "c1ebb52163a7219504c728a5c2b098bf1e50bf20148a2879c5a74c3cadc7c03c" + }, + { + "path": "research/complex-t16-rare-pattern-exchanges/OWNERS.json.gz", + "usage": "input", + "git_blob": "d3ba33d7e703a3229d9fb8a360f69d2f318bbb70", + "sha256": "87902c528dfab7d503dcf8a784260e3ab6fb7424c418a1820f7261f25be7b6bc" + } + ] +} diff --git a/research/frontier1094-idle-star-ceiling/STAR-AUDIT.json b/research/frontier1094-idle-star-ceiling/STAR-AUDIT.json new file mode 100644 index 0000000000..d27bed6ed2 --- /dev/null +++ b/research/frontier1094-idle-star-ceiling/STAR-AUDIT.json @@ -0,0 +1,42 @@ +{ + "status": "PASS_INDEPENDENT_IDLE48_STAR_OVERLAY", + "moves": 2357, + "leaves": 2357, + "centres": 1561, + "profile": { + "1": 349604, + "2": 60192, + "3": 62585, + "4": 20448, + "5": 11808, + "7": 7, + "8": 1152, + "42": 796, + "45": 765, + "48": 948, + "51": 2357 + }, + "mutation_controls": { + "noncommuting_axis": "rejected", + "axis_moved_twice": "rejected", + "leaf_reused": "rejected", + "fourth_axis_rank52": "rejected", + "foreign_axis": "rejected", + "hosted_leaf": "rejected", + "centre_also_leaf": "rejected" + }, + "checks": [ + "per-axis PR1252 commuting rule", + "orthonormal resulting axis sets", + "group axis multisets unchanged", + "disjoint stars, leaves <= 51", + "no owner-map slots, no hosted/pending children", + "halving guard 73^2 > 2*51^2", + "profile equals RESULT.json star_class_optimum" + ], + "not_checked": [ + "serialized controller/owner audit", + "mixed-provider invoice", + "strict global assembly and its negative controls" + ] +} diff --git a/research/frontier1094-idle-star-ceiling/STAR-MOVES.json.gz b/research/frontier1094-idle-star-ceiling/STAR-MOVES.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..f87c6ce92484528b53de5a030dfbd6615fa899be GIT binary patch literal 9790 zcmeI2WmuG3`}UC-z@fVZq(h`px=TtxkRBwZMnaSr=@BJG9DXXXP9H_YZ{{Po`%N z0iSi_(ebY=*wNO(lhcziQ8MSp&rln=HM{J_i?+u*_=oTN`|IqAK72g+MXYT8+}Y#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+g5YJ*MaW< z5Pt-w9VggNekG^I)4#_m@fP@~U-)6Y%9rAiNu2i9xTVLVHzr1m|I-qEh%SR|$a>^G)6dTK#3C(G$$`^B`8p}~(K!;8kB1$>n zkyxUYIhrfMai2SP;G#Qc%u&c@AWHGw(QP>aYG;H>Fd$Tq;AEmtg4&s(5*`q${{%$h z8G)RU6o6Qu5*`z(tDW0SQ3=k3>Yq88Qj(!|fB 45+51 matching; +3. star class: the exact optimum over disjoint stars, where a centre child + moves axes to leaves under PR1252's commuting rule, each leaf capped at 51. + +Every profile is priced with the pinned multicold engines (exact rationals). +""" +import argparse, random, tarfile, gzip, hashlib, importlib.util, json, sys +from collections import Counter, defaultdict +from fractions import Fraction as Q +from functools import lru_cache +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[2] +OUT = Path(__file__).resolve().parent +OWNER_MAP = ROOT / 'research/complex-t16-rare-pattern-exchanges/OWNERS.json.gz' +BASELINE = ROOT / 'research/community-frontier1094-audit/ASSEMBLY.json' +ENGINE_ROOT = ROOT / 'research/complex-k492-owner-repair/vendor/multicold/engines' +ENGINE_SHA256 = { + 'moment': '81cbc864e106418fc7854322746f72180cb8110ff39f74450a3b8d55a82c1482', + 'base_two_moment': 'aee70c242a2f1d225528fabe2002e1564d1dc884797c07d28a831c7878ee9098', + 'outer': 'c1ebb52163a7219504c728a5c2b098bf1e50bf20148a2879c5a74c3cadc7c03c', +} +M, W, DEFICIT, CAP = 73, 14336, 5120, 51 +PAIR = 'pair_class_max (PR1252 rule, independent recount)' + + +REPLAY_TAR = ROOT / 'research/community-frontier1094-audit/selected-replay.tar.gz' +MEMBERS = ('hosted/IDLE-REMAINDER-FRAMES.json.gz', 'base/work/complex-nine-native/DATA-PHASES.json', + 'audit/OWNERS-AND-PROFILE.json') + + +def replay_inputs(root): + """{member: raw bytes}; read from the committed selected replay unless a + pre-extracted candidate/strict/global directory is given.""" + if root is not None: + return {m: (Path(root) / m).read_bytes() for m in MEMBERS} + with tarfile.open(REPLAY_TAR) as tar: + return {m: tar.extractfile('candidate/strict/global/' + m).read() for m in MEMBERS} + + +def parse(name, raw): + return json.loads(gzip.decompress(raw) if name.endswith('.gz') else raw) + + +def sha(p): return hashlib.sha256(Path(p).read_bytes()).hexdigest() + + +def read(p): + raw = Path(p).read_bytes() + return json.loads(gzip.decompress(raw) if str(p).endswith('.gz') else raw) + + +def decimal(q, places): + return '0.' + str(q.numerator * 10**places // q.denominator).zfill(places) + + +def dot(a, b): return (a & b).bit_count() & 1 + + +def load_engine(name): + path = ENGINE_ROOT / (name + '.py') + assert sha(path) == ENGINE_SHA256[name], name + spec = importlib.util.spec_from_file_location('idlestar_' + name, path) + mod = importlib.util.module_from_spec(spec); spec.loader.exec_module(mod) + return mod + + +def price(profile, bad, baseline, eng): + """Exact complex endpoint and kappa; the outer recipe is PR1252's + math_support.price (retained #1094 recipe), re-stated here.""" + moment, base_two, outer = eng + assert M * W - sum(r * n for r, n in profile.items()) == DEFICIT + assert M * M > 2 * max(profile) ** 2 + endpoint = Q(moment.certify(profile, M, W, bad)['lower']) + for z, accept in ((endpoint, True), (endpoint + Q(1, 10**24), False)): + lo, hi = moment.moment(profile, M, W, z, bad) + blo, bhi = base_two.moment(M, W, list(profile.items()), z) + if bad: + slo, shi = base_two.moment(M, W, [(1, 32 * M * M * sum(profile.values()))], z) + blo += slo / 10**16; bhi += shi / 10**16 + assert (hi < 1 and bhi < 1) if accept else (lo > 1 and blo > 1) + bit = Q(baseline['bit_lower']); eta = beta = Q(1, 10**24) + s = min(bit, (1 - beta) * endpoint) - Q(1, 10**27) + chain = [Q(384599, 10**10)] + for _ in range(7): + old = chain[-1]; a = (1 - s) * s + s * old + gap = min(s - a, 1 - a - s, 1 - a - s * (1 - old), 1 - s) + assert old < a < s < 1 - a and gap > 0 + chain.append(a) + q = chain[-1] * (1 - 2 * eta) + ticks = (1 - eta) * q / (1 + q) * 10**18 + kappa = Q((ticks.numerator - 1) // ticks.denominator, 10**18) + bridge = {'semantic': {'C0': {'base': 2, 'exponent': 210000}, 'strict_literal_gap': 1}, + 'rows': {'degree_gap': Q(10**6) - Q(51 * 20161, 25)}} + assembled = outer.assembly(chain[-1], endpoint, bridge, kappa, eta=eta, beta=beta) + assert len(assembled['strict_constraints']) == 47 + assert all(x > 0 for x in assembled['strict_constraints'].values()) + try: + outer.assembly(chain[-1], endpoint, bridge, kappa + Q(1, 10**18), eta=eta, beta=beta) + except AssertionError: + pass + else: + raise AssertionError('next kappa grid point accepted') + return dict(endpoint=str(endpoint), endpoint_decimal=decimal(endpoint, 24), + kappa=str(kappa), kappa_decimal=decimal(kappa, 18)) + + +def group_context(rows, recipe): + ys = [int(s[k]) for s in recipe['stage_alignment'] for k in ('entry_Y', 'exit_Y')] + ys.append(int(recipe['terminal_Y_translation'])) + xs = [int(s[k]) for s in recipe['stage_alignment'] for k in ('entry_X', 'exit_X')] + stage = ys + xs + axes = [list(map(int, r['orthogonal_axes'])) for r in rows] + trans = [int(recipe['idle_children'][r['child']]['translation_after']) for r in rows] + k = len(rows) + # movable[d][l]: axes of donor d commuting with every axis of leaf l, all + # stage X/Y and terminal Y translations, and both terminal translations. + movable = [[None] * k for _ in range(k)] + for d in range(k): + for l in range(k): + if d != l: + fixed = axes[l] + stage + [trans[d], trans[l]] + movable[d][l] = frozenset(i for i, v in enumerate(axes[d]) + if all(dot(v, x) == 0 for x in fixed)) + return movable + + +def pair_edge(movable, i, j): + return len(movable[i][j]) >= 3 or len(movable[j][i]) >= 3 + + +def max_matching(k, edge): + @lru_cache(None) + def best(mask): + if not mask: return 0 + i = (mask & -mask).bit_length() - 1 + rest = mask & ~(1 << i) + value = best(rest) + for j in range(i + 1, k): + if rest >> j & 1 and edge(i, j): + value = max(value, 1 + best(rest & ~(1 << j))) + return value + return best((1 << k) - 1) + + +def star_flow(movable, centre, leaves, need): + """Max axes the centre can send: leaf l takes <= need distinct axes from + movable[centre][l]; each centre axis moves once (bipartite b-matching). + Returns {leaf: sorted centre-axis indices}.""" + slots = [(l, t) for l in leaves for t in range(need)] + match = {} + def augment(s, seen): + l = slots[s][0] + for ax in sorted(movable[centre][l]): + if ax in seen: continue + seen.add(ax) + if ax not in match or augment(match[ax], seen): + match[ax] = s; return True + return False + for s in range(len(slots)): + augment(s, set()) + sent = {l: [] for l in leaves} + for ax, s in match.items(): + sent[slots[s][0]].append(ax) + return {l: sorted(v) for l, v in sent.items()} + + +def cost(vec, a): + return sum(r ** (1 - a) for r in vec) + + +def partitions(items): + if not items: yield []; return + first, rest = items[0], items[1:] + for p in partitions(rest): + yield [[first]] + p + for i in range(len(p)): + yield p[:i] + [[first] + p[i]] + p[i + 1:] + + +def best_star(k, movable, a): + """Exact optimum of the disjoint-star class for one group at test exponent a. + + Enumerate set partitions of the k children; each block is a star with one + centre (or a singleton). Leaves receive up to CAP-48 = 3 axes from the centre. + Returns (sorted rank vector, [(centre, leaf, centre-axis indices)]).""" + best = None + for part in partitions(list(range(k))): + vec, moves = [], [] + for block in part: + if len(block) == 1: + vec.append(48); continue + options = [] + for c in block: + leaves = [x for x in block if x != c] + sent = star_flow(movable, c, leaves, CAP - 48) + v = [48 - sum(map(len, sent.values()))] + [48 + len(sent[l]) for l in leaves] + options.append((cost(v, a), v, [(c, l, sent[l]) for l in leaves if sent[l]])) + _, v, mv = min(options, key=lambda o: o[0]) + vec.extend(v); moves.extend(mv) + if best is None or cost(vec, a) < best[0] - 1e-12: + best = (cost(vec, a), sorted(vec), moves) + return best[1], best[2] + + +def main(): + ap = argparse.ArgumentParser(description=__doc__) + ap.add_argument('--replay-root', type=Path, + help='Optional extracted candidate/strict/global of selected-replay.tar.gz') + ap.add_argument('--no-price', action='store_true') + ap.add_argument('--check', action='store_true', + help='Recompute and compare with the committed RESULT.json and STAR-MOVES.json.gz; write nothing') + args = ap.parse_args() + raw = replay_inputs(args.replay_root) + frames, phases, audit = (parse(m, raw[m]) for m in MEMBERS) + owners = read(OWNER_MAP); baseline = json.loads(BASELINE.read_text()) + recipes = {x['port']: x for x in phases['recipes']} + roles = {(x['owner_replica'], x['port'], x['child']) for x in owners} + base_profile = Counter({int(k): v for k, v in audit['paid_profile'].items()}) + assert sum(r * n for r, n in base_profile.items()) == M * W - DEFICIT + + eligible, owner48 = defaultdict(list), defaultdict(list) + for row in frames: + if row['rank'] == 48 and row['hosted'] == 0 and row['pending_offset'] == 0: + key = (row['replica'], row['port'], row['child']) + (owner48 if key in roles else eligible)[row['replica'], row['port']].append(row) + n_elig = sum(map(len, eligible.values())); n_owner = sum(map(len, owner48.values())) + assert n_elig + n_owner == base_profile[48] and n_owner == 0 # owner map uses no idle 48 + sizes = Counter(len(v) for v in eligible.values()) + + a_test = 0.0016756 # near the endpoint; star choice is checked below to be a-invariant + pairs_total, relax, star = 0, Counter(), Counter() + star_alt = Counter(); star_moves = [] + for key, rows in sorted(eligible.items()): + k = len(rows) + relax.update([CAP] * (k - 1) + [48 * k - CAP * (k - 1)] if k > 1 else [48]) + movable = group_context(rows, recipes[key[1]]) + pairs_total += max_matching(k, lambda i, j: pair_edge(movable, i, j)) + vec, moves = best_star(k, movable, a_test) + star.update(vec); star_alt.update(best_star(k, movable, 0.01)[0]) + for c, l, idx in moves: + ca = list(map(int, rows[c]['orthogonal_axes'])) + star_moves.append(dict(replica=key[0], port=key[1], centre_child=rows[c]['child'], + leaf_child=rows[l]['child'], moved_axes=[str(ca[i]) for i in idx])) + + def with48(counter): + p = Counter(base_profile); p[48] -= sum(counter.values()); p.update(counter) + return {r: n for r, n in sorted((+p).items())} + + pair_profile = Counter(base_profile); pair_profile[48] -= 2 * pairs_total + pair_profile[45] += pairs_total; pair_profile[51] += pairs_total + profiles = { + 'baseline_1094': {r: n for r, n in sorted(base_profile.items())}, + PAIR: {r: n for r, n in sorted((+pair_profile).items())}, + 'star_class_optimum': with48(star), + 'relaxation_ceiling': with48(relax), + } + result = dict( + status='PASS_IDLE48_REPARTITION_CEILING', + replay_archive={str(REPLAY_TAR.relative_to(ROOT)): sha(REPLAY_TAR)}, + inputs={m: hashlib.sha256(raw[m]).hexdigest() for m in MEMBERS} + | {str(OWNER_MAP.relative_to(ROOT)): sha(OWNER_MAP), str(BASELINE.relative_to(ROOT)): sha(BASELINE)}, + eligible_children=n_elig, owner_slot_rank48_children=n_owner, + groups=len(eligible), group_size_histogram={str(k): v for k, v in sorted(sizes.items())}, + pair_class_maximum_pairs=pairs_total, + star_vector_invariant_between_a=[a_test, 0.01], star_vector_invariant=(star == star_alt), + star_rank_histogram={str(k): v for k, v in sorted(star.items())}, + relaxation_rank_histogram={str(k): v for k, v in sorted(relax.items())}, + profiles={name: {str(r): n for r, n in p.items()} for name, p in profiles.items()}, + ) + assert star == star_alt + if not args.no_price: + eng = tuple(load_engine(n) for n in ('moment', 'base_two_moment', 'outer')) + result['prices'] = {} + for name, p in profiles.items(): + result['prices'][name] = dict(native=price(p, False, baseline, eng), + conservative=price(p, True, baseline, eng)) + print(name, result['prices'][name]['native']['kappa_decimal'], file=sys.stderr) + P = {n: Q(v['native']['kappa']) for n, v in result['prices'].items()} + assert P['baseline_1094'] == Q(baseline['kappa']) + assert P['baseline_1094'] < P[PAIR] < P['star_class_optimum'] < P['relaxation_ceiling'] + # Control: deterministic random within-group repartitions (ranks in [1, 51], + # same child count and group mass) never price above the ceiling. + rng = random.Random(1094); controls = [] + for _ in range(4): + alt = Counter() + for rows in eligible.values(): + vec = [48] * len(rows) + for _ in range(6): + i, j = rng.randrange(len(vec)), rng.randrange(len(vec)) + t = min(rng.randint(0, 6), vec[i] - 1, CAP - vec[j]) if i != j else 0 + vec[i] -= t; vec[j] += t + alt.update(vec) + kap = Q(price(with48(alt), False, baseline, eng)['kappa']) + assert kap <= P['relaxation_ceiling'] + controls.append(dict(max_rank=max(alt), kappa=str(kap), below_ceiling=True)) + result['random_repartition_controls'] = controls + overlay = dict(schema='idle48-star-moves/1', source_frames_sha256=hashlib.sha256(raw[MEMBERS[0]]).hexdigest(), + moves=star_moves, profile=result['profiles']['star_class_optimum']) + payload = json.dumps(overlay, sort_keys=True, separators=(',', ':')).encode() + result['star_moves'] = len(star_moves) + result['star_moves_payload_sha256'] = hashlib.sha256(payload).hexdigest() + text = json.dumps(result, indent=2) + '\n' + if args.check: + assert (OUT / 'RESULT.json').read_text() == text, 'RESULT.json differs' + assert gzip.decompress((OUT / 'STAR-MOVES.json.gz').read_bytes()) == payload, 'STAR-MOVES differs' + print('PASS_IDLE48_REPARTITION_CEILING_RECOMPUTED', 'pairs=%d' % pairs_total) + return + gz = bytearray(gzip.compress(payload, mtime=0)); gz[9] = 255 + (OUT / 'STAR-MOVES.json.gz').write_bytes(bytes(gz)) + (OUT / 'RESULT.json').write_text(text) + print(result['status'], 'pairs=%d' % pairs_total) + + +if __name__ == '__main__': + main() diff --git a/research/frontier1094-idle-star-ceiling/verify.py b/research/frontier1094-idle-star-ceiling/verify.py new file mode 100644 index 0000000000..feb5f220df --- /dev/null +++ b/research/frontier1094-idle-star-ceiling/verify.py @@ -0,0 +1,164 @@ +#!/usr/bin/env python3 +"""Independent structural check of STAR-MOVES.json.gz against the frozen #1094 replay. + +Does not import analyze.py. For every move it re-derives, from the frozen idle +frames and DATA-PHASES recipes, the PR1252 commuting rule applied per axis: +a moved axis must be orthogonal (Z2 symplectic dot 0 as used by PR1252) to all +original leaf axes, every stage entry/exit X and Y, the terminal Y translation, +and the terminal translations of both centre and leaf. It then checks the +resulting axis sets, the group axis unions, the rank profile, the halving guard +and RESULT.json. Mutation controls must each be rejected. +""" +import argparse, tarfile, copy, gzip, hashlib, json +from collections import Counter, defaultdict +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[2] +OUT = Path(__file__).resolve().parent +OWNER_MAP = ROOT / 'research/complex-t16-rare-pattern-exchanges/OWNERS.json.gz' + + +def read(p): + raw = Path(p).read_bytes() + return json.loads(gzip.decompress(raw) if str(p).endswith('.gz') else raw) + + +REPLAY_TAR = ROOT / 'research/community-frontier1094-audit/selected-replay.tar.gz' +MEMBERS = ('hosted/IDLE-REMAINDER-FRAMES.json.gz', 'base/work/complex-nine-native/DATA-PHASES.json', + 'audit/OWNERS-AND-PROFILE.json') + + +def replay_inputs(root): + """{member: raw bytes}; read from the committed selected replay unless a + pre-extracted candidate/strict/global directory is given.""" + if root is not None: + return {m: (Path(root) / m).read_bytes() for m in MEMBERS} + with tarfile.open(REPLAY_TAR) as tar: + return {m: tar.extractfile('candidate/strict/global/' + m).read() for m in MEMBERS} + + +def parse(name, raw): + return json.loads(gzip.decompress(raw) if name.endswith('.gz') else raw) + + +def sha(p): return hashlib.sha256(Path(p).read_bytes()).hexdigest() +def dot(a, b): return (a & b).bit_count() & 1 + + +def gf2_rank(vs): + piv = {} + for x in vs: + while x: + b = x.bit_length() - 1 + if b in piv: x ^= piv[b] + else: piv[b] = x; break + return len(piv) + + +def check(moves, frames, recipes, roles, base_profile): + old = {(r['replica'], r['port'], r['child']): r for r in frames} + axes = {k: [int(v) for v in r['orthogonal_axes']] for k, r in old.items()} + new = {k: list(v) for k, v in axes.items()} + centres, leaves, moved_ids = set(), Counter(), set() + for m in moves: + rep, port = m['replica'], m['port'] + c, l = (rep, port, m['centre_child']), (rep, port, m['leaf_child']) + assert c != l and c in old and l in old + for k in (c, l): + r = old[k] + assert r['rank'] == 48 and r['hosted'] == 0 and r['pending_offset'] == 0 + assert k not in roles + centres.add(c); leaves[l] += 1 + rec = recipes[port] + fixed = ([int(s[q]) for s in rec['stage_alignment'] for q in ('entry_Y', 'exit_Y', 'entry_X', 'exit_X')] + + [int(rec['terminal_Y_translation'])] + + [int(rec['idle_children'][k[2]]['translation_after']) for k in (c, l)]) + mv = [int(v) for v in m['moved_axes']] + assert 1 <= len(mv) <= 3 + for v in mv: + assert v in axes[c] and (c, v) not in moved_ids + moved_ids.add((c, v)) + assert all(dot(v, x) == 0 for x in axes[l] + fixed) + new[c].remove(v); new[l].append(v) + assert not (centres & set(leaves)) and max(leaves.values()) == 1 # disjoint stars + groups = defaultdict(lambda: [Counter(), Counter()]) + for k in old: + a = new[k] + assert all(dot(x, y) == (i == j) for i, x in enumerate(a) for j, y in enumerate(a)) + assert gf2_rank(a) == len(a) and 1 <= len(a) <= 51 + groups[k[:2]][0].update(axes[k]); groups[k[:2]][1].update(a) + assert all(u == v for u, v in groups.values()) # group axis multiset unchanged + profile = Counter(base_profile) + profile.subtract(len(axes[k]) for k in old); profile.update(len(new[k]) for k in old) + profile = +profile + assert 73 ** 2 > 2 * max(profile) ** 2 + return {str(r): n for r, n in sorted(profile.items())}, len(set(leaves)), len(centres) + + +def main(): + ap = argparse.ArgumentParser(description=__doc__) + ap.add_argument('--replay-root', type=Path, + help='Optional extracted candidate/strict/global of selected-replay.tar.gz') + raw = replay_inputs(ap.parse_args().replay_root) + result = json.loads((OUT / 'RESULT.json').read_text()) + overlay = read(OUT / 'STAR-MOVES.json.gz') + for m in MEMBERS: + assert result['inputs'][m] == hashlib.sha256(raw[m]).hexdigest(), m + assert result['inputs'][str(OWNER_MAP.relative_to(ROOT))] == sha(OWNER_MAP) + assert overlay['source_frames_sha256'] == result['inputs'][MEMBERS[0]] + frames = parse(MEMBERS[0], raw[MEMBERS[0]]) + recipes = {x['port']: x for x in parse(MEMBERS[1], raw[MEMBERS[1]])['recipes']} + roles = {(x['owner_replica'], x['port'], x['child']) for x in read(OWNER_MAP)} + base = Counter({int(k): v for k, v in parse(MEMBERS[2], raw[MEMBERS[2]])['paid_profile'].items()}) + moves = overlay['moves'] + profile, n_leaves, n_centres = check(moves, frames, recipes, roles, base) + assert profile == overlay['profile'] == result['profiles']['star_class_optimum'] + assert n_leaves == len(moves) == result['star_moves'] + + # Mutation controls: each must be rejected. + def first_noncommuting(): + m = moves[0]; rep, port = m['replica'], m['port'] + rows = {r['child']: r for r in frames if (r['replica'], r['port']) == (rep, port)} + leaf = [int(v) for v in rows[m['leaf_child']]['orthogonal_axes']] + for v in rows[m['centre_child']]['orthogonal_axes']: + if any(dot(int(v), x) for x in leaf): return str(v) + bad = first_noncommuting() + controls = {} + def mutate(name, fn): + mm = copy.deepcopy(moves); fn(mm) + try: + check(mm, frames, recipes, roles, base) + except (AssertionError, KeyError, ValueError): + controls[name] = 'rejected' + else: + controls[name] = 'ACCEPTED' + mutate('noncommuting_axis', lambda mm: mm[0]['moved_axes'].__setitem__(0, bad)) + by_centre = defaultdict(list) + for i, m in enumerate(moves): + by_centre[m['replica'], m['port'], m['centre_child']].append(i) + i, j = next(v for v in by_centre.values() if len(v) >= 2)[:2] + hosted_leaf = next((r['replica'], r['port'], r['child']) for r in frames if r['hosted'] > 0) + mutate('axis_moved_twice', lambda mm: mm[j].__setitem__('moved_axes', list(mm[i]['moved_axes']))) + mutate('leaf_reused', lambda mm: mm[j].__setitem__('leaf_child', mm[i]['leaf_child'])) + mutate('fourth_axis_rank52', lambda mm: (mm[i]['moved_axes'].append(mm[j]['moved_axes'].pop()))) + mutate('foreign_axis', lambda mm: mm[0]['moved_axes'].__setitem__(0, str(1 << 72 | 1))) + mutate('hosted_leaf', lambda mm: mm[0].update(replica=hosted_leaf[0], port=hosted_leaf[1], + leaf_child=hosted_leaf[2])) + mutate('centre_also_leaf', lambda mm: mm.append(dict(mm[i], centre_child=mm[i]['leaf_child'], + leaf_child=mm[i]['centre_child']))) + assert all(v == 'rejected' for v in controls.values()), controls + receipt = dict(status='PASS_INDEPENDENT_IDLE48_STAR_OVERLAY', moves=len(moves), + leaves=n_leaves, centres=n_centres, profile=profile, mutation_controls=controls, + checks=['per-axis PR1252 commuting rule', 'orthonormal resulting axis sets', + 'group axis multisets unchanged', 'disjoint stars, leaves <= 51', + 'no owner-map slots, no hosted/pending children', 'halving guard 73^2 > 2*51^2', + 'profile equals RESULT.json star_class_optimum'], + not_checked=['serialized controller/owner audit', 'mixed-provider invoice', + 'strict global assembly and its negative controls']) + (OUT / 'STAR-AUDIT.json').write_text(json.dumps(receipt, indent=2) + '\n') + print(receipt['status'], 'moves=%d' % len(moves), 'controls=%d/%d rejected' % ( + sum(v == 'rejected' for v in controls.values()), len(controls))) + + +if __name__ == '__main__': + main() From 588425ebfc307dea3a94db9ba4bd4a3c74141b55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=A9orgui=20Maissouradze?= Date: Tue, 13 Oct 2026 23:41:47 +0200 Subject: [PATCH 2/2] =?UTF-8?q?Attribute=20frontier1094-idle-star-ceiling?= =?UTF-8?q?=20to=20Gu=C3=A9orgui=20Maissouradze?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- research/frontier1094-idle-star-ceiling/README.md | 2 +- research/frontier1094-idle-star-ceiling/TASK.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/research/frontier1094-idle-star-ceiling/README.md b/research/frontier1094-idle-star-ceiling/README.md index 025c6b7fdb..dc62e45699 100644 --- a/research/frontier1094-idle-star-ceiling/README.md +++ b/research/frontier1094-idle-star-ceiling/README.md @@ -107,5 +107,5 @@ its open questions define this scope. The #1094 replay, T16 owner map and engine those of the selected review and its retained supplier ancestry. PR1240 (Douglas Colkitt) provides the broader fixed-word packing ceiling. Coordination is in [Discussion #1265](https://github.com/CrocSwap/integer-mult-bounds/discussions/1265). -This package was prepared in a donated session (GitHub: PatatePatatePatate) with +This package was prepared by Guéorgui Maissouradze (GitHub: PatatePatatePatate) with substantial Claude (Anthropic) assistance. Apache-2.0. diff --git a/research/frontier1094-idle-star-ceiling/TASK.json b/research/frontier1094-idle-star-ceiling/TASK.json index 385170abc7..60e155b655 100644 --- a/research/frontier1094-idle-star-ceiling/TASK.json +++ b/research/frontier1094-idle-star-ceiling/TASK.json @@ -47,7 +47,7 @@ "stop_rule": "Stop after the class ceiling, the exact star optimum and a structural verifier; do not attempt controller/invoice/assembly admission for the star overlay in this session.", "outcome": "partial", "evidence": "RESULT.json (exact prices of baseline, PR1252 pair class, star optimum, relaxation ceiling; 4 random repartition controls), STAR-MOVES.json.gz (2,357 explicit moves), STAR-AUDIT.json (independent verifier, 7/7 mutation controls rejected).", - "author": "PatatePatatePatate (donated session, Claude assistance)", + "author": "Guéorgui Maissouradze / PatatePatatePatate", "ai_assistance": "Substantial Claude (Anthropic, Claude Code, Opus 5.5) assistance in derivation, implementation, verification and documentation; directed in a donated session.", "open_questions": [ {