test: current-checkout mode for the projected-pair TG runner and assessor
run_case --current-checkout records the clean checkout (HEAD, src fingerprint, harness hashes, pinned build-capture helper) labelled current_checkout instead of requiring the frozena135252tree; receipts carry numerical_revision=None. assess --current-checkout applies the same gates to such receipts. Frozen mode is unchanged and now rejects any receipt with source_mode, so the two never cross-qualify. A missinga135252object is reported as unavailable history instead of a source diff. check_projected_pairs.py is untouched, so its pinned hash and existing receipts keep their meaning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
aceea70e5f
commit
db3d098f43
3 files changed
+101
-14
No files matched your search
@@ -64,8 +64,16 @@ def provenance(repo):
|
||||
)
|
||||
|
||||
|
||||
def verify_source(repo, revision):
|
||||
"""Exact clean harness commit, fixed production tree, and reviewed capture helper."""
|
||||
CURRENT_CAPTURE = "current checkout, not the frozen a135252 qualification"
|
||||
|
||||
|
||||
def verify_source(repo, revision, current=False):
|
||||
"""Exact clean harness commit, fixed production tree, and reviewed capture helper.
|
||||
|
||||
current=True records the clean checkout itself instead of requiring the frozen
|
||||
numerical tree; such receipts carry source_mode="current_checkout" and are only
|
||||
assessed with assess(..., current=True), never as the frozen qualification.
|
||||
"""
|
||||
import oracle
|
||||
from tests.validation.multigrid import check_projected_pairs as gate
|
||||
|
||||
@@ -77,6 +85,17 @@ def verify_source(repo, revision):
|
||||
if (Path(gate.__file__).resolve() != helper
|
||||
or hashlib.sha256(helper.read_bytes()).hexdigest() != BUILD_CAPTURE_SHA256):
|
||||
raise RuntimeError("Wrong build-capture helper")
|
||||
if current:
|
||||
result = provenance(repo)
|
||||
if result["revision"] != revision or result["dirty"]:
|
||||
raise ValueError("requires the exact expected clean checkout")
|
||||
result.update(source_mode="current_checkout", source_capture=CURRENT_CAPTURE,
|
||||
build_capture_sha256=BUILD_CAPTURE_SHA256)
|
||||
return result
|
||||
if subprocess.run(["git", "-C", str(repo), "cat-file", "-e", f"{NUMERICAL_REVISION}^{{commit}}"],
|
||||
capture_output=True).returncode:
|
||||
raise RuntimeError(f"frozen numerical revision {NUMERICAL_REVISION} is not available "
|
||||
"in this clone; the frozen qualification cannot be checked")
|
||||
if gate.preflight(repo, revision, "candidate") != NUMERICAL_REVISION:
|
||||
raise RuntimeError("Wrong production revision")
|
||||
result = provenance(repo)
|
||||
@@ -149,6 +168,8 @@ def main():
|
||||
p.add_argument("--depth", type=int, choices=[1, 2, 3], required=True)
|
||||
p.add_argument("--output", type=Path, required=True)
|
||||
p.add_argument("--explosion", choices=["constant", "projected_linear"], default="constant")
|
||||
p.add_argument("--current-checkout", action="store_true",
|
||||
help="record the clean current checkout instead of the frozen a135252 tree")
|
||||
p.add_argument("--early-pressure", action="store_true",
|
||||
help="also save 65 scalar pressure samples at t*=k*.001875, k=0..64")
|
||||
args = p.parse_args()
|
||||
@@ -161,7 +182,7 @@ def main():
|
||||
p.error("--run-gpu and exactly one explicit CUDA_VISIBLE_DEVICES are required")
|
||||
repo = args.repo.resolve()
|
||||
sys.path[:0] = [str(repo / "src"), str(repo)]
|
||||
source = verify_source(repo, args.expected_revision)
|
||||
source = verify_source(repo, args.expected_revision, current=args.current_checkout)
|
||||
runtime = runtime_source(repo)
|
||||
if args.dry_run:
|
||||
print(json.dumps(dict(source=source, runtime_source=runtime, dry_run=True)))
|
||||
@@ -182,7 +203,8 @@ def main():
|
||||
report = dict(
|
||||
schema=1,
|
||||
source=source,
|
||||
numerical_revision=NUMERICAL_REVISION,
|
||||
numerical_revision=None if args.current_checkout else NUMERICAL_REVISION,
|
||||
**({"source_mode": "current_checkout"} if args.current_checkout else {}),
|
||||
reference_harness=REFERENCE_HARNESS,
|
||||
actual_build_sidecars=[],
|
||||
runtime_identity=None,
|
||||
|
||||
Reference in new issue
Block a user