Skip to content

Skip codegen of unreachable int to decimal carrier arms - #10735

Merged
robert3005 merged 1 commit into
developfrom
rk/size-decimal-cast-carrier
Oct 26, 2026
Merged

robert3005 merged 1 commit into
developfrom
rk/size-decimal-cast-carrier

Conversation

@robert3005

@robert3005 robert3005 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

The scaled-down integer to decimal cast selects its carrier as max(carrier(S), T). The source type S and the target type T fix the carrier, but match_each_decimal_value_type! compiled the kernel for all six decimal widths in each of the 48 (S, T) pairs. An if const condition now removes the five arms that cannot match before code generation. The arm that runs is the same as before.

primitive_decimal_carrier_type becomes a const fn so that the condition can use it.

before after
vortex-array release __text (macOS arm64) 14,012,988 B 13,697,852 B (-315 KB)
vortex-array LLVM IR lines 5,405,422 5,200,767

@codspeed

codspeed Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 22.72%

4 warnings, 1 note

⚠️ Walltime results may be unreliable

Some benchmarks used the Walltime instrument outside CodSpeed Macro Runners, which can make the results inconsistent.

Learn more about Macro Runners

See affected benchmarks

⚠️ Unable to measure the execution of 2 benchmarks

These benchmarks measured no execution time, so their results are not comparable and count as unchanged. This usually happens when the compiler removes the code under test.

Prevent compiler optimizations

See affected benchmarks

⚠️ 21 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ Base and head ran on different runner types

Some benchmarks with significant performance changes were compared across different runner types, so the changes might not come from the code. Run base and head on the same runner type, or use CodSpeed Macro Runners for more stable results.

Learn more about Macro Runners

Open the report in CodSpeed to investigate

ℹ️ 40 benchmarks have no flamegraph

The flamegraph wasn't generated: the symbols of the profiling trace could not be resolved, because no information about the language frames was collected.

See affected benchmarks

⚡ 2 improved benchmarks
❌ 9 regressed benchmarks
✅ 2428 untouched benchmarks
⏩ 12 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ CPU Simulation bench_compare_sliced_dict_primitive[(3333, 10000)] 32.9 µs 71.8 µs -54.14%
❌ Walltime filter_neon[64] 1.8 µs 3.4 µs -47.11%
❌ Walltime filter_neon[8] 926 ns 1,746 ns -46.96%
❌ CPU Simulation filter_powerlaw_by_random[250000] 131.3 µs 175.7 µs -25.26%
❌ Walltime filter_neon[80] 2.5 µs 3.2 µs -21.64%
❌ Walltime threshold_neon[80] 3.3 µs 4.1 µs -19.67%
❌ Walltime threshold_neon[64] 2.6 µs 3.1 µs -17.35%
❌ Walltime threshold_neon[8] 1.4 µs 1.6 µs -13.53%
❌ CPU Simulation max_f64 281.8 µs 315.2 µs -10.61%
⚡ CPU Simulation chunked_dict_primitive_canonical_into[f64, (1000, 1000, 10)] 203.3 µs 148.5 µs +36.84%
⚡ CPU Simulation decompress[u16, (4000, 256)] 62.5 µs 56.3 µs +11.01%

Tip

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


Comparing rk/size-decimal-cast-carrier (1a0cd7a) with develop (76d8371)

Open in CodSpeed

Footnotes

  1. 12 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. ↩

@connortsui20 connortsui20 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will likely be different after the changes Im planning on making in #10733

@connortsui20
connortsui20 force-pushed the rk/size-decimal-cast-carrier branch from ec5286e to 623fc4e Compare October 26, 2026 16:05
The scaled-down integer to decimal cast selects the carrier as
max(carrier(S), T). The source and target types fix the carrier, but
the dispatch macro compiled the kernel for all six decimal widths in
each (S, T) pair. A const condition now removes the five arms that
cannot match before codegen.

vortex-array release __text: 14,012,988 -> 13,697,852 bytes (-315 KB).
LLVM IR lines: 5,405,422 -> 5,200,767.

Signed-off-by: Robert Kruszewski <github@robertk.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@robert3005
robert3005 force-pushed the rk/size-decimal-cast-carrier branch from 623fc4e to 1a0cd7a Compare October 26, 2026 16:20
@robert3005
robert3005 enabled auto-merge (squash) October 26, 2026 16:24
@robert3005
robert3005 merged commit e5f20f2 into develop Oct 26, 2026
79 of 81 checks passed
@robert3005
robert3005 deleted the rk/size-decimal-cast-carrier branch October 26, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/chore A trivial change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants