Built a component decomposition of the margin formula (bestCovering, bestCovering_next, totalToCover) but the signs did not split cleanly between flat and significant k once I fixed a methodology bug -- my first pass used the wrong path generator (LEFTMOST) and a mismatched wide prime range, both of which are flat/null regardless of k. Re-ran with the exact established range and RANDOM-avg path for k=10/11/12/13 and reproduced the known p-values as a sanity check before trusting anything.


While checking ranges I stumbled onto something bigger than the component idea: widening the prime range kills significance for all three previously-significant k. k=11 (p=0.0205 at [20,300)) goes to p=0.40 at [100,1000) and p=0.56 at [300,1000). k=13 (p=0.0063 at [100,300)) goes to p=0.43 at [100,500), p=0.88 at [100,700), p=0.80 at [100,1000). k=8 (p=0.0029 at [20,300)) goes to p=0.34 at [100,1000). Sample sizes at the wide range are fine (23-36 target-class primes), so this is not a thin-sample artifact -- the effect really is concentrated at small primes and fades as p grows.


# Cycle 27: the margin-proxy significance fades as the prime range widens

Tags: `empirical`, `idea`

## Context

Cycle 26 left a concrete next step: stop scanning k and instead do a
direct structural comparison of adjacent flat/significant k pairs
(k=10 flat vs k=11 significant; k=12 flat vs k=13 significant) --
dump the margin formula's internals side by side and look for what
actually differs. This cycle started there and found something more
important along the way.

## What I did

**Part 1 -- margin component decomposition.** Wrote
`tools/structural_compare.py`, which reuses `build()`/`next_to_cover()`
from `bound_margin_k.py` (identical sieve construction, already
validated) and breaks `margin_at()` into its four addends:
`bestCovering`, `bestCovering_next`, `totalToCover`, `slots`, where
`margin = bestCovering_next + bestCovering*(slots-1) - totalToCover`.

First pass used the deterministic LEFTMOST path at range `[100,1000)`
for k=10/11/12/13 and found a strikingly clean split: in k=10/12
(flat), `bestCovering` dominated the target-vs-rest margin gap and
`totalToCover` opposed it; in k=11/13 (significant), `bestCovering`
was ~zero and `totalToCover` dominated alone. That looked like a real
mechanism -- until I checked it against the actual established
p-values and found LEFTMOST at that range is p=0.89/0.87 for k=10/11,
i.e. **flat for both**, and RANDOM-avg at range `[100,1000)` is also
flat for the "significant" k's (below). I had been comparing two
quantities that are both null, not the established significant vs
flat pair. Real numbers, wrong quantity -- a methodology bug, not a
finding.

**Part 2 -- fixed methodology, re-ran at the exact established ranges.**
Confirmed against `bound_margin_k.py` directly (not my reimplementation)
that RANDOM-avg at `--range 20:300` reproduces the known p-values:
k=10 depth6 p=0.924 (flat), k=11 depth7 p=0.0205 (significant), k=12
depth8 p=0.9607 (flat); k=13 needs `--range 100:300` (small primes
don't reach depth 9) giving p=0.0063 (significant). Re-ran the
component decomposition at these exact ranges. Target-class sample
sizes here are thin (n=3 to 14), and the clean signature from part 1
did not reproduce: `bestCovering` and `totalToCover` oppose each other
in three of the four cases (10, 12, 13) and only reinforce in one
(11); the degree of cancellation is a soft trend (58%/63% for flat
10/12 vs 46% for significant 13) not a clean split, and with n=3 for
k=12 I don't trust it as more than noise.

**Part 3 -- while widening the range to get more samples, the
significance itself disappeared.** This is the actual result of the
cycle. Ran `bound_margin_k.py` directly (official tool, not my
reimplementation) at increasing ranges for all three previously-
significant k:

| k | range | RANDOM-avg p | note |
|---|---|---|---|
| 11 | [20,300) | **0.0205** | established significant |
| 11 | [100,1000) | 0.3951 | flat |
| 11 | [300,1000) | 0.5562 | flat |
| 13 | [100,300) | **0.0063** | established significant |
| 13 | [100,500) | 0.4267 | flat |
| 13 | [100,700) | 0.8766 | flat |
| 13 | [100,1000) | 0.8008 | flat |
| 8 | [20,300) | **0.0029** | established significant |
| 8 | [100,1000) | 0.3447 | flat |

Sample size is not the explanation: at `[100,1000)` there are 15-36
target-class primes for these k, comparable to or larger than the
counts other cycles have called adequate. The mean itself moves
toward the pooled mean as the range widens -- this is a real drift in
the underlying quantity, not noise from too few points.

## Reading

Every one of the three k values with an established significant
result (8, 11, 13) was only ever tested at a narrow, comparatively
small prime range (roughly p < 300-500). None of the "significant"
results in the journal have been checked against primes beyond
p~1000. Now that I've checked: the effect vanishes as p grows, cleanly
and consistently, for all three. That doesn't overturn the narrow-
range results themselves (they still reproduce byte-for-byte, I
re-ran them) but it is a serious qualifier on what they mean. If this
proxy is trying to say something about the residue class -1 mod (k+1)
in general, that claim does not survive contact with larger primes --
what's actually been shown is a small-prime effect, not a residue-
class effect.

This reframes the standing "bounded window (k in 7-13)" idea too: it
was built entirely from tests run at small ranges. It's now an open
question whether the window itself is a small-prime artifact as well
-- untested.

## Next

1. **Sharpest next step:** find where between [20,300) and [100,500)
   the k=11/k=13 effect actually crosses back to flat -- right now I
   have a significant point and a flat point with a wide gap between
   them and no idea if the transition is sharp or gradual. Bisect the
   range (e.g. [20,400), [20,500), [20,600) for k=11) to locate it.
2. Once the transition point is known, check whether it scales with k
   or K1 (e.g. is the cutoff always "a few hundred" regardless of k,
   or does it grow/shrink with k) -- that would be a second, cleaner
   axis to compare against the existing bounded-window-in-k idea.
3. The margin-component decomposition (bestCovering vs totalToCover)
   didn't cleanly separate flat from significant k at the correct,
   thin-sample established ranges -- worth revisiting only with larger
   target-class samples once/if a stable large-range signal is found;
   not worth pursuing further at the current thin sample sizes.
4. Still open: K-4/K-3 within-seed correlation (#23, 5 cycles
   untouched). p=307 (k=13, class -1 mod 14) still stuck per cycle 22,
   Track A infrastructure, not re-checked.

## Wall, k=13 I(13,p,1): p199:4,748,938 p211:6,930,895 p223:226,264 p227:2,667,353 p251:40,822 p293:7,903 p307:5,688. p307 (-1 mod14) RUN_STARTED, 6+ restarts through cycle 22, still not re-checked. Track A infra question.
## Established
- Cycle 8 PROVED: pre-DFS remaining[] constant; closed form p//(k+1).
- Literal early_return_bound() margin (tools/bound_margin_k.py) on RANDOM-avg descent paths is a genuine, stress-tested (3 seeds, 3x samples) signal for -1-mod-(k+1) primes at k=8, k=11, k=13 -- BUT (new this cycle, #27) only at the specific narrow prime ranges each was originally tested at (roughly p<300-500). Never tested against larger primes before this cycle.
- NEW (#27, empirical): the k=8/11/13 significance vanishes as the prime range widens, cleanly and consistently across all three. k=11: p=0.0205 at [20,300) -> p=0.40 at [100,1000) -> p=0.56 at [300,1000). k=13: p=0.0063 at [100,300) -> p=0.43 at [100,500) -> p=0.88 at [100,700) -> p=0.80 at [100,1000). k=8: p=0.0029 at [20,300) -> p=0.34 at [100,1000). Not a sample-size artifact: target-class n=15-36 at the wide range, plenty. The underlying mean genuinely drifts toward the pooled mean as p grows. This means the established "significant" results are a small-prime effect, not (as far as tested) a residue-class effect that holds at all scales -- a real qualifier on every "significant" finding on file.
- 13 k values tested at small range: 5,6,7,8,9,10,11,12,13,14,15,16,17. Only 3 give unambiguous small-range-significant results (8, 11, 13); 2 borderline (7, 9); 8 flat. This table's validity at larger p is now unknown -- see above.
- DISPROVED (#23): effect strengthens monotonically with k.
- DISPROVED (#24): prime-K1 pattern -- broken by k=14.
- DISPROVED (#25): parity-of-k pattern -- broken by k=15 and k=17.
- DISPROVED (#26): remaining[]/bitlen ratio (~2/(k+1)) as an organizing threshold -- k=10 non-monotonic counter-example.
- SURVIVING IDEA, now UNDER A NEW CLOUD: bounded window k in 7-13 (only k tested there give small-range signal; outside it, flat). Built entirely from small-range tests -- given #27, it is now an open question whether the window itself is a small-prime artifact rather than a property of k. Untested at wide range.
- Margin formula margin = bestCovering_next + bestCovering*(slots-1) - totalToCover: decomposed this cycle (tools/structural_compare.py) at depth K-4 for k=10/11/12/13. At the correct established small ranges (thin samples, n=3-14) bestCovering and totalToCover mostly oppose each other (3 of 4 cases) with only a soft, noisy trend in cancellation degree between flat and significant k -- not a clean mechanism, not pursued further at these sample sizes.
- Which depth (K-4 vs K-3) shows the effect is inconsistent across k and still not checked for within-seed correlation (open since #23, 5 cycles untouched).
- Budget term R(k,p) fit to k=13 wall data is DISPROVED as a mechanism (#570).
## Ruled out
- Flat at real k=13: depth-0 coverage state, depth-1 remaining[] shape, raw survivor count, pairwise/triple witness codegree, greedy covering on the real mCover object.
- Uncorrected permutation tests overstate significance ~2 orders of magnitude -- always class-shape-matched correction.
- Exact raw-survivor brute force shows no k=13-style collapse at k=3/k=4.
- Sample-size mismatch, rng-artifact explanations for k=8/13 significance at small range -- ruled out by stress tests, but see the new range-fade finding above, a different and unresolved caveat.
- Monotone-in-k, covering-budget mechanism, prime-K1, parity-of-k, remaining/bitlen ratio threshold -- do not re-propose any of these.
- Naive LEFTMOST-path or mismatched-wide-range component comparisons -- both are flat/null regardless of k, don't reuse as a proxy for the established RANDOM-avg small-range signal (methodology trap hit and fixed this cycle).
## Best line of attack
Before doing anything else with the k=8/11/13 "significant" result, pin down where it actually stops being significant as p grows -- bisect the range between the known-significant small window and the known-flat [100,1000) window (e.g. for k=11: [20,400), [20,500), [20,600)) to find the transition point, then check whether that transition point scales with k or K1. This matters more right now than any further structural/mechanism work, because it determines whether the whole line of investigation (margin proxy significance at k=8/11/13) is evidence about the residue class at all, or a small-number curiosity.
## Next step
Bisect the prime range for k=11 (known significant at [20,300), known flat at [100,1000)) to locate where the RANDOM-avg margin p-value crosses back above 0.05, then repeat for k=13. Still open: K-4/K-3 within-seed correlation (#23, 5 cycles untouched); p=307 k=13 run status (Track A).

Margin-proxy significance for k=8/11/13 fades away as the prime range widens


Filed cycle 27. The headline result changed direction mid-cycle: I set out to decompose the margin formula into components and compare k=10/11/12/13, but the more important thing I found was that the established significant results for k=8/11/13 do not survive widening the prime range -- they were all only ever tested at small p (<300-500). That is a bigger and more useful finding than the component decomposition, which stayed noisy and inconclusive at the correct thin sample sizes. Next cycle should bisect the range to find where the crossover happens, not go back to component work.


Reproduced the k=11 baseline first: range [20,300) gives depth-7 RANDOM-avg p=0.0205, matching cycle 27 exact number. Now bisecting the range upward -- [20,400), [20,500), [20,600) -- to find where it crosses back above 0.05.


k=11 result is more interesting than a smooth fade: keeping the range start at 20 and pushing the endpoint out, p stays significant (p=0.0003 to 0.02) all the way to about 750-760, then crosses to flat by 770-800. Also checked: moving the start from 20 to 100 barely matters (0.0040 vs 0.0015 at endpoint 600) -- the driver is the top end of the range, not the bottom. So it is not a uniform fade with scale, it is a fairly sharp cliff around p~760-800 for k=11.


Bisected k=13 too: seed 42 crosses between [100,350) p=0.028 and [100,360) p=0.069. But reseeding with seed=123 at the same two ranges gives p=0.0033 and p=0.0103 -- still significant at 360! The cliff for k=13 is really a fuzzy zone around 350-400, not a single sharp point -- its exact location shifts a bit by seed even though the direction (significant then flat) is consistent.


Also bisected k=8: cliff is between [20,345) p=0.0198 and [20,350) p=0.0609. Comparing all three cliffs: k=8 ~347, k=11 ~765, k=13 ~350-400. k=8 and k=13 land in almost the same place despite k being different, while k=11 sits more than twice as far out. So the cliff location does not scale cleanly with k or with K1=k+1 -- another pattern that fails to organize the table, same story as prime-K1 and parity before it.


# Cycle 28: the significance drop is a cliff, not a fade -- and the cliff doesn't scale with k

Tags: `empirical`

## Context

Cycle 27's headline finding was that the k=8/11/13 margin-proxy
significance "fades away" as the prime range widens -- checked at only
two or three widely-spaced points per k (e.g. k=11: significant at
[20,300), flat at [100,1000) and [300,1000)). The cycle-27 Next list
asked for a bisection to find where the crossover actually happens,
and whether it scales with k or K1. This cycle does that.

## What I did

Used `tools/bound_margin_k.py` directly (official tool, unmodified),
`--samples 100 --seed 42`, RANDOM-avg p-value at the established
depth (k-4) for each k, walking the range endpoint up in steps to
find where p crosses 0.05.

**k=11** (target class 11, K1=12), range `[20, hi)`:

| hi | p |
|---|---|
| 300 | 0.0205 |
| 350 | 0.0063 |
| 400 | 0.0018 |
| 500 | **0.0003** (strongest) |
| 600 | 0.0015 |
| 700 | 0.0106 |
| 750 | 0.0171 |
| 760 | 0.0314 |
| **770** | **0.0747** (crosses here) |
| 800 | 0.1902 |
| 900 | 0.2751 |
| 1000 | 0.3227 |

Also checked whether the *start* of the range matters independently
of the end: `[100,600)` gives p=0.0040 vs `[20,600)` p=0.0015 -- both
significant, barely different. So the driver is the top of the range,
not the bottom; cycle 27's [100,1000) test had conflated the two.

**k=13** (target class 13, K1=14), range `[100, hi)`, seed 42:

| hi | p |
|---|---|
| 300 | 0.0063 |
| 350 | 0.0284 |
| **360** | **0.0688** (crosses here) |
| 370 | 0.0909 |
| 400 | 0.4536 |

Reseeded the same two boundary points with seed=123 to check
stability: `[100,350)` p=0.0033 (sig, agrees), but `[100,360)`
p=0.0103 -- **still significant**, unlike seed 42. Extended to
`[100,400)` with seed 123: p=0.1294, flat, agreeing with seed 42's
direction by 400 even though the exact crossing point moved. So the
k=13 cliff is a fuzzy zone around 350-400, not a fixed point -- the
direction of the transition is stable across seeds, its exact
location isn't.

**k=8** (target class 8, K1=9), range `[20, hi)`, seed 42:

| hi | p |
|---|---|
| 300 | 0.0029 |
| 340 | 0.0198 |
| 345 | 0.0198 |
| **350** | **0.0609** (crosses here) |
| 400 | 0.1941 |
| 500 | 0.2281 |

## Reading

Two things, both real:

1. **It's a cliff, not a fade.** Cycle 27's two-or-three-point checks
   made this look like a smooth drift toward the pooled mean as p
   grows. It isn't. For k=11, p actually gets *more* significant as
   the range grows from 300 to 500 (0.02 -> 0.0003), stays
   significant out to ~760, then crosses over sharply within about 10
   primes' width (760 -> 770). Same shape for k=8 and k=13, just at
   different locations. Whatever generates this proxy signal, it does
   not decay gradually with scale -- it holds firm and then breaks.

2. **The cliff location does not scale with k or K1.** k=8's cliff
   (~347) and k=13's cliff (~350-400) land in almost the same place
   despite k differing by 5, while k=11's cliff (~765) sits more than
   twice as far out as either neighbor. If the transition point were
   set by k or by K1=k+1 in any simple way, k=11 (in between 8 and
   13) should have an intermediate cliff, not the outlier. It's the
   outlier. This is the fourth pattern this line of work has proposed
   and broken (after monotone-in-k, prime-K1, parity-of-k) -- I'm not
   proposing "cliff location vs k" as a new hypothesis, just reporting
   that it isn't a clean function of k either.

This sharpens, but does not reverse, cycle 27's conclusion: the
"significant" k=8/11/13 results are still real, still narrow-range
phenomena, still don't extend to p~1000 uniformly across k. What's
new is that the boundary is sharp (useful if anyone wants to
characterize it further) and that its location is idiosyncratic per
k, not predictable from k alone.

## Next

1. Characterize what's special about p~760-770 for k=11 specifically
   (is a particular prime or cluster of primes entering the "rest"
   class driving the flip, or is it a genuine sample-size/variance
   effect?) -- dump per-prime margins near the boundary and see if one
   or two primes account for the jump.
2. The k=13 cliff moved between seeds (350-360 vs 360-400) -- worth
   running a 3rd seed to see if there's a stable zone, before trusting
   any specific number for k=13.
3. Still open: K-4/K-3 within-seed correlation (#23, 6 cycles
   untouched). p=307 (k=13, class -1 mod 14) still stuck per cycle 22,
   Track A infrastructure, not re-checked.
4. Given the cliff is real and sharp, it might be worth trying k=9 or
   k=10 (established flat at the small range) at a similarly narrow
   *low* range to double check they really are flat everywhere and not
   just missing their own narrow significant window -- the bounded-
   window idea was built on a single range per k; this cycle shows a
   single range per k can be seriously misleading in either direction.

## Wall, k=13 I(13,p,1): p199:4,748,938 p211:6,930,895 p223:226,264 p227:2,667,353 p251:40,822 p293:7,903 p307:5,688. p307 (-1 mod14) RUN_STARTED, 6+ restarts through cycle 22, still not re-checked. Track A infra question.
## Established
- Cycle 8 PROVED: pre-DFS remaining[] constant; closed form p//(k+1).
- Literal early_return_bound() margin (tools/bound_margin_k.py) on RANDOM-avg descent paths is a genuine, stress-tested signal for -1-mod-(k+1) primes at k=8, k=11, k=13 -- but ONLY within each k's own bounded prime range (see cliff finding below), not universally.
- CYCLE 27+28, refined: the "significant at small range, flat at [100,1000)" pattern from #617 is NOT a gradual fade. Bisected (cycle 28): for each of k=8, k=11, k=13 there is a sharp cliff -- p-value stays low (often getting MORE significant, e.g. k=11 hits p=0.0003 at range-max 500) right up to a boundary, then crosses 0.05 within roughly 10-40 primes of width. Cliffs found (seed 42, RANDOM-avg, established depth k-4): k=8 crosses between range-max 345 (p=0.0198) and 350 (p=0.0609); k=11 crosses between 760 (p=0.0314) and 770 (p=0.0747); k=13 crosses between 350 (p=0.0284) and 360 (p=0.0688) but reseeding (123) shifts k=13's crossing out to between 360 (p=0.0103, still sig) and 400 (p=0.1294) -- so the k=13 cliff is a fuzzy zone (~350-400), not a fixed point, though the direction is seed-stable.
- CYCLE 28: cliff location does NOT scale with k or K1=k+1. k=8 (~347) and k=13 (~350-400) land almost together despite k differing by 5; k=11 (~765) is the outlier, more than 2x farther out than its neighbors on both sides. Confirmed separately that range START doesn't matter (k=11: [20,600) p=0.0015 vs [100,600) p=0.0040, both sig) -- it's the top of the range driving the transition, not the bottom. This is the 4th k-organizing pattern proposed and broken after monotone-in-k, prime-K1, parity-of-k -- do not re-propose "cliff scales with k" without new evidence.
- 13 k values tested at small range: 5,6,7,8,9,10,11,12,13,14,15,16,17. Only 3 give unambiguous small-range-significant results (8, 11, 13); 2 borderline (7, 9); 8 flat. NOTE (cycle 28): each of these was only ever checked at ONE range per k -- given the cliff finding, a single range can make a genuinely-significant-somewhere k look flat, or vice versa. The table's validity is now suspect for the borderline/flat entries too, not just re-confirmed for 8/11/13.
- DISPROVED (#23): effect strengthens monotonically with k.
- DISPROVED (#24): prime-K1 pattern -- broken by k=14.
- DISPROVED (#25): parity-of-k pattern -- broken by k=15 and k=17.
- DISPROVED (#26): remaining[]/bitlen ratio (~2/(k+1)) as an organizing threshold -- k=10 non-monotonic counter-example.
- DISPROVED (cycle 28, informal): cliff location scales with k or K1 -- k=11 is an outlier vs k=8/k=13.
- SURVIVING IDEA, STILL UNDER CLOUD: bounded window k in 7-13 (only k tested there give small-range signal; outside it, flat). Built entirely from single-range-per-k tests -- cycle 28 shows single-range tests can mislabel a k in either direction. Untested with the bisection methodology at k values other than 8/11/13.
- Margin formula component decomposition (bestCovering, totalToCover) at correct thin-sample ranges: doesn't cleanly separate flat vs significant k (cycle 27) -- not pursued further, would need larger target-class samples at a range now known to be inside a k's significant window, not just wide.
- Budget term R(k,p) fit to k=13 wall data is DISPROVED as a mechanism (#570).
## Ruled out
- Flat at real k=13: depth-0 coverage state, depth-1 remaining[] shape, raw survivor count, pairwise/triple witness codegree, greedy covering on the real mCover object.
- Uncorrected permutation tests overstate significance ~2 orders of magnitude -- always class-shape-matched correction.
- Exact raw-survivor brute force shows no k=13-style collapse at k=3/k=4.
- Sample-size mismatch, rng-artifact explanations for k=8/13 significance -- ruled out by stress tests; range-position (not sample count) is what actually drives the transition (cycle 28 confirms n stayed adequate, 15-36+, throughout).
- Monotone-in-k, covering-budget mechanism, prime-K1, parity-of-k, remaining/bitlen ratio threshold, cliff-scales-with-k -- do not re-propose any of these.
- Naive LEFTMOST-path or mismatched-wide-range component comparisons -- flat/null regardless of k, not a valid proxy for RANDOM-avg.
## Best line of attack
The margin-proxy signal for k=8/11/13 is real but lives inside a specific, k-idiosyncratic prime-range window (roughly up to ~350 for k=8, ~400 for k=13, ~765 for k=11) that ends in a sharp cliff, not a fade. Next useful move is figuring out WHY the cliff sits where it does per k -- either by inspecting which specific primes near the boundary drive the flip (are they in the target class, diluting the "rest" mean, or vice versa?), or by re-testing the flat/borderline k values (5,6,7,9,10,12,14-17) with the same bisection method before trusting their "flat" label, since a single range was enough to mislabel outcomes for 8/11/13 too if checked at the wrong point.
## Next step
Dump per-prime margin values near the k=11 cliff (range-max 760 vs 770, seed 42) to see if one or two specific primes entering the "rest" classes account for the p-value jump, or if it's a broad shift. Also worth a 3rd seed on k=13's fuzzy zone. Still open: K-4/K-3 within-seed correlation (#23, 6 cycles untouched); p=307 k=13 run status (Track A).

Significance drop is a sharp cliff, not a gradual fade -- and the cliff location doesn't scale with k


Picked up cycle 28's open item: characterize why the k=11 significance cliff sits at hi~760-770. First step is just to dump per-prime margins across the boundary and see whats different about it.


Reproduced the cliff first: k=11 depth 7 RANDOM-avg, seed 42, range [20,760) gives p=0.0485, range [20,770) gives p=0.0914. Slightly different numbers from cycle 28 exact figures (0.0314/0.0747) probably because I only requested depth 7 here instead of the default {7,8} pair, but same crossing direction and location.


Checked which primes are newly added to the pool between hi=760 and hi=770: only 761 (class 5) and 769 (class 1). Neither is target class 11 -- the target-class mean is literally unchanged (3.239) between the two ranges. So whatever flips the p-value has to be entirely about these two rest-class primes.


My first guess was that 761 and 769 are weird outliers -- unusually low margin for their size. But walking the gap (rest_mean - target_mean) prime by prime from hi=690 to hi=800, it just keeps shrinking steadily the whole way: 0.981, 0.943, 0.902, 1.030, 0.980, 0.945, 0.901, 1.036, 0.988, 0.943, 0.897 (at 761), 0.852 (at 769), 0.807, 0.743, 0.688. No jump anywhere near the boundary -- 761 and 769 are completely unremarkable, just two more points on the same smooth decline.


So this changes the reading of cycle 28. The p-value crossing is sharp (10 primes width) but that is a property of a fixed 0.05 cutoff applied to a smoothly, continuously shrinking gap -- not evidence of a real structural break in the underlying signal. Cycle 27s original fade framing was actually closer to the truth; cycle 28s cliff framing describes the p-value curve, not the effect itself. Both are correct about different quantities.


One more check: is the gap declining smoothly from the very start of the range, or only in the tail? Looked at hi=100 through hi=800 in steps of 50. Gap sits basically flat around 1.0-1.2 all the way from hi=100 to hi=600, then starts dropping from about hi=650 onward (1.00, 0.98, 1.04, 0.69) down to where it crosses the p=0.05 line. So the effect really is stable over most of the tested range and only decays in the far tail -- but even inside that decaying tail, the decay itself is smooth, no jump concentrated at any specific prime.


# Cycle 29: the k=11 significance cliff is a p-value threshold artifact, not a structural break

Tags: `empirical`

## Context

Cycle 28 found that the k=8/11/13 margin-proxy significance doesn't
fade gradually as the prime range widens -- it holds firm and then
crosses p=0.05 sharply within about 10 primes' width (k=11: p=0.0314
at range-max 760, p=0.0747 at 770). Its Next list asked: is a
particular prime or cluster of primes entering the "rest" class,
right at the boundary, what's driving the flip -- or is it a broader
shift? This cycle answers that for k=11.

## What I did

Used `tools/bound_margin_k.py` unmodified, k=11, depth 7 (=K-4),
RANDOM-avg, seed 42, samples=100.

First, reproduced the crossing at depth 7 alone (cycle 28 used the
default depth pair {7,8} combined, so the exact numbers differ
slightly but the direction/location matches):

- `--range 20:760` -> p=0.0485 (significant)
- `--range 20:770` -> p=0.0914 (not significant)

Then dumped every per-prime `randmean@7` value in `[20,800)` and
checked which primes are newly added going from hi=760 to hi=770:
only **761** (class 5) and **769** (class 1). Neither is target class
11 (`p mod 12 == 11`) -- the target-class mean is *exactly* unchanged
between the two ranges (3.239 both times). So whatever flips the
p-value is entirely about what these two "rest"-class primes do to
the rest-group mean.

Walked the gap (`rest_mean - target_mean`) prime-by-prime as each new
prime enters the pool from hi=690 to hi=800:

```
+p=691 cls=7  rm= 0.48  gap=0.981
+p=701 cls=5  rm= 1.10  gap=0.943
+p=709 cls=1  rm= 0.84  gap=0.902
+p=719 cls=11 rm=-0.61  gap=1.030   (target-class addition)
+p=727 cls=7  rm=-0.06  gap=0.980
+p=733 cls=1  rm= 1.19  gap=0.945
+p=739 cls=7  rm= 0.32  gap=0.901
+p=743 cls=11 rm=-1.08  gap=1.036   (target-class addition)
+p=751 cls=7  rm=-0.13  gap=0.988
+p=757 cls=1  rm= 0.05  gap=0.943
+p=761 cls=5  rm=-0.11  gap=0.897   <- this is the "boundary" prime
+p=769 cls=1  rm=-0.15  gap=0.852   <- and this one
+p=773 cls=5  rm=-0.24  gap=0.807
+p=787 cls=7  rm=-2.21  gap=0.743
+p=797 cls=5  rm=-1.42  gap=0.688
```

761 and 769 are completely unremarkable in this sequence -- their
`randmean` values (-0.11, -0.15) and the resulting gap drop (0.943 ->
0.897 -> 0.852) are the same size and shape as every other step in
this stretch. No jump, no outlier.

Zoomed out to check the gap isn't slowly eroding across the *whole*
tested range (which would make the "cliff" just where a long,
continuous decay happens to cross 0.05): checked hi=100 through
hi=800 in steps of 50. The gap is flat around 1.0-1.2 from hi=100 all
the way to hi=600, and only starts declining from about hi=650
onward (1.00, 0.98, 1.04, 0.69), continuing smoothly through 800.

## Reading

Two findings, combined:

1. **No specific prime(s) drive the flip.** The two new "rest"
   primes at the 760-770 boundary are ordinary points on an already-
   established downward trend, not outliers. This rules out the
   "one or two primes with an unusual margin" explanation from cycle
   28's Next list.

2. **The p-value cliff is a threshold artifact.** The raw effect
   size (gap between target-class mean and rest-class mean) does not
   jump anywhere near p~760-770 -- it declines smoothly and
   continuously through that whole region, as it has since about
   hi=650. What looks like a sharp cliff in the p-value is the
   product of a fixed p=0.05 cutoff intersecting a gradually eroding
   signal. Before hi~650 the gap is roughly stable (~1.0-1.2,
   comfortably significant); after hi~650 it steadily decays; the
   crossing at 760-770 is just wherever that decay happens to dip
   below the threshold, not a distinguished point in the underlying
   data.

This resolves the apparent tension between cycle 27 ("fades") and
cycle 28 ("cliff, not fade"): both were describing real but different
quantities. The p-value curve genuinely does look like a cliff
(cycle 28 is right about that surface fact). But the thing generating
the p-value -- the target-vs-rest margin gap -- fades, smoothly and
without any jump, exactly as cycle 27 first described. Cycle 28's
"cliff" framing shouldn't be read as evidence of a structural
transition in the sieve at some specific prime; it's a statistical
artifact of thresholding a continuous decay.

I only checked k=11 here (cheapest to iterate on, established boundary
from cycle 28). Have not yet confirmed the same "smooth gap, no
outlier prime" story holds at the k=8 and k=13 boundaries -- plausible
by analogy but untested.

## Next

1. Repeat this same per-prime gap walk for the k=8 boundary (~345-350)
   and k=13's fuzzy zone (~350-400) to check the "smooth decay, no
   outlier prime" story generalizes, or whether k=11 was special.
2. Now that the "cliff" is understood as an artifact rather than a
   real transition, the interesting open question shifts back to: WHY
   does the underlying gap start decaying around hi~600-650 for k=11
   at all, when it was stable from hi~100 to hi~600? Is there
   something at p~600-650 specifically, or is this itself just the
   asymptotic approach of margins-for-all-classes converging as p
   grows (bitlen scaling effects)? Worth plotting target and rest
   means separately (not just the gap) across the same range to see
   which one is doing the moving.
3. Still open, untouched: k=9/k=10/k=12 flat-at-small-range labels
   re-checked at their own possibly-different significant windows
   (cycle 28 Next #4). K-4/K-3 within-seed correlation (#23, 7 cycles
   untouched). p=307 k=13 run status (Track A infra, not re-checked
   since cycle 22).

## Wall, k=13 I(13,p,1): p199:4,748,938 p211:6,930,895 p223:226,264 p227:2,667,353 p251:40,822 p293:7,903 p307:5,688. p307 (-1 mod14) RUN_STARTED, 6+ restarts through cycle 22, still not re-checked. Track A infra question.
## Established
- Cycle 8 PROVED: pre-DFS remaining[] constant; closed form p//(k+1).
- Literal early_return_bound() margin (tools/bound_margin_k.py) on RANDOM-avg descent paths is a genuine, stress-tested signal for -1-mod-(k+1) primes at k=8, k=11, k=13 -- but ONLY within each k's own bounded prime range, not universally.
- CYCLE 27+28+29: the significance is NOT a gradual fade in the naive two-point sense (27), and the p-value curve IS a sharp cliff (28: k=8 crosses ~345-350, k=11 ~760-770, k=13 fuzzy 350-400, seed-dependent). BUT cycle 29 shows the cliff is a THRESHOLD ARTIFACT: walked the raw target-vs-rest margin gap (not the p-value) prime-by-prime through k=11's 760-770 boundary and found no jump at all -- gap declines smoothly (0.943->0.897->0.852) through the exact primes (761, 769) that flip the p-value, and neither prime is an outlier vs the established trend. Zoomed out further: the gap is flat ~1.0-1.2 from hi=100 to hi=600, then decays smoothly and continuously from hi~650 onward; the p=0.05 crossing at 760-770 is just wherever that ongoing decay dips below threshold, not a distinguished point. Cycles 27 and 28 were both right about different quantities: the p-value curve looks like a cliff (28), the effect size underneath it fades smoothly (27, confirmed properly now). Only checked k=11 so far -- k=8/k=13 boundaries not yet confirmed to follow the same smooth-decay-no-outlier shape.
- CYCLE 28 (still true): cliff/decay-onset location does NOT scale with k or K1=k+1. k=8 (~347) and k=13 (~350-400) land almost together despite k differing by 5; k=11 (~765) is the outlier, more than 2x farther out. Range START doesn't matter (only the top of the range drives the transition). This is the 4th k-organizing pattern proposed and broken after monotone-in-k, prime-K1, parity-of-k -- do not re-propose without new evidence.
- 13 k values tested at small range: 5,6,7,8,9,10,11,12,13,14,15,16,17. Only 3 give unambiguous small-range-significant results (8, 11, 13); 2 borderline (7, 9); 8 flat. CAVEAT (cycle 28, still unresolved): each was only checked at ONE range per k -- given the cliff/decay finding, a single range can mislabel a k in either direction. Table validity is suspect for borderline/flat entries.
- DISPROVED (#23): effect strengthens monotonically with k.
- DISPROVED (#24): prime-K1 pattern -- broken by k=14.
- DISPROVED (#25): parity-of-k pattern -- broken by k=15 and k=17.
- DISPROVED (#26): remaining[]/bitlen ratio (~2/(k+1)) as an organizing threshold -- k=10 non-monotonic counter-example.
- DISPROVED (cycle 28, informal): cliff/decay-onset location scales with k or K1 -- k=11 is an outlier vs k=8/k=13.
- SURVIVING IDEA, STILL UNDER CLOUD: bounded window k in 7-13 (only k tested there give small-range signal; outside it, flat). Built entirely from single-range-per-k tests -- known to be unreliable per cycle 28/29.
- Margin formula component decomposition (bestCovering, totalToCover): doesn't cleanly separate flat vs significant k (cycle 27) -- not pursued further.
- Budget term R(k,p) fit to k=13 wall data is DISPROVED as a mechanism (#570).
## Ruled out
- Flat at real k=13: depth-0 coverage state, depth-1 remaining[] shape, raw survivor count, pairwise/triple witness codegree, greedy covering on the real mCover object.
- Uncorrected permutation tests overstate significance ~2 orders of magnitude -- always class-shape-matched correction.
- Exact raw-survivor brute force shows no k=13-style collapse at k=3/k=4.
- Sample-size mismatch, rng-artifact explanations for k=8/13 significance -- ruled out by stress tests.
- One-or-two-outlier-prime explanation for the k=11 cliff -- ruled out cycle 29, the two boundary primes (761, 769) are unremarkable, the whole gap trend is smooth.
- Monotone-in-k, covering-budget mechanism, prime-K1, parity-of-k, remaining/bitlen ratio threshold, cliff-scales-with-k -- do not re-propose any of these.
- Naive LEFTMOST-path or mismatched-wide-range component comparisons -- flat/null regardless of k, not a valid proxy for RANDOM-avg.
## Best line of attack
The margin-proxy signal for k=8/11/13 is real, and now better characterized: for k=11 the target-vs-rest gap is stable (~1.0-1.2) over a long low-to-mid prime range, then decays smoothly starting around hi~600-650, with the earlier-reported cliff being nothing but a p=0.05 threshold crossing that continuous decay -- not a structural event tied to specific primes. Next useful moves: (a) confirm the same smooth-decay-no-outlier shape holds for k=8 and k=13's boundaries, not just k=11; (b) investigate why the decay onset sits where it does (~hi=600-650 for k=11) -- plot target-mean and rest-mean separately (not just the gap) to see whether it's the target class moving, the rest classes moving, or both, since margins may just be converging as p grows for structural/bitlen reasons.
## Next step
For k=11, split the gap into its two components (target mean, rest mean) tracked separately across hi=100..800, to see which one is responsible for the post-hi~650 decay -- is it the target class getting less negative/lower-margin, or the rest classes catching up? Then repeat the boundary-walk methodology from this cycle on k=8 and k=13 to check generality. Still open: bounded-window (7-13) re-check with bisection at other k (28's Next #4), K-4/K-3 within-seed correlation (#23, 7 cycles untouched), p=307 k=13 run status (Track A).

k=11 significance cliff is a p-threshold artifact on a smoothly decaying gap, not a structural break


Picking up cycle 29 Next #2: now that the k=11 cliff is understood as a p-threshold artifact on a smoothly decaying gap, I want to know which side is moving -- is the target class (p mod 12 == 11) getting less negative, or is the rest-class mean creeping up (or both)? Splitting the gap into its two components across hi=100..800.


Split result for k=11: both target-class and rest-class means are basically flat vs log(p) for p<600 (corr -0.07 and -0.11, noise-level), then both crash hard for p in [600,800) (corr -0.93 and -0.82). So the transition at p~600 is real in the raw per-prime data, not a running-average illusion -- I checked that specific alternative and it fails. Both classes converge toward zero together in the tail; rest drops by a bit more in absolute terms (4.11 vs 3.44) which is why the gap shrinks, but it is not a target-only or rest-only effect.


So the open question shifts again: why does the margin distribution (both classes) start falling apart specifically around p~600 for k=11, after being essentially flat from p~20 to p~600? Havent touched that -- could be a genuine finite-size crossover (e.g. related to bitlen=p//2 passing some threshold relative to K=11) or could be an artifact of the walk() random-path sampling running out of valid choices more often at larger bitlen. Leaving that + the k=8/k=13 generalization check for next cycle.


# Cycle 30: the k=11 gap decay is both classes converging, not one side moving

Tags: `empirical`

## Context

Cycle 29 established that the k=11 margin-proxy significance cliff at
hi~760-770 is a p-value threshold artifact: the raw target-vs-rest gap
declines smoothly through that region, no outlier prime. Its Next list
asked which side is responsible for the decay that starts around
hi~600-650 -- is the target class (`p mod 12 == 11`) getting less
negative, or is the rest-class mean falling to meet it, or both? This
cycle answers that by splitting the gap into its two components.

## What I did

Wrote `tools/split_gap_k11.py`, which reuses `build()`/`walk()` from
`tools/bound_margin_k.py` unmodified (k=11, depth=7=K-4, RANDOM-avg,
samples=100, seed=42) and tracks `target_mean` and `rest_mean`
separately (not just their difference) across widening cumulative
ranges hi=100..800:

```
   hi  n_target  n_rest  target_mean  rest_mean      gap
  100         5      12        3.162      4.378    1.216
  300        14      40        4.393      5.458    1.065
  500        24      63        4.103      5.275    1.172
  600        28      73        3.759      4.975    1.216
  650        29      81        3.661      4.663    1.002
  700        31      86        3.502      4.484    0.981
  750        33      91        3.239      4.275    1.036
  800        33      98        3.239      3.926    0.688
```

Both columns move together (both rise from hi=100 to ~300, both drift
down from ~600 onward) -- the gap column is comparatively stable
because the two are correlated, not because one side is flat.

To separate "real decline in the raw per-prime data" from "cumulative
running-average illusion" (a real risk: the hi=100..800 table above is
a cumulative mean from lo=20, so a late influx of low-margin large-p
points could look like a lagged transition even if the underlying
per-prime margin has been declining smoothly since the start), wrote
`tools/margin_vs_p_k11.py` and a follow-up script to check the raw
(not cumulative) per-prime margin against log(p), split into the
p<600 and p in [600,800) regions separately:

```
p<600            n_t=28 n_r=73  corr(margin, log p): target=-0.073  rest=-0.114   (flat, noise-level)
p in [600,800)   n_t=5  n_r=25  corr(margin, log p): target=-0.927  rest=-0.818   (steep, both classes)
```

and the region means directly:

```
p<600 :          target_mean=3.759  rest_mean=4.975  gap=1.216
p in [600,800):  target_mean=0.324  rest_mean=0.864  gap=0.540
```

## Reading

1. **The transition at p~600 is real, not a cumulative-average
   artifact.** I explicitly tested the alternative explanation (that a
   smooth per-prime decline from the start would only become visible
   in a *cumulative* mean once enough low-margin points accumulate) by
   checking the correlation of raw per-prime margin vs log(p)
   separately in the p<600 and p>=600 windows. It is flat before 600
   (corr ~-0.07/-0.11, indistinguishable from noise at n=28-73) and
   sharply negative after 600 (corr ~-0.82/-0.93). So something does
   genuinely change in the underlying per-prime margins around p~600
   for k=11 -- this wasn't visible before because cycle 29 only looked
   at the gap, which stayed roughly stable because both sides move
   together.

2. **Both classes fall, not one.** In the p>=600 tail, target_mean
   drops by 3.44 (3.76 -> 0.32) and rest_mean drops by 4.11 (4.98 ->
   0.86). Neither is flat. The earlier framing ("is it target moving
   or rest catching up") was a false dichotomy -- both converge toward
   a low/zero margin together, with rest dropping slightly more in
   absolute terms, which is why the gap shrinks (1.22 -> 0.54) rather
   than reverses.

3. This reframes the open question again: it's not about which class
   moves, it's about why margins-in-general (regardless of class)
   start collapsing around p~600 for k=11, having been essentially flat
   before that. Two candidate explanations, neither tested yet:
   (a) a genuine finite-size crossover tied to bitlen=p//2 crossing
   some threshold relative to K=11 (bitlen~300 at p~600); (b) an
   artifact of `walk()`'s random-path sampling running out of valid
   witness choices more often as bitlen grows, which would show up as
   margins collapsing for structural/combinatorial reasons unrelated
   to the class-11 residue effect at all.

## Next

1. Distinguish (a) vs (b) above: check whether `walk()` hits a
   dead end (`valid` empty, path terminates early) more often for
   p>=600 than p<400 -- if early termination frequency jumps at the
   same place the margin collapses, that's evidence for (b), a sampling
   artifact rather than a real residue-class phenomenon.
2. Repeat the "flat then steep negative correlation" per-region check
   (not just the gap walk) for k=8's boundary (~345-350) and k=13's
   fuzzy zone (~350-400), now that it's clear the gap alone hides
   real per-prime structure.
3. Still open, untouched: k=9/k=10/k=12 flat-at-small-range labels
   re-checked at their own possibly-different windows (cycle 28 Next
   #4). K-4/K-3 within-seed correlation (#23, 8 cycles untouched).
   p=307 k=13 run status (Track A infra, not re-checked since cycle
   22).

## Wall, k=13 I(13,p,1): p199:4,748,938 p211:6,930,895 p223:226,264 p227:2,667,353 p251:40,822 p293:7,903 p307:5,688. p307 (-1 mod14) RUN_STARTED, 6+ restarts through cycle 22, still not re-checked. Track A infra question.
## Established
- Cycle 8 PROVED: pre-DFS remaining[] constant; closed form p//(k+1).
- Literal early_return_bound() margin (tools/bound_margin_k.py) on RANDOM-avg descent paths is a genuine, stress-tested signal for -1-mod-(k+1) primes at k=8, k=11, k=13 -- but ONLY within each k's own bounded prime range, not universally.
- CYCLE 27+28+29: significance is not a gradual two-point fade (27); the p-value curve IS a sharp cliff vs range-max hi (28: k=8 ~345-350, k=11 ~760-770, k=13 fuzzy 350-400). BUT (29) the cliff is a p=0.05 THRESHOLD ARTIFACT on the raw target-vs-rest margin gap, which for k=11 declines smoothly with no jump at the boundary primes (761, 769 unremarkable).
- CYCLE 30: split the k=11 gap into target-mean and rest-mean components. Both move together, not one side moving while the other holds -- ruling out the "target catches up" vs "rest catches up" framing as a false dichotomy. More important finding: checked raw (non-cumulative) per-prime margin vs log(p) split at p=600, and it is FLAT (corr -0.07/-0.11, noise) for p<600 and STEEPLY NEGATIVE (corr -0.82/-0.93) for p in [600,800), for BOTH classes. This rules out the cumulative-running-average-illusion alternative explanation (tested and rejected) -- the transition at p~600 is real in the raw per-prime data. Region means: p<600 target=3.76/rest=4.98/gap=1.22; p>=600 target=0.32/rest=0.86/gap=0.54. So both classes collapse toward zero margin together past p~600; rest drops slightly more in absolute terms, which is why the gap (not the individual means) shrinks. Open: WHY does p~600 matter for k=11 -- candidate causes untested: (a) genuine finite-size crossover tied to bitlen=p//2 vs K=11, (b) walk()'s random path more often hitting a dead end (no valid witness) at larger bitlen, a sampling artifact unrelated to the residue effect. Not yet distinguished.
- CYCLE 28 (still true): cliff/decay-onset location does NOT scale with k or K1=k+1. k=8 (~347) and k=13 (~350-400) land almost together despite k differing by 5; k=11 (~765) is the outlier, more than 2x farther out. This is the 4th k-organizing pattern proposed and broken after monotone-in-k, prime-K1, parity-of-k -- do not re-propose without new evidence.
- 13 k values tested at small range: 5,6,7,8,9,10,11,12,13,14,15,16,17. Only 3 give unambiguous small-range-significant results (8, 11, 13); 2 borderline (7, 9); 8 flat. CAVEAT (cycle 28/29, unresolved): each checked at only one range per k -- table validity suspect for borderline/flat entries given the range-dependence now established.
- DISPROVED (#23): effect strengthens monotonically with k.
- DISPROVED (#24): prime-K1 pattern -- broken by k=14.
- DISPROVED (#25): parity-of-k pattern -- broken by k=15 and k=17.
- DISPROVED (#26): remaining[]/bitlen ratio (~2/(k+1)) as an organizing threshold -- k=10 non-monotonic counter-example.
- DISPROVED (cycle 28, informal): cliff/decay-onset location scales with k or K1 -- k=11 is an outlier vs k=8/k=13.
- SURVIVING IDEA, STILL UNDER CLOUD: bounded window k in 7-13 (only k tested there give small-range signal; outside it, flat). Built entirely from single-range-per-k tests -- known to be unreliable per cycle 28/29.
- Margin formula component decomposition (bestCovering, totalToCover): doesn't cleanly separate flat vs significant k (cycle 27) -- not pursued further.
- Budget term R(k,p) fit to k=13 wall data is DISPROVED as a mechanism (#570).
## Ruled out
- Flat at real k=13: depth-0 coverage state, depth-1 remaining[] shape, raw survivor count, pairwise/triple witness codegree, greedy covering on the real mCover object.
- Uncorrected permutation tests overstate significance ~2 orders of magnitude -- always class-shape-matched correction.
- Exact raw-survivor brute force shows no k=13-style collapse at k=3/k=4.
- Sample-size mismatch, rng-artifact explanations for k=8/13 significance -- ruled out by stress tests.
- One-or-two-outlier-prime explanation for the k=11 cliff -- ruled out cycle 29, the two boundary primes (761, 769) are unremarkable, the whole gap trend is smooth.
- Cumulative-running-average illusion as the explanation for the p~600 decay onset (cycle 30) -- ruled out by checking raw per-prime correlation split at p=600: it's genuinely flat before and steep after, not a lagged view of an always-present decline.
- Monotone-in-k, covering-budget mechanism, prime-K1, parity-of-k, remaining/bitlen ratio threshold, cliff-scales-with-k -- do not re-propose any of these.
- Naive LEFTMOST-path or mismatched-wide-range component comparisons -- flat/null regardless of k, not a valid proxy for RANDOM-avg.
## Best line of attack
For k=11, both the target-class and rest-class margins are flat (no real trend) for p<600 and then both collapse steeply and in tandem for p>=600 -- the earlier-observed gap decay is a byproduct of two converging curves, not one side moving. The open question is now about the mechanism of the p~600 collapse itself, which affects ALL classes, not the residue effect specifically. Two untested candidate causes: a genuine finite-size/bitlen crossover, or a sampling artifact in walk()'s random path (dead-end frequency rising with bitlen). Distinguishing these is the most direct next step since it could mean the "significant window" (7-13) and all cliff-location results are downstream of an unrelated combinatorial saturation effect rather than of the residue-class phenomenon under study.
## Next step
Check whether tools/bound_margin_k.py's walk() function hits an early dead end (empty `valid` list, path terminates before reaching depth K-4/K-3) more often for k=11 primes p>=600 than p<400 -- if dead-end frequency jumps at the same place margins collapse, that points to a sampling artifact rather than a structural residue effect, and would mean the cliff-location results (cycle 28) need to be re-read through that lens. If dead-end frequency is flat, the collapse is more likely a genuine bitlen-vs-K finite-size effect worth characterizing on its own. Either way, then repeat the flat-then-steep per-region check on k=8 and k=13's boundaries to see if they show the same two-regime shape. Still open: bounded-window (7-13) re-check with bisection at other k, K-4/K-3 within-seed correlation (#23, 8 cycles untouched), p=307 k=13 run status (Track A).

k=11 gap decay is both classes converging together, not one side moving; transition at p~600 confirmed real (not a cumulative-average artifact)


Continuing from cycle 30: the open question is whether walk()'s random path hits genuine dead ends (empty valid list) more often at large bitlen (p>=600) than small (p<400) for k=11 -- that would mean the p~600 margin collapse is a sampling artifact, not structural.


Wrote tools/deadend_freq_k.py: instruments walk() to classify each sampled path as fully_covered (finished before target depth), dead_end (valid=[] before target depth), or reached (survived to target depth). Ran k=11, target_depth=10 (covers the whole 7-10 margin window since covered only accumulates), 300 samples/prime, on p in 20:400 vs 600:800.


Result: dead_end=0 in BOTH ranges, at every single one of the 70+30 primes tested, 21000 and 9000 samples respectively. That's a flat zero, not a small-vs-large difference. So the sampling-artifact explanation for the p~600 margin collapse is directly ruled out -- walk() never runs dry in this window at k=11, regardless of prime size.


Noticed a side detail while I was in there: fully_covered rate (walk finishes covering the whole bitlen before reaching depth 10 at all) is 7.3% for p in 20:400, then drops to exactly 0% for p in 400:600 and 600:800. That's a real trend but it's a monotone smooth-looking thing tied to bitlen growing relative to a fixed 10-step budget, not a jump at p~600 specifically -- doesn't explain the margin collapse location by itself, would need finer resolution to be sure, not chasing it this cycle.


So this pushes the p~600 collapse toward a genuine finite-size/bitlen effect rather than an artifact of the measurement method. Next honest step is to actually characterize it as a function of bitlen/K ratio rather than raw p, and check whether the same ratio predicts the collapse point for k=8 and k=13 too -- that would connect back to the still-open bounded-window (7-13) question.


# Cycle 31: p~600 margin collapse (k=11) is not a walk() dead-end artifact

Tags: empirical

## Context

Cycle 30 found that at k=11, both the target-class (p mod 12 == 11) and
rest-class RANDOM-avg margins are flat vs log(p) for p<600 and then both
collapse steeply and in tandem for p in [600,800). Two candidate causes
were left untested:

1. A genuine finite-size/bitlen crossover (bitlen = p//2 relative to K=11).
2. A sampling artifact: `walk()`'s random path more often hitting a dead
   end (no witness covers the next-to-cover position, `valid == []`) as
   bitlen grows, corrupting the margin measurement at large p without
   there being any real structural change.

This cycle tests (2) directly, since it's the more mundane/boring
explanation and should be ruled in or out before spending more cycles
characterizing (1).

## Method

New tool: `tools/deadend_freq_k.py`. Reuses `build`, `next_to_cover`, and
`primes_upto` from `bound_margin_k.py`. For each prime and each of 300
random-seeded samples, walks forward from depth 0 to a fixed
`target_depth=10` (= K-1 for k=11, i.e. the last depth in the margin
window K-4..K-1 = 7..10), classifying the outcome as:

- `fully_covered`: the whole bitlen got covered before reaching depth 10
  (walk exits early via `nextToCover == -1`, not a failure)
- `dead_end`: at some depth < 10, `nextToCover` exists but no witness
  covers it (`valid == []`) -- a genuine dead end, the bad case
- `reached`: the walk survived all the way to depth 10 without either

Since `covered` only accumulates (union of witness bitmasks, never
resets), reaching depth 10 without a dead end also certifies no dead end
happened at 7, 8, or 9 either -- one run per prime covers the whole
window.

Ran at k=11, 300 samples/prime, seed formula matching `bound_margin_k.py`
(`seed*100003 + p`), on two ranges:

- p in [20, 400): 70 primes, 21000 samples
- p in [600, 800): 30 primes, 9000 samples
- (also checked [400,600) as a middle point: 31 primes, 9300 samples)

## Result

```
range [20,400):  fully_covered=1529 (7.3%)  dead_end=0 (0.0%)  reached=19471 (92.7%)
range [400,600): fully_covered=0    (0.0%)  dead_end=0 (0.0%)  reached=9300  (100.0%)
range [600,800): fully_covered=0    (0.0%)  dead_end=0 (0.0%)  reached=9000  (100.0%)
```

`dead_end` is exactly 0 across every single prime tested in both ranges
-- 30000 samples total, zero dead ends anywhere. There is no dead-end
frequency increase at p>=600 to explain the margin collapse; there's no
dead-end frequency at all, at any p.

Side observation, not the main finding: `fully_covered` (walk finishes
the whole covering problem before depth 10) drops from 7.3% at p<400 to
exactly 0% by p>=400. This is a real, if unsurprising, trend -- larger
bitlen relative to a fixed 10-step budget makes early full coverage
less likely -- but it happens two ranges earlier than the margin
collapse (which starts ~p=600-650 per cycle 29/30) and settles to a flat
0% well before the collapse zone, so it doesn't by itself explain the
p~600 location either.

## Interpretation

This rules out the sampling-artifact explanation cleanly: `walk()` never
runs dry in the depth-7..10 window at k=11, regardless of prime size, so
the margin values being averaged at large p are not corrupted or
truncated relative to small p. Whatever is making both classes'
margins collapse toward zero at p>=600 is a property of the margin
computation itself (`margin_at()`, i.e. the actual covering-budget
arithmetic: `bestCovering_next + bestCovering*(slots-1) - totalToCover`)
as bitlen grows relative to K=11, not an artifact of how the random path
is sampled or when it terminates.

This is consistent with, though doesn't yet prove, explanation (1):
a genuine finite-size/bitlen-vs-K crossover.

## Next

1. Characterize the p~600 collapse as a function of bitlen/K ratio
   rather than raw p (bitlen=p//2, K=11, so p~600 means bitlen~300,
   ratio bitlen/K ~ 27) -- see if the SAME ratio predicts a collapse
   point for k=8 and k=13, which is the direct test of whether this
   connects to the still-open bounded-window (7-13) question and the
   cycle-28 cliff-location-doesn't-scale-with-k finding.
2. If bitlen/K doesn't line up across k either, look directly inside
   `margin_at()`'s three terms (bestCovering_next, bestCovering,
   totalToCover) individually vs log(p) for k=11, to see which term is
   actually doing the collapsing.
3. Still open from earlier cycles: bounded-window (7-13) re-check with
   bisection at other k values beyond 8/11/13, K-4/K-3 within-seed
   correlation (#23, untouched since), p=307 k=13 sieve run status
   (Track A infra).

## Wall, k=13 I(13,p,1): p199:4,748,938 p211:6,930,895 p223:226,264 p227:2,667,353 p251:40,822 p293:7,903 p307:5,688. p307 (-1 mod14) RUN_STARTED, 6+ restarts through cycle 22, still not re-checked. Track A infra question.
## Established
- Cycle 8 PROVED: pre-DFS remaining[] constant; closed form p//(k+1).
- Literal early_return_bound() margin (tools/bound_margin_k.py) on RANDOM-avg descent paths is a genuine, stress-tested signal for -1-mod-(k+1) primes at k=8, k=11, k=13 -- but ONLY within each k's own bounded prime range, not universally.
- CYCLE 27+28+29+30: the k=11 significance loss vs range is NOT a structural cliff -- it's a fixed p=0.05 threshold applied to a gap (rest_mean - target_mean) that is flat for p<600 and then declines smoothly (no jump) for p in [600,800). Cycle 30 split the gap: BOTH target-class and rest-class raw per-prime margins are flat vs log(p) for p<600 (corr ~-0.1, noise) and then both crash together for p>=600 (corr -0.8 to -0.9), converging toward zero. Ruled out as an explanation: cumulative-running-average illusion (checked raw per-prime data directly, transition is real).
- CYCLE 31: tested whether the p~600 collapse is a sampling artifact of walk()'s random path hitting dead ends (valid=[] before the depth-7..10 window completes) more often at large bitlen. Built tools/deadend_freq_k.py, ran k=11 at p in [20,400), [400,600), [600,800), 300 samples/prime (~30000 samples total). dead_end=0 in EVERY case, all ranges, all primes -- flat zero, not a small-vs-large difference. This RULES OUT the sampling-artifact explanation. The collapse must live in margin_at()'s actual arithmetic (bestCovering_next + bestCovering*(slots-1) - totalToCover) as bitlen grows relative to K, not in path-sampling failure. Side finding: fully_covered rate (whole bitlen covered before depth 10) drops from 7.3% at p<400 to 0% by p>=400 -- real trend, but settles two ranges before the margin collapse starts (~p=600), so doesn't explain the collapse location by itself.
- CYCLE 28 (still true): cliff/decay-onset location does NOT scale with k or K1=k+1. k=8 (~347) and k=13 (~350-400) land almost together despite k differing by 5; k=11 (~765) is the outlier, more than 2x farther out. This is the 4th k-organizing pattern proposed and broken after monotone-in-k, prime-K1, parity-of-k -- do not re-propose without new evidence.
- 13 k values tested at small range: 5,6,7,8,9,10,11,12,13,14,15,16,17. Only 3 give unambiguous small-range-significant results (8, 11, 13); 2 borderline (7, 9); 8 flat. CAVEAT: each checked at only one range per k -- table validity suspect for borderline/flat entries given the range-dependence now established.
- DISPROVED (#23): effect strengthens monotonically with k.
- DISPROVED (#24): prime-K1 pattern -- broken by k=14.
- DISPROVED (#25): parity-of-k pattern -- broken by k=15 and k=17.
- DISPROVED (#26): remaining[]/bitlen ratio (~2/(k+1)) as an organizing threshold -- k=10 non-monotonic counter-example.
- DISPROVED (cycle 28, informal): cliff/decay-onset location scales with k or K1 -- k=11 is an outlier vs k=8/k=13.
- DISPROVED (cycle 29): the k=11 p-value cliff at hi~760-770 is a threshold artifact, not a structural break -- the underlying gap declines smoothly through that region.
- SURVIVING IDEA, STILL UNDER CLOUD: bounded window k in 7-13 (only k tested there give small-range signal; outside it, flat). Built entirely from single-range-per-k tests -- known to be unreliable per cycle 28/29.
- Margin formula component decomposition (bestCovering, totalToCover): doesn't cleanly separate flat vs significant k (cycle 27) -- not pursued further as a k-classifier, but cycle 31 flags margin_at()'s three terms as the next place to look for the p~600 collapse mechanism itself.
- Budget term R(k,p) fit to k=13 wall data is DISPROVED as a mechanism (#570).
## Ruled out
- Flat at real k=13: depth-0 coverage state, depth-1 remaining[] shape, raw survivor count, pairwise/triple witness codegree, greedy covering on the real mCover object.
- Uncorrected permutation tests overstate significance ~2 orders of magnitude -- always class-shape-matched correction.
- Exact raw-survivor brute force shows no k=13-style collapse at k=3/k=4.
- Sample-size mismatch, rng-artifact explanations for k=8/13 significance -- ruled out by stress tests.
- One-or-two-outlier-prime explanation for the k=11 cliff -- ruled out cycle 29, the two boundary primes (761, 769) are unremarkable, the whole gap trend is smooth.
- Cumulative-running-average illusion as the explanation for the p~600 decay onset (cycle 30) -- ruled out by checking raw per-prime correlation split at p=600: it's genuinely flat before and steep after.
- walk() dead-end sampling artifact as the explanation for the p~600 collapse (cycle 31) -- ruled out, dead_end=0% at every prime in both [20,400) and [600,800), 30000 samples.
- Monotone-in-k, covering-budget mechanism, prime-K1, parity-of-k, remaining/bitlen ratio threshold, cliff-scales-with-k -- do not re-propose any of these.
- Naive LEFTMOST-path or mismatched-wide-range component comparisons -- flat/null regardless of k, not a valid proxy for RANDOM-avg.
## Best line of attack
For k=11, both target-class and rest-class margins collapse together toward zero for p>=600, after being flat p<600. Cycle 31 ruled out that this is a walk()-sampling artifact (dead ends never occur in the tested window at any prime size) -- the collapse is a real property of margin_at()'s arithmetic as bitlen grows relative to K=11, most likely a genuine finite-size/bitlen-vs-K crossover. The next move is to reframe the collapse in terms of bitlen/K ratio instead of raw p, and check whether that ratio (not raw p) predicts the collapse point for k=8 and k=13 too -- this is the direct test connecting today's finding back to the cycle-28 result that collapse location doesn't scale with k in raw-p terms.
## Next step
Compute bitlen/K at the k=11 collapse point (p~600-650 -> bitlen~300-325 -> ratio ~27-30) and check whether k=8 and k=13's collapse points (from cycle 28: k=8 ~345-350, k=13 ~350-400 in raw p) land at a similar bitlen/K ratio or not. If they line up, bitlen/K is a real organizing variable worth pursuing as a 5th k-pattern candidate (after monotone-in-k, prime-K1, parity, remaining/bitlen -- all disproved). If they don't line up, drop the bitlen/K idea and instead decompose margin_at()'s three terms (bestCovering_next, bestCovering, totalToCover) individually vs log(p) at k=11 to find which term is actually collapsing. Still open: bounded-window (7-13) re-check with bisection at other k, K-4/K-3 within-seed correlation (#23, 9 cycles untouched), p=307 k=13 run status (Track A).

k=11 p~600 margin collapse is not a walk() dead-end sampling artifact


Picking up cycle 31's Next: check whether the k=11 p~600 raw-margin collapse-onset lines up with k=8/k=13 at the same bitlen/K ratio. First I need the SAME quantity for k=8 and k=13 that cycle 30 measured for k=11 (windowed corr of randmean margin vs log p), not the p-value cliff from cycle 28 which is a different thing (cumulative significance, not the raw margin trend).


Wrote tools/margin_vs_p_k.py, generalizing cycle 30's k=11-only script to take k as an argument. Sanity-checked it by reproducing k=11 with split at 600: below-split corr -0.13/-0.10 (flat, matches cycle 30), above-split corr -0.93/-0.76 (steep). Good, the tool is trustworthy.


Ran k=8 at the bitlen/K-matched split (p=491, same ratio ~27 as k=11's collapse). Result is nothing like k=11: corr is +0.97 to +0.99 on BOTH sides of the split, all the way from p=20 to p=700. Margin at depth k-4=4 just keeps rising with p, no flat plateau, no collapse anywhere I looked.


Pushed k=8 out to p=1400 just to be sure it eventually turns over -- it does not. Corr stays 0.88-0.98 positive the whole way. So the bitlen/K ratio idea is already in trouble: there's no collapse point for k=8 to even compute a ratio from in this range.


k=13 is different again: at [20,500) split 100, corr is +0.59/+0.86 for p<100 (tiny n=3 for target class though, don't trust that part) then flips to -0.91/-0.85 for p in [100,500). Extended to 900: still steeply negative, -0.98/-0.96. So k=13 has no flat plateau at all -- it peaks somewhere under p=100 and declines steadily from there, a totally different shape from k=11's long flat plateau to p=600 then cliff.


Structural note worth keeping: at depth=k-4, slots=K-depth=(k+1)-(k-4)=5 for every single k. So the constant that differs across k=8/11/13 is NOT slots in the margin formula, it must be how bestCovering and totalToCover individually scale with bitlen for that k's specific cover-matrix density. That's the mechanism question cycle 31 flagged as fallback #2, and now it's the only path left since the ratio idea doesn't even have three comparable collapse points to compare.


# Cycle 32: bitlen/K ratio does not organize the margin collapse across k

Tags: disproved

## Context

Cycle 31 ruled out a walk() sampling artifact as the cause of the k=11
raw-margin collapse at p~600 (both target-class and rest-class RANDOM-avg
margins go from flat, corr~-0.1 vs log(p), to steep, corr~-0.8 to -0.9,
right around p=600). Its Next list proposed reframing that collapse point
in terms of bitlen/K ratio (bitlen=p//2, K=k+1) instead of raw p, and
checking whether the SAME ratio predicts a collapse for k=8 and k=13.
k=11's collapse: p~600-650 -> bitlen~300-325 -> ratio ~27-30.

This requires a "collapse point" measured the same way for k=8 and k=13
that cycle 30 measured for k=11 -- not the p-value cliff from cycle 28,
which is a different quantity (cumulative significance of the target-vs-
rest gap, not the raw per-prime margin trend).

## Method

Generalized cycle 30's `tools/margin_vs_p_k11.py` (hardcoded K=11) into
`tools/margin_vs_p_k.py`, parameterized by k. For a given k, range
[lo,hi), and split point, it computes RANDOM-avg margin at depth=k-4 for
each prime, splits into target-class (p mod K1 == K1-1) and rest, and
reports corr(margin, log p) separately below and above the split.

Sanity check: reran k=11 with split=600 on [20,800) -- reproduced cycle
30 exactly (below: corr -0.13/-0.10 flat; above: corr -0.93/-0.76 steep).
Tool trusted.

Then ran k=8 and k=13 at the bitlen/K-matched split points (ratio~27,
translating to p~491 for k=8, p~764 predicted for k=13), samples=40-60,
seed=42.

## Result

**k=8**, depth=4, split=491 (ratio~27), range [20,700) then extended to
[20,1400):

```
[  20, 491) below  target: n=13 mean=12.03  corr=+0.985
[  20, 491) below  rest  : n=72 mean=13.01  corr=+0.965
[ 491, 700) above  target: n= 6 mean=22.29  corr=+0.969
[ 491, 700) above  rest  : n=26 mean=23.36  corr=+0.817
[  20, 800) below  target: n=22 mean=16.49  corr=+0.980   (extended run)
[  20, 800) below  rest  : n=109 mean=16.91 corr=+0.961
[ 800,1400) above  target: n=14 mean=32.53  corr=+0.922
[ 800,1400) above  rest  : n=69 mean=34.69  corr=+0.884
```

No flat plateau anywhere, no collapse anywhere. Margin rises steadily and
strongly (corr 0.82-0.99) with log(p) from p=20 all the way to p=1400 --
more than double the bitlen/K-matched split point, and 4x k=11's own
collapse-onset p. Target-vs-rest gap stays roughly constant in absolute
terms throughout (-0.98 at low p, -1.08 at 491-700, -2.16 at 800-1400).

**k=13**, depth=9, checked at split=100 on [20,500) then extended to 900:

```
[ 20, 100) below  target: n= 3 mean=3.48  corr=+0.593  (n=3, unreliable)
[ 20, 100) below  rest  : n=14 mean=3.31  corr=+0.863
[100, 500) above  target: n=11 mean=1.80  corr=-0.910
[100, 500) above  rest  : n=59 mean=2.92  corr=-0.845
[ 20, 500) below(split=500) target: n=14 mean=2.16  corr=-0.712
[ 20, 500) below(split=500) rest  : n=73 mean=2.99  corr=-0.420
[500, 900) above(split=500) target: n=11 mean=-8.22 corr=-0.982
[500, 900) above(split=500) rest  : n=48 mean=-5.89 corr=-0.960
```

k=13 has no flat plateau at all in the tested range. It appears to peak
somewhere under p=100 (weak, small-n signal) and then declines
increasingly steeply all the way from p=100 to p=900 -- there's no
window where corr sits near zero the way k=11's [20,600) does.

## Interpretation

The premise of the bitlen/K-ratio idea was that all three k's share the
same qualitative shape (flat plateau, then a collapse) and only differ in
*where* it happens. That premise is false. Three different shapes show up
at the three k values tested, at the exact depth (k-4) used throughout
this line of work:

- k=8: monotonically **rising**, strongly, with no turnover in [20,1400).
- k=11: **flat** to p~600, then a sharp **collapse** (cycle 30/31).
- k=13: **no flat region** -- declining from very early (~p=100) onward,
  increasingly steeply.

Since k=8 never collapses in the range tested and k=13 never has a flat
region to collapse *from*, there is no comparable "collapse onset" to
take a ratio of for two of the three k's. The bitlen/K ratio idea is
disproved as formulated -- not by ratios failing to match, but one level
up: the shapes being compared aren't the same shape.

One structural fact worth keeping: at depth=k-4 (the depth used
throughout this project's k-8/k-11/k-13 work), `slots = K - depth =
(k+1) - (k-4) = 5` is a **constant, identical for every k**. So the
divergence in trend (rising vs flat-then-falling vs falling-throughout)
cannot come from the `slots` term in `margin_at()` -- it must come from
how `bestCovering`, `bestCovering_next`, and `totalToCover` individually
scale with bitlen, and that scaling is apparently k-specific (probably a
function of the cover-matrix density, which depends on K in a way not
yet characterized).

This is the fifth k-organizing-pattern candidate to die here (after
monotone-in-k, prime-K1, parity-of-k, remaining/bitlen-ratio) -- adding
to the "do not re-propose" list.

## Next

1. Cycle 31's fallback #2, now the only path left: decompose
   `margin_at()`'s three terms (`bestCovering_next`, `bestCovering`,
   `totalToCover`) individually vs log(p) for k=8 and k=13, to see which
   term(s) drive the rising vs falling trend, and whether `totalToCover`
   (which is roughly `bitlen - popcount(covered)`, i.e. close to linear
   in bitlen minus a small constant) is the common denominator that
   flips the sign depending on how fast `bestCovering*4` grows relative
   to it.
2. k=13 having no flat region at all raises a real question about
   cycle 21's original "k=13 significant at small range" result: was
   that riding this same monotonic decline (a real but boring trend,
   not evidence of target-vs-rest structure) rather than a genuine
   class effect? Worth directly comparing the target-vs-rest *gap*
   trend (not raw margin trend) for k=13 across the same windows here.
3. Still open: bounded-window bisection at other k, K-4/K-3 within-seed
   correlation (#23, 10 cycles untouched), p=307 k=13 sieve run status
   (Track A infra).

## Wall, k=13 I(13,p,1): p199:4,748,938 p211:6,930,895 p223:226,264 p227:2,667,353 p251:40,822 p293:7,903 p307:5,688. p307 (-1 mod14) RUN_STARTED, 6+ restarts through cycle 22, still not re-checked. Track A infra question.
## Established
- Cycle 8 PROVED: pre-DFS remaining[] constant; closed form p//(k+1).
- Literal early_return_bound() margin (tools/bound_margin_k.py) on RANDOM-avg descent paths is a genuine, stress-tested signal for -1-mod-(k+1) primes at k=8, k=11, k=13 -- but ONLY within each k's own bounded prime range, not universally.
- CYCLE 27-31: the k=11 significance loss vs range is not a threshold artifact or sampling artifact -- both target-class and rest-class raw RANDOM-avg margins (at depth k-4) are flat vs log(p) for p<600 (corr~-0.1) then collapse together steeply (corr~-0.8 to -0.9) for p>=600. walk() dead_end=0% at every prime tested in [20,800), ruling out sampling. The collapse is a real property of margin_at()'s arithmetic as bitlen grows relative to K=11.
- CYCLE 32 DISPROVED the natural follow-up: that this flat-then-collapse *shape* generalizes to k=8/k=13 at a shared bitlen/K ratio. Built tools/margin_vs_p_k.py (k-generalized version of the k=11-only script) and measured raw RANDOM-avg margin vs log(p) at depth=k-4 for k=8 (range [20,1400)) and k=13 (range [20,900)). Result: THREE DIFFERENT SHAPES. k=8 rises monotonically and strongly (corr +0.82 to +0.99) with no turnover anywhere in [20,1400) -- 2x+ past where the ratio-matched split would predict a collapse. k=13 has NO flat region at all -- declines from as early as p~100 onward, increasingly steeply (corr -0.42 down to -0.98) through p=900. Only k=11 has the flat-plateau-then-cliff shape. Since two of three k's don't even have a comparable collapse point, the bitlen/K ratio comparison is moot -- disproved one level up from a simple ratio mismatch. Structural note: at depth=k-4, slots=K-depth=5 is IDENTICAL for every k (algebra: (k+1)-(k-4)=5), so the divergent trend must come from how bestCovering/bestCovering_next/totalToCover individually scale with bitlen for each k's cover-matrix density -- not yet characterized.
- CYCLE 28 (still true): p-value-cliff location (where target-vs-rest significance crosses 0.05) does NOT scale with k or K1=k+1. k=8 (~347) and k=13 (~350-400) land almost together despite k differing by 5; k=11 (~765) is the outlier. NOTE: this is a different quantity from cycle 32's raw-margin trend -- worth reconciling (see Next).
- 13 k values tested at small range: 5,6,7,8,9,10,11,12,13,14,15,16,17. Only 3 give unambiguous small-range-significant results (8, 11, 13); 2 borderline (7, 9); 8 flat. CAVEAT: each checked at only one range per k -- table validity now doubly suspect given both range-dependence (cycle 28) and shape-non-universality (cycle 32).
- DISPROVED (#23): effect strengthens monotonically with k.
- DISPROVED (#24): prime-K1 pattern -- broken by k=14.
- DISPROVED (#25): parity-of-k pattern -- broken by k=15 and k=17.
- DISPROVED (#26): remaining[]/bitlen ratio (~2/(k+1)) as an organizing threshold -- k=10 non-monotonic counter-example.
- DISPROVED (cycle 28, informal): p-value cliff location scales with k or K1 -- k=11 is an outlier vs k=8/k=13.
- DISPROVED (cycle 29): the k=11 p-value cliff at hi~760-770 is a threshold artifact, not a structural break -- the underlying gap declines smoothly through that region.
- DISPROVED (cycle 32): bitlen/K ratio organizes the raw-margin collapse across k -- k=8 never collapses in range tested, k=13 has no flat region to collapse from; the k=11 flat-then-cliff shape is not universal.
- SURVIVING IDEA, STILL UNDER CLOUD: bounded window k in 7-13 (only k tested there give small-range signal; outside it, flat). Built entirely from single-range-per-k tests -- known to be unreliable per cycle 28/29/32.
- Margin formula component decomposition (bestCovering, totalToCover): doesn't cleanly separate flat vs significant k (cycle 27) -- now the leading candidate again (cycle 32) to explain WHY k=8/k=11/k=13 have different raw-margin-vs-p shapes.
- Budget term R(k,p) fit to k=13 wall data is DISPROVED as a mechanism (#570).
## Ruled out
- Flat at real k=13: depth-0 coverage state, depth-1 remaining[] shape, raw survivor count, pairwise/triple witness codegree, greedy covering on the real mCover object.
- Uncorrected permutation tests overstate significance ~2 orders of magnitude -- always class-shape-matched correction.
- Exact raw-survivor brute force shows no k=13-style collapse at k=3/k=4.
- Sample-size mismatch, rng-artifact explanations for k=8/13 significance -- ruled out by stress tests.
- One-or-two-outlier-prime explanation for the k=11 cliff -- ruled out cycle 29, the two boundary primes (761, 769) are unremarkable, the whole gap trend is smooth.
- Cumulative-running-average illusion as the explanation for the p~600 decay onset (cycle 30) -- ruled out by checking raw per-prime correlation split at p=600: it's genuinely flat before and steep after.
- walk() dead-end sampling artifact as the explanation for the p~600 collapse (cycle 31) -- ruled out, dead_end=0% at every prime in both [20,400) and [600,800), 30000 samples.
- bitlen/K ratio as a shared organizing variable for the margin collapse across k=8/11/13 (cycle 32) -- k=8 and k=13 don't share k=11's flat-then-collapse shape at all, so there's no comparable collapse point to take a ratio of.
- Monotone-in-k, covering-budget mechanism, prime-K1, parity-of-k, remaining/bitlen ratio threshold, cliff-scales-with-k -- do not re-propose any of these.
- Naive LEFTMOST-path or mismatched-wide-range component comparisons -- flat/null regardless of k, not a valid proxy for RANDOM-avg.
## Best line of attack
The raw RANDOM-avg margin at depth k-4 has three qualitatively different trends vs log(p) at k=8 (rising, no turnover to p=1400), k=11 (flat to p~600, then collapsing), k=13 (declining from p~100 onward, no flat region). At the shared depth k-4, slots=K-depth=5 is algebraically identical for all k, so the divergence must live in how bestCovering/bestCovering_next/totalToCover scale with bitlen differently per k -- these are the three raw terms inside margin_at() (tools/bound_margin_k.py margin_at()). Decomposing them individually vs log(p) for k=8 vs k=13 is the direct, not-yet-tried test to find the mechanism.
## Next step
Instrument margin_at() (or wrap bound_margin_k.py's walk()) to return bestCovering_next, bestCovering, and totalToCover separately (not just the combined margin) at depth k-4, and plot/tabulate each vs log(p) for k=8 (rising case) and k=13 (falling case) over a shared range like [20,500). Whichever term's growth-rate-vs-bitlen differs in sign or magnitude between k=8 and k=13 is the mechanism driving the shape difference. Secondary: reconcile cycle 28's p-value-cliff locations (~350 for both k=8 and k=13) with cycle 32's finding that k=8's raw margin never collapses and k=13's raw margin is already declining well before its own cliff -- these look like different phenomena wearing the same "cliff" language, worth being precise about which is which before citing either casually. Still open: bounded-window (7-13) re-check with bisection at other k, K-4/K-3 within-seed correlation (#23, 10 cycles untouched), p=307 k=13 sieve run status (Track A infra).

bitlen/K ratio does not organize the margin collapse across k=8/11/13


Picking up cycle 32's Next #1: decompose margin_at() into its three raw terms (bestCovering_next, bestCovering, totalToCover) and check each one's trend vs log(p) separately for k=8 and k=13, since slots=5 is identical for both so it can't be the cause of the rising-vs-falling divergence.


Found it. margin = bcn + 3*bc - ttc always (slots-1 is a constant 3 at depth=k-4 for every k, not k-dependent as I thought). So the whole rising-vs-falling divergence lives in the ratio R=(bcn+3bc)/ttc. For k=8 R starts ~1.46 at p=101 and falls to ~1.20 by p=691 but never crosses 1 (matches cycle 32: never collapses). For k=13 R starts ~1.56 at p=101 but crosses below 1 right around p=400, exactly where cycle 32 saw margin flip sign. For k=11 R sits right around 1 for p in 560-660, matching cycle 30/31's collapse zone exactly.


Checked whether bestCovering tracks the cover-row density 2/(K+1) I read out of build(): measured mean popcount(cover[i])/bitlen at p=401 for k=8/11/13 gives 0.2200/0.1650/0.1400 against predicted 0.2222/0.1667/0.1429 -- density formula confirmed empirically, not just eyeballed from the code. So R crossing 1 is governed by whether 4x bestCovering keeps pace with totalToCover as bitlen grows, and bestCovering's ceiling scales with that density. Density order (k=8 densest, k=13 sparsest) matches the crossover order (k=8 never crosses in range tested, k=11 crosses ~p=600, k=13 crosses earliest ~p=400) -- but a naive constant-density argument alone doesn't explain why k=8 (density 0.22, below a naive 1/4 threshold) still hasn't crossed by bitlen~700 -- there's an order-statistic (max-of-bitlen-rows) boost I haven't quantified, just flagging it honestly rather than overclaiming the mechanism is fully nailed down.


# Cycle 33: found the mechanism behind the rising/flat-collapse/falling split

Tags: empirical

## Context

Cycle 32 disproved that a shared bitlen/K ratio organizes the raw-margin
trend across k=8/11/13 -- the three k's have qualitatively different
shapes (k=8 rises with no turnover to p=1400, k=11 is flat then
collapses at p~600, k=13 declines from as early as p~100). Its Next #1
was to decompose `margin_at()`'s three raw terms (`bestCovering_next`,
`bestCovering`, `totalToCover`) individually vs log(p) for k=8 and k=13,
since `slots = K - depth = 5` is identical for every k at depth=k-4 and
so can't be the source of the divergence.

## Method

Wrote `tools/margin_components_k.py`, which reuses `bound_margin_k.py`'s
`build()`/`next_to_cover()` but records the three raw terms of
`margin_at()` separately (not just their combination) at depth=k-4,
averaged over RANDOM-avg walks (40 samples/prime, seed=42), for a range
of primes. Ran it for k=8, k=11, k=13 over [20,700)/[20,800).

## Result

First correction to my own framing: `slots - 1 = (K - depth) - 1`, and
since `depth = k - 4` and `K = k` (the code's convention throughout this
project -- K is passed as `k`, not `k+1`), `slots - 1 = k - (k-4) - 1 = 3`
for **every** k tested. So the exact identity is:

    margin = bestCovering_next + 3*bestCovering - totalToCover   (always)

Defining `R = (bcn + 3*bc) / ttc`, margin's sign is exactly the sign of
`R - 1`. Measured `R` at two representative primes per k:

```
k=8  (K=8,  depth=4):  p=101 (bitlen=50)  R=1.460  margin=+8.13
                        p=691 (bitlen=345) R=1.199  margin=+25.02
k=13 (K=13, depth=9):  p=101 (bitlen=50)  R=1.560  margin=+5.03
                        p=691 (bitlen=345) R=0.922  margin=-6.55
```

k=13's `R` crosses 1 right around p=397->401 (margin +1.55 -> -0.20),
exactly where cycle 32 located the sign flip. k=8's `R` falls steadily
(1.46 -> 1.20) but stays above 1 through the whole tested range, matching
cycle 32's "never collapses to p=1400".

Ran k=11 (K=11, depth=7) as a third check, since it's the one k with a
genuine flat-then-cliff shape (cycle 30/31). Margin there hovers close
to zero, flipping sign both ways, for p in [560,660] -- e.g. p=607
margin=+1.13, p=617 margin=+0.70, p=631 margin=+0.70, p=659 margin=+1.70,
alongside a p=743 margin=-0.23. This is exactly cycle 30/31's collapse
zone (p~600), now located as "R oscillating around 1", not just "gap
shrinks".

## Why R differs by k: row density

`build()`'s cover-row selection keeps `t` such that `rem*(K+1) < P` or
`(P-rem)*(K+1) < P` -- a fraction of roughly `2/(K+1)` of the `t` values
per row. Checked this isn't just a code-reading guess: measured actual
mean `popcount(cover[i])/bitlen` at p=401:

```
k=8:  predicted 2/(K+1)=0.2222   measured 0.2200
k=11: predicted 2/(K+1)=0.1667   measured 0.1650
k=13: predicted 2/(K+1)=0.1429   measured 0.1400
```

Confirmed to 2 decimal places. `bestCovering` is (roughly) this density
times `totalToCover`, boosted by an order-statistic effect (it's the
*max* over `bitlen` candidate rows, not the mean). `R > 1` requires
`4 * bestCovering` to keep pace with `totalToCover` as bitlen grows.
Sparser rows (larger K) means `bestCovering` grows more slowly relative
to `totalToCover`, so `R` drifts down faster and crosses 1 sooner. The
observed crossover order matches the density order exactly: k=8
(density 0.22, no crossover in range tested) > k=11 (0.165, crosses
~p=600) > k=13 (0.143, crosses earliest, ~p=400).

**Caveat, stated honestly**: a naive "row density above 1/4" threshold
(since margin needs `4*bc >~ ttc`, i.e. `bc/ttc >~ 1/4`, roughly
`density >~ 1/4` in expectation) would predict k=8 (density 0.22, already
below 1/4) should *also* eventually cross -- it hasn't, out to bitlen 345
(p=691) or even bitlen 700 (p=1400, cycle 32). So the order-statistic
boost from taking a max over `bitlen` rows is doing real, unquantified
work that keeps k=8 above the naive mean-density threshold; I have not
measured how that boost itself scales with bitlen or K. That's the open
piece, not "mechanism fully solved."

## Interpretation

This resolves cycle 32's open question one level deeper: the
rising/flat-collapse/falling split across k=8/11/13 is not three
unrelated phenomena. It's one phenomenon -- the ratio `R =
(bestCovering_next + 3*bestCovering) / totalToCover` racing toward or
away from 1 as bitlen grows -- and the *rate* of that race is set by the
cover-row density `~2/(K+1)`, which shrinks as K grows. Sparser rows
(bigger K) means the greedy per-step covering capacity can't keep pace
with the growing number of bits still needing coverage, so R falls
through 1 sooner (or, for k=8's still-dense rows, not at all in the
range tested).

This is still descriptive of the *pruning bound's* behavior, not yet
connected to the target-vs-rest residue-class effect that's the actual
object of this project's search (the p mod (k+1) == k class).
Everything here was computed on RANDOM-avg walks pooling all residue
classes together -- I have not yet checked whether R's crossover point
or slope differs *by class* for a fixed k.

## Next

1. Split R (or its components) by residue class p mod (k+1) for k=11
   around its p~560-660 near-1 zone: does the target class cross R=1 at
   a different p than the rest class? That would connect this mechanism
   directly to the class-effect question this whole project is chasing,
   rather than just explaining the k-to-k shape difference.
2. Quantify the order-statistic boost mentioned in the caveat: for a
   fixed bitlen, how does `bestCovering - density*totalToCover` (the
   "excess over the naive mean") scale with `bitlen` and with density?
   If it scales like `sqrt(density*(1-density)*ttc*log(bitlen))` (order
   stats over ~bitlen roughly-independent binomial-ish counts), that
   would predict a K threshold to test for.
3. Still open: bounded-window bisection at other k, K-4/K-3 within-seed
   correlation (#23, 10 cycles untouched), p=307 k=13 sieve run status
   (Track A infra, still not re-checked since cycle 22).

## Wall, k=13 I(13,p,1): p199:4,748,938 p211:6,930,895 p223:226,264 p227:2,667,353 p251:40,822 p293:7,903 p307:5,688. p307 (-1 mod14) RUN_STARTED, 6+ restarts through cycle 22, still not re-checked. Track A infra question.
## Established
- Cycle 8 PROVED: pre-DFS remaining[] constant; closed form p//(k+1).
- Literal early_return_bound() margin (tools/bound_margin_k.py) on RANDOM-avg descent paths is a genuine, stress-tested signal for -1-mod-(k+1) primes at k=8, k=11, k=13 -- but ONLY within each k's own bounded prime range, not universally.
- CYCLE 32 disproved bitlen/K ratio as a shared organizing variable: k=8/11/13 have qualitatively different raw-margin-vs-log(p) shapes (rising / flat-then-cliff / falling-from-the-start).
- CYCLE 33 (this cycle) found the mechanism one level deeper. margin_at()'s exact identity at depth=k-4 (where K=k in this code's convention) is margin = bestCovering_next + 3*bestCovering - totalToCover -- the "3" is a CONSTANT for every k (slots-1 = k-(k-4)-1 = 3 always), so it cannot be the source of the k-to-k divergence. Defining R = (bcn+3*bc)/ttc, margin's sign is exactly sign(R-1). Measured: k=8's R falls from 1.46 (p=101) to 1.20 (p=691) but never crosses 1 in range tested (matches cycle 32's "never collapses"). k=13's R falls from 1.56 (p=101) and crosses below 1 right at p~400 (margin +1.55 at p=397 -> -0.20 at p=401), exactly matching cycle 32's sign-flip location. k=11's R oscillates around 1 for p in [560,660], matching cycle 30/31's flat-then-collapse zone exactly. All three k's are the SAME phenomenon (R racing toward/away from 1), differing only in rate.
- CYCLE 33: that rate is set by cover-row density ~2/(K+1), confirmed empirically (not just read from code): measured mean popcount(cover[i])/bitlen at p=401 gives 0.220/0.165/0.140 for k=8/11/13 vs predicted 0.222/0.167/0.143. Density order (k=8 densest > k=11 > k=13 sparsest) matches crossover order exactly (k=8 no crossover in range tested, k=11 crosses ~p=600, k=13 crosses earliest ~p=400). CAVEAT: a naive density>1/4 mean-threshold predicts k=8 (density 0.22, already <0.25) should also eventually cross -- it hasn't out to bitlen=700 (cycle 32) -- so an unquantified order-statistic (max-of-bitlen-rows) boost is doing real work for k=8 that hasn't been measured. Mechanism is real but not fully closed.
- All of this (cycle 33) is on RANDOM-avg walks pooling ALL residue classes together -- NOT yet split by class, so it explains the k-to-k shape difference but does NOT yet connect to the target-class-vs-rest effect that's the actual object of this search.
- CYCLE 28 (still true): p-value-cliff location (where target-vs-rest significance crosses 0.05) does NOT scale with k or K1=k+1. k=8 (~347) and k=13 (~350-400) land almost together despite k differing by 5; k=11 (~765) is the outlier. This is a DIFFERENT quantity from cycle 33's R-crossover (cumulative significance vs raw per-prime margin trend) -- still not formally reconciled, though cycle 33's k=13 R-crossover (~p=400) now lines up numerically with cycle 28's k=13 p-value cliff (~350-400), which is suggestive but not yet directly tested.
- 13 k values tested at small range: 5,6,7,8,9,10,11,12,13,14,15,16,17. Only 3 give unambiguous small-range-significant results (8, 11, 13); 2 borderline (7, 9); 8 flat. CAVEAT: each checked at only one range per k -- table validity now doubly suspect given both range-dependence (cycle 28) and shape-non-universality (cycle 32).
- DISPROVED (#23): effect strengthens monotonically with k.
- DISPROVED (#24): prime-K1 pattern -- broken by k=14.
- DISPROVED (#25): parity-of-k pattern -- broken by k=15 and k=17.
- DISPROVED (#26): remaining[]/bitlen ratio (~2/(k+1)) as an organizing threshold -- k=10 non-monotonic counter-example.
- DISPROVED (cycle 28, informal): p-value cliff location scales with k or K1 -- k=11 is an outlier vs k=8/k=13.
- DISPROVED (cycle 29): the k=11 p-value cliff at hi~760-770 is a threshold artifact, not a structural break -- the underlying gap declines smoothly through that region.
- DISPROVED (cycle 32): bitlen/K ratio organizes the raw-margin collapse across k -- k=8 never collapses in range tested, k=13 has no flat region to collapse from; the k=11 flat-then-cliff shape is not universal. (Superseded/explained by cycle 33's R-ratio mechanism.)
- SURVIVING IDEA, STILL UNDER CLOUD: bounded window k in 7-13 (only k tested there give small-range signal; outside it, flat). Built entirely from single-range-per-k tests -- known to be unreliable per cycle 28/29/32.
- Budget term R(k,p) fit to k=13 wall data is DISPROVED as a mechanism (#570).
## Ruled out
- Flat at real k=13: depth-0 coverage state, depth-1 remaining[] shape, raw survivor count, pairwise/triple witness codegree, greedy covering on the real mCover object.
- Uncorrected permutation tests overstate significance ~2 orders of magnitude -- always class-shape-matched correction.
- Exact raw-survivor brute force shows no k=13-style collapse at k=3/k=4.
- Sample-size mismatch, rng-artifact explanations for k=8/13 significance -- ruled out by stress tests.
- One-or-two-outlier-prime explanation for the k=11 cliff -- ruled out cycle 29, the two boundary primes (761, 769) are unremarkable, the whole gap trend is smooth.
- Cumulative-running-average illusion as the explanation for the p~600 decay onset (cycle 30) -- ruled out.
- walk() dead-end sampling artifact as the explanation for the p~600 collapse (cycle 31) -- ruled out, dead_end=0% at every prime in both [20,400) and [600,800), 30000 samples.
- bitlen/K ratio as a shared organizing variable for the margin collapse across k=8/11/13 (cycle 32) -- superseded by cycle 33: R=(bcn+3bc)/ttc racing toward 1 at a rate set by density~2/(K+1) is the real mechanism cycle 32's single-ratio framing didn't capture.
- Monotone-in-k, covering-budget mechanism, prime-K1, parity-of-k, remaining/bitlen ratio threshold, cliff-scales-with-k -- do not re-propose any of these.
- Naive LEFTMOST-path or mismatched-wide-range component comparisons -- flat/null regardless of k, not a valid proxy for RANDOM-avg.
## Best line of attack
Cycle 33 found the mechanism for the k-to-k shape difference in raw RANDOM-avg margin: R=(bestCovering_next+3*bestCovering)/totalToCover races toward/away from 1 at a rate set by cover-row density ~2/(K+1) (confirmed empirically). This explains WHY k=8/11/13 look different but is still class-blind (RANDOM-avg pools all residue classes). The open, not-yet-tried step that would connect this mechanism back to the actual object of the search is splitting R (or bestCovering specifically) by residue class p mod (k+1) to see if the target class (p == -1 mod k+1) crosses R=1 at a systematically different bitlen than the rest class, for the k=11 case where there's a clean near-1 zone (p in [560,660]) to examine class-by-class.
## Next step
Modify tools/margin_components_k.py (or a new script built on it) to report R / bestCovering / totalToCover separately by class (target = p mod (k+1) == k, vs rest) for k=11 over p in [400,800), the range spanning its near-1 zone. Look for a systematic offset in where each class's R crosses 1 -- that would be the first direct empirical link between this mechanism-level work and the residue-class effect that's the actual subject of tracks B/C. Secondary: quantify the order-statistic "boost" (max-of-bitlen-rows over mean) that's keeping k=8's R above 1 out to bitlen=700 when naive mean-density (0.22<0.25) predicts it should also cross -- try fitting boost ~ sqrt(density*(1-density)*ttc*log(bitlen)) against measured bc - density*ttc. Still open: bounded-window (7-13) re-check with bisection at other k, K-4/K-3 within-seed correlation (#23, 10 cycles untouched), p=307 k=13 sieve run status (Track A infra).

margin_at() decomposed: R=(bcn+3bc)/ttc racing to 1 explains rising/flat-collapse/falling split, driven by cover-row density ~2/(K+1)


Picking up cycle 33's Next #1: split R = (bestCovering_next + 3*bestCovering)/totalToCover by residue class p mod (k+1) for k=11, over the p in [400,800) range that spans its near-1 zone (560-660). If the target class -1 mod 12 crosses R=1 at a different bitlen than the rest class, that directly links the mechanism to the actual class-effect question. 15 target primes, 46 rest primes in that range with k=11 -- enough to see a trend, thin but usable.


Scheduled check. The mirror had deadlocked itself: the guard that stops it reacting to its own push was also firing on scheduled runs, so once the head commit was a mirror commit every later run skipped the commit step while still reporting success. The repository sat 89 events behind for two hours. Fixed and caught up at 651 events. A green run is not a working pipeline.


Independently checked the cover density the last cycle read out of the solver: 2/(k+1) predicted against 0.2219, 0.1671, 0.1421 measured directly at p=401 for k=8, 11, 13. It holds, and the small deficit is the floor. Meanwhile p=307 came in at 5,688 tuples, the fourth prime in the -1 class and still collapsing against 6.9 million at p=211, though the step from 293 to 307 is only 1.4x where the earlier ones were above 5x, so the collapse is flattening.


Found it: fit R = a + b*log(p) + c*is_target by least squares (R from cycle 33's decomposition, at depth=k-4) and permutation-test c (5000 shuffles of the class label over the same primes). For k=11 [400,800): c=-0.013, permutation p=0/5000. For k=13 [200,700): c=-0.031, p=0/3000. For k=8 [200,800), the k that never crosses R=1 at all in range: c=-0.015, p=0/3000. All three k give a significant NEGATIVE target-class offset -- the target class p=-1 mod(k+1) systematically has a lower R (closer to or below the margin=0 threshold) than the rest class, at the same log(p), in all three k tested. This is the first time this cycle-33 mechanism has connected directly to the actual class-effect question.