pub struct BatchRecord {
signature: String,
rescued: bool,
}Expand description
Names the batch LoopDetector::check just counted.
LoopDetector::record_results takes one so it cannot be handed the wrong
batch. The answers it records belong to the batch that just ran, and the
comparison at the next check is against those; passing the previous
batch’s instead would invert the measurement silently, which is a mistake
this codebase has made once already with a global id map and caught only in
review.
Consumed by record_results and deliberately not Clone: recording one
batch twice would let a second, different answer rescue a run that never
changed its answer, and no call site has a reason to do it. The type is what
stops that rather than a rule in prose.
Fields§
§signature: String§rescued: boolImplementations§
Source§impl BatchRecord
impl BatchRecord
Sourcepub const fn rescued(&self) -> bool
pub const fn rescued(&self) -> bool
Whether this occurrence survived only because an earlier answer moved.
True when the run has repeated more times than the threshold allows and
LoopDetector::check passed anyway — which is exactly the turn that
signature-only counting would have refused. Known when the verdict is
reached, not when the next answers arrive: the reset that saved this
turn happened on a previous one.