research: post-swept-tube near-ready cost account (L103, measurement only)

FI/TN LOD0-2 W12 worker CPU 13.9/12.2 s: passages 40/35%, far-shell refinement (HasDownwardHit/
HasUpwardHit ~1.7-1.9 s) in 'other' 27/30%, support 14/13%, dispatch 8%, base field 6%, bands 6%.
Workers 28%/24% idle during LOD0-1. Near-ready W12: SW 0.77, FI 1.51, TN 1.38, VS 0.96 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dhxM43dnWvUu2B5Ph1iG1
This commit is contained in:
Fr0zkaandClaude Opus 5.5 committed 2026-10-28 19:39:47 +01:00
1 parent c38e683292
commit 8d62ba57ed
7 files changed
+973

No files matched your search

@@ -0,0 +1,79 @@
#!/usr/bin/env python3
"""Capture L87 cold critical-path and worker-idle traces on current source."""
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/l103/timeline"
DATA = ROOT / "Standalone/data/owner_world.json"
BINARY = ROOT / "Saved/Linux/l101/bin/VoxelForgeCoreHeadless-l101-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=(\S+)$", 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.lower()}-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:
result = 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))
events = re.findall(r"^\[CpuTileTimeline\] event=(\S+)", content, re.M)
cold_events = re.findall(r"^\[ColdTimeline\] event=(\S+) edge=(\S+)", content, re.M)
if result.returncode or not all((near, pipeline, config, stamp)) or not events:
raise RuntimeError(f"timeline run failed or trace missing: {log}; exit={result.returncode}")
if stamp.group(1) != "c5f49a45f51856b857a1ee8877b7d777208e67daf64281caefc7ef84e8006410":
raise RuntimeError(f"source stamp mismatch: {log}: {stamp.group(1)}")
config_fields = dict(FIELDS.findall(config.group(1)))
if int(config_fields["workers"]) != workers:
raise RuntimeError(f"worker mismatch: {log}")
spec = STRATA[stratum]
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)}")
pipeline_fields = dict(FIELDS.findall(pipeline.group(1)))
whole = pipeline_fields["whole_tiles"].split("/")
if (int(whole[0]), int(whole[1])) != (spec["whole"], spec["whole"]):
raise RuntimeError(f"incomplete whole set: {log}: {pipeline_fields['whole_tiles']}")
row = {"stratum": stratum, "workers": workers, "exit_code": result.returncode,
"source_stamp": stamp.group(1), "near_tiles": spec["near"],
"whole_tiles": spec["whole"], "lod02_ready_s": float(near.group(3)),
"whole_view_ready_s": float(pipeline_fields["whole_view_ready"].removesuffix("s")),
"timeline_events": len(events), "cold_timeline_marks": len(cold_events),
"wall_s": round(time.monotonic() - started, 3),
"log": str(log.relative_to(ROOT))}
print("[L103TimelineRun] " + json.dumps(row, sort_keys=True), flush=True)
return row
def main() -> int:
for stratum in STRATA:
for workers in (8, 12):
run(stratum, workers)
return 0
if __name__ == "__main__":
raise SystemExit(main())