From d6afdfef9fe8f0c8b7e1b0a699a8fe0b34c4d3a4 Mon Sep 17 00:00:00 2001 From: Martino Ferrari Date: Thu, 8 Oct 2026 19:47:07 +0200 Subject: [PATCH] fix: a reserved hole is addressed by the counters actually missing, not one past the frame that revealed them --- src/acquisition.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/acquisition.cpp b/src/acquisition.cpp index 860df80..0b3bbb3 100644 --- a/src/acquisition.cpp +++ b/src/acquisition.cpp @@ -797,7 +797,13 @@ void Acquisition::reserve_hole(std::uint32_t missing, const Partition& part, Hole h; h.tick_begin = tick_; h.slot_begin = store.time().produced(); - h.counter_first = last_counter_ + 1u; + // `lost` counts the packets missing *immediately before* the frame that revealed them + // (see `udps_frame_t::lost`), and the counter mark at the top of `on_data` has already + // moved `last_counter_` to that frame's own counter -- so the hole spans + // [counter - missing, counter). This read `last_counter_ + 1u`, which addressed a span + // one past the revealing frame and `missing + 1` too high: no late packet's counter could + // fall in it, so every backfill lookup missed and `backfilled` read 0 against 154 holes. + h.counter_first = last_counter_ - missing; h.packets = missing; double dt = part.base_dt;