← Back to Pull requests

fix: Scope source fingerprints to Git trees and declare additional source inputs #10268

Closed
unknown closed this pull request without merging on Nov 30, 2026 21:51 UTC
View on GitHub
unknown unknown commented on Nov 25, 2026 00:13 UTC
Author

Description

Splits the source-scope part out of #9907, as requested in review. A subproject's source fingerprint now uses the Git tree of its own directory instead of the HEAD commit of its whole checkout, so unrelated commits in rocm-systems, rocm-libraries or TheRock no longer invalidate it. Because of that, sources a subproject reads outside its directory must now be declared, so this PR adds ADDITIONAL_SOURCE_INPUTS and declares them for the real subprojects. CMake argument fingerprinting from #9907 will be a separate PR.

ISSUE ID: #9525

Changes

  • Source identity uses git rev-parse HEAD:./, and the dirty check is limited to the same directory. A .smrev marker still takes priority.

  • New ADDITIONAL_SOURCE_INPUTS argument. Each input is hashed with its path. An input named twice is counted once. A missing or invalid input makes the fingerprint invalid and prints Fingerprint invalid: ....

  • Declarations for every subproject that reads outside its directory (found by scanning CMake files and includes, and by tracing a Linux build). Windows-only inputs are declared under WIN32.

  • shared/ctest (the rocm-systems and rocm-libraries test helpers) is declared only by the subprojects that include it: through THEROCK_ROCM_SYSTEMS_TEST_INPUTS / THEROCK_ROCM_LIBRARIES_TEST_INPUTS when tests are built, or directly by the four that include it in every build (rpp, rocprofiler-compute, hipdnn_integration_tests, hipDNN_samples).

  • docs/development/build_system.md explains when and how to declare ADDITIONAL_SOURCE_INPUTS and lists the current declarations.

  • The consumer-graph parser accepts the new argument without treating it as a dependency.

  • Smaller fixture tests with neutral names, and the identity test loads the real therock_subproject.cmake.
  • Testing

    Unit tests run in the existing Unit Tests workflow (Linux and Windows). This PR adds 21 tests:

    | File | New tests |
    | --- | --- |
    | cmake/tests/therock_source_identity_test.py | 8 |
    | cmake/tests/therock_subproject_source_deps_test.py | 12 |
    | build_tools/tests/cmake_consumer_graph_test.py | 1 |

    The three files (38 tests) run in <fill in> s on Linux and <fill in> s on Windows. Removing any of these makes a test fail: the tree identity, the directory-scoped dirty check, the input path hash, invalidating on a bad input, or the duplicate removal.

    python -m pytest cmake/tests/therock_source_identity_test.py cmake/tests/therock_subproject_source_deps_test.py build_tools/tests/cmake_consumer_graph_test.py --durations=0
    

    Checked by hand on a full tree (not part of this PR): for each relationship below, a file was committed inside the declared input, the tree was reconfigured, and the consuming artifact's fingerprints changed while sysdeps did not.

  • hip-clr reading rocm-systems/projects/hip

  • amd-llvm reading compiler/spirv-llvm-translator

  • amdsmi reading rocm-systems/shared/sha256 (Linux)

  • rocprofiler-compute reading rocm-systems/shared/ctest (Linux)

  • hip-clr reading rocm-systems/shared/amdgpu-windows-interop (Windows)
  • Linux: 4 passed, 1 skipped in 36 s. Windows: 3 passed, 1 skipped in 147 s. Removing a declaration made its check fail. Also on Linux: no Fingerprint invalid messages with tests on or off, and a rocjpeg-only change moves 38 fingerprints (152 on main).

    Rollout

    CI computes fingerprints with this code, but nothing reuses artifacts based on them yet. Before turning reuse on, we compare fingerprint changes per artifact against the commits that caused them for a few weeks (for example, a shared/sha256 change should move amdsmi). Then we turn reuse on in stages: LLVM, then rocm-systems, then rocm-libraries.

    Limitations

  • Nothing detects a new read outside a subproject's directory, for example one added by a submodule bump. A follow-up can add an automatic check; until then, new reads must be declared by hand (see build_system.md).

  • rocm-libraries declarations were not checked on a real tree: with KPACK_SPLIT_ARTIFACTS on, target-specific artifacts have no .fprint files. They are backed by the audit only.

  • Unchanged from before: untracked files are not part of the dirty check, and fingerprints are computed at configure time.
  • <details>
    <summary>Current <code>ADDITIONAL_SOURCE_INPUTS</code> declarations</summary>

    Directories are relative to the TheRock source directory. "Tests" means the directory is declared only when THEROCK_BUILD_TESTING is on.

    | Sub-project | Directories | When |
    | --- | --- | --- |
    | amd-llvm | compiler/spirv-llvm-translator | Always |
    | amd-llvm | rocm-systems/projects/rocr-runtime/runtime/hsa-runtime/inc | Not Windows |
    | therock-aux-overlay | compiler/amd-llvm/cmake/Modules | Not Windows |
    | amdsmi | rocm-systems/shared/cuid, rocm-systems/shared/sha256, rocm-systems/projects/rocr-runtime/libhsakmt/include | Always (amdsmi is not built on Windows) |
    | ROCR-Runtime | rocm-systems/shared/amdgpu-windows-interop | Windows |
    | hrx | rocm-systems/projects/aqlprofile/src/core/include | Always |
    | hip-clr | rocm-systems/projects/hip, rocm-systems/projects/hrr/include, rocm-systems/runtimes/api-headers/include | Always |
    | hip-clr, ocl-clr | rocm-systems/shared/amdgpu-windows-interop, rocm-systems/projects/rocr-runtime | Windows |
    | hipInfo | rocm-systems/projects/hip-tests/samples | Always |
    | ocl-icd | rocm-systems/projects/clr/opencl/khronos/headers | Always |
    | ocl-clr | rocm-systems/runtimes/api-headers/include | Always |
    | hip-tests | rocm-systems/projects/hip-tests | Always |
    | rccl | rocm-systems/projects/rccl-tests/src | Tests |
    | rocjitsu | rocm-systems/runtimes/api-headers | Always |
    | rocprofiler-sdk | rocm-systems/shared/sha256 | Always |
    | rocprofiler-compute | rocm-systems/shared/ctest | Always |
    | profiler-hub | rocm-systems/projects/rocprofiler-sdk/source/share/rocprofiler-sdk-rocpd | Always |
    | rocBLAS | rocm-libraries/shared/tensile | Always |
    | hipBLASLt | rocm-libraries/shared/stinkytofu | Always |
    | rocRAND, hipCCL_tests, rocPRIM_tests, hipCUB, rocThrust | rocm-libraries/shared/primbench | Tests, and on Linux only when amdsmi is built |
    | hipdnn_integration_tests, miopenprovider, hipblasltprovider, hipkernelprovider | rocm-libraries/dnn-providers/cmake | Always |
    | rpp, hipdnn_integration_tests, hipDNN_samples | rocm-libraries/shared/ctest | Always |

    These sub-projects declare shared/ctest through the test input variables, so only when tests are built:

  • ${THEROCK_ROCM_SYSTEMS_TEST_INPUTS}: rccl, rocshmem, rocrtst.

  • ${THEROCK_ROCM_LIBRARIES_TEST_INPUTS}: hipBLAS, hipBLASLt, hipblasltprovider, hipCCL_tests, hipCUB, hipDNN, hipFFT, hipkernelprovider, hipRAND, hipSOLVER, hipSPARSE, hipSPARSELt, hipTensor, MIOpen, miopenprovider, rocALUTION, rocBLAS, rocFFT, rocPRIM_tests, rocRAND, rocRoller, rocSOLVER, rocSPARSE, rocThrust, rocWMMA.
  • </details>

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: erman-gurses Review duration: 8497m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.52) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #10268"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 22.5% · Safe to merge
    22.5%
    Repository