114. Append-only Prefix.filling(order: FillOrder) across 1D, 2D, and List (2026-11-21)
- Decision. Extend the unified
Prefixfamily (Prefix<D, T>,Prefix<R, C, T>,Prefix<T>) withFillOrder = Forward | ReverseandPrefix<...>.filling(order: FillOrder = FillOrder.Forward), returning dedicated append-only tables (FillPrefix<D, T>,FillPrefix<R, C, T>,FillPrefix<T>) with O(1).set(...)in strict fill order (row-major in 2D) and O(1).sum(...)/.prefix(...). Staticprefix(a)tables keep zero extra fields or branches (zero emitted-size or hot-loop overhead for static users likecf2129e). EachFillPrefixtracksrev: Boolandnext: Int;.settraps on out-of-order writes and.sum/.prefixtrap on any non-empty query reading unfilled cells, with identical trapping in interpreter and C++.FillOrder,FillPrefix, and_FillPrefix*are brought in alongsidePrefix/prefixviaINTERNAL_BUILT_ON. - Reason. Corpus audit found two real DPs that fill a prefix/suffix sum table while querying the already-filled part (
cf2183fin 2D reverse andcf2229ein 1D forward), meeting the two-user bar (other 2D prefix-sum ports likeioi07p5andapio09p1are static rather than append-only). ExtendingPrefixdirectly rather than adding a one-offRectSumsstruct keeps one type and one O(1).sumvocabulary across static and incremental 1D/2D/list prefix and suffix tables. - Reverse. Remove
FillOrder,filling,set, and therev/nextfields fromstdlib/prefix.cpandFillOrderfromINTERNAL_BUILT_ONincrates/cpl-check/src/prelude.rs; revertcf2183fandcf2229eto hand-maintained prefix/suffix arrays.