Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion skillopt_sleep/mine.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,19 @@ def _promote_one(*, to: str, from_splits: set[str]) -> None:
# Only promote from train so hash-assigned test tasks stay untouched.
if len(real) >= 2 and not any(t.split == "val" for t in real):
_promote_one(to="val", from_splits={"train"})
if not any(t.split == "val" for t in real):
import logging
logging.warning("holdout_leaked: test task promoted to val to satisfy non-empty guarantee")
_promote_one(to="val", from_splits={"test"})
# Guarantee a train pool exists when possible; never borrow from test.
if not any(t.split == "train" for t in tasks) and len(real) >= 2:
_promote_one(to="train", from_splits={"val"})
val_count = sum(1 for t in real if t.split == "val")
if val_count > 1:
_promote_one(to="train", from_splits={"val"})
else:
import logging
logging.warning("holdout_leaked: test task promoted to train to satisfy non-empty guarantee")
_promote_one(to="train", from_splits={"test"})
return tasks


Expand Down