Repository navigation
test: measure CSC decompression allocations behind a function barrier - #358
Merged
Merged
Conversation
`coloring` returns a `Union` of star and tree results. On Julia < 1.12, the never-taken branch of the split `decompress_csc!` call is a dynamic call (e.g. no tree method for mixed eltypes), which heap-allocates view arguments and makes the `@allocated` checks report 64 bytes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NohyV4o3EsFGSzxSYqoZrN
gdalle
approved these changes
Oct 28, 2026
gdalle
marked this pull request as ready for review
October 28, 2026 14:30
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #358 +/- ##
=======================================
Coverage 46.22% 46.22%
=======================================
Files 20 20
Lines 2533 2533
=======================================
Hits 1171 1171
Misses 1362 1362 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Important
This PR was generated by a coding agent, please disregard it until @gdalle has reviewed it.
Fixes the
@allocatedfailures intest/decompression.jl(lines 54 and 174) on Julia 1.10 and 1.11, which have mademainCI red since #353/#354.Diagnosis
The package code does not allocate: calling
decompress_csc!with a concretely typed result gives 0 bytes on 1.10–1.13, views included.The allocations come from the tests.
coloringreturns aUnion{StarSetColoringResult,TreeSetColoringResult}(the decompression mode is a keyword), so eachdecompress_csc!call in the test function is union-split. For the line 54 call (ComplexF64view output,Float64view input), theTreeSetColoringResultbranch has no matching method (it requires equal eltypes) and compiles to a dynamic call. That branch is never taken, but on Julia < 1.12 it still forces theSubArrayarguments to be heap-allocated (64 bytes). Julia 1.12+ no longer does this. The line 174 failure on 1.11 is the same pattern with view arguments.Fix
Add a small
allocated_decompress_csc!helper and route the four@allocated decompress_csc!(...)checks through it. The helper is a function barrier, so allocations are measured with concrete argument types, which is what users with a concrete result type see.Local checks
test/decompression.jlpasses on Julia 1.10, 1.11, 1.12 and 1.13 (it failed on 1.10 with 360 failures before).Note: CI will still show the unrelated SuiteSparse download errors (
MatrixDepot.DataError, server returns 403), tracked in #356 / #357.Model: Claude Opus 5.5
🤖 Generated with Claude Code
https://claude.ai/code/session_01NohyV4o3EsFGSzxSYqoZrN