# One-off patch of the dataset's v1.2 shards to v1.3 (lead, 2026-11-05): prefill rows with condition "setup" dropped, as # the steering runs dropped that planted conclusion when its kind joined "It's not real". Same shards, schema and compression; # rewrites build_report.json counts. # Usage: python patch_v1_3.py import collections, glob, json, math, os, sys import pyarrow.compute as pc, pyarrow.parquet as pq H = sys.argv[1] cnt = dict(rows=0, setting=collections.Counter(), bench=collections.Counter(), mon=collections.Counter(), js=collections.Counter()) dropped = 0 for f in sorted(glob.glob(f"{H}/data/reviews-*.parquet")): pf = pq.ParquetFile(f); t = pf.read(); n0 = t.num_rows; rg = math.ceil(n0 / pf.metadata.num_row_groups) t = t.filter(pc.invert(pc.and_(pc.equal(t["setting"], "prefill"), pc.fill_null(pc.equal(t["prefill_condition"], "setup"), False)))) dropped += n0 - t.num_rows pq.write_table(t, f, compression="zstd", row_group_size=rg) cnt["rows"] += t.num_rows for k, col in (("setting", "setting"), ("bench", "benchmark"), ("mon", "monitor_model")): cnt[k].update(t[col].to_pylist()) cnt["js"].update(f"{s}/{j}" for s, j in zip(t["setting"].to_pylist(), t["judge_status"].to_pylist())) rep = json.load(open(f"{H}/build_report.json")) rep.update(rows=cnt["rows"], rows_by_setting=dict(sorted(cnt["setting"].items())), rows_by_benchmark=dict(sorted(cnt["bench"].items())), rows_by_monitor=dict(sorted(cnt["mon"].items())), judge_status=dict(sorted(cnt["js"].items())), bytes=sum(os.path.getsize(f) for f in glob.glob(f"{H}/data/reviews-*.parquet")), v1_3_patch="2026-11-05: prefill condition 'setup' dropped (%d rows)" % dropped) json.dump(rep, open(f"{H}/build_report.json", "w"), indent=1, sort_keys=True) print("dropped", dropped, "rows", cnt["rows"]); print(json.dumps({k: rep[k] for k in ("rows_by_setting", "rows_by_monitor", "rows_by_benchmark")}, indent=1))