wip(assembler): round L32 -- smooth Gradient interface at full amplitude (no rings, not flat)
Band faces now use signed distance to the displaced solid intervals, continuous across bands, so MC interpolates the interface instead of terracing at density levels. The Gradient amplitude is restored to width/8 (about 4 m peak-to-peak at 16 m). Ring/terrace audit at LOD0-8 on the FI floor and SW ceiling passes; negative controls: L30 (rings) and L31 (flat) both fail. Hole/interface audits, 16 passage rows and 24/24 determinism pass. Evaluator 20. Cost vs L31 SW +1.9%, FI +1.5%. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CSFYgsdW8ejZSyiMf4qRSX
This commit is contained in:
1 parent
28069f0d98
commit
d0158c6019
31 files changed
+2207
-111
No files matched your search
@@ -0,0 +1,104 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Run five interleaved whole-view pairs against the L31 binary."""
|
||||
import os
|
||||
import re
|
||||
import statistics
|
||||
import subprocess
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[4]
|
||||
OUT = ROOT / "Saved/Linux/l32"
|
||||
OUT.mkdir(parents=True, exist_ok=True)
|
||||
RUN_TAG = os.environ.get("VOXELFORGE_COST_TAG", "").strip()
|
||||
BINARIES = {
|
||||
"l31": ROOT / "Saved/Linux/l31/bin/VoxelForgeCoreHeadless-linux31-clang",
|
||||
"l32": Path(os.environ.get("VOXELFORGE_L32_COST_BINARY",
|
||||
str(OUT / "bin/VoxelForgeCoreHeadless-l32-clang-v20"))),
|
||||
}
|
||||
ORDERS = (("l31", "l32"), ("l32", "l31"), ("l31", "l32"),
|
||||
("l32", "l31"), ("l31", "l32"))
|
||||
READY = re.compile(r"\bwhole_view_ready=([0-9.]+)s")
|
||||
rows = []
|
||||
failed = False
|
||||
|
||||
|
||||
for recipe in ("surface-world", "floating-islands"):
|
||||
for pair, order in enumerate(ORDERS, 1):
|
||||
for build in order:
|
||||
tag = f"-{RUN_TAG}" if RUN_TAG else ""
|
||||
name = f"cost{tag}-{recipe}-pair{pair}-{build}"
|
||||
logfile = OUT / f"{name}.log"
|
||||
command = [
|
||||
"taskset", "-c", "0-11", "prlimit", "--as=6442450944", "--",
|
||||
str(BINARIES[build]), str(ROOT / "Standalone/data/owner_world.json"),
|
||||
"--workers=12", "--world-assembler-prototype", "--stream-benchmark",
|
||||
"--stream-pipeline", "--force-generate", "--clip-radius=3",
|
||||
"--max-clip-level=8", "--max-level=-1", f"--recipe={recipe}",
|
||||
]
|
||||
started = time.monotonic()
|
||||
try:
|
||||
with logfile.open("w", encoding="utf-8") as stream:
|
||||
result = subprocess.run(command, stdout=stream, stderr=subprocess.STDOUT,
|
||||
timeout=900, check=False)
|
||||
except subprocess.TimeoutExpired:
|
||||
result = None
|
||||
elapsed = time.monotonic() - started
|
||||
text = logfile.read_text(encoding="utf-8", errors="replace")
|
||||
matches = READY.findall(text)
|
||||
if build == "l32":
|
||||
stamps = re.findall(
|
||||
r"^\[WorldAssemblerRecipeAudit\] requested=([^ ]+) actual=([^ ]+).*status=([^ ]+)$",
|
||||
text, re.M)
|
||||
actual_recipe = stamps[0][1] if len(stamps) == 1 else "missing"
|
||||
stamp_ok = stamps == [(recipe, recipe, "PASS")]
|
||||
else:
|
||||
configured = re.findall(r"^\[HeadlessConfig\].*\brecipe=([^\s]+)", text, re.M)
|
||||
actual_recipe = configured[0] if len(configured) == 1 else "missing"
|
||||
floating_plan = "[FloatingIslandWorldAssembly]" in text
|
||||
surface_plan = "[WorldAssemblerPrototype]" in text
|
||||
plan_matches = ((actual_recipe == "floating-islands" and floating_plan)
|
||||
or (actual_recipe == "surface-world" and not floating_plan
|
||||
and surface_plan))
|
||||
marker = (f"[L32BaselineRecipeAudit] requested={recipe} actual={actual_recipe} "
|
||||
f"headless_recipe={configured[0] if len(configured) == 1 else 'missing'} "
|
||||
f"floating_island_plan={'present' if floating_plan else 'absent'} "
|
||||
f"surface_world_plan={'present' if surface_plan else 'absent'} "
|
||||
f"status={'PASS' if actual_recipe == recipe and plan_matches else 'FAIL'}\n")
|
||||
with logfile.open("a", encoding="utf-8") as stream:
|
||||
stream.write(marker)
|
||||
text += marker
|
||||
stamp_ok = actual_recipe == recipe and plan_matches and len(configured) == 1
|
||||
valid = (result is not None and result.returncode == 0 and len(matches) == 1
|
||||
and "hash=off" in text and "cache_hits=0" in text and stamp_ok)
|
||||
ready = float(matches[0]) if len(matches) == 1 else float("nan")
|
||||
rows.append((recipe, pair, build, ready, elapsed,
|
||||
result.returncode if result else "TIMEOUT", valid))
|
||||
print(f"{recipe} pair={pair} build={build} whole_view_ready={ready:.3f}s "
|
||||
f"process_elapsed={elapsed:.1f}s {'PASS' if valid else 'FAIL'}", flush=True)
|
||||
failed |= not valid
|
||||
|
||||
summary = OUT / (f"cost-runs-{RUN_TAG}.csv" if RUN_TAG else "cost-runs.csv")
|
||||
summary.write_text(
|
||||
"recipe,pair,build,whole_view_ready_seconds,process_elapsed_seconds,exit_code,status\n" +
|
||||
"".join(f"{recipe},{pair},{build},{ready:.6f},{elapsed:.3f},{code},"
|
||||
f"{'PASS' if ok else 'FAIL'}\n"
|
||||
for recipe, pair, build, ready, elapsed, code, ok in rows), encoding="utf-8")
|
||||
|
||||
for recipe in ("surface-world", "floating-islands"):
|
||||
by_build = {build: [row[3] for row in rows if row[0] == recipe and row[2] == build]
|
||||
for build in BINARIES}
|
||||
l31 = statistics.median(by_build["l31"])
|
||||
l32 = statistics.median(by_build["l32"])
|
||||
paired = []
|
||||
for pair in range(1, 6):
|
||||
values = {row[2]: row[3] for row in rows if row[0] == recipe and row[1] == pair}
|
||||
paired.append((values["l32"] - values["l31"]) / values["l31"] * 100.0)
|
||||
print(f"[L32CostSummary] recipe={recipe} pairs=5 median_l31_s={l31:.3f} "
|
||||
f"median_l32_s={l32:.3f} median_change_pct={(l32/l31-1)*100.0:+.2f} "
|
||||
f"paired_change_pct={','.join(f'{value:+.2f}' for value in paired)}")
|
||||
|
||||
print(f"[L32Cost] runs={len(rows)} status={'FAIL' if failed else 'PASS'} summary={summary}",
|
||||
flush=True)
|
||||
raise SystemExit(1 if failed or len(rows) != 20 else 0)
|
||||
Reference in new issue
Block a user