feat(core): slab + sparse motifs, slice 1 -- flat field, monolith, platform at 0.52 s (L56); research R25

Motif vocabulary v3: version-1 records keyed by (seed, strate, stable ID) with route keepouts, band
clearance and pairwise spacing. A rounded capped-cylinder monolith (r 1.4 m, 24 m tall) and a rounded-box
plinth, smooth-unioned into a flatField floor with a 0.55 m geometric rounding (measured fillets 0.73-1.17 m).
Exact radial/box interval bounds, a BVH, isTileShapeFree aware (0 brute-force misses, false-proof controls
rejected). Final-field route passes; whole-surface audit covers foot, cap and platform edges. Cold whole
view 0.524 s. Owner world unchanged. fast/medium/full PASS (Clang and GCC).
Research R25 (self-checked): FloatingIslands LOD0 column cache conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dhxM43dnWvUu2B5Ph1iG1
This commit is contained in:
Fr0zkaandClaude Opus 5.5 committed 2026-10-25 07:47:15 +01:00
1 parent aee1487410
commit 4e64b75044
15 files changed
+1560 -12

No files matched your search

+259
View File
@@ -26,6 +26,7 @@ LINUX37 = ROOT / "Standalone/Research/WorldAssemblerM3/Linux37"
LINUX47 = ROOT / "Standalone/Research/WorldAssemblerM3/Linux47"
LINUX53 = ROOT / "Standalone/Research/WorldAssemblerM3/Linux53"
LINUX54 = ROOT / "Standalone/Research/WorldAssemblerM3/Linux54"
LINUX56 = ROOT / "Standalone/Research/WorldAssemblerM3/Linux56"
OWNER = ROOT / "Standalone/data/owner_world.json"
OUT_DEFAULT = ROOT / "Saved/Linux/l42"
@@ -1306,6 +1307,257 @@ def run_profile_random_camera_sweep(runner: VerificationRunner, binary: Path, *,
reference_path.write_text(json.dumps(references, indent=2) + "\n", encoding="utf-8")
def build_motif_fixture(runner: VerificationRunner) -> Path:
script = LINUX56 / "BuildMotifFixtureR24.py"
fixture_dir = OUT / "fixtures"
runner.run_stage("build-style-override-motifs-slice1-r24", script,
["--out", str(fixture_dir)], binary=CLANG, data=OWNER,
recipe="surface-world", style=None,
script_inputs=[OWNER])
fixture = fixture_dir / "style-override-motifs-slice1.json"
runner.require("motif-fixture:exists", fixture.is_file(),
"versioned flatField and two fixed-count sparse motifs are present")
return fixture
def motif_camera_rows(layout_path: Path) -> list[tuple[str, tuple[float, float, float, float, float]]]:
try:
layout = json.loads(layout_path.read_text(encoding="utf-8"))
motifs = layout["stamps"]
monolith = next(row for row in motifs if row["kind"] == 5)
routes = [anchor["values"] for strate in layout["strates"]
for anchor in strate.get("anchors", [])
if anchor.get("kind") == "route_point" and len(anchor.get("values", [])) >= 3]
except (OSError, KeyError, StopIteration, TypeError, json.JSONDecodeError) as error:
raise VerificationFailure(f"cannot derive motif cameras from {layout_path}: {error}")
mono = tuple(value / 1_000_000.0 for value in monolith["position_um"])
floor = monolith["floor_um"] / 1_000_000.0
cameras: list[tuple[str, tuple[float, float, float, float, float]]] = []
camera = (mono[0] - 10.0, mono[1], floor + 1.65)
target = (mono[0], mono[1], floor + 12.0)
dx, dy, dz = (target[i] - camera[i] for i in range(3))
cameras.append(("monolith", (*camera, math.degrees(math.atan2(dx, dy)),
math.degrees(math.atan2(dz, math.hypot(dx, dy))))))
if len(routes) < 2:
raise VerificationFailure("resolved motif layout has no planned surface route")
points = [tuple(float(value) / 1024.0 for value in row[:3]) for row in routes]
center = tuple(sum(point[axis] for point in points) / len(points) for axis in range(3))
rng = _SplitMix64(0x4C353600 + sum(b"motifs-slice1"))
for index in range(2):
x = center[0] + rng.between(-36.0, 36.0)
y = center[1] + rng.between(-36.0, 36.0)
z = center[2] + rng.between(-2.0, 3.0)
yaw = rng.between(-180.0, 180.0)
pitch = rng.between(-18.0, 18.0)
cameras.append((f"random{index}", (x, y, z, yaw, pitch)))
return cameras
def validate_motif_layout(runner: VerificationRunner, name: str,
layout_path: Path, manifest_path: Path) -> dict:
try:
layout = json.loads(layout_path.read_text(encoding="utf-8"))
manifest = json.loads(manifest_path.read_text(encoding="utf-8"))
motifs = layout["stamps"]
profile = manifest["recipe"]["surface_profile"]
monolith = next(record for record in motifs if record["kind"] == 5)
platform = next(record for record in motifs if record["kind"] == 6)
strate = next(row for row in layout["strates"]
if row["strate_index"] == monolith["strate_index"])
ids = [record["stable_id"] for record in motifs]
gap_squared = 0
for axis in range(3):
gap = max(0, monolith["bounds_min_um"][axis]
- platform["bounds_max_um"][axis],
platform["bounds_min_um"][axis]
- monolith["bounds_max_um"][axis])
gap_squared += gap * gap
min_spacing = max(monolith["minimum_spacing_um"],
platform["minimum_spacing_um"])
spacing_ok = gap_squared >= min_spacing * min_spacing
floor_ok = all(record["attachment_policy"] == 1
and record["position_um"][2]
== record["floor_um"] + record["half_extents_um"][2]
and record["bounds_min_um"][2] > strate["content"]["bottom_um"]
and record["bounds_max_um"][2] < strate["content"]["top_um"]
for record in motifs)
valid = (layout["stamp_vocabulary_version"] == 3 and len(motifs) == 2
and ids == sorted(ids) and profile["version"] == 1
and profile["kind"] == "flatField" and spacing_ok and floor_ok
and monolith["half_extents_um"][0] == monolith["half_extents_um"][1]
and monolith["rounding_radius_um"] >= 500_000
and platform["rounding_radius_um"] >= 500_000)
except (OSError, KeyError, StopIteration, TypeError, ValueError,
json.JSONDecodeError):
valid = False
motifs = []
profile = {}
spacing_ok = floor_ok = False
runner.require(f"{name}:versioned-records", valid,
f"vocabulary=3 profile={profile.get('kind', 'MISSING')} records={len(motifs)} "
f"stable_ids_sorted={valid} floor_attachment={floor_ok} pairwise_spacing={spacing_ok}")
return layout
def run_motif_fixture_audits(runner: VerificationRunner, binary: Path = CLANG) -> tuple[Path, Path]:
compiler = compiler_name(binary)
fixture = build_motif_fixture(runner)
manifest = OUT / "fixtures" / "style-override-motifs-slice1-manifest.json"
layout_path = OUT / "layouts" / f"motif-slice1-capsule-reachability-{compiler}.json"
name = f"motif-slice1-capsule-reachability-{compiler}"
row, output = runner.run_cpp(name, binary, fixture, "surface-world",
["--audit-resolved-layout-passages",
f"--world-assembler-manifest-output={manifest}"],
expected_style=None, expected_strate_styles={"0": 2, "1": 1},
layout_path=layout_path,
script_inputs=[LINUX56 / "BuildMotifFixtureR24.py"])
validate_passage(runner, name, output)
runner.require(f"{name}:motif-record-output",
all_match(output, r"^\[ResolvedMotifFamily\] vocabulary=3 records=2 "
r"placement=seed,strate,stable_id route_keepout=PASS band_clearance=PASS "
r"pairwise_spacing=PASS status=PASS$"),
"two stable motif records resolve outside passage, route and band keepouts")
layout = validate_motif_layout(runner, name, layout_path, manifest)
interval_name = f"motif-slice1-interval-oracle-{compiler}"
interval_layout = OUT / "layouts" / f"{interval_name}.json"
_, interval_output = runner.run_cpp(interval_name, binary, fixture,
"surface-world", ["--audit-motif-intervals",
f"--world-assembler-manifest-output={manifest}"],
expected_style=None, expected_strate_styles={"0": 2, "1": 1},
layout_path=interval_layout,
script_inputs=[LINUX56 / "BuildMotifFixtureR24.py"])
oracle = re.search(r"^\[ResolvedMotifIntervalOracle\] .*status=PASS$",
interval_output, re.M)
runner.require(f"{interval_name}:intervals-and-controls", oracle is not None,
"feature-bound intervals cover brute-force samples; false all-air/all-solid controls reject")
return fixture, layout_path
def motif_signature(output: str, row: dict) -> dict[str, object]:
serialization = re.search(
r"^\[WorldAssemblerPlanSerialization\].*canonical_round_trip=true .*"
r"plan_hash=([0-9a-f]+) manifest_hash=([0-9a-f]+) status=PASS$", output, re.M)
return {
"tiles": {"/".join(map(str, key)): list(value)
for key, value in sorted(parse_tile_hashes(output).items())},
"materials": {"/".join(map(str, key)): value
for key, value in sorted(parse_tile_material_hashes(output).items())},
"whole_hashes": HASH_RE.findall(output),
"plan_hash": serialization.group(1) if serialization else None,
"manifest_hash": serialization.group(2) if serialization else None,
"layout_id": row.get("layout_id"),
}
def run_motif_determinism(runner: VerificationRunner, binary: Path, *,
compare_reference: bool) -> None:
compiler = compiler_name(binary)
reference_path = OUT / "motif-random-camera-reference.json"
if compare_reference:
try:
references = json.loads(reference_path.read_text(encoding="utf-8"))
except (OSError, json.JSONDecodeError) as error:
raise VerificationFailure(f"missing Clang motif reference: {error}")
else:
references: dict[str, dict[str, dict[str, object]]] = {}
fixture = OUT / "fixtures" / "style-override-motifs-slice1.json"
layout_path = OUT / "layouts" / "motif-slice1-capsule-reachability-clang.json"
cameras = motif_camera_rows(layout_path)
for camera_index, (label, camera) in enumerate(cameras):
x, y, z, yaw, pitch = camera
camera_flag = f"--camera={x:.6f},{y:.6f},{z:.6f},{yaw:.3f},{pitch:.3f}"
signatures: dict[int, dict[str, object]] = {}
for workers in (1, 8, 12):
name = f"motif-camera-{label}-{compiler}-w{workers}"
manifest = OUT / "fixtures" / f"{name}-manifest.json"
row, output = runner.run_cpp(name, binary, fixture, "surface-world",
["--stream-hash-tiles", camera_flag, "--clip-radius=3",
"--max-clip-level=0", "--max-level=0", "--render-distance-chunks=0",
f"--world-assembler-manifest-output={manifest}"],
expected_style=None, expected_strate_styles={"0": 2, "1": 1},
workers=workers, max_level=0,
layout_path=OUT / "layouts" / f"{name}.json",
script_inputs=[LINUX56 / "BuildMotifFixtureR24.py"])
signature = motif_signature(output, row)
whole = re.search(r"^\[PipelineWholeViewHash\] tiles=(\d+)", output, re.M)
expected_tiles = int(whole.group(1)) if whole else -1
runner.require(f"{name}:tile-hash-coverage",
len(signature["tiles"]) == expected_tiles
and len(signature["materials"]) == expected_tiles,
f"geometry_tiles={len(signature['tiles'])}/{expected_tiles} "
f"material_tiles={len(signature['materials'])}/{expected_tiles}")
signatures[workers] = signature
stable = signatures[1] == signatures[8] == signatures[12]
runner.require(f"motif-camera-{label}-{compiler}:workers", stable,
"W1, W8 and W12 preserve plan, motif and tile geometry/material hashes")
key = f"p{camera_index:02d}/{label}"
if compare_reference:
runner.require(f"motif-camera-{label}-gcc:clang-peer",
{str(worker): signatures[worker] for worker in (1, 8, 12)}
== references.get(key),
"Clang and GCC preserve the random-camera motif hashes at W1/W8/W12")
else:
references[key] = {str(worker): signatures[worker]
for worker in (1, 8, 12)}
if not compare_reference:
reference_path.write_text(json.dumps(references, indent=2) + "\n", encoding="utf-8")
def run_motif_timing(runner: VerificationRunner, binary: Path,
layout_path: Path) -> dict[str, float]:
camera = motif_camera_rows(layout_path)[0][1]
camera_flag = "--camera=" + ",".join(f"{value:.6f}" for value in camera)
name = f"motif-slice1-cold-view-{compiler_name(binary)}"
manifest = OUT / "fixtures" / f"{name}-manifest.json"
row, output = runner.run_cpp(name, binary,
OUT / "fixtures" / "style-override-motifs-slice1.json", "surface-world",
[camera_flag, "--stream-hash", "--instrument-tile-drain", "--clip-radius=3",
"--max-clip-level=0", "--max-level=0", "--render-distance-chunks=0",
f"--world-assembler-manifest-output={manifest}"],
expected_style=None, expected_strate_styles={"0": 2, "1": 1}, workers=12,
max_level=0, layout_path=OUT / "layouts" / f"{name}.json",
script_inputs=[LINUX56 / "BuildMotifFixtureR24.py"])
summary = re.search(r"^\[StreamPipeline\] workers=12 .*?first_tile_ready=([0-9.]+)s "
r"neighborhood_mesh=([0-9.]+)s neighborhood_ready=([0-9.]+)s "
r".*?whole_view_ready=([0-9.]+)s", output, re.M)
runner.require(f"{name}:timing", summary is not None,
"cold first tile, near ring and whole view timings are recorded")
values = ({"first_tile_seconds": float(summary.group(1)),
"near_ring_seconds": float(summary.group(3)),
"whole_view_seconds": float(summary.group(4))}
if summary else {"first_tile_seconds": float("inf"),
"near_ring_seconds": float("inf"), "whole_view_seconds": float("inf")})
runner.require(f"{name}:provisional-budget", values["whole_view_seconds"] <= 1.75,
f"whole_view_ready={values['whole_view_seconds']:.3f}s budget=1.750s")
row.update(values)
(OUT / "motif-timing.json").write_text(json.dumps(values, indent=2) + "\n",
encoding="utf-8")
return values
def run_motif_captures_and_surface_audit(runner: VerificationRunner) -> None:
script = LINUX56 / "CaptureMotifsR24.py"
quality = VERIFY_DIR / "capture_quality.py"
auditor = LINUX56 / "AuditMotifSurfaceR24.py"
_, output = runner.run_stage("capture-and-audit-motifs-slice1-r24", script,
["--out", str(OUT), "--fixture-dir", str(OUT / "fixtures"),
"--artifact-dir", str(LINUX56 / "captures"), "--headless", str(CLANG),
"--renderer", str(RENDERER), "--auditor", str(auditor)],
binary=CLANG, data=OWNER, recipe="surface-world", style=None,
env=env_for(capture=True),
script_inputs=[quality, auditor, LINUX56 / "BuildMotifFixtureR24.py"])
capture_rows = re.findall(r"^\[L56MotifCapture\] view=(\S+) .*status=PASS$",
output, re.M)
runner.require("capture-and-audit-motifs-slice1-r24:views",
set(capture_rows) == {"eye", "overview"} and len(capture_rows) == 2,
f"views={','.join(capture_rows)}")
surface = re.search(r"^\[MotifSurfaceAudit\] .*status=PASS$", output, re.M)
runner.require("capture-and-audit-motifs-slice1-r24:whole-surface",
surface is not None,
"whole LOD0 surface has covered monolith foot/cap and platform-edge ROIs; controls reject")
def run_transitions_and_invariants(runner: VerificationRunner,
binaries: tuple[Path, ...]) -> None:
for binary in binaries:
@@ -1613,6 +1865,10 @@ def run_medium_suite(runner: VerificationRunner, *, both_compilers: bool = False
run_caves_determinism(runner, CLANG, fixture, layout_path, compare_reference=False)
run_caves_performance(runner, CLANG, fixture, layout_path)
run_caves_surface_evidence(runner, fixture, layout_path)
_motif_fixture, motif_layout = run_motif_fixture_audits(runner, CLANG)
run_motif_determinism(runner, CLANG, compare_reference=False)
run_motif_timing(runner, CLANG, motif_layout)
run_motif_captures_and_surface_audit(runner)
def run_gcc_supplement(runner: VerificationRunner) -> None:
@@ -1630,6 +1886,8 @@ 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)
run_motif_fixture_audits(runner, GCC)
run_motif_determinism(runner, GCC, compare_reference=True)
def _tier_deadline(_signum: int, _frame: object) -> None:
@@ -1659,6 +1917,7 @@ def main() -> int:
run_random_camera_sweep(runner, (CLANG,), 3, ((3, 0, 0),))
run_ring(runner, full=False)
run_native_caves_field_audit(runner, CLANG)
run_motif_fixture_audits(runner, CLANG)
elif ARGS.tier == "medium":
run_medium_suite(runner, both_compilers=False)
else: