The compiled-analytic stratum interval now certifies a legacy tile uniform only when it stays beyond the detail envelope (and smooth-min slack for solid) with no intersecting primitive, edit, native field, composer candidate, passage or active transition; everything else fails closed. The stream layer uses the proof for whole-tile skips; legacy sub-tile skips stay off (two block proofs failed the falsifier in TN). Falsifier: full-grid reference vs skip-enabled run, identical mesh/payload/topology hashes on every tile of all four owner views, Clang and GCC, W1/W8/W12; 20-camera sweep per strate, 0 violations; a too-tight control changed 3/184/233/238 tiles and was caught. Whole view (8 workers): SW 2.61->2.48, FI 7.18->5.05, TN 5.97->4.63, VS 2.70->2.40 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016dhxM43dnWvUu2B5Ph1iG1
109 lines
4.8 KiB
Python
109 lines
4.8 KiB
Python
#!/usr/bin/env python3
|
|
"""Audit certified legacy density blocks across 20 deterministic camera positions per stratum."""
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
import re
|
|
import statistics
|
|
import subprocess
|
|
import time
|
|
from pathlib import Path
|
|
|
|
|
|
ROOT = Path(__file__).resolve().parents[4]
|
|
OUT = ROOT / "Saved/Linux/l74/logs"
|
|
DATA = ROOT / "Standalone/data/owner_world.json"
|
|
BIN = ROOT / "Saved/Linux/l74/bin/VoxelForgeCoreHeadless-l74-clang"
|
|
CAMERAS = {
|
|
0: (8.0, 16.0, -372.2626953125),
|
|
1: (25.8369140625, 3.19921875, -737.0),
|
|
2: (19.166015625, -14.2001953125, -753.3740234375),
|
|
3: (-20.0625, -5.068359375, -900.353515625),
|
|
}
|
|
OFFSETS = [(x, y) for y in (-3, -1, 1, 3) for x in (-4, -2, 0, 2, 4)]
|
|
AUDIT = re.compile(
|
|
r"\[UniformBlockProofAudit\] checked_blocks=(\d+) checked_samples=(\d+) "
|
|
r"fallback_blocks=(\d+) unknown_blocks=(\d+) violations=(\d+)"
|
|
)
|
|
TILE = re.compile(
|
|
r"\[WorldAssemblerTilePipeline\] .*?solid_boxes=(\d+) air_boxes=(\d+) "
|
|
r"mixed_boxes=(\d+) unknown_boxes=(\d+) whole_tile_skips=(\d+).*?"
|
|
r"classification_worker_ms=([0-9.]+)"
|
|
)
|
|
VIOLATION = re.compile(r"\[UniformBlockProofViolation\]")
|
|
|
|
|
|
def run(view: int, position: int, offset: tuple[int, int]) -> dict:
|
|
base = CAMERAS[view]
|
|
camera = ",".join(f"{value:.12f}" for value in
|
|
(base[0] + offset[0], base[1] + offset[1], base[2])) + ",0,0"
|
|
log = OUT / f"audit-s{view}-p{position:02d}.log"
|
|
command = [
|
|
"taskset", "-c", "0-11", "prlimit", "--as=6442450944", "--", "timeout",
|
|
"1740s", str(BIN), str(DATA), "--world-assembler-prototype", "--stream-benchmark",
|
|
"--stream-pipeline", "--force-generate", "--workers=8", "--clip-radius=3",
|
|
"--max-clip-level=8", "--max-level=8", f"--camera={camera}",
|
|
"--audit-uniform-block-proofs", "--profile-lod-work",
|
|
]
|
|
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")
|
|
audit = AUDIT.search(content)
|
|
tile = TILE.search(content)
|
|
if result.returncode != 0 or audit is None or tile is None:
|
|
raise SystemExit(f"audit run failed or summary is missing; see {log}")
|
|
checked, samples, fallback, unknown, violations = map(int, audit.groups())
|
|
solid, air, mixed, tile_unknown, tile_skips = map(int, tile.groups()[:5])
|
|
classifier_ms = float(tile.group(6))
|
|
violation_lines = len(VIOLATION.findall(content))
|
|
row = {
|
|
"strate": view, "position": position, "offset_m": list(offset),
|
|
"exit_code": result.returncode, "wall_s": round(time.monotonic() - started, 3),
|
|
"checked_blocks": checked, "checked_samples": samples,
|
|
"fallback_blocks": fallback, "unknown_blocks": unknown,
|
|
"violations": violations + violation_lines,
|
|
"block_proof_hit_pct": round(100.0 * checked / max(checked + fallback, 1), 2),
|
|
"tile_solid_boxes": solid, "tile_air_boxes": air, "tile_mixed_boxes": mixed,
|
|
"tile_unknown_boxes": tile_unknown, "tile_whole_skips": tile_skips,
|
|
"classification_worker_ms": classifier_ms,
|
|
"log": str(log.relative_to(ROOT)),
|
|
}
|
|
print("[L74AuditSweepRun] " + json.dumps(row, sort_keys=True), flush=True)
|
|
if row["violations"] != 0:
|
|
raise SystemExit(f"uniform block proof violation; see {log}")
|
|
return row
|
|
|
|
|
|
def main() -> int:
|
|
OUT.mkdir(parents=True, exist_ok=True)
|
|
if not DATA.is_file() or not BIN.is_file():
|
|
raise SystemExit("missing owner world or L74 Clang headless binary")
|
|
rows = [run(view, index, offset) for view in range(4)
|
|
for index, offset in enumerate(OFFSETS)]
|
|
summary = []
|
|
for view in range(4):
|
|
group = [row for row in rows if row["strate"] == view]
|
|
checked = sum(row["checked_blocks"] for row in group)
|
|
fallback = sum(row["fallback_blocks"] for row in group)
|
|
costs = [row["classification_worker_ms"] for row in group]
|
|
summary.append({
|
|
"strate": view, "positions": len(group), "violations": sum(
|
|
row["violations"] for row in group), "checked_blocks": checked,
|
|
"fallback_blocks": fallback, "proof_hit_pct": round(
|
|
100.0 * checked / max(checked + fallback, 1), 2),
|
|
"classifier_ms_p50": round(statistics.median(costs), 3),
|
|
"classifier_ms_p95": round(sorted(costs)[int(0.95 * (len(costs) - 1))], 3),
|
|
})
|
|
result = {"runs": rows, "summary": summary}
|
|
(OUT / "audit-sweep.json").write_text(json.dumps(result, indent=2) + "\n",
|
|
encoding="utf-8")
|
|
for row in summary:
|
|
print("[L74AuditSweepSummary] " + json.dumps(row, sort_keys=True), flush=True)
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|