Repository navigation
Recover the first-call compile time that #1128 added to sprand and widelength - #1137
Merged
Merged
Conversation
…`widelength` `widelength` is a product of the widened dimensions without `prod`'s reduction machinery, `sizehint!` passes Base an `Int`, and `sprand` throws an `OverflowError` for 2^63 or more entries instead of drawing column by column. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1137 +/- ##
==========================================
+ Coverage 94.66% 94.67% +0.01%
==========================================
Files 16 16
Lines 10437 10422 -15
==========================================
- Hits 9880 9867 -13
+ Misses 557 555 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ViralBShah
added a commit
that referenced
this pull request
Oct 27, 2026
…`widelength` (#1137) The TTFX check on #1136 flags the 1.14 backports: the cold run of `sprand(200, 200, 0.05); kron(S, S); S * rand(200)` went from 633 to 687 ms and the warm one from 274 to 289 ms. All of it comes from #1128. That PR raised the methods compiled by this workload from 465 to 514, and none of the other 28 backports changed it measurably. **Before** (`main`) ```julia julia> sprand(Xoshiro(1), 2^62, 4, 1e-17) 4611686018427387904×4 SparseMatrixCSC{Float64, Int64} with 169 stored entries ``` **After** ```julia julia> sprand(Xoshiro(1), 2^62, 4, 1e-17) ERROR: OverflowError: a 4611686018427387904×4 sparse matrix has more entries than `sprand` can draw from ``` First run of the TTFX workload in a fresh process, median of 16 runs interleaved, Julia 1.15.0-DEV.142 on macOS arm64. A cold run starts with an empty JIT object cache, as the check does: | | cold run | warm run | methods compiled | |---|---|---|---| | before #1128 (4c87861) | 282.8 ms | 116.3 ms | 465 | | `main` | 302.0 ms | 121.6 ms | 514 | | this PR | 282.9 ms | 116.2 ms | 450 | `widelength(x) = prod(widen, size(x))` went through `mapreduce`, `MappingRF` and `ComposedFunction`, about 35 methods on the first call of `kron`, `sprand` or a broadcast. It is now `*(map(widen, size(x))...)`: the same `Int128` product, from one call to `*`. `sizehint!` converts that bound to `Int`, which Base's `sizehint!` does anyway, so it is not compiled again for an `Int128` size. Inference and codegen of `sprand` covered the branch that draws column by column for a matrix of 2^63 or more entries, even though no realistic call takes it. That branch is removed: `sprand` throws an `OverflowError` for such a size. Before #1128 it returned a matrix with no stored entries. Should be backported to 1.14 so that #1136 picks it up. Written by Claude Code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Viral B. Shah <ViralBShah@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 9bfad27)
ViralBShah
added a commit
that referenced
this pull request
Oct 27, 2026
Backports of the merged PRs labelled `backport 1.14`, cherry-picked with `-x` in the order they were merged on `main`. `release-1.14` starts at b0aa455 (#1104), the commit JuliaLang/julia's `release-1.14` pins, and every PR merged on `main` since then is labelled, so this branch's tree is identical to `main`'s at 9bfad27. - [x] #1105 - [x] #1011 - [x] #1107 - [x] #1108 - [x] #1110 - [x] #1111 - [x] #1114 - [x] #1112 - [x] #1115 - [x] #1117 - [x] #1118 - [x] #1109 - [x] #1113 - [x] #1122 - [x] #1123 - [x] #1120 - [x] #1124 - [x] #1125 - [x] #1116 - [x] #1121 - [x] #1126 - [x] #1128 - [x] #1130 - [x] #1131 - [x] #1119 - [x] #1133 - [x] #1127 - [x] #1135 - [x] #1134 - [x] #1137 #1137 removes the first-call compile time that #1128 added, which the TTFX check flagged on this PR. #1132 merged into the branch of #1131 and is part of its commit. Not bug fixes: #1011 adds a deprecation, #1109 changes the `sprand` value stream for a value function, #1113 changes the result shape of `SparseMatrixCSC` of a vector view, and #1119, #1133, #1134 and #1135 add methods for views. They are included because they are labelled and 1.14 is not released yet. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Viral B. Shah <ViralBShah@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The TTFX check on #1136 flags the 1.14 backports: the cold run of
sprand(200, 200, 0.05); kron(S, S); S * rand(200)went from 633 to 687 ms and the warm one from 274 to 289 ms. All of it comes from #1128. That PR raised the methods compiled by this workload from 465 to 514, and none of the other 28 backports changed it measurably.Before (
main)After
First run of the TTFX workload in a fresh process, median of 16 runs interleaved, Julia 1.15.0-DEV.142 on macOS arm64. A cold run starts with an empty JIT object cache, as the check does:
mainwidelength(x) = prod(widen, size(x))went throughmapreduce,MappingRFandComposedFunction, about 35 methods on the first call ofkron,sprandor a broadcast. It is now*(map(widen, size(x))...): the sameInt128product, from one call to*.sizehint!converts that bound toInt, which Base'ssizehint!does anyway, so it is not compiled again for anInt128size. Inference and codegen ofsprandcovered the branch that draws column by column for a matrix of 2^63 or more entries, even though no realistic call takes it. That branch is removed:sprandthrows anOverflowErrorfor such a size. Before #1128 it returned a matrix with no stored entries.Should be backported to 1.14 so that #1136 picks it up.
Written by Claude Code.
🤖 Generated with Claude Code