Problem
cost_model::query_cost prices Subtract as O(1) (merge + subtract + query). That holds only when the repeat interval T equals the window W (design doc open item 6). When T > W, each query must fold in ⌊T/W⌋ newly completed windows and subtract as many evicted ones, so cost scales with T/W.
Once items keep their own T (instead of the gcd), T > W becomes common and Subtract is systematically underpriced.
Change
Price Subtract as a function of T/W, or restrict Subtract candidates to T = W.
Part of #753.
🤖 Generated with Claude Code
Problem
cost_model::query_costprices Subtract as O(1) (merge + subtract + query). That holds only when the repeat interval T equals the window W (design doc open item 6). WhenT > W, each query must fold in⌊T/W⌋newly completed windows and subtract as many evicted ones, so cost scales withT/W.Once items keep their own T (instead of the gcd),
T > Wbecomes common and Subtract is systematically underpriced.Change
Price Subtract as a function of
T/W, or restrict Subtract candidates toT = W.Part of #753.
🤖 Generated with Claude Code