Skip to main content

bracket_of

Function bracket_of 

pub fn bracket_of(study: StudyId, number: TrialNumber, n_brackets: u32) -> u32
Expand description

Which Hyperband bracket a trial belongs to — deterministic, storage-free.

crc32(study ‖ trial_number) mod n_brackets, where the input is the 16 bytes of the study id followed by the trial number, each big-endian. Because it is a pure function of identifiers every worker already has, no bracket-assignment state is shared or persisted: two processes place the same trial in the same bracket by computing, not by coordinating. n_brackets <= 1 collapses to the single bracket 0.