fn all_invariants_failed( failures: &BTreeSet<ReplayFailure>, invariant_fns: &[(&Function, bool)], ) -> bool