From 65c0386e8a46f6e6d308b9351653418c7532eb26 Mon Sep 17 00:00:00 2001 From: YurenHao0426 Date: Thu, 6 Aug 2026 12:51:23 -0500 Subject: experiment: freeze same-path bias confirmation --- experiments/contrastive_bias_c1_smoke.py | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 experiments/contrastive_bias_c1_smoke.py (limited to 'experiments/contrastive_bias_c1_smoke.py') diff --git a/experiments/contrastive_bias_c1_smoke.py b/experiments/contrastive_bias_c1_smoke.py new file mode 100644 index 0000000..eb66934 --- /dev/null +++ b/experiments/contrastive_bias_c1_smoke.py @@ -0,0 +1,37 @@ +#!/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() -- cgit v1.2.3