two more places for similarity: points='shape' (WHICH triple the model uses, argmin |phi-xi| over declared candidates — select, never weight) and direction='dissimilar' (the far end read by |f| rather than by distance); defaults bit-identical, P1-P5 pinned (7 green), inertness counters make an inert mode a failed EXPERIMENT rather than a pass; each grid writes to its own file
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+38
-2
@@ -111,10 +111,13 @@ def make_method(spec):
|
||||
sim, scale, guard = spec[1], spec[2], spec[3]
|
||||
space = spec[4] if len(spec) > 4 else "x"
|
||||
prestep = spec[5] if len(spec) > 5 else "none"
|
||||
points = spec[6] if len(spec) > 6 else "recent"
|
||||
direction = spec[7] if len(spec) > 7 else "distance"
|
||||
|
||||
def m(f, a, b, xtol, maxfev):
|
||||
return pure_root(f, a, b, xtol, maxfev, similarity=sim,
|
||||
scale=scale, guard=guard, space=space, prestep=prestep)
|
||||
scale=scale, guard=guard, space=space, prestep=prestep,
|
||||
points=points, direction=direction)
|
||||
return m
|
||||
|
||||
|
||||
@@ -124,6 +127,10 @@ def label(spec):
|
||||
tag = "pure"
|
||||
if len(spec) > 4 and spec[4] != "x":
|
||||
tag = spec[4]
|
||||
if len(spec) > 6 and spec[6] != "recent":
|
||||
tag = f"{tag}+shape"
|
||||
if len(spec) > 7 and spec[7] != "distance":
|
||||
tag = f"{tag}+dissim"
|
||||
if len(spec) > 5 and spec[5] != "none":
|
||||
# name the gate by WHICH gate it is: "progress" is a measured negative and must
|
||||
# never be confused with "slope" in a results file
|
||||
@@ -191,6 +198,23 @@ def build_grid_log(smoke):
|
||||
for sim in sims for sc in ("derived", "derived3") for gu in guards]
|
||||
|
||||
|
||||
def build_grid_points(smoke):
|
||||
"""Mode A (PREREG 2026-09-21): the triple chosen by shape, on top of the slope gate that
|
||||
already reached the project target. Three-point scale only — a triple must exist."""
|
||||
sims = ["ratio", "sqrt"] if smoke else sorted(PURE_SIMS)
|
||||
guards = ("credit", "project") if smoke else GUARD_MODES
|
||||
return [("pure", sim, "derived3", gu, "x", "slope", "shape", "distance")
|
||||
for sim in sims for gu in guards]
|
||||
|
||||
|
||||
def build_grid_direction(smoke):
|
||||
"""Mode B (PREREG 2026-09-21): the far end read by dissimilarity, on top of the slope gate."""
|
||||
sims = ["ratio", "sqrt"] if smoke else sorted(PURE_SIMS)
|
||||
guards = ("credit", "project") if smoke else GUARD_MODES
|
||||
return [("pure", sim, sc, gu, "x", "slope", "recent", "dissimilar")
|
||||
for sim in sims for sc in ("derived", "derived3") for gu in guards]
|
||||
|
||||
|
||||
def build_grid_slope(smoke):
|
||||
"""The slope-stability gate grid (PREREG 2026-09-21). Only derived scales: there must be
|
||||
a slope to judge. Baselines are not recomputed — they are in sweep_full.json."""
|
||||
@@ -231,7 +255,11 @@ def main():
|
||||
logmode = "--log" in sys.argv # the u-space grid, written to its OWN file
|
||||
gatemode = "--gate" in sys.argv # the pre-step gate grid, likewise
|
||||
slopemode = "--slope" in sys.argv # the slope-stability gate grid
|
||||
specs = (build_grid_slope(smoke) if slopemode else
|
||||
pointsmode = "--points" in sys.argv # mode A: triple by shape
|
||||
dirmode = "--direction" in sys.argv # mode B: far end by dissimilarity
|
||||
specs = (build_grid_points(smoke) if pointsmode else
|
||||
build_grid_direction(smoke) if dirmode else
|
||||
build_grid_slope(smoke) if slopemode else
|
||||
build_grid_gate(smoke) if gatemode else
|
||||
build_grid_log(smoke) if logmode else build_grid(smoke))
|
||||
t0 = time.time()
|
||||
@@ -249,6 +277,14 @@ 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 pointsmode or dirmode:
|
||||
base = "sweep_points" if pointsmode else "sweep_direction"
|
||||
out = f"{base}_smoke.json" if smoke else f"{base}.json"
|
||||
with open(out, "w", encoding="utf8") as fh:
|
||||
json.dump(results, fh)
|
||||
print(f"wrote {out} ({time.time() - t0:.0f}s total)", flush=True)
|
||||
report(results)
|
||||
return
|
||||
if slopemode:
|
||||
out = "sweep_slope_smoke.json" if smoke else "sweep_slope.json"
|
||||
with open(out, "w", encoding="utf8") as fh:
|
||||
|
||||
Reference in New Issue
Block a user