Skip to main content

repair_log

Function repair_log 

Source
pub fn repair_log(log: &mut ObservationLog) -> (usize, usize)
Expand description

Pull out-of-domain cells in a stored log back inside their coordinate’s range, and drop the rows that cannot be repaired. Returns (cells clamped, observations dropped).

The other half of the sentinel fix, and the half that is not optional. A gate that stops the next bad row does nothing about the ones already on disk: six cells of exactly 1e30 sat in the raw φ of fifty stored observations, and every fit after this load would have re-read them, re-fit the standardizer on them and re-poisoned the posterior — the fault would have looked fixed while the profile stayed broken.

Repaired by name, never positionally. Every observation carries its own coordinate names (ObservationLog’s whole design), and only the seven in [StructFeatures::UNIT_NAMES] have a bound this can enforce: the counts are unbounded above and the audio descriptors live on axes whose range depends on the stimulus, so for those the only defensible check is finiteness. A row with a non-finite cell anywhere is dropped rather than patched, because there is no value to clamp it to that is not an invention.

Idempotent, and a no-op on a clean log — which every log written after this ships will be.