Add filter-and-scatter RowFn execution - #9521
Conversation
Merging this PR will improve performance by 12.14%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | WallTime | words_gather_scalar[65536] |
9.4 µs | 8.2 µs | +13.74% |
| ⚡ | Simulation | cold_misaligned[(16, 64)] |
428.3 µs | 382.1 µs | +12.09% |
| ⚡ | Simulation | compress_fsst[(500, 64, 8)] |
585.9 µs | 529.6 µs | +10.62% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing ct/row-fn-filter-scatter (685e0d2) with develop (fd538ff)2
Footnotes
-
42 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
-
No successful run was found on
develop(951cdf7) during the generation of this report, so fd538ff was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
2268a7d to
84b879d
Compare
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
84b879d to
b6c09be
Compare
|
Can you merge this with the next pr so we can see if this is the best approach |
|
@joseph-isaacs this is not about being a better approach, it's that we literally cannot support spatial with rowfn without this let me update the pr description to include more detail |
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
|
im actually going to hold off on this until we can figure out how we want to deal with @HarukiMoriarty's work |
Rationale for this change
Partially valid
RowFninputs cannot always use direct skip-invalid execution. That path skips the row function for null rows, but it still decodes the original columns first. Vortex does not guarantee that the stored payload behind a null is meaningful, so decoding those rows can fail before the row loop has a chance to skip them.Geometry columns expose this limitation. A null row can contain coordinate or offset storage that does not describe a valid geometry. Some geometry representations can substitute safe placeholders, but not every native geometry type supports that.
The current spatial executor handles this by filtering each input to the combined valid rows before decoding it. It computes the compact result and then scatters those values back to their original positions. The existing implementation does that here.
#9349 moves spatial distance onto the shared
RowFnexecutor. This PR adds the same fallback there so the conversion preserves the existing null-handling behavior instead of requiring every input type to decode arbitrary null payloads.What changes are included in this PR?
For a partially valid batch, the executor first tries the cheaper direct valid-row path. If an input decoder or output sink cannot support that path, it filters every input to the valid rows, runs the ordinary dense kernel, validates the compact output, and scatters the values back to the original row positions.
The existing all-valid and all-null fast paths are unchanged.