feat: a repaired hole keeps a fainter band, so a report is not a false accusation

This commit is contained in:
Martino Ferrari committed 2026-10-08 23:00:22 +02:00
1 parent 4666b807fc
commit 3859d2ca79
5 files changed
+48 -11

No files matched your search

+16 -6
View File
@@ -10502,7 +10502,10 @@ gboolean color_probe(gpointer user) {
/// `bands`. The first is the state of the *data* rather than of a counter: a reservation writes
/// placeholders and a backfill repairs them, and the two counters agreeing proves only that the
/// same number of slots was written and read, not that the right ones were. The second asserts the
/// trigger never latched inside a reserved span. The third asserts the band reached the plot.
/// trigger never latched inside a reserved span. The third asserts the band reached the plot, and
/// splits it by state: a hole whose late packets have all arrived keeps its band in the fainter
/// tint, so `bands_repaired` is how a reading tells a window that is *missing* data from one that
/// merely *was*.
gboolean reseq_probe(gpointer user) {
App* a = static_cast<App*>(user);
if (a->window == nullptr) return G_SOURCE_REMOVE;
@@ -10543,22 +10546,29 @@ gboolean reseq_probe(gpointer user) {
}
}
// The shading as the plot actually holds it, read off row 0 after the frame published it. Every
// row carries the same spans, so one row is the whole answer.
// row carries the same spans, so one row is the whole answer. Split by state because the two
// mean different things: `bands` is what the window is reporting and `bands_repaired` how much
// of that report is historical, so `bands == bands_repaired` with `nan_slots=0` is a healthy
// reading and not the contradiction it would be if the band had one state.
std::size_t bands = 0;
std::size_t bands_repaired = 0;
if (a->rows->row_count() > 0 && a->rows->row(0).plot != nullptr) {
bands = a->rows->row(0).plot->invalid_spans().size();
for (const plot::InvalidSpan& span : a->rows->row(0).plot->invalid_spans()) {
++bands;
if (span.repaired) ++bands_repaired;
}
}
std::fprintf(stderr,
"[reseq-probe] reseq=%llu late=%llu stale=%llu holes=%llu hole_slots=%llu "
"backfilled=%llu open_holes=%zu bands=%zu nan_slots=%llu scanned=%llu "
"trigger_in_hole=%d\n",
"backfilled=%llu open_holes=%zu bands=%zu bands_repaired=%zu nan_slots=%llu "
"scanned=%llu trigger_in_hole=%d\n",
static_cast<unsigned long long>(m.stats().resequenced.load()),
static_cast<unsigned long long>(m.stats().late.load()),
static_cast<unsigned long long>(m.stats().stale.load()),
static_cast<unsigned long long>(m.stats().holes.load()),
static_cast<unsigned long long>(m.stats().hole_slots.load()),
static_cast<unsigned long long>(m.stats().backfilled.load()), open_holes, bands,
static_cast<unsigned long long>(nan_slots),
bands_repaired, static_cast<unsigned long long>(nan_slots),
static_cast<unsigned long long>(scanned), trigger_in_hole);
std::fflush(stderr);
return G_SOURCE_REMOVE;