diff --git a/research/rank8-u2-entrance-obstruction/README.md b/research/rank8-u2-entrance-obstruction/README.md new file mode 100644 index 0000000000..61d5b703e1 --- /dev/null +++ b/research/rank8-u2-entrance-obstruction/README.md @@ -0,0 +1,202 @@ +# Monotone entrances miss the rank-8/u2 16-child cell + +**Negative result. No new κ.** The selected conditional exponent stays +`60403/20000000` (`0.00302015`). This package does not touch that record. + +The integer cell in ToikY's `research/lever-integer-twins` puts paid mass +5586 at `{8:698, 2:1}` on every call, with two unpaid coordinates and centre +charge 64. On nine calls its pooled idle is `{51:272, 46:1}`, and the moment +at `a = 1/98` still passes after 16 added rank-1 children and fails at 17. +That 16-child margin is a budget for a physical producer, not a producer. +The question left open by `research/rank8-u2-split-boundary` is whether any +literal local word has this paid profile. On the selected register file, no +monotone nested frame word of mass 5586 and rank at most 8 meets the moment +at all. + +## Contract + +Frames are subspaces of \(\mathbb{F}_2^9\). A monotone register chain climbs +from its pinned entrance to an exit inside the legal terminal, and the climb +ranks are positive integers summing to at most \(\dim(\mathrm{exit}) - +\dim(\mathrm{entrance})\). One chain therefore holds at most one part of size +8, because the room is at most 9. The selected local word fixes the entrances +and the register file: + +| Registers | Count | Entrance | Maximum exit | Room | +|---|---:|---|---|---:| +| Sources | 112 | the port line, dimension 1 | FULL, dimension 9 | 8 | +| Targets | 112 | 0 | the port parity hyperplane, dimension 8 | 8 | +| Helpers with entrance 0 | 288 | 0 | FULL | 9 | +| Helpers with entrance 1 | 136 | dimension 1 | FULL | 8 | +| Helpers with entrance 4 | 32 | dimension 4 | FULL | 5 | +| Helpers with entrance 5 | 24 | dimension 5 | FULL | 4 | + +There are 648 rooms of size at least 8, 32 of size 5 and 24 of size 4. +Raising a target exit from the parity hyperplane to FULL adds residual room +but no eighth rank-8 slot, and it does not change the histogram below. + +## Result + +The minimum-cost histogram of mass 5586 with parts at most 8 that fits these +rooms is + +```text +{8:648, 5:32, 4:24, 1:146}. +``` + +Its nine-call moment at `a = 1/98`, with the optimal pooled idle +`{51:272, 46:1}`, has certified bounds strictly above 1. The ideal cell is +not among the feasible histograms: it needs 698 rank-8 children and the file +has 648 monotone slots. The same checker reproduces the published control on +`{8:698, 2:1}`: 16 added rank-1 children still pass and 17 fail. + +A comparison that is not a monotone word grants each of the eight centre +registers three rank-8 steps (room 24 instead of 8 or 9). The cheapest +histogram in that larger model is `{8:664, 5:32, 4:24, 1:18}`. Its bare +pooled moment is below 1, and one added rank-1 child on the nine-call total +pushes it above 1. The 16-child margin is not available there either. + +## Why this histogram is the monotone minimum + +Let \(f(r) = (r/73)^{97/98}\) for \(r \ge 1\) and \(f(0) = 0\). The child cost +at \(a = 1/98\) is \(f(r)\). The pinned enclosures separate two strict +inequalities on \(\{1,\ldots,8\}\): + +- merging: \(f(x) + f(y) > f(x+y)\) whenever \(x, y \ge 1\) and \(x+y \le 8\); +- transfer: \(f(x) + f(y) > f(x-1) + f(y+1)\) whenever \(1 \le x \le y\) and + \(y+1 \le 8\), with \(f(0) = 0\) when \(x = 1\). + +Every composition of 8 into at least two positive parts is therefore strictly +more expensive than one part of size 8. Any feasible assignment that uses +fewer than 648 eights still has at least 8 units of mass in smaller parts and +a large register that is not holding an 8. Gathering those units into one 8 +strictly lowers the cost. So every minimum uses exactly 648 eights, and the +remaining mass is 402. + +That remainder has to sit in the 32 rooms of size 5, the 24 rooms of size 4, +and the single leftover slot of a room that already holds an 8. No leftover +slot has size greater than 1, and a room of size 5 or 4 cannot hold a 7. +Filling the size-5 and size-4 rooms with one part each, then placing the last +146 units as ones, is the unique minimum: splitting a 5 or a 4 raises the +cost by the merge inequality. The resulting moment is already above 1, before +any additive rank-1 surcharge and before integer idle is replaced by anything +worse than the pooled histogram. + +## What was not shown + +Non-monotone paths, extra registers, changed entrances and a different +template are outside this certificate. Unknown restoration, precision and +consumer costs are not zero. The three-step centre comparison is only an +upper model on the same eight centre indices; it is not a scalar word. The +obstruction is about this entrance file and the older \(u = 2\) planning cell. +It is not a statement about the #4470 productive-helper invoice, and it does +not move the selected exponent. + +The family split in `research/rank8-u2-split-boundary` still applies to the +ideal histogram. It does not create a 649th monotone rank-8 slot. + +## Scope + +Card `complex-new-helper-inventory`, priority revision 7, base +`ff3cc58e370d0f678e529246f8c73e8094e18fcf`. Scope status is **refined**. The +card asks for a new inventory with a favorable full bill. The bounded question +here is the literal rank-at-most-8 producer inside the 16-child slack. The +answer on these entrances is that the monotone minimum already fails +\(a = 1/98\). + +Ordered eligible list for session r31, rebuilt on 2026-10-23 against +`ff3cc58e370d0f678e529246f8c73e8094e18fcf`. The order is the one recorded in +`research/f2-six-difference-basis`: open handoffs from the 19 October index, +then priority-table rows whose stated next decision is still open, then +catalogue cards that are not already one of those rows. Dropped before the +cut: work this account already delivered, questions closed on current main, +questions covered by an open pull request, and topics already on a fork +`cursor/*` branch. + +1. Consumer of `(w, q, v_N)` (discussion comment 19030045), distinct from the + encoded-exit and `(N-P)⊗M` consumers. +2. Fresh T385 wrapper completion (comment 19030047), distinct from the reverse + coefficient and from the merged compiler integration. +3. Six-tape head-move bill for the `L546` addition (comment 19030049), + distinct from the F0 magnitude ledger and from #4162. +4. `BIT.md` weighted-leaf and fixed-tape induction. The `2^{-4p}` sentence, + the row-field pad, the uniform evaluator constant and the shared-arena axis + are already delivered. +5. Four-provider ordinary/outer rebind. The idle-cost block is recorded; the + four-id rebind is not. +6. Matched park/restore bill for the #4166 caller. Open #4167 does not price + that comparison. +7. R437 fixed-tape and parking bill. The reverse coefficient is excluded. +8. `#4091` model equivalence on the later 1090-call fill. +9. This package. + +The retiming handoff (comment 19030053) stays dropped because #4122, #4128 and +open #4567 already address it. `p104-side-correction` is not a separate row: +item 1 is that consumer, and the slot, chart, encoding and fiber gaps are +certified. `formal-interface-lemma`, `bit-helper-contract`, +`bit-new-register-model`, `complex-rank-shape-decoder`, `centre-path-sharing`, +`connector-alphabet-change`, and the stock, census, replay, packing and +scalar-itinerary cards stay dropped for the same reasons already recorded on +the difference-basis package, plus this account's later deliveries through +#4651. + +This is open question 2 of `research/rank8-u2-split-boundary`. Question 1 of +that package, the census of family splits that still pass 16 extra rank-1 +children, is a different refinement of #4151 and is not answered here. +`research/rank8-u2-plane-port-slack` and `research/selected-k8-child-rank-bound` +likewise leave the literal producer open. A cached overlap search on +2026-10-23 (307 open pull requests, 4479 discussion records) did not find +another note stating the histogram `{8:648, 5:32, 4:24, 1:146}`. Same-day +fork branches for the L546 six-tape bill, the R437 parent blank-return, the +shared chart-1 centre visit, the SOURCE87 fibre count and the #4091 1090-call +ceiling price other rows of this list. + +## Reproduce + +Python 3.12, standard library only, from the repository root: + +```sh +python3 -B research/rank8-u2-entrance-obstruction/verify.py +python3 -B scripts/research_package.py --package research/rank8-u2-entrance-obstruction +``` + +Expected line: + +```text +PASS_RANK8_U2_ENTRANCE_OBSTRUCTION slots=648 monotone=GT/0 centre3=LT/0/GT/1 ideal=LT/16/GT/17 no_new_kappa +``` + +The checker hashes the word gzip, the decompressed word and `ceiling.py`, +rebuilds the 704 entrance rooms, packs both histograms, and separates every +merge and transfer inequality on ranks `1..8` by the pinned outward +enclosures. Not run: Lean, Docker, the selected cold replay, and any search +for a non-monotone scalar word. + +## Open next questions + +1. Can one centre register legally emit three rank-8 steps without an added + rank-1 child? The arithmetic room of that comparison is zero: the bare + moment passes and one aggregate rank-1 child fails. A legal trace would + still need a changed path law. The first step is one explicit up, down, up + frame trace and its own paid histogram. The standing monotone contract is + the blocker. +2. Do the #4470 productive-helper frames have at least as many monotone + rank-8 slots as that invoice demands? This certificate does not read that + word. The first step is the same entrance count on the #4470 complex + frames, and the blocker is that the two templates must not be mixed. + +## Credit + +The 16/17 integer boundary and the cell `{8:698, 2:1}` are ToikY's +`research/lever-integer-twins`, following Nick Petalas's PR #3874. The +entrance fields and the \(\mathbb{F}_2^9\) frame contract are the selected k8 +word in `research/r480-owner-optimum`, as read by the frame-ceiling line +(PR #1671, Gareth Davidson, using navinor's frame method). The child-cost +enclosures are Douglas Colkitt's `research/complex-local-word-ceiling`, with +Claude assistance. The coverage identity is PR #1012. The split dependence of +the ideal slack is `research/rank8-u2-split-boundary`; this note does not +recompute those three family splits. The plane-port screen that already misses +the same slack is `research/rank8-u2-plane-port-slack`. + +Prepared by unpaidmoon with substantial Cursor Grok assistance. Apache-2.0. +No independent human review and no formal-kernel acceptance are claimed. diff --git a/research/rank8-u2-entrance-obstruction/SOURCES.json b/research/rank8-u2-entrance-obstruction/SOURCES.json new file mode 100644 index 0000000000..2e0e38e6cf --- /dev/null +++ b/research/rank8-u2-entrance-obstruction/SOURCES.json @@ -0,0 +1,30 @@ +{ + "schema_version": 1, + "base_commit": "ff3cc58e370d0f678e529246f8c73e8094e18fcf", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "c35482cd9035843b15a634cc8276a7e1e40e8395", + "sha256": "6fe0a099b89aa2aed796a13c3a21dafc63f3388ebf397464e44e0451893b9375" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "f126dd2e2dad2b669e75d1d0d0bd05c600725602", + "sha256": "f7a48bfa2659b88378282a8eee7d9fe52cdf505594124c4d1686b58510fffd72" + }, + { + "path": "research/complex-local-word-ceiling/ceiling.py", + "usage": "input", + "git_blob": "6c0f54527d879396f689523bfde19928a9b6157c", + "sha256": "86a1432870b3b21d8454106ec9162fddc0471472d9214c590a1420f2426cedfc" + }, + { + "path": "research/r480-owner-optimum/inputs/local/FULL-WORD.json.gz", + "usage": "input", + "git_blob": "723decbca8995e916d6f4b783aa3e1ddd4eb47fe", + "sha256": "49596aa4ed4fd36cd4582fd0e8ddeb09fd80370a7d8aea1ede52a135b536d289" + } + ] +} diff --git a/research/rank8-u2-entrance-obstruction/TASK.json b/research/rank8-u2-entrance-obstruction/TASK.json new file mode 100644 index 0000000000..c367867263 --- /dev/null +++ b/research/rank8-u2-entrance-obstruction/TASK.json @@ -0,0 +1,72 @@ +{ + "schema_version": 1, + "task_id": "complex-new-helper-inventory", + "priority_revision": 7, + "base_commit": "ff3cc58e370d0f678e529246f8c73e8094e18fcf", + "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": [ + "docs/research/research-family-status.md", + "research/complex-local-word-ceiling/README.md", + "research/heterogeneous-owner-assembly/README.md", + "certificates/selected-result.json", + "research/selected-k8-unrestricted-ends/README.md" + ], + "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 outside the frozen catalogue whose per-call profile, screened with ceiling.ceiling(), beats the selected word's packing ceiling; a lower cap does not establish identical circuitry or order attainable optima, and is insufficient to pass the stronger-budget target under this model. A scoped local result may be retained without a complete supplier. Expanding it into further construction rounds requires the family-level budget and obligation gate in research-family-status.md; an optimistic passing relaxation alone is not acceptance.", + "first_step": { + "command": [ + "python3", + "-B", + "research/complex-local-word-ceiling/verify.py" + ], + "expected": "PASS_COMPLEX_LOCAL_WORD_CEILING", + "inspect": "Read the selected word's per-call local profile, its packing ceiling and the lever table; run levers.py for the ideal budget of the lever you target.", + "scope": "Positive control and planning budget only; this is not a new construction or full cold replay." + }, + "first_experiment": "Before any synthesis, write the candidate per-call local profile (and centre charge / unpaid coordinates if changed) and screen it with ceiling.ceiling(); reject it if even the ideal ceiling does not beat the selected word's by your stated margin.", + "bottleneck_link": "Packing of the selected word is capped at +0.87% (ceiling model); only a lower local excess spend or a changed coverage law raises the cap.", + "allowed_variations": [ + "Narrow to one changed boundary or helper type with explicit counts.", + "If the coverage law, template or guard changes, derive an applicable fully charged replacement bound instead of applying the incumbent ceiling outside its scope." + ], + "scope_change_triggers": [ + "Mixing only providers already inside the pinned catalogue.", + "Only changing helper terminal subspaces and monotone frames within the fixed scalar word, entrances and cleanup contract already covered by #1995/#2013.", + "Continuing a partial cost improvement while leaving the same unpriced consumer, restoration or central-readout obligation unresolved; refresh the family expansion decision first. Local product-retiming evidence has a narrow scope and is not a ban on changed graphs or contracts." + ], + "overlap_terms": [ + "helper inventory", + "heterogeneous-owner", + "mutable leaver" + ] + }, + "scope_status": "refined", + "actual_scope": "On the selected k8 register file, with pinned entrances and monotone nested frames in F_2^9, no rank-at-most-8 paid profile of mass 5586 meets the u=2 nine-call moment at a=1/98. The ideal cell {8:698, 2:1} needs 698 rank-8 children; these entrances supply 648 monotone slots. The minimum feasible profile is {8:648, 5:32, 4:24, 1:146}, and its pooled moment is strictly above 1.", + "scope_change_reason": "The card asks for a new helper inventory whose fully charged profile beats the packing ceiling. This package answers the still-open literal rank-at-most-8 producer inside the published 16-child u=2 slack, and stops at the entrance obstruction. It does not propose another ideal ceiling.", + "bottleneck_link": "The complex child-rank lever is what the selected-r8-u2 cell uses to aim at a=1/98. A monotone word on the pinned entrances cannot reach that histogram, so the 16-child slack is not a producer budget on this register file. Selected kappa is unchanged.", + "budget_minutes": 60, + "stop_rule": "Stop when the monotone optimum and the three-step centre comparison are signed against the published 16/17 control. Do not search scalar rewrites, add registers, or rerun the selected replay.", + "outcome": "negative-result", + "evidence": "python3 -B research/rank8-u2-entrance-obstruction/verify.py prints PASS_RANK8_U2_ENTRANCE_OBSTRUCTION slots=648 monotone=GT/0 centre3=LT/0/GT/1 ideal=LT/16/GT/17 no_new_kappa.", + "author": "unpaidmoon", + "ai_assistance": "Substantial Cursor Grok assistance on the obstruction, the exchange checks and the verifier.", + "open_questions": [ + { + "question": "Can one centre register legally emit three rank-8 steps, and can that word avoid every added rank-1 child?", + "why_it_matters": "Granting three rank-8 steps on each of the eight centres passes the bare u=2 moment and fails as soon as one aggregate rank-1 child is added. The 16-child margin is not available there either.", + "first_step": "Write one centre register as an explicit up, down, up frame trace with its scalar gates and the paid histogram of that trace alone.", + "blocked_by": "The standing frame contract keeps non-centre paths monotone. A descent plus two climbs is a changed path law and needs its own restoration bill before it can be counted." + }, + { + "question": "Do the #4470 productive-helper frames still have fewer than 698 monotone rank-8 slots?", + "why_it_matters": "This obstruction is about the selected k8 entrance file and the older u=2 planning cell. It does not automatically transfer to the current selected invoice.", + "first_step": "Count dim(exit)-dim(entrance) on the #4470 complex word, if that word still uses nested F_2^9 frames, and compare the count with its own paid rank-8 demand.", + "blocked_by": "The #4470 word is a different bill. Reusing these 648 slots as if they were that invoice would mix two templates." + } + ] +} diff --git a/research/rank8-u2-entrance-obstruction/VERIFY.json b/research/rank8-u2-entrance-obstruction/VERIFY.json new file mode 100644 index 0000000000..54c02d2673 --- /dev/null +++ b/research/rank8-u2-entrance-obstruction/VERIFY.json @@ -0,0 +1,21 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/complex-local-word-ceiling/ceiling.py", + "research/r480-owner-optimum/inputs/local/FULL-WORD.json.gz" + ], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Entrance census, monotone and centre-comparison moments, merge and exchange enclosures, the published 16/17 control, and the selected kappa pin." + } + ] +} diff --git a/research/rank8-u2-entrance-obstruction/verify.py b/research/rank8-u2-entrance-obstruction/verify.py new file mode 100644 index 0000000000..427375f2bf --- /dev/null +++ b/research/rank8-u2-entrance-obstruction/verify.py @@ -0,0 +1,241 @@ +#!/usr/bin/env python3 +"""The monotone selected entrances cannot host the rank-8/u2 16-child cell. + +The pinned ceiling engine supplies child-cost enclosures. This file recomputes +the entrance capacities from the selected local word and does not edit either +input. It claims no producer, no consumer and no new kappa. +""" +import gzip +import hashlib +import importlib.util +from collections import Counter +from fractions import Fraction +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[2] +WORD = ROOT / "research/r480-owner-optimum/inputs/local/FULL-WORD.json.gz" +ENGINE = ROOT / "research/complex-local-word-ceiling/ceiling.py" +SELECTED = ROOT / "certificates/selected-result.json" +WORD_GZIP_SHA = "49596aa4ed4fd36cd4582fd0e8ddeb09fd80370a7d8aea1ede52a135b536d289" +WORD_RAW_SHA = "c2b294300760e1fd6eeab8c22c4d13e4633dca40e52cac8da0d68163a76e3ca8" +ENGINE_SHA = "86a1432870b3b21d8454106ec9162fddc0471472d9214c590a1420f2426cedfc" +H = 9 +V = 112 +HELPERS = 480 +MASS = 5586 +A = Fraction(1, 98) +FAMILIES = 896 +CALLS = 9 +CENTRE = 64 +UNPAID = 2 +MONOTONE = {8: 648, 5: 32, 4: 24, 1: 146} +CENTRE3 = {8: 664, 5: 32, 4: 24, 1: 18} +IDEAL = {8: 698, 2: 1} + + +def require(ok, why): + if not ok: + raise SystemExit("FAIL: " + why) + + +def digest(path): + return hashlib.sha256(path.read_bytes()).hexdigest() + + +def dimension(vectors): + pivot = {} + for value in vectors or []: + require(isinstance(value, int) and 0 <= value < (1 << H), "frame vector outside F2^9") + while value: + bit = value.bit_length() - 1 + if bit in pivot: + value ^= pivot[bit] + else: + pivot[bit] = value + break + return len(pivot) + + +def load_engine(): + require(digest(ENGINE) == ENGINE_SHA, "ceiling.py sha256 differs from the package pin") + spec = importlib.util.spec_from_file_location("pinned_ceiling", ENGINE) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + require(module.max_idle_rank(73) == 51, "halving cap is not 51") + return module + + +def load_word(): + require(digest(WORD) == WORD_GZIP_SHA, "selected word gzip sha256 changed") + raw = gzip.decompress(WORD.read_bytes()) + require(hashlib.sha256(raw).hexdigest() == WORD_RAW_SHA, "selected word content hash changed") + word = json_loads(raw) + report = word["report"] + profile = {int(rank): count for rank, count in report["local_profile"].items()} + require(profile == {1: 2412, 2: 418, 3: 432, 4: 142, 5: 82, 8: 8}, "published local profile") + require(sum(rank * count for rank, count in profile.items()) == MASS, "published mass") + require((report["h"], report["v"], report["R"]) == (H, V, HELPERS), "word dimensions") + return word + + +def json_loads(raw): + import json + return json.loads(raw) + + +def capacities(word): + """Maximum monotone climb on each register. + + Sources start on their port line and may end at FULL. Targets start empty + and may end on the port parity hyperplane. Helpers start at the pinned + entrance and may end at FULL. A monotone chain has room dim(exit)-dim(entrance). + """ + count = 2 * V + HELPERS + start = [1] * V + [0] * (V + HELPERS) + for key, frame in word.get("start_extra", {}).items(): + register = int(key) + require(2 * V <= register < count, "entrance is not a helper") + start[register] = dimension(frame) + ports = word["ports"] + require(len(ports) == V, "port count") + for port in ports: + require(isinstance(port, int) and 0 < port < (1 << H), "port line is not a nonzero F2^9 vector") + caps = [] + for register, entrance in enumerate(start): + if register < V: + limit = H + elif register < 2 * V: + limit = H - 1 + else: + limit = H + require(limit >= entrance, "entrance does not sit in the maximum exit") + caps.append(limit - entrance) + centres = [int(register) for register in word["centers"]] + require(len(centres) == len(set(centres)) == 8, "eight distinct centres") + require(all(0 <= register < count for register in centres), "centre register") + return caps, centres + + +def pack(caps, mass=MASS): + remaining = list(caps) + histogram = Counter() + need = mass + for part in range(8, 0, -1): + for index, _room in enumerate(remaining): + while remaining[index] >= part and need >= part: + remaining[index] -= part + histogram[part] += 1 + need -= part + if need == 0: + require(sum(rank * count for rank, count in histogram.items()) == mass, "packer mass") + return dict(histogram) + raise SystemExit("FAIL: packer left mass " + str(need)) + + +def pooled_moment(engine, per_call, extra): + histogram = Counter({51: 272, 46: 1}) + for rank, count in per_call.items(): + histogram[rank] += CALLS * count + if extra: + histogram[1] += extra + low = high = Fraction(0) + for rank, count in histogram.items(): + left, right = engine.child_cost(int(rank), 73, A) + require(left <= right, "cost enclosure inverted") + low += count * left + high += count * right + total = (73 - UNPAID) * FAMILIES + CENTRE * CALLS + paid = CALLS * MASS + require(total - paid == 51 * 272 + 46, "pooled idle is not the u=2 remainder") + require(sum(rank * count for rank, count in histogram.items()) == total + extra, "moment mass") + return engine.down(low / FAMILIES), engine.up(high / FAMILIES) + + +def sign(bounds): + low, high = bounds + if high < 1: + return "LT" + if low > 1: + return "GT" + return "UNK" + + +def certify_exchanges(engine): + """Strict concavity on 1..8: merging, and moving mass onto the larger part, lowers cost.""" + cost = {} + for rank in range(1, 9): + cost[rank] = engine.child_cost(rank, 73, A) + + def below(left_ranks, right_ranks): + left = sum((cost[rank][1] for rank in left_ranks), Fraction(0)) + right = sum((cost[rank][0] for rank in right_ranks), Fraction(0)) + require(left < right, "enclosure does not separate " + str(left_ranks) + " from " + str(right_ranks)) + + for left in range(1, 8): + for right in range(1, 9 - left): + below((left + right,), (left, right)) + for small in range(1, 8): + for large in range(small, 8): + donor = () if small == 1 else (small - 1,) + below(donor + (large + 1,), (small, large)) + # Gathering any composition of 8 into one part lowers the certified cost. + compositions = [[]] + + def grow(parts, used): + start = parts[-1] if parts else 1 + for part in range(start, 9 - used): + grow(parts + [part], used + part) + if used == 8 and len(parts) >= 2: + compositions.append(parts) + + grow([], 0) + require(len(compositions) > 2, "composition list") + for parts in compositions[1:]: + below((8,), tuple(parts)) + + +def main(): + engine = load_engine() + word = load_word() + caps, centres = capacities(word) + counts = Counter(caps) + require(counts == Counter({9: 288, 8: 360, 5: 32, 4: 24}), "entrance capacity census changed") + require(sum(1 for cap in caps if cap >= 8) == 648, "rank-8 slot count") + require(all(caps[register] >= 8 for register in centres), "a centre has no rank-8 slot") + monotone = pack(caps) + require(monotone == MONOTONE, "monotone optimum histogram changed") + centre_caps = list(caps) + for register in centres: + centre_caps[register] = 24 + centre3 = pack(centre_caps) + require(centre3 == CENTRE3, "three-step centre histogram changed") + certify_exchanges(engine) + monotone_sign = sign(pooled_moment(engine, monotone, 0)) + centre_bare = sign(pooled_moment(engine, centre3, 0)) + centre_one = sign(pooled_moment(engine, centre3, 1)) + ideal_16 = sign(pooled_moment(engine, IDEAL, 16)) + ideal_17 = sign(pooled_moment(engine, IDEAL, 17)) + require(monotone_sign == "GT", "monotone optimum no longer fails at zero surcharge") + require(centre_bare == "LT" and centre_one == "GT", "centre comparison room is no longer zero") + require(ideal_16 == "LT" and ideal_17 == "GT", "published 16/17 boundary moved") + # A histogram with 649 eights does not fit these caps. + overflow = dict(monotone) + overflow[8] += 1 + overflow[1] -= 8 + require(overflow[1] > 0, "overflow control") + require(sum(1 for cap in caps if cap >= 8) < overflow[8], "649 eights were accepted") + import json + selected = json.loads(SELECTED.read_text(encoding="utf-8")) + require(selected["kappa"] == "60403/20000000", "selected kappa record changed") + print( + "PASS_RANK8_U2_ENTRANCE_OBSTRUCTION" + " slots=648" + " monotone=GT/0" + " centre3=LT/0/GT/1" + " ideal=LT/16/GT/17" + " no_new_kappa" + ) + + +if __name__ == "__main__": + main()