PREREG_half_contra outcome: ACCEPTED (server = smoke in every projection cell; 0 violations in the guaranteed family).
'half': the step promises the root in the half near x (S >= 1/2) while the bracket line puts it in the far half (smaller |f| at the far end) -> halve.
half alone APS 2806 -> 2564 (!) CHA 3220 -> 3202
G2 + contra + rem + point + exp + half APS 2773 -> 2559 CHA 2073 -> 2047 both 4606 (all of H1-H4; goal kept)
per problem vs Chandrupatla: APS 98/17/38 p=2.7e-7, CHA 27/6/7 p=8e-4
contra + rem + point + exp + half (no G2) APS 2551 CHA 2044 both 4595 (H2 fails by 24)
with defect it does not combine (APS 2531 -> 2651): the two refuse overlapping steps.
fun9: 77 -> 68 (Chandrupatla 55); fun9.5 24 -> 16.
Server regression x2: 1204 passed, 1 failed = the paper-number check.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -424,3 +424,28 @@ def test_the_exp_limit_leaves_simple_roots_alone():
|
||||
guard="project", prestep=p)[1]
|
||||
for p in ("defect+flatanalogmempt", "defect+flatanalogmempt+exp")]
|
||||
assert n[0] == n[1], n
|
||||
|
||||
|
||||
# ---- PREREG_half_contra_2026-09-21: the half promised by the step vs the bracket ----
|
||||
@pytest.mark.parametrize("f,a,b", PROBS)
|
||||
@pytest.mark.parametrize("guard", ("project", "credit"))
|
||||
@pytest.mark.parametrize("pre", ("half", "defect+flatanalogmempt+exp+half",
|
||||
"contra+flatanalogmempt+exp+half"))
|
||||
def test_the_guarantee_holds_with_half(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_half_is_silent_on_a_line_and_breaks_the_fun9_flank():
|
||||
"""Measured before pinning: on [2e-4, 81] the flank costs 24 -> 16 in the best cell."""
|
||||
st = {}
|
||||
pure_root(lambda t: 3.0 * t - 1.0, -2.0, 5.0, XTOL, MAXFEV, similarity="ratio",
|
||||
scale="derived3", guard="project", prestep="half", stats=st)
|
||||
assert st.get("half_refused", 0) == 0
|
||||
n = [pure_root(_fun9, 0.0002, 81.0, XTOL, MAXFEV, similarity="ratio", scale="derived3",
|
||||
guard="project", prestep=p)[1]
|
||||
for p in ("defect+flatanalogmempt+exp", "defect+flatanalogmempt+exp+half")]
|
||||
assert n[1] < n[0], n
|
||||
|
||||
Reference in New Issue
Block a user