Files
VoxelForge/Standalone/Research/WorldAssemblerM3/Linux84/RunL84Scaling.py
T
Fr0zkaandClaude Opus 5.5 0a98da6fd0 streaming: passage-heavy tiles first, far parents after LOD0-1 (L84, headless only)
Predicted passage-overlap tiles are scheduled earlier (FI worst tile rank 116 -> 69, dispatch
0.95 -> 0.82 s); LOD0-1 publish from the base shape before far parents, which are built before
LOD2 is queued. Every tile hash identical to L83 (all four whole views). Fast tier PASS.
Cold LOD0-2 W8 / W12: SW 1.02 / 0.99, FI 2.26 / 2.18, TN 2.27 / 2.15, VS 1.13 / 1.09 s.
Heaviest tiles (FI/TN junction band, z=-93) still take 0.5-0.7 s each, mostly full-grid fill;
idealized floor ~0.92 s. Unreal scheduler not yet updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dhxM43dnWvUu2B5Ph1iG1
2026-10-28 01:02:59 +01:00

113 lines
5.5 KiB
Python

#!/usr/bin/env python3
"""L80-protocol W8/W12 readiness pairs for the L84 far-parent deferral candidate."""
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/l84/scaling-final"
DATA = ROOT / "Standalone/data/owner_world.json"
BINARY = ROOT / "Saved/Linux/l84/bin/VoxelForgeCoreHeadless-l84-clang19"
WORKERS = (8, 12)
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),
}
EXPECTED_NEAR = {0: 1408, 1: 1216, 2: 1344, 3: 1344}
EXPECTED_WHOLE = {0: 2850, 1: 2249, 2: 2233, 3: 2329}
SOURCE_STAMP = "c433a039b0255ce3c4794bf20313b8a5a11442feeb07b6555f585688949741a5"
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+) cold_ready_s=([0-9.]+)$", re.M)
STAMP = re.compile(r"^\[VoxelForgeSourceStamp\] sha256=(\S+)$", re.M)
def run(strate: int, workers: int, phase: str, rep: int) -> dict:
OUT.mkdir(parents=True, exist_ok=True)
log = OUT / f"s{strate}-w{workers}-{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(BINARY), 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",
]
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, stamp_match = (
PIPELINE.search(output), NEAR.search(output), STAMP.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}")
if stamp_match is None or stamp_match.group(1) != SOURCE_STAMP:
raise RuntimeError(f"source stamp mismatch in {log}")
pipeline = dict(FIELDS.findall(pipeline_match.group(1)))
near_done, near_total = int(near_match.group(1)), int(near_match.group(2))
whole_done, whole_total = (int(v) for v in pipeline["whole_tiles"].split("/"))
if (near_done, near_total) != (EXPECTED_NEAR[strate], EXPECTED_NEAR[strate]):
raise RuntimeError(f"near readiness incomplete in {log}: {near_done}/{near_total}")
if (whole_done, whole_total) != (EXPECTED_WHOLE[strate], EXPECTED_WHOLE[strate]):
raise RuntimeError(f"whole readiness incomplete in {log}: {whole_done}/{whole_total}")
row = {
"strate": strate, "workers": workers, "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")),
"shape_s": float(pipeline["shape"].removesuffix("s")),
"far_shape_s": float(pipeline["far_shape"].removesuffix("s")),
"first_tile_ready_s": float(pipeline["first_tile_ready"].removesuffix("s")),
"neighborhood_ready_s": float(pipeline["neighborhood_ready"].removesuffix("s")),
"full_detail_ready_s": float(pipeline["full_detail_ready"].removesuffix("s")),
"near_tiles": near_total, "whole_tiles": whole_total,
"source_stamp": stamp_match.group(1), "log": str(log.relative_to(ROOT)),
}
print("[L84ScalingRun] " + json.dumps(row, sort_keys=True), flush=True)
return row
def main() -> int:
if not BINARY.is_file() or not DATA.is_file():
raise SystemExit(f"missing input: {BINARY} or {DATA}")
rows = []
for strate in range(4):
for workers in WORKERS:
run(strate, workers, "warmup", 0)
for rep, order in enumerate(((8, 12), (12, 8), (8, 12)), 1):
for workers in order:
rows.append(run(strate, workers, "measured", rep))
(OUT / "runs-partial.json").write_text(
json.dumps(rows, indent=2) + "\n", encoding="utf-8")
summary = []
for strate in range(4):
for workers in WORKERS:
subset = [row for row in rows
if row["strate"] == strate and row["workers"] == workers]
item = {"strate": strate, "workers": workers, "measured_runs": len(subset)}
for metric in ("lod02_ready_s", "whole_view_ready_s", "shape_s", "far_shape_s",
"first_tile_ready_s", "neighborhood_ready_s", "full_detail_ready_s"):
values = [row[metric] for row in subset]
item[metric] = values
item[f"{metric}_median"] = statistics.median(values)
item[f"{metric}_min"] = min(values)
item[f"{metric}_max"] = max(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())