refactor: resolved metre layout is the runtime authority (L41, migration step 3); stamp covers plugin sources; R8
UVoxelStrateManager::Initialize resolves the layout width to integer micrometres before passages or scheduling; each slot stores physical [bottom, top) bounds, transition mode/width and passage settings; chunk indices remain a floor-based compatibility projection. The Core adapter derives interiors and L29 bands from those resolved values. verify: full-tier cost baseline is HEAD (or --baseline), tier timeout 7200 s with 1800 s per process; the source stamp now includes the plugin Source tree compiled on Linux (it previously missed VoxelStrateManager.cpp and friends). Owner hashes identical to L37; fast, medium and full PASS on a clean rebuild. Unreal manager/adapter edits are uncompiled on Windows. Research R8: inventory of unit-bearing UPROPERTYs and a custom-version asset migration plan. 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
efa9e89468
commit
1abee91721
11 files changed
+662
-215
No files matched your search
@@ -10,6 +10,7 @@ import os
|
||||
from pathlib import Path
|
||||
import re
|
||||
import shutil
|
||||
import signal
|
||||
import statistics
|
||||
import struct
|
||||
import subprocess
|
||||
@@ -22,12 +23,16 @@ ROOT = Path(__file__).resolve().parents[3]
|
||||
VERIFY_DIR = ROOT / "Standalone/Tools/verify"
|
||||
LINUX37 = ROOT / "Standalone/Research/WorldAssemblerM3/Linux37"
|
||||
OWNER = ROOT / "Standalone/data/owner_world.json"
|
||||
OUT_DEFAULT = ROOT / "Saved/Linux/l39"
|
||||
OUT_DEFAULT = ROOT / "Saved/Linux/l41"
|
||||
|
||||
PARSER = argparse.ArgumentParser(description=__doc__)
|
||||
PARSER.add_argument("tier", choices=("fast", "medium", "full"))
|
||||
PARSER.add_argument("--out", type=Path, default=OUT_DEFAULT,
|
||||
help="artifact directory (default: Saved/Linux/l39)")
|
||||
help="artifact directory (default: Saved/Linux/l41)")
|
||||
PARSER.add_argument("--baseline", default="HEAD",
|
||||
help="commit used for the full-tier cost baseline (default: HEAD)")
|
||||
PARSER.add_argument("--overall-timeout", type=int, default=7200,
|
||||
help="maximum tier wall time in seconds (default: 7200; each child is capped at 1800)")
|
||||
ARGS = PARSER.parse_args()
|
||||
OUT = ARGS.out.resolve()
|
||||
os.environ["VOXELFORGE_VERIFY_OUT"] = str(OUT)
|
||||
@@ -40,9 +45,9 @@ from runner import VerificationFailure, VerificationRunner, bounded_run
|
||||
from source_stamp import source_stamp
|
||||
|
||||
|
||||
CLANG = OUT / "bin/VoxelForgeCoreHeadless-l39-clang"
|
||||
GCC = OUT / "bin/VoxelForgeCoreHeadless-l39-gcc"
|
||||
RENDERER = OUT / "bin/VoxelForgeOffscreenCapture-l39-clang"
|
||||
CLANG = OUT / "bin/VoxelForgeCoreHeadless-l41-clang"
|
||||
GCC = OUT / "bin/VoxelForgeCoreHeadless-l41-gcc"
|
||||
RENDERER = OUT / "bin/VoxelForgeOffscreenCapture-l41-clang"
|
||||
HASH_RE = re.compile(r"^\[Pipeline(?:FullDetailHash|WholeViewHash|LODHash|ExactQueryHash)\].*$", re.M)
|
||||
RECIPE_RE = re.compile(
|
||||
r"^\[WorldAssemblerRecipeAudit\] requested=([^ ]+) actual=([^ ]+).*status=([^ ]+)$", re.M)
|
||||
@@ -481,19 +486,26 @@ def run_30_cell_determinism(runner: VerificationRunner) -> None:
|
||||
runner.require("determinism-30-cell-count", count == 30, f"cells={count}/30")
|
||||
|
||||
|
||||
def prepare_l36_cost_baseline(runner: VerificationRunner) -> tuple[Path, str]:
|
||||
temp = Path("/tmp/voxelforge-l36-stamped")
|
||||
def prepare_cost_baseline(runner: VerificationRunner) -> tuple[Path, str]:
|
||||
resolved = bounded_run(["git", "rev-parse", "--verify", f"{ARGS.baseline}^{{commit}}"], timeout=120)
|
||||
if resolved is None or resolved.returncode != 0:
|
||||
raise VerificationFailure(f"could not resolve cost baseline commit {ARGS.baseline!r}")
|
||||
baseline_commit = resolved.stdout.strip()
|
||||
if not re.fullmatch(r"[0-9a-f]{40,64}", baseline_commit):
|
||||
raise VerificationFailure(f"git returned an invalid baseline commit: {baseline_commit!r}")
|
||||
temp = Path(f"/tmp/voxelforge-cost-baseline-{baseline_commit[:12]}")
|
||||
if temp.exists():
|
||||
shutil.rmtree(temp)
|
||||
temp.mkdir(parents=True)
|
||||
tarball = temp / "l36.tar"
|
||||
tarball = temp / "baseline.tar"
|
||||
archive = bounded_run(["git", "archive", "-o", str(tarball),
|
||||
"8be1c4d", "Standalone"], timeout=120)
|
||||
baseline_commit, "Standalone"], timeout=120)
|
||||
if archive is None or archive.returncode != 0 or not tarball.is_file():
|
||||
raise VerificationFailure("could not export historical L36 source commit 8be1c4d")
|
||||
raise VerificationFailure(
|
||||
f"could not export Standalone from cost baseline commit {baseline_commit}")
|
||||
extract = bounded_run(["tar", "-xf", str(tarball), "-C", str(temp)], timeout=120)
|
||||
if extract is None or extract.returncode != 0:
|
||||
raise VerificationFailure("historical L36 source extraction failed")
|
||||
raise VerificationFailure("cost baseline source extraction failed")
|
||||
tarball.unlink(missing_ok=True)
|
||||
|
||||
base = temp / "Standalone"
|
||||
@@ -508,55 +520,57 @@ def prepare_l36_cost_baseline(runner: VerificationRunner) -> tuple[Path, str]:
|
||||
"#include \"SourceStamp.h\"\n#include <cstring>\n#include \"OwnerWorldLoader.h\"", 1)
|
||||
anchor = re.search(r"int main\(int argc,\s*char\*\*\s*argv\)\s*\{", text)
|
||||
if anchor is None:
|
||||
raise VerificationFailure("cannot instrument historical L36 headless entry point")
|
||||
raise VerificationFailure("cannot instrument cost-baseline headless entry point")
|
||||
injected = ("\n VoxelForgePrintSourceStamp();\n"
|
||||
" if(argc==2&&std::strcmp(argv[1],\"--print-source-stamp\")==0)return 0;")
|
||||
text = text[:anchor.end()] + injected + text[anchor.end():]
|
||||
legacy_main.write_text(text, encoding="utf-8")
|
||||
|
||||
baseline_stamp = source_stamp(temp)
|
||||
binary = OUT / "historical-bin/VoxelForgeCoreHeadless-l36-stamped"
|
||||
baseline_variant = f"baseline-{baseline_commit[:12]}-stamped"
|
||||
binary = OUT / "historical-bin" / f"VoxelForgeCoreHeadless-{baseline_variant}"
|
||||
env = os.environ.copy()
|
||||
env["VOXELFORGE_BUILD_ROOT"] = str(temp / "build")
|
||||
env["VOXELFORGE_BIN_DIR"] = str(binary.parent)
|
||||
command = ["bash", str(base / "BuildLinux.sh"), "--compiler=clang++-19",
|
||||
"--variant=l36-stamped", "--fp-contract=off", "--jobs=12"]
|
||||
log = OUT / "cost-baseline-build-l36.log"
|
||||
f"--variant={baseline_variant}", "--fp-contract=off", "--jobs=12"]
|
||||
log = OUT / "cost-baseline-build.log"
|
||||
log.parent.mkdir(parents=True, exist_ok=True)
|
||||
started = time.monotonic()
|
||||
with log.open("w", encoding="utf-8") as stream:
|
||||
proc = bounded_run(command, timeout=1800, env=env, stdout=stream)
|
||||
elapsed = time.monotonic() - started
|
||||
runner.require("cost-baseline-l36-build",
|
||||
runner.require("cost-baseline-build",
|
||||
proc is not None and proc.returncode == 0 and binary.is_file(),
|
||||
f"source_stamp={baseline_stamp} elapsed_seconds={elapsed:.1f} log={log}")
|
||||
f"baseline={baseline_commit} source_stamp={baseline_stamp} "
|
||||
f"elapsed_seconds={elapsed:.1f} log={log}")
|
||||
runner.binary_stamp_overrides[str(binary)] = baseline_stamp
|
||||
return binary, baseline_stamp
|
||||
|
||||
|
||||
def run_cost_pairs(runner: VerificationRunner) -> None:
|
||||
baseline, baseline_stamp = prepare_l36_cost_baseline(runner)
|
||||
baseline, baseline_stamp = prepare_cost_baseline(runner)
|
||||
candidate = CLANG
|
||||
orders = (("l36", "l39"), ("l39", "l36"), ("l36", "l39"),
|
||||
("l39", "l36"), ("l36", "l39"))
|
||||
orders = (("baseline", "candidate"), ("candidate", "baseline"),
|
||||
("baseline", "candidate"), ("candidate", "baseline"),
|
||||
("baseline", "candidate"))
|
||||
by_recipe: dict[str, dict[str, list[float]]] = {
|
||||
"floating-islands": {"l36": [], "l39": []},
|
||||
"surface-world": {"l36": [], "l39": []}}
|
||||
"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)):
|
||||
for pair, order in enumerate(orders, 1):
|
||||
for build in order:
|
||||
binary = baseline if build == "l36" else candidate
|
||||
expected_style = None if build == "l36" else style
|
||||
binary = baseline if build == "baseline" else candidate
|
||||
name = f"cost-{recipe}-pair{pair}-{build}"
|
||||
expected_stamp = baseline_stamp if build == "l36" else None
|
||||
expected_stamp = baseline_stamp if build == "baseline" else None
|
||||
row, output = runner.run_cpp(name, binary, OWNER, recipe, [],
|
||||
expected_style=2 if build == "l39" else None,
|
||||
expected_strate_styles={"0": 2, "1": 1} if build == "l39" else None,
|
||||
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",
|
||||
expected_stamp=expected_stamp)
|
||||
row["requested_style"] = style
|
||||
row["expected_passage_style"] = 2 if build == "l39" else None
|
||||
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
|
||||
and "cache_hits=0" in output
|
||||
@@ -567,14 +581,14 @@ def run_cost_pairs(runner: VerificationRunner) -> None:
|
||||
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["l36"])
|
||||
new = statistics.median(values["l39"])
|
||||
paired = [((by_pair[(recipe, pair)]["l39"] - by_pair[(recipe, pair)]["l36"])
|
||||
/ by_pair[(recipe, pair)]["l36"] * 100.0)
|
||||
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["l36"]) == len(values["l39"]) == 5,
|
||||
f"median_l36_s={old:.3f} median_l39_s={new:.3f} "
|
||||
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)}")
|
||||
|
||||
@@ -598,9 +612,18 @@ def run_gcc_supplement(runner: VerificationRunner) -> None:
|
||||
run_transitions_and_invariants(runner, (GCC,))
|
||||
|
||||
|
||||
def _tier_deadline(_signum: int, _frame: object) -> None:
|
||||
raise VerificationFailure(
|
||||
f"{ARGS.tier} tier exceeded its {ARGS.overall_timeout}s overall timeout")
|
||||
|
||||
|
||||
def main() -> int:
|
||||
runner = VerificationRunner(ARGS.tier)
|
||||
started = time.monotonic()
|
||||
if ARGS.overall_timeout <= 0:
|
||||
raise VerificationFailure("--overall-timeout must be a positive number of seconds")
|
||||
signal.signal(signal.SIGALRM, _tier_deadline)
|
||||
signal.setitimer(signal.ITIMER_REAL, ARGS.overall_timeout)
|
||||
try:
|
||||
if not OWNER.is_file():
|
||||
raise VerificationFailure(f"canonical owner input is missing: {OWNER}")
|
||||
@@ -634,6 +657,8 @@ def main() -> int:
|
||||
runner.save_summary("FAIL", str(error))
|
||||
print(f"[{ARGS.tier}] DONE FAIL elapsed={elapsed:.1f}s error={error}", flush=True)
|
||||
return 1
|
||||
finally:
|
||||
signal.setitimer(signal.ITIMER_REAL, 0)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in new issue
Block a user