Skip to content

Add FileCheck tests of the inlining of allocations with dynamic dimensions - #230

Merged
giordano merged 1 commit into
mainfrom
checked-dims-straight-line
Oct 24, 2026
Merged

giordano merged 1 commit into
mainfrom
checked-dims-straight-line

Conversation

@giordano

Copy link
Copy Markdown
Collaborator

The check of dynamic dimensions done when allocating a FixedSizeArray must be
cheap to inline: with loops in the Julia IR of checked_size_product it is not
inlined for 3 or more dimensions, and for 2 dimensions it makes the functions
allocating arrays and calling other functions, e.g. * of matrices, too
expensive to inline into their callers.

These tests require CheckedSizeProduct v1.0.1, where the reductions over the
tuple of dimensions are recursive rather than loops.

…sions

The check of dynamic dimensions done when allocating a `FixedSizeArray` must be
cheap to inline: with loops in the Julia IR of `checked_size_product` it is not
inlined for 3 or more dimensions, and for 2 dimensions it makes the functions
allocating arrays and calling other functions, e.g. `*` of matrices, too
expensive to inline into their callers.

These tests require CheckedSizeProduct v1.0.1, where the reductions over the
tuple of dimensions are recursive rather than loops.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uo8pYxD9d3UaCJdsLPXq79
@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.39%. Comparing base (9452c7b) to head (b335bf6).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #230   +/-   ##
=======================================
  Coverage   94.39%   94.39%           
=======================================
  Files           8        8           
  Lines         321      321           
=======================================
  Hits          303      303           
  Misses         18       18           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@giordano

giordano commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator Author

All the test failures in https://github.com/JuliaArrays/FixedSizeArrays.jl/actions/runs/39948573136/job/120397168346?pr=230 (on commit ad7d713) show that the tests introduced here catch the issue that JuliaArrays/CheckedSizeProduct.jl#28 is resolving (#183)

@giordano
giordano force-pushed the checked-dims-straight-line branch from ad7d713 to d5dbf6a Compare October 23, 2026 12:15
@giordano

giordano commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator Author

Instead in https://github.com/JuliaArrays/FixedSizeArrays.jl/actions/runs/39952024839?pr=230 (on commit d5dbf6a) the same tests are passing everywhere except on Julia v1.10 (which doesn't read the [sources] section of Project.toml), to confirm that JuliaArrays/CheckedSizeProduct.jl#28 does indeed solve the issue (namely, increased cost of inlining of checked_dims, which prevents further optimisations)

@giordano
giordano force-pushed the checked-dims-straight-line branch from b335bf6 to 4373de6 Compare October 24, 2026 18:19
@giordano
giordano marked this pull request as ready for review October 24, 2026 18:19
@giordano
giordano merged commit d4db76d into main Oct 24, 2026
21 checks passed
@giordano
giordano deleted the checked-dims-straight-line branch October 24, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant