bench(valid): a training freeze may lower the ordinary floor to the ratio; the draw takes a size

The held-out benchmark keeps the 40-commit floor and the union of twelve-commit stratified draws.
A training freeze passes floor=20 (never below the ratio) and the record carries ordinary_floor.
When the union of twelve-commit draws cannot reach the count (small cells stay unallocated on
every draw), one stratified draw of the full count is used; with count equal to the eligible
commits that is every one of them.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
Marius Ciepluch
2026-10-13 18:33:10 +02:00
co-authored by Claude Fable 5.1
parent f29b3a3df2
commit bbbb0f397e
4 changed files with 54 additions and 9 deletions
+3
View File
@@ -406,6 +406,9 @@ def test_draw_seed_proportional_cells_floor_and_thirds():
assert counts["eligible"] == 120
with pytest.raises(s.Rejected, match="ordinary_floor"):
e.draw_ordinary(rows[:39], set(), set(), seed=19)
assert len(e.draw_ordinary(rows[:39], set(), set(), seed=19, floor=20)[0]) == 12 # a training freeze may lower the floor
with pytest.raises(ValueError, match="below one draw"):
e.draw_ordinary(rows, set(), set(), seed=19, floor=11)
# Thirds come from the history's time span, not rank among eligible changes.
with pytest.raises(s.Rejected, match="time_thirds"):
e.draw_ordinary([ordinary(i) for i in range(40)] + [ordinary(10000, message="security")], set(), set(), seed=1)