Add static consumer-graph parser #8199
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 347 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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.350
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #8199"
general
weight: 0.35
endurthiabhilash
Motivation
TheRock's committed consumer graph (
test_tools/therock_consumer_graph.json) can drift from the CMake it describes. This adds a static generator that parses the super-project CMake — noENABLE_ALLconfigure, no submodules — and a unit-test suite that enforces the parser is a conservative may-depend superset of the committed graph (it never omits a real node or edge). It changes no test selection and does not make the generated graph authoritative.GitHub issue: https://github.com/ROCm/TheRock/issues/7782
## Technical Details
build_tools/_therock_utils/cmake_consumer_graph.py— parses Git-tracked CMake and extractstherock_cmake_subproject_declaredeps into the reverse-edge schema. Models the dependency-relevant subset (set/list/${var},ifunion,foreach,add_subdirectory/includescope) conservatively; unresolved dependency vars fail loud instead of dropping an edge. Also exposesbuild_subtree_map()(source subtree → graph keys) for follow-up work.build_tools/generate_consumer_graph.py— writes the graph, or--checkdiffs against the committed graph without writing.build_tools/tests/cmake_consumer_graph_test.py— runs in the existing blockingTest build_toolsstep (ubuntu + windows); real-tree invariants run where a checkout is present. Nounit_tests.ymlchange.cmake-parser==0.9.2; RFC0013 documents the generator and adds a Revision History.Test Plan
cd build_tools && python -m pytest tests/cmake_consumer_graph_test.pypython build_tools/generate_consumer_graph.py --checkpre-commit runon changed files; Unit Tests workflow on ubuntu + windows.Test Result
--check:reference_only_* = 0— the committed 117 nodes / 426 edges are all covered; 4 nodes / 11 edges are conservative-only (by design); no dangling or unreachable declarations.pre-commitclean (black / mdformat); cross-platform CI pending on this push.Submission Checklist