Pack deferred Boolean RowFn output directly - #9626
Conversation
Merging this PR will degrade performance by 46.65%
|
908771e to
d5c51a4
Compare
d5c51a4 to
1156781
Compare
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
1156781 to
4d96e40
Compare
Summary
Extends direct output collection to the all-valid fallible
execute_ownedpath. Depends on #9629.The source work in the preceding PRs makes each input layout visible to the collector, but fallible Boolean RowFns still write one byte per result into
Vec<bool>before constructing a packed array. The output type needs to own collection while the executor also reduces failure evidence.Changes
Adds
OutputElement::build_from_deferred, whose default keeps the existingVecandmap_checked_intocollection. The Boolean override packs output withBitBuffer::collect_boolwhile OR-reducing the matching failure evidence.execute_ownedpasses its decoded source through that hook.Tests cover varying inputs, both partial-constant orientations, and an observable valid-row failure. The focused benchmark covers deferred Boolean output for
i32andi64, with deferredi64as the non-Boolean control. Nullable retry and valid-only execution are unchanged.Optimized x86 codegen emits vector comparisons,
vpmovmskb, and direct packed-word stores for varying inputs and both constant orientations. Deferredi64remains scalar, so this stays a draft experiment rather than evidence that the generic fallible path improved.The hook constructs the
ArrayRefbeforefinish_failurevalidates the reduced evidence. A rejected batch therefore pays output-construction cost and discards the column, and a customOutputElementobserves output-construction panics before the deferred error is built.API Changes
Adds
OutputElement::build_from_deferred. Implementations must preserve the row order and output contract ofbuild_from, return the bitwise OR of exactly the callback failure values, and cannot add another failure path. Failure evidence must be no wider than the output element.