Testing in TheRock

August 13, 2026 ยท View on GitHub

TheRock is the integration point for build, test, packaging, and release infrastructure for the ROCm Core SDK. The code here is used by developers building ROCm from source, CI systems validating pull request contributions in repositories like rocm-systems and rocm-libraries, and release workflows publishing nightly and stable releases in rockrel which are trusted by users and downstream projects.

TheRock aims to keep ROCm "ready to release" at any time. Achieving this at scale requires robust automated tests that detect issues as close as possible to their source. Early detection limits the impact of regressions and makes them easier to diagnose and fix, while continuous validation provides the confidence needed to release frequently.

Testing must scale across a broad support surface. ROCm includes 40+ subprojects, supports 25+ GPU targets across multiple hardware generations, runs on multiple operating systems, is distributed via multiple packaging formats, and is used by many downstream frameworks. Testing every combination for every change is not practical, so TheRock layers automated tests according to their cost and the confidence they provide. Presubmit testing prioritizes fast, high-signal test suites and configurations with enough capacity to run for every change. Longer test suites and hardware with limited runner capacity are exercised through nightly, scheduled, and on-demand testing.

Testing should be accessible to all contributors. Wherever possible, code and automation should be structured so that important behavior can be tested quickly on commonly available development machines. Local testing usually provides the fastest feedback, while continuous integration (CI) workflows provide consistent environments for validating changes across representative project-wide configurations and component boundaries.

The ROCm Core SDK is built and released as a single product. Individual subprojects may validate their own behavior in isolation, then TheRock assembles and tests those projects together as often as practical throughout development to provide confidence in cross-component behavior and product-wide properties that component-level testing cannot evaluate.

This page describes how these testing layers work together to validate changes to TheRock and the ROCm subprojects it integrates. It also explains how code and automation are structured for testing, which validation methods apply to each feature area, and the known limitations of the current coverage.


Table of contents


Testing changes to TheRock

Test categories in TheRock

Tests for the code in TheRock itself are split into a few broad categories:

Tests in each category should be runnable as part of local development and also run as part of our CI workflows:

Test typeTarget test runtimeCI workflows
pre-commit10 seconds
unit tests5 minutes (independent of builds)
integration tests30 minutes (after builds)

Project features should be tested using a combination of these test types that balance time to signal and representative coverage. For example, Python packages should have both unit tests for package building and integration tests for package installation and runtime behavior.


TheRock feature area: CMake and super-project build logic

Super-project CMake build - Scope

As the centralized build system for ROCm Core, TheRock includes a CMake super-project using code in:

The build system supports a broad matrix of configurations:

Matrix dimensionAvailable configurationsTypical CI coverage
Operating systemLinux (multiple distros), WSL, WindowsLinux (manylinux), WSL, Windows
Build variantRelease, Debug, Address Sanitizer (ASan), etc.Release
AMDGPU build/test targetsgfx942, gfx950, gfx1100, gfx1200, etc.1-5 targets (based on test runner availability)
Enabled subprojectsTHEROCK_ENABLE_ALL, THEROCK_ENABLE_PROFILER, etc.All enabled, subsets as an optimization
Enabled feature flagsSee FLAGS.cmake and docs/development/flags.mdDefault values
Other CMake optionsTHEROCK_BUILD_TESTING, THEROCK_BUNDLE_SYSDEPS, etc.Default values

Super-project CMake build - Design for testing

The CMake build system is designed to be reproducible, configurable, and debuggable:

  • We use the same build system for Linux and Windows with minimal branching.
  • Subproject builds can be run in isolation and their configured options can be viewed via _init.cmake and _toolchain.cmake files (see build_system.md).
  • Build commands are routed through teatime.py so all logs are written to ${build}/logs/. CI/CD workflow runs upload logs to S3 buckets (see s3_buckets.md) following the schema in workflow_outputs.md.
  • Build performance logs are collected by ninja and uploaded together with other logs using post_stage_upload.py.
  • Common base CMake option combinations are managed through CMakePresets.json.

Source code:

Build environments:

Super-project CMake build - Validation methods

We are evaluating adding unit tests for certain features of the CMake build system itself, see https://github.com/ROCm/TheRock/pull/6984 for example.

The CI systems in TheRock and component repositories like rocm-systems continuously build a few slices through our support matrix. For changes to build system files, we generally look for

  • The build and test jobs in .github/workflows/multi_arch_ci.yml should not have new failures.
  • The build jobs should not significantly regress in duration.
  • The build artifacts should not unexpectedly grow in size.

Important

Certain types of changes benefit from additional validation, such as:

  • Adding new subprojects
  • Adjusting support for specific AMDGPU targets
  • Updates to the compiler (llvm-project)

Pull requests that modify key git submodules in TheRock automatically run extra CI jobs. These extra CI jobs can be enabled for other PRs through the mechanisms documented in ci_behavior_manipulation.md.

Super-project CMake build - Limitations and known gaps

Warning

The full matrix of all build settings and feature combinations is too expensive to test as part of every change, so we rely on a progressively expanding list of jobs as part of our CI/CD systems. Some non-default build variants like Debug and Address Sanitizer (ASan) also stress the build system and CI servers in unique ways so they are particularly costly to test regularly.

Tip

As a general reference, here are some metrics for different CI jobs as of July 2026:

Job descriptionWall timeBuild runner usageTest runner usage
rocm-systems per-commit CI
  • Linux, Windows
  • 2 GPU families
  • "standard" test type
3 hours4 hours2 hours
TheRock per-commit CI
  • Linux, Windows
  • 5 GPU families
  • "quick" test type
4 hours12 hours10 hours
Nightly releases
  • Linux, Windows
  • 15+ GPU families
  • "comprehensive" test type
6 hours40+ hours100+ hours

Our target is 30 minutes "time to signal" wall time including builds and tests.

Warning

We do not yet actively track build duration or binary size metrics, nor do we report diffs in these metrics on PRs.

See https://github.com/ROCm/TheRock/issues/5325.


TheRock feature area: GitHub Actions workflows

GitHub Actions workflows - Scope

We use GitHub Actions in the .github/workflows directory for a variety of workflows:

  • Lightweight checks: codeql.yml, gitleaks.yml, pre-commit.yml, unit_tests.yml, therock-pr-bot.yml, etc.
  • CI/CD workflows: multi_arch_ci.yml, multi_arch_release.yml, etc.
  • Other automation: bump_submodules.yml, copy_release.yml, publish_build_manylinux_x86_64.yml

Many of these workflows are central to day-to-day project development and official releases, so care must be taken to test them thoroughly.

GitHub Actions workflows - Design for testing

Workflows can take hours to run and can be difficult to debug, so we follow these practices to make testing manageable:

GitHub Actions workflows - Validation methods

We test our GitHub Actions workflows using a combination of these practices:

GitHub Actions workflows - Limitations and known gaps

Cross-repository workflow design and testing is difficult, so we try to limit such usage and review changes carefully.

Warning

In https://github.com/ROCm/rockrel (our dedicated releases repository with tighter access controls) we use unpinned references so nightly releases always use the latest code:

uses: ROCm/TheRock/.github/workflows/multi_arch_release.yml@main

This has been a frequent source of breaks where workflow inputs differ across repositories if parity commits are not merged together. See https://github.com/ROCm/rockrel/issues/49 for ideas to improve that.


TheRock feature area: Python scripts and tools

Python scripts and tools - Scope

Most build system and utility scripts are written in Python, not Bash or other languages. Our GitHub Actions workflows also use Python scripts for the bulk of their logic (see the GitHub Actions workflows section above).

Python scripts and tools - Design for testing

We test our Python scripts using pytest, aiming to follow the style guidelines in python_style_guide.md and particularly the "testing standards" section.

Tip

These patterns can make testing scripts easier:

  • Add --dry-run modes to scripts with dangerous or expensive side effects.
  • Design for running locally, iterate via local usage and unit tests, and then integrate into GitHub Actions workflows or other cloud pipelines as needed.

Python scripts and tools - Validation methods

All Python unit tests should be run as part of .github/workflows/unit_tests.yml, with the help of files like build_tools/pyproject.toml.

Note that simple unit tests do not fully replace integration testing using real build tools, packages, or remote APIs.

Python scripts and tools - Limitations and known gaps

Warning

Some tests have been added without including them on CI, which is getting fixed via https://github.com/ROCm/TheRock/issues/6927.

Warning

We measure Python code coverage as part of .github/workflows/unit_tests.yml, but we do not yet track it continuously, surface the coverage diff on PRs, or set any project-wide or area-specific target percentages.

Warning

A few tests require authenticated API access to use real services instead of mocks. These tests are skipped automatically when credentials are missing.


TheRock feature area: Packaging

Packaging - Scope

The artifacts produced by the build system are assembled into tarballs/archives, Python packages, and native operating system packages for distribution.

Packaging - Design for testing

  • Packages should be buildable from ROCm artifacts using scripts in build_tools/packaging/ with documentation in docs/packaging/.
  • With the exception of package signing, developers and downstream projects should be able to build packages exactly as TheRock's CI/CD system does.
  • Packages should use dev/nightly/stable versions following docs/packaging/versioning.md for version/channel sorting and auditability.

Packaging - Validation methods

Packages are tested using a combination of these practices:

  • Unit tests for package construction scripts
    • Test structural metadata for inputs and outputs, file inclusion/exclusion filters, script portability across environments
  • Installation tests which check that packages can be installed and used:
    • Package self-tests (example: rocm-sdk test, see Python Packaging - Testing).
    • Install tests may run on multiple operating systems / distros since we build packages to be portably distributed.
    • Integration and regression tests for interactions between multiple packages, ensuring that ROCm packages are self-sufficient, don't conflict with system packages, and can be used together with other ecosystem packages

Native Linux packaging unit tests live under build_tools/packaging/linux/tests/.

Tip

Package installation tests should be modeled closely after user-facing install instructions. If the installation instructions are complicated or include workarounds, aim to improve that at the source rather than apply workarounds local to CI tests.

Packaging - Limitations and known gaps

Warning

We currently only run packaging-focused tests on packages. This can miss when subprojects pass their tests for one package type but fail for another package type, such as when

  • Python packages are missing multi-arch / kpack split .kpack files
  • Native Linux packages are missing xnack+ files for ASan

See https://github.com/ROCm/TheRock/issues/5384.



Testing changes to ROCm subprojects with TheRock

This section focuses on how TheRock is used to test changes to ROCm subprojects such as amd-llvm, hip-clr, RCCL, MIOpen, etc.

Subprojects which get built and released by TheRock as "ROCm core" store their own source code in separate repositories such as:

During development in those repositories, changes may be tested with a combination of

  • "Component CI" that can be specialized per subproject and generally exercises individual subprojects directly
  • "TheRock CI" that leverages the unified build system, builds and tests multiple subprojects together, and closely matches the release environment

Attempts are made to "bump" each submodule reference in TheRock regularly (see .github/workflows/bump_submodules.yml), and these "bump PRs" run more exhaustive builds and tests than "TheRock CI" runs in the subproject source repositories.

Workflows running in https://github.com/ROCm/rockrel build release packages using code from TheRock and then trigger even more comprehensive tests across available GPU test runners.

Building subprojects through TheRock

Once a subproject's source code is included in TheRock, it can be integrated into the build system to produce artifacts by following build_system.md - Adding subprojects. Artifacts produced for subprojects are included in packages using the configuration code in build_tools/packaging/.

Tip

See git_chores.md - Adding a new submodule for instructions on how to add new submodules.

Warning

Adding or removing subprojects, or making deep changes to existing subprojects, can affect configurations outside of the default CI matrix. Such changes may benefit from targeted validation on additional GPU targets, platforms, or build variants. See the TheRock feature area: CMake and super-project build logic section above as well as the CI Behavior Manipulation docs.

Testing subprojects through TheRock

Subproject build tests

Subprojects can run CPU-only tests during the build by using the therock_cmake_subproject_build_test() function defined in cmake/therock_subproject.cmake, like so:

# Using ctest
therock_cmake_subproject_build_test(rocjitsu
  COMMAND "${CMAKE_CTEST_COMMAND}" --output-on-failure --no-tests=error
)

# Using a python test runner
therock_cmake_subproject_build_test(amd-comgr
  COMMAND
    "${Python3_EXECUTABLE}" "${_llvm_lit_script}"
    "${CMAKE_BINARY_DIR}/compiler/amd-comgr/build/test-lit" -v
)

These build tests can be run from the superproject CMake build via

cmake --build "${BUILD_DIR}" --target therock-build-tests -- -k 0

Tip

Logs for build tests can be found next to the other build outputs:

 amd-comgr_build.log
+amd-comgr_build_test_1.log
+amd-comgr_build_test_2.log
 amd-comgr_configure.log
 amd-comgr_install.log

See also the Super-project CMake build - Design for testing section above.

Warning

Build tests currently run after other build steps rather than in parallel with them. This can introduce bottlenecks and could be revisited once all build tests pass and can be marked blocking, see notes in .github/workflows/multi_arch_build_portable_linux_artifacts.yml and .github/workflows/multi_arch_build_windows_artifacts.yml as well as https://github.com/ROCm/TheRock/issues/4789.

Subproject test runner

Subprojects can run installed component tests, including GPU tests, after the build by adding a test script to /build_tools/github_actions/test_executable_scripts/.

Tests should

Tip

See adding_tests.md for instructions on how to add tests for a subproject to TheRock's CI.