Files
VoxelForge/Standalone/Research/WorldAssemblerM3/Linux105/RunL105Timeline.py
T
Fr0zkaandClaude Opus 5.5 f228d6319f startup: parallel owner-shape compile and far-parent build (L105, exact); R45 simplification audit
Owner shapes compile per stratum on the Core parallel scheduler and merge in owner-layout order;
far-parent ellipsoids/connectors generate in parallel and merge canonically; 512-unit far bins.
Base compile 239 -> 203 ms, far-parent build 128 -> 33 ms. Near-ready @W12: SW 0.84 -> 0.75,
FI 1.51 -> 1.42, TN 1.38 -> 1.30, VS 0.92 -> 0.85 s. All hashes equal L104 (Clang/GCC W1/W8/W12).
Fast tier PASS; Linux UE builds; 6/6 Unreal arrival traces pass.
R45 (read-only, owner's "are we overcomplicating?"): next simplifications = tunnel floor/mouth support
inside the bounded passage field; boundary bands once per XY column; certified early SW tiles.

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

84 lines
4.1 KiB
Python

#!/usr/bin/env python3
"""Capture L105 cold startup, phase and worker-idle timelines."""
from __future__ import annotations
import json
import re
import subprocess
import time
from pathlib import Path
ROOT = Path(__file__).resolve().parents[4]
OUT = ROOT / "Saved/Linux/l105/timeline"
DATA = ROOT / "Standalone/data/owner_world.json"
BINARY = ROOT / "Saved/Linux/l105/bin/VoxelForgeCoreHeadless-l105-clang"
STRATA = {
"fi": {"camera": (25.8369140625, 3.19921875, -737.0), "near": 1216, "whole": 2249},
"tn": {"camera": (19.166015625, -14.2001953125, -753.3740234375), "near": 1344, "whole": 2233},
}
NEAR = re.compile(r"^\[WorldAssemblerNearLODReady\] lods=0-2 tiles=(\d+)/(\d+) cold_ready_s=([0-9.]+)$", re.M)
PIPELINE = re.compile(r"^\[StreamPipeline\] (.*)$", re.M)
CONFIG = re.compile(r"^\[HeadlessConfig\] (.*)$", re.M)
STAMP = re.compile(r"^\[VoxelForgeSourceStamp\] sha256=([0-9a-f]{64})$", re.M)
FIELDS = re.compile(r"([a-zA-Z0-9_]+)=([^ ]+)")
def run(stratum: str, workers: int) -> dict:
OUT.mkdir(parents=True, exist_ok=True)
log = OUT / f"{stratum}-w{workers}-direct-measured-r1.log"
camera = ",".join(f"{value:.12f}" for value in STRATA[stratum]["camera"]) + ",0,0"
command = [
"taskset", "-c", "0-11", "prlimit", "--as=6442450944", "--", "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", "--cold-worker-timeline",
]
started = time.monotonic()
with log.open("w", encoding="utf-8") as stream:
process = subprocess.run(command, cwd=ROOT, stdout=stream,
stderr=subprocess.STDOUT, check=False, timeout=1740)
content = log.read_text(encoding="utf-8", errors="replace")
near, pipeline, config, stamp = (NEAR.search(content), PIPELINE.search(content),
CONFIG.search(content), STAMP.search(content))
if process.returncode or not all((near, pipeline, config, stamp)):
raise RuntimeError(f"timeline run failed or missing marker: {log}; exit={process.returncode}")
if not re.search(r"^\[CpuTileTimeline\] event=", content, re.M):
raise RuntimeError(f"missing CPU tile timeline: {log}")
if not re.search(r"^\[ColdTimeline\] event=", content, re.M):
raise RuntimeError(f"missing cold timeline: {log}")
config_fields = dict(FIELDS.findall(config.group(1)))
pipeline_fields = dict(FIELDS.findall(pipeline.group(1)))
spec = STRATA[stratum]
whole = tuple(map(int, pipeline_fields["whole_tiles"].split("/")))
if int(config_fields["workers"]) != workers:
raise RuntimeError(f"worker mismatch: {log}")
if (int(near.group(1)), int(near.group(2))) != (spec["near"], spec["near"]):
raise RuntimeError(f"incomplete near set: {log}: {near.group(1)}/{near.group(2)}")
if whole != (spec["whole"], spec["whole"]):
raise RuntimeError(f"incomplete whole set: {log}: {whole}")
row = {
"stratum": stratum, "workers": workers, "source_stamp": stamp.group(1),
"near_tiles": spec["near"], "whole_tiles": spec["whole"],
"near_ready_s": float(near.group(3)),
"whole_view_ready_s": float(pipeline_fields["whole_view_ready"].removesuffix("s")),
"shape_s": float(pipeline_fields["shape"].removesuffix("s")),
"far_shape_s": float(pipeline_fields["far_shape"].removesuffix("s")),
"wall_s": round(time.monotonic() - started, 3),
"log": str(log.relative_to(ROOT)),
}
print("[L105TimelineRun] " + 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 = [run(stratum, workers) for stratum in STRATA for workers in (8, 12)]
(OUT / "runs.json").write_text(json.dumps(rows, indent=2) + "\n", encoding="utf-8")
return 0
if __name__ == "__main__":
raise SystemExit(main())