wip(l59): open helix shaft (ledge open to the core) -- PARKED: jagged inner ramp edge, audit ROI missed it
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
6c6cc37e1d
commit
54ba1b49ab
17 files changed
+1167
-172
No files matched your search
@@ -27,7 +27,7 @@ LINUX47 = ROOT / "Standalone/Research/WorldAssemblerM3/Linux47"
|
||||
LINUX53 = ROOT / "Standalone/Research/WorldAssemblerM3/Linux53"
|
||||
LINUX54 = ROOT / "Standalone/Research/WorldAssemblerM3/Linux54"
|
||||
LINUX56 = ROOT / "Standalone/Research/WorldAssemblerM3/Linux56"
|
||||
LINUX58 = ROOT / "Standalone/Research/WorldAssemblerM3/Linux58"
|
||||
LINUX59 = ROOT / "Standalone/Research/WorldAssemblerM3/Linux59"
|
||||
OWNER = ROOT / "Standalone/data/owner_world.json"
|
||||
OUT_DEFAULT = ROOT / "Saved/Linux/l42"
|
||||
|
||||
@@ -672,9 +672,9 @@ def run_native_caves_field_audit(runner: VerificationRunner, binary: Path) -> tu
|
||||
|
||||
|
||||
def build_lattice_fixture(runner: VerificationRunner, binary: Path) -> Path:
|
||||
fixture = OUT / "fixtures" / "lattice-l58.json"
|
||||
builder = LINUX58 / "BuildLatticeFixtureL58.py"
|
||||
runner.run_stage("build-native-lattice-fixture-l58", builder,
|
||||
fixture = OUT / "fixtures" / "lattice-l59.json"
|
||||
builder = LINUX59 / "BuildLatticeFixtureL59.py"
|
||||
runner.run_stage("build-native-lattice-fixture-l59", builder,
|
||||
["--owner", str(OWNER), "--out", str(fixture)], binary=binary,
|
||||
data=OWNER, recipe="lattice", style=None, env=env_for(),
|
||||
script_inputs=[builder, OWNER])
|
||||
@@ -686,19 +686,24 @@ def run_native_lattice_field_audit(runner: VerificationRunner, binary: Path) ->
|
||||
compiler = compiler_name(binary)
|
||||
layout_path = OUT / "layouts" / f"native-lattice-field-{compiler}.json"
|
||||
styles = {"0": 2, "1": 1, "2": 1}
|
||||
inputs = [LINUX58 / "BuildLatticeFixtureL58.py"]
|
||||
inputs = [LINUX59 / "BuildLatticeFixtureL59.py"]
|
||||
row, output = runner.run_cpp(f"native-lattice-field-{compiler}", binary, fixture,
|
||||
"lattice", ["--lattice-strate=1", "--audit-native-lattice",
|
||||
"--max-clip-level=0", "--render-distance-chunks=0"],
|
||||
expected_style=None, expected_strate_styles=styles, workers=12,
|
||||
max_level=0, layout_path=layout_path, script_inputs=inputs)
|
||||
plan = re.search(r"^\[LatticeSpinePlan\] .*recipe=Core\.Lattice\.PrimitiveField version=1 "
|
||||
r"strate=1 .*spine_first=true .*centerline_radius_m=6\.000 clear_width_m=3\.000 "
|
||||
r"pitch_m=5\.000 turns=4 floor_to_soffit_m=2\.600 .*inner_edge_grade_deg=([0-9.]+) "
|
||||
r"floor_blend_m=1\.900 union_envelope_m=0\.050 maze_cells=([0-9]+) dead_ends=2 .*status=PASS$",
|
||||
plan = re.search(r"^\[LatticeSpinePlan\] .*recipe=Core\.Lattice\.PrimitiveField version=2 "
|
||||
r"strate=1 .*spine_first=true .*shaft_core_id=lattice/spine/shaft-core-v2 "
|
||||
r"shaft_core_radius_m=4\.500 centerline_radius_m=6\.000 clear_width_m=3\.000 "
|
||||
r"pitch_m=5\.000 turns=4 inner_edge_margin_m=1\.500 "
|
||||
r"capsule_drop_clearance_m=1\.160 support_depth_m=1\.000 "
|
||||
r"ramp_vertical_clearance_m=4\.000 shaft_outer_envelope_m=21\.000 "
|
||||
r"maze_headroom_m=2\.600 centerline_grade_deg=[0-9.]+ "
|
||||
r"inner_edge_grade_deg=([0-9.]+) floor_blend_m=1\.900 "
|
||||
r"union_envelope_m=1\.000 maze_cells=([0-9]+) dead_ends=2 .*status=PASS$",
|
||||
output, re.M)
|
||||
runner.require(f"native-lattice-field-{compiler}:recipe-and-spine", bool(plan),
|
||||
"native opt-in version-1 lattice, actual mouths first, four-turn ramp and two branches")
|
||||
"native version-2 open well, measured inner margin, supported four-turn ramp and maze branches")
|
||||
fillet = re.search(r"^\[LatticeFilletAudit\].*measured_radius_m=([0-9.]+) .*status=PASS$",
|
||||
output, re.M)
|
||||
runner.require(f"native-lattice-field-{compiler}:measured-fillet",
|
||||
@@ -713,8 +718,9 @@ def run_native_lattice_field_audit(runner: VerificationRunner, binary: Path) ->
|
||||
f"headroom_m={reach.group(2) if reach else 'MISSING'}")
|
||||
runner.require(f"native-lattice-field-{compiler}:interval-oracle-and-shape-free",
|
||||
all_match(output, r"^\[LatticeIntervalOracle\].*misses=0 "
|
||||
r"shaft_core_air=PROVED shaft_core_wall=mixed "
|
||||
r"false_all_air=REJECTED false_all_solid=REJECTED .*isTileShapeFree=BLOCKED .*status=PASS$"),
|
||||
"BVH intervals match brute-force samples, reject both false proofs and block occupied tiles")
|
||||
"interval bounds prove the shaft core air, find the outer wall, reject false proofs and block occupied tiles")
|
||||
|
||||
orphan_name = f"native-lattice-orphan-control-{compiler}"
|
||||
orphan_layout = OUT / "layouts" / f"{orphan_name}.json"
|
||||
@@ -735,6 +741,7 @@ def run_native_lattice_field_audit(runner: VerificationRunner, binary: Path) ->
|
||||
if row.get("strate_index") == 1]
|
||||
graph_ok = (layout.get("cavern_graph_vocabulary_version") == 1
|
||||
and len(edges) >= 9 and len(rooms) >= 8
|
||||
and any(room.get("stable_id") == "lattice/spine/shaft-core-v2" for room in rooms)
|
||||
and len(lattice_rows) == 1
|
||||
and lattice_rows[0].get("generator_kind") == "Maze"
|
||||
and lattice_rows[0].get("recipe_id") == "Core.Lattice.PrimitiveField"
|
||||
@@ -759,8 +766,10 @@ def lattice_camera_positions(layout_path: Path, count: int = 4) -> list[tuple[fl
|
||||
edges = sorted(layout.get("cavern_edges", []), key=lambda edge: edge["stable_id"])
|
||||
helix = next((edge for edge in edges
|
||||
if edge["stable_id"] == "lattice/spine/01-helix-ramp-v1"), None)
|
||||
if layout.get("cavern_graph_vocabulary_version") != 1 or helix is None:
|
||||
raise VerificationFailure(f"missing resolved lattice helix in {layout_path}")
|
||||
core = next((room for room in layout.get("cavern_rooms", [])
|
||||
if room["stable_id"] == "lattice/spine/shaft-core-v2"), None)
|
||||
if layout.get("cavern_graph_vocabulary_version") != 1 or helix is None or core is None:
|
||||
raise VerificationFailure(f"missing resolved open shaft or helix in {layout_path}")
|
||||
helix_points = [[value / 1_000_000.0 for value in point]
|
||||
for point in helix.get("polyline_um", [])]
|
||||
if len(helix_points) < 4:
|
||||
@@ -773,11 +782,8 @@ def lattice_camera_positions(layout_path: Path, count: int = 4) -> list[tuple[fl
|
||||
point = helix_points[index]
|
||||
tangent = [helix_points[index + 1][axis] - helix_points[index - 1][axis]
|
||||
for axis in range(3)]
|
||||
lateral = rng.between(-0.35, 0.35)
|
||||
horizontal = max(1.0e-9, math.hypot(tangent[0], tangent[1]))
|
||||
x = point[0] - tangent[1] / horizontal * lateral
|
||||
y = point[1] + tangent[0] / horizontal * lateral
|
||||
z = point[2] + rng.between(1.35, 1.55)
|
||||
center = [value / 1_000_000.0 for value in core["center_um"]]
|
||||
x, y, z = center
|
||||
else:
|
||||
route_edges = [edge for edge in edges if edge["stable_id"].startswith(
|
||||
"lattice/spine/maze-edge-")]
|
||||
@@ -830,7 +836,7 @@ def run_lattice_determinism(runner: VerificationRunner, binary: Path,
|
||||
peer_layouts: dict[int, str] = {}
|
||||
key = f"p{camera_index:02d}"
|
||||
current[key] = {"camera_m": [round(value, 6) for value in camera[:3]],
|
||||
"inside_helix": camera_index == 0}
|
||||
"inside_shaft_core": camera_index == 0}
|
||||
for workers in (1, 8, 12):
|
||||
name = (f"lattice-camera-{compiler}-s{LATTICE_CAMERA_SWEEP_SEED:06x}-"
|
||||
f"p{camera_index:02d}-w{workers}")
|
||||
@@ -841,7 +847,7 @@ def run_lattice_determinism(runner: VerificationRunner, binary: Path,
|
||||
"--render-distance-chunks=0"], expected_style=None,
|
||||
expected_strate_styles=styles, workers=workers, max_level=0,
|
||||
layout_path=run_layout,
|
||||
script_inputs=[LINUX58 / "BuildLatticeFixtureL58.py"])
|
||||
script_inputs=[LINUX59 / "BuildLatticeFixtureL59.py"])
|
||||
tiles = parse_tile_hashes(output)
|
||||
whole = re.search(r"^\[PipelineWholeViewHash\] tiles=(\d+)", output, re.M)
|
||||
expected_rows = int(whole.group(1)) if whole else -1
|
||||
@@ -871,17 +877,34 @@ def run_lattice_determinism(runner: VerificationRunner, binary: Path,
|
||||
def run_lattice_performance(runner: VerificationRunner, binary: Path,
|
||||
fixture: Path, layout_path: Path) -> None:
|
||||
compiler = compiler_name(binary)
|
||||
camera = lattice_camera_positions(layout_path, count=1)[0]
|
||||
layout = json.loads(layout_path.read_text(encoding="utf-8"))
|
||||
helix = next(edge for edge in layout.get("cavern_edges", [])
|
||||
if edge["stable_id"] == "lattice/spine/01-helix-ramp-v1")
|
||||
helix_points = [[value / 1_000_000.0 for value in point]
|
||||
for point in helix.get("polyline_um", [])]
|
||||
index = len(helix_points) // 2
|
||||
point = helix_points[index]
|
||||
tangent = [helix_points[index + 1][axis] - helix_points[index - 1][axis]
|
||||
for axis in range(3)]
|
||||
horizontal = max(1.0e-9, math.hypot(tangent[0], tangent[1]))
|
||||
rng = _SplitMix64(LATTICE_CAMERA_SWEEP_SEED)
|
||||
lateral = rng.between(-0.35, 0.35)
|
||||
x = point[0] - tangent[1] / horizontal * lateral
|
||||
y = point[1] + tangent[0] / horizontal * lateral
|
||||
z = point[2] + rng.between(1.35, 1.55)
|
||||
yaw = math.degrees(math.atan2(tangent[0], tangent[1])) + rng.between(-14.0, 14.0)
|
||||
pitch = rng.between(-6.0, 6.0)
|
||||
camera = (x, y, z, yaw, pitch)
|
||||
x, y, z, yaw, pitch = camera
|
||||
camera_flag = f"--camera={x:.6f},{y:.6f},{z:.6f},{yaw:.3f},{pitch:.3f}"
|
||||
name = f"lattice-speed-{compiler}-w12"
|
||||
row, output = runner.run_cpp(name, binary, fixture, "lattice",
|
||||
["--lattice-strate=1", camera_flag, "--clip-radius=4", "--max-clip-level=0",
|
||||
"--max-level=0", "--render-distance-chunks=0", "--camera-step=24,0,0",
|
||||
"--region-crossing"], expected_style=None,
|
||||
"--region-crossing", "--instrument-tile-drain"], expected_style=None,
|
||||
expected_strate_styles={"0": 2, "1": 1, "2": 1}, workers=12,
|
||||
max_level=0, layout_path=OUT / "layouts" / f"{name}.json",
|
||||
script_inputs=[LINUX58 / "BuildLatticeFixtureL58.py"])
|
||||
script_inputs=[LINUX59 / "BuildLatticeFixtureL59.py"])
|
||||
stream = re.search(r"^\[StreamPipeline\] .*first_tile_ready=([0-9.]+)s "
|
||||
r".*neighborhood_ready=([0-9.]+)s .*whole_view_ready=([0-9.]+)s .*cache_hits=0",
|
||||
output, re.M)
|
||||
@@ -895,6 +918,20 @@ def run_lattice_performance(runner: VerificationRunner, binary: Path,
|
||||
f"whole_view_s={stream.group(3) if stream else 'MISSING'} "
|
||||
f"moving_p50_ms={moving.group(2) if moving else 'MISSING'} "
|
||||
f"moving_p95_ms={moving.group(3) if moving else 'MISSING'}")
|
||||
stage_rows = re.findall(r"^\[CpuTileStages\] (.*)$", output, re.M)
|
||||
def sum_stage(field: str) -> float:
|
||||
values = [float(value) for value in re.findall(
|
||||
rf"(?:^| ){re.escape(field)}=([0-9.]+)(?: |$)", "\n".join(stage_rows))]
|
||||
return sum(values)
|
||||
stage_summary = {field: sum_stage(field) for field in (
|
||||
"worker_ms", "classify_ms", "column_exclusive_ms", "mc_ms",
|
||||
"mc_grid_ms", "mc_cell_ms", "mc_gradient_ms", "mc_interpolation_ms",
|
||||
"mc_dedup_ms", "mc_skirt_ms", "mc_other_ms", "mesh_assembly_ms")}
|
||||
runner.require(f"{name}:tile-drain-instrumentation",
|
||||
bool(stage_rows) and stage_summary["worker_ms"] > 0.0,
|
||||
f"tile_stage_rows={len(stage_rows)} worker_sum_ms={stage_summary['worker_ms']:.3f} "
|
||||
f"mc_ms={stage_summary['mc_ms']:.3f} "
|
||||
f"column_ms={stage_summary['column_exclusive_ms']:.3f}")
|
||||
if stream and moving:
|
||||
row["speed_metrics"] = {
|
||||
"cold_first_tile_seconds": float(stream.group(1)),
|
||||
@@ -905,6 +942,8 @@ def run_lattice_performance(runner: VerificationRunner, binary: Path,
|
||||
"moving_p95_ms": float(moving.group(3)),
|
||||
"workers": 12, "camera_m": [round(value, 6) for value in camera[:3]],
|
||||
}
|
||||
row["tile_drain_instrumentation"] = {
|
||||
"stage_rows": len(stage_rows), "aggregate_ms": stage_summary}
|
||||
|
||||
|
||||
def cave_camera_positions(layout_path: Path, count: int = 4) -> list[tuple[float, float, float, float, float]]:
|
||||
@@ -1103,25 +1142,25 @@ def run_caves_surface_evidence(runner: VerificationRunner, fixture: Path,
|
||||
|
||||
def run_lattice_surface_evidence(runner: VerificationRunner, fixture: Path,
|
||||
layout_path: Path) -> None:
|
||||
capture_script = LINUX58 / "CaptureNativeLatticeL58.py"
|
||||
artifact_dir = LINUX58 / "captures"
|
||||
_, capture_output = runner.run_stage("capture-native-lattice-l58", capture_script,
|
||||
capture_script = LINUX59 / "CaptureNativeLatticeL59.py"
|
||||
artifact_dir = LINUX59 / "captures"
|
||||
_, capture_output = runner.run_stage("capture-native-lattice-l59", capture_script,
|
||||
["--out", str(OUT), "--fixture", str(fixture), "--layout", str(layout_path),
|
||||
"--headless", str(CLANG), "--renderer", str(RENDERER),
|
||||
"--artifact-dir", str(artifact_dir)], binary=CLANG, data=fixture,
|
||||
recipe="lattice", style=2, env=env_for(capture=True),
|
||||
script_inputs=[capture_script, LINUX54 / "CaptureNativeCavesL54.py",
|
||||
VERIFY_DIR / "capture_quality.py"])
|
||||
capture_rows = re.findall(r"^\[L58LatticeCapture\] view=([^ ]+) file=(\S+) "
|
||||
capture_rows = re.findall(r"^\[L59LatticeCapture\] view=([^ ]+) file=(\S+) "
|
||||
r"bytes=(\d+) sha256=([0-9a-f]{64}) status=PASS$", capture_output, re.M)
|
||||
expected_views = {"helix-top-down", "ramp-eye-next-turn", "maze-eye-level",
|
||||
"cutaway-overview"}
|
||||
runner.require("capture-native-lattice-l58:coverage-and-size",
|
||||
expected_views = {"shaft-top-down", "ramp-eye-across", "maze-corridor",
|
||||
"shaft-overview"}
|
||||
runner.require("capture-native-lattice-l59:coverage-and-size",
|
||||
{row[0] for row in capture_rows} == expected_views and len(capture_rows) == 4
|
||||
and all(int(row[2]) <= 300_000 for row in capture_rows),
|
||||
f"views={[(row[0], int(row[2])) for row in capture_rows]}")
|
||||
|
||||
surface_script = LINUX58 / "AuditLatticeSurfaceL58.py"
|
||||
surface_script = LINUX59 / "AuditLatticeSurfaceL59.py"
|
||||
audit_layout = ROOT / "Saved/Linux/l48/layouts/landmark-reachability-clang.json"
|
||||
candidate_mesh = OUT / "lattice-meshes" / "lattice-whole-view.vfmesh"
|
||||
controls = (
|
||||
@@ -1130,26 +1169,27 @@ def run_lattice_surface_evidence(runner: VerificationRunner, fixture: Path,
|
||||
("L47-wall-foot-control", ROOT / "Saved/Linux/l47/landmark-l47.vfmesh", "fail"),
|
||||
("plain-native-control", ROOT / "Saved/Linux/l48/control-plain-native.vfmesh", "pass"),
|
||||
)
|
||||
args = ["--json", str(OUT / "whole-surface-lattice-l58.json"),
|
||||
"--svg-dir", str(artifact_dir), "--case", "lattice-whole",
|
||||
svg_dir = OUT / "surface-audit-svg"
|
||||
args = ["--json", str(OUT / "whole-surface-lattice-l59.json"),
|
||||
"--svg-dir", str(svg_dir), "--case", "lattice-whole",
|
||||
str(candidate_mesh), str(layout_path), "measure", "whole"]
|
||||
for label, mesh, expectation in controls:
|
||||
args.extend(("--case", label, str(mesh), str(audit_layout), expectation, "whole"))
|
||||
_, audit_output = runner.run_stage("whole-surface-lattice-l58", surface_script,
|
||||
_, audit_output = runner.run_stage("whole-surface-lattice-l59", surface_script,
|
||||
args, binary=CLANG, data=fixture, recipe="lattice", style=2,
|
||||
layout_path=layout_path, env=env_for(),
|
||||
script_inputs=[surface_script, LINUX54 / "AuditWholeSurfaceL54.py",
|
||||
candidate_mesh, layout_path, audit_layout, *(item[1] for item in controls)])
|
||||
candidate = re.search(r"^\[WholeSurfaceAudit\] label=lattice-whole .*"
|
||||
r"observed=(PASS|FAIL) expected=MEASURE status=PASS$", audit_output, re.M)
|
||||
runner.require("whole-surface-lattice-l58:helix-and-maze",
|
||||
runner.require("whole-surface-lattice-l59:shaft-lip-wall-foot-and-underside",
|
||||
bool(candidate and candidate.group(1) == "PASS"),
|
||||
f"observed={candidate.group(1) if candidate else 'MISSING'} over helix ramp edges and maze wall feet")
|
||||
for label, _mesh, expectation in controls:
|
||||
match = re.search(rf"^\[WholeSurfaceAudit\] label={re.escape(label)} .*"
|
||||
rf"observed=(PASS|FAIL) expected={expectation.upper()} status=PASS$",
|
||||
audit_output, re.M)
|
||||
runner.require(f"whole-surface-lattice-l58:{label}", bool(match),
|
||||
runner.require(f"whole-surface-lattice-l59:{label}", bool(match),
|
||||
f"control_expectation={expectation} observed={match.group(1) if match else 'MISSING'}")
|
||||
|
||||
|
||||
@@ -2227,7 +2267,7 @@ def run_gcc_supplement(runner: VerificationRunner) -> None:
|
||||
if not fixture.is_file() or not layout_path.is_file():
|
||||
fixture, layout_path = run_native_caves_field_audit(runner, CLANG)
|
||||
run_caves_determinism(runner, GCC, fixture, layout_path, compare_reference=True)
|
||||
lattice_fixture = OUT / "fixtures" / "lattice-l58.json"
|
||||
lattice_fixture = OUT / "fixtures" / "lattice-l59.json"
|
||||
lattice_layout = OUT / "layouts" / "native-lattice-field-clang.json"
|
||||
if not lattice_fixture.is_file() or not lattice_layout.is_file():
|
||||
lattice_fixture, lattice_layout = run_native_lattice_field_audit(runner, CLANG)
|
||||
|
||||
Reference in new issue
Block a user