From def9e24c4d4149a3977795fde4143529fb7fe982 Mon Sep 17 00:00:00 2001 From: Gahow Wang Date: Thu, 16 Jul 2026 04:02:29 +0800 Subject: [PATCH] Allow targeted SLO boundary repeats --- .../best_effort/fixed_cohort_rank.py | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/runs/frontier-multicase-sufficiency-v0/best_effort/fixed_cohort_rank.py b/runs/frontier-multicase-sufficiency-v0/best_effort/fixed_cohort_rank.py index d81db14..90bdce5 100644 --- a/runs/frontier-multicase-sufficiency-v0/best_effort/fixed_cohort_rank.py +++ b/runs/frontier-multicase-sufficiency-v0/best_effort/fixed_cohort_rank.py @@ -916,6 +916,11 @@ def _slo_has_feasible_load(config_result: dict[str, Any], *, slo_name: str) -> b def prepare_community_repeat(args: argparse.Namespace) -> Path: """Prepare a fresh-server reverse-order repeat of decision-boundary loads.""" + selected_slos = list(getattr(args, "slo", [])) or list(SLO_VARIANTS) + unknown_slos = sorted(set(selected_slos) - set(SLO_VARIANTS)) + if unknown_slos: + raise ValueError(f"unknown repeat SLOs: {unknown_slos}") + selected_configs = set(getattr(args, "config", [])) source_manifest = json.loads(args.source_manifest.read_text()) first_pass = json.loads(args.community_freeze.read_text()) if source_manifest.get("schema") != COMMUNITY_SCHEMA: @@ -960,6 +965,15 @@ def prepare_community_repeat(args: argparse.Namespace) -> Path: first_execution_order = sorted( source_manifest["configs"], key=lambda item: int(item["execution_index"]) ) + if selected_configs: + unknown_configs = sorted(selected_configs - set(source_records)) + if unknown_configs: + raise ValueError(f"unknown repeat configs: {unknown_configs}") + first_execution_order = [ + item + for item in first_execution_order + if item["config"]["name"] in selected_configs + ] records = [] selections = [] for execution_index, source_record in enumerate( @@ -968,7 +982,7 @@ def prepare_community_repeat(args: argparse.Namespace) -> Path: name = source_record["config"]["name"] excluded_unrankable_slos = [ slo_name - for slo_name in SLO_VARIANTS + for slo_name in selected_slos if not _slo_has_feasible_load( first_results[name], slo_name=slo_name ) @@ -981,7 +995,7 @@ def prepare_community_repeat(args: argparse.Namespace) -> Path: first_results[name], slo_name=slo_name ) ) - for slo_name in SLO_VARIANTS + for slo_name in selected_slos } boundary_rates = sorted( { @@ -1064,6 +1078,8 @@ def prepare_community_repeat(args: argparse.Namespace) -> Path: "execution_contract": { "schema": REPEAT_SELECTION_SCHEMA, "selection": "all_adjacent_pre_registered_slo_feasibility_transitions_plus_between_rate_refinement", + "selected_slos": selected_slos, + "selected_configs": sorted(selected_configs) if selected_configs else "all", "unrankable_slo_policy": "exclude_per_config_surfaces_with_no_feasible_load", "fallback_when_no_transition": "top_two_if_all_feasible_else_bottom_two", "config_order": "reverse_of_first_pass", @@ -2145,6 +2161,8 @@ def parse_args() -> argparse.Namespace: repeat.add_argument("--protocol-manifest", type=Path) repeat.add_argument("--frontier-freeze", type=Path) repeat.add_argument("--output-root", type=Path, required=True) + repeat.add_argument("--slo", action="append", default=[]) + repeat.add_argument("--config", action="append", default=[]) compare_parser = subparsers.add_parser("compare") compare_parser.add_argument("--frontier-freeze", type=Path, required=True)