From 670b0d8a4669d939b09b4990be89173805831215 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Fri, 16 Oct 2026 20:54:00 +0800 Subject: ci(compiler): gate platform packages on reproducible compiler tests Run all three suites on Linux, macOS and Windows with the push SHA as seed. Retain failure evidence and document the 12 existing failures, pending human review and remaining coverage gaps. Co-Authored-By: Claude Fable 5.1 --- tests/check_generators.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/check_generators.py (limited to 'tests/check_generators.py') diff --git a/tests/check_generators.py b/tests/check_generators.py new file mode 100644 index 0000000..2b92789 --- /dev/null +++ b/tests/check_generators.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 +"""Require identical generated input bytes across platforms and Perl versions.""" + +import hashlib +import json +from pathlib import Path +import subprocess +import sys + + +directory = Path(__file__).resolve().parent / "ii" +vectors = json.loads((directory / "generator-vectors.json").read_text(encoding="utf-8")) +for name, digest in vectors.items(): + command = [sys.argv[1], str(directory / name / "generate.pl")] + outputs = [] + for seed in ["0" * 40, "0" * 40, "1" * 40]: + result = subprocess.run([*command, seed, "100"], check=True, stdout=subprocess.PIPE, + stderr=subprocess.PIPE, timeout=10) + if result.stderr: + raise RuntimeError(f"{name}: unexpected stderr {result.stderr!r}") + outputs.append(result.stdout) + if outputs[0] != outputs[1] or outputs[0] == outputs[2]: + raise RuntimeError(f"{name}: seed reproducibility failed") + if hashlib.sha256(outputs[0]).hexdigest() != digest: + raise RuntimeError(f"{name}: generated input differs from the portable test vector") + print(f"PASS {name}: repeatable, seed-sensitive, portable bytes") -- cgit v1.3.1-4-g156e