Skip to content

Overhaul test infrastructure#389

Open
lkdvos wants to merge 27 commits intomainfrom
ld-testing
Open

Overhaul test infrastructure#389
lkdvos wants to merge 27 commits intomainfrom
ld-testing

Conversation

@lkdvos
Copy link
Copy Markdown
Member

@lkdvos lkdvos commented Mar 24, 2026

Summary

  • Moves test dependencies into a dedicated test/Project.toml, separating them from the main package manifest
  • Replaces the monolithic test runner with ParallelTestRunner.jl, running each test file in its own worker process
  • Adds --fast mode that skips AD test groups and reduces sector/scalar-type coverage for quick iteration
  • Adds test/README.md documenting how to run tests, available groups, fast mode, and how to add new test files
  • Updates CI to auto-discover test groups as matrix jobs; draft PRs run a reduced matrix (ubuntu + Julia 1 only) while ready PRs run the full matrix

kshyatt
kshyatt previously approved these changes Mar 25, 2026
Copy link
Copy Markdown
Member

@kshyatt kshyatt left a comment

Choose a reason for hiding this comment

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

Apart from minor comment LGTM, this will be very helpful for the Enzyme PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 25, 2026

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

@kshyatt
Copy link
Copy Markdown
Member

kshyatt commented Mar 26, 2026

Ope, GPU failures look related...

@kshyatt kshyatt self-requested a review March 26, 2026 09:58
@lkdvos
Copy link
Copy Markdown
Member Author

lkdvos commented Mar 26, 2026

Needs #390 first, but should then be ready.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

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

@lkdvos lkdvos marked this pull request as ready for review March 27, 2026 13:23
@lkdvos lkdvos force-pushed the ld-testing branch 2 times, most recently from ab125b5 to e3ce090 Compare March 30, 2026 12:56
return (Vtr, Vℤ₃, VU₁, VfU₁, VCU₁, VSU₂, VfSU₂, VIB_diag, VIB_M)
end

# Gauge-fixing tangents for AD factorization tests
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.

Clearly we should have these functions in the main MAK module?

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 think this is in line with the current MAK approach. I'm happy to migrate this, but probably we should then also do this for MAK itself so we can reuse the functions.

@Jutho
Copy link
Copy Markdown
Member

Jutho commented Mar 30, 2026

This generally looks good; I left a few small comments and questions. But clearly, this is too much change for a detailed review. Is there a convenient way to review such code reorganization, i.e. to separate between what has just moved to other files and what are actual changes. I could probably ask some agent, but I don't feel like doing that.

@lkdvos
Copy link
Copy Markdown
Member Author

lkdvos commented Mar 30, 2026

I don't think there is, but I did try and not actually alter anything except for the organization of the tests.
To summarize:

  • Split files over separate files/folders to have some parallelization
  • Reworked the github actions implementation
  • added a --fast filter that just reduces some of the tests

In principle there is no reason to review the actual contents of the test files, since these are unchanged, which also explains some of the things you commented on.
I'll address those in the meantime.

@lkdvos
Copy link
Copy Markdown
Member Author

lkdvos commented Mar 31, 2026

Update: really struggling with the CUDA tests here, that are not happy with the updated spacelist. After that, I think the branch rules should be updated to check for the test summary succeeding, and this should be good to go from there. Unfortunately I didn't manage to actually get this done, so if someone feels like continuing, that would be great.

@kshyatt
Copy link
Copy Markdown
Member

kshyatt commented Apr 2, 2026

Picking this back up as I exit the JuliaCon mines

@Jutho
Copy link
Copy Markdown
Member

Jutho commented Apr 2, 2026

So there definitely seems to be an issue with the FiniteDifferences specification. I don't know how it works with the separate project.toml and test/project.toml files of what needs to go where. However, FiniteDifferences is in this case only appearing in test/project.toml and only has a compat entry in project.toml, so that definitely looks off.

I'll fix this locally and run the tests locally before committing.

@kshyatt
Copy link
Copy Markdown
Member

kshyatt commented Apr 2, 2026

And I'm looking at the CUDA failure!

@kshyatt
Copy link
Copy Markdown
Member

kshyatt commented Apr 2, 2026

CUDA tests are failing because the output of

bs = blocks(t)
iterate(bs)

is nothing for the IsingBimodule space. I'll try to figure out why.

@Jutho
Copy link
Copy Markdown
Member

Jutho commented Apr 2, 2026

I was wrong; FiniteDifferences is a weakdeps in the main Project.toml, so it makes that its compat entry is in that file, as it is for several other weakdeps, and then this compat entry is not repeated in test/project.toml. Which means I don't understand the FiniteDifferences complaint (I can also not reproduce it locally).

@kshyatt
Copy link
Copy Markdown
Member

kshyatt commented Apr 2, 2026

OK, should be a quick fix..

@borisdevos
Copy link
Copy Markdown
Member

borisdevos commented Apr 2, 2026

CUDA tests are failing because the output of

bs = blocks(t)
iterate(bs)

is nothing for the IsingBimodule space. I'll try to figure out why.

I purposefully avoided testing the VIB_M spaces for certain tests because of the space W = V1 ⊗ V2 ⊗ V3 ⊗ V4 ⊗ V5 being considered. Long story short, it's a hom-space that's forbidden by fusion rules. The new default_spacelist function will take these spaces for every situation.

Edit: turns out I didn't avoid testing them, I just worked around them the same way you did in your recent commit 😄

@timedtestset "Tensors with symmetry: $Istr" verbose = true begin
V1, V2, V3, V4, V5 = V
@timedtestset "Basic tensor properties" begin
W = V1 ⊗ V2 ⊗ V3 ⊗ V4 ⊗ V5
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.

The problem is rather that the IsingBimodule spaces have been constructed such that V1 ⊗ V2 ← V3 ⊗ V4 ⊗ V5 is non-empty. I don't think it was ever the goal to construct a TensorMap{5,0} with codomain given by V1 ⊗ V2 ⊗ V3 ⊗ V4 ⊗ V5.

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.

We should probably be a bit more consistent with which tensors are being constructed, to avoid indeed empty tensor or overly large tensors.

@kshyatt
Copy link
Copy Markdown
Member

kshyatt commented Apr 2, 2026 via email

@Jutho
Copy link
Copy Markdown
Member

Jutho commented Apr 2, 2026

Also, locally I know get Aqua ambiguity warnings (on Julia 1.10)

1 ambiguities found. To get a list, set `broken = false`.
Ambiguity #1
findtruncated_svd(values::AbstractVector, strategy::MatrixAlgebraKit.TruncationUnion) @ MatrixAlgebraKit ~/.julia/packages/MatrixAlgebraKit/x7OBV/src/implementations/truncation.jl:147
findtruncated_svd(values::TensorKit.SectorVector, strategy::MatrixAlgebraKit.TruncationStrategy) @ TensorKit.Factorizations ~/.julia/packages/TensorKit/Lo4KY/src/factorizations/truncation.jl:156

Possible fix, define
  findtruncated_svd(::TensorKit.SectorVector, ::MatrixAlgebraKit.TruncationUnion)

I don't understand how this wasn't caught on previous merges, since this cannot be caused
by the current PR

@kshyatt
Copy link
Copy Markdown
Member

kshyatt commented Apr 2, 2026

I just worked around them the same way you did in your recent commit 😄

Great minds etc etc...

@kshyatt
Copy link
Copy Markdown
Member

kshyatt commented Apr 2, 2026

Also, locally I know get Aqua ambiguity warnings (on Julia 1.10)

1 ambiguities found. To get a list, set `broken = false`.
Ambiguity #1
findtruncated_svd(values::AbstractVector, strategy::MatrixAlgebraKit.TruncationUnion) @ MatrixAlgebraKit ~/.julia/packages/MatrixAlgebraKit/x7OBV/src/implementations/truncation.jl:147
findtruncated_svd(values::TensorKit.SectorVector, strategy::MatrixAlgebraKit.TruncationStrategy) @ TensorKit.Factorizations ~/.julia/packages/TensorKit/Lo4KY/src/factorizations/truncation.jl:156

Possible fix, define
  findtruncated_svd(::TensorKit.SectorVector, ::MatrixAlgebraKit.TruncationUnion)

I don't understand how this wasn't caught on previous merges, since this cannot be caused by the current PR

This is after fixing the FD issue? Could the FD be pushed so I can take a look alongside (if you like, of course!)

@Jutho
Copy link
Copy Markdown
Member

Jutho commented Apr 2, 2026

I am fixing / changing a few other things along the way. I will try to push something later tonight.

@kshyatt
Copy link
Copy Markdown
Member

kshyatt commented Apr 2, 2026 via email

@Jutho
Copy link
Copy Markdown
Member

Jutho commented Apr 2, 2026

Didn't manage to finish this; some tests are still failing, so it feels stupid to strain the CI with that. Will continue tomorrow.

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.

4 participants