From da89e18ee4635c74da48a668d58c749cd1a47439 Mon Sep 17 00:00:00 2001 From: SolitaryThinker Date: Mon, 13 Jul 2026 19:20:49 -0700 Subject: [PATCH] [ci]: enforce variant-wide recipe mismatch --- fastvideo/tests/performance/compare_baseline.py | 6 +++--- .../performance/test_compare_baseline_policy.py | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/fastvideo/tests/performance/compare_baseline.py b/fastvideo/tests/performance/compare_baseline.py index 9be4709e6..e6861f8fe 100644 --- a/fastvideo/tests/performance/compare_baseline.py +++ b/fastvideo/tests/performance/compare_baseline.py @@ -219,10 +219,10 @@ def _record_uses_v2_identity(record: dict[str, Any]) -> bool: def _recipe_cohort_filters(record: dict[str, Any]) -> dict[str, str]: + identity = _comparison_identity_filters(record) return { - key: value - for key, value in _comparison_identity_filters(record).items() - if key != "recipe_fingerprint" + key: identity[key] + for key in ("workload_id", "variant_id", "benchmark_version") } diff --git a/fastvideo/tests/performance/test_compare_baseline_policy.py b/fastvideo/tests/performance/test_compare_baseline_policy.py index 8bb7a6543..19dda9cdb 100644 --- a/fastvideo/tests/performance/test_compare_baseline_policy.py +++ b/fastvideo/tests/performance/test_compare_baseline_policy.py @@ -1449,6 +1449,21 @@ def test_load_records_filters_same_variant_changed_recipe(tmp_path): assert len(mismatch_records) == 1 +def test_recipe_mismatch_cohort_spans_hardware_and_software_profiles(): + filters = compare_baseline._recipe_cohort_filters( + _v2_record( + recipe_fingerprint="recipe-2", + hardware_profile_id="hw-new", + software_profile_id="sw-new", + )) + + assert filters == { + "workload_id": "wan-t2v", + "variant_id": "1.3b-sp2", + "benchmark_version": "2", + } + + def test_legacy_record_lookup_still_uses_model_and_gpu(tmp_path): model_id = "wan-t2v-1.3b-2gpu" model_dir = tmp_path / sanitize(model_id)