wip(assembler): round L33 -- SurfaceWorld can be an upper strate; FloorProfileBlend measures seams
Route planning for an upper SurfaceWorld failed on long candidate chords over steep relief; chords are now capped to the arrival/departure radii on an 8 m centre grid with an origin-proximity cost (21.5 m walk, about 4 deg). The departure passage starts at the SW ground and tunnels down through rock. FI -> SW -> TN fixture: all 4 styles pass every passage audit on both compilers. FloorProfileBlend now checks endpoint height/tangent seams (step and tangent-step negative controls detected). Owner world hashes unchanged; 30/30 determinism; cost within noise. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CSFYgsdW8ejZSyiMf4qRSX
This commit is contained in:
1 parent
d0158c6019
commit
b7a47bef95
17 files changed
+1116
-32
No files matched your search
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Build owner-like FloatingIslands -> SurfaceWorld -> TunnelNetwork fixtures."""
|
||||
import copy
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[4]
|
||||
SOURCE = ROOT / "Standalone/data/owner_world.json"
|
||||
OUT = ROOT / "Saved/Linux/l33/fixtures"
|
||||
|
||||
|
||||
def make_fixture(style: int) -> Path:
|
||||
world = json.loads(SOURCE.read_text(encoding="utf-8"))
|
||||
source_tunnel, source_surface = world["strates"]
|
||||
|
||||
floating = copy.deepcopy(source_tunnel)
|
||||
floating.update(index=0, top_chunk_z=0, bottom_chunk_z=-15, height_chunks=16)
|
||||
floating["asset"]["StrateName"] = "Linux33 Upper FloatingIslands"
|
||||
floating["asset"]["StrateHeightInChunks"] = 16
|
||||
floating["asset"]["GeneratorType"] = 6
|
||||
|
||||
surface = copy.deepcopy(source_surface)
|
||||
surface.update(index=1, top_chunk_z=-16, bottom_chunk_z=-79, height_chunks=64)
|
||||
surface["asset"]["StrateName"] = "Linux33 Middle SurfaceWorld"
|
||||
surface["asset"]["StrateHeightInChunks"] = 64
|
||||
surface["asset"]["PassageConfig"]["Style"] = style
|
||||
surface["passage_config"]["Style"] = style
|
||||
|
||||
tunnel = copy.deepcopy(source_tunnel)
|
||||
tunnel.update(index=2, top_chunk_z=-80, bottom_chunk_z=-143, height_chunks=64)
|
||||
tunnel["asset"]["StrateName"] = "Linux33 Lower TunnelNetwork"
|
||||
tunnel["asset"]["StrateHeightInChunks"] = 64
|
||||
|
||||
world["strates"] = [floating, surface, tunnel]
|
||||
world["total_strates"] = 3
|
||||
world["settings_asset"]["TotalStrates"] = 3
|
||||
world["settings_asset"]["StratePool"] = [
|
||||
"/Standalone/Linux33/UpperFloatingIslands",
|
||||
"/Standalone/Linux33/MiddleSurfaceWorld",
|
||||
"/Standalone/Linux33/LowerTunnelNetwork",
|
||||
]
|
||||
world["passages"] = [] # The L23 legacy coordinates are not part of this resolved stack.
|
||||
world["source"] = "VoxelForge Linux33 owner-like SurfaceWorld-upper fixture"
|
||||
|
||||
OUT.mkdir(parents=True, exist_ok=True)
|
||||
path = OUT / f"sw-upper-tunnel-network-style{style}.json"
|
||||
path.write_text(json.dumps(world, separators=(",", ":")), encoding="utf-8")
|
||||
return path
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
for style in range(4):
|
||||
path = make_fixture(style)
|
||||
print(f"style={style} fixture={path}")
|
||||
@@ -0,0 +1,100 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Export and render two bounded SurfaceWorld departure views."""
|
||||
import os
|
||||
import subprocess
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[4]
|
||||
OUT = ROOT / "Saved/Linux/l33"
|
||||
FIXTURE = OUT / "fixtures/sw-upper-tunnel-network-style0.json"
|
||||
HEADLESS = OUT / "bin/VoxelForgeCoreHeadless-clang-l33-final"
|
||||
CAPTURE = OUT / "bin/VoxelForgeOffscreenCapture-clang-l33-final"
|
||||
PNG_DIR = OUT / "capture-png"
|
||||
DEST = Path(__file__).resolve().parent / "captures"
|
||||
PNG_DIR.mkdir(parents=True, exist_ok=True)
|
||||
DEST.mkdir(parents=True, exist_ok=True)
|
||||
env = os.environ.copy()
|
||||
env["LP_NUM_THREADS"] = "12"
|
||||
env["XDG_CACHE_HOME"] = str(OUT / "xdg-cache")
|
||||
|
||||
views = (
|
||||
{
|
||||
"name": "sw-departure-mouth",
|
||||
"export_camera": "18.75,-12,-499,0,-22",
|
||||
"render_camera": "18.75,0,-490",
|
||||
"yaw": "0",
|
||||
"pitch": "-90",
|
||||
"fov": "38",
|
||||
"height_center": "-503.166",
|
||||
"height_range": "4",
|
||||
"light": "0,-1,0.2",
|
||||
"headlamp": "off",
|
||||
"clip": None,
|
||||
},
|
||||
{
|
||||
"name": "sw-departure-rock-entry",
|
||||
"export_camera": "26,-16,-499,64,-16",
|
||||
"render_camera": "14,-4,-500",
|
||||
"yaw": "78",
|
||||
"pitch": "-16",
|
||||
"fov": "32",
|
||||
"height_center": "-503.166",
|
||||
"height_range": "4",
|
||||
"light": "0,-1,0.2",
|
||||
"headlamp": "off",
|
||||
"clip": "1,0,0,-18.75",
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
def run(name, command):
|
||||
logfile = OUT / f"capture-{name}.log"
|
||||
wrapped = [
|
||||
"taskset", "-c", "0-11", "prlimit", "--as=6442450944", "--",
|
||||
"timeout", "1800s", *command,
|
||||
]
|
||||
started = time.monotonic()
|
||||
with logfile.open("w", encoding="utf-8") as stream:
|
||||
result = subprocess.run(wrapped, cwd=ROOT, env=env, stdout=stream,
|
||||
stderr=subprocess.STDOUT, timeout=1800, check=False)
|
||||
print(f"[L33CaptureRun] step={name} elapsed={time.monotonic()-started:.1f}s "
|
||||
f"exit={result.returncode} log={logfile}", flush=True)
|
||||
if result.returncode != 0:
|
||||
raise SystemExit(f"{name} failed; see {logfile}")
|
||||
|
||||
|
||||
for view in views:
|
||||
name = view["name"]
|
||||
mesh = OUT / f"{name}.vfmesh"
|
||||
png = PNG_DIR / f"{name}.png"
|
||||
jpg = DEST / f"{name}.jpg"
|
||||
run(f"{name}-export", [
|
||||
str(HEADLESS), str(FIXTURE), "--workers=12", "--world-assembler-prototype",
|
||||
"--stream-benchmark", "--stream-pipeline", "--force-generate", "--clip-radius=2",
|
||||
"--max-clip-level=0", "--max-level=0", "--render-distance-chunks=0",
|
||||
"--recipe=floating-islands",
|
||||
f"--camera={view['export_camera']}", f"--mesh-export={mesh}",
|
||||
])
|
||||
command = [
|
||||
str(CAPTURE), str(mesh), str(png), "--size=1600x900", f"--fov-deg={view['fov']}",
|
||||
f"--camera-m={view['render_camera']}", f"--yaw-deg={view['yaw']}",
|
||||
f"--pitch-deg={view['pitch']}", "--shade=readable",
|
||||
f"--headlamp={view['headlamp']}", f"--light-direction={view['light']}",
|
||||
"--height-tint=on", f"--height-center-m={view['height_center']}",
|
||||
f"--height-range-m={view['height_range']}", "--tile-edges=off",
|
||||
]
|
||||
if view["clip"]:
|
||||
command.append(f"--clip-plane={view['clip']}")
|
||||
run(f"{name}-render", command)
|
||||
run(f"{name}-jpeg", [
|
||||
"ffmpeg", "-nostdin", "-hide_banner", "-loglevel", "error", "-y",
|
||||
"-i", str(png), "-frames:v", "1", "-q:v", "4", str(jpg),
|
||||
])
|
||||
size = jpg.stat().st_size if jpg.exists() else 0
|
||||
ok = 0 < size <= 300_000
|
||||
print(f"[L33CaptureJPEG] file={jpg.relative_to(ROOT)} bytes={size} "
|
||||
f"status={'PASS' if ok else 'FAIL'}", flush=True)
|
||||
if not ok:
|
||||
raise SystemExit(f"{jpg.name} is missing or exceeds 300 KB")
|
||||
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Check representative owner hashes against L32 before the full matrix."""
|
||||
import re
|
||||
import subprocess
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[4]
|
||||
OUT = ROOT / "Saved/Linux/l33"
|
||||
L32 = ROOT / "Saved/Linux/l32"
|
||||
BINARIES = {
|
||||
"clang": OUT / "bin/VoxelForgeCoreHeadless-clang-l33-final",
|
||||
"gcc": OUT / "bin/VoxelForgeCoreHeadless-gcc-l33-final",
|
||||
}
|
||||
HASH_PATTERN = re.compile(
|
||||
r"^\[Pipeline(?:FullDetailHash|WholeViewHash|LODHash|ExactQueryHash)\].*$", re.M)
|
||||
failed = False
|
||||
|
||||
for compiler, binary in BINARIES.items():
|
||||
for recipe in ("surface-world", "floating-islands"):
|
||||
name = f"owner-hash-preflight-{compiler}-{recipe}-w12"
|
||||
logfile = OUT / f"{name}.log"
|
||||
command = [
|
||||
"taskset", "-c", "0-11", "prlimit", "--as=6442450944", "--",
|
||||
str(binary), str(ROOT / "Standalone/data/owner_world.json"),
|
||||
"--world-assembler-prototype", "--stream-benchmark", "--stream-pipeline",
|
||||
"--stream-hash", "--force-generate", "--clip-radius=3", "--max-clip-level=8",
|
||||
"--far-horizon-lod8-step=0", "--workers=12", f"--recipe={recipe}",
|
||||
]
|
||||
started = time.monotonic()
|
||||
try:
|
||||
with logfile.open("w", encoding="utf-8") as stream:
|
||||
result = subprocess.run(command, stdout=stream, stderr=subprocess.STDOUT,
|
||||
timeout=900, check=False)
|
||||
except subprocess.TimeoutExpired:
|
||||
result = None
|
||||
text = logfile.read_text(encoding="utf-8", errors="replace")
|
||||
hashes = HASH_PATTERN.findall(text)
|
||||
baseline_path = L32 / f"l25-settled-final-{compiler}-{recipe}-w12.log"
|
||||
baseline = HASH_PATTERN.findall(baseline_path.read_text(
|
||||
encoding="utf-8", errors="replace")) if baseline_path.exists() else []
|
||||
stamps = re.findall(
|
||||
r"^\[WorldAssemblerRecipeAudit\] requested=([^ ]+) actual=([^ ]+).*status=([^ ]+)$",
|
||||
text, re.M)
|
||||
same = len(hashes) == 12 and hashes == baseline
|
||||
ok = (result is not None and result.returncode == 0 and same
|
||||
and stamps == [(recipe, recipe, "PASS")])
|
||||
failed |= not ok
|
||||
print(f"{name} elapsed={time.monotonic()-started:.1f}s hashes={len(hashes)}/12 "
|
||||
f"same_as_l32={'yes' if same else 'no'} "
|
||||
f"{'PASS' if ok else 'FAIL'}", flush=True)
|
||||
|
||||
raise SystemExit(1 if failed else 0)
|
||||
@@ -0,0 +1,58 @@
|
||||
# Linux33 report
|
||||
|
||||
## Upper SurfaceWorld route
|
||||
|
||||
The old fixed candidate set used 64 m chords, 2 m waypoint spacing and 16 m centre spacing. On the refreshed upper-stack fixture, the legacy replay measured 366/648 candidates above the 15° grade limit; its worst segment was 79.971° at XY (−84,−48) to (−82,−48). These were long paths over steep terrain relief near the outer search area. L23’s earlier fixture reported 648/648 grade rejects; the refreshed fixture gives a different count. The route Z samples are terrain-ground heights (about −503 m at the chosen mouth), not a target at the bottom of the 499 m strate. There was no unit or bedrock-reference error.
|
||||
|
||||
The planner now caps chords at 58.5 m for the 24 m arrival and 37.5 m departure radii, searches six lengths and places route centres on an 8 m grid, with a proximity cost favouring the origin. It found a 21.5 m walk from (−2.75,0) to departure (18.75,0), average grade about 4.2°. The SW passage starts at the ground floor (−503.166 m), with a 1.5 m portal blending to a 3.5 m tunnel over 9 m, then descends through SW rock. The first tunnel point is at (32.5,0), floor −505.637 m for style 0.
|
||||
|
||||
## Upper-stack fixture audits
|
||||
|
||||
Fixture: FloatingIslands → SurfaceWorld → TunnelNetwork; recipe stamp `floating-islands`; layout identity `resolved-layout-v3-fnv64:fc4e73619037f88c`. Clang and GCC passed every row for every style.
|
||||
|
||||
| Passage style | Floor chord deviation (voxels) | Passage and route audits | Open air | Naturalness | Bridge / columns | Bindings / walkability |
|
||||
|---:|---:|---|---|---|---|---|
|
||||
| 0 | 2.081 | 2/2 each pass | 0 violations | 2/2 pass | pass / 0 failures | 0 failures / pass |
|
||||
| 1 | 10.901 | 2/2 each pass | 0 violations | 2/2 pass | pass / 0 failures | 0 failures / pass |
|
||||
| 2 | 14.822 | 2/2 each pass | 0 violations | 2/2 pass | pass / 0 failures | 0 failures / pass |
|
||||
| 3 | 16.374 | 2/2 each pass | 0 violations | 2/2 pass | pass / 0 failures | 0 failures / pass |
|
||||
|
||||
All rows are recipe-stamped and passed on both compilers. Capsule blocking, unsupported samples and grade failures were zero; mouth-content and mouth-radius checks were 2/2. This includes open-air, naturalness, no-long-bridge, rock-column wall/support, route binding and walkability audits.
|
||||
|
||||
## FloorProfileBlend
|
||||
|
||||
The old 2-voxel check measured maximum curve-to-straight-chord deviation, which grows with valid curvature and does not measure a seam. The check now compares endpoint height and tangent residuals. All styles have 0.00000000 voxel height residual and 0.00000000 voxel/m tangent residual (limits 0.010 and 0.001). Negative controls detected a 3-voxel step and a 0.25 voxel/m tangent step. Verdict: check corrected; no floor geometry change was needed.
|
||||
|
||||
## Captures
|
||||
|
||||
Both 1600×900 JPEGs are under 300 KB. The first shows the SW ground mouth; the second is a cutaway through the rock entry.
|
||||
|
||||
Sizes and SHA-256: mouth 26,939 B, `561d3a1e334ea3a3115fb781a1130ec850d8777b74c1be3704c70b865878640a`; rock entry 37,572 B, `f85d150bf44cd2cdae1ee49de023ad9e4c657b8fa7e8d8f8b93abc86586ad6e5`.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## Hashes, determinism and cost
|
||||
|
||||
Owner-world hashes match L32 exactly: all 12 hash lines per run across Clang/GCC and both recipes passed the owner preflight; the L25 and 24 m crossing matrix also passed at W1/W8/W12 (24/24 owner rows). W12 whole-view hashes: SurfaceWorld density `953eb1df1705f277`, mesh `d8006cb43f44aa5b`, payload `9217bff766970de5`, topology `83e3aa6f3a063e60`; FloatingIslands density `806537cdd98f8afb`, mesh `a4b06dd4d260943d`, payload `763a99aa04a73eae`, topology `baa37d80d3620d87`. The upper fixture was stable across W1/W8/W12 on both compilers. Total determinism: 30/30. Invariant audits: 16/16.
|
||||
|
||||
Five interleaved W12 cost pairs per recipe against L32: median whole-view ready time changed +0.99% for SurfaceWorld and +0.41% for FloatingIslands; paired medians were +0.57% and +0.41%, within run noise. Recipe/evaluator versions remain 2/20. No Unreal files changed; no Unreal build was run. No version bump was needed because the owner hashes are unchanged.
|
||||
|
||||
## Failed and retried runs
|
||||
|
||||
- CLI setup rejected `--compiler clang`; the accepted form was `--compiler=clang++-19`. One shell quoting attempt ended at EOF. A FloatingIslands fixture initially had a `surface-world` recipe stamp and was regenerated with `floating-islands`.
|
||||
- A translated ring centre failed the strict placement disk and was reverted. Fixture audit iterations: r1 had style 1–3 failures (TN capsule pinch, route undercut, naturalness); r2 had 141 open-air violations plus route/naturalness failures; r3 had strict ring-placement and route-support failures; r4 had four edge open-air samples. The broad column-window fix passed passage audits but changed owner hashes. Its first scoped retry dropped supported bracket samples and failed SurfaceWorld hash preflight on both compilers; restoring the original non-SW bracket bounds fixed it.
|
||||
- An intermediate Clang build failed on `coreVoxelSizeMetres` and `gradeSegments`; both names were corrected. Final Clang 19 and GCC 14 `--fp-contract=off`, `-j12` builds succeeded. An early determinism run on stale binaries was stopped after 21 rows and showed the interim hash mismatch; the final binaries passed all 30 rows.
|
||||
- The first capture export included the far ring and grew to 2.49 GB; it was stopped before rendering. The LOD0 streamed export reduced the scene to about 2.2 MB. Capture framings r5–r8 rendered successfully but obscured the mouth; r9 is the inspected final framing.
|
||||
|
||||
No run exceeded 30 minutes and no step remained stuck for 15 minutes. Logs and exports are in `Saved/Linux/l33/`; no commit, push or stash was made.
|
||||
|
||||
## Orchestrator review (Claude)
|
||||
|
||||
- Merged: the owner world is unchanged (hashes equal L32); SW-as-upper now plans its route and passes the full audit set
|
||||
on the FI→SW→TN fixture. The FloorProfileBlend check now measures seams (endpoint height/tangent residuals) with
|
||||
step/tangent negative controls. Accepted: chord deviation measured curvature, not a defect.
|
||||
- Captures: `sw-departure-mouth.jpg` is out of focus and unreadable; `sw-departure-rock-entry.jpg` shows a natural opening
|
||||
but **horizontal step-like ledges inside**, reminiscent of the L23 terraces. L34 checks passage mouths and entries for
|
||||
stepping across styles and fixes the blurry capture setup.
|
||||
@@ -0,0 +1,81 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Run five interleaved W12 whole-view pairs against the L32 binary."""
|
||||
import re
|
||||
import statistics
|
||||
import subprocess
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[4]
|
||||
OUT = ROOT / "Saved/Linux/l33"
|
||||
OUT.mkdir(parents=True, exist_ok=True)
|
||||
BINARIES = {
|
||||
"l32": ROOT / "Saved/Linux/l32/bin/VoxelForgeCoreHeadless-l32-clang-v20",
|
||||
"l33": OUT / "bin/VoxelForgeCoreHeadless-clang-l33-final",
|
||||
}
|
||||
ORDERS = (("l32", "l33"), ("l33", "l32"), ("l32", "l33"),
|
||||
("l33", "l32"), ("l32", "l33"))
|
||||
READY = re.compile(r"\bwhole_view_ready=([0-9.]+)s")
|
||||
rows = []
|
||||
failed = False
|
||||
|
||||
|
||||
for recipe in ("surface-world", "floating-islands"):
|
||||
for pair, order in enumerate(ORDERS, 1):
|
||||
for build in order:
|
||||
name = f"cost-{recipe}-pair{pair}-{build}"
|
||||
logfile = OUT / f"{name}.log"
|
||||
command = [
|
||||
"taskset", "-c", "0-11", "prlimit", "--as=6442450944", "--",
|
||||
str(BINARIES[build]), str(ROOT / "Standalone/data/owner_world.json"),
|
||||
"--workers=12", "--world-assembler-prototype", "--stream-benchmark",
|
||||
"--stream-pipeline", "--force-generate", "--clip-radius=3",
|
||||
"--max-clip-level=8", "--max-level=-1", f"--recipe={recipe}",
|
||||
]
|
||||
started = time.monotonic()
|
||||
try:
|
||||
with logfile.open("w", encoding="utf-8") as stream:
|
||||
result = subprocess.run(command, stdout=stream, stderr=subprocess.STDOUT,
|
||||
timeout=900, check=False)
|
||||
except subprocess.TimeoutExpired:
|
||||
result = None
|
||||
elapsed = time.monotonic() - started
|
||||
text = logfile.read_text(encoding="utf-8", errors="replace")
|
||||
matches = READY.findall(text)
|
||||
stamps = re.findall(
|
||||
r"^\[WorldAssemblerRecipeAudit\] requested=([^ ]+) actual=([^ ]+).*status=([^ ]+)$",
|
||||
text, re.M)
|
||||
stamp_ok = stamps == [(recipe, recipe, "PASS")]
|
||||
valid = (result is not None and result.returncode == 0 and len(matches) == 1
|
||||
and "hash=off" in text and "cache_hits=0" in text and stamp_ok)
|
||||
ready = float(matches[0]) if len(matches) == 1 else float("nan")
|
||||
rows.append((recipe, pair, build, ready, elapsed,
|
||||
result.returncode if result else "TIMEOUT", valid))
|
||||
print(f"{recipe} pair={pair} build={build} whole_view_ready={ready:.3f}s "
|
||||
f"process_elapsed={elapsed:.1f}s {'PASS' if valid else 'FAIL'}", flush=True)
|
||||
failed |= not valid
|
||||
|
||||
summary = OUT / "cost-runs.csv"
|
||||
summary.write_text(
|
||||
"recipe,pair,build,whole_view_ready_seconds,process_elapsed_seconds,exit_code,status\n" +
|
||||
"".join(f"{recipe},{pair},{build},{ready:.6f},{elapsed:.3f},{code},"
|
||||
f"{'PASS' if ok else 'FAIL'}\n"
|
||||
for recipe, pair, build, ready, elapsed, code, ok in rows), encoding="utf-8")
|
||||
|
||||
for recipe in ("surface-world", "floating-islands"):
|
||||
by_build = {build: [row[3] for row in rows if row[0] == recipe and row[2] == build]
|
||||
for build in BINARIES}
|
||||
baseline = statistics.median(by_build["l32"])
|
||||
current = statistics.median(by_build["l33"])
|
||||
paired = []
|
||||
for pair in range(1, 6):
|
||||
values = {row[2]: row[3] for row in rows if row[0] == recipe and row[1] == pair}
|
||||
paired.append((values["l33"] - values["l32"]) / values["l32"] * 100.0)
|
||||
print(f"[L33CostSummary] recipe={recipe} pairs=5 median_l32_s={baseline:.3f} "
|
||||
f"median_l33_s={current:.3f} median_change_pct={(current/baseline-1)*100.0:+.2f} "
|
||||
f"paired_change_pct={','.join(f'{value:+.2f}' for value in paired)}", flush=True)
|
||||
|
||||
print(f"[L33Cost] runs={len(rows)} status={'FAIL' if failed else 'PASS'} summary={summary}",
|
||||
flush=True)
|
||||
raise SystemExit(1 if failed or len(rows) != 20 else 0)
|
||||
@@ -0,0 +1,131 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Run owner L25 hashes, 24 m crossings, and upper-SurfaceWorld fixture determinism."""
|
||||
import re
|
||||
import subprocess
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[4]
|
||||
OUT = ROOT / "Saved/Linux/l33"
|
||||
L32 = ROOT / "Saved/Linux/l32"
|
||||
FIXTURE = OUT / "fixtures/sw-upper-tunnel-network-style0.json"
|
||||
BINARIES = {
|
||||
"clang": OUT / "bin/VoxelForgeCoreHeadless-clang-l33-final",
|
||||
"gcc": OUT / "bin/VoxelForgeCoreHeadless-gcc-l33-final",
|
||||
}
|
||||
HASH_PATTERN = re.compile(
|
||||
r"^\[Pipeline(?:FullDetailHash|WholeViewHash|LODHash|ExactQueryHash)\].*$", re.M)
|
||||
LAYOUT_PATTERN = re.compile(
|
||||
r"^\[ResolvedLayoutSnapshot\] schema=\d+ stable_identity=([^ ]+) strata=\d+ bytes=\d+ round_trip=PASS$",
|
||||
re.M)
|
||||
PLAN_PATTERN = re.compile(
|
||||
r"^\[WorldAssemblerPlanSerialization\].*canonical_round_trip=true .*"
|
||||
r"plan_hash=([0-9a-f]+) manifest_hash=([0-9a-f]+) status=PASS$", re.M)
|
||||
ROUTE_PATTERN = re.compile(
|
||||
r"^\[WorldAssemblerRouteAccepted\] arrival_xy_m=\([^)]*\) "
|
||||
r"departure_xy_m=\([^)]*\) endpoint_proximity_cost=\d+ average_grade_q16=\d+$", re.M)
|
||||
rows = []
|
||||
failed = False
|
||||
owner_reference = {}
|
||||
fixture_reference = None
|
||||
|
||||
|
||||
def run(command, logfile):
|
||||
started = time.monotonic()
|
||||
try:
|
||||
with logfile.open("w", encoding="utf-8") as stream:
|
||||
result = subprocess.run(command, stdout=stream, stderr=subprocess.STDOUT,
|
||||
timeout=1800, check=False)
|
||||
except subprocess.TimeoutExpired:
|
||||
result = None
|
||||
return result, time.monotonic() - started, logfile.read_text(
|
||||
encoding="utf-8", errors="replace")
|
||||
|
||||
|
||||
for kind in ("l25", "crossing24"):
|
||||
for recipe in ("surface-world", "floating-islands"):
|
||||
for compiler, binary in BINARIES.items():
|
||||
for workers in (1, 8, 12):
|
||||
name = f"{kind}-{compiler}-{recipe}-w{workers}"
|
||||
logfile = OUT / f"determinism-{name}.log"
|
||||
command = [
|
||||
"taskset", "-c", "0-11", "prlimit", "--as=6442450944", "--",
|
||||
str(binary), str(ROOT / "Standalone/data/owner_world.json"),
|
||||
"--world-assembler-prototype", "--stream-benchmark", "--stream-pipeline",
|
||||
"--stream-hash", "--force-generate", "--clip-radius=3",
|
||||
"--max-clip-level=8", "--far-horizon-lod8-step=0",
|
||||
f"--workers={workers}", f"--recipe={recipe}",
|
||||
]
|
||||
if kind == "crossing24":
|
||||
command.extend(("--camera-step=24,0,0", "--region-crossing"))
|
||||
result, elapsed, text = run(command, logfile)
|
||||
hashes = HASH_PATTERN.findall(text)
|
||||
stamps = re.findall(
|
||||
r"^\[WorldAssemblerRecipeAudit\] requested=([^ ]+) actual=([^ ]+).*status=([^ ]+)$",
|
||||
text, re.M)
|
||||
ref = L32 / f"{kind}-settled-final-{compiler}-{recipe}-w{workers}.log"
|
||||
reference_hashes = HASH_PATTERN.findall(ref.read_text(
|
||||
encoding="utf-8", errors="replace")) if ref.exists() else []
|
||||
stable_key = (kind, recipe)
|
||||
stable = stable_key not in owner_reference or hashes == owner_reference[stable_key]
|
||||
if stable_key not in owner_reference and hashes:
|
||||
owner_reference[stable_key] = hashes
|
||||
equal_l32 = len(hashes) == 12 and hashes == reference_hashes
|
||||
ok = (result is not None and result.returncode == 0
|
||||
and stamps == [(recipe, recipe, "PASS")]
|
||||
and "hash=on" in text and len(hashes) == 12 and stable and equal_l32)
|
||||
rows.append((kind, recipe, compiler, workers, elapsed,
|
||||
result.returncode if result else "TIMEOUT", ok))
|
||||
print(f"{name} elapsed={elapsed:.1f}s hashes={len(hashes)}/12 "
|
||||
f"same_across_matrix={'yes' if stable else 'no'} "
|
||||
f"same_as_l32={'yes' if equal_l32 else 'no'} {'PASS' if ok else 'FAIL'}",
|
||||
flush=True)
|
||||
failed |= not ok
|
||||
|
||||
|
||||
for compiler, binary in BINARIES.items():
|
||||
for workers in (1, 8, 12):
|
||||
name = f"upper-fixture-{compiler}-w{workers}"
|
||||
logfile = OUT / f"determinism-{name}.log"
|
||||
command = [
|
||||
"taskset", "-c", "0-11", "prlimit", "--as=6442450944", "--",
|
||||
str(binary), str(FIXTURE), "--workers=" + str(workers),
|
||||
"--world-assembler-prototype", "--stream-benchmark", "--stream-pipeline",
|
||||
"--force-generate", "--clip-radius=3", "--max-clip-level=8",
|
||||
"--max-level=-1", "--recipe=floating-islands", "--audit-resolved-layout-passages",
|
||||
]
|
||||
result, elapsed, text = run(command, logfile)
|
||||
layouts = LAYOUT_PATTERN.findall(text)
|
||||
plans = PLAN_PATTERN.findall(text)
|
||||
routes = ROUTE_PATTERN.findall(text)
|
||||
stamps = re.findall(
|
||||
r"^\[WorldAssemblerRecipeAudit\] requested=([^ ]+) actual=([^ ]+).*status=([^ ]+)$",
|
||||
text, re.M)
|
||||
passage_summary = re.search(r"^\[ResolvedPassageAuditSummary\].*status=PASS$", text, re.M)
|
||||
signature = (tuple(layouts), tuple(plans), tuple(routes))
|
||||
stable = fixture_reference is None or signature == fixture_reference
|
||||
if fixture_reference is None and layouts and plans and routes:
|
||||
fixture_reference = signature
|
||||
ok = (result is not None and result.returncode == 0 and len(layouts) == 1
|
||||
and len(plans) == 1 and len(routes) == 1
|
||||
and stamps == [("floating-islands", "floating-islands", "PASS")]
|
||||
and passage_summary is not None and stable)
|
||||
rows.append(("upper-fixture", "floating-islands", compiler, workers, elapsed,
|
||||
result.returncode if result else "TIMEOUT", ok))
|
||||
print(f"{name} elapsed={elapsed:.1f}s layout={layouts[0] if layouts else 'MISSING'} "
|
||||
f"stable_across_matrix={'yes' if stable else 'no'} {'PASS' if ok else 'FAIL'}",
|
||||
flush=True)
|
||||
failed |= not ok
|
||||
|
||||
|
||||
summary = OUT / "determinism-l33.csv"
|
||||
summary.write_text(
|
||||
"kind,recipe,compiler,workers,elapsed_seconds,exit_code,status\n" +
|
||||
"".join(f"{kind},{recipe},{compiler},{workers},{elapsed:.3f},{code},"
|
||||
f"{'PASS' if ok else 'FAIL'}\n"
|
||||
for kind, recipe, compiler, workers, elapsed, code, ok in rows),
|
||||
encoding="utf-8")
|
||||
print(f"[L33Determinism] runs={len(rows)} pass={sum(row[-1] for row in rows)} "
|
||||
f"fail={sum(not row[-1] for row in rows)} summary={summary}", flush=True)
|
||||
raise SystemExit(1 if failed or len(rows) != 30 else 0)
|
||||
@@ -0,0 +1,81 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Run L33 route/proof and transition invariants with recipe-stamped logs."""
|
||||
import re
|
||||
import subprocess
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[4]
|
||||
OUT = ROOT / "Saved/Linux/l33"
|
||||
BINARIES = {
|
||||
"clang": OUT / "bin/VoxelForgeCoreHeadless-clang-l33-final",
|
||||
"gcc": OUT / "bin/VoxelForgeCoreHeadless-gcc-l33-final",
|
||||
}
|
||||
rows = []
|
||||
failed = False
|
||||
|
||||
|
||||
def run(name, binary, data, recipe, extra, checks):
|
||||
global failed
|
||||
logfile = OUT / f"{name}.log"
|
||||
command = [
|
||||
"taskset", "-c", "0-11", "prlimit", "--as=6442450944", "--",
|
||||
str(binary), str(data), "--workers=12", "--world-assembler-prototype",
|
||||
"--stream-benchmark", "--stream-pipeline", "--force-generate", "--clip-radius=3",
|
||||
"--max-clip-level=8", "--max-level=-1", f"--recipe={recipe}", *extra,
|
||||
]
|
||||
started = time.monotonic()
|
||||
try:
|
||||
with logfile.open("w", encoding="utf-8") as stream:
|
||||
result = subprocess.run(command, stdout=stream, stderr=subprocess.STDOUT,
|
||||
timeout=900, check=False)
|
||||
except subprocess.TimeoutExpired:
|
||||
result = None
|
||||
elapsed = time.monotonic() - started
|
||||
text = logfile.read_text(encoding="utf-8", errors="replace")
|
||||
stamps = re.findall(
|
||||
r"^\[WorldAssemblerRecipeAudit\] requested=([^ ]+) actual=([^ ]+).*status=([^ ]+)$",
|
||||
text, re.M)
|
||||
stamp_ok = stamps == [(recipe, recipe, "PASS")]
|
||||
checks_ok = all(check(text) for check in checks)
|
||||
ok = result is not None and result.returncode == 0 and stamp_ok and checks_ok
|
||||
rows.append((name, recipe, elapsed, result.returncode if result else "TIMEOUT", ok))
|
||||
print(f"{name} elapsed={elapsed:.1f}s recipe={stamps[0][1] if stamps else 'MISSING'} "
|
||||
f"stamp={'PASS' if stamp_ok else 'FAIL'} checks={'PASS' if checks_ok else 'FAIL'} "
|
||||
f"{'PASS' if ok else 'FAIL'}", flush=True)
|
||||
failed |= not ok
|
||||
|
||||
|
||||
owner = ROOT / "Standalone/data/owner_world.json"
|
||||
for recipe in ("surface-world", "floating-islands"):
|
||||
for compiler, binary in BINARIES.items():
|
||||
name = f"invariant-route-proof-{recipe}-{compiler}"
|
||||
run(name, binary, owner, recipe,
|
||||
["--stream-hash", "--audit-uniform-block-proofs", "--audit-route-parity"],
|
||||
[lambda text: bool(re.search(
|
||||
r"^\[RouteParityAudit\].*status=PASS$", text, re.M)),
|
||||
lambda text: bool(re.search(
|
||||
r"^\[UniformBlockProofAudit\].*violations=0(?:\s|$)", text, re.M))])
|
||||
|
||||
for recipe in ("surface-world", "floating-islands"):
|
||||
for compiler, binary in BINARIES.items():
|
||||
for mode in ("hard", "gradient", "interleaved"):
|
||||
name = f"invariant-transition-{recipe}-{mode}-{compiler}"
|
||||
run(name, binary, owner, recipe,
|
||||
[f"--transition-mode={mode}", "--audit-strate-transitions"],
|
||||
[lambda text: bool(re.search(
|
||||
r"^\[StrateTransitionAuditSummary\].*hole_columns=0 air_samples=0 .*status=PASS$",
|
||||
text, re.M)),
|
||||
lambda text: bool(re.search(
|
||||
r"^\[StrateTransitionNegativeControls\].*status=PASS$", text, re.M))])
|
||||
|
||||
summary = OUT / "invariant-audits.csv"
|
||||
summary.write_text(
|
||||
"run,recipe,elapsed_seconds,exit_code,status\n" +
|
||||
"".join(f"{name},{recipe},{elapsed:.3f},{code},{'PASS' if ok else 'FAIL'}\n"
|
||||
for name, recipe, elapsed, code, ok in rows),
|
||||
encoding="utf-8")
|
||||
print(f"[L33InvariantAudits] runs={len(rows)} pass={sum(row[-1] for row in rows)} "
|
||||
f"fail={sum(not row[-1] for row in rows)} summary={summary}", flush=True)
|
||||
raise SystemExit(1 if failed or len(rows) != 16 else 0)
|
||||
@@ -0,0 +1,78 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Recipe-stamped resolved-passage audits for the L33 upper-SurfaceWorld stack."""
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[4]
|
||||
OUT = ROOT / "Saved/Linux/l33"
|
||||
TAG = os.environ.get("VOXELFORGE_L33_AUDIT_TAG", "clang").strip() or "clang"
|
||||
BINARY = Path(os.environ.get("VOXELFORGE_L33_AUDIT_BINARY",
|
||||
str(OUT / f"bin/VoxelForgeCoreHeadless-{TAG}-l33-final")))
|
||||
ROWS = []
|
||||
FAILED = False
|
||||
|
||||
for style in range(4):
|
||||
name = f"upper-sw-three-strata-{TAG}-style{style}"
|
||||
fixture = OUT / f"fixtures/sw-upper-tunnel-network-style{style}.json"
|
||||
logfile = OUT / f"{name}.log"
|
||||
command = [
|
||||
"taskset", "-c", "0-11", "prlimit", "--as=6442450944", "--",
|
||||
str(BINARY), str(fixture), "--workers=12", "--world-assembler-prototype",
|
||||
"--stream-benchmark", "--stream-pipeline", "--force-generate",
|
||||
"--clip-radius=3", "--max-clip-level=8", "--max-level=-1",
|
||||
"--recipe=floating-islands", "--audit-resolved-layout-passages",
|
||||
]
|
||||
started = time.monotonic()
|
||||
try:
|
||||
with logfile.open("w", encoding="utf-8") as stream:
|
||||
result = subprocess.run(command, stdout=stream, stderr=subprocess.STDOUT,
|
||||
timeout=1800, check=False)
|
||||
except subprocess.TimeoutExpired:
|
||||
result = None
|
||||
elapsed = time.monotonic() - started
|
||||
text = logfile.read_text(encoding="utf-8", errors="replace")
|
||||
stamp_ok = re.findall(
|
||||
r"^\[WorldAssemblerRecipeAudit\] requested=([^ ]+) actual=([^ ]+).*status=([^ ]+)$",
|
||||
text, re.M) == [("floating-islands", "floating-islands", "PASS")]
|
||||
summary = re.search(r"^\[ResolvedPassageAuditSummary\].*$", text, re.M)
|
||||
summary_ok = bool(summary and "interfaces=2 passed=2 natural=2/2" in summary.group()
|
||||
and "route_walkable=2" in summary.group()
|
||||
and "route_binding_failures=0" in summary.group()
|
||||
and "status=PASS" in summary.group())
|
||||
markers = (
|
||||
r"^\[PassageOpenAirAuditSummary\].*violations=0.*status=PASS$",
|
||||
r"^\[PassageNoLongBridgeAudit\].*status=PASS$",
|
||||
r"^\[PassageRockColumnAuditSummary\].*wall_or_support_failures=0.*status=PASS$",
|
||||
r"^\[PassageNaturalnessSummary\].*status=PASS$",
|
||||
)
|
||||
markers_ok = all(re.search(pattern, text, re.M) for pattern in markers)
|
||||
passage_rows = re.findall(
|
||||
r"^\[ResolvedPassageAudit\].*blocked=0 support_samples=\d+ unsupported=0 "
|
||||
r"grade_failures=0 mouth_content=2/2 mouth_radius=2/2 walkability=PASS$",
|
||||
text, re.M)
|
||||
floor_rows = re.findall(r"^\[FloorProfileBlend\].*status=PASS$", text, re.M)
|
||||
route_rows = re.findall(
|
||||
r"^\[ResolvedStrateRouteAudit\].*blocked=0 support_samples=\d+ unsupported=0 "
|
||||
r"grade_failures=0 mouth_binding=PASS status=PASS$", text, re.M)
|
||||
ok = (result is not None and result.returncode == 0 and stamp_ok and summary_ok
|
||||
and markers_ok and len(passage_rows) == 2 and len(route_rows) == 2
|
||||
and len(floor_rows) >= 1 and "[Walkability] PASS" in text)
|
||||
FAILED |= not ok
|
||||
ROWS.append((style, elapsed, result.returncode if result else "TIMEOUT", ok))
|
||||
print(f"{name} elapsed={elapsed:.1f}s exit={result.returncode if result else 'TIMEOUT'} "
|
||||
f"recipe={'PASS' if stamp_ok else 'FAIL'} passages={len(passage_rows)}/2 "
|
||||
f"routes={len(route_rows)}/2 floor_blend_rows={len(floor_rows)} "
|
||||
f"{'PASS' if ok else 'FAIL'}", flush=True)
|
||||
|
||||
summary_path = OUT / f"upper-sw-three-strata-{TAG}-audits.csv"
|
||||
summary_path.write_text(
|
||||
"style,elapsed_seconds,exit_code,status\n" +
|
||||
"".join(f"{style},{elapsed:.3f},{code},{'PASS' if ok else 'FAIL'}\n"
|
||||
for style, elapsed, code, ok in ROWS), encoding="utf-8")
|
||||
print(f"[L33UpperSurfaceFixtureAudit] compiler={TAG} runs={len(ROWS)} pass={sum(row[-1] for row in ROWS)} "
|
||||
f"fail={sum(not row[-1] for row in ROWS)} summary={summary_path}", flush=True)
|
||||
raise SystemExit(1 if FAILED or len(ROWS) != 4 else 0)
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 37 KiB |
Reference in new issue
Block a user