Coverage for cafl4ds/filters/accept_all.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.15.0, created at 2026-07-17 14:39 +0000

1"""The B-floor filter: accept every batch, no replay, raw stream order. 

2 

3This is the *only* knob in Phase 0. It is the honest lower bound of the streaming loop — the 

4model sees the correlated stream exactly as it arrives, with no selection intervention — and 

5the reference every later filter is measured against. 

6""" 

7 

8from __future__ import annotations 

9 

10import torch 

11 

12from cafl4ds.data.streams import StreamBatch 

13from cafl4ds.filters.base import Filter, FilterContext 

14 

15 

16class AcceptAll(Filter): 

17 """B-floor: accepts the entire incoming batch unchanged.""" 

18 

19 def select(self, batch: StreamBatch, ctx: FilterContext) -> torch.Tensor: 

20 """Return every image in ``batch`` (no selection). 

21 

22 Args: 

23 batch: The incoming label-free stream batch. 

24 ctx: Unused (B-floor consults neither the model nor any health state). 

25 

26 Returns: 

27 The batch's images unchanged. 

28 """ 

29 del ctx # B-floor is model-agnostic. 

30 return batch.images