research: passage exclusion envelope at plan time (L148, 7/16; kept as patch)

Seed-2 shell carver measured: vertical-shafts route-edge-0, the layer's own connection edge from the 2-3 lower
mouth. Connection edges legitimately run beside the passage 12-20 m from the mouth, so an 8 m mouth-sphere exclusion
rejects 9/16 otherwise valid plans. Points to one continuous tube across the mouth instead of two overlapping ones.

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-11-01 14:18:19 +01:00
1 parent a0d7ab3a1a
commit f21aab775f
6 files changed
+825

No files matched your search

@@ -0,0 +1,97 @@
#!/usr/bin/env python3
"""Compare L148 composed owner hashes and layout identity at W1/W8/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/l148/determinism"
DATA = ROOT / "Standalone/data/owner_world.json"
BINARIES = {
"clang": ROOT / "Standalone/bin/linux/VoxelForgeCoreHeadless-l148-clang",
"gcc": ROOT / "Standalone/bin/linux/VoxelForgeCoreHeadless-l148-gcc",
}
CAMERA = "-20.062500,-5.068359,-900.353516,0,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)
EXCLUSION_RE = re.compile(
r"^\[CavernPassageExclusionAudit\] strate=[23] primitives=\d+ "
r"outside_joint=0 mouth_joint=\d+ negative_controls=1/1 "
r"first_primitive=none first_passage=none status=PASS$", re.M)
def main() -> int:
if any(not path.is_file() for path in (DATA, *BINARIES.values())):
raise SystemExit("missing L148 Clang/GCC binary or composed owner fixture")
OUT.mkdir(parents=True, exist_ok=True)
rows = []
reference_hashes: tuple[str, ...] | None = None
reference_identity: str | None = None
reference_stamp: str | None = None
for compiler, binary in BINARIES.items():
for workers in (1, 8, 12):
name = f"determinism-{compiler}-w{workers}"
log, layout = OUT / f"{name}.log", OUT / f"{name}.json"
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=0",
f"--camera={CAMERA}", "--stream-hash", "--force-generate", "--seed=2",
"--recipe=surface-world", "--render-distance-chunks=0",
"--density-dispatch-report", "--audit-resolved-layout-passages",
"--audit-passage-tile-seams", f"--resolved-layout-output={layout}"]
started = time.monotonic()
with log.open("w", encoding="utf-8") as output:
proc = subprocess.run(command, cwd=ROOT, stdout=output,
stderr=subprocess.STDOUT, check=False, timeout=1740)
content = log.read_text(encoding="utf-8", errors="replace")
stamp_match = STAMP_RE.search(content)
stamp = stamp_match.group(1) if stamp_match else None
hashes = tuple(HASH_RE.findall(content))
identity = (json.loads(layout.read_text(encoding="utf-8")).get("stable_identity")
if layout.is_file() else None)
audits = EXCLUSION_RE.findall(content)
shell_ok = bool(re.search(
r"^\[PassageShellAuditSummary\].*status=PASS$", content, re.M))
passed = (proc.returncode == 0 and stamp is not None and bool(hashes)
and len(audits) == 2 and shell_ok and bool(identity))
if reference_stamp is None and passed:
reference_stamp, reference_hashes, reference_identity = stamp, hashes, identity
else:
passed = (passed and stamp == reference_stamp and hashes == reference_hashes
and identity == reference_identity)
row = {"compiler": compiler, "workers": workers, "exit": proc.returncode,
"stamp": stamp, "hash_lines": len(hashes),
"hashes_match_first": hashes == reference_hashes,
"layout_identity": identity,
"layout_matches_first": identity == reference_identity,
"exclusion_audits": len(audits), "shell_gate": shell_ok,
"passed": bool(passed),
"elapsed_s": round(time.monotonic() - started, 3),
"log": str(log.relative_to(ROOT)), "layout": str(layout.relative_to(ROOT))}
rows.append(row)
print("[L148DeterminismRun] " + json.dumps(row, sort_keys=True), flush=True)
(OUT / "runs-partial.json").write_text(json.dumps(rows, indent=2) + "\n",
encoding="utf-8")
if not passed:
(OUT / "summary.json").write_text(json.dumps(
{"status": "FAIL", "runs": rows}, indent=2) + "\n", encoding="utf-8")
raise SystemExit(f"composed owner determinism mismatch; see {log}")
summary = {"status": "PASS", "stamp": reference_stamp,
"layout_identity": reference_identity, "runs": rows}
(OUT / "summary.json").write_text(json.dumps(summary, indent=2) + "\n",
encoding="utf-8")
print(f"[L148DeterminismSummary] runs={len(rows)} source_stamp={reference_stamp} "
f"status=PASS")
return 0
if __name__ == "__main__":
raise SystemExit(main())