wip: opt-in landing-pad contract + Core.Liminal.Field v2 pads (L145)

Layers may publish certified arrival/departure pads; the passage planner binds endpoints and tangents to them;
no-pad layouts serialize unchanged (owner canonical hashes match v227). Pads removed the endpoint grade failures;
seeds 0-4 passed at a 45 m margin, but seed 5 still has 289 blocked passage-capsule samples ~29 m before the
departure pad, where the composed field stays solid (-0.162) inside the tube over native ground (-3.6). Ripple
audit now keeps true route distance across masked gaps (with a synthetic control).

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-11-01 12:19:30 +01:00
1 parent a45ba9bb10
commit 7d654ff861
14 files changed
+1228 -66

No files matched your search

@@ -0,0 +1,58 @@
#!/usr/bin/env python3
"""Build the 3-strata composed Core.Liminal.Field v2 fixture."""
from __future__ import annotations
import argparse
import json
import os
from pathlib import Path
ROOT = Path(__file__).resolve().parents[4]
OWNER = Path(os.environ.get("VOXELFORGE_OWNER_DATA",
ROOT / "Standalone/data/owner_world.json"))
OUT_DEFAULT = Path(os.environ.get("VOXELFORGE_VERIFY_OUT", ROOT / "Saved/Linux/l145"))
def main() -> None:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--out", type=Path, default=OUT_DEFAULT / "fixtures")
args = parser.parse_args()
args.out.mkdir(parents=True, exist_ok=True)
world = json.loads(OWNER.read_text(encoding="utf-8"))
if len(world.get("strates", [])) < 3:
raise SystemExit("owner fixture needs at least three authored strate slots")
world["strates"] = world["strates"][:3]
world["total_strates"] = 3
world["settings_asset"]["TotalStrates"] = 3
world["settings_asset"]["FixedStrates"] = world["settings_asset"]["FixedStrates"][:3]
# Keep the resolved arrival near the departure depth. The owner's 5000-unit
# reach clamps to liminal bedrock on most seeds and leaves no field floor.
world["strates"][0]["passage_config"]["ReachMin"] = 1536
world["strates"][0]["passage_config"]["ReachMax"] = 1792
world["surface_profile_override"] = {
"version": 1,
"kind": "flatField",
"minimum_arena_clearance_m": 0.0,
}
middle = world["strates"][1]
middle["asset"]["GeneratorType"] = 4 # ECaveGeneratorType::SurfaceWorld
middle["asset"]["StrateName"] = "Liminal Field"
# Keep the departure mouth 24–32 m above liminal bedrock so every variant
# has room for its floor, road landing and support footings.
middle["passage_config"]["ReachMin"] = 192
middle["passage_config"]["ReachMax"] = 256
world["core_liminal_field"] = {
"version": 2,
"strate_index": int(middle["index"]),
"variant_policy": "seed_modulo_4",
}
output = args.out / "core-liminal-field-3-strata.json"
output.write_text(json.dumps(world, separators=(",", ":")) + "\n", encoding="utf-8")
print(f"[L145Fixture] path={output} strates=SurfaceWorld,Core.Liminal.Field,TunnelNetwork status=PASS")
if __name__ == "__main__":
main()
@@ -0,0 +1,243 @@
#!/usr/bin/env python3
"""Capture one arrival-mouth eye view per Core.Liminal.Field v2 variant."""
from __future__ import annotations
import hashlib
import json
import math
import os
from pathlib import Path
import subprocess
import sys
import time
ROOT = Path(__file__).resolve().parents[4]
HERE = Path(__file__).resolve().parent
OUT = ROOT / "Saved/Linux/l145"
CAPTURES = HERE / "captures"
LIMIT = ["taskset", "-c", "0-11", "prlimit", "--as=6442450944", "--"]
Q_PER_METRE = 1024.0
sys.path.insert(0, str(ROOT / "Standalone/Tools/verify"))
from runner import bounded_run, current_stamp, first_stamp
def fmt(values) -> str:
return ",".join(f"{value:.6f}" for value in values)
def sha256(path: Path) -> str:
digest = hashlib.sha256()
with path.open("rb") as stream:
for block in iter(lambda: stream.read(1024 * 1024), b""):
digest.update(block)
return digest.hexdigest()
def run_step(name: str, command: list[object], log: Path, env: dict[str, str],
stamped: bool = False) -> str:
expected_stamp = current_stamp() if stamped else None
if stamped:
binary = Path(str(command[0]))
probe = bounded_run([str(binary), "--print-source-stamp"], timeout=15)
if probe is None or probe.returncode != 0 \
or first_stamp(probe.stdout or "") != expected_stamp:
raise RuntimeError(f"{name} refused a stale executable: {binary}")
started = time.monotonic()
log.parent.mkdir(parents=True, exist_ok=True)
with log.open("w", encoding="utf-8") as stream:
result = subprocess.run([*LIMIT, "timeout", "1740s", *map(str, command)],
cwd=ROOT, env=env, stdout=stream, stderr=subprocess.STDOUT,
timeout=1745, check=False)
output = log.read_text(encoding="utf-8", errors="replace")
elapsed = time.monotonic() - started
print(f"[L145Run] step={name} elapsed_s={elapsed:.3f} exit={result.returncode} log={log}",
flush=True)
if stamped and (first_stamp(output) != expected_stamp
or current_stamp() != expected_stamp):
raise RuntimeError(f"{name} source stamp mismatch; see {log}")
if result.returncode != 0:
raise RuntimeError(f"{name} exit={result.returncode}; see {log}")
return output
def camera_angles(camera, target):
dx, dy, dz = (target[i] - camera[i] for i in range(3))
return math.degrees(math.atan2(dx, dy)), math.degrees(
math.atan2(dz, math.hypot(dx, dy)))
def route_views(manifest_path: Path, layout_path: Path, name: str):
manifest = json.loads(manifest_path.read_text(encoding="utf-8"))
layout = json.loads(layout_path.read_text(encoding="utf-8"))
plan = next(row for row in manifest["plan"]["strates"]
if row["strate_index"] == 1 and row.get("liminal_field", {}).get("version") == 2)
points = [tuple(value / Q_PER_METRE for value in row["position_q"])
for row in plan["route"]]
first, second = points[0], points[1]
dx, dy = second[0] - first[0], second[1] - first[1]
length = math.hypot(dx, dy)
if length <= 1.0e-6:
raise RuntimeError("Core.Liminal.Field arrival tangent is degenerate")
tx, ty = dx / length, dy / length
eye_camera = (first[0] - tx * 1.5, first[1] - ty * 1.5, first[2] + 1.6)
third = points[min(2, len(points) - 1)]
dx, dy = third[0] - first[0], third[1] - first[1]
tangent_length = math.hypot(dx, dy)
tx, ty = dx / tangent_length, dy / tangent_length
dz_per_metre = (third[2] - first[2]) / tangent_length
eye_target = (first[0] + tx * 40.0, first[1] + ty * 40.0,
first[2] + dz_per_metre * 40.0 + 1.6)
middle = len(points) // 2
before, center, after = points[middle - 1], points[middle], points[middle + 1]
dx, dy = after[0] - before[0], after[1] - before[1]
length = math.hypot(dx, dy)
if length <= 1.0e-6:
raise RuntimeError("Core.Liminal.Field wide-view tangent is degenerate")
tx, ty = dx / length, dy / length
nx, ny = -ty, tx
floor = plan["liminal_field"]["floor_height_q"] / Q_PER_METRE
if name == "flatField-monolith":
monolith = next(row for row in layout.get("stamps", [])
if row.get("stable_id") == "core/liminal-field/monolith/000")
monolith_center = tuple(value / 1.0e6 for value in monolith["position_um"])
floor = monolith_center[2] - monolith["half_extents_um"][2] / 1.0e6
wide_camera = (monolith_center[0] - tx * 30.0 + nx * 18.0,
monolith_center[1] - ty * 30.0 + ny * 18.0, floor + 25.0)
wide_target = monolith_center
elif name == "periodicHills":
wide_camera = (center[0] - 20.0, center[1] - 25.0, floor + 10.0)
wide_target = (center[0] + 10.0, center[1] + 8.0, floor + 1.0)
elif name == "pillar-grid":
pillars = [row for row in layout.get("stamps", [])
if row.get("stable_id", "").startswith("core/liminal-field/pillars/")]
if not pillars:
raise RuntimeError("pillar-grid layout has no resolved grid stamps")
pairs = []
for i, first_pillar in enumerate(pillars):
for second_pillar in pillars[i + 1:]:
a = first_pillar["position_um"]
b = second_pillar["position_um"]
dx, dy = (b[0] - a[0]) / 1.0e6, (b[1] - a[1]) / 1.0e6
separation = math.hypot(dx, dy)
if 60.0 <= separation <= 90.0:
mx = (a[0] + b[0]) / 2.0e6
my = (a[1] + b[1]) / 2.0e6
pairs.append((math.hypot(mx - center[0], my - center[1]),
mx, my, dx / separation, dy / separation,
(a[2] + b[2]) / 2.0e6,
first_pillar["half_extents_um"][2] / 1.0e6))
if not pairs:
raise RuntimeError("pillar-grid has no neighboring resolved columns")
_, mx, my, tx, ty, pillar_z, half_height = min(pairs)
floor = pillar_z - half_height
nx, ny = -ty, tx
wide_camera = (center[0] - tx * 20.0 + nx * 25.0,
center[1] - ty * 20.0 + ny * 25.0, center[2] + 8.0)
wide_target = (center[0], center[1], floor + 2.0)
else:
wide_camera = (center[0] - tx * 20.0 + nx * 25.0,
center[1] - ty * 20.0 + ny * 25.0, center[2] + 8.0)
wide_target = (center[0], center[1], floor + 2.0)
return {"eye": (eye_camera, eye_target), "wide": (wide_camera, wide_target)}
def capture_variant(seed: int, name: str, *, headless: Path, renderer: Path,
fixture: Path, env: dict[str, str]):
stem = f"core-liminal-{name}-seed{seed:02d}"
plan_dir = OUT / "capture-plans" / stem
plan_dir.mkdir(parents=True, exist_ok=True)
manifest = plan_dir / "manifest.json"
layout = plan_dir / "layout.json"
command = [headless, fixture, "--workers=1", f"--seed={seed}",
"--world-assembler-prototype", "--stream-benchmark", "--stream-pipeline",
"--force-generate", "--clip-radius=1", "--max-clip-level=0", "--max-level=0",
"--render-distance-chunks=0", "--camera=0,0,-540,0,0",
f"--world-assembler-manifest-output={manifest}",
f"--resolved-layout-output={layout}"]
output = run_step(f"plan-{stem}", command, OUT / "logs" / f"capture-{stem}-plan.log",
env, stamped=True)
if "[CoreLiminalFieldDraw]" not in output:
raise RuntimeError(f"{stem} plan omitted its Core liminal deck")
views = route_views(manifest, layout, name)
for view, (eye, target) in {"eye": views["eye"]}.items():
work = OUT / "captures" / f"{stem}-{view}"
work.mkdir(parents=True, exist_ok=True)
view_manifest = work / "manifest.json"
view_layout = work / "layout.json"
mesh = work / "world.vfmesh"
yaw, pitch = camera_angles(eye, target)
camera = (*eye, yaw, pitch)
view_clip_radius = (5 if view == "wide" and name in {
"flatField-monolith", "periodicHills"} else
3)
command = [headless, fixture, "--workers=12", f"--seed={seed}",
"--world-assembler-prototype", "--stream-benchmark", "--stream-pipeline",
"--force-generate", f"--clip-radius={view_clip_radius}",
"--max-clip-level=0", "--max-level=0",
"--render-distance-chunks=0", "--capture-skip-walkability",
f"--camera={fmt(camera)}", f"--mesh-export={mesh}",
f"--world-assembler-manifest-output={view_manifest}",
f"--resolved-layout-output={view_layout}"]
output = run_step(f"export-{stem}-{view}", command,
OUT / "logs" / f"capture-{stem}-{view}-export.log", env, stamped=True)
if "[CoreLiminalFieldDraw]" not in output or not mesh.is_file() \
or mesh.stat().st_size == 0:
raise RuntimeError(f"{stem}-{view} export omitted its Core liminal deck or mesh")
png = work / f"{view}.png"
image = CAPTURES / f"{stem}-{view}.jpg"
fog = {
"flatField-monolith": (30, 180, "0.66,0.73,0.77", -708.0, 46.0),
"periodicHills": (140, 850, "0.78,0.84,0.88", -720.0, 14.0),
"road-over-cloud-floor": (24, 420, "0.88,0.93,0.95", -720.0, 65.0),
"pillar-grid": (180, 1200, "0.82,0.88,0.91", -720.0, 80.0),
}[name]
fog_start, fog_end, fog_color, height_center, height_range = fog
render = [renderer, mesh, png, "--size=1600x900", "--fov-deg=72",
f"--camera-m={fmt(eye)}", f"--yaw-deg={yaw:.6f}", f"--pitch-deg={pitch:.6f}",
"--tile-skirts=on", "--shade=readable", "--headlamp=off", "--height-tint=on",
f"--height-center-m={height_center:.6f}", f"--height-range-m={height_range:.6f}",
"--light-direction=-0.42,-0.58,0.70", "--fog=on", f"--fog-start-m={fog_start}",
f"--fog-end-m={fog_end}", f"--fog-color={fog_color}"]
run_step(f"render-{stem}-{view}", render,
OUT / "logs" / f"capture-{stem}-{view}-render.log", env, stamped=True)
run_step(f"jpeg-{stem}-{view}", ["ffmpeg", "-nostdin", "-hide_banner", "-loglevel",
"error", "-y", "-i", png, "-frames:v", "1", "-q:v", "4", image],
OUT / "logs" / f"capture-{stem}-{view}-jpeg.log", env)
run_step(f"quality-{stem}-{view}", [sys.executable,
ROOT / "Standalone/Tools/verify/capture_quality.py", image],
OUT / "logs" / f"capture-{stem}-{view}-quality.log", env)
print(f"[L145Capture] variant={name} seed={seed} view={view} "
f"eye_height={'1.600m' if view == 'eye' else 'wide'} bytes={image.stat().st_size} "
f"sha256={sha256(image)} status=PASS", flush=True)
def main() -> int:
headless = ROOT / "Standalone/bin/linux/VoxelForgeCoreHeadless-l145-clang"
renderer = ROOT / "Standalone/bin/linux/VoxelForgeOffscreenCapture-l145-clang"
fixture = OUT / "fixtures/core-liminal-field-3-strata.json"
env = os.environ.copy()
env["VOXELFORGE_VERIFY_OUT"] = str(OUT)
env["VOXELFORGE_OWNER_DATA"] = str(ROOT / "Standalone/data/owner_world.json")
env["LP_NUM_THREADS"] = "12"
env["XDG_CACHE_HOME"] = str(OUT / "xdg-cache")
CAPTURES.mkdir(parents=True, exist_ok=True)
variants = ("flatField-monolith", "periodicHills",
"road-over-cloud-floor", "pillar-grid")
selected = set(os.environ.get("L145_CAPTURE_VARIANTS", "").split(","))
for seed, name in enumerate(variants):
if selected and name not in selected:
continue
capture_variant(seed, name, headless=headless, renderer=renderer,
fixture=fixture, env=env)
return 0
if __name__ == "__main__":
try:
raise SystemExit(main())
except Exception as error:
print(f"[L145Capture] status=FAIL error={error}", file=sys.stderr, flush=True)
raise SystemExit(1)
@@ -0,0 +1,51 @@
# Linux145 — Core.Liminal.Field v2 landing pads
**Result: endpoint landing pads alone did not make the liminal join solvable.** The pads bind the passage mouth to certified ground and remove grade failures in the final seed 5 probe, but the passage capsule still intersects native Surface World terrain about 29 m from the departure pad. This matches R48's warning that a pad must cover the approach and tube exclusion envelope; stop here and use a bounded joint plan.
## What changed
- Added an opt-in landing-pad record to resolved strata: stable ID, arrival/departure role, position, floor height, Q16 approach direction, clearance, support depth, and a certification bit. The passage planner validates the record and binds the endpoint and tangent to it. Empty pad lists are omitted from canonical serialization, preserving legacy owner layouts and hashes.
- Added `Core.Liminal.Field` v2 pads on the field profile: flat ground, hill/valley profile, road endpoints, and pillar-grid clearings. Its layer route connects the pads; the road uses that route as its road centerline.
- Added an uncertified-pad negative control. Corrected the ripple audit to retain each valid sample's actual route distance across masked gaps; a 5 m synthetic gap control now confirms that the measurement detects a 5.8 cm ripple and rejects the same smooth cubic control.
- Fixed the composed audit's footing placement so it counts actual structural supports. No Unreal `Source/` files changed.
## Count first: failure cause
L144's fixed-mouth route already showed both end-connector grade and capsule blockage. For the flat-field seed 0 probe, the liminal route had 222 blocked capsule samples and 7 grade failures, with no unsupported samples or structural-support failures. Pillar-grid seed 3 had 289 blocked samples and 9 grade failures. In the separate seed 5 audit, interface 1–2 had 10 blocked passage-capsule samples and the liminal route had 9 blocked samples, both with zero grade failures. These results say support alone was not the cause; the fixed endpoint geometry sometimes made the approach too steep, while other cases had occupied space at the join. [L144 report](../Linux144/REPORT.md); logs: `Saved/Linux/l144/logs/probe8-seed00.log`, `probe8-seed03.log`, `audit-seed05.log`.
The pad experiment removed the endpoint-grade part in seed 5, but not the occupied-space part:
| Probe | Passage 1–2 capsule | Grade / support | Shell | Liminal route |
|---|---:|---|---|---|
| L144 seed 5, fixed mouths | 10 blocked | 0 grade failures; 0 unsupported | not the failing gate | 9 blocked; 0 grade failures |
| L145 seed 5, 45 m ground margin | 140 blocked; 20 interior shell violations | 0 grade failures; 0 unsupported | FAIL | PASS |
| L145 seed 5, final 20 m ground margin | 289 blocked | 0 grade failures; 0 unsupported | PASS | PASS |
The final L145 Clang W1 probe (source stamp `82e3b58c…`) certified both pads. The departure pad was `(12, 0, -716.451) m`, with floor `-717.581 m`, 6 m clearance, and 2 m support depth. Yet the interface-1–2 passage reported 289/50,904 capsule samples blocked, with 0/4,040 unsupported and 0 grade failures. A blocked sample at `(-16.087, 2.915, -722.743) m` had native density `-3.629` and composed density `-0.162`; it is about 29 m from the departure pad. The sample is inside the passage tube, so the layer's field remains solid across the approach even though its pad itself is certified. The lower interface, both shell audits, both ripple audits, and the liminal walk audit passed; the final composed passage summary failed and seam audit did not run for this seed. See `Saved/Linux/l145/logs/audit-seed05-clang-w1.log`.
For the 45 m attempt, the original seed 0–4 Clang W1 probes passed their composed gates, then seed 5 failed. The seed 5 log was overwritten by the final 20 m rerun; its counts above are from that earlier run. The corrected ripple fitter also removed a false 5.99 cm reading caused by compressing masked samples: at 45 m, seed 0 measured 2.87 cm after retaining route distances. These are probe results, not timing measurements.
The third repeated seed 5 failure reaches the requested stop condition. This does not show that a full candidate-and-approach contract is impossible; it shows the tested endpoint-only pad contract is too weak. The passage planner needs to choose a candidate while checking the full capsule approach and tube against the layer field, as R48 recommends.
## Captures
One 1.6 m eye-height capture was rendered at each arrival pad. All four passed `capture_quality.py`; mesh export used `--capture-skip-walkability`, so these images show appearance and are not walkability evidence.
| Variant | Capture |
|---|---|
| Flat field + monolith | ![Flat field arrival](captures/core-liminal-flatField-monolith-seed00-eye.jpg) |
| Repeating hills | ![Hill field arrival](captures/core-liminal-periodicHills-seed01-eye.jpg) |
| Road over cloud floor | ![Road arrival](captures/core-liminal-road-over-cloud-floor-seed02-eye.jpg) |
| Pillar grid | ![Pillar grid arrival](captures/core-liminal-pillar-grid-seed03-eye.jpg) |
## Checks
- Clang 19 headless and offscreen-capture binaries reported the final source stamp. Four arrival captures passed quality checks.
- Fast tier passed on the final source: `Saved/Linux/l145/fast/fast-summary.json` (280.8 s tier duration). The initial default-output attempt refused a stale L42 binary before tests started; rerunning into the isolated L145 output directory with the current L145 binary passed.
- Owner canonical hash checks passed: Surface World style 1 and Floating Islands style 2 each matched all 12 pinned L130-v227 rows at W1 and W12, and each recipe's W1/W12 rows matched. These exercise the no-pad owner path.
- `git diff --check` passed.
- The landing-pad composed matrix stopped at seed 5 after the repeated failure. It did not complete 8 seeds per variant (32 runs). Clang/GCC W1/W8/W12 identity for the liminal fixture was not run. Final-source seeds 0–4 were not rerun after the margin returned to 20 m. No performance timing was collected.
Changed standalone files: `Standalone/Core/include/VoxelForgeCore/VoxelForgeCore.h`, `Standalone/Core/src/ResolvedLayoutInternal.h`, `Standalone/Core/src/WorldAssemblerInternal.h`, `Standalone/Source/StreamBenchmarkHeadless.cpp`, `Standalone/Source/StreamBenchmarkPipeline.h`, and `Standalone/Source/WorldAssemblyPrototype.h`.
Remaining risk: the current pad record certifies a local landing and direction, not an approach corridor. A future joint planner must reserve/check the full capsule and tube against the layer before finalizing pad choice and passage geometry.
@@ -0,0 +1,188 @@
#!/usr/bin/env python3
"""Run L145's composed liminal audits and the worker/compiler identity matrix."""
from __future__ import annotations
import argparse
import json
import os
from pathlib import Path
import re
import subprocess
import sys
import time
ROOT = Path(__file__).resolve().parents[4]
OUT = ROOT / "Saved/Linux/l145"
FIXTURE = OUT / "fixtures/core-liminal-field-3-strata.json"
LIMIT = ["taskset", "-c", "0-11", "prlimit", "--as=6442450944", "--"]
AUDIT_FLAGS = ("--audit-resolved-layout-passages", "--audit-liminal-road-walk",
"--audit-passage-tile-seams")
VARIANTS = ("flatField-monolith", "periodicHills",
"road-over-cloud-floor", "pillar-grid")
PASSAGE_RE = re.compile(r"^\[ResolvedPassageAudit\].*walkability=PASS$", re.M)
SHELL_RE = re.compile(r"^\[PassageShellAudit\].*status=PASS$", re.M)
sys.path.insert(0, str(ROOT / "Standalone/Tools/verify"))
from runner import current_stamp, first_stamp
def parse_seeds(value: str) -> list[int]:
result: set[int] = set()
for token in value.split(","):
token = token.strip()
if not token:
continue
if "-" in token:
first, last = (int(part) for part in token.split("-", 1))
if first > last:
raise argparse.ArgumentTypeError(f"reversed seed range: {token}")
result.update(range(first, last + 1))
else:
result.add(int(token))
if not result or min(result) < 0:
raise argparse.ArgumentTypeError("seeds must be nonnegative and nonempty")
return sorted(result)
def validate_audit(output: str, seed: int, compiler: str, workers: int) -> None:
checks = {
"landing-pad negative control":
"[LandingPadNegativeControl] uncertified_rejected=true status=PASS" in output,
"passage walk audits": len(PASSAGE_RE.findall(output)) == 2,
"passage shell audits": len(SHELL_RE.findall(output)) == 2,
"passage ripple audits": len(re.findall(
r"^\[PassageRippleAudit\].*status=PASS$", output, re.M)) == 2,
"masked ripple sampling controls": len(re.findall(
r"^\[PassageRippleSamplingControl\].*status=PASS$", output, re.M)) == 2,
"passage shell summary": bool(re.search(
r"^\[PassageShellAuditSummary\].*status=PASS$", output, re.M)),
"liminal walk audit": bool(re.search(
r"^\[LiminalLayerWalkAudit\].*status=PASS$", output, re.M)),
"liminal negative control":
"[LiminalLayerNegativeControl] altered_departure_rejected=true status=PASS" in output,
"passage summary": bool(re.search(
r"^\[ResolvedPassageAuditSummary\].*status=PASS$", output, re.M)),
"seam audit": bool(re.search(
r"^\[PassageTileSeamAudit\].*status=PASS$", output, re.M)),
}
failed = [name for name, passed in checks.items() if not passed]
if failed:
raise RuntimeError(
f"seed={seed} compiler={compiler} workers={workers} failed checks: "
+ ", ".join(failed))
def run_audit(seed: int, compiler: str, workers: int, *, audit: bool = True) -> dict:
binary = ROOT / f"Standalone/bin/linux/VoxelForgeCoreHeadless-l145-{compiler}"
if not binary.is_file():
raise RuntimeError(f"missing binary: {binary}")
expected_stamp = current_stamp()
probe = subprocess.run([str(binary), "--print-source-stamp"], cwd=ROOT,
capture_output=True, text=True, timeout=15, check=False)
if probe.returncode != 0 or first_stamp(probe.stdout) != expected_stamp:
raise RuntimeError(f"stale executable: {binary}")
tag = f"seed{seed:02d}-{compiler}-w{workers}"
log = OUT / "logs" / f"audit-{tag}.log"
manifest = OUT / "manifests" / f"audit-{tag}.json"
layout = OUT / "layouts" / f"audit-{tag}.json"
manifest.parent.mkdir(parents=True, exist_ok=True)
layout.parent.mkdir(parents=True, exist_ok=True)
command = [str(binary), str(FIXTURE), f"--workers={workers}",
"--world-assembler-prototype", "--stream-benchmark", "--stream-pipeline",
"--force-generate", "--clip-radius=1", "--max-clip-level=0", "--max-level=0",
"--render-distance-chunks=0", "--camera=0,0,-540,0,0", f"--seed={seed}",
f"--world-assembler-manifest-output={manifest}",
f"--resolved-layout-output={layout}"]
if audit:
command.extend(AUDIT_FLAGS)
env = os.environ.copy()
env["VOXELFORGE_VERIFY_OUT"] = str(OUT)
env["VOXELFORGE_OWNER_DATA"] = str(ROOT / "Standalone/data/owner_world.json")
env["LP_NUM_THREADS"] = "12"
env["XDG_CACHE_HOME"] = str(OUT / "xdg-cache")
started = time.monotonic()
with log.open("w", encoding="utf-8") as stream:
result = subprocess.run([*LIMIT, "timeout", "1740s", *command],
cwd=ROOT, env=env, stdout=stream, stderr=subprocess.STDOUT,
timeout=1745, check=False)
output = log.read_text(encoding="utf-8", errors="replace")
if result.returncode != 0:
raise RuntimeError(f"{tag} exit={result.returncode}; see {log}")
if first_stamp(output) != expected_stamp or current_stamp() != expected_stamp:
raise RuntimeError(f"{tag} source stamp changed during run; see {log}")
if audit:
validate_audit(output, seed, compiler, workers)
if not manifest.is_file() or not layout.is_file():
raise RuntimeError(f"{tag} omitted canonical manifest or layout")
manifest_value = json.loads(manifest.read_text(encoding="utf-8"))
layout_value = json.loads(layout.read_text(encoding="utf-8"))
identity = {
"seed": seed,
"variant": VARIANTS[seed % len(VARIANTS)],
"compiler": compiler,
"workers": workers,
"manifest_hash": manifest_value["content_hash"],
"resolved_layout_identity": layout_value["stable_identity"],
"log": str(log.relative_to(ROOT)),
"elapsed_s": round(time.monotonic() - started, 3),
"audited": audit,
}
print(f"[L145AuditRun] seed={seed} variant={identity['variant']} compiler={compiler} "
f"workers={workers} manifest={identity['manifest_hash']} "
f"layout={identity['resolved_layout_identity']} "
f"elapsed_s={identity['elapsed_s']:.3f} status=PASS", flush=True)
return identity
def main() -> int:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--seeds", default="0-31", type=parse_seeds,
help="audit seeds, e.g. 0-31 or 0,1,2,3")
parser.add_argument("--determinism", action="store_true",
help="also compare seed 0 on Clang/GCC at W1/W8/W12")
parser.add_argument("--only-determinism", action="store_true",
help="run only the Clang/GCC seed-0 W1/W8/W12 identity matrix")
args = parser.parse_args()
if not FIXTURE.is_file():
raise SystemExit(f"missing fixture: {FIXTURE}; run BuildL145Fixtures.py first")
records = []
if not args.only_determinism:
for seed in args.seeds:
records.append(run_audit(seed, "clang", 1))
if args.determinism or args.only_determinism:
matrix = [run_audit(0, compiler, workers)
for compiler in ("clang", "gcc") for workers in (1, 8, 12)]
identities = {(row["manifest_hash"], row["resolved_layout_identity"])
for row in matrix}
if len(identities) != 1:
raise RuntimeError(f"Clang/GCC W1/W8/W12 identity mismatch: {matrix}")
records.extend(matrix)
summary = {
"audit_seeds": args.seeds if not args.only_determinism else [],
"variant_counts": {
name: sum(1 for seed in args.seeds if seed % len(VARIANTS) == index)
for index, name in enumerate(VARIANTS)
} if not args.only_determinism else {},
"records": records,
"determinism_pass": bool(args.determinism or args.only_determinism),
"status": "PASS",
}
summary_path = OUT / "audit-matrix-summary.json"
summary_path.parent.mkdir(parents=True, exist_ok=True)
summary_path.write_text(json.dumps(summary, indent=2) + "\n", encoding="utf-8")
print(f"[L145AuditMatrix] records={len(records)} summary={summary_path} status=PASS",
flush=True)
return 0
if __name__ == "__main__":
try:
raise SystemExit(main())
except Exception as error:
print(f"[L145AuditMatrix] status=FAIL error={error}", file=sys.stderr, flush=True)
raise SystemExit(1)
Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB