Core.Caves.PrimitiveField v1, opt-in per strate (legacy TunnelNetwork assets stay legacy): solid host rock and one smooth union of two elliptical spine tubes and an ellipsoid room, each intersected with its rising floor by cubic smooth-max (W 2.4 m, measured fillet 0.70 m, no trailing floor cap). Bound in the L40 field table and L42 capabilities, BVH feature candidates, isTileShapeFree aware, exact interval boxes (0 misses). Capsule flood fill arrival -> departure passes (headroom >= 0.3 m, grade <= 15 deg); the generalized whole-surface audit passes with its controls failing. Cold whole view 0.727 s, near ring 0.19 s. Graph ordering/serialization changes are scoped to native caves (the flagged L47 demo is unchanged); verify tiers write captures under --out only. fast/medium/full PASS, Clang and GCC. Research R23 (deepened): per-tile LOD0 kernel speed plan. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016dhxM43dnWvUu2B5Ph1iG1
56 lines
2.3 KiB
Python
56 lines
2.3 KiB
Python
#!/usr/bin/env python3
|
|
"""Build the isolated L54 native-caves fixture from the canonical owner input."""
|
|
from __future__ import annotations
|
|
|
|
import argparse
|
|
import hashlib
|
|
import json
|
|
from pathlib import Path
|
|
|
|
|
|
def sha256(path: Path) -> str:
|
|
digest = hashlib.sha256()
|
|
with path.open("rb") as stream:
|
|
for block in iter(lambda: stream.read(1024 * 1024), b""):
|
|
digest.update(block)
|
|
return digest.hexdigest()
|
|
|
|
|
|
def main() -> int:
|
|
parser = argparse.ArgumentParser(description=__doc__)
|
|
parser.add_argument("--owner", type=Path, required=True)
|
|
parser.add_argument("--out", type=Path, required=True)
|
|
args = parser.parse_args()
|
|
root = json.loads(args.owner.read_text(encoding="utf-8"))
|
|
strates = root.get("strates")
|
|
if not isinstance(strates, list):
|
|
raise ValueError("owner input has no strates array")
|
|
cave_candidates = [item for item in strates
|
|
if isinstance(item, dict) and int(item.get("index", -1)) == 1
|
|
and int(item.get("asset", {}).get("GeneratorType", -1)) == 4]
|
|
if len(cave_candidates) != 1:
|
|
raise ValueError("fixture requires exactly one SurfaceWorld cave strate at index 1")
|
|
upper_candidates = [item for item in strates
|
|
if isinstance(item, dict) and int(item.get("index", -1)) == 0]
|
|
if len(upper_candidates) != 1:
|
|
raise ValueError("fixture requires one adjacent upper strate at index 0")
|
|
passage = upper_candidates[0].get("passage_config")
|
|
asset_passage = upper_candidates[0].get("asset", {}).get("PassageConfig")
|
|
if (not isinstance(passage, dict) or not isinstance(asset_passage, dict)
|
|
or int(passage.get("Connections", -1)) != 1
|
|
or int(asset_passage.get("Connections", -1)) != 1):
|
|
raise ValueError("upper-strate passage config differs from the reviewed owner fixture")
|
|
passage["Connections"] = 2
|
|
asset_passage["Connections"] = 2
|
|
args.out.parent.mkdir(parents=True, exist_ok=True)
|
|
args.out.write_text(json.dumps(root, indent=2, sort_keys=True) + "\n",
|
|
encoding="utf-8")
|
|
print(f"[CavesFixtureBuild] source={args.owner} source_sha256={sha256(args.owner)} "
|
|
f"fixture={args.out} fixture_sha256={sha256(args.out)} changed=upper-strate-0-connections:1->2 "
|
|
"owner_input_untouched=true status=PASS")
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|