core: Vertical Shafts on the shared Core cave planner (L139, v237; 15/16 seeds)
Shaft mode reuses PlanResolvedCavernNetworkV1 with a capped full-height cylinder primitive (shapeKind=1), ledges, access bores and cross links; 11 VerticalShaftParams fields mapped. Basal law: arrival 2-3 to a walkable terminal landing; drops/climbs stay reporting tiers. Seed 2 fails shell/seams at the 2-3 arrival mouth (3 variants tried, stopped per AGENTS.md). Whole view faster than assembler/world in 8/8 cells; near-ready slower in 7/8. Source/: VoxelForgeCoreAdapter.cpp. 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
fa4417aad0
commit
318c5cf4f2
31 files changed
+1719
-106
No files matched your search
@@ -0,0 +1,167 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Run interleaved L80 timings for L139, fa4417a, and assembler/world."""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import statistics
|
||||
import subprocess
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[4]
|
||||
OUT = ROOT / "Saved/Linux/l139/timing"
|
||||
DATA = ROOT / "Standalone/data/owner_world.json"
|
||||
BINARIES = {
|
||||
"assembler-world": (
|
||||
ROOT / "Saved/Linux/l137/bin/VoxelForgeCoreHeadless-l137-aa-a",
|
||||
"4499fb2a8a4ede7d6cbc68d1b794f104658cdaae93ed9cacbc91fe7ff3fc3621"),
|
||||
"fa4417a": (
|
||||
ROOT / "Saved/Linux/l138/bin/VoxelForgeCoreHeadless-l138-clang",
|
||||
"9aade4e6cb33e86c36b89440644d9ef5d440288fb6ff0af03af128291c95f93f"),
|
||||
"l139": (
|
||||
ROOT / "Saved/Linux/l139/bin/VoxelForgeCoreHeadless-l139-clang",
|
||||
"b8603b6cb3975ca0f9669759e4e2464561c557fdb7aa6836acef123ecf0b99d1"),
|
||||
}
|
||||
CAMERAS = {
|
||||
0: (8.0, 16.0, -372.2626953125),
|
||||
1: (25.8369140625, 3.19921875, -737.0),
|
||||
2: (19.166015625, -14.2001953125, -753.3740234375),
|
||||
3: (-20.0625, -5.068359375, -900.353515625),
|
||||
}
|
||||
PIPELINE = re.compile(r"^\[StreamPipeline\] (.*)$", re.M)
|
||||
FIELDS = re.compile(r"([a-zA-Z0-9_]+)=([^ ]+)")
|
||||
NEAR = re.compile(
|
||||
r"^\[WorldAssemblerNearLODReady\] lods=0-2 tiles=(\d+)/(\d+) cold_ready_s=([0-9.]+)$",
|
||||
re.M)
|
||||
STAMP = re.compile(r"^\[VoxelForgeSourceStamp\] sha256=([0-9a-f]+)$", re.M)
|
||||
|
||||
|
||||
def run(strate: int, workers: int, version: str, phase: str, replicate: int) -> dict:
|
||||
OUT.mkdir(parents=True, exist_ok=True)
|
||||
binary, expected_stamp = BINARIES[version]
|
||||
camera = ",".join(f"{value:.12f}" for value in CAMERAS[strate]) + ",0,0"
|
||||
label = f"s{strate}-w{workers}-{version}-{phase}{replicate}"
|
||||
log = OUT / f"{label}.log"
|
||||
command = [
|
||||
"taskset", "-c", "0-11", "prlimit", "--as=6442450944", "--",
|
||||
"timeout", "1740s", str(binary), str(DATA), "--world-assembler-prototype",
|
||||
"--stream-benchmark", "--stream-pipeline", f"--workers={workers}",
|
||||
"--clip-radius=3", "--max-clip-level=8", "--max-level=8",
|
||||
f"--camera={camera}", "--profile-lod-work", "--stream-scheduler-policy=3",
|
||||
]
|
||||
started = time.monotonic()
|
||||
with log.open("w", encoding="utf-8") as output:
|
||||
proc = subprocess.run(command, cwd=ROOT, stdout=output,
|
||||
stderr=subprocess.STDOUT, check=False, timeout=1740)
|
||||
content = log.read_text(encoding="utf-8", errors="replace")
|
||||
pipeline, near, stamp = PIPELINE.search(content), NEAR.search(content), STAMP.search(content)
|
||||
if (proc.returncode or pipeline is None or near is None or stamp is None
|
||||
or stamp.group(1) != expected_stamp):
|
||||
raise SystemExit(f"L80 timing failed or stamp mismatch: {log}; exit={proc.returncode}")
|
||||
fields = dict(FIELDS.findall(pipeline.group(1)))
|
||||
row = {
|
||||
"strate": strate, "workers": workers, "version": version,
|
||||
"phase": phase, "replicate": replicate, "source_stamp": stamp.group(1),
|
||||
"lod02_ready_s": float(near.group(3)),
|
||||
"whole_view_ready_s": float(fields["whole_view_ready"].removesuffix("s")),
|
||||
"whole_tiles": int(fields["whole_tiles"].split("/")[0]),
|
||||
"wall_s": round(time.monotonic() - started, 3),
|
||||
"log": str(log.relative_to(ROOT)),
|
||||
}
|
||||
print("[L139FinalTimingRun] " + json.dumps(row, sort_keys=True), flush=True)
|
||||
return row
|
||||
|
||||
|
||||
def quiet_machine() -> tuple[float, float]:
|
||||
load_1m = os.getloadavg()[0]
|
||||
|
||||
def totals() -> tuple[int, int]:
|
||||
fields = Path("/proc/stat").read_text().splitlines()[0].split()
|
||||
values = [int(value) for value in fields[1:]]
|
||||
return sum(values), values[3] + values[4]
|
||||
|
||||
before = totals()
|
||||
time.sleep(2.0)
|
||||
after = totals()
|
||||
idle = 100.0 * (after[1] - before[1]) / max(1, after[0] - before[0])
|
||||
return load_1m, idle
|
||||
|
||||
|
||||
def main() -> int:
|
||||
if any(not path.is_file() for path in [DATA, *(entry[0] for entry in BINARIES.values())]):
|
||||
raise SystemExit("missing L139 timing input")
|
||||
OUT.mkdir(parents=True, exist_ok=True)
|
||||
load_1m, idle = quiet_machine()
|
||||
(OUT / "machine-load-before.txt").write_text(
|
||||
f"1-minute load: {load_1m:.2f}\n2-second CPU idle: {idle:.1f}%\n")
|
||||
print(f"[L139FinalTimingGate] load_1m={load_1m:.2f} cpu_idle_2s={idle:.1f}%", flush=True)
|
||||
if load_1m >= 1.5 or idle < 97.0:
|
||||
raise SystemExit("timing refused: machine is above the L80 quiet-load gate")
|
||||
|
||||
rows = []
|
||||
for strate in range(4):
|
||||
for workers in (8, 12):
|
||||
for version in BINARIES:
|
||||
run(strate, workers, version, "warmup", 0)
|
||||
for replicate in range(1, 6):
|
||||
order = tuple(BINARIES)
|
||||
order = order[replicate % 3:] + order[:replicate % 3]
|
||||
if replicate % 2 == 0:
|
||||
order = tuple(reversed(order))
|
||||
for version in order:
|
||||
rows.append(run(strate, workers, version, "measured", replicate))
|
||||
(OUT / "runs-partial.json").write_text(
|
||||
json.dumps(rows, indent=2) + "\n", encoding="utf-8")
|
||||
|
||||
measured = [row for row in rows if row["phase"] == "measured"]
|
||||
summary = []
|
||||
for strate in range(4):
|
||||
for workers in (8, 12):
|
||||
group = [row for row in measured
|
||||
if row["strate"] == strate and row["workers"] == workers]
|
||||
medians = {
|
||||
version: {
|
||||
key: statistics.median(row[key] for row in group
|
||||
if row["version"] == version)
|
||||
for key in ("lod02_ready_s", "whole_view_ready_s")
|
||||
}
|
||||
for version in BINARIES
|
||||
}
|
||||
entry = {"strate": strate, "workers": workers,
|
||||
"replicates_per_version": 5, "medians": medians}
|
||||
for key in ("lod02_ready_s", "whole_view_ready_s"):
|
||||
for baseline in ("fa4417a", "assembler-world"):
|
||||
entry[f"l139_vs_{baseline}_{key}_delta_pct"] = round(
|
||||
100.0 * (medians["l139"][key] / medians[baseline][key] - 1.0), 2)
|
||||
entry[f"l139_vs_fa4417a_{key}_paired_deltas_pct"] = [
|
||||
round(100.0 * (
|
||||
next(row[key] for row in group
|
||||
if row["version"] == "l139" and row["replicate"] == replicate)
|
||||
/ next(row[key] for row in group
|
||||
if row["version"] == "fa4417a" and row["replicate"] == replicate)
|
||||
- 1.0), 3) for replicate in range(1, 6)]
|
||||
entry[f"l139_vs_assembler-world_{key}_paired_deltas_pct"] = [
|
||||
round(100.0 * (
|
||||
next(row[key] for row in group
|
||||
if row["version"] == "l139" and row["replicate"] == replicate)
|
||||
/ next(row[key] for row in group
|
||||
if row["version"] == "assembler-world"
|
||||
and row["replicate"] == replicate) - 1.0), 3)
|
||||
for replicate in range(1, 6)]
|
||||
summary.append(entry)
|
||||
(OUT / "summary.json").write_text(json.dumps({
|
||||
"a_a_noise_floor_pct": 1.0,
|
||||
"fa4417a_commit": "fa4417a",
|
||||
"timing_protocol": (
|
||||
"one warmup per binary, five interleaved runs, W8/W12, all four owner layers"),
|
||||
"runs": rows,
|
||||
"summary": summary,
|
||||
}, indent=2) + "\n", encoding="utf-8")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Reference in new issue
Block a user