Skip to content

Commit cfd97ca

Browse files
ianlibanioclaude
andcommitted
Research: nine-stage stage recipes cannot improve PR589 idle hosting (no new kappa)
Exhaustive search of K=4 nine-stage stage recipes (one rank-1 local per stage, at most one +-1 bridge per gap): 2,070,720 valid recipes, 1,064 idle-window structures, each priced with stage-compatible PR442 hosting (0 banks, remainder <= 45) and the pinned rational moment engine. None exceeds PR589's bit c; the template ties with 7 others, and the width-8 hosting wall R <= 4v holds for the whole class. The template recipe alone reproduces PR589's frozen windows, remainder and exact c. The 2K+1 local-count floor re-derived here duplicates open #743 (credited). Base 410026d; selected #1094 remains complex-bound. Seed 18, card selected-packing (refined), claim discussion #1427. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 410026d commit cfd97ca

12 files changed

Lines changed: 1532 additions & 0 deletions

File tree

‎research/bit589-recipe-floor/EXPECTED.json‎

Lines changed: 408 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# Local-count floor for the stage recipe
2+
3+
This note shows that the stage recipe of the nine-stage bit template uses the
4+
fewest possible local invocations for its number of data pairs. The recipe is
5+
in `global_k.py` (`recipe(K)`), from the PR #386/#436/#443/#463 lineage as
6+
generalised by PR #510.
7+
8+
**Priority.** The bound is not new. The archived campaign report M states that
9+
exchanging P bank pairs needs at least 2P+1 stages. Open PR #743 (Johnny
10+
Franks) proves it uniformly with the potential `rank(A) + rank(D)` of the
11+
diagonal blocks. That potential equals `2K − ν − μ'` below, so the two proofs
12+
are the same argument. This independent formulation is kept because its four
13+
invariants also drive the pruning of `recipe_search.py`. No priority is
14+
claimed.
15+
16+
## Scalar model of a recipe
17+
18+
The template's own integer replay (`small()` in `global_k.py`) abstracts a
19+
recipe to an integer matrix on `2K` banks. Bank `2p` is side 0 of pair `p`, and
20+
bank `2p+1` is side 1. Order the coordinates as `V = V0 ⊕ V1`, where
21+
`V0 = span(side 0 of every pair)` and `V1 = span(side 1 of every pair)`. Write
22+
`L0 = V0 ⊕ 0` and `L1 = 0 ⊕ V1`. The events act as follows:
23+
24+
| event | effect | form |
25+
|---|---|---|
26+
| forward local on pair `p` | `side1_p += side0_p` | lower unipotent `[[I,0],[S,I]]`, `S = e_p e_pᵀ`, rank 1 |
27+
| reverse local on pair `p` | `side0_p -= side1_p` | upper unipotent `[[I,T],[0,I]]`, `T = -e_p e_pᵀ`, rank 1 |
28+
| bridge `(d,s,c)` | `side0_d += c side0_s`, `side1_s -= c side1_d` | block diagonal `diag(A, A⁻ᵀ)` |
29+
| final exchange | `(side0_p, side1_p) -> (side1_p, -side0_p)` | block anti-diagonal `X` |
30+
31+
The template asserts that the whole recipe composes to the identity. Let `P` be
32+
the product of all locals and bridges, so that `X P = I` (and bridges after the
33+
last local are part of `P`). Then `P = X⁻¹` is block anti-diagonal:
34+
`P(L0) = L1` and `P(L1) = L0`.
35+
36+
## Theorem
37+
38+
Work over any field. Let
39+
40+
`P = Λ_n τ_n Λ_{n-1} ... Λ_1 τ_1 Λ_0`,
41+
42+
where:
43+
44+
- every `Λ_i` maps `L0` to `L0` and `L1` to `L1`;
45+
- every `τ_i` is lower (`[[I,0],[S_i,I]]`) or upper (`[[I,T_i],[0,I]]`), with
46+
`r_i = rank(τ_i - I)`.
47+
48+
The matrices `S_i` and `T_i` may be arbitrary; they need not be symmetric or
49+
integral. If `P(L0) = L1` and `P(L1) = L0`, then
50+
51+
`Σ_i r_i ≥ 2K + 1`.
52+
53+
**Corollary.** Every local of the bit template has rank 1, and every bridge
54+
sequence is block diagonal. So any recipe that ends in the exchange of all `K`
55+
pairs needs at least `2K + 1` locals, which is `2K + 1` stages. `recipe(K)`
56+
uses exactly `2K + 1`, so it is optimal in this respect. Equivalently, at
57+
`L = 9` stages there are at most `K = 4` exchanged pairs. The rank-mass
58+
deficit `T(2Kv - L·cst)` therefore cannot be raised by re-designing the stage
59+
recipe in this model: at fixed `L`, `K` cannot increase, and at fixed `K`, `L`
60+
cannot decrease.
61+
62+
## Proof
63+
64+
For a linear map `g`, define
65+
66+
- `μ(g) = dim(g L0 ∩ L0)` and `μ'(g) = dim(g L1 ∩ L0)`;
67+
- `ν(g) = dim(g L0 ∩ L1)` and `ν'(g) = dim(g L1 ∩ L1)`.
68+
69+
At `g = I` these are `(μ, μ', ν, ν') = (K, 0, 0, K)`. At `g = P` they must be
70+
`(0, K, K, 0)`. Build `P` from the right, one factor at a time.
71+
72+
**(a) Block-diagonal factors change nothing.** On the left, `Λ` preserves both
73+
`L0` and `L1`, so `dim(ΛU ∩ L_j) = dim(Λ(U ∩ L_j)) = dim(U ∩ L_j)`. On the
74+
right, `gΛL_j = gL_j`.
75+
76+
**(b) A lower factor fixes ν and ν'; an upper factor fixes μ and μ'.** A lower
77+
`τ` maps `L1` onto itself, so `dim(τU ∩ L1) = dim(U ∩ τ⁻¹L1) = dim(U ∩ L1)`.
78+
The same argument applies to an upper `τ` with `L0`.
79+
80+
**(c) A factor of rank r changes each quantity by at most r.** Let `U` and `W`
81+
be subspaces and `x ∈ U ∩ W ∩ ker(τ - I)`. Then `x = τx ∈ τU ∩ W`, so
82+
`dim(τU ∩ W) ≥ dim(U ∩ W) - r`. Applying the same bound to `τ⁻¹`, which also
83+
has `rank(τ⁻¹ - I) = r`, gives the reverse inequality.
84+
85+
By (a)–(c), only lower factors move `μ` and `μ'`, and only upper factors move
86+
`ν` and `ν'`. Each moves them by at most its rank. So `Σ_lower r_i ≥ K` and
87+
`Σ_upper r_i ≥ K`.
88+
89+
Now look at the first factor `τ_1`; `Λ_0` does not matter by (a).
90+
91+
- **`τ_1` is lower.** It fixes `L1` pointwise, so `τ_1 Λ_0 L1 = L1` and
92+
`μ' = dim(L1 ∩ L0) = 0` stays 0. The later lower factors alone must raise
93+
`μ'` from 0 to `K`. Hence `Σ_lower r_i ≥ K + r_1 ≥ K + 1`.
94+
- **`τ_1` is upper.** It fixes `L0` pointwise, so `ν` stays 0 after it, and
95+
symmetrically `Σ_upper r_i ≥ K + 1`.
96+
97+
In both cases `Σ r_i ≥ 2K + 1`. ∎
98+
99+
## Tightness and checks
100+
101+
- **Tightness.** `recipe(K)` attains the bound: `F_0` followed by
102+
`(R_j B+ F_j B−)` for `j = 0..K-1`, which is `2K + 1` rank-1 locals.
103+
- **Brute force.** `floor_check.py` independently confirms `K = 1` and `K = 2`.
104+
For `K = 1` it uses vectors in `[-3,3]`; for `K = 2` it uses all primitive
105+
vectors in `[-2,2]²` and entries up to 50. No product of `2K` rank-1 shears is
106+
block anti-diagonal, while products of `2K + 1` shears are. This is a finite
107+
check of the bounded class only; the theorem above is the general statement.
108+
109+
## Scope
110+
111+
- **What the theorem covers.** The theorem is about the template's scalar
112+
abstraction: each local is a rank-1 shear on one pair. Its conclusion does
113+
not depend on the coefficients, on the field (it holds over F2, where the
114+
template also replays its columns), or on which block-diagonal maps sit
115+
between locals.
116+
- **What it does not cover.** It does not cover templates in which a local
117+
acts on several pairs at once, or in which free data movement is
118+
off-block-diagonal, for example a cheap `side1 += side0` addition that is not
119+
a paid local. Nor does it cover architectures where the exchange is not
120+
required on every data pair.
121+
- **Hosting, words and κ.** It says nothing about how idle children are
122+
hosted, which is the subject of the search in `README.md`. It says nothing
123+
about the local word either. It changes no κ.
Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
# Nine-stage stage recipes cannot improve PR #589's idle hosting
2+
3+
**Status: scoped negative result (bit supplier). No new κ.**
4+
5+
The question is whether any nine-stage stage recipe can improve PR #589's idle hosting. The domain searched is every
6+
recipe with four exchanged pairs, one rank-1 local per stage and at most one ±1 bridge per gap: 2,070,720 valid
7+
recipes, 1,064 distinct idle-window structures. **None raises PR #589's bit c.** The template recipe attains the
8+
maximum, tied by seven other structures that leave the identical remainder. The width-8 hosting wall `R ≤ 4v = 444`
9+
holds for every recipe in the class.
10+
11+
The selected #1094 assembly is complex-bound: complex b is 0.0016755 and bit c is 0.0017334. No bit-side result
12+
changes κ (0.001672660197076918).
13+
14+
## Question and predecessors
15+
16+
PR #589's nine-stage bit c is fixed by two inputs. The first is the word's local paid profile, which PR #886 and #933
17+
showed is locally optimal. The second is the **idle remainder** `{2:435, 4:444, 6:444, 7:666, 42:9}` per replica that
18+
PR #442 hosting leaves behind.
19+
20+
- **Fixed windows (bit589-width-packing).** The merged `research/bit589-width-packing` (Sagar Thakrar) proved that,
21+
with the template's idle windows held fixed, no width-8 re-hosting improves c. It identified helper width 7 as the
22+
lever.
23+
- **Geometric audit (#1307).** Open #1307 (commdata2338) audits the geometric disjointness of the same hosting.
24+
- **This note: vary the windows.** Here the windows themselves vary. They are produced by the *stage recipe*
25+
(`recipe(K)` in `global_k.py`, PR #463/#510 lineage). Per data-coordinate copy, the template advances idle pairs
26+
by Δ = {6,6,4,4,2,2,1,1,1} levels. A Δ-level advance is a rank-7Δ child, which can host ⌊7Δ/8⌋ width-8 residuals
27+
from the stages it spans.
28+
- **What was open.** Could another valid recipe produce fewer or longer advances, and so more capacity and a
29+
cheaper remainder?
30+
31+
## Results
32+
33+
| question | answer |
34+
|---|---|
35+
| Fewer locals per exchanged pair? | **No: 2K+1 locals are necessary.** First proved uniformly by open #743 (Johnny Franks; archived report M). `PROOF.md` gives an equivalent formulation whose invariants drive the search's pruning. `floor_check.py` confirms K = 1, 2. At nine stages K ≤ 4, so the deficit `T(2Kv − L·cst)` cannot be raised by a recipe. |
36+
| PR #589 from the recipe alone? | **Exact.** The template recipe, read unchanged from the vendored `global_k.py`, gives windows equal to the frozen official selection index by index. It gives the same remainder and c = `1733427039589844234749/10^24`. |
37+
| Optimistic ceiling: any split of the 27 idle level-steps, pooled residuals, no recipe validity | c ≤ 0.001927 (+11.2%), but only with 4–5 segments such as Δ = 8+8+6+5. |
38+
| The same ceiling with ≥ 9 segments | c ≤ 0.0017515 (+1.04%), which needs advances of 8 levels. |
39+
| Exhaustive K = 4 class | **2,070,720** recipes form **1,064** window structures with 9 / 10 / 11 idle segments (75 / 513 / 476 structures). Σ Δ = 27 and max Δ ≤ 6 throughout. |
40+
| Hosting (count/window programme, 0 banks, paid remainder ≤ 45) | Capacity is `27 − #segments ≤ 18` slots per copy set, at most **3,996** against 3,951 needed. 989 structures fail total capacity, 27 lack capacity at some stage, 2 fail the joint transport or remainder cap, and **46 are hostable**. |
41+
| Best exact c | **PR #589's c exactly**, attained by 8 structures with the same remainder. The other hostable structures sit at four lower values, 0.044% to 0.213% lower. **None is higher.** |
42+
43+
### Why the remainder is pinned
44+
45+
- **Capacity equals Δ − 1.** For 1 ≤ Δ ≤ 8, `⌊7Δ/8⌋ = Δ − 1`. A fully hosted advance therefore leaves exactly
46+
`8 − Δ`, and capacity per copy set is `Σ(Δ_i − 1) = 27 − #segments`.
47+
- **The template already has the fewest segments.** The smallest segment count in the class grows as 3(K−1): 3, 6
48+
and 9 for K = 2, 3, 4. The longest advance grows as 2(K−1): 2, 4 and 6. Hence, at K = 4:
49+
- capacity is at most 18 slots, so `R ≤ 18·2v/9 = 4v` for every recipe;
50+
- no advance reaches the 7–8 levels that the optimistic layouts need.
51+
- **The same conclusion as with fixed windows.** With 9 segments and Σ Δ = 27, the remainders `8 − Δ` total 45 per
52+
copy set. The 45 spare slots are best left as whole rank-42 copies, as bit589-width-packing proved for the fixed
53+
windows.
54+
- **Where a gain must come from instead.** Any further bit gain must come from outside this class:
55+
- wider gaps (open question 1);
56+
- other stage counts (eleven stages is already worse for this word: 0.0017110);
57+
- banks or split residuals (#448/#480, not established);
58+
- **helper width**, which is bit589-width-packing's lever.
59+
60+
## Method
61+
62+
1. **Scalar model.** The model is the template's own integer replay. A forward local is `side1_p += side0_p`, a
63+
reverse local is `side0_p −= side1_p`, and a bridge is `diag(A, A⁻ᵀ)`. A recipe is valid iff the product is block
64+
anti-diagonal, so that a final bridge sequence plus the exchange gives the identity.
65+
- A Levi before the first local, or after the last, cannot change validity, because it preserves L0 and L1.
66+
- So the search omits both and, by pair symmetry, puts the first local on pair 0.
67+
2. **Search.** Depth-first search with exact integer ranks.
68+
- It prunes with `max(μ, K−μ') + max(K−ν, ν') ≤ remaining stages` from `PROOF.md`.
69+
- Completability of (stage, product) is memoised.
70+
- Entries are capped at |8|. At K = 3, a cap of 64 gives the identical 28,464 recipes.
71+
3. **Idle children and windows.** Idle children are inserted exactly as `global_k` does: before a local, before a
72+
bridge, and finally in pair order. Windows follow PR #442 `hosting_core.windows`.
73+
4. **Hosting.** Hosting is an exact integer programme with PR #442's objective.
74+
- Every residual is hosted (0 banks, as PR #589).
75+
- A residual of stage s is hosted only in a window spanning s.
76+
- Every paid remainder is ≤ 45, which keeps halving depth 2 and row 18,355 < 20,161.
77+
- The template and the best five structures are re-solved with the **vendored official** `hosting_k.solve`
78+
(`host_all=True, max_remainder=45`). It must give the same objective and the same c.
79+
5. **Price.** The price is the pinned rational moment engine of the selected assembly (sha256 `81cbc864…`), with the
80+
inherited bad-branch surcharge. The global profile is `288 ×` local + `32 ×` remainder. The rank-mass identity
81+
`T(2Kv − L·cst) = 10,272` and halving depth 2 are asserted for every structure.
82+
83+
## Reproduce
84+
85+
```sh
86+
python3.12 -m pip install numpy==2.5.4 scipy==1.18.1
87+
python3.12 -B research/bit589-recipe-floor/verify.py --reuse --jobs 2 # registered generic replay, about 2 minutes
88+
python3.12 -B research/bit589-recipe-floor/verify.py --jobs 12 # also reruns the K=4 search, about 25 minutes
89+
python3.12 scripts/research_package.py --package research/bit589-recipe-floor
90+
```
91+
92+
- **`--reuse`** re-prices the committed search `data/search-K4.json`, which is hash-pinned in `EXPECTED.json`.
93+
- **Without `--reuse`**, the search is rerun and must equal the committed file in content.
94+
- **Measured.** `--reuse --jobs 2` takes 24 s through `scripts/research_package.py` (Python 3.12.15). The full run
95+
takes 26 min 55 s with `--jobs 12` and 165 MB RSS. Both used numpy 2.5.4 and scipy 1.18.1 on Linux x86-64.
96+
97+
Expected last line:
98+
99+
```text
100+
PASS_BIT589_RECIPE_FLOOR floor=2K+1 K3_recipes=28464 K4_recipes=2070720 K4_structures=1064 max_capacity=3996 hostable=46 best_c=1733427039589844234749/1000000000000000000000000 equal=8 above_pr589=0 no_new_kappa (…s)
101+
```
102+
103+
## Controls
104+
105+
- **Positive.** The template recipe composes with the exchange to the identity. Its windows equal the frozen
106+
`selection9-p111.json` index by index. The own programme, the frozen selection and the official programme agree,
107+
and the price is PR #589's c exactly.
108+
- **Negative (19).** These all fail as they should:
109+
- dropping any of the six internal bridges;
110+
- dropping any of the nine locals;
111+
- flipping one local's type;
112+
- removing stage 0 from every window (hosting becomes infeasible).
113+
114+
The invariants are `(4,0,0,4)` at the identity and `(0,4,4,0)` at the template product.
115+
- **Agreement between implementations.**
116+
- The numpy and pure-Python floor checks agree (K = 2: 180,092 states at length 5, 12 hits, none shorter).
117+
- A separate prototype search found the same 2,070,720 recipes and the same 1,064 structures at K = 4.
118+
- The prototype and package also agree on all 135 K = 3 structures.
119+
120+
## Scope
121+
122+
- **Searched class.** Nine-stage recipes with K = 4, one local per stage, at most one bridge (coefficient ±1) per
123+
gap, and entries |≤ 8|. Priced with PR #589's word under PR #442 width-8 whole-residual hosting, 32 replicas and
124+
0 banks.
125+
- **Hosting relaxes geometry.** "Hostable" means admissible in PR #442's count/window programme. Open #1307 shows that
126+
this does not imply disjoint physical axes. The search is therefore a relaxation, and a stricter geometric check could
127+
only remove candidates. It cannot weaken the negative result.
128+
- **Not searched.**
129+
- Gaps with two or more bridges: a K = 3 probe did not finish in 20 minutes.
130+
- Banks, and cross-copy or split residuals.
131+
- Other stage counts, words or replica schemes.
132+
- Locals that are not single-pair rank-1 shears.
133+
- Width-7 helpers.
134+
135+
"No better structure" is a statement about this class only.
136+
- **Proof status.** The 2K+1 floor has written proofs here and in #743. The K = 4 result is an exhaustive finite
137+
enumeration, not a formal proof. Hosting is optimal only within the stated integer programme.
138+
- **κ and inherited assumptions.** κ is unchanged. All inherited bit assumptions remain: mutable-source realization,
139+
whole-call hosting, all-size compiler, precision and tape, and H1–H5.
140+
- **Files.** Only this directory is added. The selected record, PR #589's package and `upstream/` are unchanged.
141+
142+
## Open next questions
143+
144+
The same three questions, with their fields, are in `TASK.json`.
145+
146+
1. **Wider gaps.**
147+
- *Question:* can a gap holding several bridges give a K = 4 recipe with fewer than 9 idle segments, or with an
148+
advance of 7–8 levels?
149+
- *Why it matters:* it is the only lever left inside this template.
150+
- *First step:* rerun `recipe_search.py 3 --bridges-per-gap 2` with stronger pruning.
151+
- *Blocked by:* search cost.
152+
2. **A segment theorem.**
153+
- *Question:* is "at least 3(K−1) idle segments" a theorem for every bridge recipe?
154+
- *Why it matters:* it would make `R ≤ 4v` recipe-independent at width 8, at every K.
155+
- *First step:* generalise the observed 3/6/9 into entry, final and borrowing synchronisation counts.
156+
- *Blocked by:* a written proof; the rank invariants bound locals, not syncs.
157+
3. **The width-7 interaction.**
158+
- *Question:* once width-7 helpers exist, which recipe is best?
159+
- *Why it matters:* 7 divides every 7Δ window, so capacity becomes 27 slots for every recipe.
160+
- *First step:* re-price `data/search-K4.json` at width 7 under bit589-width-packing's bracket.
161+
- *Blocked by:* no width-7 bit helper exists yet.
162+
163+
## Provenance
164+
165+
- **Base.** `410026dc5513b87db92ae98571d1d5984c69a983`. The work was started on `8bddbee3`; every pinned input is
166+
byte-identical on both bases.
167+
- **Assignment and card.** OS-random assignment seed **18** (bit supplier track). Catalogue card `selected-packing`,
168+
with scope declared `refined` in `TASK.json`.
169+
- **Pins.** All inputs are hash-pinned in `SOURCES.json` and `recipe_lib.py` and checked by `verify.py`:
170+
- the moment engine and PR #589's `EXPECTED.json`, which match the selected assembly's own input pins;
171+
- the vendored `global_k.py`, `hosting_k.py` and `hosting_core.py`;
172+
- the frozen selection.
173+
- **Claim.** [Discussion #1427](https://github.com/CrocSwap/integer-mult-bounds/discussions/1427).
174+
- **Overlap.** `scripts/find_overlap.py --refresh` was run on 2026-10-14 over 785 open PRs and 145 discussions,
175+
searching recipe, hosting, idle and stage terms. It found no recipe-variation search. The adjacent work is credited:
176+
bit589-width-packing, #1307, #743, #886 and #933.
177+
178+
## Credit
179+
180+
- **Template and recipe lineage.** Zhihao Chen and eumemic (PR #386/#436), chafreaky (#439/#443), and
181+
DreamingOfClouds (#463 generalisation, #510 nine-stage chain, #589).
182+
- **Hosting.** DaysSky (PR #442 idle-axis hosting).
183+
- **The word.** eumemic (#543/#555), DreamingOfClouds (#545/#589), and Jacob Sussman (the E8 unit and the borrowing
184+
chain).
185+
- **The 2K+1 floor.** Archived report M and Johnny Franks (#743).
186+
- **Fixed-window hosting bound.** Sagar Thakrar (bit589-width-packing).
187+
- **Geometric audit.** commdata2338 (open #1307).
188+
- **Paid-profile predecessors.** SethBurkart123 (#886) and #933.
189+
190+
Prepared by Ian Libânio with substantial AI assistance (Claude Opus 5.5, Anthropic, via Claude Code). Apache-2.0.

0 commit comments

Comments
 (0)