Skip to content

Conversation

jishnub
Copy link
Member

@jishnub jishnub commented Sep 11, 2025

In all the places where sym_uplo is used within this package, it is used in a context where uplo in ('U', 'L'), so the error path is never taken. We may therefore remove the error branch from the function and improve the effects inference.

julia> Base.infer_effects(LinearAlgebra.sym_uplo, (Char,))
(+c,+e,!n,+t,+s,+m,+u,+o,+r)

julia> Base.infer_effects(LinearAlgebra.sym_uplo_unsafe, (Char,))
(+c,+e,+n,+t,+s,+m,+u,+o,+r)

I've not removed the sym_uplo function, since this is used by some packages in the ecosystem (e.g., JuMP).

Copy link

codecov bot commented Sep 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.90%. Comparing base (98723df) to head (eb5a514).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1441   +/-   ##
=======================================
  Coverage   93.89%   93.90%           
=======================================
  Files          34       34           
  Lines       15920    15925    +5     
=======================================
+ Hits        14948    14954    +6     
+ Misses        972      971    -1     

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Member

@dkarrasch dkarrasch left a comment

Choose a reason for hiding this comment

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

What about making this a one-line function?

Copy link
Member

@dkarrasch dkarrasch left a comment

Choose a reason for hiding this comment

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

Can you please add tests that check the three possible outcomes of the previous sym_uplo function to make sure (a) it's covered, (b) it doesn't change behavior, and finally (c) doesn't get removed by accident.

@jishnub jishnub changed the title Add sym_uplo_unsafe to skip validation Add _sym_uplo to skip validation Sep 18, 2025
@jishnub
Copy link
Member Author

jishnub commented Sep 19, 2025

@dkarrasch good to merge?

@dkarrasch dkarrasch merged commit 880a9fe into master Sep 20, 2025
1 of 2 checks passed
@dkarrasch dkarrasch deleted the jishnub/sym_uplo_safe branch September 20, 2025 15:46
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.

3 participants