One current-state page (shipping behaviour, references with sources, gaps, verification, closed lines), linked from CLAUDE.md. Removes the L86/L88 passage/boundary ablation switches and the unused legacy route-grade audit; inventory of every kept switch in the report. Output identical: 24/24 + 18/18 hashes, fast tier, walk/seam audits, UE host build; timing unchanged (-0.2%, CI spans 0). No Source/ changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016dhxM43dnWvUu2B5Ph1iG1
116 lines
5.3 KiB
Python
116 lines
5.3 KiB
Python
#!/usr/bin/env python3
|
|
"""Five interleaved L80 readiness measurements per stratum and worker count."""
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
import os
|
|
import re
|
|
import statistics
|
|
import subprocess
|
|
import time
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[4]
|
|
OUT = ROOT / "Saved/Linux/l131/timing"
|
|
DATA = ROOT / "Standalone/data/owner_world.json"
|
|
BINARIES = {
|
|
"base": ROOT / "Saved/Linux/l130/bin/VoxelForgeCoreHeadless-l130-clang",
|
|
"l131": ROOT / "Saved/Linux/l131/bin/VoxelForgeCoreHeadless-l131-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),
|
|
}
|
|
PIPELINE_RE = re.compile(r"^\[StreamPipeline\] (.*)$", re.M)
|
|
FIELDS_RE = re.compile(r"([a-zA-Z0-9_]+)=([^ ]+)")
|
|
NEAR_RE = re.compile(r"^\[WorldAssemblerNearLODReady\] lods=0-2 tiles=(\d+)/(\d+) cold_ready_s=([0-9.]+)$", re.M)
|
|
|
|
|
|
def run(strate: int, workers: int, version: str, phase: str, replicate: int) -> dict:
|
|
camera = ",".join(f"{value:.12f}" for value in CAMERAS[strate]) + ",0,0"
|
|
label = f"s{strate}-w{workers}-{version}-{phase}{replicate}-l131-v227"
|
|
log = OUT / f"{label}.log"
|
|
command = ["taskset", "-c", "0-11", "prlimit", "--as=6442450944", "--",
|
|
"timeout", "1740s", str(BINARIES[version]), str(DATA),
|
|
"--world-assembler-prototype", "--stream-benchmark", "--stream-pipeline",
|
|
f"--workers={workers}", "--clip-radius=3", "--max-clip-level=8",
|
|
"--max-level=8", f"--camera={camera}", "--profile-lod-work",
|
|
"--stream-scheduler-policy=3"]
|
|
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")
|
|
pipeline, near = PIPELINE_RE.search(content), NEAR_RE.search(content)
|
|
if result.returncode or pipeline is None or near is None:
|
|
raise RuntimeError(f"timing run failed: {log}; exit={result.returncode}")
|
|
fields = dict(FIELDS_RE.findall(pipeline.group(1)))
|
|
row = {"strate": strate, "workers": workers, "version": version,
|
|
"phase": phase, "replicate": replicate,
|
|
"lod02_ready_s": float(near.group(3)),
|
|
"whole_view_ready_s": float(fields["whole_view_ready"].removesuffix("s")),
|
|
"wall_s": round(time.monotonic() - started, 3),
|
|
"log": str(log.relative_to(ROOT))}
|
|
print("[L131TimingRun] " + json.dumps(row, sort_keys=True), flush=True)
|
|
return row
|
|
|
|
|
|
def quiet_machine() -> tuple[float, float]:
|
|
load_1m = os.getloadavg()[0]
|
|
def totals() -> tuple[int, int]:
|
|
fields = Path("/proc/stat").read_text().splitlines()[0].split()
|
|
values = [int(value) for value in fields[1:]]
|
|
return sum(values), values[3] + (values[4] if len(values) > 4 else 0)
|
|
before = totals()
|
|
time.sleep(2.0)
|
|
after = totals()
|
|
idle = 100.0 * (after[1] - before[1]) / max(1, after[0] - before[0])
|
|
return load_1m, idle
|
|
|
|
|
|
def main() -> int:
|
|
if any(not path.is_file() for path in (DATA, *BINARIES.values())):
|
|
raise SystemExit("missing timing input")
|
|
OUT.mkdir(parents=True, exist_ok=True)
|
|
load_1m, idle = quiet_machine()
|
|
(OUT / "machine-load-before.txt").write_text(
|
|
f"1-minute load: {load_1m:.2f}\n2-second CPU idle: {idle:.1f}%\n")
|
|
print(f"[L131TimingGate] load_1m={load_1m:.2f} cpu_idle_2s={idle:.1f}%", flush=True)
|
|
if load_1m >= 0.9 or idle < 97.0:
|
|
raise SystemExit("timing refused: machine is above the L80 quiet-load gate")
|
|
|
|
rows = []
|
|
for strate in range(4):
|
|
for workers in (8, 12):
|
|
for version in BINARIES:
|
|
rows.append(run(strate, workers, version, "warmup", 0))
|
|
for replicate in range(1, 6):
|
|
order = tuple(BINARIES) if replicate % 2 else tuple(reversed(BINARIES))
|
|
for version in order:
|
|
rows.append(run(strate, workers, version, "measured", replicate))
|
|
(OUT / "runs-partial.json").write_text(json.dumps(rows, indent=2) + "\n")
|
|
|
|
measured = [row for row in rows if row["phase"] == "measured"]
|
|
summary = []
|
|
for strate in range(4):
|
|
for workers in (8, 12):
|
|
old = [row for row in measured if row["strate"] == strate and row["workers"] == workers and row["version"] == "base"]
|
|
new = [row for row in measured if row["strate"] == strate and row["workers"] == workers and row["version"] == "l131"]
|
|
item = {"strate": strate, "workers": workers, "replicates_per_version": 5}
|
|
for key in ("lod02_ready_s", "whole_view_ready_s"):
|
|
old_med, new_med = statistics.median(row[key] for row in old), statistics.median(row[key] for row in new)
|
|
item[f"base_{key}_median"] = old_med
|
|
item[f"l131_{key}_median"] = new_med
|
|
item[f"delta_pct_{key}"] = round(100.0 * (new_med / old_med - 1.0), 2)
|
|
item[f"base_{key}_values"] = [row[key] for row in old]
|
|
item[f"l131_{key}_values"] = [row[key] for row in new]
|
|
summary.append(item)
|
|
(OUT / "summary.json").write_text(json.dumps({"runs": rows, "summary": summary}, indent=2) + "\n")
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|