Skip to content

Return a borrowed scalar from as_constant - #10790

Merged
robert3005 merged 2 commits into
developfrom
claude/determined-tesla-6o0lrq
Oct 26, 2026
Merged

robert3005 merged 2 commits into
developfrom
claude/determined-tesla-6o0lrq

Conversation

@robert3005

Copy link
Copy Markdown
Contributor

ArrayRef::as_constant, Array::as_constant and ReduceNode::as_constant now return Option<&Scalar> instead of cloning the constant's scalar. Let the callers decide if they need an owned scalar

@robert3005 robert3005 added the changelog/break A breaking API change label Oct 26, 2026
@codspeed

codspeed Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 9.52%

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

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

⚡ 3 improved benchmarks
❌ 4 regressed benchmarks
✅ 2401 untouched benchmarks
⏩ 12 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Walltime mul_u64_nonnull_neon 20.3 µs 39.1 µs -48.06%
❌ CPU Simulation chunked_dict_primitive_canonical_into[f64, (1000, 1000, 10)] 149 µs 202.8 µs -26.55%
❌ Walltime threshold_avx2[80] 2.6 µs 3 µs -15.69%
❌ CPU Simulation test_scan_filter[int] 3 ms 3.4 ms -11.25%
⚡ Walltime filter_neon[8] 1,115 ns 876 ns +27.28%
⚡ CPU Simulation test_repeated_scan_scalar_at[int] 280.2 µs 234.8 µs +19.33%
⚡ Walltime filter_neon[64] 2 µs 1.7 µs +14.49%

Tip

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


Comparing claude/determined-tesla-6o0lrq (91e0833) with develop (f3cbb32)

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

`ArrayRef::as_constant`, `Array::as_constant` and `ReduceNode::as_constant`
now return `Option<&Scalar>` instead of cloning the constant's scalar. Call
sites that need ownership clone explicitly; the rest now borrow, which also
avoids cloning list scalars in `list_contains` reduction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PxoTdLxRGNd2aWb6qz6EhC
Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PxoTdLxRGNd2aWb6qz6EhC
Signed-off-by: Claude <noreply@anthropic.com>
@robert3005
robert3005 enabled auto-merge (squash) October 26, 2026 14:03
@robert3005
robert3005 force-pushed the claude/determined-tesla-6o0lrq branch from 7a81473 to 91e0833 Compare October 26, 2026 14:07
@robert3005
robert3005 merged commit 46429f5 into develop Oct 26, 2026
79 of 81 checks passed
@robert3005
robert3005 deleted the claude/determined-tesla-6o0lrq branch October 26, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/break A breaking API change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants