Skip to main content

Module buckets

Module buckets 

Source
Expand description

Sorted per-class buckets over a selection pool.

Implemented by plan 02-05. Sorted per-class buckets over a selection pool.

Sorted Vecs throughout, never hash-map iteration: any collection whose order reaches a hash or a manifest must have a defined order, or determinism becomes a property of the allocator (PF-006).

§What a bucket is, exactly

One entry per DECLARED class label — including labels whose pool is empty — holding the training ids of that class in ascending lexicographic order, with every id in the dataset’s ExclusionRecord removed.

Declaring the empty buckets matters. If a label with no remaining rows simply vanished from the map, selection would silently produce a manifest with fewer classes than the label map declares, and the per-class balance check would pass on it. Keeping the empty bucket turns that case into CrossSplitDuplicateUnderflow, naming the class.

§Exclusions are applied HERE, once

Cross-split duplicate content is excluded from the selection pool and recorded, never fatal at prepare time (D-18, upheld by D-27). This module is the single place that subtraction happens, so no selection path can forget it and no path can apply it twice.

Structs§

ClassBuckets
Per-class training-id pools, sorted and post-exclusion.