Skip to content

Bugfix on basis type instability#1294

Merged
JordiManyer merged 5 commits into
masterfrom
bugfix-basis-type-instability
May 1, 2026
Merged

Bugfix on basis type instability#1294
JordiManyer merged 5 commits into
masterfrom
bugfix-basis-type-instability

Conversation

@JordiManyer
Copy link
Copy Markdown
Member

@JordiManyer JordiManyer commented May 1, 2026

The issue here is that TensorValue{2,2,Float64} is actually abstract, the concrete version of it being TensorValue{2,2,Float64,4}. Although the fourth parameter is completely deterministic, Julia does not allow us to define things like struct TensorValue{D1,D2,T} <: MultiValue{D1,D2,T,D1*D2}, which would be ideal. Obviously, the user would always like to use the abstract type, but because the bases construction were just taking whatever type the user provided we ended up with abstract types being used for computations. This is horrible for performance.

To fix this, I have gone through the code and added a way to actually make the user-given types concrete if possible. @Antoinemarteau let me know if you think there is a better way.

Needs to be merged after #1293 .

@codecov
Copy link
Copy Markdown

codecov Bot commented May 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.83%. Comparing base (f39eac1) to head (dbef316).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1294      +/-   ##
==========================================
- Coverage   88.83%   88.83%   -0.01%     
==========================================
  Files         227      227              
  Lines       29775    29780       +5     
==========================================
+ Hits        26451    26455       +4     
- Misses       3324     3325       +1     
Flag Coverage Δ
drivers 39.96% <89.47%> (+<0.01%) ⬆️
extensions 5.12% <22.22%> (-0.02%) ⬇️
unit-adaptivity 40.10% <73.68%> (-0.01%) ⬇️
unit-basics 14.70% <68.42%> (+<0.01%) ⬆️
unit-celldata 21.13% <63.15%> (-0.01%) ⬇️
unit-fespaces-1 32.37% <84.21%> (+<0.01%) ⬆️
unit-fespaces-2 38.84% <73.68%> (+<0.01%) ⬆️
unit-fields 17.62% <100.00%> (+0.04%) ⬆️
unit-geometry 28.77% <57.89%> (-0.01%) ⬇️
unit-multifield 30.88% <63.15%> (-0.01%) ⬇️
unit-odes 28.75% <57.89%> (-0.01%) ⬇️
unit-referencefes 34.25% <100.00%> (+<0.01%) ⬆️
unit-visualization 11.91% <57.89%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@JordiManyer JordiManyer merged commit 8e8a580 into master May 1, 2026
58 checks passed
@JordiManyer JordiManyer deleted the bugfix-basis-type-instability branch May 1, 2026 14:34
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