Skip to content

Refactor Enzyme testsuite#177

Merged
kshyatt merged 12 commits intomainfrom
ksh/enzyme_refi
Mar 6, 2026
Merged

Refactor Enzyme testsuite#177
kshyatt merged 12 commits intomainfrom
ksh/enzyme_refi

Conversation

@kshyatt
Copy link
Member

@kshyatt kshyatt commented Feb 24, 2026

Will need #175 first and a rebase on top. I missed a few docstrings as well which I can go in and add.

@github-actions
Copy link

github-actions bot commented Feb 24, 2026

Your PR no longer requires formatting changes. Thank you for your contribution!

@codecov
Copy link

codecov bot commented Feb 24, 2026

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ixAlgebraKitEnzymeExt/MatrixAlgebraKitEnzymeExt.jl 0.00% 6 Missing ⚠️
Files with missing lines Coverage Δ
...ixAlgebraKitEnzymeExt/MatrixAlgebraKitEnzymeExt.jl 1.29% <0.00%> (-0.02%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kshyatt
Copy link
Member Author

kshyatt commented Mar 5, 2026

OK, I think this is ready for people to have a look

Copy link
Member

@lkdvos lkdvos left a comment

Choose a reason for hiding this comment

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

Overall looks great, thanks for this work!
I left some minor comments and I think some changes got merged slightly wrong, but otherwise I think we can go ahead and merge this

@kshyatt
Copy link
Member Author

kshyatt commented Mar 6, 2026

Also added the projections tests to see if Enzyme can generate good rules for them on its own

@kshyatt
Copy link
Member Author

kshyatt commented Mar 6, 2026

I'll try to figure out why the project_hermitian(A, A, alg) ones are failing, but otherwise looks like Enzyme successfully drew up a rule!

@kshyatt
Copy link
Member Author

kshyatt commented Mar 6, 2026

OK, projections added. @lkdvos what do you think of the awkward cludge for the inplace methods? I do think this is FD related weirdness...

Copy link
Member

@lkdvos lkdvos left a comment

Choose a reason for hiding this comment

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

I think the projection stuff looks totally reasonable, I think I understand the issue from your docstrings so makes sense to me!

project_antihermitian_inplace!(A, alg) = project_antihermitian!(A, A, alg)


enzyme_fdm(T) = eltype(T) <: Union{Float32, ComplexF32} ? EnzymeTestUtils.FiniteDifferences.central_fdm(5, 1, max_range = 1.0e-2) : EnzymeTestUtils.FiniteDifferences.central_fdm(5, 1)
Copy link
Member

Choose a reason for hiding this comment

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

I would have probably made this a multiline function, it's quite long for a single line, but this is really just aesthetics at this point 😉

Co-authored-by: Lukas Devos <ldevos98@gmail.com>
@kshyatt kshyatt merged commit 95dd693 into main Mar 6, 2026
9 of 10 checks passed
@kshyatt kshyatt deleted the ksh/enzyme_refi branch March 6, 2026 20:35
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.

2 participants