audit: interior-air gate and gap-true ripple fitter on the cave planner (L147, audit only)
Tunnel Network and Vertical Shafts 16-seed sweeps: 5,171,796 passage-interior capsule samples each, 0 solid; no-passage controls fire 48/48; masked-gap ripple controls 48/48. Only seed 2 fails (known interface 2-3 shell wall_missing, outside the interior). Owner hashes/plan/layout identical to HEAD. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016dhxM43dnWvUu2B5Ph1iG1
This commit is contained in:
1 parent
4f93f3fffb
commit
a0d7ab3a1a
4 files changed
+393
-25
No files matched your search
@@ -0,0 +1,137 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Run the L147 composed passage audit for all 16 owner seeds."""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import re
|
||||
import subprocess
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[4]
|
||||
OUT = ROOT / "Saved/Linux/l147/seeds"
|
||||
BIN = ROOT / "Standalone/bin/linux/VoxelForgeCoreHeadless-l147-clang"
|
||||
DATA = ROOT / "Standalone/data/owner_world.json"
|
||||
STAMP = "c6b8a100355e271ddc40eb5973569d2ff4e2ba8d9c628c72f8e0af2493f0609f"
|
||||
STAMP_RE = re.compile(r"^\[VoxelForgeSourceStamp\] sha256=([0-9a-f]+)$", re.M)
|
||||
BASELINES = {
|
||||
"tunnel-network": ROOT / "Saved/Linux/l135/optimized-seed-sweep.json",
|
||||
"vertical-shafts": ROOT / "Saved/Linux/l139/seeds/summary.json",
|
||||
}
|
||||
DISPATCH = {
|
||||
"tunnel-network": re.compile(
|
||||
r"^\[DensityDispatch\] strate=2 generator=TunnelNetwork "
|
||||
r"recipe=Core\.Caves\.PrimitiveField version=1 "
|
||||
r"bound_path=Caves-native adapter=FCavesFieldAdapter$", re.M),
|
||||
"vertical-shafts": re.compile(
|
||||
r"^\[DensityDispatch\] strate=3 generator=VerticalShafts "
|
||||
r"recipe=Core\.Caves\.PrimitiveField version=1 "
|
||||
r"bound_path=Caves-native adapter=FCavesFieldAdapter$", re.M),
|
||||
}
|
||||
ROUTES = {
|
||||
"tunnel-network": re.compile(
|
||||
r"^\[ResolvedStrateRouteAudit\] strate=2 .*unsupported=0 "
|
||||
r"grade_failures=0 .*status=PASS$", re.M),
|
||||
"vertical-shafts": re.compile(
|
||||
r"^\[ResolvedStrateRouteAudit\] strate=3 .*unsupported=0 "
|
||||
r"grade_failures=0 .*status=PASS$", re.M),
|
||||
}
|
||||
CONTROLS = {
|
||||
"tunnel-network": re.compile(
|
||||
r"^\[TunnelNetworkBlockedRouteControl\].*expected=FAIL status=PASS$", re.M),
|
||||
"vertical-shafts": re.compile(
|
||||
r"^\[VerticalShaftsBlockedRouteControl\].*expected=FAIL status=PASS$", re.M),
|
||||
}
|
||||
REQUIRED = {
|
||||
"passages": 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),
|
||||
"passage_interior": re.compile(
|
||||
r"^\[PassageInteriorCapsuleAuditSummary\].*status=PASS$", re.M),
|
||||
}
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--kind", choices=tuple(BASELINES), required=True)
|
||||
args = parser.parse_args()
|
||||
if not BIN.is_file() or not DATA.is_file():
|
||||
raise SystemExit("missing L147 Clang binary or composed owner fixture")
|
||||
baseline_path = BASELINES[args.kind]
|
||||
baseline = json.loads(baseline_path.read_text(encoding="utf-8"))
|
||||
baseline_results = {int(row["seed"]): row for row in baseline["results"]}
|
||||
OUT.mkdir(parents=True, exist_ok=True)
|
||||
mode_out = OUT / args.kind
|
||||
mode_out.mkdir(parents=True, exist_ok=True)
|
||||
results = []
|
||||
partial = mode_out / "runs-partial.json"
|
||||
for seed in range(16):
|
||||
log = mode_out / f"seed{seed}.log"
|
||||
layout = mode_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", "--density-dispatch-report",
|
||||
"--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:
|
||||
proc = subprocess.run(command, cwd=ROOT, stdout=output,
|
||||
stderr=subprocess.STDOUT, check=False, timeout=1740)
|
||||
content = log.read_text(encoding="utf-8", errors="replace")
|
||||
stamp = STAMP_RE.search(content)
|
||||
checks = {name: bool(pattern.search(content)) for name, pattern in REQUIRED.items()}
|
||||
checks["source_stamp"] = stamp is not None and stamp.group(1) == STAMP
|
||||
checks["dispatch"] = bool(DISPATCH[args.kind].search(content))
|
||||
checks["route"] = bool(ROUTES[args.kind].search(content))
|
||||
checks["blocked_route_control"] = bool(CONTROLS[args.kind].search(content))
|
||||
checks["three_passage_interiors"] = len(re.findall(
|
||||
r"^\[ResolvedPassageAudit\].*interior_air=PASS", content, re.M)) == 3
|
||||
checks["three_interior_negative_controls"] = len(re.findall(
|
||||
r"^\[ResolvedPassageInteriorNegativeControl\].*detected=true status=PASS$",
|
||||
content, re.M)) == 3
|
||||
checks["three_ripple_gap_controls"] = len(re.findall(
|
||||
r"^\[PassageRippleSamplingControl\].*status=PASS$", content, re.M)) == 3
|
||||
checks["three_blocked_passage_controls"] = len(re.findall(
|
||||
r"^\[ResolvedPassageBlockedControl\].*detected=true$", content, re.M)) == 3
|
||||
checks["passage_count"] = len(re.findall(
|
||||
r"^\[ResolvedPassageAudit\].*walkability=PASS$", content, re.M)) == 3
|
||||
checks["layout_output"] = layout.is_file()
|
||||
passed = proc.returncode == 0 and all(checks.values())
|
||||
prior = baseline_results.get(seed, {})
|
||||
prior_passed = bool(prior.get("passed", False))
|
||||
change = ("newly failing" if prior_passed and not passed else
|
||||
"newly passing" if not prior_passed and passed else
|
||||
"still passing" if prior_passed else "still failing")
|
||||
failed_checks = [name for name, ok in checks.items() if not ok]
|
||||
reason = (", ".join(failed_checks) if failed_checks else
|
||||
"all previous and new gates pass" if passed else
|
||||
f"process exit {proc.returncode}")
|
||||
row = {"kind": args.kind, "seed": seed, "prior_verdict": "PASS" if prior_passed else "FAIL",
|
||||
"verdict": "PASS" if passed else "FAIL", "change": change,
|
||||
"reason": reason, "exit": proc.returncode, "checks": checks,
|
||||
"elapsed_s": round(time.monotonic() - started, 3),
|
||||
"log": str(log.relative_to(ROOT)), "layout": str(layout.relative_to(ROOT))}
|
||||
results.append(row)
|
||||
print("[L147SeedSweep] " + json.dumps(row, sort_keys=True), flush=True)
|
||||
partial.write_text(json.dumps(results, indent=2) + "\n", encoding="utf-8")
|
||||
passed_count = sum(row["verdict"] == "PASS" for row in results)
|
||||
summary = {"kind": args.kind, "source_stamp": STAMP,
|
||||
"baseline": str(baseline_path.relative_to(ROOT)), "seeds": list(range(16)),
|
||||
"passed": passed_count, "failed": 16 - passed_count, "results": results}
|
||||
summary_path = mode_out / "summary.json"
|
||||
summary_path.write_text(json.dumps(summary, indent=2) + "\n", encoding="utf-8")
|
||||
print(f"[L147SeedSweepSummary] kind={args.kind} passed={passed_count}/16 "
|
||||
f"failed={16-passed_count} status={'PASS' if passed_count == 16 else 'FAIL'}",
|
||||
flush=True)
|
||||
return 0 if passed_count == 16 else 1
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Reference in new issue
Block a user