Skip to content

Tests: per-backend test environments - #237

Merged
luraess merged 2 commits into
mainfrom
lr/test-envs
Oct 22, 2026
Merged

luraess merged 2 commits into
mainfrom
lr/test-envs

Conversation

@luraess

@luraess luraess commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

The test target installed CUDA, AMDGPU, Metal, Enzyme, KernelAbstractions and Polyester together on every platform. Resolving them jointly held each GPU package back (CUDA 6.2.2 and AMDGPU 2.7.0 on Julia 1.13, while 6.4.x and 2.9.x are released) and has no solution at all on the upcoming Julia release (pre). Each CI job also downloaded the GPU packages it then skipped.

Changes

  • test/Project.toml replaces the [extras]/[targets] test target. It holds only the always-needed test dependencies; the GPU packages are not among them.
  • The test runner installs the GPU backend to test. PS_TEST_BACKEND=CUDA|AMDGPU|Metal now has two effects: runtests.jl installs the package (plus CUDA_Runtime_jll for CUDA, so that a local CUDA runtime preference applies) into the temporary test environment of Pkg.test if it is not already there, and the tests of that backend must run. Without the variable, the CPU backends are tested. The CI jobs only set the variable, which they already did (CUDA on Daint, AMDGPU on Beverin, Metal on the macOS runners); the installation is repeated per run since the test environment is temporary, which is fast with a warm depot.
  • test/packages.jl, included by every test file, replaces the backend-selection preamble that was repeated in 18 files. It imports the GPU packages that are installed, defines empty placeholder modules for the others (the test files refer to the packages by name, e.g. $package == $PKG_CUDA compares the modules), and sets TEST_PACKAGES to the installed and functional ones.
  • Small test adjustments needed by the above: KernelAbstractions GPU backend types are referred to qualified in the select_hardware tests (they only exist once the GPU package is loaded), the CellArrays type definitions in test_allocators.jl are selected with @static if, and TEST_PACKAGES is a copy of SUPPORTED_PACKAGES instead of an alias (the tests no longer mutate the package constant).
  • The Testing page of the docs describes PS_TEST_BACKEND and the optional permanent Pkg.add into the test environment.

Effect

  • Each job tests the newest release of its backend that is compatible with ParallelStencil: on GH200 the test environment now resolves CUDA 6.4.1 instead of 6.2.2. (KernelAbstractions stays at 0.9 because of the package's compat bound; lifting it to 0.10 is a separate change.)
  • The pre job should resolve again, since no job installs more than one GPU package (the conflict was between AMDGPU, CUDA and Enzyme together); to be confirmed by its run on this PR.
  • Smaller environments: the GH200 job no longer installs AMDGPU and Metal, the macOS jobs no longer install CUDA and AMDGPU.

…installed by the test runner)

The test target installed CUDA, AMDGPU, Metal, Enzyme, KernelAbstractions and Polyester
together on every platform, which held each GPU package back (CUDA 6.2.2, AMDGPU 2.7.0 on
Julia 1.13) and has no solution on Julia pre.

- test/Project.toml replaces the [extras]/[targets] test target; it holds only the
  always-needed test dependencies, no GPU package.
- runtests.jl installs the backend given by PS_TEST_BACKEND (CUDA with CUDA_Runtime_jll,
  AMDGPU or Metal) into the temporary test environment of Pkg.test if it is not installed;
  the tests of that backend must then run. The CI jobs only set the variable.
- test/packages.jl replaces the backend-selection preamble repeated in 18 test files;
  GPU packages that are not installed are replaced by empty placeholder modules, as the
  test files refer to the packages by name.
- select_hardware tests: KernelAbstractions GPU backend types referred to qualified;
  test_allocators.jl: CellArrays type definitions selected with @static if;
  TEST_PACKAGES is a copy of SUPPORTED_PACKAGES instead of an alias.
- Docs: Testing page updated.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@codecov-commenter

codecov-commenter commented Oct 22, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.60%. Comparing base (bf33d32) to head (47c2df9).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

☔ View full report in Codecov by Harness.
📢 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.

…e GPU backend

Pkg's automatic precompilation after Pkg.add fails with "Unknown package" for indirect
dependencies whose version changed (GPUCompiler when adding AMDGPU), as it identifies
them by name in the test environment.
@luraess
luraess merged commit 652350d into main Oct 22, 2026
9 of 10 checks passed
@luraess
luraess deleted the lr/test-envs branch October 22, 2026 21:02
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