feat(core): cavern graph v1, one continuous floor-capped tunnel into the landmark chamber (L46); R13
The flagged SW demo's ramp (57 carves + 107 support pillars, visibly ribbed) becomes one cubic-Bezier sweep: closest point by 17-point seed plus 5 Newton steps, a cubic floor profile, a rounded 2.6 m bore, and a hard floor cap applied after unions and relief that only adds support where the field is air. Optional resolved cavern-graph records (one room, one edge) enter canonical identity only when present; their bounds extend World::isTileShapeFree. Reachability passes (L43 control fails), headroom 2.8 m, floor ripple 1.8 mm (L45 ramp control fails at 17.9 mm), shape limits met; demo off: owner hashes identical to L45. fast/medium/full PASS. Research R13 (read-only): continuous SDF sweeps along curves. 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
f13b145f23
commit
e016f6a20f
14 files changed
+1753
-48
No files matched your search
@@ -192,7 +192,7 @@ def run_landmark_reachability(runner: VerificationRunner,
|
||||
expected_style=2, expected_strate_styles={"0": 2, "1": 1},
|
||||
max_level=0, layout_path=OUT / "layouts" / f"{passage_name}.json")
|
||||
runner.require(f"{passage_name}:demo-enabled",
|
||||
all_match(passage_output, r"^\[LandmarkStampDemo\] enabled=true .*status=PASS$"),
|
||||
all_match(passage_output, r"^\[LandmarkCavernGraphDemo\] enabled=true .*rooms=1 edges=1 .*status=PASS$"),
|
||||
"landmark demo flag resolved while running passage audits")
|
||||
validate_passage(runner, passage_name, passage_output)
|
||||
|
||||
@@ -203,7 +203,7 @@ def run_landmark_reachability(runner: VerificationRunner,
|
||||
expected_style=2, expected_strate_styles={"0": 2, "1": 1},
|
||||
max_level=0, layout_path=OUT / "layouts" / f"{interface_name}.json")
|
||||
runner.require(f"{interface_name}:demo-enabled",
|
||||
all_match(interface_output, r"^\[LandmarkStampDemo\] enabled=true .*status=PASS$"),
|
||||
all_match(interface_output, r"^\[LandmarkCavernGraphDemo\] enabled=true .*rooms=1 edges=1 .*status=PASS$"),
|
||||
"landmark demo flag resolved while running interface audits")
|
||||
runner.require(f"{interface_name}:hole-audit",
|
||||
all_match(interface_output, r"^\[StrateTransitionAuditSummary\].*hole_columns=0 "
|
||||
@@ -213,8 +213,14 @@ def run_landmark_reachability(runner: VerificationRunner,
|
||||
all_match(interface_output, r"^\[StrateTransitionNegativeControls\].*status=PASS$"),
|
||||
"demo-on interface audit detects both thickness controls")
|
||||
runner.require(f"{name}:candidate-walkability",
|
||||
all_match(output, r"^\[LandmarkWalkability\] layout=L45 .*status=PASS$"),
|
||||
"demo capsule clearance, support and <=15 degree grade")
|
||||
all_match(output, r"^\[LandmarkWalkability\] layout=L46 .*headroom_required_m=0\.300 status=PASS$"),
|
||||
"demo capsule clearance, support, headroom and <=15 degree grade")
|
||||
runner.require(f"{name}:headroom",
|
||||
all_match(output, r"^\[LandmarkHeadroom\] minimum_m=(?:0\.[3-9][0-9][0-9]|[1-9][0-9]*\.[0-9]{3}) required_m=0\.300 status=PASS$"),
|
||||
"at least 0.3 m above the capsule along the complete route")
|
||||
runner.require(f"{name}:continuous-tunnel-ripple",
|
||||
all_match(output, r"^\[CavernTunnelRipple\] layout=L46 .*floor_limit_m=0\.015 .*wall_limit_m=0\.035 status=PASS$"),
|
||||
"floor and wall ripple remain below L36/L35 limits")
|
||||
runner.require(f"{name}:buried-l43-control",
|
||||
all_match(output, r"^\[LandmarkReachabilityControl\] layout=L43-buried .*"
|
||||
r"result=FAIL expected=FAIL status=PASS$"),
|
||||
@@ -227,6 +233,18 @@ def run_landmark_reachability(runner: VerificationRunner,
|
||||
all_match(output, r"^\[LandmarkReachabilityAudit\] positive=PASS "
|
||||
r"control=EXPECTED_FAIL status=PASS$"),
|
||||
"candidate passes and buried control fails")
|
||||
ripple_control = f"landmark-l45-ramp-ripple-control-{compiler}"
|
||||
_, control_output = runner.run_cpp(ripple_control, binary, OWNER, "surface-world",
|
||||
["--landmark-chamber-demo", "--landmark-l45-ramp-control",
|
||||
"--audit-landmark-reachability", "--max-clip-level=0",
|
||||
"--render-distance-chunks=0"],
|
||||
expected_style=2, expected_strate_styles={"0": 2, "1": 1},
|
||||
max_level=0, layout_path=OUT / "layouts" / f"{ripple_control}.json")
|
||||
runner.require(f"{ripple_control}:negative-control",
|
||||
all_match(control_output,
|
||||
r"^\[CavernTunnelRippleControl\] layout=L45-ramp .*"
|
||||
r"floor_limit_m=0\.015 .*observed=FAIL expected=FAIL status=PASS$"),
|
||||
"the segmented L45 ramp exceeds the floor ripple threshold")
|
||||
|
||||
|
||||
def expected_control_row(runner: VerificationRunner, name: str) -> None:
|
||||
@@ -398,6 +416,36 @@ def parse_tile_hashes(output: str) -> dict[tuple[int, int, int, int], tuple[str,
|
||||
return rows
|
||||
|
||||
|
||||
def cavern_audit_cameras(layout_path: Path) -> list[tuple[float, float, float, float, float]]:
|
||||
layout = json.loads(layout_path.read_text(encoding="utf-8"))
|
||||
edges = layout.get("cavern_edges", [])
|
||||
if layout.get("cavern_graph_vocabulary_version") != 1 or len(edges) != 1:
|
||||
raise VerificationFailure(f"missing one resolved cavern edge in {layout_path}")
|
||||
points = [[value / 1_000_000.0 for value in point]
|
||||
for point in edges[0]["control_points_um"]]
|
||||
|
||||
def value(t: float, axis: int) -> float:
|
||||
one = 1.0 - t
|
||||
return (one ** 3 * points[0][axis] + 3.0 * one ** 2 * t * points[1][axis]
|
||||
+ 3.0 * one * t ** 2 * points[2][axis] + t ** 3 * points[3][axis])
|
||||
|
||||
def derivative(t: float, axis: int) -> float:
|
||||
one = 1.0 - t
|
||||
return (3.0 * one ** 2 * (points[1][axis] - points[0][axis])
|
||||
+ 6.0 * one * t * (points[2][axis] - points[1][axis])
|
||||
+ 3.0 * t ** 2 * (points[3][axis] - points[2][axis]))
|
||||
|
||||
cameras = []
|
||||
for t, lateral in ((0.50, 0.0), (0.32, 3.3)):
|
||||
x, y, floor = value(t, 0), value(t, 1), value(t, 2)
|
||||
dx, dy = derivative(t, 0), derivative(t, 1)
|
||||
length = math.hypot(dx, dy)
|
||||
side_x, side_y = -dy / length, dx / length
|
||||
cameras.append((x + side_x * lateral, y + side_y * lateral,
|
||||
floor + 1.6, math.degrees(math.atan2(dx, dy)), 0.0))
|
||||
return cameras
|
||||
|
||||
|
||||
def run_random_camera_sweep(runner: VerificationRunner, binaries: tuple[Path, ...],
|
||||
camera_count: int,
|
||||
configurations: tuple[tuple[int, int, int], ...]) -> None:
|
||||
@@ -464,6 +512,42 @@ def run_random_camera_sweep(runner: VerificationRunner, binaries: tuple[Path, ..
|
||||
runner.require(f"{label}:W{left}-W{right}",
|
||||
left_rows == right_rows, detail)
|
||||
|
||||
# Keep a pair of fixed cameras on the current owner graph: one in the bore and
|
||||
# one beside its curved wall. Their tile hashes join the seeded W1/W8/W12 sweep.
|
||||
layout_path = OUT / "layouts" / "landmark-reachability-clang.json"
|
||||
if layout_path.is_file():
|
||||
graph_cameras = cavern_audit_cameras(layout_path)
|
||||
for binary in binaries:
|
||||
compiler = compiler_name(binary)
|
||||
for camera_index, camera in enumerate(graph_cameras):
|
||||
x, y, z, yaw, pitch = camera
|
||||
camera_flag = f"--camera={x:.6f},{y:.6f},{z:.6f},{yaw:.3f},{pitch:.3f}"
|
||||
label = f"cavern-camera-{compiler}-s{CAMERA_SWEEP_SEED:06x}-p{camera_index:02d}"
|
||||
signatures: dict[int, dict[tuple[int, int, int, int], tuple[str, ...]]] = {}
|
||||
for workers in (1, 8, 12):
|
||||
name = f"{label}-w{workers}"
|
||||
row, output = runner.run_cpp(name, binary, OWNER, "surface-world",
|
||||
["--stream-hash-tiles", camera_flag, "--landmark-chamber-demo",
|
||||
"--clip-radius=3", "--max-clip-level=0", "--max-level=0",
|
||||
"--render-distance-chunks=0"],
|
||||
expected_style=2,
|
||||
expected_strate_styles={"0": 2, "1": 1}, workers=workers,
|
||||
max_level=0, layout_path=OUT / "layouts" / f"{name}.json")
|
||||
row["camera_position_m"] = [round(value, 6) for value in camera[:3]]
|
||||
row["camera_region"] = "inside-tunnel" if camera_index == 0 else "near-tunnel-wall"
|
||||
signatures[workers] = parse_tile_hashes(output)
|
||||
whole = re.search(r"^\[PipelineWholeViewHash\] tiles=(\d+)", output, re.M)
|
||||
expected_rows = int(whole.group(1)) if whole else -1
|
||||
runner.require(f"{name}:tile-hash-rows",
|
||||
bool(signatures[workers]) and len(signatures[workers]) == expected_rows,
|
||||
f"rows={len(signatures[workers])} expected={expected_rows} camera={camera[:3]}")
|
||||
for left, right in ((1, 8), (1, 12), (8, 12)):
|
||||
runner.require(f"{label}:W{left}-W{right}",
|
||||
signatures[left] == signatures[right],
|
||||
f"camera_m=({x:.3f},{y:.3f},{z:.3f}) "
|
||||
f"region={'inside' if camera_index == 0 else 'near'}-tunnel "
|
||||
f"W{left}=W{right} density/mesh/payload/topology tile hashes match")
|
||||
|
||||
|
||||
def run_ring(runner: VerificationRunner, *, full: bool) -> None:
|
||||
script = LINUX37 / "RunRingAuditsL37.py"
|
||||
@@ -611,11 +695,11 @@ def run_captures_and_mesh_audits(runner: VerificationRunner) -> None:
|
||||
script_inputs=[overview_script, VERIFY_DIR / "capture_quality.py",
|
||||
OUT / "owner-fi-ground-mouth.vfmesh"])
|
||||
|
||||
landmark_script = ROOT / "Standalone/Research/WorldAssemblerM3/Linux45/CaptureLandmarkL45.py"
|
||||
landmark_script = ROOT / "Standalone/Research/WorldAssemblerM3/Linux46/CaptureLandmarkL46.py"
|
||||
landmark_layout = OUT / "layouts" / "landmark-reachability-clang.json"
|
||||
runner.run_stage("capture-landmark-l45", landmark_script,
|
||||
runner.run_stage("capture-landmark-l46", landmark_script,
|
||||
["--layout", str(landmark_layout), "--artifact-dir", str(OUT),
|
||||
"--capture-dir", str(ROOT / "Standalone/Research/WorldAssemblerM3/Linux45/captures"),
|
||||
"--capture-dir", str(ROOT / "Standalone/Research/WorldAssemblerM3/Linux46/captures"),
|
||||
"--data", str(OWNER)],
|
||||
binary=CLANG, data=OWNER, recipe="surface-world", style=1,
|
||||
layout_path=landmark_layout, env=env_for(capture=True),
|
||||
|
||||
Reference in new issue
Block a user