2 """Shared benchmark package validation for performance evidence. 4 Packages counted, diagnosis-only, and excluded evidence together with explicit 5 boundary records for downstream publication consumers. 8 python benchmarks/density_matrix/performance_evidence/benchmark_bundle_validation.py 11 from __future__
import annotations
15 from pathlib
import Path
17 REPO_ROOT = Path(__file__).resolve().parents[3]
18 if str(REPO_ROOT)
not in sys.path:
19 sys.path.insert(0, str(REPO_ROOT))
21 from benchmarks.density_matrix.performance_evidence.bundle
import (
22 build_performance_evidence_benchmark_package_payload,
24 from benchmarks.density_matrix.performance_evidence.common
import (
25 PERFORMANCE_EVIDENCE_BENCHMARK_PACKAGE_SCHEMA_VERSION,
26 build_package_software_metadata,
27 performance_evidence_output_dir,
28 write_artifact_bundle,
30 from benchmarks.density_matrix.validation_scaffold
import require_bundle_fields
32 SUITE_NAME =
"performance_evidence_benchmark_package" 33 ARTIFACT_FILENAME =
"benchmark_package_bundle.json" 35 ARTIFACT_CORE_FIELDS = (
51 "suite_name": SUITE_NAME,
53 if payload[
"summary"][
"total_cases"] == len(payload[
"cases"])
54 and payload[
"summary"][
"correctness_evidence_boundary_cases"] == len(payload[
"negative_cases"])
56 "schema_version": PERFORMANCE_EVIDENCE_BENCHMARK_PACKAGE_SCHEMA_VERSION,
58 "selected_candidate": payload[
"selected_candidate"],
59 "summary": dict(payload[
"summary"]),
60 "required_artifacts": list(payload[
"required_artifacts"]),
61 "cases": payload[
"cases"],
62 "negative_cases": payload[
"negative_cases"],
68 def main(argv: list[str] |
None =
None) -> int:
69 parser = argparse.ArgumentParser(description=__doc__)
73 default=DEFAULT_OUTPUT_DIR,
74 help=
"Directory to write the benchmark package bundle into.",
79 help=
"Suppress console output.",
81 args = parser.parse_args(argv)
88 "counted_supported_cases={counted_supported_cases}, diagnosis_only_cases={diagnosis_only_cases}, excluded_cases={excluded_cases}".format(
92 print(
"Wrote {}".format(output_path))
94 return 0
if bundle[
"status"] ==
"pass" else 1
97 if __name__ ==
"__main__":
98 raise SystemExit(
main())
def build_package_software_metadata()
def performance_evidence_output_dir
def build_performance_evidence_benchmark_package()
def build_performance_evidence_benchmark_package_payload()
def write_artifact_bundle
def require_bundle_fields