#!/usr/bin/env python3 """Static checks for the frozen same-path C1 registry.""" import json from pathlib import Path import sys ROOT = Path(__file__).resolve().parents[1] sys.path.insert(0, str(ROOT / "experiments")) from contrastive_bias_c1 import CONDITIONS, SEEDS, jobs, registry_sha256 def main(): rows = jobs("/frozen/author/python") assert len(rows) == 20 assert {row["seed"] for row in rows} == set(SEEDS) assert {row["condition"] for row in rows} == {row[0] for row in CONDITIONS} for seed in SEEDS: seed_rows = [row for row in rows if row["seed"] == seed] assert [row["condition"] for row in seed_rows] == [ row[0] for row in CONDITIONS] for row in rows: command = row["command"] assert command[command.index("--seeds") + 1] == str(row["seed"]) assert command[command.index("--num-epochs") + 1] == "130" assert command[command.index("--test-policy") + 1] == "none" assert command[command.index("--dp-bias-ratio") + 1] == "4.0" assert command[command.index("--dp-bias-kind") + 1] == row["kind"] assert command[command.index("--dp-bias-rule") + 1] == row["rule"] print(json.dumps({ "status": "passed", "num_cells": len(rows), "seeds": list(SEEDS), "registry_sha256": registry_sha256(rows), }, indent=2, sort_keys=True)) if __name__ == "__main__": main()