← Back to Pull requests

Use configured tools for ThinLTO indexing #852

Open
cerisier opened this pull request with 43 lines diff across 5 files
View on GitHub
cerisier cerisier commented on Aug 21, 2026 12:18 UTC
Author

ThinLTO indexing shares link finalization, but tool lookup currently uses the final link action instead of the indexing action. A rule-based toolchain with a dedicated indexing driver therefore runs the ordinary linker, and files owned only by that indexing tool are omitted from the legacy linker_files input set.

Use the actual action name for tool selection and associate all three ThinLTO indexing actions with linker_files. Ordinary link and archive actions are unchanged. Focused analysis coverage assigns distinct tools to executable linking and indexing, and covers all three file-group mappings.

Diff: 43 lines (+42 / -1) across 5 files Reviewer: lilygorsheneva Review duration: 100127m
All Vouch review confidence checks passed
Residual risk 0.12 = Change Risk (0.62) × (1 − Review Confidence (0.81)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.62 · 43 lines diff across 5 files
0.62
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.71 · 5 substantive comment(s)
0.71
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
80%
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.226
Sensitive Paths sensitive_paths
0.062
Real PR Conversation Timeline
9 items
lilygorsheneva lilygorsheneva commented on Aug 24, 2026 16:10 UTC
Reviewer

LGTM, might need to resolve merge confilcts

cerisier cerisier commented on Oct 16, 2026 17:15 UTC
Author

@lilygorsheneva thanks for the review ! CI is green now !

cerisier cerisier commented on Oct 18, 2026 22:04 UTC
Author

Seems all green !

pzembrod pzembrod commented on code on Oct 19, 2026 14:55 UTC
Code Review
tests/cc/common/cc_binary_thin_lto_tests.bzl:1
@@ -179,6 +180,31 @@ def _test_thin_lto_action_graph_impl(env, target):
         ),
     )
 
+def _test_thin_lto_index_uses_its_action_tool(name, **kwargs):
+    util.helper_target(
+        cc_binary,
+        name = name + "/bin",
+        srcs = ["hello.cc"],
+    )
+    cc_analysis_test(
+        name = name,
+        impl = _test_thin_lto_index_uses_its_action_tool_impl,
+        target = name + "/bin",
+        test_features = ["thin_lto", "supports_start_end_lib"],
+        with_action_configs = [
+            ACTION_NAMES.cpp_link_executable,
+            ACTION_NAMES.lto_index_for_executable,
+        ],
+        **kwargs
+    )
+
+def _test_thin_lto_index_uses_its_action_tool_impl(env, target):
+    index_action = env.expect.that_target(target).action_named("CppLTOIndexing")
+    env.expect.that_str(index_action.actual.argv[0]).equals("tests/cc/testutil/toolchains/lto_index_tool")

This should be replaceable with
index_action.argv().offset(0, factory=subjects.str).equals("tests/cc/testutil/toolchains/lto_index_tool")

Likewise the next env.expect.that_str assertion. It's always preferable to follow the chain of subjects once one has a subject to start with (index_action in this case), rather than referring to .actual and then constructing a new subject from scratch. It provides better failure messages with more context in case the test fails.

cerisier cerisier commented on code on Oct 19, 2026 16:04 UTC
Code Review
tests/cc/common/cc_binary_thin_lto_tests.bzl:1
@@ -179,6 +180,31 @@ def _test_thin_lto_action_graph_impl(env, target):
         ),
     )
 
+def _test_thin_lto_index_uses_its_action_tool(name, **kwargs):
+    util.helper_target(
+        cc_binary,
+        name = name + "/bin",
+        srcs = ["hello.cc"],
+    )
+    cc_analysis_test(
+        name = name,
+        impl = _test_thin_lto_index_uses_its_action_tool_impl,
+        target = name + "/bin",
+        test_features = ["thin_lto", "supports_start_end_lib"],
+        with_action_configs = [
+            ACTION_NAMES.cpp_link_executable,
+            ACTION_NAMES.lto_index_for_executable,
+        ],
+        **kwargs
+    )
+
+def _test_thin_lto_index_uses_its_action_tool_impl(env, target):
+    index_action = env.expect.that_target(target).action_named("CppLTOIndexing")
+    env.expect.that_str(index_action.actual.argv[0]).equals("tests/cc/testutil/toolchains/lto_index_tool")

Understood! Will change accordingly !

cerisier cerisier commented on code on Oct 22, 2026 20:08 UTC
Code Review
tests/cc/common/cc_binary_thin_lto_tests.bzl:1
@@ -179,6 +180,31 @@ def _test_thin_lto_action_graph_impl(env, target):
         ),
     )
 
+def _test_thin_lto_index_uses_its_action_tool(name, **kwargs):
+    util.helper_target(
+        cc_binary,
+        name = name + "/bin",
+        srcs = ["hello.cc"],
+    )
+    cc_analysis_test(
+        name = name,
+        impl = _test_thin_lto_index_uses_its_action_tool_impl,
+        target = name + "/bin",
+        test_features = ["thin_lto", "supports_start_end_lib"],
+        with_action_configs = [
+            ACTION_NAMES.cpp_link_executable,
+            ACTION_NAMES.lto_index_for_executable,
+        ],
+        **kwargs
+    )
+
+def _test_thin_lto_index_uses_its_action_tool_impl(env, target):
+    index_action = env.expect.that_target(target).action_named("CppLTOIndexing")
+    env.expect.that_str(index_action.actual.argv[0]).equals("tests/cc/testutil/toolchains/lto_index_tool")

Done

cerisier cerisier commented on Oct 22, 2026 20:10 UTC
Author

Let me know if anything is needed more

lilygorsheneva lilygorsheneva approved these changes on Oct 22, 2026 21:11 UTC
Approved Reviewer

Approved these changes.

Assignees
cerisier cerisier
Labels
risk: low confidence: 80.5% reviewed sensitive_module
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: 61.7% (MEDIUM) · Higher = larger blast radius
61.7%
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: 80.5% · Lower = rushed or shallow review
80.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: 12% · Safe to merge
12%