fix: sanitizer sweep across all generators; bound signed shifts/division/overflow at coordinate limits (L61); R31

New verify.py sanitize tier (Clang address,undefined,float-cast-overflow; GCC address,undefined;
-fno-sanitize-recover) runs 19 cases per compiler at LOD0-8 across every generator, passages and the
crossing: 0 runtime reports; a planted signed-overflow control is caught by both. A static scan fixed
INT_MIN negation in floor division, unbounded signed LOD shifts and coordinate-times-extent overflow in
VoxelClipmapDesiredTiles.h and VoxelTypes.h (plugin and standalone), and VoxelWorld.cpp, VoxelContentManager.cpp
and VoxelDensityVolume.cpp (plugin only, uncompiled here). Supported-input output unchanged (version 211).
fast/medium/full PASS. Research R31 (self-checked): far-LOD 4-8 cut plan.

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-26 05:19:18 +01:00
1 parent c0c204ba50
commit 135957831b
13 files changed
+760 -132

No files matched your search

+16 -4
View File
@@ -17,7 +17,13 @@ from source_stamp import source_stamp
ROOT = Path(__file__).resolve().parents[3]
OUT = Path(os.environ.get("VOXELFORGE_VERIFY_OUT", ROOT / "Saved/Linux/l39"))
LIMIT = ["taskset", "-c", "0-11", "prlimit", "--as=6442450944", "--"]
def limit_prefix() -> list[str]:
mode = os.environ.get("VOXELFORGE_LIMIT_MODE", "as")
if mode not in ("as", "rss"):
raise RuntimeError(f"unsupported process limit mode: {mode}")
return ["taskset", "-c", "0-11", "prlimit", f"--{mode}=6442450944", "--"]
RECIPE_RE = re.compile(
r"^\[WorldAssemblerRecipeAudit\] requested=([^ ]+) actual=([^ ]+).*status=([^ ]+)$",
re.M)
@@ -57,7 +63,7 @@ def bounded_run(command: list[str], *, timeout: int = 1800,
stdout: Any = subprocess.PIPE) -> subprocess.CompletedProcess[str] | None:
timeout = min(1800, max(1, int(timeout)))
try:
return subprocess.run([*LIMIT, "timeout", "--signal=KILL", f"{timeout}s",
return subprocess.run([*limit_prefix(), "timeout", "--signal=KILL", f"{timeout}s",
*map(str, command)],
cwd=cwd, env=env, stdout=stdout, stderr=subprocess.STDOUT,
text=True, encoding="utf-8", errors="replace", timeout=timeout,
@@ -147,7 +153,12 @@ class VerificationRunner:
raise RuntimeError(f"missing executable: {binary}")
digest = sha256_file(binary)
expected_stamp = expected_stamp or self.binary_stamp_overrides.get(str(binary), self.expected)
proc = bounded_run([str(binary), "--print-source-stamp"], timeout=15)
probe_env = None
if "sanitize" in binary.name.lower():
probe_env = os.environ.copy()
probe_env["ASAN_OPTIONS"] = "detect_leaks=0:abort_on_error=1:symbolize=1"
probe_env["LSAN_OPTIONS"] = "detect_leaks=0"
proc = bounded_run([str(binary), "--print-source-stamp"], timeout=15, env=probe_env)
output = proc.stdout or "" if proc is not None else ""
embedded = first_stamp(output)
if proc is None or proc.returncode != 0 or embedded is None:
@@ -202,6 +213,7 @@ class VerificationRunner:
workers: int = 12, timeout: int = 1800,
layout_path: Path | None = None,
max_level: int = -1,
clip_radius: int = 3,
expected_strate_styles: dict[str, int] | None = None,
script_inputs: list[Path] | None = None,
allow_nonzero: bool = False,
@@ -215,7 +227,7 @@ class VerificationRunner:
clean_flags = [flag for flag in flags if not flag.startswith("--resolved-layout-output=")]
command = [str(binary), str(data), f"--workers={workers}",
"--world-assembler-prototype", "--stream-benchmark", "--stream-pipeline",
"--force-generate", "--clip-radius=3", "--max-clip-level=8",
"--force-generate", f"--clip-radius={clip_radius}", "--max-clip-level=8",
f"--max-level={max_level}",
f"--recipe={recipe}", *clean_flags, f"--resolved-layout-output={layout_path}"]
log = OUT / f"{name}.log"