Skip to content

Try to improve type stability with Householder#184

Open
lkdvos wants to merge 2 commits intomainfrom
ld-typestability
Open

Try to improve type stability with Householder#184
lkdvos wants to merge 2 commits intomainfrom
ld-typestability

Conversation

@lkdvos
Copy link
Member

@lkdvos lkdvos commented Mar 9, 2026

Here I standardized the Householder keyword arguments in an attempt to improve the type stability (again).

Apparently this just isn't enough, so I gave up again and just put the @assume_effects into place.
In general, I think this really is what we want, and the main point is that this should really only go wrong if default_algorithm isn't foldable, which is probably a fair thing to ask for.
I am also quite unhappy about this solution, and am very open to alternative suggestions, but I spent way too long on this already and am running out of ideas.

To give some insight into what I found:
The main thing seems to be that there is a maximal depth that the compiler will @inline or const-prop. For example, with some tinkering I actually got it to the point where select_algorithm(right_orth!, A, alg) is type stable, but select_algorithm(right_orth, A, alg) then wasn't, even though it is marked with inline annotations.
From this I concluded there is a maximal depth of logic we can achieve, and since the "orthnull" already is using up quite a bit of that I can't seem to get past it without a major rewrite

@codecov
Copy link

codecov bot commented Mar 9, 2026

Codecov Report

❌ Patch coverage is 59.09091% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/implementations/lq.jl 0.00% 4 Missing ⚠️
ext/MatrixAlgebraKitGenericLinearAlgebraExt.jl 0.00% 2 Missing ⚠️
src/implementations/qr.jl 50.00% 2 Missing ⚠️
src/algorithms.jl 87.50% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/interface/decompositions.jl 62.96% <100.00%> (-1.04%) ⬇️
src/interface/lq.jl 62.50% <100.00%> (ø)
src/interface/qr.jl 62.50% <100.00%> (ø)
src/algorithms.jl 77.53% <87.50%> (-13.18%) ⬇️
ext/MatrixAlgebraKitGenericLinearAlgebraExt.jl 0.00% <0.00%> (-85.92%) ⬇️
src/implementations/qr.jl 64.28% <50.00%> (-29.86%) ⬇️
src/implementations/lq.jl 55.14% <0.00%> (-39.05%) ⬇️

... and 35 files with indirect coverage changes

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

@lkdvos lkdvos force-pushed the ld-typestability branch 2 times, most recently from d371835 to cb03fcf Compare March 9, 2026 19:39
@lkdvos lkdvos force-pushed the ld-typestability branch from cb03fcf to 4535feb Compare March 9, 2026 20:22
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