perf(core): FI LOD0 attribution, exact Z-inner traversal; fix a mesh gap at the passage shaft foot (L57); R26

Sampled cycle attribution of FI LOD0 field work: grid fill 83%, boundary 13%, skirts 4%; island roots,
columns and helix dominate, the column cache path is real but secondary (no thrashing). FI-only Z-inner
traversal at LOD0 (same lattice samples, exact) cuts FI whole view 5.35 -> 5.03 s and moving p50 by 12%;
global Z-inner and <=4-island culling were measured and rejected. The meshing band now includes the planned
passage support column's conservative bounds, closing a real gap where the arrival shaft meets the floor
(WorldAssemblyEvaluatorVersion 208 -> 209). fast/medium/full PASS, Clang and GCC.
Research R26 (self-checked): native lattice (maze/shaft) generator design.

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 10:47:44 +01:00
1 parent 4e64b75044
commit 1e3e04bbac
14 files changed
+777 -48

No files matched your search

+75 -29
View File
@@ -1542,7 +1542,7 @@ def run_motif_captures_and_surface_audit(runner: VerificationRunner) -> None:
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),
"--artifact-dir", str(OUT / "captures"), "--headless", str(CLANG),
"--renderer", str(RENDERER), "--auditor", str(auditor)],
binary=CLANG, data=OWNER, recipe="surface-world", style=None,
env=env_for(capture=True),
@@ -1803,43 +1803,89 @@ def run_cost_pairs(runner: VerificationRunner) -> None:
orders = (("baseline", "candidate"), ("candidate", "baseline"),
("baseline", "candidate"), ("candidate", "baseline"),
("baseline", "candidate"))
by_recipe: dict[str, dict[str, list[float]]] = {
"floating-islands": {"baseline": [], "candidate": []},
"surface-world": {"baseline": [], "candidate": []}}
by_pair: dict[tuple[str, int], dict[str, float]] = {}
for recipe, style in (("floating-islands", 2), ("surface-world", 1)):
caves_layout = OUT / "layouts" / "native-caves-field-clang.json"
caves_camera = cave_camera_positions(caves_layout, count=1)[0]
caves_camera_flag = "--camera=" + ",".join(f"{value:.6f}" for value in caves_camera)
motif_layout = OUT / "layouts" / "motif-slice1-capsule-reachability-clang.json"
motif_camera = motif_camera_rows(motif_layout)[0][1]
motif_camera_flag = "--camera=" + ",".join(f"{value:.6f}" for value in motif_camera)
owner_styles = {"0": 2, "1": 1}
contexts = (
("floating-islands", OWNER, "floating-islands", [], 2, owner_styles, -1),
# The resolved passage uses the TunnelNetwork-side style (strate 0 = 2);
# the separate owner-style check below still verifies SurfaceWorld strate 1 = 1.
("surface-world", OWNER, "surface-world", [], 2, owner_styles, -1),
("caves", OUT / "fixtures" / "caves.json", "caves",
[caves_camera_flag, "--clip-radius=4", "--max-clip-level=0",
"--max-level=0", "--render-distance-chunks=0"],
2, owner_styles, 0),
("motifs", OUT / "fixtures" / "style-override-motifs-slice1.json", "surface-world",
[motif_camera_flag, "--clip-radius=3", "--max-clip-level=0",
"--max-level=0", "--render-distance-chunks=0"],
2, owner_styles, 0),
)
by_recipe: dict[str, dict[str, dict[str, list[float]]]] = {
name: {build: {metric: [] for metric in
("whole_view_seconds", "first_tile_seconds", "near_ring_seconds",
"moving_p50_ms", "moving_p95_ms")}
for build in ("baseline", "candidate")}
for name, *_ in contexts}
by_pair: dict[tuple[str, int], dict[str, dict[str, float]]] = {}
for name, data, recipe, base_flags, style, expected_styles, max_level in contexts:
flags = [*base_flags, "--camera-step=24,0,0", "--region-crossing"]
for pair, order in enumerate(orders, 1):
for build in order:
binary = baseline if build == "baseline" else candidate
name = f"cost-{recipe}-pair{pair}-{build}"
run_name = f"cost-{name}-pair{pair}-{build}"
expected_stamp = baseline_stamp if build == "baseline" else None
row, output = runner.run_cpp(name, binary, OWNER, recipe, [],
expected_style=2 if build == "candidate" else None,
expected_strate_styles={"0": 2, "1": 1} if build == "candidate" else None,
layout_path=OUT / "layouts" / f"{name}.json",
row, output = runner.run_cpp(run_name, binary, data, recipe, flags,
expected_style=style if build == "candidate" else None,
expected_strate_styles=expected_styles if build == "candidate" else None,
max_level=max_level,
layout_path=OUT / "layouts" / f"{run_name}.json",
expected_stamp=expected_stamp)
row["requested_style"] = style
row["expected_passage_style"] = 2 if build == "candidate" else None
ready = re.findall(r"\bwhole_view_ready=([0-9.]+)s", output)
ok = (len(ready) == 1 and "hash=off" in output
row["expected_passage_style"] = style if build == "candidate" else None
stream = re.search(r"^\[StreamPipeline\].*?first_tile_ready=([0-9.]+)s "
r".*?neighborhood_ready=([0-9.]+)s .*?whole_view_ready=([0-9.]+)s",
output, re.M)
moving = re.search(r"^\[MovingTileLatency\] entering_tiles=(\d+) "
r"p50_ms=([0-9.]+) p95_ms=([0-9.]+) "
r"metric=submit_to_completion_observed$", output, re.M)
metrics = ({"first_tile_seconds": float(stream.group(1)),
"near_ring_seconds": float(stream.group(2)),
"whole_view_seconds": float(stream.group(3)),
"moving_p50_ms": float(moving.group(2)),
"moving_p95_ms": float(moving.group(3))}
if stream and moving and int(moving.group(1)) > 0 else {})
row["cost_metrics"] = metrics
ok = (len(metrics) == 5 and "hash=off" in output
and "cache_hits=0" in output
and RECIPE_RE.findall(output) == [(recipe, recipe, "PASS")])
runner.require(f"{name}:cost-record", ok,
f"whole_view_ready={ready[0] if ready else 'MISSING'}s "
runner.require(f"{run_name}:cost-record", ok,
f"metrics={metrics if metrics else 'MISSING'} "
f"source_stamp={row['source_stamp']}")
by_recipe[recipe][build].append(float(ready[0]))
by_pair.setdefault((recipe, pair), {})[build] = float(ready[0])
for recipe, values in by_recipe.items():
old = statistics.median(values["baseline"])
new = statistics.median(values["candidate"])
paired = [((by_pair[(recipe, pair)]["candidate"] - by_pair[(recipe, pair)]["baseline"])
/ by_pair[(recipe, pair)]["baseline"] * 100.0)
for pair in range(1, 6)]
runner.require(f"cost-{recipe}-five-pairs",
len(values["baseline"]) == len(values["candidate"]) == 5,
f"median_baseline_s={old:.3f} median_candidate_s={new:.3f} "
f"median_change_pct={(new / old - 1.0) * 100.0:+.2f} "
f"paired_change_pct={','.join(f'{value:+.2f}' for value in paired)}")
for metric, value in metrics.items():
by_recipe[name][build][metric].append(value)
by_pair.setdefault((name, pair), {})[build] = metrics
for name, values in by_recipe.items():
for metric in values["baseline"]:
old_values = values["baseline"][metric]
new_values = values["candidate"][metric]
old = statistics.median(old_values) if old_values else float("inf")
new = statistics.median(new_values) if new_values else float("inf")
paired = [((by_pair[(name, pair)]["candidate"][metric]
- by_pair[(name, pair)]["baseline"][metric])
/ by_pair[(name, pair)]["baseline"][metric] * 100.0)
for pair in range(1, 6)
if (name, pair) in by_pair
and len(by_pair[(name, pair)].get("baseline", {})) == 5
and len(by_pair[(name, pair)].get("candidate", {})) == 5]
runner.require(f"cost-{name}-{metric}-five-pairs",
len(old_values) == len(new_values) == len(paired) == 5,
f"median_baseline={old:.3f} median_candidate={new:.3f} "
f"median_change_pct={(new / old - 1.0) * 100.0:+.2f} "
f"paired_change_pct={','.join(f'{value:+.2f}' for value in paired)}")
def run_medium_suite(runner: VerificationRunner, *, both_compilers: bool = False) -> None: