Files
VoxelForge/Standalone/Research/WorldAssemblerM3/Linux156/RunL156Determinism.py
T
Fr0zkaandClaude Opus 5.5 a751a01b11 research: headroom-only landings, band fit, bore exemption (L156; last landing round, kept as patch)
Band fit works (all chambers inside host bands, 16/16 seeds both sweeps); chamber support exemption + open-floor
control work; found a metres/subvoxel mix in the shell-opening predicate. Still fails: upper landing evaluated grade
22.85 deg over native ground; TN and VS sweeps 0/16; UE 30 m/s near coverage 39.0% vs 45.5%. Owner: stop forcing
landings after this round.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dhxM43dnWvUu2B5Ph1iG1
2026-11-02 02:31:04 +01:00

110 lines
6.0 KiB
Python

#!/usr/bin/env python3
"""Compare the composed native Floating Islands owner at Clang/GCC 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/l156/determinism"
BASELINE = ROOT / "Standalone/Research/WorldAssemblerM3/Linux156/baselines/native-owner-fi-seed0.json"
DATA = ROOT / "Standalone/data/owner_world.json"
STAMP = "4bf096c0a06f72eb765ff8785d55c00ded946ed1bd1f39fa1914b3658ceb61f0"
BINARIES = {
"clang": ROOT / "Saved/Linux/l156/bin/VoxelForgeCoreHeadless-l156-clang",
"gcc": ROOT / "Saved/Linux/l156/bin/VoxelForgeCoreHeadless-l156-gcc",
}
CAMERA = "25.836914,3.199219,-737.000000,0,0"
STAMP_RE = re.compile(r"^\[VoxelForgeSourceStamp\] sha256=([0-9a-f]{64})$", re.M)
HASH_RE = re.compile(
r"^\[Pipeline(?:FullDetailHash|WholeViewHash|MaterialHash|LODHash|ExactQueryHash)\].*$",
re.M)
NATIVE_FI = re.compile(
r"^\[DensityDispatch\] strate=1 generator=FloatingIslands "
r"recipe=FloatingIslands\.ClusterField version=\d+ "
r"bound_path=FloatingIslands-native adapter=FFloatingIslandFieldAdapter$", re.M)
FI_RECIPE_HASH = re.compile(
r"^\[FloatingIslandWorldAssembly\].*recipe_hash=([0-9a-f]+) status=PASS$", re.M)
FI_CLEARANCE = re.compile(r"^\[FloatingIslandPassageClearance\].*status=PASS$", re.M)
FI_ROUTE_AUDIT = re.compile(r"^\[FloatingIslandRouteAudit\].*status=PASS$", re.M)
def main() -> int:
if not DATA.is_file() or any(not path.is_file() for path in BINARIES.values()):
raise SystemExit("missing L156 Clang/GCC binary or composed owner fixture")
OUT.mkdir(parents=True, exist_ok=True)
rows: list[dict[str, object]] = []
reference_hashes: list[str] | None = None
reference_identity: str | None = None
reference_recipe_hash: str | None = None
for compiler, binary in BINARIES.items():
for workers in (1, 8, 12):
name = f"native-owner-fi-{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=0",
"--recipe=surface-world", "--native-owner-fi", "--render-distance-chunks=0",
"--density-dispatch-report", 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 = STAMP_RE.search(content)
hashes = HASH_RE.findall(content)
current_layout = json.loads(layout.read_text(encoding="utf-8")) if layout.is_file() else {}
identity = current_layout.get("stable_identity")
native_ok = bool(NATIVE_FI.search(content))
recipe_hash = FI_RECIPE_HASH.search(content)
clearance = FI_CLEARANCE.search(content)
route_audit = FI_ROUTE_AUDIT.search(content)
local_pass = (proc.returncode == 0 and stamp is not None
and stamp.group(1) == STAMP and len(hashes) >= 4 and native_ok
and recipe_hash is not None and route_audit is not None and bool(identity))
if reference_hashes is None and local_pass:
reference_hashes, reference_identity = hashes, identity
reference_recipe_hash = recipe_hash.group(1) if recipe_hash else None
same = (hashes == reference_hashes and identity == reference_identity
and (recipe_hash.group(1) if recipe_hash else None)
== reference_recipe_hash)
passed = bool(local_pass and same)
row = {"compiler": compiler, "workers": workers, "exit": proc.returncode,
"source_stamp": stamp.group(1) if stamp else None, "hash_lines": hashes,
"layout_identity": identity, "native_fi_dispatch": native_ok,
"floating_island_recipe_hash": recipe_hash.group(1) if recipe_hash else None,
"passage_clearance_line": clearance.group(0) if clearance else None,
"route_audit_line": route_audit.group(0) if route_audit else None,
"passed": passed, "elapsed_s": round(time.monotonic() - started, 3),
"log": str(log.relative_to(ROOT)), "layout": str(layout.relative_to(ROOT))}
rows.append(row)
print("[L156DeterminismRun] " + json.dumps(row, sort_keys=True), flush=True)
(OUT / "runs-partial.json").write_text(json.dumps(rows, indent=2) + "\n")
if not passed:
summary = {"status": "FAIL", "source_stamp": STAMP, "runs": rows}
(OUT / "summary.json").write_text(json.dumps(summary, indent=2) + "\n")
raise SystemExit(f"native owner determinism mismatch; see {log}")
summary = {"status": "PASS", "source_stamp": STAMP,
"world_assembly_evaluator_version": 240,
"layout_identity": reference_identity,
"floating_island_recipe_hash": reference_recipe_hash,
"baseline_scope": "candidate only; fast tier remains failed",
"runs": rows}
OUT.joinpath("summary.json").write_text(json.dumps(summary, indent=2) + "\n")
BASELINE.parent.mkdir(parents=True, exist_ok=True)
BASELINE.write_text(json.dumps(summary, indent=2) + "\n", encoding="utf-8")
print(f"[L156DeterminismSummary] runs={len(rows)} source_stamp={STAMP} status=PASS "
"baseline=candidate-only", flush=True)
return 0
if __name__ == "__main__":
raise SystemExit(main())