Skip to content

Map constant RowFn inputs directly - #9628

Draft
connortsui20 wants to merge 1 commit into
ct/row-fn-bool-outputfrom
ct/row-fn-constant-sources
Draft

Map constant RowFn inputs directly#9628
connortsui20 wants to merge 1 commit into
ct/row-fn-bool-outputfrom
ct/row-fn-constant-sources

Conversation

@connortsui20

@connortsui20 connortsui20 commented Aug 25, 2026

Copy link
Copy Markdown
Member

Summary

#9620 lets Boolean output collect results directly into a packed bit buffer, but only when every input varies by row. A RowFn constant is stored as one decoded value instead of a row_count-element view, so one constant input still forces an intermediate Vec<bool>:

before: (column, column)   -> BitBuffer
        (column, constant) -> Vec<bool> -> BitBuffer

after:  either input shape -> BitBuffer

This PR does not add constant handling. It makes the direct output collector usable with the constant handling RowFn already has. Depends on #9620.

Changes

Adds a private indexed source over decoded ArgColumns. Each argument reads either row index or its single decoded constant, while the source still reports the logical batch length expected by OutputElement::build_from.

The row-or-constant choice remains visible to the optimizer before traversal, which preserves direct packed Boolean stores. Tests cover both constant positions, all-constant input, and nullary execution.

API Changes

Clarifies that InputElement::view must produce the same row values as InputElement::get for every addressable index.

@codspeed-hq

codspeed-hq Bot commented Aug 25, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 6.66%

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

⚡ 4 improved benchmarks
❌ 5 regressed benchmarks
✅ 2121 untouched 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 arrow_checked_add_u32_neon[16384] 12.5 µs 20.3 µs -38.74%
WallTime arrow_checked_add_u32_avx512[16384] 17.6 µs 21.2 µs -16.99%
WallTime infallible_bool_avx2[i64, PerRowConstant] 9.9 µs 11.3 µs -13.16%
WallTime infallible_bool_avx2[i64, ConstantPerRow] 9.9 µs 11.4 µs -13.02%
WallTime mul_u32_nonnull_avx512 5.6 µs 6.3 µs -10.59%
WallTime infallible_bool_avx512[i32, ConstantPerRow] 3.3 µs 2.9 µs +14.61%
WallTime infallible_bool_avx512[i32, PerRowConstant] 3.2 µs 2.9 µs +11.72%
WallTime mul_i32_nonnull_avx512 7.9 µs 7.1 µs +10.99%
WallTime infallible_bool_avx2[i32, ConstantPerRow] 3.8 µs 3.4 µs +10.18%

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-constant-sources (d979a9b) with ct/row-fn-bool-output (ccb755d)

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-constant-sources branch from d88742b to 08450db Compare August 25, 2026 20:55
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
@connortsui20
connortsui20 force-pushed the ct/row-fn-constant-sources branch from 08450db to d979a9b 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