Files
VoxelForge/Standalone/Research/WorldAssemblerM3/Linux82/RunL82Readiness.py
T
Fr0zkaandClaude Opus 5.5 f572108dc4 passages: exact relief skip + per-tile BVH node masks (L82); FI/TN LOD0-2 -12%
- Wall relief noise is skipped when its hard-bounded contribution cannot change the final max;
  mouth surface/tread noise only on paths that use it.
- Exact active BVH-node masks cached per tile/passage/segment range; no per-sample lower_bound.
- Full-view audit imports the exported Core plan (not the stale 26-point root route): 21,425/21,425
  walkability samples pass.
Cold (L80 protocol, medians) LOD0-2: SW 1.16->1.11, FI 2.86->2.51, TN 2.88->2.54, VS 1.23->1.22 s.
Passage share FI 64.6->58.7%, TN 65.4->58.4%. Hashes identical (v214). TN "slowdown" from L81
not reproduced (5 pairs, 3.08 -> 2.75 s). Fast tier PASS; Linux UE host builds.

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

97 lines
4.2 KiB
Python

#!/usr/bin/env python3
"""Three interleaved L80-protocol readiness pairs per stratum, L81 vs L82."""
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/l82/readiness"
DATA = ROOT / "Standalone/data/owner_world.json"
BINARIES = {
"L81": ROOT / "Saved/Linux/l81/bin/VoxelForgeCoreHeadless-l81-clang",
"L82": ROOT / "Saved/Linux/l82/bin/VoxelForgeCoreHeadless-clang19",
}
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),
}
PIPELINE = re.compile(r"^\[StreamPipeline\] (.*)$", re.M)
FIELDS = re.compile(r"([a-zA-Z0-9_]+)=([^ ]+)")
NEAR = re.compile(r"^\[WorldAssemblerNearLODReady\] lods=0-2 tiles=(\d+)/(\d+) "
r"cold_ready_s=([0-9.]+)$", re.M)
def run(strate: int, version: str, phase: str, rep: int) -> dict:
OUT.mkdir(parents=True, exist_ok=True)
log = OUT / f"s{strate}-{version.lower()}-{phase}{rep}.log"
camera = ",".join(f"{v:.12f}" for v in CAMERAS[strate]) + ",0,0"
command = [
"taskset", "-c", "0-11", "prlimit", "--as=6442450944", "--",
"env", "VOXELFORGE_L81_PASSAGE_BOUND_PADDING_VOXELS=0", "timeout", "1740s",
str(BINARIES[version]), str(DATA), "--world-assembler-prototype",
"--stream-benchmark", "--stream-pipeline", "--workers=8", "--clip-radius=3",
"--max-clip-level=8", "--max-level=8", f"--camera={camera}",
"--profile-lod-work", "--stream-scheduler-policy=3",
]
start = time.monotonic()
with log.open("w", encoding="utf-8") as stream:
result = subprocess.run(command, cwd=ROOT, stdout=stream,
stderr=subprocess.STDOUT, check=False, timeout=1740)
output = log.read_text(encoding="utf-8", errors="replace")
pipeline_match, near_match = PIPELINE.search(output), NEAR.search(output)
if result.returncode or pipeline_match is None or near_match is None:
raise RuntimeError(f"readiness run failed: exit={result.returncode} {log}")
pipeline = dict(FIELDS.findall(pipeline_match.group(1)))
row = {
"strate": strate, "version": version, "phase": phase, "replicate": rep,
"exit_code": result.returncode, "wall_s": round(time.monotonic() - start, 3),
"lod02_ready_s": float(near_match.group(3)),
"whole_view_ready_s": float(pipeline["whole_view_ready"].removesuffix("s")),
"whole_tiles": int(pipeline["whole_tiles"].split("/")[0]),
"log": str(log.relative_to(ROOT)),
}
print("[L82ReadinessRun] " + json.dumps(row, sort_keys=True), flush=True)
return row
def main() -> int:
for binary in (*BINARIES.values(), DATA):
if not binary.is_file():
raise SystemExit(f"missing input: {binary}")
for strate in range(4):
for version in ("L81", "L82"):
run(strate, version, "warmup", 0)
rows = []
orders = (("L81", "L82"), ("L82", "L81"), ("L81", "L82"))
for strate in range(4):
for rep, order in enumerate(orders, 1):
for version in order:
rows.append(run(strate, version, "measured", rep))
(OUT / "runs-partial.json").write_text(json.dumps(rows, indent=2) + "\n",
encoding="utf-8")
summary = []
for strate in range(4):
group = [row for row in rows if row["strate"] == strate]
item = {"strate": strate, "measured_pairs": 3}
for version in ("L81", "L82"):
subset = [row for row in group if row["version"] == version]
for metric in ("lod02_ready_s", "whole_view_ready_s"):
values = [row[metric] for row in subset]
item[f"{version}_{metric}"] = values
item[f"{version}_{metric}_median"] = statistics.median(values)
summary.append(item)
(OUT / "summary.json").write_text(json.dumps({"runs": rows, "summary": summary},
indent=2) + "\n", encoding="utf-8")
return 0
if __name__ == "__main__":
raise SystemExit(main())