← Back to Pull requests

feat(ci): derive test-subproject selection from the consumer graph #6941

Closed
unknown closed this pull request without merging on Aug 07, 2026 21:27 UTC
View on GitHub
unknown unknown commented on Jul 28, 2026 21:36 UTC
Author

Motivation

TheRock CI selects which GPU test suites to run from the set of changed projects, via a hand-maintained TEST_SUBPROJECTS list on each therock_cmake_subproject_declare(). That list is only partially populated, so a change to most subprojects selects nothing beyond itself, producing passing CI runs that never exercised the affected downstream suite (false greens).

This PR makes test selection a derived property of the dependency edges the build already declares, rather than a parallel list kept in sync by hand. Selection walks the reverse-dependency (consumer) graph to a per-component level on a 1–5 gating ladder — default level 4 (the changed component + its direct consumers), with broader/narrower tiers available per component. See
RFC0013 for the design and gating background.

Issue ID: #3343

Technical Details


  • Consumer graph (CMake). therock_cmake_subproject_declare() records a reverse edge per BUILD_DEPS/RUNTIME_DEPS; therock_emit_consumer_graph() serializes it at configure time. The graph is committed to test_tools/therock_consumer_graph.json so the per-PR change-detection job reads it directly — no fetch or configure on the hot path. Removes the TEST_SUBPROJECTS keyword and its per-component uses.

  • Level-based selection (Python). determine_rocm_test_dependencies.py loads the committed graph and, for each changed subproject, walks consumer edges to the depth set by its policy level (5 = self only, 4 = direct consumers, 3 = transitive closure). Build stage is not consulted.

  • Policy overrides (test_tools/test_policies.toml). A small, hand-reviewed file layers explicit intent on the graph: per-component level, plus test_include (additive) and test_exclude (subtractive, applied last) for couplings the graph can't express, test-only targets with no link edge (e.g. rocgdb-cpu, hipinfo) and reverse edges absent from forward deps. Broad-blast-radius runtimes (e.g. rocr-runtime) use level = 3 to auto-derive their downstream set instead of listing it by hand.

  • Drift check (CI). consumer_graph_drift.yml regenerates the graph from a full-tree configure and fails if the committed copy is stale, so the checked-in graph can never silently diverge from the declared dependency edges.
  • Test Plan


  • test_tools/tests/determine_rocm_test_dependencies_test.py covers the level walk (each depth), test_include/test_exclude, and policy validation against the committed graph.

  • build_tools/github_actions/tests/check_consumer_graph_drift_test.py covers the drift check's normalization and pass/fail behavior.
  • Test Result


    <!-- fill in: unit tests pass; selection matches prior behavior for known changes -->

    Submission Checklist


    - [ ] Reviewed CONTRIBUTING.md
    - [ ] Unit tests pass
    - [ ] RFC0013 reflects the merged design

    Diff: 372 lines (+279 / -93) across 4 files Reviewer: endurthiabhilash Review duration: 14391m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 372 lines diff across 4 files
    0.43
    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%
    60%
    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.354
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #6941"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 42.8% (MEDIUM) · Higher = larger blast radius
    42.8%
    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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 16.9% · Safe to merge
    16.9%
    Repository