Files
VoxelForge/Standalone/Research/WorldAssemblerM3/Linux137/RunL137SeedSweep.py
T
Fr0zkaandClaude Opus 5.5 05e78331fe core: A/A noise floor (±1%) and small hot-path trims for the cave planner (L137, output = v236)
Identical builds differ <=0.6% median; residual near-ready vs assembler/world is real: Surface World +2.9..+3.6%,
Vertical Shafts +4.0..+4.3%, Tunnel Network -3.6/+6.8%. Profile points at column-cache reads and the sweep lookup.
Removed an unused sample field and per-lookup shared_ptr refcounting. 16/16 seeds, fast tier, Clang/GCC green.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dhxM43dnWvUu2B5Ph1iG1
2026-11-01 03:22:55 +01:00

74 lines
3.7 KiB
Python

#!/usr/bin/env python3
"""Run the L137 composed passage and tile-seam audits for seeds 0 through 15."""
from __future__ import annotations
import json
import re
import subprocess
import time
from pathlib import Path
ROOT = Path(__file__).resolve().parents[4]
OUT = ROOT / "Saved/Linux/l137/seeds"
BIN = ROOT / "Saved/Linux/l137/fast/bin/VoxelForgeCoreHeadless-fast-clang"
DATA = ROOT / "Standalone/data/owner_world.json"
STAMP = "dcf2ffa55fd6d62b3c7faf76229c3b99c635868dc1b694fc6e8f39e738775a4e"
STAMP_RE = re.compile(r"^\[VoxelForgeSourceStamp\] sha256=([0-9a-f]+)$", re.M)
REQUIRED = {
"passage": re.compile(r"^\[ResolvedPassageAuditSummary\].*status=PASS$", re.M),
"seams": re.compile(r"^\[PassageTileSeamAudit\].*status=PASS$", re.M),
"shell": re.compile(r"^\[PassageShellAuditSummary\].*status=PASS$", re.M),
"naturalness": re.compile(r"^\[PassageNaturalnessSummary\].*status=PASS$", re.M),
"mouth_profile": re.compile(r"^\[PassageMouthProfileSummary\].*status=PASS$", re.M),
"ripple": re.compile(r"^\[PassageRippleAuditSummary\].*status=PASS$", re.M),
"route_negative_control": re.compile(
r"^\[TunnelNetworkBlockedRouteControl\].*expected=FAIL status=PASS$", re.M),
}
def main() -> int:
if not BIN.is_file() or not DATA.is_file():
raise SystemExit("missing L137 fast binary or owner fixture")
OUT.mkdir(parents=True, exist_ok=True)
results = []
for seed in range(16):
log = OUT / f"seed{seed}.log"
layout = OUT / f"seed{seed}.json"
command = ["taskset", "-c", "0-11", "prlimit", "--as=6442450944", "--",
"timeout", "1740s", str(BIN), str(DATA),
"--world-assembler-prototype", "--stream-benchmark", "--stream-pipeline",
"--workers=8", "--clip-radius=3", "--max-clip-level=8", "--max-level=0",
"--force-generate", f"--seed={seed}", "--recipe=surface-world",
"--audit-resolved-layout-passages", "--audit-passage-tile-seams",
f"--resolved-layout-output={layout}"]
started = time.monotonic()
with log.open("w", encoding="utf-8") as output:
result = subprocess.run(command, cwd=ROOT, stdout=output,
stderr=subprocess.STDOUT, check=False, timeout=1740)
content = log.read_text(encoding="utf-8", errors="replace")
found_stamp = STAMP_RE.search(content)
checks = {name: bool(pattern.search(content)) for name, pattern in REQUIRED.items()}
checks["source_stamp"] = found_stamp is not None and found_stamp.group(1) == STAMP
blocked = re.findall(r"^\[ResolvedPassageBlockedControl\].*detected=true$",
content, re.M)
checks["three_blocked_controls"] = len(blocked) == 3
passed = result.returncode == 0 and all(checks.values())
row = {"seed": seed, "exit": result.returncode, "passed": passed,
"checks": checks, "blocked_controls": len(blocked),
"elapsed_s": round(time.monotonic() - started, 3),
"log": str(log.relative_to(ROOT)), "layout": str(layout.relative_to(ROOT))}
results.append(row)
print("[L137SeedSweep] " + json.dumps(row, sort_keys=True), flush=True)
(OUT / "runs-partial.json").write_text(json.dumps(results, indent=2) + "\n")
if not passed:
raise SystemExit(f"seed {seed} failed composed audits; see {log}")
summary = {"source_stamp": STAMP, "seeds": list(range(16)),
"passed": len(results), "failed": 0, "results": results}
(OUT / "summary.json").write_text(json.dumps(summary, indent=2) + "\n")
print("[L137SeedSweepSummary] passed=16/16 status=PASS")
return 0
if __name__ == "__main__":
raise SystemExit(main())