Skip to content

Use indexed sources for fallible constant rows - #9629

Draft
connortsui20 wants to merge 1 commit into
ct/row-fn-constant-sourcesfrom
ct/row-fn-execute-owned-sources
Draft

Use indexed sources for fallible constant rows#9629
connortsui20 wants to merge 1 commit into
ct/row-fn-constant-sourcesfrom
ct/row-fn-execute-owned-sources

Conversation

@connortsui20

@connortsui20 connortsui20 commented Aug 25, 2026

Copy link
Copy Markdown
Member

Summary

Extends the decoded input source from #9628 to fallible execute_owned calls.

Fallible RowFns already collect into spare Vec capacity while reducing compact failure evidence. Their constant fallback still selected between a row and a decoded constant through ElementTuple::get inside that loop, which hid the input layout from the optimizer and duplicated the traversal code used for ordinary row inputs.

Changes

Constructs one decoded source for every all-valid batch, then passes it to the existing map_checked_into collector. The source fixes each argument's row-or-constant choice before traversal, while the output allocation, initialization rules, and deferred failure handling remain unchanged.

This also removes the separate LaneZip execution branch. Optimized x86 IR keeps the same vector loop for varying Boolean inputs, unswitches source variants before the selected row loop, and removes the duplicate vectorized loop previously emitted for the two source representations. In the focused fixture, the deferred Boolean executor is 27% smaller and the deferred i64 executor is 19% smaller, with the same bounds-panic sites.

Tests cover a constant left-hand input. The focused benchmark covers varying inputs and both partial-constant orientations for deferred i64 output.

@codspeed-hq

codspeed-hq Bot commented Aug 25, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 39.38%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚡ 7 improved benchmarks
❌ 23 regressed benchmarks
✅ 2100 untouched benchmarks
🆕 9 new benchmarks
⏩ 106 skipped benchmarks1
🗄️ 4 archived benchmarks run2

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime subtract_shapes_avx2[(16384, PerRowConstant)] 8.1 µs 20.1 µs -59.62%
WallTime subtract_shapes_avx2[(16384, ConstantPerRow)] 8.2 µs 20.1 µs -59.48%
WallTime sub_i64_constant_avx2 8.2 µs 20.1 µs -59.39%
WallTime add_shapes_neon[(16384, PerRowConstant)] 9.8 µs 24.1 µs -59.22%
WallTime add_i64_constant_neon 9.8 µs 24 µs -59.08%
WallTime subtract_shapes_neon[(16384, PerRowConstant)] 10 µs 24.4 µs -59.03%
WallTime sub_i64_constant_neon 10.1 µs 24.6 µs -58.77%
WallTime add_shapes_neon[(16384, ConstantPerRow)] 9.9 µs 23.9 µs -58.71%
WallTime subtract_shapes_neon[(16384, ConstantPerRow)] 10.1 µs 24.5 µs -58.62%
WallTime mul_i32_constant_avx2 12 µs 28.7 µs -58.32%
WallTime subtract_shapes_avx2[(16384, PerRowNullableConstant)] 8.7 µs 20.7 µs -58.14%
WallTime add_shapes_neon[(16384, PerRowNullableConstant)] 10.3 µs 24.3 µs -57.55%
WallTime subtract_shapes_neon[(16384, PerRowNullableConstant)] 10.7 µs 25 µs -57.21%
WallTime mul_i32_constant_neon 11.5 µs 27 µs -57.19%
WallTime add_i64_constant_avx2 8.1 µs 18.9 µs -57.19%
WallTime add_shapes_avx2[(16384, PerRowConstant)] 8.1 µs 18.9 µs -57.16%
WallTime add_shapes_avx2[(16384, ConstantPerRow)] 8.1 µs 18.9 µs -57.1%
WallTime add_shapes_avx2[(16384, PerRowNullableConstant)] 8.6 µs 19.5 µs -55.85%
WallTime scalar_subtract_neon 14.2 µs 21.1 µs -32.59%
WallTime scalar_subtract_avx2 13.3 µs 18.9 µs -29.9%
... ... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing ct/row-fn-execute-owned-sources (95c4505) with ct/row-fn-constant-sources (d979a9b)

Open in CodSpeed

Footnotes

  1. 106 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.

  2. 4 benchmarks were run, but are now archived. If they were deleted in another branch, consider rebasing to remove them from the report. Instead if they were added back, click here to restore them.

@connortsui20
connortsui20 force-pushed the ct/row-fn-execute-owned-sources branch from 5b08a97 to f640ec1 Compare August 25, 2026 20:55
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
@connortsui20
connortsui20 force-pushed the ct/row-fn-execute-owned-sources branch from f640ec1 to 95c4505 Compare August 25, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/performance A performance improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant