Design decisions

50. MonoDeque single constructor and Bitset.subset_sums (2026-11-21)

  1. MonoDeque<T>.new(by: (T, T) -> T = min) replaces the two-constructor new(pick) + by(better) split, stores by directly without wrapping in a lambda, and adds best_at -> ?Int and drop_after(max_at: Int). Reason: options are named arguments rather than separate constructors; storing by as-is lets C++ codegen inline min/max directly (~2x faster than wrapping pick in a lambda); best_at supplies DP argmin in O(1); drop_after(max_at) mirrors drop_before(min_at) for right-to-left sweeps without negating positions or adding state to MonoDeque (research/frictions/ucup4s24f.md). Reverse: restore MonoDeque.by(better: (T, T) -> Bool) beside new(pick) and drop best_at/drop_after.
  2. Bitset knapsack is Bitset<D>.subset_sums(weights) rather than a free std.bitset.subset_sums. Reason: avoids colliding with std.dp.subset_sums(xs) -> List<Int> (meet-in-the-middle) and eliminates the turbofish at call sites (Bitset<Sum>.subset_sums(ws)). Reverse: expose a free subset_sums<D> in std.bitset.