Files
VoxelForge/Standalone/Research/WorldAssemblerM3/Linux80/RunL80PassageCensus.py
T
Fr0zkaandClaude Opus 5.5 b06397df9c streaming: speed-aware scheduler with hysteresis (L80); arrival near-first, fast travel keeps the horizon
Policy 3 (headless + Unreal): walkable ring always first; at rest/arrival LOD0-2 before far;
walking interleaves near:far ~4:1 toward heading; fast travel admits far coarse tiles right after
the walkable ring. Hysteresis: walking 0.75/0.35 m/s, fast 12/8 m/s.
Headless, far holes while moving 30 m/s: L77 9.0% / L79 77.2% / L80 8.9%. Cold LOD0-2 ready
(one clean protocol, medians): SW 1.30, FI 3.61, TN 3.07, VS 1.43 s.
Unreal 30 m/s traces end 2,233/2,237 loaded (commandlet readiness exit 1) for all policies.
Passage zero-padding cut: ~50% fewer passage iterations on active tiles, max 6.6 cm surface
displacement, no sign flips; not adopted yet (padding sweep next). World unchanged (v213).

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

93 lines
3.9 KiB
Python

#!/usr/bin/env python3
"""Find active LOD0/1 passage tiles in each owner stratum."""
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/l80/passage-census"
DATA = ROOT / "Standalone/data/owner_world.json"
BINARY = ROOT / "Saved/Linux/l79/bin/VoxelForgeCoreHeadless-l79-final"
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),
}
TILE = re.compile(r"^\[PassageComposerTile\] (.*)$", re.M)
FIELD = re.compile(r"([a-zA-Z0-9_]+)=([^ ]+)")
KEY = re.compile(r"key=\((-?\d+),(-?\d+),(-?\d+),lod(\d+)\)")
def run(strate: int, camera: tuple[float, float, float]) -> dict:
log = OUT / f"strate{strate}.log"
camera_arg = ",".join(f"{v:.12f}" for v in camera) + ",0,0"
command = [
"taskset", "-c", "0-11", "prlimit", "--as=6442450944", "--",
"timeout", "1740s", str(BINARY), str(DATA), "--world-assembler-prototype",
"--stream-benchmark", "--stream-pipeline", "--workers=8", "--clip-radius=3",
"--max-clip-level=8", "--max-level=1", f"--camera={camera_arg}",
"--profile-lod-work", "--profile-passage-composer",
]
start = time.monotonic()
with log.open("w", encoding="utf-8") as out:
proc = subprocess.run(command, cwd=ROOT, stdout=out, stderr=subprocess.STDOUT,
check=False, timeout=1740)
text = log.read_text(encoding="utf-8", errors="replace")
rows = []
for match in TILE.finditer(text):
row = dict(FIELD.findall(match.group(1)))
for name, value in tuple(row.items()):
try:
row[name] = int(value) if name not in {"worker_ms"} else float(value)
except ValueError:
pass
key = KEY.search(match.group(1))
if key:
row["coord"] = [int(key.group(i)) for i in range(1, 4)]
row["lod"] = int(key.group(4))
row["strate"] = strate
rows.append(row)
summary = next((line for line in text.splitlines()
if line.startswith("[StreamPipeline] ")), None)
result = {"strate": strate, "exit_code": proc.returncode,
"wall_s": round(time.monotonic() - start, 3),
"profiled_tiles": len(rows), "log": str(log.relative_to(ROOT)),
"summary": summary, "tiles": rows}
print("[L80PassageCensus] " + json.dumps(
{k: v for k, v in result.items() if k != "tiles"}, sort_keys=True), flush=True)
if proc.returncode or not rows:
raise SystemExit(f"census failed or emitted no tile rows: {log} exit={proc.returncode}")
return result
def main() -> int:
OUT.mkdir(parents=True, exist_ok=True)
runs = [run(i, CAMERAS[i]) for i in range(4)]
tiles = [tile for result in runs for tile in result["tiles"]]
categories = {
"mouth": "mouth_route_segment_checks",
"route_body": "carve_segment_visits",
"support": "support_segment_visits",
}
leaders = {}
for strate in range(4):
for lod in (0, 1):
for category, metric in categories.items():
candidates = [tile for tile in tiles
if tile["strate"] == strate and tile["lod"] == lod
and tile.get(metric, 0) > 0]
candidates.sort(key=lambda x: (x.get(metric, 0), x.get("worker_ms", 0)),
reverse=True)
leaders[f"s{strate}-l{lod}-{category}"] = candidates[:2]
payload = {"runs": [{k: v for k, v in r.items() if k != "tiles"} for r in runs],
"profiled_tile_count": len(tiles), "tiles": tiles, "leaders": leaders}
(OUT / "summary.json").write_text(json.dumps(payload, indent=2) + "\n", encoding="utf-8")
return 0
if __name__ == "__main__":
raise SystemExit(main())