Skip to content

More JET fixes#2256

Merged
lgoettgens merged 9 commits intomasterfrom
mh/JET
Dec 17, 2025
Merged

More JET fixes#2256
lgoettgens merged 9 commits intomasterfrom
mh/JET

Conversation

@fingolfin
Copy link
Copy Markdown
Member

  • Add fallbacks for Union{} to some type traits
  • Fix JET warnings in Fac
  • Help JET in gcd code
  • Specify type for 2nd arg of lu! as MatElem
  • Use deepcopy instead of copy on RingElems
  • Help JET understand sqrt_heap does not use Fe undefined
  • JET: init AhoCorasickAutomaton w/o conversions
  • Fix _numpart: first argument should be Int
  • Tighten argument types for hnf_kb!

With this, it is down to 62 possible errors.

These pop up as part of inference in various places
Allow it to deduce from types that certain code is safe,
and c is never used undefined
This helper e.g. JET to reason about the code.
And humans generally appreciate such a hint, too.
We do not define copy for RingElem in general, but
deepcopy is (usually) available.
After all it is a key for lookuptable, which must be an Int.
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 16, 2025

Codecov Report

❌ Patch coverage is 62.06897% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.06%. Comparing base (0eb3ed5) to head (4cbac91).
⚠️ Report is 32 commits behind head on master.

Files with missing lines Patch % Lines
src/fundamental_interface.jl 0.00% 4 Missing ⚠️
src/generic/LaurentMPoly.jl 0.00% 2 Missing ⚠️
src/generic/LaurentPoly.jl 0.00% 2 Missing ⚠️
src/Poly.jl 50.00% 1 Missing ⚠️
src/generic/Ideal.jl 75.00% 1 Missing ⚠️
src/generic/SparsePoly.jl 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2256      +/-   ##
==========================================
- Coverage   88.07%   88.06%   -0.02%     
==========================================
  Files         126      126              
  Lines       31728    31736       +8     
==========================================
+ Hits        27946    27948       +2     
- Misses       3782     3788       +6     

☔ 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
Copy Markdown
Member

@lgoettgens lgoettgens left a comment

Choose a reason for hiding this comment

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

Happy about most changes, but one important comment below

Comment thread src/generic/YoungTabs.jl
Comment on lines +75 to +79
return _numpart(Int(n), _numPartsTableBig)
end
end

function _numpart(n::T, lookuptable::Dict{Int, T}) where T<:Integer
function _numpart(n::Int, lookuptable::Dict{Int, T}) where T<:Integer
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These two changes restrict functionality! I would be in favor of reverting them for now and have a closer look in a different PR

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't think any functionality is restricted: if you look into the body of the function, n is always used as a key for lookuptable, which is of type Dict{Int,T} -- so the key must be an Int.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

had another look, now seems indeed fine

@lgoettgens lgoettgens merged commit fccef26 into master Dec 17, 2025
21 of 23 checks passed
@lgoettgens lgoettgens deleted the mh/JET branch December 17, 2025 15:08
@lgoettgens lgoettgens added the release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes label Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants