Account for failed fidelity pilot attempts

This commit is contained in:
2026-07-14 13:41:46 +08:00
parent 1f32ae217e
commit 2261818994
3 changed files with 87 additions and 10 deletions

View File

@@ -14,6 +14,7 @@ sys.path.insert(0, str(HERE))
import pilot_controller as controller # noqa: E402
import prepare_pilot as prepare # noqa: E402
from analyze_pilot import campaign_gpu_accounting # noqa: E402
@dataclass
@@ -69,6 +70,32 @@ def main() -> None:
assert row["fidelity_pilot_band"] == role
assert abs(float(row["sampling_u"]) - 0.5) < 1e-12
prior = root / "prior-state.json"
primary = root / "primary-state.json"
prior.write_text(
json.dumps(
{
"status": "failed",
"gpu_hours_total": 0.02,
"hard_cap_h20_hours": 3.5,
}
),
encoding="utf-8",
)
primary.write_text(
json.dumps(
{
"status": "complete",
"gpu_hours_total": 1.5,
"hard_cap_h20_hours": 3.5,
}
),
encoding="utf-8",
)
accounting = campaign_gpu_accounting(primary, (prior,))
assert math.isclose(accounting["aggregate_h20_hours"], 1.52)
assert all(accounting["invariants"].values())
assert len(controller.ORDER) == 6
assert set(controller.ORDER) == set(prepare.CELLS)
assert math.isclose(