core: A/A noise floor (±1%) and small hot-path trims for the cave planner (L137, output = v236)
Identical builds differ <=0.6% median; residual near-ready vs assembler/world is real: Surface World +2.9..+3.6%, Vertical Shafts +4.0..+4.3%, Tunnel Network -3.6/+6.8%. Profile points at column-cache reads and the sweep lookup. Removed an unused sample field and per-lookup shared_ptr refcounting. 16/16 seeds, fast tier, Clang/GCC green. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016dhxM43dnWvUu2B5Ph1iG1
This commit is contained in:
1 parent
08cc3bd89b
commit
05e78331fe
9 files changed
+786
-24
No files matched your search
@@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Compare L137 Clang/GCC composed hashes at W1, W8, and W12."""
|
||||
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/l137/determinism"
|
||||
DATA = ROOT / "Standalone/data/regression/owner_world_2strate_l61.json"
|
||||
BINARIES = {
|
||||
"clang": ROOT / "Saved/Linux/l137/fast/bin/VoxelForgeCoreHeadless-fast-clang",
|
||||
"gcc": ROOT / "Saved/Linux/l137/fast/bin/VoxelForgeCoreHeadless-fast-gcc",
|
||||
}
|
||||
STAMP = "dcf2ffa55fd6d62b3c7faf76229c3b99c635868dc1b694fc6e8f39e738775a4e"
|
||||
CAMERA = "-4.688214,38.662384,-505.781342,-28.446,0"
|
||||
HASH_RE = re.compile(
|
||||
r"^\[Pipeline(?:FullDetailHash|WholeViewHash|MaterialHash|LODHash|ExactQueryHash)\].*$",
|
||||
re.M)
|
||||
STAMP_RE = re.compile(r"^\[VoxelForgeSourceStamp\] sha256=([0-9a-f]+)$", re.M)
|
||||
|
||||
|
||||
def main() -> int:
|
||||
if any(not path.is_file() for path in (DATA, *BINARIES.values())):
|
||||
raise SystemExit("missing L137 determinism binary or owner fixture")
|
||||
OUT.mkdir(parents=True, exist_ok=True)
|
||||
rows = []
|
||||
baseline: tuple[str, ...] | None = None
|
||||
for compiler, binary in BINARIES.items():
|
||||
for workers in (1, 8, 12):
|
||||
label = f"determinism-{compiler}-w{workers}"
|
||||
log = OUT / f"{label}.log"
|
||||
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=0",
|
||||
"--max-level=0", f"--camera={CAMERA}", "--stream-hash-tiles",
|
||||
"--force-generate", "--recipe=surface-world", "--render-distance-chunks=0",
|
||||
"--landmark-chamber-demo", "--ore-veins-demo"]
|
||||
started = time.monotonic()
|
||||
with log.open("w", encoding="utf-8") as output:
|
||||
result = subprocess.run(command, cwd=ROOT, stdout=output,
|
||||
stderr=subprocess.STDOUT, check=False, timeout=1740)
|
||||
content = log.read_text(encoding="utf-8", errors="replace")
|
||||
stamp = STAMP_RE.search(content)
|
||||
hashes = tuple(HASH_RE.findall(content))
|
||||
passed = (result.returncode == 0 and stamp is not None
|
||||
and stamp.group(1) == STAMP and len(hashes) >= 4)
|
||||
if baseline is None and passed:
|
||||
baseline = hashes
|
||||
elif baseline is not None:
|
||||
passed &= hashes == baseline
|
||||
row = {"compiler": compiler, "workers": workers, "exit": result.returncode,
|
||||
"stamp": stamp.group(1) if stamp else None, "hash_lines": len(hashes),
|
||||
"hashes_match_first": hashes == baseline, "passed": bool(passed),
|
||||
"elapsed_s": round(time.monotonic() - started, 3),
|
||||
"log": str(log.relative_to(ROOT))}
|
||||
rows.append(row)
|
||||
print("[L137DeterminismRun] " + json.dumps(row, sort_keys=True), flush=True)
|
||||
if not passed:
|
||||
(OUT / "summary.json").write_text(json.dumps(
|
||||
{"status": "FAIL", "stamp": STAMP, "runs": rows}, indent=2) + "\n")
|
||||
raise SystemExit(f"determinism mismatch; see {log}")
|
||||
(OUT / "summary.json").write_text(json.dumps(
|
||||
{"status": "PASS", "stamp": STAMP, "runs": rows}, indent=2) + "\n")
|
||||
print(f"[L137DeterminismSummary] runs={len(rows)} stamp={STAMP} status=PASS")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Reference in new issue
Block a user