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
This commit is contained in:
Fr0zkaandClaude Opus 5.5 committed 2026-10-28 01:02:59 +01:00
1 parent a81b5b7d06
commit 0a98da6fd0
6 files changed
+590 -9

No files matched your search

@@ -0,0 +1,109 @@
#!/usr/bin/env python3
"""Compare L83 and L84 per-tile and whole-view hashes for all four full views."""
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/l84/hash-check-final"
DATA = ROOT / "Standalone/data/owner_world.json"
BINARIES = {
"L83": ROOT / "Saved/Linux/l83/bin/VoxelForgeCoreHeadless-l83-clang19",
"L84": ROOT / "Saved/Linux/l84/bin/VoxelForgeCoreHeadless-l84-clang19",
}
STAMPS = {
"L83": "08af4e98c86a69477cc79e21463d8c93bcd11ebe0f077d7c11519031d9141fa9",
"L84": "c433a039b0255ce3c4794bf20313b8a5a11442feeb07b6555f585688949741a5",
}
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_WHOLE = {0: 2850, 1: 2249, 2: 2233, 3: 2329}
STAMP = re.compile(r"^\[VoxelForgeSourceStamp\] sha256=(\S+)$", re.M)
TILE_HASH = re.compile(
r"^\[PipelineTileHash\] lod=(-?\d+) x=(-?\d+) y=(-?\d+) z=(-?\d+) "
r"density=(0x[0-9a-f]+) mesh=(0x[0-9a-f]+) payload=(0x[0-9a-f]+) "
r"topology=(0x[0-9a-f]+)$", re.M)
WHOLE_HASH = re.compile(
r"^\[PipelineWholeViewHash\] tiles=(\d+) density=(0x[0-9a-f]+) "
r"mesh=(0x[0-9a-f]+) payload=(0x[0-9a-f]+) topology=(0x[0-9a-f]+)$", re.M)
def run(strate: int, version: str) -> dict:
OUT.mkdir(parents=True, exist_ok=True)
log = OUT / f"{version.lower()}-s{strate}.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(BINARIES[version]), str(DATA), "--world-assembler-prototype",
"--stream-benchmark", "--stream-pipeline", "--workers=8", "--clip-radius=3",
"--max-clip-level=8", "--max-level=8", f"--camera={camera}",
"--stream-scheduler-policy=3", "--stream-hash-tiles",
]
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)
output = log.read_text(encoding="utf-8", errors="replace")
source, whole = STAMP.search(output), WHOLE_HASH.search(output)
hashes = {
(int(match.group(1)), int(match.group(2)), int(match.group(3)), int(match.group(4))):
match.group(5, 6, 7, 8)
for match in TILE_HASH.finditer(output)
}
if result.returncode or source is None or whole is None:
raise RuntimeError(f"hash run failed: exit={result.returncode} {log}")
if source.group(1) != STAMPS[version]:
raise RuntimeError(f"source stamp mismatch in {log}: {source.group(1)}")
if int(whole.group(1)) != EXPECTED_WHOLE[strate] or len(hashes) != EXPECTED_WHOLE[strate]:
raise RuntimeError(f"incomplete whole-view hashes in {log}: tiles={len(hashes)} whole={whole.group(1)}")
row = {
"version": version, "strate": strate, "exit_code": result.returncode,
"wall_s": round(time.monotonic() - started, 3), "tile_count": len(hashes),
"whole_hash": whole.group(1, 2, 3, 4, 5), "hashes": hashes,
"source_stamp": source.group(1), "log": str(log.relative_to(ROOT)),
}
print("[L84HashRun] " + json.dumps(
{key: value for key, value in row.items() if key != "hashes"}, sort_keys=True),
flush=True)
return row
def main() -> int:
for binary in (*BINARIES.values(), DATA):
if not binary.is_file():
raise SystemExit(f"missing input: {binary}")
rows, comparisons = [], []
for strate in range(4):
pair = {version: run(strate, version) for version in ("L83", "L84")}
before, after = pair["L83"], pair["L84"]
mismatches = sorted(key for key in set(before["hashes"]) | set(after["hashes"])
if before["hashes"].get(key) != after["hashes"].get(key))
comparison = {
"strate": strate, "tile_count": len(before["hashes"]),
"tile_hashes_identical": not mismatches,
"whole_hash_identical": before["whole_hash"] == after["whole_hash"],
"mismatch_count": len(mismatches), "first_mismatches": mismatches[:12],
"l83_whole_hash": before["whole_hash"], "l84_whole_hash": after["whole_hash"],
"logs": {version: pair[version]["log"] for version in pair},
}
comparisons.append(comparison)
rows.extend({key: value for key, value in row.items() if key != "hashes"}
for row in pair.values())
(OUT / "runs-partial.json").write_text(json.dumps(
{"comparisons": comparisons, "runs": rows}, indent=2) + "\n", encoding="utf-8")
print("[L84HashComparison] " + json.dumps(comparison, sort_keys=True), flush=True)
return 0 if all(row["tile_hashes_identical"] and row["whole_hash_identical"]
for row in comparisons) else 1
if __name__ == "__main__":
raise SystemExit(main())