PREREG_flat_exp_limit outcome: ACCEPTED (server numbers equal to the smoke in every projection cell; 0 violations in the guaranteed family).

Translation limit of the analogy (f shrank, x-scale did not -> m = inf):
  defect + remembered + point + exp        APS 2531  CHA 1972  both 4503
  G2 + defect + remembered + point + exp   APS 2588  CHA 1997  both 4585
  G2 + contra + remembered + point + exp   APS 2773  CHA 2073  both 4846
  Chandrupatla                             APS 2787  CHA 2441  both 5228
Per problem against Chandrupatla now SIGNIFICANT ON BOTH SETS: G2+contra+rem+pt+exp APS 98/18/37 p=1.5e-7, CHA 28/3/9 p=0.0026; defect+rem+pt+exp APS 86/20/47 p=9e-4, CHA 27/3/10 p=0.0076.
NOT where predicted: fun9 only -1..-3; the gain is on the flat families (x^9 177 -> 161, x^19 339 -> 167).
Server regression x2: 1179 passed, 1 failed = the paper-number check.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
vvs
2026-09-21 18:44:23 +01:00
co-authored by Claude Opus 5
parent e887691d09
commit baa93963cf
8 changed files with 112 additions and 6 deletions
+18
View File
@@ -0,0 +1,18 @@
== no G2
flatanalogpt+exp APS 2807->2810 CHA 2338->2333 fun9 105->100 E1 ✓ E2 ✓ E3 ✗ E4 ✓ GOAL lost CHA vsCh 21/4/15 p=0.41
fun1:82 fun2:141 fun3:314 fun4:288 fun5:100 fun6:256 fun7:1000 fun8:52 fun9:100
flatanalogmempt+exp APS 2814->2815 CHA 2119->2039 fun9 104->99 E1 ✓ E2 ✓ E3 ✗ E4 ✓ GOAL lost CHA vsCh 29/4/7 p=0.00031
fun1:83 fun2:141 fun3:123 fun4:146 fun5:208 fun6:187 fun7:1000 fun8:52 fun9:99
defect+flatanalogmempt+exp APS 2532->2531 CHA 2164->1972 fun9 75->74 E1 ✓ E2 ✓ E3 ✓ E4 ✓ GOAL kept CHA vsCh 27/3/10 p=0.0076
fun1:100 fun2:144 fun3:123 fun4:146 fun5:161 fun6:167 fun7:1000 fun8:57 fun9:74
contra+flatanalogmempt+exp APS 2794->2792 CHA 2105->2020 fun9 80->77 E1 ✓ E2 ✓ E3 ✓ E4 ✓ GOAL lost CHA vsCh 29/4/7 p=0.00031
fun1:86 fun2:141 fun3:123 fun4:146 fun5:208 fun6:187 fun7:1000 fun8:52 fun9:77
== G2
flatanalogpt+exp APS 2780->2783 CHA 2221->2222 fun9 94->95 E1 ✗ E2 ✗ E3 ✗ E4 ✓ GOAL kept CHA vsCh 24/3/13 p=0.099
fun1:82 fun2:146 fun3:230 fun4:261 fun5:100 fun6:256 fun7:1000 fun8:52 fun9:95
flatanalogmempt+exp APS 2787->2788 CHA 2117->2077 fun9 93->96 E1 ✗ E2 ✓ E3 ✗ E4 ✓ GOAL lost CHA vsCh 29/3/8 p=0.00075
fun1:83 fun2:146 fun3:147 fun4:158 fun5:208 fun6:187 fun7:1000 fun8:52 fun9:96
defect+flatanalogmempt+exp APS 2589->2588 CHA 2177->1997 fun9 75->74 E1 ✓ E2 ✓ E3 ✓ E4 ✓ GOAL kept CHA vsCh 27/2/11 p=0.014
fun1:100 fun2:145 fun3:147 fun4:146 fun5:161 fun6:167 fun7:1000 fun8:57 fun9:74
contra+flatanalogmempt+exp APS 2775->2773 CHA 2119->2073 fun9 80->77 E1 ✓ E2 ✓ E3 ✓ E4 ✓ GOAL kept CHA vsCh 28/3/9 p=0.0026
fun1:98 fun2:146 fun3:147 fun4:158 fun5:208 fun6:187 fun7:1000 fun8:52 fun9:77
+8
View File
@@ -8,6 +8,8 @@ TOTALS (evaluations of f, failures charged 200)
+ G2 + analogy + ORDER POINT 2780 2221 5001
+ G2 + contra + rem. + ORDER PT 2775 2119 4894
+ defect + rem. + ORDER POINT 2532 2164 4696
+ G2 + contra + rem. + pt + EXP 2773 2073 4846
+ defect + rem. + pt + EXP 2531 1972 4503
Chandrupatla 2787 2441 5228
Brent 2889 4115 7004
TOMS748 2820 4000 6820
@@ -22,6 +24,8 @@ PER PROBLEM, ours against each rival: wins/ties/losses (sign-test p)
+ G2 + analogy + ORDER POINT Chandrupatla 95/20/38 p=8.2e-07 Brent 110/9/34 p=1.5e-10 TOMS748 97/15/41 p=2.1e-06
+ G2 + contra + rem. + ORDER PT Chandrupatla 98/18/37 p=1.5e-07 Brent 112/8/33 p=3e-11 TOMS748 98/15/40 p=8.5e-07
+ defect + rem. + ORDER POINT Chandrupatla 86/20/47 p=0.00091 Brent 101/12/40 p=2.9e-07 TOMS748 107/11/35 p=1.1e-09
+ G2 + contra + rem. + pt + EXP Chandrupatla 98/18/37 p=1.5e-07 Brent 112/8/33 p=3e-11 TOMS748 98/15/40 p=8.5e-07
+ defect + rem. + pt + EXP Chandrupatla 86/20/47 p=0.00091 Brent 101/12/40 p=2.9e-07 TOMS748 107/11/35 p=1.1e-09
CHA
proposed rule Chandrupatla 9/5/26 p=0.006 Brent 30/4/4 p=6.2e-06 TOMS748 31/1/8 p=0.00029
+ G2 (step pattern) Chandrupatla 10/3/27 p=0.0076 Brent 30/2/6 p=7e-05 TOMS748 31/1/8 p=0.00029
@@ -31,6 +35,8 @@ PER PROBLEM, ours against each rival: wins/ties/losses (sign-test p)
+ G2 + analogy + ORDER POINT Chandrupatla 24/3/13 p=0.099 Brent 30/2/6 p=7e-05 TOMS748 35/1/4 p=3.4e-07
+ G2 + contra + rem. + ORDER PT Chandrupatla 22/3/15 p=0.32 Brent 31/2/5 p=1.3e-05 TOMS748 36/1/3 p=3.6e-08
+ defect + rem. + ORDER POINT Chandrupatla 20/3/17 p=0.74 Brent 30/2/6 p=7e-05 TOMS748 34/1/5 p=2.4e-06
+ G2 + contra + rem. + pt + EXP Chandrupatla 28/3/9 p=0.0026 Brent 31/3/4 p=3.5e-06 TOMS748 37/1/2 p=2.8e-09
+ defect + rem. + pt + EXP Chandrupatla 27/3/10 p=0.0076 Brent 30/2/6 p=7e-05 TOMS748 35/1/4 p=3.4e-07
CHA PER FAMILY (ours / Chandrupatla)
fun1 fun2 fun3 fun4 fun5 fun6 fun7 fun8 fun9
@@ -42,4 +48,6 @@ CHA PER FAMILY (ours / Chandrupatla)
+ G2 + analogy + ORDER POINT 82 146 230 261 100 256 1000 52 94
+ G2 + contra + rem. + ORDER PT 94 146 144 143 252 208 1000 52 80
+ defect + rem. + ORDER POINT 99 144 132 141 177 339 1000 57 75
+ G2 + contra + rem. + pt + EXP 98 146 147 158 208 187 1000 52 77
+ defect + rem. + pt + EXP 100 144 123 146 161 167 1000 57 74
Chandrupatla 103 152 305 297 233 233 1000 63 55
+14 -3
View File
@@ -607,7 +607,7 @@ def _config3(x, fx, xp, fp, xp2, fp2):
return xi, phi, abs(x - xp), abs(fx - fp)
def _analogy_order(cur, past):
def _analogy_order(cur, past, translation=False):
"""The order m of the analogous pair, or None when the configuration is not nearer to
its own past than to the line phi = xi (or the pair's scales are undefined). The judgment
is ordinal; m = ln(f ratio) / ln(x ratio) is read, not chosen.
@@ -623,6 +623,12 @@ def _analogy_order(cur, past):
if best[2] <= 0.0 or best[3] <= 0.0 or cur[2] <= 0.0 or cur[3] <= 0.0:
return None
lx, lf = cur[2] / best[2], cur[3] / best[3]
if translation and math.isfinite(lx) and math.isfinite(lf) and 0.0 < lf < 1.0 <= lx:
# PREREG_flat_exp_limit 2026-09-21. f shrank while the step in x did not: the pair
# is similar by TRANSLATION (exp(x - 1) = exp(x)/e), the limit of scaling as the
# order grows without bound - steeper than any power. m = inf, the boundary of the
# same definition, not a new constant.
return math.inf
if not (math.isfinite(lx) and math.isfinite(lf)) or lx == 1.0 or lf <= 0.0:
return None
return math.log(lf) / math.log(lx)
@@ -758,11 +764,15 @@ def pure_root(f, a, b, xtol, maxfev, similarity="ratio", scale="derived",
# category variables below then carry the same string the old tests compared.
if "+" in prestep:
parts = prestep.split("+")
cats = ({"defect"}, {"contra"}, {"flatanalog", "flatanalogmem", "flatanalogpt",
cats = ({"defect"}, {"contra"}, {"exp"}, {"flatanalog", "flatanalogmem", "flatanalogpt",
"flatanalogmempt"})
if (len(parts) != len(set(parts)) or any(not any(p in c for c in cats) for p in parts)
or any(sum(p in c for p in parts) > 1 for c in cats)):
raise ValueError(f"unknown composite prestep {prestep!r}")
if "exp" in parts and not any(p.startswith("flatanalog") for p in parts):
# the translation limit changes how the analogy reads its order; without the
# flat regime there is no analogy to read (PREREG_flat_exp_limit)
raise ValueError("prestep component 'exp' needs a flatanalog* component")
elif prestep not in ("none", "progress", "slope", "band", "defect", "simpair", "flat",
"flat2", "flatcreep", "flatstick", "flatstickmid", "flatstickexit",
"flatjudge", "flatanalog", "flatanalogmem", "contra",
@@ -776,6 +786,7 @@ def pure_root(f, a, b, xtol, maxfev, similarity="ratio", scale="derived",
flat_mem = pre_flat in ("flatanalogmem", "flatanalogmempt")
flat_pt = pre_flat in ("flatanalogpt", "flatanalogmempt")
pre_contra = "contra" in parts
pre_exp = "exp" in parts # PREREG_flat_exp_limit: translation similarity, m = inf
if pre_dec != "none" and scale not in (
"derived3", "derived3_cap", "derived3_m", "bracket", "far"):
# the decision reads a TRIPLE; under the two-point scale there is no third point
@@ -1065,7 +1076,7 @@ def pure_root(f, a, b, xtol, maxfev, similarity="ratio", scale="derived",
cur = _config3(x, fx, x_prev, f_prev, x_prev2, f_prev2)
flag = (sticky_m is None and last_model and f_prev != 0.0
and fx / f_prev >= 0.25)
m_pair = _analogy_order(cur, configs)
m_pair = _analogy_order(cur, configs, translation=pre_exp)
steep = m_pair is not None and m_pair >= 2.0
if flat_mem:
if steep:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+24 -3
View File
@@ -285,6 +285,24 @@ def build_grid_orderpt(smoke):
for gu in guards for ext in ("none", "pattern") for pre in ORDERPT_PRESTEPS]
EXPLIMIT_BASES = ("flatanalogpt", "flatanalogmempt", "defect+flatanalogmempt",
"contra+flatanalogmempt")
def build_grid_explimit(smoke):
"""PREREG_flat_exp_limit_2026-09-21: every order-point variant without / with the
translation limit (m = inf), on the proposed rule with and without G2."""
presteps = ("none",) + tuple(p for b in EXPLIMIT_BASES for p in (b, b + "+exp"))
for pre in presteps[1:]:
x, _n, ok = pure_root(lambda t: t - 1.0, 0.0, 3.0, 1e-10, 100, similarity="ratio",
scale="derived3", guard="project", prestep=pre)
if not (ok and abs(x - 1.0) < 1e-8):
raise SystemExit(f"prestep={pre} preflight FAILED: refusing to report zeros")
guards = ("project", "credit") if smoke else GUARD_MODES
return [("pure", "ratio", "derived3", gu, "x", pre, "recent", "distance", "none", ext)
for gu in guards for ext in ("none", "pattern") for pre in presteps]
def build_grid_extrap2(smoke):
"""PREREG_extrapolation_gates_2026-09-21: the same cells as build_grid_extrap, every
one in all five modes (none, A, G1, G2, G3)."""
@@ -464,10 +482,12 @@ def main():
memmode = "--flatanalogmem" in sys.argv # the analogy remembered as a property of the run
dcmode = "--defcontra" in sys.argv # defect x contra x flat regime, composites
ptmode = "--orderpt" in sys.argv # split at the point from the pair's order
expmode = "--explimit" in sys.argv # the translation limit of the analogy, m = inf
combomode = "--combo" in sys.argv # modes A and B together
pointsmode = "--points" in sys.argv # mode A: triple by shape
dirmode = "--direction" in sys.argv # mode B: far end by dissimilarity
specs = (build_grid_orderpt(smoke) if ptmode else
specs = (build_grid_explimit(smoke) if expmode else
build_grid_orderpt(smoke) if ptmode else
build_grid_defcontra(smoke) if dcmode else
build_grid_flat(smoke, ("flatanalogmem", "flatanalog")) if memmode else
build_grid_flat(smoke, ("flatanalog", "flatstickexit")) if analogmode else
@@ -503,8 +523,9 @@ def main():
# the published sweep_full.json is what verify_article.py checks the paper
# against, so the log grid never writes into it
if ptmode or dcmode or memmode or analogmode or judgemode or exitmode or stickmode or creepmode or flat2mode or flatmode or ext2mode or extmode or decmode or ordermode or capmode or combomode or pointsmode or dirmode:
base = ("sweep_orderpt" if ptmode else
if expmode or ptmode or dcmode or memmode or analogmode or judgemode or exitmode or stickmode or creepmode or flat2mode or flatmode or ext2mode or extmode or decmode or ordermode or capmode or combomode or pointsmode or dirmode:
base = ("sweep_explimit" if expmode else
"sweep_orderpt" if ptmode else
"sweep_defcontra" if dcmode else
"sweep_flatanalogmem" if memmode else
"sweep_flatanalog" if analogmode else
+3
View File
@@ -23,6 +23,7 @@ def main():
full = load("sweep_full.json")
dc = load("sweep_defcontra.json")
op = load("sweep_orderpt.json")
ex = load("sweep_explimit.json")
rivals = {"Chandrupatla": full["chandrupatla"], "Brent": full["brent"],
"TOMS748": full["toms748"]}
ours = {
@@ -34,6 +35,8 @@ def main():
"+ G2 + analogy + ORDER POINT": op["pure+extP+flatanalogpt.ratio.derived3.project"],
"+ G2 + contra + rem. + ORDER PT": op["pure+extP+contra+flatanalogmempt.ratio.derived3.project"],
"+ defect + rem. + ORDER POINT": op["defect+flatanalogmempt.ratio.derived3.project"],
"+ G2 + contra + rem. + pt + EXP": ex["pure+extP+contra+flatanalogmempt+exp.ratio.derived3.project"],
"+ defect + rem. + pt + EXP": ex["defect+flatanalogmempt+exp.ratio.derived3.project"],
}
print("TOTALS (evaluations of f, failures charged 200)")
print(f" {'method':<32} {'APS':>6} {'CHA':>6} {'both':>6}")
+43
View File
@@ -381,3 +381,46 @@ def test_the_order_point_spares_simple_roots_and_beats_the_midpoint_on_powers():
_x, nmid, _ = pure_root(f, a, b, XTOL, MAXFEV, similarity="ratio", scale="derived3",
guard="project", prestep="flatanalogmem")
assert ok and npt < nmid, (npt, nmid)
# ---- PREREG_flat_exp_limit_2026-09-21: translation similarity, m = inf ----
@pytest.mark.parametrize("bad", ("exp", "defect+exp", "contra+exp"))
def test_exp_needs_the_flat_regime(bad):
with pytest.raises(ValueError):
pure_root(lambda t: t - 1.0, 0.0, 3.0, XTOL, MAXFEV, similarity="ratio",
scale="derived3", guard="project", prestep=bad)
def test_a_translated_exponential_pair_reads_an_infinite_order():
e = math.exp
old = _config3(3.0, e(3.0), 4.0, e(4.0), 5.0, e(5.0))
new = _config3(1.0, e(1.0), 2.0, e(2.0), 3.0, e(3.0)) # the same shape, moved by 2
assert new[0] == pytest.approx(old[0]) and new[1] == pytest.approx(old[1])
assert _analogy_order(new, [old]) is None # scaling reading: undefined
assert _analogy_order(new, [old], translation=True) == math.inf
p = lambda t: t ** 5 # noqa: E731
a = _config3(0.4, p(0.4), 0.8, p(0.8), 1.6, p(1.6))
b = _config3(0.1, p(0.1), 0.2, p(0.2), 0.4, p(0.4))
assert _analogy_order(b, [a], translation=True) == pytest.approx(5.0, rel=1e-9)
@pytest.mark.parametrize("f,a,b", PROBS)
@pytest.mark.parametrize("guard", ("project", "credit"))
@pytest.mark.parametrize("pre", ("flatanalogpt+exp", "defect+flatanalogmempt+exp",
"contra+flatanalogmempt+exp"))
def test_the_guarantee_holds_with_the_exp_limit(f, a, b, guard, pre):
x, n, ok = pure_root(f, a, b, XTOL, MAXFEV, similarity="ratio", scale="derived3",
guard=guard, prestep=pre)
assert ok and min(a, b) <= x <= max(a, b)
half = math.ceil(math.log2(abs(b - a) / XTOL))
assert n <= (2 * half + 3 if guard == "project" else half + 4), n
def test_the_exp_limit_leaves_simple_roots_alone():
for f, a, b in ((lambda t: 3.0 * t - 1.0, -2.0, 5.0),
(lambda t: t ** 3 - 2.0 * t - 5.0, 1.0, 4.0),
(lambda t: math.exp(t) - 2.0, 0.0, 3.0)):
n = [pure_root(f, a, b, XTOL, MAXFEV, similarity="ratio", scale="derived3",
guard="project", prestep=p)[1]
for p in ("defect+flatanalogmempt", "defect+flatanalogmempt+exp")]
assert n[0] == n[1], n