The canonical filtrationOrdering shape every stream in this codebase's ordering contract must produce (CLAUDE.md's stream rules 1/2): primary key filtration value REVERSED (smaller-under-this-ordering means younger -- Chain's pivot-selection machinery needs "smaller" to mean "younger"), then dimension ascending, then a caller-supplied tie-break. A cell either side's fv is undefined for falls through to the dimension/tie-break keys alone, matching every existing call site's behavior.
The canonical filtrationOrdering shape every stream in this codebase's ordering contract must produce (CLAUDE.md's stream rules 1/2): primary key filtration value REVERSED (smaller-under-this-ordering means younger -- Chain's pivot-selection machinery needs "smaller" to mean "younger"), then dimension ascending, then a caller-supplied tie-break. A cell either side's fv is undefined for falls through to the dimension/tie-break keys alone, matching every existing call site's behavior.
fv stays a PartialFunction, not C => Option[Double]: every call site already had one on hand (no .lift allocation needed), and this sits directly on Chain.reduceBy's SortedMap/PriorityQueue comparison path -- the hottest loop in every engine.