Enforce phase-stable telemetry pilot gates
This commit is contained in:
@@ -129,6 +129,70 @@ def main() -> None:
|
||||
]
|
||||
)
|
||||
assert stable == {"0.10->0.25": ["queue"], "0.25->0.50": ["queue"]}
|
||||
load_consistency = {
|
||||
"0.10->0.25:queue": {"passes_two_regimes": True},
|
||||
"0.25->0.50:queue": {"passes_two_regimes": True},
|
||||
}
|
||||
mechanism = pilot_analysis.mechanism_gate(stable, load_consistency)
|
||||
assert mechanism["passes"] is False
|
||||
stable["0.25->0.50"].append("kv")
|
||||
load_consistency["0.25->0.50:kv"] = {"passes_two_regimes": True}
|
||||
mechanism = pilot_analysis.mechanism_gate(stable, load_consistency)
|
||||
assert mechanism["passes"] is True
|
||||
assert mechanism["passing_transitions"] == ["0.25->0.50"]
|
||||
efficacy = pilot_analysis.stable_adjacent_efficacy_features(
|
||||
[
|
||||
{
|
||||
"end_fraction": 0.1,
|
||||
"efficacy": {"telemetry_qualifying_features": ["early"]},
|
||||
},
|
||||
{
|
||||
"end_fraction": 0.25,
|
||||
"efficacy": {"telemetry_qualifying_features": ["queue"]},
|
||||
},
|
||||
{
|
||||
"end_fraction": 0.5,
|
||||
"efficacy": {"telemetry_qualifying_features": ["kv", "queue"]},
|
||||
},
|
||||
]
|
||||
)
|
||||
assert efficacy == {"0.25->0.50": ["queue"]}
|
||||
coverage = pilot_analysis.telemetry_coverage(
|
||||
[
|
||||
{"step_index": 1, "submit_mono_ns": 100_000_000},
|
||||
{"step_index": 2, "submit_mono_ns": 200_000_000},
|
||||
],
|
||||
start_ns=0,
|
||||
end_ns=300_000_000,
|
||||
)
|
||||
assert coverage == {
|
||||
"start_gap_s": 0.1,
|
||||
"end_gap_s": 0.1,
|
||||
"max_internal_gap_s": 0.1,
|
||||
}
|
||||
coverage_gate = pilot_analysis.cumulative_coverage_gate(
|
||||
[
|
||||
{
|
||||
"trial_sanity": [
|
||||
{
|
||||
"trial_id": "a",
|
||||
"admitted_fraction": 0.25,
|
||||
"completed_fraction": 0.2,
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"trial_sanity": [
|
||||
{
|
||||
"trial_id": "a",
|
||||
"admitted_fraction": 0.5,
|
||||
"completed_fraction": 0.4,
|
||||
}
|
||||
]
|
||||
},
|
||||
]
|
||||
)
|
||||
assert coverage_gate["red_flags"] == []
|
||||
print("phase-aware intervention response v2 analysis: PASS")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user