Files
VoxelForge/Standalone/Research/WorldAssemblerM3/Linux37/RunPassageAuditsL37.py
T
Fr0zkaandClaude Opus 5.5 753cc9c259 tools(verify): fast/medium/full verification tiers with a compiled-in source stamp (L39); research R6
BuildLinux.sh hashes a sorted manifest of compiled inputs into VOXELFORGE_SOURCE_STAMP, printed first by
every executable; Standalone/Tools/verify/verify.py checks it before and after each tier and records
binary/input hashes and the resolved recipe, style map and layout. Fast (163 s) runs on the canonical owner
world only and asserts FI Style 2 / SW Style 1; medium (8 min) and full (26 min) add the style matrix,
GCC, determinism and cost. Controls: stale source, mislabelled style-0 owner, all-black capture, L30/L31,
L35/L36 and the L38 step are all rejected. No geometry change; owner hashes identical to L37.
Research R6: leak table, generator contract and a 10-step metre-native migration plan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dhxM43dnWvUu2B5Ph1iG1
2026-10-23 15:27:52 +02:00

102 lines
5.1 KiB
Python

#!/usr/bin/env python3
"""Legacy L37 style-override passage matrix runner; prefer Tools/verify/verify.py."""
import re
import os
import shutil
import subprocess
import time
from pathlib import Path
ROOT = Path(__file__).resolve().parents[4]
OUT = ROOT / "Saved/Linux/l37"
BINARIES = {
"clang": OUT / "bin/VoxelForgeCoreHeadless-l37-final-clang",
"gcc": OUT / "bin/VoxelForgeCoreHeadless-l37-final-gcc",
}
RUNS = []
for recipe, filename in (
("floating-islands", "floating-islands"),
("surface-world", "surface-world"),
):
for style in range(4):
source = ROOT / f"Saved/Linux/linux25-owner-{filename}-style{style}.json"
name = f"style-override-{filename}-style{style}"
destination = OUT / "fixtures" / f"{name}.json"
destination.parent.mkdir(parents=True, exist_ok=True)
shutil.copyfile(source, destination)
RUNS.append((name, destination, recipe))
for style in range(4):
source = OUT.parent / "l33/fixtures" / f"sw-upper-tunnel-network-style{style}.json"
name = f"style-override-upper-sw-fixture-style{style}"
destination = OUT / "fixtures" / f"{name}.json"
destination.parent.mkdir(parents=True, exist_ok=True)
shutil.copyfile(source, destination)
RUNS.append((name, destination, "floating-islands"))
RECIPE = re.compile(r"^\[WorldAssemblerRecipeAudit\] requested=([^ ]+) actual=([^ ]+).*status=PASS$", re.M)
PASSAGE = re.compile(r"^\[ResolvedPassageAudit\].*walkability=PASS$", re.M)
MOUTH = re.compile(r"^\[PassageMouthProfileAudit\].*status=PASS$", re.M)
ROUTE = re.compile(r"^\[ResolvedStrateRouteAudit\].*mouth_binding=PASS status=PASS$", re.M)
CHECKS = (
r"^\[ResolvedLayoutStrict\] accepted=true issues=0 error=$",
r"^\[ResolvedLayoutValidatorControls\].*status=PASS$",
r"^\[PassageMouthProfileNegativeControl\].*source=L23_terraced_geometry.*detected=true$",
r"^\[PassageMouthProfileSummary\].*l23_terrace_negative_control=DETECTED status=PASS$",
r"^\[PassageNaturalnessSummary\].*l23_negative_control=DETECTED.*status=PASS$",
r"^\[PassageRippleAuditSummary\].*synthetic_spheres_negative_control=DETECTED max_amplitude_m=0\.035 floor_beaded_negative_control=DETECTED max_floor_amplitude_m=0\.015 status=PASS$",
r"^\[PassageOpenAirAuditSummary\].*violations=0.*l24_negative_control=DETECTED status=PASS$",
r"^\[PassageNoLongBridgeAudit\].*status=PASS$",
r"^\[PassageRockColumnAuditSummary\].*status=PASS$",
r"^\[ResolvedPassageAuditSummary\].*route_binding_failures=0 .*status=PASS$",
r"^\[Walkability\] PASS",
r"^\[FloorProfileBlend\].*negative_controls=step_detected/slope_detected status=PASS$",
)
rows = []
failed = False
for compiler, binary in BINARIES.items():
for name, data, recipe in RUNS:
logfile = OUT / f"passage-audit-{name}-{compiler}.log"
command = [
"taskset", "-c", "0-11", "prlimit", "--as=6442450944", "--",
"timeout", "1800s", str(binary), str(data), "--workers=12",
"--world-assembler-prototype", "--stream-benchmark", "--stream-pipeline",
"--force-generate", "--clip-radius=3", "--max-clip-level=8", "--max-level=-1",
f"--recipe={recipe}", "--audit-resolved-layout-passages",
]
started = time.monotonic()
try:
with logfile.open("w", encoding="utf-8") as stream:
result = subprocess.run(command, cwd=ROOT, stdout=stream,
stderr=subprocess.STDOUT, timeout=1800, check=False)
except subprocess.TimeoutExpired:
result = None
elapsed = time.monotonic() - started
output = logfile.read_text(encoding="utf-8", errors="replace")
stamp_ok = RECIPE.findall(output) == [(recipe, recipe)]
passages = len(PASSAGE.findall(output))
mouths = len(MOUTH.findall(output))
routes = len(ROUTE.findall(output))
checks_ok = all(re.search(pattern, output, re.M) for pattern in CHECKS)
ok = (result is not None and result.returncode == 0 and stamp_ok
and passages >= 1 and mouths == passages and routes >= 1 and checks_ok)
code = result.returncode if result is not None else "TIMEOUT"
rows.append((name, recipe, compiler, elapsed, code, passages, mouths, routes, ok))
failed |= not ok
print(f"[L37PassageAuditRun] case={name} compiler={compiler} recipe={recipe} "
f"elapsed={elapsed:.1f}s exit={code} passages={passages} "
f"profiles={mouths} routes={routes} {'PASS' if ok else 'FAIL'} "
f"log={logfile}", flush=True)
summary = OUT / "passage-audits.csv"
summary.write_text(
"case,recipe,compiler,elapsed_seconds,exit_code,passages,mouth_profiles,routes,status\n" +
"".join(f"{name},{recipe},{compiler},{elapsed:.3f},{code},{passages},{mouths},{routes},"
f"{'PASS' if ok else 'FAIL'}\n"
for name, recipe, compiler, elapsed, code, passages, mouths, routes, ok in rows),
encoding="utf-8")
print(f"[L37PassageAuditSummary] runs={len(rows)} pass={sum(row[-1] for row in rows)} "
f"fail={sum(not row[-1] for row in rows)} summary={summary}", flush=True)
raise SystemExit(1 if failed or len(rows) != 24 else 0)