|
21 | 21 | from check_native_cpp_versions import FILES, check as check_native_versions |
22 | 22 | from check_aggregate_cpp_versions import clean |
23 | 23 | from prepare_settlement_cpp_abi_base import ( |
24 | | - V14_COMMIT, V14_TREE, authenticate_headers, extract_tar, |
| 24 | + V14_COMMIT, V14_TREE, V15_FROZEN_COMMIT, V15_FROZEN_TREE, |
| 25 | + authenticate_headers, extract_tar, |
25 | 26 | ) |
26 | 27 |
|
27 | 28 | ROOT = Path(__file__).resolve().parents[1] |
|
44 | 45 |
|
45 | 46 | V14_HEADERS_SHA256 = "37e9340e0a985db118006e7e3b265e0191445285ce5e8fd8fc77f1578275e28e" |
46 | 47 | V14_ENGINE_EPOCH = "engine_script_run_v14" |
| 48 | +V15_FROZEN_HEADERS_SHA256 = "189a0e99ff60f7c9284243117fe501ebf9a9fb6269c787dad35957d0ca7a6ed3" |
| 49 | +V15_FROZEN_ENGINE_EPOCH = "engine_script_run_v15" |
47 | 50 | CURRENT_TERMS_SURFACE_READY = True |
48 | 51 | CURRENT_RESULT_DIAGNOSTIC = "R4B_CURRENT_RESULT_ALTERNATIVES" |
49 | 52 |
|
@@ -292,30 +295,47 @@ def control_applicability(ready: bool | None = None) -> list[dict]: |
292 | 295 | "CURRENT_EXECUTION_V15_CALLER", "engine_script_run_v15"), |
293 | 296 | ("v15_native_fx_curve_surface_compile", "compile", ready, |
294 | 297 | "NATIVE_FX_CURVE_CALLER", "engine_script_run_v15"), |
| 298 | + ("v15_frozen_current_execution_surface_compile", "compile", ready, |
| 299 | + "CURRENT_EXECUTION_V15_CALLER", V15_FROZEN_ENGINE_EPOCH), |
| 300 | + ("v15_frozen_native_fx_curve_surface_compile", "compile", ready, |
| 301 | + "NATIVE_FX_CURVE_CALLER", V15_FROZEN_ENGINE_EPOCH), |
295 | 302 | ) |
296 | 303 | return [{"name": name, "kind": kind, "applicable": bool(applicable), |
297 | 304 | "status": "required" if applicable else "pending_surface", |
298 | 305 | "template": template, "provider_epoch": epoch} |
299 | 306 | for name, kind, applicable, template, epoch in controls] |
300 | 307 |
|
301 | 308 |
|
302 | | -def authenticate_v14_fixture(fixture: Path, destination: Path) -> dict: |
303 | | - """Authenticate the pinned tar closure independently of gzip-JSON fixtures.""" |
| 309 | +def authenticate_host_fixture(fixture: Path, destination: Path, *, archive_sha256: str, |
| 310 | + commit: str, tree: str, epoch: str, label: str) -> dict: |
| 311 | + """Authenticate a pinned host tar closure independently of gzip-JSON fixtures.""" |
304 | 312 | archive = (fixture / "headers.tar").read_bytes() |
305 | | - if sha256(archive) != V14_HEADERS_SHA256: |
306 | | - raise RuntimeError("frozen v14 header archive digest mismatch") |
| 313 | + if sha256(archive) != archive_sha256: |
| 314 | + raise RuntimeError("frozen " + label + " header archive digest mismatch") |
307 | 315 | extract_tar(archive, destination) |
308 | | - manifest = authenticate_headers(destination, fixture / "manifest.json", |
309 | | - commit=V14_COMMIT, tree=V14_TREE) |
| 316 | + manifest = authenticate_headers(destination, fixture / "manifest.json", commit=commit, tree=tree) |
310 | 317 | for name in ("engine.hpp", "native_host.hpp"): |
311 | 318 | text = (destination / "include/pineforge" / name).read_text() |
312 | 319 | epochs = set(re.findall(r"\binline\s+namespace\s+(engine_script_run_v\d+)\s*\{", |
313 | 320 | clean(text))) |
314 | | - if epochs != {V14_ENGINE_EPOCH}: |
315 | | - raise RuntimeError("frozen v14 header owner mismatch: " + name) |
| 321 | + if epochs != {epoch}: |
| 322 | + raise RuntimeError("frozen " + label + " header owner mismatch: " + name) |
316 | 323 | return manifest |
317 | 324 |
|
318 | 325 |
|
| 326 | +def authenticate_v14_fixture(fixture: Path, destination: Path) -> dict: |
| 327 | + return authenticate_host_fixture( |
| 328 | + fixture, destination, archive_sha256=V14_HEADERS_SHA256, |
| 329 | + commit=V14_COMMIT, tree=V14_TREE, epoch=V14_ENGINE_EPOCH, label="v14") |
| 330 | + |
| 331 | + |
| 332 | +def authenticate_v15_frozen_fixture(fixture: Path, destination: Path) -> dict: |
| 333 | + return authenticate_host_fixture( |
| 334 | + fixture, destination, archive_sha256=V15_FROZEN_HEADERS_SHA256, |
| 335 | + commit=V15_FROZEN_COMMIT, tree=V15_FROZEN_TREE, |
| 336 | + epoch=V15_FROZEN_ENGINE_EPOCH, label="v15") |
| 337 | + |
| 338 | + |
319 | 339 | def remove_current_result_cancelled(text: str) -> str: |
320 | 340 | """Remove just the appended result alternative; reject ambiguous mutations.""" |
321 | 341 | aliases = list(re.finditer( |
@@ -660,6 +680,19 @@ def main() -> int: |
660 | 680 | "manifest_sha256": sha256((FIXTURE / v14_name / "manifest.json").read_bytes()), |
661 | 681 | "files": v14_manifest["files"], "provider_epoch": V14_ENGINE_EPOCH, |
662 | 682 | } |
| 683 | + v15_frozen_name = "host-e7cdf05" |
| 684 | + v15_frozen_destination = root / v15_frozen_name |
| 685 | + v15_frozen_manifest = authenticate_v15_frozen_fixture( |
| 686 | + FIXTURE / v15_frozen_name, v15_frozen_destination) |
| 687 | + v15_frozen_include = v15_frozen_destination / "include" |
| 688 | + receipt["fixtures"][v15_frozen_name] = { |
| 689 | + "source_commit": v15_frozen_manifest["commit"], |
| 690 | + "source_tree": v15_frozen_manifest["tree"], |
| 691 | + "archive_sha256": V15_FROZEN_HEADERS_SHA256, |
| 692 | + "manifest_sha256": sha256((FIXTURE / v15_frozen_name / "manifest.json").read_bytes()), |
| 693 | + "files": v15_frozen_manifest["files"], |
| 694 | + "provider_epoch": V15_FROZEN_ENGINE_EPOCH, |
| 695 | + } |
663 | 696 |
|
664 | 697 | def compile_object(name, source, include_path, extra_source_dir=None): |
665 | 698 | path = root / (name + ".cpp") |
@@ -778,6 +811,10 @@ def link(name, objects, runtime, missing=None): |
778 | 811 | CURRENT_EXECUTION_V15_CALLER, include) |
779 | 812 | current_fx_curve = compile_object("v15_native_fx_curve_surface_compile", |
780 | 813 | NATIVE_FX_CURVE_CALLER, include) |
| 814 | + compile_object("v15_frozen_current_execution_surface_compile", |
| 815 | + CURRENT_EXECUTION_V15_CALLER, v15_frozen_include) |
| 816 | + compile_object("v15_frozen_native_fx_curve_surface_compile", |
| 817 | + NATIVE_FX_CURVE_CALLER, v15_frozen_include) |
781 | 818 | # The unmodified V15 probe above must compile before this mutation is meaningful. |
782 | 819 | mutated_include = root / "missing-cancelled-include" |
783 | 820 | shutil.copytree(include, mutated_include) |
|
0 commit comments