The L70 "2x SurfaceWorld GenerateTile in Unreal" was the instrument: the trace enabled bCaptureVoxelForgeCoreHashesForValidation, which disables the native heightfield-band shortcut and whole-tile skips (W1 same keys: 9.00 s hash-off vs 28.46 s hash-on). With hashing off, Unreal and headless match at W8 within 1.2-2.5% (Core 14.42 s vs 14.26 s) on identical tile keys. LOD0 p95 tail = real cost of non-empty passage tiles near the spawn mouth (p50/p95 18.8/105 ms); most LOD0 tiles are empty. verify.py reads its baselines from Standalone/Tools/verify/baselines/ instead of untracked Saved/Linux. The 11 .vfmesh control meshes (~78 MB) are not committed yet (to be stored compressed). Fast tier green. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016dhxM43dnWvUu2B5Ph1iG1
108 lines
4.9 KiB
Python
108 lines
4.9 KiB
Python
#!/usr/bin/env python3
|
|
"""Measure production-path SurfaceWorld tile work without validation hashing."""
|
|
from __future__ import annotations
|
|
|
|
import argparse
|
|
import json
|
|
import subprocess
|
|
import time
|
|
from pathlib import Path
|
|
|
|
|
|
ROOT = Path(__file__).resolve().parents[4]
|
|
OUT = ROOT / "Saved/Linux/l71"
|
|
ENGINE_OUT = OUT / "engine"
|
|
HOST_PLUGIN_SAVED = Path("/home/jahni/VFHost/Plugins/VoxelForge/Saved/Linux/l71")
|
|
PROJECT = Path("/home/jahni/VFHost/VFHost.uproject")
|
|
EDITOR = Path("/home/jahni/UnrealEngine/Engine/Binaries/Linux/UnrealEditor-Cmd")
|
|
SPAWN_M = (8.0, 16.0, -372.2626953125)
|
|
|
|
|
|
def run(trial: int) -> dict:
|
|
label = f"strate0-trial{trial}"
|
|
traces = ENGINE_OUT / "traces"
|
|
trace = traces / f"{label}.trace.jsonl"
|
|
abslog = traces / f"{label}.log"
|
|
stdout = traces / f"{label}.stdout.log"
|
|
# VoxelForgeExplore restricts exported content to the host plugin's Saved tree.
|
|
output = HOST_PLUGIN_SAVED / "output" / label
|
|
userdir = ENGINE_OUT / "user" / label
|
|
zendata = ENGINE_OUT / "zen" / label
|
|
ddc = ENGINE_OUT / "DDC"
|
|
for directory in (traces, output, userdir, zendata, ddc):
|
|
directory.mkdir(parents=True, exist_ok=True)
|
|
|
|
spawn_cm = ",".join(f"{value * 100.0:.3f}" for value in SPAWN_M)
|
|
command = [
|
|
str(EDITOR), str(PROJECT), "-nullrhi", "-unattended", "-nop4", "-nosplash",
|
|
"-NoSound", "-corelimit=12", "-NoZenAutoLaunch", "-notraceserver",
|
|
"-nocrashreports", "-DisablePlugins=AndroidFileServer", "-ddc=NoZenLocalFallback",
|
|
f"-userdir={userdir}", f"-ZenDataPath={zendata}",
|
|
f"-LocalDataCachePath={ddc}", "-run=VoxelForgeExplore", "-seed=0",
|
|
"-archetype=TunnelNetwork", "-slot=0", "-modes=export", "-gameconfig=1",
|
|
"-coreworldtest=1", "-ownerfourstrateplan=1", "-corevoxelsizecm=25",
|
|
"-coreislandtest=0", "-corefallbacktest=0", "-coreofftest=0",
|
|
"-coreplantest=0", "-settingsref=/Game/VoxelForge/DA_Settings.DA_Settings",
|
|
"-corehybridmesher=0", f"-out={output}", "-voxel.StreamingCoarseFirst=0",
|
|
"-voxel.StreamingDynamicNearReserve=1", "-voxel.StreamingLegacyPendingResultCap=0",
|
|
"-voxel.CoreRegionConcurrentAdmission=1", "-voxel.StreamingResultBacklogCap=256",
|
|
"-voxel.StreamingReadyQueueDepth=8", "-voxel.StreamingBackgroundWorkerCap=1",
|
|
"-voxel.CoreColumnCacheDirectMapped=0", "-voxel.CoreMCGradientMemoization=1",
|
|
"-voxel.StreamingCollisionLookahead=1", "-coreworldstreamtrace=1", "-voxel.TestMove=0",
|
|
"-voxel.TestMoveSpeedCmPerSecond=0", f"-voxel.StartupTraceSpawnCm={spawn_cm}",
|
|
f"-voxel.StartupTraceFile={trace}", "-voxel.StartupTraceUntilEndPlay=1",
|
|
"-voxel.StartupTraceMaxTiles=16384", "-voxel.CollisionGate=0", f"-abslog={abslog}",
|
|
]
|
|
started = time.monotonic()
|
|
with stdout.open("w", encoding="utf-8") as stream:
|
|
# UE itself is CPU-pinned and time-bounded. Linux does not enforce --rss.
|
|
result = subprocess.run(
|
|
["taskset", "-c", "0-11", "timeout", "1740s", *command],
|
|
cwd=ROOT, stdout=stream, stderr=subprocess.STDOUT, check=False, timeout=1740,
|
|
)
|
|
elapsed = time.monotonic() - started
|
|
events = set()
|
|
if trace.is_file():
|
|
for line in trace.read_text(encoding="utf-8", errors="replace").splitlines():
|
|
try:
|
|
events.add(json.loads(line).get("type", ""))
|
|
except json.JSONDecodeError:
|
|
continue
|
|
row = {
|
|
"label": label,
|
|
"trial": trial,
|
|
"spawn_m": SPAWN_M,
|
|
"elapsed_s": round(elapsed, 3),
|
|
"exit_code": result.returncode,
|
|
"trace": str(trace),
|
|
"stdout": str(stdout),
|
|
"events": sorted(events),
|
|
"has_walkable_gate": "walkable_gate" in events,
|
|
"has_lod0_ring": "lod0_ring_ready" in events,
|
|
"has_initial_set": "stream_trace_milestone" in events,
|
|
"has_summary": "summary" in events,
|
|
}
|
|
print(f"[L71EngineTrace] {json.dumps(row, sort_keys=True)}", flush=True)
|
|
return row
|
|
|
|
|
|
def main() -> int:
|
|
parser = argparse.ArgumentParser(description=__doc__)
|
|
parser.add_argument("--trials", type=int, default=3, choices=range(1, 4))
|
|
args = parser.parse_args()
|
|
if not EDITOR.is_file() or not PROJECT.is_file():
|
|
raise SystemExit(f"missing UnrealEditor-Cmd or host project: {EDITOR} {PROJECT}")
|
|
rows = [run(trial) for trial in range(1, args.trials + 1)]
|
|
summary = ENGINE_OUT / "surface-trace-summary.json"
|
|
summary.write_text(json.dumps(rows, indent=2) + "\n", encoding="utf-8")
|
|
complete = all(row["exit_code"] == 0 and row["has_walkable_gate"]
|
|
and row["has_lod0_ring"] and row["has_initial_set"] and row["has_summary"]
|
|
for row in rows)
|
|
print(f"[L71EngineTraceSet] trials={len(rows)} status={'PASS' if complete else 'INCOMPLETE'} "
|
|
f"summary={summary}", flush=True)
|
|
return 0 if complete else 2
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|