FsdbReader: value at t plus the last real change before t, without loading the whole signal
Use case: a debugger or trace tool needs, for N signals at time t, both the value and when it last changed. Loading each signal whole (ffrLoadSignals with no window) costs seconds for rebuilt (secondary) signals.
What worked (W-2024.09, documented API only): - Set a view window [lo - 1, t] with ffrSetViewWindow/ffrResetViewWindow, where lo = t - span. Then add the ids, ffrLoadSignals once, and use a traverse handle per id from ffrGetMinXTag. - The reader gives a value change before lo: it carries the value in effect on entry to the window. Treat every change at a time below lo as that base value, not as a real change. With lo = 0 the base is all x. - Normalize in the window: group same-time changes and keep the last value (glitches). A group equal to the value already in effect is not a change. The last group that differs is the last real change. If there is none, grow span x8 and repeat until lo reaches 0. - The cost of a rebuilt signal scales with the span, so start narrow (1/4096 of the dump). Stored signals pay a mostly fixed per-call cost, so start wider (1/256) and batch them in one call per round. - Always restore the full window afterwards (ffrResetViewWindow to [0, max]). Then check that a whole load still sees every change: a leaked narrow window silently truncates later loads.
Verified against a brute-force reference on a small FSDB written with the FSDB writer: late first changes, all-x first changes, no changes, glitches at the end; 7,000 checks. On a 1.7 GB dump, 50 signals at two times matched the whole-signal answer exactly. A 10-signal read took ~200 ms against 50-110 ms for a plain value-at-t read.