← Back to Pull requests

fix: Include subproject CMake arguments in fingerprints #10338

Closed
unknown closed this pull request without merging on Dec 02, 2026 00:25 UTC
View on GitHub
unknown unknown commented on Nov 28, 2026 00:42 UTC
Author

Description

Splits the CMake-argument part out of #9907, as requested in review; follows #10268, which scoped source fingerprints. A subproject's fingerprint did not include the arguments TheRock passes when it configures the subproject, so changing one (for example -DBUILD_SHARED_LIBS=ON to OFF) left the fingerprint unchanged and a cache could reuse an artifact built with different options. This PR adds those arguments to the fingerprint.

ISSUE ID: #9525

Changes

  • therock_cmake_subproject_activate hashes the final argument list (declared CMAKE_ARGS plus any <name>_CMAKE_ARGS override), in configure-command order, and adds it to the fingerprint as CMAKE_ARGS_V1=.... Each argument is hashed separately, so argument boundaries, order and repeats count.

  • The arguments are included even when the subproject's stage is imported as prebuilt, so a prebuilt and a real build with the same options get the same fingerprint.

  • Generator expressions are evaluated after fingerprints are computed, so hashing their text could miss a change in their value. Supporting them is deferred: an argument containing one makes the fingerprint invalid, and with THEROCK_VERBOSE configure prints FPRINT invalid: CMake argument '...' contains a generator expression. #10402 and <rocgdb PR> replaced the generator expressions in CMAKE_ARGS with regular variables, so no real fingerprint is invalidated.
  • Testing

    New cmake/tests/therock_subproject_cmake_args_test.py: 7 tests, they use the shared helpers from #10268 to configure a small superproject with three subprojects (one that gets the arguments, one that depends on it, and an unrelated control), check that the inner configure received the argument, and check that the right fingerprints changed while the control did not. Cases: changed, added and removed arguments; a per-project override; reordered repeated arguments; -DVALUE= versus no argument; a prebuilt stage; and $<TARGET_PROPERTY:...>, whose value changes while its text does not (fingerprint invalid both times). All 7 fail without the change, and removing the invalidation is also caught.

    python -m pytest cmake/tests/therock_subproject_cmake_args_test.py --durations=0
    

    <details>
    <summary>Test output (Linux)</summary>

    =================================================================================================================== test session starts ===================================================================================================================
    platform linux -- Python 3.12.3, pytest-9.0.3, pluggy-1.7.0
    rootdir: /home/master/erman/third/TheRock
    configfile: pyproject.toml
    plugins: cov-6.0.0, check-2.5.3, timeout-2.4.0, platformdirs-4.14.8
    collected 7 items                                                                                                                                                                                                                                         
    
    cmake/tests/therock_subproject_cmake_args_test.py .......                                                                                                                                                                                           [100%]
    
    ==================================================================================================================== slowest durations ====================================================================================================================
    0.25s call     cmake/tests/therock_subproject_cmake_args_test.py::CMakeArgumentFingerprintTest::test_declared_argument_changes_output_and_dependency_fingerprints
    0.24s call     cmake/tests/therock_subproject_cmake_args_test.py::CMakeArgumentFingerprintTest::test_generator_expression_with_unknown_value_invalidates_fingerprint
    0.22s call     cmake/tests/therock_subproject_cmake_args_test.py::CMakeArgumentFingerprintTest::test_duplicate_argument_order_preserves_last_value_precedence
    0.22s call     cmake/tests/therock_subproject_cmake_args_test.py::CMakeArgumentFingerprintTest::test_per_project_override_reaches_output_and_fingerprint
    0.09s call     cmake/tests/therock_subproject_cmake_args_test.py::CMakeArgumentFingerprintTest::test_argument_removal_and_restoration
    0.08s call     cmake/tests/therock_subproject_cmake_args_test.py::CMakeArgumentFingerprintTest::test_prebuilt_stage_still_accounts_for_requested_arguments
    0.08s call     cmake/tests/therock_subproject_cmake_args_test.py::CMakeArgumentFingerprintTest::test_explicit_empty_value_is_distinct_from_no_argument
    
    (14 durations < 0.005s hidden.  Use -vv to show these durations.)
    ==================================================================================================================== 7 passed in 1.21s ====================================================================================================================
    

    </details>

    Full configure on Linux (-DTHEROCK_ENABLE_ALL=ON -DTHEROCK_VERBOSE=ON): 119 subprojects fingerprinted, no FPRINT invalid: CMake argument messages.

    Limitations

  • Every fingerprint changes once when this lands, because new content is added. Nothing reuses artifacts by fingerprint yet.

  • Generator expressions in CMAKE_ARGS are not supported yet: an argument using one loses caching for the subproject and its dependents. Pass a value computed at configure time instead.
  • Diff: 650 lines (+487 / -163) across 8 files Reviewer: erman-gurses Review duration: 5743m
    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 #10338"
    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