Skip to content

Use indexed sources for fallible constant rows - #9629

Merged
connortsui20 merged 1 commit into
developfrom
ct/row-fn-execute-owned-sources
Aug 27, 2026
Merged

Use indexed sources for fallible constant rows#9629
connortsui20 merged 1 commit into
developfrom
ct/row-fn-execute-owned-sources

Conversation

@connortsui20

@connortsui20 connortsui20 commented Aug 25, 2026

Copy link
Copy Markdown
Member

Summary

RowFn handles constant inputs so row kernels do not need separate execution paths for each input shape. #9628 adds an indexed source for infallible execution, but fallible execute_owned still uses a separate loop whenever any input is constant. That loop selects between row and constant values on every iteration, duplicating the traversal and hiding the fixed batch input shape from LLVM.

Depends on #9628.

Changes

Extends the decoded indexed source to fallible execute_owned calls. Each source validates its decoded length and fixes its row-or-constant behavior before traversal, allowing every input shape to use map_checked_into without changing output initialization or deferred failure handling.

This removes the separate LaneZip branch. Optimized x86 IR preserves the vector loop while reducing the focused deferred Boolean executor by 27% and the deferred i64 executor by 19%, with the same bounds-panic sites. Tests cover a constant left-hand input, and the focused benchmark covers varying inputs and both partial-constant orientations.

@connortsui20 connortsui20 added the changelog/performance A performance improvement label Aug 25, 2026
@codspeed-hq

codspeed-hq Bot commented Aug 25, 2026

Copy link
Copy Markdown

Merging this PR will regress 1 benchmark

⚠️ 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.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 8 improved benchmarks
❌ 1 regressed benchmark
✅ 2121 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 mul_i8_nonnull_avx2 11.2 µs 12.9 µs -13.05%
WallTime mul_u64_nonnull_neon 20.6 µs 15.4 µs +34.05%
WallTime multiply_shapes_neon[(16384, PerRowPerRow)] 20.6 µs 17.2 µs +19.92%
WallTime mul_i64_nonnull_neon 20.2 µs 17.1 µs +18.49%
WallTime multiply_shapes_neon[(128, PerRowPerRow)] 2.2 µs 1.9 µs +16.32%
WallTime add_shapes_neon[(128, PerRowPerRow)] 2.1 µs 1.8 µs +12.17%
WallTime multiply_shapes_neon[(16384, PerRowConstant)] 22.8 µs 20.3 µs +12.11%
WallTime subtract_shapes_neon[(128, PerRowPerRow)] 2.1 µs 1.8 µs +12.06%
WallTime multiply_shapes_neon[(16384, PerRowNullableConstant)] 23.3 µs 21.1 µs +10.34%
🆕 WallTime deferred_i64_neon[ConstantPerRow] N/A 16.6 µs N/A
🆕 WallTime deferred_i64_neon[PerRowConstant] N/A 16.7 µs N/A
🆕 WallTime deferred_i64_neon[PerRowPerRow] N/A 15.6 µs N/A
🆕 WallTime deferred_i64_avx512[ConstantPerRow] N/A 10.1 µs N/A
🆕 WallTime deferred_i64_avx512[PerRowConstant] N/A 10.1 µs N/A
🆕 WallTime deferred_i64_avx512[PerRowPerRow] N/A 10 µs N/A
🆕 WallTime deferred_i64_avx2[ConstantPerRow] N/A 10.2 µs N/A
🆕 WallTime deferred_i64_avx2[PerRowConstant] N/A 10.1 µs N/A
🆕 WallTime deferred_i64_avx2[PerRowPerRow] N/A 10 µs N/A

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 (0dcfaae) with develop (42a5d3b)

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
@connortsui20
connortsui20 force-pushed the ct/row-fn-execute-owned-sources branch 2 times, most recently from 95c4505 to eb173d5 Compare August 26, 2026 14:15
@connortsui20
connortsui20 force-pushed the ct/row-fn-execute-owned-sources branch from eb173d5 to bf06cf4 Compare August 26, 2026 15:13
@connortsui20
connortsui20 force-pushed the ct/row-fn-execute-owned-sources branch from bf06cf4 to 838db34 Compare August 26, 2026 17:07
Base automatically changed from ct/row-fn-constant-sources to develop August 26, 2026 17:25
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
@connortsui20
connortsui20 marked this pull request as ready for review August 26, 2026 19:27
@connortsui20
connortsui20 force-pushed the ct/row-fn-execute-owned-sources branch from 838db34 to 0dcfaae Compare August 26, 2026 19:28
@connortsui20
connortsui20 merged commit 4c6a8ca into develop Aug 27, 2026
92 of 103 checks passed
@connortsui20
connortsui20 deleted the ct/row-fn-execute-owned-sources branch August 27, 2026 13:48
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.

2 participants