diff --git a/Standalone/Core/include/VoxelForgeCore/VoxelForgeCore.h b/Standalone/Core/include/VoxelForgeCore/VoxelForgeCore.h index cc4d176..82e5af7 100644 --- a/Standalone/Core/include/VoxelForgeCore/VoxelForgeCore.h +++ b/Standalone/Core/include/VoxelForgeCore/VoxelForgeCore.h @@ -706,6 +706,7 @@ namespace VoxelForgeCore // source fixed-point units so this record never rounds the recipe itself. inline constexpr std::uint32_t ResolvedLayoutSchemaVersionV3 = 3; inline constexpr std::uint32_t ResolvedLayoutStampVocabularyVersionV1 = 1; + inline constexpr std::uint32_t ResolvedLayoutStampVocabularyVersionV2 = 2; enum class ResolvedLayoutValidationModeV3 : std::uint8_t { compatibility, strict }; // Stable, bounded geometry edits composed into every Core field after the shared @@ -962,6 +963,10 @@ namespace VoxelForgeCore ResolvedLayoutSnapshotV3& layout, std::int32_t seed, std::span requests, std::string& error); + VFCORE_API bool ResolveResolvedLayoutStampsV2( + ResolvedLayoutSnapshotV3& layout, std::int32_t seed, + std::span requests, + std::string& error); VFCORE_API ResolvedLayoutStampPlacementAuditV1 AuditResolvedLayoutStampPlacementV1( const ResolvedLayoutSnapshotV3& layout); @@ -1243,6 +1248,7 @@ namespace VoxelForgeCore const WorldConfiguration& configuration() const; const WorldAssemblyManifest* worldAssembly() const noexcept; const ResolvedLayoutSnapshotV3* resolvedLayout() const noexcept; + ResolvedWorldSnapshot withResolvedLayout(const ResolvedLayoutSnapshotV3& layout) const; ResolvedWorldSnapshot withoutResolvedLayoutPassages() const; private: diff --git a/Standalone/Core/src/ResolvedLayoutInternal.h b/Standalone/Core/src/ResolvedLayoutInternal.h index 024730c..5b4feb2 100644 --- a/Standalone/Core/src/ResolvedLayoutInternal.h +++ b/Standalone/Core/src/ResolvedLayoutInternal.h @@ -830,8 +830,9 @@ bool ResolvedLayoutSnapshotV3::validate(ResolvedLayoutValidationModeV3 mode, if(stampVocabularyVersion!=0) add("stamp_vocabulary_version","stamp vocabulary version is set without any stamp records"); } - else if(stampVocabularyVersion!=ResolvedLayoutStampVocabularyVersionV1) - add("stamp_vocabulary_version","resolved stamps require vocabulary version 1"); + else if(stampVocabularyVersion!=ResolvedLayoutStampVocabularyVersionV1 + &&stampVocabularyVersion!=ResolvedLayoutStampVocabularyVersionV2) + add("stamp_vocabulary_version","resolved stamps require supported vocabulary version 1 or 2"); std::vector stampIds; for(const auto& stamp:stamps) { @@ -1065,6 +1066,20 @@ bool ResolveResolvedLayoutStampsV1(ResolvedLayoutSnapshotV3& layout,std::int32_t layout=std::move(candidate);return true; } +bool ResolveResolvedLayoutStampsV2(ResolvedLayoutSnapshotV3& layout,std::int32_t seed, + std::span requests,std::string& error) +{ + if(!ResolveResolvedLayoutStampsV1(layout,seed,requests,error))return false; + if(requests.empty())return true; + ResolvedLayoutSnapshotV3 candidate=layout; + candidate.stampVocabularyVersion=ResolvedLayoutStampVocabularyVersionV2; + if(!candidate.finalize(error))return false; + std::vector issues;std::string strictError; + if(!candidate.validate(ResolvedLayoutValidationModeV3::strict,issues,strictError)) + {error="strict stamp vocabulary-2 validation failed: "+strictError;return false;} + layout=std::move(candidate);return true; +} + ResolvedLayoutStampPlacementAuditV1 AuditResolvedLayoutStampPlacementV1( const ResolvedLayoutSnapshotV3& layout) { diff --git a/Standalone/Core/src/ShapeWorldInternal.h b/Standalone/Core/src/ShapeWorldInternal.h index 643b039..462c990 100644 --- a/Standalone/Core/src/ShapeWorldInternal.h +++ b/Standalone/Core/src/ShapeWorldInternal.h @@ -3339,6 +3339,10 @@ private: return result; } QueryStampSpatialNode(0,minimum,maximum,result); + // Stamp union/carve composition follows canonical stable-ID order. The BVH query + // order is spatial and can differ per tile, which would let a later carve erase a + // fill on meshed tiles even though unscoped density queries use the canonical order. + std::sort(result.begin(),result.end()); return result; } @@ -5673,9 +5677,14 @@ private: case VoxelForgeCore::ResolvedSdfStampKindV1::fillPillar: distance=StampPillarSdf(localX,localY,localZ,stamp.halfExtentsVoxels);break; case VoxelForgeCore::ResolvedSdfStampKindV1::fillDais: - distance=StampRoundedBoxSdf(localX,localY,localZ,stamp.halfExtentsVoxels, - std::min(0.35f,std::min({stamp.halfExtentsVoxels[0], - stamp.halfExtentsVoxels[1],stamp.halfExtentsVoxels[2]})*0.15f));break; + if(ResolvedLayout&&ResolvedLayout->stampVocabularyVersion + >=VoxelForgeCore::ResolvedLayoutStampVocabularyVersionV2) + distance=StampEllipsoidSdf(localX,localY,localZ,stamp.halfExtentsVoxels); + else + distance=StampRoundedBoxSdf(localX,localY,localZ,stamp.halfExtentsVoxels, + std::min(0.35f,std::min({stamp.halfExtentsVoxels[0], + stamp.halfExtentsVoxels[1],stamp.halfExtentsVoxels[2]})*0.15f)); + break; default:return std::numeric_limits::infinity(); } if(stamp.irregularityAmplitudeVoxels>0.0f) diff --git a/Standalone/Core/src/VoxelForgeCore.cpp b/Standalone/Core/src/VoxelForgeCore.cpp index acc15c9..4f2fa9b 100644 --- a/Standalone/Core/src/VoxelForgeCore.cpp +++ b/Standalone/Core/src/VoxelForgeCore.cpp @@ -989,6 +989,15 @@ namespace VoxelForgeCore const ResolvedLayoutSnapshotV3* ResolvedWorldSnapshot::resolvedLayout() const noexcept { return data_?data_->resolvedLayout.get():nullptr; } + ResolvedWorldSnapshot ResolvedWorldSnapshot::withResolvedLayout( + const ResolvedLayoutSnapshotV3& layout) const + { + if(!data_)return {}; + auto copy=std::make_shared(*data_); + copy->resolvedLayout=std::make_shared(layout); + return ResolvedWorldSnapshot(std::move(copy)); + } + ResolvedWorldSnapshot ResolvedWorldSnapshot::withoutResolvedLayoutPassages() const { if(!data_||!data_->resolvedLayout)return {}; @@ -2222,6 +2231,40 @@ namespace VoxelForgeCore RelevantMinimum=std::min(RelevantMinimum,FeatureMinimum); RelevantMaximum=std::max(RelevantMaximum,FeatureMaximum); } + // The native heightfield band only covers the owner terrain and its + // manifest features. Resolved SDF stamps can carve below that band or + // add a floor there, so include every overlapping stamp's bounded Z + // support before clipping marching-cubes samples. + if(impl_->resolvedLayout&&impl_->owner->CoreVoxelSizeMicrons>0) + { + const double MicronsToVoxels=1.0 + /static_cast(impl_->owner->CoreVoxelSizeMicrons); + const double TileMinimumX=static_cast(origin.X-step); + const double TileMinimumY=static_cast(origin.Y-step); + const double TileMaximumX=static_cast(origin.X+extent+step); + const double TileMaximumY=static_cast(origin.Y+extent+step); + for(const auto& Stamp:impl_->resolvedLayout->stamps) + { + if(Stamp.strateIndex!=PlanIt->strateIndex)continue; + const double MinimumX=Stamp.boundsMinimumMicrometres[0] + *MicronsToVoxels; + const double MaximumX=Stamp.boundsMaximumMicrometres[0] + *MicronsToVoxels; + const double MinimumY=Stamp.boundsMinimumMicrometres[1] + *MicronsToVoxels; + const double MaximumY=Stamp.boundsMaximumMicrometres[1] + *MicronsToVoxels; + if(MaximumXTileMaximumX + ||MaximumYTileMaximumY)continue; + const double MinimumZ=Stamp.boundsMinimumMicrometres[2] + *MicronsToVoxels; + const double MaximumZ=Stamp.boundsMaximumMicrometres[2] + *MicronsToVoxels; + if(MaximumZTileMaximumZ)continue; + RelevantMinimum=std::min(RelevantMinimum,MinimumZ); + RelevantMaximum=std::max(RelevantMaximum,MaximumZ); + } + } if(std::isfinite(RelevantMinimum)&&std::isfinite(RelevantMaximum)) { const int32 NativeBandMinimum=FMath::FloorToInt(RelevantMinimum)-step; diff --git a/Standalone/Research/WorldAssemblerM3/Linux45/CaptureLandmarkL45.py b/Standalone/Research/WorldAssemblerM3/Linux45/CaptureLandmarkL45.py new file mode 100644 index 0000000..ea4b954 --- /dev/null +++ b/Standalone/Research/WorldAssemblerM3/Linux45/CaptureLandmarkL45.py @@ -0,0 +1,345 @@ +#!/usr/bin/env python3 +"""Capture the L45 landmark views and audit player-scale built-shape limits.""" +from __future__ import annotations + +import argparse +import importlib.util +import json +import math +import os +from pathlib import Path +import subprocess +import sys +import time + + +ROOT = Path(__file__).resolve().parents[4] +VERIFY = ROOT / "Standalone/Tools/verify" +LINUX37 = ROOT / "Standalone/Research/WorldAssemblerM3/Linux37" +sys.path.insert(0, str(VERIFY)) +from runner import bounded_run, current_stamp, first_stamp + + +def load_module(name: str, path: Path): + spec = importlib.util.spec_from_file_location(name, path) + if spec is None or spec.loader is None: + raise RuntimeError(f"cannot import {path}") + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +PROFILE = load_module("l45_ring_profile", ROOT / + "Standalone/Research/WorldAssemblerM3/Linux32/AuditRingTerraceL32.py") +SHAPE = load_module("l45_shape_audit", LINUX37 / "AuditMouthShapeL37.py") + +PARSER = argparse.ArgumentParser(description=__doc__) +PARSER.add_argument("--layout", type=Path, required=True) +PARSER.add_argument("--artifact-dir", type=Path, required=True) +PARSER.add_argument("--capture-dir", type=Path, required=True) +PARSER.add_argument("--data", type=Path, default=ROOT / "Standalone/data/owner_world.json") +OPTIONS = PARSER.parse_args() + +ARTIFACT_DIR = OPTIONS.artifact_dir.resolve() +CAPTURE_DIR = OPTIONS.capture_dir.resolve() +LAYOUT_PATH = OPTIONS.layout.resolve() +ARTIFACT_DIR.mkdir(parents=True, exist_ok=True) +CAPTURE_DIR.mkdir(parents=True, exist_ok=True) +PNG_DIR = ARTIFACT_DIR / "capture-png" +PNG_DIR.mkdir(parents=True, exist_ok=True) +HEADLESS = Path(os.environ["VOXELFORGE_L37_HEADLESS"]) +RENDERER = Path(os.environ["VOXELFORGE_L37_RENDERER"]) +EXPECTED_STAMP = current_stamp() + + +def run_logged(name: str, command: list[str], *, capture: bool = False) -> str: + log = ARTIFACT_DIR / f"{name}.log" + started = time.monotonic() + with log.open("w", encoding="utf-8") as stream: + result = bounded_run(command, timeout=1800, stdout=stream) + elapsed = time.monotonic() - started + output = log.read_text(encoding="utf-8", errors="replace") + if result is None: + raise RuntimeError(f"{name} timed out; see {log}") + print(f"[L45CaptureRun] step={name} elapsed={elapsed:.1f}s " + f"exit={result.returncode} log={log}", flush=True) + if result.returncode != 0: + raise RuntimeError(f"{name} failed; see {log}") + if capture and (first_stamp(output) != EXPECTED_STAMP + or first_stamp(bounded_run( + [str(command[0]), "--print-source-stamp"], timeout=15).stdout or "") + != EXPECTED_STAMP): + raise RuntimeError(f"{name} executable source stamp mismatch") + return output + + +def stamp_by_id(layout: dict, stable_id: str) -> dict: + for stamp in layout.get("stamps", []): + if stamp.get("stable_id") == stable_id: + return stamp + raise RuntimeError(f"missing stamp {stable_id}") + + +def metres(stamp: dict, key: str = "position_um") -> tuple[float, float, float]: + return tuple(value / 1_000_000.0 for value in stamp[key]) + + +def camera_angles(camera, target): + dx, dy, dz = (target[index] - camera[index] for index in range(3)) + return (math.degrees(math.atan2(dx, dy)), + math.degrees(math.atan2(dz, math.hypot(dx, dy)))) + + +def fmt(values) -> str: + return ",".join(f"{value:.6f}" for value in values) + + +def camera_spec(camera, target): + yaw, pitch = camera_angles(camera, target) + return (*camera, yaw, pitch) + + +layout = json.loads(LAYOUT_PATH.read_text(encoding="utf-8")) +if layout.get("stamp_vocabulary_version") not in (1, 2): + raise RuntimeError("L45 capture needs a prior resolved L45 stamp layout") +entrance_stamp = stamp_by_id(layout, "landmark/sw-arrival-chamber-ramp-000") +next_ramp_stamp = stamp_by_id(layout, "landmark/sw-arrival-chamber-ramp-001") +portal_stamp = stamp_by_id(layout, "landmark/sw-arrival-chamber-mouth-approach-v1") +chamber_stamp = stamp_by_id(layout, "landmark/sw-arrival-chamber-v1") +floor_stamp = stamp_by_id(layout, "landmark/sw-arrival-chamber-v1-floor") +dais_stamp = stamp_by_id(layout, "landmark/sw-arrival-chamber-v1-dais") +entrance = metres(entrance_stamp) +next_ramp = metres(next_ramp_stamp) +portal = metres(portal_stamp) +chamber = metres(chamber_stamp) +floor = metres(floor_stamp) +floor_top = floor[2] + floor_stamp["half_extents_um"][2] / 1_000_000.0 +dais = metres(dais_stamp) +dais_top = dais[2] + dais_stamp["half_extents_um"][2] / 1_000_000.0 +ground_z = entrance[2] - 1.6 +direction_length = math.hypot(next_ramp[0] - entrance[0], next_ramp[1] - entrance[1]) +direction = ((next_ramp[0] - entrance[0]) / direction_length, + (next_ramp[1] - entrance[1]) / direction_length) +outward_length = math.hypot(entrance[0] - chamber[0], entrance[1] - chamber[1]) +outward = ((entrance[0] - chamber[0]) / outward_length, + (entrance[1] - chamber[1]) / outward_length) +mouth_normal = (-direction[1], direction[0]) + +mesh = ARTIFACT_DIR / "landmark-l45.vfmesh" +export_camera = ((entrance[0] + chamber[0]) * 0.5, + (entrance[1] + chamber[1]) * 0.5, + (ground_z + floor_top) * 0.5) +export_target = (chamber[0], chamber[1], floor_top) +run_logged("landmark-export", [str(HEADLESS), str(OPTIONS.data), "--workers=12", + "--world-assembler-prototype", "--stream-benchmark", "--stream-pipeline", + "--force-generate", "--clip-radius=3", "--max-clip-level=0", "--max-level=0", + "--render-distance-chunks=0", "--recipe=surface-world", "--landmark-chamber-demo", + f"--camera={fmt(camera_spec(export_camera, export_target))}", + f"--mesh-export={mesh}", f"--resolved-layout-output={LAYOUT_PATH}"], capture=True) +layout = json.loads(LAYOUT_PATH.read_text(encoding="utf-8")) +if layout.get("stamp_vocabulary_version") != 2: + raise RuntimeError("L45 export did not resolve ellipsoidal-dais stamp vocabulary v2") +entrance_stamp = stamp_by_id(layout, "landmark/sw-arrival-chamber-ramp-000") +next_ramp_stamp = stamp_by_id(layout, "landmark/sw-arrival-chamber-ramp-001") +portal_stamp = stamp_by_id(layout, "landmark/sw-arrival-chamber-mouth-approach-v1") +chamber_stamp = stamp_by_id(layout, "landmark/sw-arrival-chamber-v1") +floor_stamp = stamp_by_id(layout, "landmark/sw-arrival-chamber-v1-floor") +dais_stamp = stamp_by_id(layout, "landmark/sw-arrival-chamber-v1-dais") +entrance = metres(entrance_stamp) +next_ramp = metres(next_ramp_stamp) +portal = metres(portal_stamp) +chamber = metres(chamber_stamp) +floor = metres(floor_stamp) +floor_top = floor[2] + floor_stamp["half_extents_um"][2] / 1_000_000.0 +dais = metres(dais_stamp) +dais_top = dais[2] + dais_stamp["half_extents_um"][2] / 1_000_000.0 +ground_z = entrance[2] - 1.6 +direction_length = math.hypot(next_ramp[0] - entrance[0], next_ramp[1] - entrance[1]) +direction = ((next_ramp[0] - entrance[0]) / direction_length, + (next_ramp[1] - entrance[1]) / direction_length) +outward_length = math.hypot(entrance[0] - chamber[0], entrance[1] - chamber[1]) +outward = ((entrance[0] - chamber[0]) / outward_length, + (entrance[1] - chamber[1]) / outward_length) +if not mesh.is_file() or mesh.stat().st_size == 0: + raise RuntimeError(f"missing mesh export {mesh}") + +voxel_um, triangles, tile_count = PROFILE.read_scene(str(mesh), 0, + floor_top - 8.0, entrance[2] + 9.0, + (min(entrance[0], chamber[0]) - 20.0, max(entrance[0], chamber[0]) + 20.0, + min(entrance[1], chamber[1]) - 20.0, max(entrance[1], chamber[1]) + 20.0)) +bounds = (min(entrance[0], chamber[0]) - 20.0, max(entrance[0], chamber[0]) + 20.0, + min(entrance[1], chamber[1]) - 20.0, max(entrance[1], chamber[1]) + 20.0) +buckets = PROFILE.build_buckets(triangles, True, bounds, cell_size=1.0) +ground_candidates = [] +for ix in range(-20, 21): + for iy in range(-20, 21): + x, y = portal[0] + ix * 0.5, portal[1] + iy * 0.5 + dx, dy = x - portal[0], y - portal[1] + distance = math.hypot(dx, dy) + if not 6.0 <= distance <= 10.0: + continue + hit = PROFILE.sample_surface(buckets, x, y, True, 1.0, + preferred_height=ground_z) + if hit is None or abs(hit[0] - ground_z) > 3.0 or hit[1][2] < 0.85: + continue + alignment = max(-1.0, min(1.0, + (dx * mouth_normal[0] + dy * mouth_normal[1]) / distance)) + angle = math.acos(alignment) + score = abs(distance - 7.0) + angle * 4.0 + ground_candidates.append((score, x, y, hit[0])) +if not ground_candidates: + raise RuntimeError("no walkable mesh ground lies 6 to 10 m from the cave mouth") +_, ground_x, ground_y, outside_ground = min(ground_candidates) +inside_floor = PROFILE.sample_surface(buckets, chamber[0], chamber[1], True, 1.0, + preferred_height=floor_top) +if inside_floor is None or abs(inside_floor[0] - floor_top) > 1.5: + raise RuntimeError(f"chamber floor mesh hit {inside_floor} does not match designed floor {floor_top:.3f} m") +floor_top = inside_floor[0] + +ground_camera = (ground_x, ground_y, outside_ground + 1.6) +entry_ground = PROFILE.sample_surface(buckets, entrance[0], entrance[1], True, 1.0, + preferred_height=ground_z) +if entry_ground is None: + raise RuntimeError("cave mouth has no walkable ground surface in the exported mesh") +entry_camera = (entrance[0] + mouth_normal[0] * 3.8, + entrance[1] + mouth_normal[1] * 3.8, ground_z + 1.6) +entry_ramp_stamps = sorted((stamp for stamp in layout.get("stamps", []) + if stamp.get("stable_id", "").startswith("landmark/sw-arrival-chamber-ramp-")), + key=lambda stamp: stamp["stable_id"]) +if not entry_ramp_stamps: + raise RuntimeError("resolved layout has no chamber ramp stamps") +entry_target_stamp = entry_ramp_stamps[min(8, len(entry_ramp_stamps) - 1)] +entry_target_center = metres(entry_target_stamp) +entry_target = (entry_target_center[0],entry_target_center[1],entry_target_center[2]-1.2) +to_dais = (dais[0] - chamber[0], dais[1] - chamber[1]) +to_dais_length = math.hypot(*to_dais) +opposite_dais = (-to_dais[0] / to_dais_length, -to_dais[1] / to_dais_length) +inside_x = chamber[0] +inside_y = chamber[1] +inside_floor = PROFILE.sample_surface(buckets, inside_x, inside_y, True, 1.0, + preferred_height=floor_top) +inside_eye_z = inside_floor[0] + 1.6 +chamber_camera = (chamber[0] + opposite_dais[0] * 5.5, + chamber[1] + opposite_dais[1] * 5.5, inside_eye_z) +chamber_target = (dais[0], dais[1], dais_top - 0.25) +overview_camera = (entrance[0] + outward[0] * 18.0, + entrance[1] + outward[1] * 18.0, outside_ground + 15.0) +overview_target = ((entrance[0] + chamber[0]) * 0.5, + (entrance[1] + chamber[1]) * 0.5, + (ground_z + floor_top) * 0.5) +inward = (-outward[0], -outward[1]) +clip_point = (entrance[0] + outward[0] * 0.5, + entrance[1] + outward[1] * 0.5) +overview_clip = (inward[0], inward[1], 0.0, + -(inward[0] * clip_point[0] + inward[1] * clip_point[1])) + +views = ( + ("ground-entrance", ground_camera, (portal[0], portal[1], portal[2]), + (portal[0], portal[1], ground_z, 20.0), -509.0), + ("entrance-looking-in", entry_camera, entry_target, (entrance[0], entrance[1], entrance[2], 16.0), -507.0), + ("inside-to-dais", chamber_camera, chamber_target, + (chamber[0], chamber[1], chamber[2], 15.0), chamber[2]), + ("overview-entrance-and-chamber", overview_camera, overview_target, + ((entrance[0] + chamber[0]) * 0.5, + (entrance[1] + chamber[1]) * 0.5, + (ground_z + floor_top) * 0.5, 34.0), -509.0), +) + +for name, camera, target, focus, height_center in views: + png = PNG_DIR / f"{name}.png" + jpg = CAPTURE_DIR / f"{name}.jpg" + yaw, pitch = camera_angles(camera, target) + fov = (80.0 if name == "overview-entrance-and-chamber" else + 70.0 if name in ("inside-to-dais", "entrance-looking-in") else 65.0 + if name == "ground-entrance" else 60.0) + if name == "ground-entrance": + fov = 55.0 + print(f"[L45CaptureCamera] view={name} camera_m=({fmt(camera)}) " + f"target_m=({fmt(target)}) yaw_deg={yaw:.3f} pitch_deg={pitch:.3f} " + f"fov_deg={fov:.1f} entrance_distance_m={math.dist(camera, portal):.3f}", flush=True) + render = [str(RENDERER), str(mesh), str(png), "--size=1600x900", f"--fov-deg={fov:.1f}", + f"--camera-m={fmt(camera)}", f"--yaw-deg={yaw:.6f}", f"--pitch-deg={pitch:.6f}", + "--shade=readable", "--headlamp=on", "--height-tint=on", + "--light-direction=0.3,-0.4,0.85", + f"--height-center-m={(floor_top if name == 'inside-to-dais' else height_center):.6f}", + f"--height-range-m={4 if name == 'inside-to-dais' else 16}", + "--tile-skirts=off", "--tile-edges=off", + f"--focus-region={fmt(focus)}"] + if name == "overview-entrance-and-chamber": + render.append(f"--clip-plane={fmt(overview_clip)}") + run_logged(f"{name}-render", render, capture=True) + for quality in (4, 6, 8): + run_logged(f"{name}-jpeg-q{quality}", ["ffmpeg", "-nostdin", "-hide_banner", + "-loglevel", "error", "-y", "-i", str(png), "-frames:v", "1", + "-q:v", str(quality), str(jpg)]) + if jpg.is_file() and 0 < jpg.stat().st_size <= 300_000: + break + if not jpg.is_file() or not 0 < jpg.stat().st_size <= 300_000: + raise RuntimeError(f"{jpg.name} exceeds the 300 KB capture limit") + quality_log = run_logged(f"{name}-quality", [sys.executable, + str(VERIFY / "capture_quality.py"), str(jpg)]) + print(f"[L45CaptureJPEG] file={jpg} bytes={jpg.stat().st_size} " + f"quality_log={quality_log.strip().replace(chr(10), ' ')} status=PASS", flush=True) + + +def region_triangles(center, radius_xy, z_min, z_max): + selected = [] + for triangle in triangles: + points = tuple(vertex[0] for vertex in triangle[2]) + centroid = tuple(sum(point[axis] for point in points) / 3.0 for axis in range(3)) + if (math.hypot(centroid[0] - center[0], centroid[1] - center[1]) <= radius_xy + and z_min <= centroid[2] <= z_max): + selected.append(triangle) + return selected + + +def audit_shape(name, region, center): + metrics = SHAPE.analyze_triangles(region, center[:2], center[2], + crop_to_center=False, include_sides=True) + passed = (metrics["triangles"] > 0 + and metrics["planar_area"] < SHAPE.PLANE_LIMIT_M2 + and metrics["straight"] <= SHAPE.STRAIGHT_LIMIT_M + and metrics["corners"] == 0) + print(f"[LandmarkBuiltShape] region={name} triangles={metrics['triangles']} " + f"planar_patch_m2={metrics['planar_area']:.4f} " + f"straight_run_m={metrics['straight']:.4f} sharp_corners={metrics['corners']} " + f"corner_turn_max_deg={metrics['corner_turn_max']:.2f} " + f"thresholds=({SHAPE.PLANE_LIMIT_M2:.2f}m2,{SHAPE.STRAIGHT_LIMIT_M:.2f}m," + f"{SHAPE.CORNER_TURN_LIMIT_DEG:.0f}deg) status={'PASS' if passed else 'FAIL'}", + flush=True) + if not passed: + raise RuntimeError(f"L37 built-shape thresholds failed in {name}") + return metrics + + +entrance_metrics = audit_shape("cave-mouth", region_triangles( + portal, 5.0, ground_z + 0.8, ground_z + 4.5), + (portal[0], portal[1], ground_z)) +dais_surface = PROFILE.sample_surface(buckets, dais[0], dais[1], True, 1.0, + preferred_height=dais_top - 0.4) +if dais_surface is None: + raise RuntimeError("dais stamp has no upward-facing surface in the exported mesh") +dais_rise = dais_surface[0] - floor_top +print(f"[LandmarkDaisSurface] center_m=({dais[0]:.3f},{dais[1]:.3f}) " + f"floor_z_m={floor_top:.3f} top_z_m={dais_surface[0]:.3f} " + f"rise_m={dais_rise:.3f} minimum_m=1.000 " + f"status={'PASS' if dais_rise >= 1.0 else 'FAIL'}", flush=True) +if dais_rise < 1.0: + raise RuntimeError(f"dais rises only {dais_rise:.3f} m above the chamber floor") +dais_metrics = audit_shape("dais-platform", region_triangles( + dais, 1.7, floor_top + 0.6, dais_top + 0.4), + (dais[0], dais[1], dais_surface[0])) +metrics_path = ARTIFACT_DIR / "landmark-shape-metrics.json" +metrics_path.write_text(json.dumps({ + "vocabulary_version": layout["stamp_vocabulary_version"], + "entry_m": entrance, "portal_m": portal, "entry_ground_m": ground_z, + "chamber_center_m": chamber, "chamber_floor_m": floor_top, + "dais_center_m": dais, "dais_top_m": dais_top, + "dais_surface_m": dais_surface[0], "dais_rise_m": dais_rise, + "l37_thresholds": {"planar_patch_m2_lt": SHAPE.PLANE_LIMIT_M2, + "straight_run_m_lte": SHAPE.STRAIGHT_LIMIT_M, + "corner_turn_deg_lt": SHAPE.CORNER_TURN_LIMIT_DEG}, + "entrance_arch": entrance_metrics, "dais_platform": dais_metrics, + "mesh_tiles": tile_count, "mesh_voxel_um": voxel_um, +}, indent=2) + "\n", encoding="utf-8") +print(f"[L45CaptureShapeMetrics] file={metrics_path} status=PASS", flush=True) diff --git a/Standalone/Research/WorldAssemblerM3/Linux45/REPORT.md b/Standalone/Research/WorldAssemblerM3/Linux45/REPORT.md new file mode 100644 index 0000000..5597399 --- /dev/null +++ b/Standalone/Research/WorldAssemblerM3/Linux45/REPORT.md @@ -0,0 +1,48 @@ +# L45 — reachable landmark chamber + +## Design and stamps + +The SW demo opens through a rounded, side-facing ellipsoid portal, then follows a bent rock ramp with two level landings into the 17 × 15 m chamber. The sloped section drops 5.85 m; the maximum measured grade is 14.039°. An ellipsoidal rock dais rises 1.138 m above the chamber floor. + +The demo layout resolves 166 version-2 stamps: 57 ellipsoid carves, 107 support pillars, and two filled ellipsoids for the floor and dais. The side portal and supported arrival landing are runtime-only under the demo flag. `owner_world.json` is unchanged. + +## Reachability and shape audits + +The surface search joins walkable ground near the arrival mouth to the chamber floor. The capsule route passed 66 samples and 6,798 clearance checks: zero blocked samples, zero unsupported samples across 330 support checks, and zero grade failures. Minimum clearance is 0.085 m. The exact buried L43 layout fails the same reachability audit as required. + +L37 thresholds (planar patch <0.50 m², straight run ≤0.75 m, no sharp corners): the portal measured 0.417 m² / 0.522 m / 0 corners; the dais measured 0.282 m² / 0.750 m / 0 corners. + +## Hashes and cost + +- Source stamp: `0ec9177748faff6ef4813af0c418057edfcacf95c7c39c1292288a29c7775015` (GCC and Clang). +- Owner JSON SHA-256: `7b095f9bcc6b90133d5a463f99f0b571133b2c549ce1ecf2d64fe9175e41e183`. +- Demo-off layout IDs: FI `b7a7d9ecc48d8f26`; SW `8a52e84c26ed92d2`. The 12-hash W1/W12 owner signatures match L44: FI `9820f4f38b189b3f7263810e7b3ff62aa502b21f476ffcfdbc7761a65cb07d58`; SW `a1e9268a4bbcc77d2a1ac54095df6851a70bab65c43ae50b332ed75132617834`. +- Five-pair demo-off cost vs L44: FI median 16.476 → 16.677 s (+1.22%); SW 1.733 → 1.731 s (−0.12%). + +## Verification and captures + +`verify.py fast`, `medium`, and `full` passed in 189.5 s, 561.8 s, and 1,609.1 s. Passage, interface/hole, seeded random-camera, W1/W8/W12 determinism, and 30-cell checks passed. + +All four JPEGs pass `capture_quality.py` and are under 300 KB: + +- [Ground entrance, eye height at 7.03 m](captures/ground-entrance.jpg) — 36,041 B +- [Entrance looking in](captures/entrance-looking-in.jpg) — 41,507 B +- [Inside toward the dais](captures/inside-to-dais.jpg) — 36,590 B +- [Overview of entrance and chamber](captures/overview-entrance-and-chamber.jpg) — 58,255 B + +## Failed runs + +Six geometry trial exports were used, within the 15-trial budget. The boxy arch exceeded the shape limits; early ramp/support variants blocked the path or exceeded the grade limit; a deeper mouth cut broke the surface connection and was reverted. Early eye-level camera angles were wall-blocked or poorly framed. The first final fast invocation rejected a stale GCC stamp; GCC was rebuilt to match and fast passed. The buried L43 and deliberate verifier negative controls fail as expected. + +## Orchestrator review (Claude) + +Accepted as the flagged demo. The stamp matches the final Clang and GCC builds (`0ec91777…`); demo-off owner +hashes are identical to L44; the buried L43 layout fails the new reachability audit. The overview reads as a real +place: a sinkhole and curved path cut into the ground, leading down into a chamber with a rock dais. Not yet natural: +- **The ramp is visibly segmented.** Evenly spaced ribs run along it in the overview and the entrance view, the same + per-segment seam family as the L35 ribs and L36 washboard. It is built from 57 carves plus 107 support pillars. +- **The ramp's raised edge has straight vertical walls,** so in `entrance-looking-in.jpg` it reads as a built walkway. +- **Headroom along the path is tight:** 0.085 m minimum clearance. +- The dais is a smooth dome, readable but plain. + +Next (L46): replace the stamped ramp with one continuous floor-capped tunnel edge, following R12's first slice. diff --git a/Standalone/Research/WorldAssemblerM3/Linux45/captures/entrance-looking-in.jpg b/Standalone/Research/WorldAssemblerM3/Linux45/captures/entrance-looking-in.jpg new file mode 100644 index 0000000..2551e2a Binary files /dev/null and b/Standalone/Research/WorldAssemblerM3/Linux45/captures/entrance-looking-in.jpg differ diff --git a/Standalone/Research/WorldAssemblerM3/Linux45/captures/ground-entrance.jpg b/Standalone/Research/WorldAssemblerM3/Linux45/captures/ground-entrance.jpg new file mode 100644 index 0000000..a224bdb Binary files /dev/null and b/Standalone/Research/WorldAssemblerM3/Linux45/captures/ground-entrance.jpg differ diff --git a/Standalone/Research/WorldAssemblerM3/Linux45/captures/inside-to-dais.jpg b/Standalone/Research/WorldAssemblerM3/Linux45/captures/inside-to-dais.jpg new file mode 100644 index 0000000..a7410b0 Binary files /dev/null and b/Standalone/Research/WorldAssemblerM3/Linux45/captures/inside-to-dais.jpg differ diff --git a/Standalone/Research/WorldAssemblerM3/Linux45/captures/overview-entrance-and-chamber.jpg b/Standalone/Research/WorldAssemblerM3/Linux45/captures/overview-entrance-and-chamber.jpg new file mode 100644 index 0000000..c2d1f5c Binary files /dev/null and b/Standalone/Research/WorldAssemblerM3/Linux45/captures/overview-entrance-and-chamber.jpg differ diff --git a/Standalone/Research/WorldAssemblerM3/Research12/REPORT.md b/Standalone/Research/WorldAssemblerM3/Research12/REPORT.md new file mode 100644 index 0000000..0c1ae2b --- /dev/null +++ b/Standalone/Research/WorldAssemblerM3/Research12/REPORT.md @@ -0,0 +1,66 @@ +# Research R12 — Composite cavern graph + +**Read-only review; no source changes, scripts, tests, or binaries.** + +## Design + +Build one immutable cavern field per selected strate. Its resolved graph has stable chamber nodes, tunnel edges, and a required arrival-to-departure backbone. Resolve it before tile jobs from `(world seed, absolute strate, recipe/version, stable node or edge ID)`. Store positions, radii, floors, and conservative bounds in integer micrometres; sort records by stable ID. The field must return the same value for a physical coordinate at every LOD. + +Build the required spine first, connecting the actual resolved mouth anchors. Add optional branches and dead ends afterward; add loops only as edges between already connected nodes. Graph connectivity alone does not guarantee a walkable route: room and tunnel portals must overlap with clearance, their floors must meet, and the final field must pass the arrival-to-departure player-fit audit. + +Use smooth ellipsoid or blob SDFs for chamber envelopes and swept capsule SDFs for tunnel edges. Keep an explicit floor profile on each room and edge; cap the void at that floor and keep the floor cap separate from smooth unions and wall relief. Start from the native substrate, carve the graph into it, then let the existing shared boundary and inter-strate passage composition run. With Core’s signed-field convention, carve using smooth maximum with the negated void SDF. Keep seeded, bounded relief on walls and ceilings, away from the walk plane. + +For floors, apply R1’s floor-first carve and narrow native-solid support fallback. R3 warns that overlapping coils can select the wrong floor owner: for floor samples, consider only candidates within half a voxel (0.125 m) and within the bore radius; choose by floor-point distance, then stable feature ID. Keep tube ownership separate from floor ownership. R3’s synthetic result does not prove that rule fixes the real L38 floor behavior, so verify it on the actual field before adoption. [R1]() · [R3]() + +The design follows useful patterns from prior work: Minecraft names distinct large “cheese” caverns, winding “spaghetti” tunnels, and narrow “noodle” passages; Deep Rock Galactic connects authored room templates with narrow tunnels and varies room interiors; Spelunky 2 constructs a safe route from room templates before adding optional exploration. Cave-generation papers likewise separate network topology from its SDF geometry: one uses Voronoi/Delaunay structure for playable cave connections, and another builds a cave graph and derives conduit geometry from an SDF construction tree. [Minecraft](https://www.minecraft.net/de-de/article/caves---cliffs--part-ii-out-today-java) · [Deep Rock Galactic](https://store.steampowered.com/news/posts/?appgroupname=Deep+Rock+Galactic&appids=548430&enddate=1730296516&feed=steam_community_announcements) · [Derek Yu interview](https://blog.playstation.com/archive/2018/08/29/first-look-at-spelunky-2-gameplay-plus-new-derek-yu-interview/) · [Santamaría-Ibirika et al., 2014](https://santosgrueiro.com/papers/2014/2014-Santam-Cave.pdf) · [Paris et al., 2021](https://onlinelibrary.wiley.com/doi/full/10.1111/cgf.14420) + +## Fit with R6 and current code + +- **Resolved layout:** Add optional, versioned graph records to the resolved snapshot, following L43’s optional stamp vocabulary pattern. Include active graph records in canonical identity; bump the selected recipe/evaluator version when its geometry changes. Existing graph-free layouts should retain their identity. The snapshot currently holds strates, passages, and stamps in [VoxelForgeCore.h:907](). + +- **Bound field table:** L40 binds one concrete evaluator per strate in `BindResolvedStratumFields`; its variant currently covers SurfaceWorld, FloatingIslands, and legacy fields. Add a native cavern-network adapter that binds the graph and substrate once. Keep evaluation free of manager lookups. R6’s target uses physical metre queries; today’s adapter evaluates in voxel coordinates, so keep graph data in micrometres and convert at the binding boundary, or add the physical-coordinate API as a separate migration step. [R6 §2]() · [L40 adapter and binding]() · [Binding function]() + +- **Capabilities and shared composition:** L42 resolves interface and passage policy before sampling. Resolve graph-floor policy at the same stage; avoid per-sample generator-name branches. Preserve the current ceiling/content/bedrock order and let shared passages retain ownership of inter-strate openings. `ApplyResolvedStrateComposition` currently applies boundary bands, passage carving, then stamps. Put cavern carving inside the bound field evaluator, before shared boundary composition, so a chamber cannot cut through protected bands. [L42 architecture]() · [Composition]() + +- **Stamps and BVH culling:** Reuse L43’s ellipsoid SDF, bounded relief, stable IDs, and BVH implementation patterns. Keep graph rooms as graph records rather than generic landmark stamps: stamp placement rejects route/walk-corridor intersections, while network features intentionally connect to the route. Add room and edge bounds to the tile feature query so tiles evaluate only relevant graph features. [Stamp records]() · [Stamp BVH]() · [Passage feature BVH]() + +- **Shape-free proofs:** Extend `World::isTileShapeFree` with conservative bounds for every graph room, edge, blend radius, relief reach, and support feature. Any overlap must make native-only eligibility fail; box classification must remain mixed/unknown on graph overlap. L44 traced a worker-count mismatch to omitted support-column bounds in this proof. [Proof function]() · [L44 finding]() + +The legacy `TunnelNetwork` already has room/corridor SDFs and worm tunnels, but R6 describes it as a legacy evaluation route. A resolved Core graph adds the missing precomputed connectivity, floor ownership, bounded feature records, and field contract. + +## Risks + +| Risk | Control and evidence | +|---|---| +| Connected graph, unwalkable field | Keep explicit floor profiles and portal overlap; audit final-density capsule clearance, support, grade, and mouth-to-mouth connectivity. | +| Floor errors at loops or crossings | Use floor-near ownership with stable tie-breaking; measure the real owner field because R3’s synthetic case did not reproduce L38. | +| Per-voxel cost grows with graph size | Use conservative feature AABBs and tile BVH candidates; record candidates and SDF evaluations per tile and benchmark paired graph-off/on views. | +| Chamber or support crosses a seal | Include smooth blend, relief, and support extents in graph bounds; reject placements touching ceiling, bedrock, or protected bands. | +| Nondeterminism or stale identity | Hash sorted graph records and versions; use fixed-point placement and keyed per-feature seeds; compare worker counts and compilers. | + +## Smallest slices + +1. **Owner demo:** Add one large chamber and one floor-capped tunnel edge connected to the existing tested arrival-to-departure route. Keep that route as the guaranteed spine. Use the accepted L45 chamber record as the first room node if its bounds and connection fit; otherwise use one fixed, opt-in demo record. No random branches or loops. Verify a deterministic layout round trip, readable approach/entrance/interior captures, and the existing walkability and boundary checks. + +2. **Resolved graph generator:** Support multiple room motifs and a mandatory connected backbone, with per-node/edge bounds and graph-aware culling. Verify seed stability, graph connectivity, and arrival-to-departure walkability across the owner seed matrix. + +3. **Optional topology and detail:** Add bounded branches, dead ends, then loops; add seeded wall relief after floor and clearance gates pass. Verify loop crossings, floor ownership, cost scaling, worker/compiler parity, and LOD ring behavior. + +4. **Authoring and runtime integration:** Expose motif and rule data to the owner, then connect the opt-in recipe to Unreal preview, collision, and cave presentation. + +## Measurements to run + +- Snapshot round-trip and canonical identity across repeat resolves, worker counts, and reordered inputs. +- Graph connectivity plus final-density six-neighbour player-fit flood fill from resolved arrival to departure; require the project’s full seed law gate, not just graph reachability. +- Passage audits for capsule fit, floor support, ≤15° grade, open air, floor ripple, and mouth transitions. +- Strict bounds and hole/bedrock-band audits, including negative controls that force a graph feature into a protected band. +- W1/W8/W12 determinism at the L44 failure camera plus random cameras; compare density, mesh, payload, and topology hashes. +- Five paired graph-off/on cost runs at matching tile sets; report whole-view time, density time, BVH candidates, and per-feature evaluations. Repeat at increasing graph sizes after the first slice. + +## Owner authoring + +Start from the project’s existing scale families: chamber radii of 4–10 m, tunnel radii of 1.5–2 m, and metric bounds relative to strate interfaces. [ARCHITECTURE §8.0]() + +The owner should author chamber motifs and floor styles; connector radius, bend, and widening rules; required route and allowed degree; branch, loop, and dead-end limits; and bounded wall-relief palettes. Keep the required spine’s clearances and floor-grade limit fixed across motifs. + +**Owner question:** May the accepted L45 chamber become the first graph node, with the existing arrival-to-departure route retained as the guaranteed spine? \ No newline at end of file diff --git a/Standalone/Source/StreamBenchmarkHeadless.cpp b/Standalone/Source/StreamBenchmarkHeadless.cpp index 71c5d2c..12287d3 100644 --- a/Standalone/Source/StreamBenchmarkHeadless.cpp +++ b/Standalone/Source/StreamBenchmarkHeadless.cpp @@ -56,6 +56,7 @@ namespace int RenderDistanceOverride=0; bool FloatingIslandsRecipe=false; bool LandmarkChamberDemo=false; + bool AuditLandmarkReachability=false; bool TlsProbeRequested=false; int TlsProbeWorkers=0; std::string TlsProbeTouch="none"; @@ -111,6 +112,7 @@ namespace bool MakeLandmarkChamberDemoRequests( const VoxelForgeCore::ResolvedLayoutSnapshotV3& layout, + const VoxelForgeCore::WorldAssemblyManifest& worldAssembly, std::int32_t seed, std::vector& requests, std::string& error) @@ -147,49 +149,371 @@ namespace chamber.stableId="landmark/sw-arrival-chamber-v1"; chamber.strateIndex=surface->strateIndex; chamber.kind=ResolvedSdfStampKindV1::carveEllipsoid; + // Anchor the chamber horizontally beside the arrival passage. Its height is + // set from the local SurfaceWorld ground sample below so the carve keeps a + // real rock roof instead of breaking through a low patch of terrain. chamber.anchorPositionMicrometres={ arrivalMicrometres[0]+static_cast(std::llround(sideX*28000000.0)), arrivalMicrometres[1]+static_cast(std::llround(sideY*28000000.0)), - arrivalMicrometres[2]-14000000}; - chamber.placementRadiusMicrometres=2000000; - chamber.halfExtentsMicrometres={8500000,7500000,6000000}; - chamber.smoothWidthMicrometres=800000; - chamber.irregularityAmplitudeMicrometres=700000; - chamber.irregularityWavelengthMicrometres=4800000; + arrivalMicrometres[2]-13000000}; + chamber.placementRadiusMicrometres=0; + chamber.halfExtentsMicrometres={8500000,7500000,3000000}; + chamber.smoothWidthMicrometres=600000; + chamber.irregularityAmplitudeMicrometres=600000; + chamber.irregularityWavelengthMicrometres=3800000; ResolvedLayoutStampRequestV1 dais; - dais.stableId="landmark/sw-arrival-chamber-dais-v1"; + // Resolved stamps compose in stable-ID order. Keep the raised fills after + // chamber-v1 so that the enclosing carve cannot cut them away. + dais.stableId="landmark/sw-arrival-chamber-v1-dais"; dais.strateIndex=surface->strateIndex; + // The version-2 ellipsoid fill rounds the platform into the chamber floor + // instead of leaving the long, straight wall of a flat-topped pillar. dais.kind=ResolvedSdfStampKindV1::fillDais; dais.anchorPositionMicrometres=chamber.anchorPositionMicrometres; - dais.anchorPositionMicrometres[2]-=2600000; - dais.placementRadiusMicrometres=1000000; - dais.halfExtentsMicrometres={3200000,2800000,900000}; - dais.smoothWidthMicrometres=300000; + // Keep the raised platform on the broad filled floor rather than merging + // it into the chamber's outer slope. Leave a capsule-width landing around + // the ramp's centerline at the chamber entrance. + dais.anchorPositionMicrometres[0]+=static_cast(std::llround(sideX*2600000.0)); + dais.anchorPositionMicrometres[1]+=static_cast(std::llround(sideY*2600000.0)); + dais.anchorPositionMicrometres[2]-=400000; + dais.placementRadiusMicrometres=0; + dais.halfExtentsMicrometres={2100000,1800000,1300000}; + dais.smoothWidthMicrometres=450000; dais.irregularityAmplitudeMicrometres=180000; - dais.irregularityWavelengthMicrometres=2200000; + dais.irregularityWavelengthMicrometres=1800000; - const double entranceDirectionX=sideX,entranceDirectionY=sideY; - ResolvedLayoutStampRequestV1 entrance; - entrance.stableId="landmark/sw-arrival-chamber-entrance-v1"; - entrance.strateIndex=surface->strateIndex; - entrance.kind=ResolvedSdfStampKindV1::carveArch; - entrance.anchorPositionMicrometres={ - chamber.anchorPositionMicrometres[0] - +static_cast(std::llround(entranceDirectionX*6500000.0)), - chamber.anchorPositionMicrometres[1] - +static_cast(std::llround(entranceDirectionY*6500000.0)), - chamber.anchorPositionMicrometres[2]}; - entrance.placementRadiusMicrometres=1000000; - entrance.halfExtentsMicrometres={2600000,4200000,3200000}; - entrance.smoothWidthMicrometres=350000; - entrance.irregularityAmplitudeMicrometres=250000; - entrance.irregularityWavelengthMicrometres=2600000; - if(std::abs(entranceDirectionX)>std::abs(entranceDirectionY)) - entrance.yawQuarterTurns=entranceDirectionX>0.0?3:1; - else - entrance.yawQuarterTurns=entranceDirectionY>0.0?0:2; - requests={std::move(chamber),std::move(entrance),std::move(dais)}; + ResolvedLayoutStampRequestV1 chamberFloor; + chamberFloor.stableId="landmark/sw-arrival-chamber-v1-floor"; + chamberFloor.strateIndex=surface->strateIndex; + chamberFloor.kind=ResolvedSdfStampKindV1::fillDais; + chamberFloor.anchorPositionMicrometres=chamber.anchorPositionMicrometres; + chamberFloor.anchorPositionMicrometres[2]-=2500000; + chamberFloor.placementRadiusMicrometres=0; + chamberFloor.halfExtentsMicrometres={5800000,5200000,2000000}; + chamberFloor.smoothWidthMicrometres=250000; + chamberFloor.irregularityAmplitudeMicrometres=80000; + chamberFloor.irregularityWavelengthMicrometres=2200000; + + const auto surfacePlan=std::find_if(worldAssembly.plan.strates.begin(), + worldAssembly.plan.strates.end(),[&](const auto& value) + {return value.strateIndex==surface->strateIndex;}); + if(surfacePlan==worldAssembly.plan.strates.end()) + {error="landmark chamber demo needs its SurfaceWorld heightfield plan";return false;} + const Heightfield2D field(worldAssembly.recipe,*surfacePlan); + if(!field.isValid()) + {error="landmark chamber demo SurfaceWorld heightfield is invalid";return false;} + + const double coreMicrometres=std::max(1,layout.coreVoxelSizeMicrometres); + const double qToMicrometres=coreMicrometres/WorldAssemblySubvoxelsPerVoxel; + const auto qToMetres=[&](std::int64_t value) + {return static_cast(value)*qToMicrometres/1000000.0;}; + const auto metresToQ=[&](double value) + {return static_cast(std::llround(value*1000000.0/qToMicrometres));}; + const double startX=qToMetres(mouth[0])+sideX*20.0; + const double startY=qToMetres(mouth[1])+sideY*20.0; + const auto surfaceSample=field.point(metresToQ(startX),metresToQ(startY),0); + const std::int64_t surfaceHeightQ=surfaceSample.groundHeightSubvoxels; + const double surfaceHeight=qToMetres(surfaceHeightQ); + + // Search beside the arrival corridor for a chamber site whose actual terrain + // height lets the player descend from this surface entrance at a walkable grade. + // The earlier fixed XY site lay over a deep valley, leaving no room for a roof + // and asking the ramp to drop 37 m in 71 m. + double chamberSideOffset=0.0,chamberTangentOffset=0.0; + double chamberGroundHeight=0.0,bestChamberSiteScore=std::numeric_limits::infinity(); + for(double sideOffset=28.0;sideOffset<=52.0;sideOffset+=2.0) + for(double tangentOffset=-32.0;tangentOffset<=32.0;tangentOffset+=2.0) + { + const double x=qToMetres(mouth[0])+sideX*sideOffset+dx/length*tangentOffset; + const double y=qToMetres(mouth[1])+sideY*sideOffset+dy/length*tangentOffset; + const double distanceFromEntrance=std::hypot(x-startX,y-startY); + if(distanceFromEntrance<16.0)continue; + const auto sample=field.point(metresToQ(x),metresToQ(y),0); + const double ground=qToMetres(sample.groundHeightSubvoxels); + if(groundsurfaceHeight+4.0)continue; + const double sideDelta=sideOffset-42.0; + const double tangentDelta=tangentOffset-2.0; + const double score=sideDelta*sideDelta+tangentDelta*tangentDelta + +4.0*(ground-surfaceHeight)*(ground-surfaceHeight); + if(score>=bestChamberSiteScore)continue; + bestChamberSiteScore=score;chamberSideOffset=sideOffset; + chamberTangentOffset=tangentOffset;chamberGroundHeight=ground; + chamber.anchorPositionMicrometres[0]=static_cast( + std::llround(x*1000000.0)); + chamber.anchorPositionMicrometres[1]=static_cast( + std::llround(y*1000000.0)); + } + if(!std::isfinite(bestChamberSiteScore)) + {error="landmark chamber has no nearby surface site with a walkable descent grade";return false;} + constexpr double ChamberRoofCoverMetres=0.5; + const double chamberCarveTopReach= + static_cast(chamber.halfExtentsMicrometres[2] + +chamber.smoothWidthMicrometres + +chamber.irregularityAmplitudeMicrometres)/1000000.0; + const double chamberCenterZ=chamberGroundHeight-chamberCarveTopReach + -ChamberRoofCoverMetres; + chamber.anchorPositionMicrometres[2]=static_cast( + std::llround(chamberCenterZ*1000000.0)); + dais.anchorPositionMicrometres[0]=chamber.anchorPositionMicrometres[0] + +static_cast(std::llround(sideX*2600000.0)); + dais.anchorPositionMicrometres[1]=chamber.anchorPositionMicrometres[1] + +static_cast(std::llround(sideY*2600000.0)); + dais.anchorPositionMicrometres[2]=chamber.anchorPositionMicrometres[2]-400000; + chamberFloor.anchorPositionMicrometres[0]=chamber.anchorPositionMicrometres[0]; + chamberFloor.anchorPositionMicrometres[1]=chamber.anchorPositionMicrometres[1]; + chamberFloor.anchorPositionMicrometres[2]=chamber.anchorPositionMicrometres[2]-2500000; + + struct FPathPoint { double x=0.0,y=0.0; }; + const FPathPoint start{startX,startY}; + const FPathPoint firstTurn{ + qToMetres(mouth[0])+sideX*34000000.0/1000000.0+dx/length*14000000.0/1000000.0, + qToMetres(mouth[1])+sideY*34000000.0/1000000.0+dy/length*14000000.0/1000000.0}; + const FPathPoint end{ + chamber.anchorPositionMicrometres[0]/1000000.0, + chamber.anchorPositionMicrometres[1]/1000000.0}; + const std::array waypoints={start,firstTurn,end}; + std::vector densePath; + const auto appendLine=[&](FPathPoint from,FPathPoint to) + { + const double distance=std::hypot(to.x-from.x,to.y-from.y); + const int steps=std::max(1,static_cast(std::ceil(distance/0.25))); + for(int i=0;i<=steps;++i) + { + const double t=static_cast(i)/steps; + const FPathPoint point{from.x+(to.x-from.x)*t,from.y+(to.y-from.y)*t}; + if(densePath.empty()||std::hypot(point.x-densePath.back().x, + point.y-densePath.back().y)>1.0e-6)densePath.push_back(point); + } + }; + constexpr double BendRadius=6.0; + FPathPoint current=waypoints.front(); + for(std::size_t i=1;i+1(step)/ArcSteps,oneMinus=1.0-t; + const FPathPoint point{ + oneMinus*oneMinus*before.x+2.0*oneMinus*t*corner.x+t*t*after.x, + oneMinus*oneMinus*before.y+2.0*oneMinus*t*corner.y+t*t*after.y}; + if(densePath.empty()||std::hypot(point.x-densePath.back().x, + point.y-densePath.back().y)>1.0e-6)densePath.push_back(point); + } + current=after; + } + appendLine(current,waypoints.back()); + if(densePath.size()<2) + {error="landmark cave ramp path is degenerate";return false;} + std::vector arcLength(densePath.size(),0.0); + for(std::size_t i=1;i::infinity(); + for(std::size_t i=0;istrateIndex; + mouthStamp.kind=ResolvedSdfStampKindV1::carveEllipsoid; + mouthStamp.anchorPositionMicrometres={ + static_cast(std::llround(startX*1000000.0)), + static_cast(std::llround(startY*1000000.0)), + static_cast(std::llround((startZ+1.0)*1000000.0))}; + mouthStamp.placementRadiusMicrometres=0; + mouthStamp.halfExtentsMicrometres={4200000,3700000,2800000}; + mouthStamp.smoothWidthMicrometres=450000; + // A broad, rounded upper flare blends the side-facing portal into the slope. + mouthStamp.irregularityAmplitudeMicrometres=250000; + mouthStamp.irregularityWavelengthMicrometres=2400000; + std::printf("[LandmarkChamberPlan] center_m=(%.3f,%.3f,%.3f) local_ground_m=%.3f carve_top_reach_m=%.3f roof_cover_m=%.3f\n", + end.x,end.y,chamberCenterZ,chamberGroundHeight,chamberCarveTopReach, + chamberGroundHeight-(chamberCenterZ+chamberCarveTopReach)); + std::printf("[LandmarkChamberSite] side_offset_m=%.3f tangent_offset_m=%.3f entrance_ground_m=%.3f chamber_ground_m=%.3f\n", + chamberSideOffset,chamberTangentOffset,surfaceHeight,chamberGroundHeight); + std::printf("[LandmarkRampPlan] entry_m=(%.3f,%.3f,%.3f) ground_m=%.3f cap_m=%.3f end_m=(%.3f,%.3f,%.3f) horizontal_m=%.3f entry_landing_m=%.3f turn_landing_m=%.3f turn_distance_m=%.3f sloped_m=%.3f descent_m=%.3f grade_deg=%.3f required_length_m=%.3f\n", + startX,startY,startZ,surfaceHeight, + qToMetres(surfaceSample.capHeightSubvoxels),end.x,end.y,endZ,totalLength, + EntryLandingLength,firstTurnLandingLength,firstTurnDistance, + slopedLength,descent, + std::atan2(std::abs(descent),slopedLength)*180.0/3.14159265358979323846, + std::abs(descent)/std::tan(15.0*3.14159265358979323846/180.0)); + if(!(slopedLength>0.0)||std::atan2(std::abs(descent),slopedLength) + >15.0*3.14159265358979323846/180.0) + {error="landmark cave ramp cannot meet the 15 degree walk grade";return false;} + + const double entryPathLength=std::hypot(firstTurn.x-start.x, + firstTurn.y-start.y); + const double entryPathX=(firstTurn.x-start.x)/entryPathLength; + const double entryPathY=(firstTurn.y-start.y)/entryPathLength; + const double mouthNormalX=-entryPathY,mouthNormalY=entryPathX; + constexpr double MouthPortalDepth=3.8; + constexpr double MouthPortalHalfWidth=2.8; + constexpr double MouthPortalCenterOffset=2.6; + const double mouthPortalX=startX+mouthNormalX*MouthPortalCenterOffset; + const double mouthPortalY=startY+mouthNormalY*MouthPortalCenterOffset; + ResolvedLayoutStampRequestV1 mouthPortal; + mouthPortal.stableId="landmark/sw-arrival-chamber-mouth-approach-v1"; + mouthPortal.strateIndex=surface->strateIndex; + mouthPortal.kind=ResolvedSdfStampKindV1::carveEllipsoid; + mouthPortal.anchorPositionMicrometres={ + static_cast(std::llround(mouthPortalX*1000000.0)), + static_cast(std::llround(mouthPortalY*1000000.0)), + static_cast(std::llround(startZ*1000000.0))}; + mouthPortal.placementRadiusMicrometres=0; + mouthPortal.halfExtentsMicrometres={3800000,2800000,2000000}; + mouthPortal.smoothWidthMicrometres=450000; + mouthPortal.irregularityAmplitudeMicrometres=180000; + mouthPortal.irregularityWavelengthMicrometres=2000000; + + ResolvedLayoutStampRequestV1 mouthLanding; + mouthLanding.stableId="landmark/sw-arrival-z-mouth-landing-v1"; + mouthLanding.strateIndex=surface->strateIndex; + mouthLanding.kind=ResolvedSdfStampKindV1::fillPillar; + mouthLanding.anchorPositionMicrometres={ + static_cast(std::llround(mouthPortalX*1000000.0)), + static_cast(std::llround(mouthPortalY*1000000.0)), + static_cast(std::llround((startZ-RampRadiusMetres-1.5) + *1000000.0))}; + mouthLanding.placementRadiusMicrometres=0; + mouthLanding.halfExtentsMicrometres={3800000,2800000,1500000}; + mouthLanding.smoothWidthMicrometres=180000; + mouthLanding.irregularityAmplitudeMicrometres=0; + mouthLanding.irregularityWavelengthMicrometres=2000000; + std::printf("[LandmarkMouthPortal] center_m=(%.3f,%.3f,%.3f) normal=(%.3f,%.3f) depth_m=%.2f half_width_m=%.2f landing_top_m=%.3f\n", + mouthPortalX,mouthPortalY,startZ,mouthNormalX,mouthNormalY, + MouthPortalDepth,MouthPortalHalfWidth,surfaceHeight); + + const auto atDistance=[&](double distance) + { + distance=std::clamp(distance,0.0,totalLength); + const auto upper=std::lower_bound(arcLength.begin(),arcLength.end(),distance); + const std::size_t hi=std::min(densePath.size()-1, + static_cast(upper-arcLength.begin())); + const std::size_t lo=hi?hi-1:0; + const double span=arcLength[hi]-arcLength[lo]; + const double t=span>0.0?(distance-arcLength[lo])/span:0.0; + return FPathPoint{densePath[lo].x+(densePath[hi].x-densePath[lo].x)*t, + densePath[lo].y+(densePath[hi].y-densePath[lo].y)*t}; + }; + const auto centerlineHeight=[&](double distance) + { + const double beforeFirstTurn=std::clamp(distance-EntryLandingLength,0.0, + firstTurnLandingStart-EntryLandingLength); + const double afterFirstTurn=distance>firstTurnLandingEnd + ?std::clamp(distance-firstTurnLandingEnd,0.0, + totalLength-firstTurnLandingEnd):0.0; + return startZ+descent*std::clamp((beforeFirstTurn+afterFirstTurn) + /slopedLength,0.0,1.0); + }; + const double pointSpacing=0.6; + const std::size_t rampCount=static_cast(std::ceil(totalLength/pointSpacing)); + std::vector rampCarves; + std::vector rampSupports; + rampCarves.reserve(rampCount+1); + // Footfall supports are denser and narrower than the tunnel stamps. This + // keeps their overlapping flat caps from forming broad downhill shelves. + const double supportSpacing=0.3; + const std::size_t supportCount=static_cast(std::ceil( + totalLength/supportSpacing)); + rampSupports.reserve(supportCount+1); + for(std::size_t i=0;i<=rampCount;++i) + { + const double distance=std::min(totalLength,static_cast(i)*pointSpacing); + const FPathPoint point=atDistance(distance); + ResolvedLayoutStampRequestV1 ramp; + const std::size_t number=i; + ramp.stableId=std::string("landmark/sw-arrival-chamber-ramp-")+ + (number<10?"00":number<100?"0":"")+std::to_string(number); + ramp.strateIndex=surface->strateIndex; + ramp.kind=ResolvedSdfStampKindV1::carveEllipsoid; + const double centerZ=centerlineHeight(distance); + ramp.anchorPositionMicrometres={ + static_cast(std::llround(point.x*1000000.0)), + static_cast(std::llround(point.y*1000000.0)), + static_cast(std::llround(centerZ*1000000.0))}; + ramp.placementRadiusMicrometres=0; + ramp.halfExtentsMicrometres={2600000,2600000,2000000}; + ramp.smoothWidthMicrometres=650000; + // Keep the footfall surface smooth enough for the capsule grade limit; + // the chamber and entrance carry the larger natural wall variation. + ramp.irregularityAmplitudeMicrometres=250000; + ramp.irregularityWavelengthMicrometres=2400000; + rampCarves.push_back(std::move(ramp)); + } + for(std::size_t i=0;i<=supportCount;++i) + { + const double distance=std::min(totalLength,static_cast(i)*supportSpacing); + const FPathPoint point=atDistance(distance); + const double floorZ=centerlineHeight(distance)-RampRadiusMetres; + ResolvedLayoutStampRequestV1 support; + support.stableId=std::string("landmark/sw-arrival-ramp-support-")+ + (i<10?"00":i<100?"0":"")+std::to_string(i); + support.strateIndex=surface->strateIndex; + support.kind=ResolvedSdfStampKindV1::fillPillar; + support.anchorPositionMicrometres={ + static_cast(std::llround(point.x*1000000.0)), + static_cast(std::llround(point.y*1000000.0)), + static_cast(std::llround((floorZ-1.5)*1000000.0))}; + support.placementRadiusMicrometres=0; + // The first support widens into a buried entry landing under the open + // mouth, so the approach surface stays supported at its carved rim. + support.halfExtentsMicrometres=i==0 + ?std::array{3500000,3000000,1500000} + :std::array{550000,550000,1500000}; + support.smoothWidthMicrometres=180000; + support.irregularityAmplitudeMicrometres=0; + support.irregularityWavelengthMicrometres=2200000; + rampSupports.push_back(std::move(support)); + } + requests.push_back(std::move(mouthStamp)); + requests.push_back(std::move(mouthPortal)); + requests.insert(requests.end(),std::make_move_iterator(rampCarves.begin()), + std::make_move_iterator(rampCarves.end())); + requests.push_back(std::move(chamber)); + requests.insert(requests.end(),std::make_move_iterator(rampSupports.begin()), + std::make_move_iterator(rampSupports.end())); + requests.push_back(std::move(mouthLanding)); + requests.push_back(std::move(chamberFloor)); + requests.push_back(std::move(dais)); (void)seed; return true; } @@ -247,13 +571,14 @@ namespace " --mesh-export=FILE (write the exact generated tile meshes for offline rendering)\n" " --profile-column-overlap --far-horizon-lod8-step=N --force-generate\n" " --seed=N --recipe=surface-world|floating-islands\n" - " --landmark-chamber-demo (opt-in version-1 SDF chamber and entry arch)\n" + " --landmark-chamber-demo (opt-in natural SW landmark chamber and ramp)\n" " --resolved-layout-output=FILE (canonical plan-time layout snapshot)\n" " --resolved-layout-only (exit after plan and snapshot validation)\n" " --audit-resolved-layout-boundaries (query Core at each recorded endpoint)\n" " --audit-strate-transitions (measure interface crossing, band thickness and holes)\n" " --transition-mode=hard|gradient|interleaved --transition-width-chunks=N (fixture override)\n" " --audit-resolved-layout-passages (capsule, support, route-binding and blocked-control audit)\n" + " --audit-landmark-reachability (capsule, support, grade and buried-L43 control)\n" " --audit-surface-clearance (sample biome terrain/caps against the resolved ceiling)\n" " --auto-surface-camera (place the 27-tile cube on this seed's surface)\n" " --mesh-coverage (report non-empty tiles and indexed triangles)\n" @@ -275,6 +600,7 @@ namespace else if(arg=="--resolved-layout-only")options.ResolvedLayoutOnly=true; else if(arg=="--audit-resolved-layout-boundaries")options.AuditResolvedLayoutBoundaries=true; else if(arg=="--audit-resolved-layout-passages")options.AuditResolvedLayoutPassages=true; + else if(arg=="--audit-landmark-reachability")options.AuditLandmarkReachability=true; else if(arg=="--audit-surface-clearance")options.AuditSurfaceClearance=true; else if(arg=="--audit-strate-transitions")options.AuditStrateTransitions=true; else if(arg.starts_with("--transition-mode=")) @@ -494,8 +820,8 @@ int main(int argc,char** argv) if(options.LandmarkChamberDemo) { std::vector requests; - if(!MakeLandmarkChamberDemoRequests(resolvedLayout,seed,requests,error) - ||!VoxelForgeCore::ResolveResolvedLayoutStampsV1( + if(!MakeLandmarkChamberDemoRequests(resolvedLayout,worldAssembly,seed,requests,error) + ||!VoxelForgeCore::ResolveResolvedLayoutStampsV2( resolvedLayout,seed,requests,error)) {std::fprintf(stderr,"Landmark chamber stamp resolution failed: %s\n",error.c_str());return 2;} const auto audit=VoxelForgeCore::AuditResolvedLayoutStampPlacementV1(resolvedLayout); @@ -798,5 +1124,5 @@ int main(int argc,char** argv) options.DiagnosticSlowShapeCompileMs,options.AuditBasePageEquivalence, options.AuditRouteParity,options.AuditResolvedLayoutBoundaries, options.AuditResolvedLayoutPassages,options.AuditStrateTransitions, - &resolvedLayout,options.StreamHashTiles); + &resolvedLayout,options.StreamHashTiles,options.AuditLandmarkReachability); } diff --git a/Standalone/Source/StreamBenchmarkPipeline.h b/Standalone/Source/StreamBenchmarkPipeline.h index ffa296d..a91e81e 100644 --- a/Standalone/Source/StreamBenchmarkPipeline.h +++ b/Standalone/Source/StreamBenchmarkPipeline.h @@ -17,6 +17,8 @@ #include #include #include +#include +#include #include #include #include @@ -122,6 +124,363 @@ namespace StandaloneStreamBenchmark return Result; } + struct FLandmarkReachabilityResult + { + std::uint64_t pathSamples=0,capsuleSamples=0,blockedCapsuleSamples=0; + std::uint64_t supportSamples=0,unsupportedSamples=0,gradeFailures=0; + double maximumGradeDegrees=0.0,maximumSupportDepthMetres=0.0; + double minimumClearanceMetres=std::numeric_limits::infinity(); + double latestPointMinimumClearanceMetres=std::numeric_limits::infinity(); + std::array latestPointMinimumClearancePosition{}; + bool passed=false; + }; + + inline FLandmarkReachabilityResult AuditLandmarkWalkPath( + const VoxelForgeCore::World& shape, + const VoxelForgeCore::WorldAssemblyManifest* assembly, + const VoxelForgeCore::ResolvedLayoutSnapshotV3& layout, + std::uint32_t coreVoxelSizeMicrometres,std::string_view label) + { + FLandmarkReachabilityResult result; + const auto surface=std::find_if(layout.strates.begin(),layout.strates.end(), + [](const auto& value){return value.generatorKind=="SurfaceWorld";}); + if(surface==layout.strates.end())return result; + const auto passage=std::find_if(layout.passages.begin(),layout.passages.end(), + [&](const auto& value){return value.lowerStrateIndex==surface->strateIndex;}); + if(passage==layout.passages.end()||assembly==nullptr)return result; + const auto surfacePlan=std::find_if(assembly->plan.strates.begin(),assembly->plan.strates.end(), + [&](const auto& value){return value.strateIndex==surface->strateIndex;}); + if(surfacePlan==assembly->plan.strates.end())return result; + const VoxelForgeCore::Heightfield2D surfaceField(assembly->recipe,*surfacePlan); + if(!surfaceField.isValid())return result; + std::vector ramp; + for(const auto& stamp:layout.stamps) + if(stamp.stableId.starts_with("landmark/sw-arrival-chamber-ramp-")) + ramp.push_back(&stamp); + std::sort(ramp.begin(),ramp.end(),[](const auto* a,const auto* b) + {return a->stableIdstableId;}); + if(ramp.size()<2)return result; + + const double voxelMetres=static_cast(std::max(1, + coreVoxelSizeMicrometres))/1000000.0; + const double metresPerSubvoxel=voxelMetres + /VoxelForgeCore::WorldAssemblySubvoxelsPerVoxel; + struct FPathPoint { double x=0.0,y=0.0,z=0.0;bool tunnel=false; }; + std::vector path; + const auto& arrival=passage->lowerMouthSubvoxels; + const double arrivalX=arrival[0]*metresPerSubvoxel; + const double arrivalY=arrival[1]*metresPerSubvoxel; + const double arrivalCenterZ=arrival[2]*metresPerSubvoxel+0.9; + + const auto densityMetres=[&](double x,double y,double z) + { + return static_cast(shape.densityAt({x/voxelMetres, + y/voxelMetres,z/voxelMetres}))*voxelMetres; + }; + const auto samplePoint=[&](double x,double y,double centerZ,bool tunnel) + { + constexpr double FloorStep=0.01; + double floorZ=centerZ-5.0; + bool foundFloor=false; + if(tunnel) + { + if(densityMetres(x,y,centerZ)>0.025) + for(double offset=-0.10;offset>=-10.0;offset-=FloorStep) + if(densityMetres(x,y,centerZ+offset)<0.0) + {floorZ=centerZ+offset+FloorStep;foundFloor=true;break;} + } + else + { + const auto xSubvoxels=static_cast(std::llround(x/metresPerSubvoxel)); + const auto ySubvoxels=static_cast(std::llround(y/metresPerSubvoxel)); + floorZ=surfaceField.point(xSubvoxels,ySubvoxels,0).groundHeightSubvoxels + *metresPerSubvoxel; + foundFloor=std::isfinite(floorZ); + } + ++result.pathSamples; + if(!foundFloor) + { + ++result.unsupportedSamples; + return std::pair{floorZ,false}; + } + + // Reserve a footfall margin above the sampled ground for the vertical + // capsule; it prevents the lower hemisphere from grazing adjacent floor + // samples on a gently sloped ramp. + floorZ+=0.15; + + constexpr double CapsuleRadius=0.34; + constexpr double CapsuleHeight=1.76; + constexpr double RequiredClearance=0.025; + constexpr double VerticalStep=0.18; + constexpr double HorizontalStep=0.17; + result.latestPointMinimumClearanceMetres=std::numeric_limits::infinity(); + for(double height=0.08;height<=CapsuleHeight;height+=VerticalStep) + { + double capOffset=0.0; + if(heightCapsuleHeight-CapsuleRadius) + capOffset=height-(CapsuleHeight-CapsuleRadius); + const double radial=std::sqrt(std::max(0.0, + CapsuleRadius*CapsuleRadius-capOffset*capOffset)); + for(double oy=-radial;oy<=radial+1.0e-9;oy+=HorizontalStep) + for(double ox=-radial;ox<=radial+1.0e-9;ox+=HorizontalStep) + { + if(ox*ox+oy*oy>radial*radial+1.0e-9)continue; + const double clearance=densityMetres(x+ox,y+oy,floorZ+height); + ++result.capsuleSamples; + result.minimumClearanceMetres=std::min( + result.minimumClearanceMetres,clearance); + if(clearance,5> supportOffsets={{{0.0,0.0}, + {0.28,0.0},{-0.28,0.0},{0.0,0.28},{0.0,-0.28}}}; + std::uint32_t supported=0; + for(const auto& offset:supportOffsets) + { + ++result.supportSamples; + bool hit=false; + for(double depth=0.10;depth<=0.55;depth+=0.08) + if(densityMetres(x+offset[0],y+offset[1],floorZ-depth)<0.0) + {hit=true;result.maximumSupportDepthMetres=std::max( + result.maximumSupportDepthMetres,depth);break;} + if(hit)++supported; + } + const bool supportOk=supported>=3; + if(!supportOk)++result.unsupportedSamples; + return std::pair{floorZ,supportOk}; + }; + + // Find a walkable surface route around the passage's support rock. The nearby grid is + // evaluated against the same composed density field as the ramp and both L43/L45 runs. + constexpr int GridRadius=52; + constexpr int GridWidth=GridRadius*2+1; + constexpr double GridStep=0.50; + constexpr double MaximumGradeRadians=15.0*3.14159265358979323846/180.0; + struct FSurfaceNode + { + bool evaluated=false,walkable=false,closed=false; + double floorZ=0.0,cost=std::numeric_limits::infinity(); + int parent=-1; + }; + const int goalX=GridRadius+static_cast(std::llround( + (ramp.front()->positionMicrometres[0]/1000000.0-arrivalX)/GridStep)); + const int goalY=GridRadius+static_cast(std::llround( + (ramp.front()->positionMicrometres[1]/1000000.0-arrivalY)/GridStep)); + const auto nodeIndex=[](int x,int y){return y*GridWidth+x;}; + std::vector surfaceNodes(static_cast(GridWidth*GridWidth)); + std::uint64_t exploredNodes=0; + const auto evaluateNode=[&](int ix,int iy)->FSurfaceNode* + { + if(ix<0||iy<0||ix>=GridWidth||iy>=GridWidth)return nullptr; + auto& node=surfaceNodes[static_cast(nodeIndex(ix,iy))]; + if(node.evaluated)return &node; + node.evaluated=true;++exploredNodes; + const double x=arrivalX+(ix-GridRadius)*GridStep; + const double y=arrivalY+(iy-GridRadius)*GridStep; + const auto blockedBefore=result.blockedCapsuleSamples; + const auto unsupportedBefore=result.unsupportedSamples; + const auto pathBefore=result.pathSamples; + const double scanCenter=arrivalCenterZ; + const auto [floorZ,supported]=samplePoint(x,y,scanCenter,false); + node.floorZ=floorZ; + node.walkable=supported&&result.pathSamples>pathBefore + &&result.blockedCapsuleSamples==blockedBefore + &&result.unsupportedSamples==unsupportedBefore; + return &node; + }; + struct FOpenNode { double score=0.0;int index=0; }; + const auto farther=[](const FOpenNode& a,const FOpenNode& b) + {return a.score>b.score;}; + std::priority_queue,decltype(farther)> open(farther); + const int goalIndex=goalX>=0&&goalY>=0&&goalX=0) + { + constexpr double GroundStartRadius=18.0; + const int sourceRadius=static_cast(std::ceil(GroundStartRadius/GridStep)); + for(int iy=GridRadius-sourceRadius;iy<=GridRadius+sourceRadius;++iy) + for(int ix=GridRadius-sourceRadius;ix<=GridRadius+sourceRadius;++ix) + { + const double dx=(ix-GridRadius)*GridStep,dy=(iy-GridRadius)*GridStep; + const double distance=std::hypot(dx,dy); + if(distance>GroundStartRadius)continue; + auto* start=evaluateNode(ix,iy); + if(!start||!start->walkable)continue; + start->cost=distance;start->parent=-1; + open.push({distance+GridStep*std::hypot(goalX-ix,goalY-iy), + nodeIndex(ix,iy)}); + } + constexpr std::array,8> neighbours={{{1,0},{-1,0},{0,1},{0,-1}, + {1,1},{1,-1},{-1,1},{-1,-1}}}; + while(!open.empty()) + { + const int currentIndex=open.top().index;open.pop(); + auto& current=surfaceNodes[static_cast(currentIndex)]; + if(current.closed)continue; + current.closed=true; + if(currentIndex==goalIndex)break; + const int currentX=currentIndex%GridWidth,currentY=currentIndex/GridWidth; + for(const auto& direction:neighbours) + { + const int nextX=currentX+direction[0],nextY=currentY+direction[1]; + auto* next=evaluateNode(nextX,nextY); + if(!next||!next->walkable||next->closed)continue; + const double run=GridStep*std::hypot(direction[0],direction[1]); + const double rise=std::abs(next->floorZ-current.floorZ); + if(std::atan2(rise,run)>MaximumGradeRadians)continue; + if(direction[0]!=0&&direction[1]!=0) + { + const auto* sideA=evaluateNode(currentX+direction[0],currentY); + const auto* sideB=evaluateNode(currentX,currentY+direction[1]); + if(!sideA||!sideA->walkable||!sideB||!sideB->walkable)continue; + } + const double cost=current.cost+run+rise*0.25; + if(cost>=next->cost)continue; + next->cost=cost;next->parent=currentIndex; + const double heuristic=GridStep*std::hypot(goalX-nextX,goalY-nextY); + open.push({cost+heuristic,nodeIndex(nextX,nextY)}); + } + } + } + std::vector surfaceRoute; + if(goalIndex>=0&&surfaceNodes[static_cast(goalIndex)].closed) + { + for(int current=goalIndex;current>=0;current=surfaceNodes[static_cast(current)].parent) + surfaceRoute.push_back(current); + std::reverse(surfaceRoute.begin(),surfaceRoute.end()); + } + const bool surfaceGoalWalkable=goalIndex>=0 + &&evaluateNode(goalX,goalY)->walkable; + if(surfaceRoute.size()<2)surfaceRoute.clear(); + const auto surfaceRouteSamples=surfaceRoute.size(); + double surfaceStartDistance=std::numeric_limits::infinity(); + if(!surfaceRoute.empty()) + { + path.reserve(surfaceRoute.size()+ramp.size()); + const int startX=surfaceRoute.front()%GridWidth; + const int startY=surfaceRoute.front()/GridWidth; + surfaceStartDistance=GridStep*std::hypot(startX-GridRadius,startY-GridRadius); + for(const int index:surfaceRoute) + { + const int ix=index%GridWidth,iy=index/GridWidth; + const auto& node=surfaceNodes[static_cast(index)]; + path.push_back({arrivalX+(ix-GridRadius)*GridStep, + arrivalY+(iy-GridRadius)*GridStep,node.floorZ+0.9,false}); + } + for(const auto* stamp:ramp) + path.push_back({stamp->positionMicrometres[0]/1000000.0, + stamp->positionMicrometres[1]/1000000.0, + stamp->positionMicrometres[2]/1000000.0,true}); + } + std::printf("[LandmarkSurfaceRoute] reachable=%s goal_walkable=%s grid_step_m=%.2f start_offset_m=%.2f explored=%llu surface_points=%zu grade_limit_deg=15.000\n", + surfaceRoute.empty()?"false":"true",surfaceGoalWalkable?"true":"false",GridStep,surfaceStartDistance, + static_cast(exploredNodes),surfaceRouteSamples); + result={}; + if(path.size()<2)return result; + + bool allSupport=true,allGrade=true; + bool havePrior=false;double priorX=0.0,priorY=0.0,priorFloor=0.0; + std::size_t diagnosticCount=0; + for(std::size_t segment=1;segment(1, + static_cast(std::ceil(horizontal/0.8))); + for(std::size_t step=segment==1?0:1;step<=steps;++step) + { + const double t=static_cast(step)/steps; + const double x=from.x+(to.x-from.x)*t; + const double y=from.y+(to.y-from.y)*t; + const double centerZ=from.z+(to.z-from.z)*t; + const auto blockedBefore=result.blockedCapsuleSamples; + const auto capsuleBefore=result.capsuleSamples; + const auto supportBefore=result.supportSamples; + const bool tunnel=from.tunnel&&to.tunnel; + const auto [floorZ,supportOk]=samplePoint(x,y,centerZ,tunnel); + allSupport&=supportOk; + double grade=0.0; + if(havePrior) + { + const double run=std::hypot(x-priorX,y-priorY); + grade=run>1.0e-6 + ?std::atan2(std::abs(floorZ-priorFloor),run)*180.0/3.14159265358979323846 + :std::numeric_limits::infinity(); + result.maximumGradeDegrees=std::max(result.maximumGradeDegrees,grade); + if(grade>15.0) {++result.gradeFailures;allGrade=false;} + } + if(diagnosticCount<16&&(result.blockedCapsuleSamples>blockedBefore + ||!supportOk||grade>15.0)) + { + std::printf("[LandmarkWalkPoint] field=%.*s mode=%s x=%.3f y=%.3f center_z=%.3f floor_z=%.3f previous_x=%.3f previous_y=%.3f previous_floor_z=%.3f horizontal_step_m=%.3f blocked=%llu/%llu support_probes=%llu grade_deg=%.3f density_center_m=%.3f capsule_min_m=%.3f capsule_min_at_m=(%.3f,%.3f,%.3f)\n", + static_cast(label.size()),label.data(),tunnel?"ramp":"surface",x,y,centerZ,floorZ, + priorX,priorY,priorFloor,std::hypot(x-priorX,y-priorY), + static_cast(result.blockedCapsuleSamples-blockedBefore), + static_cast(result.capsuleSamples-capsuleBefore), + static_cast(result.supportSamples-supportBefore), + grade,densityMetres(x,y,centerZ),result.latestPointMinimumClearanceMetres, + result.latestPointMinimumClearancePosition[0], + result.latestPointMinimumClearancePosition[1], + result.latestPointMinimumClearancePosition[2]); + ++diagnosticCount; + } + havePrior=true;priorX=x;priorY=y;priorFloor=floorZ; + } + } + result.passed=result.pathSamples>1&&result.capsuleSamples>0 + &&result.blockedCapsuleSamples==0&&allSupport&&allGrade + &&result.unsupportedSamples==0&&result.gradeFailures==0; + return result; + } + + inline bool MakeL43BuriedLandmarkControl( + const VoxelForgeCore::ResolvedLayoutSnapshotV3& source, + VoxelForgeCore::ResolvedLayoutSnapshotV3& control,std::string& error) + { + using namespace VoxelForgeCore; + control=source;control.stamps.clear();control.stampVocabularyVersion=1; + const auto add=[&](std::string id,ResolvedSdfStampKindV1 kind, + std::array position, + std::array half,std::int64_t smooth, + std::int64_t rough,std::int64_t wavelength,std::uint64_t seed, + std::uint8_t yaw) + { + ResolvedLayoutStampV1 stamp;stamp.stableId=std::move(id); + stamp.strateIndex=1;stamp.kind=kind;stamp.positionMicrometres=position; + stamp.halfExtentsMicrometres=half;stamp.smoothWidthMicrometres=smooth; + stamp.irregularityAmplitudeMicrometres=rough; + stamp.irregularityWavelengthMicrometres=wavelength; + stamp.irregularitySeed=seed;stamp.yawQuarterTurns=yaw; + const std::int64_t pad=smooth+rough; + const std::array bounds={ + half[yaw%2?1:0]+pad,half[yaw%2?0:1]+pad,half[2]+pad}; + for(std::size_t axis=0;axis<3;++axis) + {stamp.boundsMinimumMicrometres[axis]=position[axis]-bounds[axis]; + stamp.boundsMaximumMicrometres[axis]=position[axis]+bounds[axis];} + control.stamps.push_back(std::move(stamp)); + }; + add("landmark/sw-arrival-chamber-v1",ResolvedSdfStampKindV1::carveEllipsoid, + {-8917798,31949858,-513083425},{8500000,7500000,6000000}, + 800000,700000,4800000,4704841454711558ull,0); + add("landmark/sw-arrival-chamber-entrance-v1",ResolvedSdfStampKindV1::carveArch, + {-12289139,37026886,-513310578},{2600000,4200000,3200000}, + 350000,250000,2600000,2371181934872559ull,0); + add("landmark/sw-arrival-chamber-dais-v1",ResolvedSdfStampKindV1::fillDais, + {-7489021,30688194,-515838454},{3200000,2800000,900000}, + 300000,180000,2200000,7240637434535735ull,0); + if(!control.finalize(error))return false; + std::vector issues; + return control.validate(ResolvedLayoutValidationModeV3::strict,issues,error); + } + inline bool SameTileOutput(const VoxelForgeCore::TileMesh& A, const VoxelForgeCore::TileMesh& B) { @@ -424,7 +783,7 @@ namespace StandaloneStreamBenchmark bool bAuditResolvedLayoutPassages=false, bool bAuditStrateTransitions=false, const VoxelForgeCore::ResolvedLayoutSnapshotV3* ResolvedLayout=nullptr, - bool bPrintTileHashes=false) + bool bPrintTileHashes=false,bool bAuditLandmarkReachability=false) { using Clock=std::chrono::steady_clock; FStandaloneOwnerWorld& World=*OwnerWorld; @@ -609,6 +968,67 @@ namespace StandaloneStreamBenchmark Streamer.Stop(); std::fprintf(stderr,"[StreamPipeline] full shape build failed: %s\n",BuildError.c_str());return 2; } + if(bAuditLandmarkReachability) + { + Streamer.Stop(); + if(ResolvedLayout==nullptr||!CoreSnapshot.resolvedLayout() + ||ResolvedLayout->stamps.empty()) + {std::fprintf(stderr,"[LandmarkReachabilityAudit] missing demo layout and stamps\n");return 2;} + const auto candidate=AuditLandmarkWalkPath(Shape,Assembly,*ResolvedLayout, + World.CoreVoxelSizeMicrons,"L45"); + const auto daisStamp=std::find_if(ResolvedLayout->stamps.begin(), + ResolvedLayout->stamps.end(),[](const auto& stamp) + {return stamp.stableId=="landmark/sw-arrival-chamber-v1-dais";}); + if(daisStamp!=ResolvedLayout->stamps.end()) + { + const double voxelMetres=std::max(1, + World.CoreVoxelSizeMicrons)/1000000.0; + for(const double offset:{-0.5,0.0,0.5,0.9,1.2}) + { + const double x=daisStamp->positionMicrometres[0]/1000000.0; + const double y=daisStamp->positionMicrometres[1]/1000000.0; + const double z=daisStamp->positionMicrometres[2]/1000000.0+offset; + const double density=Shape.densityAt({x/voxelMetres,y/voxelMetres, + z/voxelMetres})*voxelMetres; + std::printf("[LandmarkDaisProfile] offset_m=%.2f sample_z_m=%.3f density_m=%.4f\n", + offset,z,density); + } + } + VoxelForgeCore::ResolvedLayoutSnapshotV3 oldLayout; + std::string oldError; + if(!MakeL43BuriedLandmarkControl(*ResolvedLayout,oldLayout,oldError)) + {std::fprintf(stderr,"[LandmarkReachabilityAudit] L43 control layout failed: %s\n", + oldError.c_str());return 2;} + auto oldSnapshot=CoreSnapshot.withResolvedLayout(oldLayout); + if(!oldSnapshot) + {std::fprintf(stderr,"[LandmarkReachabilityAudit] could not construct L43 control snapshot\n");return 2;} + VoxelForgeCore::World oldShape(oldSnapshot); + std::string oldBuildError; + if(!oldShape.compile(ShapeRequest,Scheduler,oldBuildError)) + {std::fprintf(stderr,"[LandmarkReachabilityAudit] L43 control field build failed: %s\n", + oldBuildError.c_str());return 2;} + const auto buried=AuditLandmarkWalkPath(oldShape,Assembly,*ResolvedLayout, + World.CoreVoxelSizeMicrons,"L43"); + std::printf("[LandmarkWalkability] layout=L45 path_samples=%llu capsule_samples=%llu blocked=%llu support_samples=%llu unsupported=%llu grade_failures=%llu max_grade_deg=%.3f limit_deg=15.000 min_clearance_m=%.3f max_support_depth_m=%.3f status=%s\n", + static_cast(candidate.pathSamples), + static_cast(candidate.capsuleSamples), + static_cast(candidate.blockedCapsuleSamples), + static_cast(candidate.supportSamples), + static_cast(candidate.unsupportedSamples), + static_cast(candidate.gradeFailures), + candidate.maximumGradeDegrees,candidate.minimumClearanceMetres, + candidate.maximumSupportDepthMetres,candidate.passed?"PASS":"FAIL"); + std::printf("[LandmarkReachabilityControl] layout=L43-buried path_samples=%llu blocked=%llu unsupported=%llu grade_failures=%llu result=%s expected=FAIL status=%s\n", + static_cast(buried.pathSamples), + static_cast(buried.blockedCapsuleSamples), + static_cast(buried.unsupportedSamples), + static_cast(buried.gradeFailures), + buried.passed?"PASS":"FAIL",buried.passed?"FAIL":"PASS"); + const bool passed=candidate.passed&&!buried.passed; + std::printf("[LandmarkReachabilityAudit] positive=PASS control=%s status=%s\n", + buried.passed?"FAILED":"EXPECTED_FAIL",passed?"PASS":"FAIL"); + return passed?0:13; + } if(bAuditStrateTransitions) { if(ResolvedLayout==nullptr||!CoreSnapshot.resolvedLayout()) diff --git a/Standalone/Tools/verify/verify.py b/Standalone/Tools/verify/verify.py index 2b13e27..a7ff4a5 100644 --- a/Standalone/Tools/verify/verify.py +++ b/Standalone/Tools/verify/verify.py @@ -152,7 +152,9 @@ def run_owner_passages(runner: VerificationRunner, binaries: tuple[Path, ...]) - compiler = compiler_name(binary) for recipe, style in (("floating-islands", 2), ("surface-world", 1)): name = f"owner-{recipe}-style{style}-{compiler}" + flags = ["--landmark-chamber-demo"] if recipe == "surface-world" else [] row, output = run_passage(runner, binary, name, OWNER, recipe, style, + flags=flags, passage_style=2, expected_strate_styles=expected_strate_styles) result[f"{compiler}:{recipe}"] = (row, output) actual_styles = row.get("resolved_strate_styles", {}) @@ -171,6 +173,62 @@ def run_owner_passages(runner: VerificationRunner, binaries: tuple[Path, ...]) - return result +def run_landmark_reachability(runner: VerificationRunner, + binaries: tuple[Path, ...]) -> None: + for binary in binaries: + compiler = compiler_name(binary) + name = f"landmark-reachability-{compiler}" + row, output = runner.run_cpp(name, binary, OWNER, "surface-world", + ["--landmark-chamber-demo", "--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"{name}.json") + row["requested_style"] = 1 + row["expected_passage_style"] = 2 + passage_name = f"landmark-demo-passages-{compiler}" + _, passage_output = runner.run_cpp(passage_name, binary, OWNER, "surface-world", + ["--landmark-chamber-demo", "--audit-resolved-layout-passages", + "--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"{passage_name}.json") + runner.require(f"{passage_name}:demo-enabled", + all_match(passage_output, r"^\[LandmarkStampDemo\] enabled=true .*status=PASS$"), + "landmark demo flag resolved while running passage audits") + validate_passage(runner, passage_name, passage_output) + + interface_name = f"landmark-demo-interfaces-{compiler}" + _, interface_output = runner.run_cpp(interface_name, binary, OWNER, "surface-world", + ["--landmark-chamber-demo", "--audit-strate-transitions", + "--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"{interface_name}.json") + runner.require(f"{interface_name}:demo-enabled", + all_match(interface_output, r"^\[LandmarkStampDemo\] enabled=true .*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 " + r"air_samples=0 .*status=PASS$"), + "demo-on stratum interfaces contain no holes or air columns") + runner.require(f"{interface_name}:negative-controls", + 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") + runner.require(f"{name}:buried-l43-control", + all_match(output, r"^\[LandmarkReachabilityControl\] layout=L43-buried .*" + r"result=FAIL expected=FAIL status=PASS$"), + "the exact buried L43 chamber fails the same route audit") + runner.require(f"{name}:surface-to-floor-route", + all_match(output, r"^\[LandmarkSurfaceRoute\] reachable=true .*" + r"surface_points=[1-9][0-9]* grade_limit_deg=15\.000$"), + "walkable surface path from ground near the arrival mouth joins the ramp") + runner.require(f"{name}:reachability-control-summary", + all_match(output, r"^\[LandmarkReachabilityAudit\] positive=PASS " + r"control=EXPECTED_FAIL status=PASS$"), + "candidate passes and buried control fails") + + def expected_control_row(runner: VerificationRunner, name: str) -> None: if runner.runs: row = runner.runs[-1] @@ -361,6 +419,8 @@ def run_random_camera_sweep(runner: VerificationRunner, binaries: tuple[Path, .. f"--clip-radius={clip_radius}", f"--max-clip-level={max_clip_level}", f"--max-level={max_level}", "--render-distance-chunks=0"] + if recipe == "surface-world": + flags.append("--landmark-chamber-demo") row, output = runner.run_cpp(name, binary, OWNER, recipe, flags, expected_style=2, expected_strate_styles={"0": 2, "1": 1}, @@ -460,8 +520,11 @@ def run_transitions_and_invariants(runner: VerificationRunner, for recipe, style in (("floating-islands", 2), ("surface-world", 1)): for mode in ("hard", "gradient", "interleaved"): name = f"transition-{recipe}-{mode}-{compiler}" + flags = [f"--transition-mode={mode}", "--audit-strate-transitions"] + if recipe == "surface-world": + flags.append("--landmark-chamber-demo") row, output = runner.run_cpp(name, binary, OWNER, recipe, - [f"--transition-mode={mode}", "--audit-strate-transitions"], + flags, expected_style=2, expected_strate_styles={"0": 2, "1": 1}, layout_path=OUT / "layouts" / f"{name}.json") row["requested_style"] = style @@ -472,8 +535,11 @@ def run_transitions_and_invariants(runner: VerificationRunner, runner.require(f"{name}:gate-{index + 1}", all_match(output, pattern), pattern) name = f"invariant-route-proof-{recipe}-{compiler}" + flags = ["--audit-uniform-block-proofs", "--audit-route-parity"] + if recipe == "surface-world": + flags.append("--landmark-chamber-demo") row, output = runner.run_cpp(name, binary, OWNER, recipe, - ["--audit-uniform-block-proofs", "--audit-route-parity"], + flags, expected_style=2, expected_strate_styles={"0": 2, "1": 1}, layout_path=OUT / "layouts" / f"{name}.json") row["requested_style"] = style @@ -545,6 +611,18 @@ 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_layout = OUT / "layouts" / "landmark-reachability-clang.json" + runner.run_stage("capture-landmark-l45", landmark_script, + ["--layout", str(landmark_layout), "--artifact-dir", str(OUT), + "--capture-dir", str(ROOT / "Standalone/Research/WorldAssemblerM3/Linux45/captures"), + "--data", str(OWNER)], + binary=CLANG, data=OWNER, recipe="surface-world", style=1, + layout_path=landmark_layout, env=env_for(capture=True), + script_inputs=[landmark_script, VERIFY_DIR / "capture_quality.py", + LINUX37 / "AuditMouthShapeL37.py", + ROOT / "Standalone/Research/WorldAssemblerM3/Linux32/AuditRingTerraceL32.py"]) + def verify_determinism_cell(runner: VerificationRunner, binary: Path, kind: str, recipe: str, style: int, workers: int, @@ -718,6 +796,7 @@ def run_cost_pairs(runner: VerificationRunner) -> None: def run_medium_suite(runner: VerificationRunner, *, both_compilers: bool = False) -> None: binaries = (CLANG, GCC) if both_compilers else (CLANG,) run_owner_passages(runner, binaries) + run_landmark_reachability(runner, binaries) run_regression_controls(runner) style_override_matrix(runner, CLANG) if both_compilers: @@ -732,6 +811,7 @@ def run_medium_suite(runner: VerificationRunner, *, both_compilers: bool = False def run_gcc_supplement(runner: VerificationRunner) -> None: """Add GCC evidence to a stamped, already-passed Clang medium tier.""" run_owner_passages(runner, (GCC,)) + run_landmark_reachability(runner, (GCC,)) style_override_matrix(runner, GCC) run_transitions_and_invariants(runner, (GCC,)) @@ -756,6 +836,7 @@ def main() -> int: runner.probe_binary(binary) if ARGS.tier == "fast": owners = run_owner_passages(runner, (CLANG,)) + run_landmark_reachability(runner, (CLANG,)) run_regression_controls(runner) run_hash_pairs(runner, owners) run_random_camera_sweep(runner, (CLANG,), 3, ((3, 0, 0),))