fix(sleep): keep train and val splits non-empty - #272
Conversation
|
@microsoft-github-policy-service agree |
|
Reviewed Local Linux/Python 3.11 verification: 34 passed, comprising the split-hardening/wiring suites and two independent all-test / val-plus-test invariant checks. I have not reproduced an additional runtime defect in this focused review. For a reproducible acceptance record, please attach the command or small script used for the reported 6,300-case invariant sweep, with its seed/count/fraction/order ranges. That is an evidence request, not a request to add a large framework or perform paid-model experiments. Preserve the documented minimum-reassignment rule, warnings identifying the affected task IDs, and the distinction between stable hash assignment and the small-batch fallback. Please keep this as one coherent solution to #271 rather than stacking overlapping split fixes. Official CI for this exact head is still |
Summary
Why
assign_splitspromised a non-empty validation gate for at least two real tasks, but an all-test hash assignment left both train and validation empty. A val-plus-test assignment had the same invariant gap: topping up train from the only validation task emptied validation.The fallback now prefers spare train or validation tasks and reaches into test only when preserving both required pools is otherwise impossible.
Fixes #271
Validation
uv run --extra dev pytest -q tests/test_split_hardening_2x3.py tests/test_split_wiring.py— 32 passed.PATH=/Users/vam/.local/bin:/usr/bin:/bin:/usr/sbin:/sbin uv run --extra dev pytest -q— 1,499 passed, 11 skipped, 353 subtests passed.uv run --extra dev ruff check skillopt_sleep/mine.py tests/test_split_hardening_2x3.py— passed.git diff --check— passed.Baseline notes
With the normal host PATH, the full suite reports one unrelated failure because the installed Pi CLI resolves to
/opt/homebrew/bin/piwhiletests/test_backend_pi.py::test_default_model_from_envexpects the literal stringpi. The same failure reproduces on pristine upstreammain; excluding the installed Pi CLI from PATH gives the clean full-suite result above. Full-repository Ruff also reports pre-existing lint findings outside these two files; both changed files are clean.