← Back to Pull requests

Report parse and execution failures from Process #1129

Merged
aaronj0 merged 2 files (15 lines) on Oct 05, 2026 14:22 UTC
View on GitHub
aaronj0 aaronj0 commented on Sep 30, 2026 12:46 UTC
Author

process's return code is kSuccess even when the parse recovered from emitted errors or a wrapped expression failed at run time (the JIT reports those through diagnostics that cannot always unwind out of the wrapper frame). Trap the diagnostics like Declare does and check the compilation result, so callers can rely on the return code instead of scraping the captured stderr.

Diff: 15 lines (+14 / -1) across 2 files Reviewer: vgvassilev Review duration: 7296m
All Vouch review confidence checks passed
Residual risk 0.03 = Change Risk (0.21) × (1 − Review Confidence (0.85)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.21 · 15 lines diff across 2 files
0.21
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.79 · 5 substantive comment(s)
0.79
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
85%
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.166
Real PR Conversation Timeline
9 items
codecov[bot] codecov[bot] commented on Sep 30, 2026 12:50 UTC
Bot

Codecov Report


:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 88.50%. Comparing base (e731565) to head (8356fe9).
:warning: Report is 7 commits behind head on main.

<details><summary>Additional details and impacted files</summary>

![Impacted file tree graph](https://app.codecov.io/gh/compiler-research/CppInterOp/pull/1129?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=compiler-research)

@@            Coverage Diff             @@
##             main    #1129      +/-   ##
==========================================
+ Coverage   88.44%   88.50%   +0.06%     
==========================================
  Files          24       24              
  Lines        6793     6838      +45     
==========================================
+ Hits         6008     6052      +44     
- Misses        785      786       +1     

| Files with missing lines | Coverage Δ | |
|---|---|---|
| lib/CppInterOp/CppInterOp.cpp | 91.08% <100.00%> (+0.08%) | :arrow_up: |

| Files with missing lines | Coverage Δ | |
|---|---|---|
| lib/CppInterOp/CppInterOp.cpp | 91.08% <100.00%> (+0.08%) | :arrow_up: |
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>

  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

  • </details>

    github-actions[bot] github-actions[bot] commented on Sep 30, 2026 13:00 UTC
    Bot

    clang-tidy review says "All clean, LGTM! :+1:"

    vgvassilev vgvassilev commented on code on Sep 30, 2026 13:57 UTC
    Code Review
    lib/CppInterOp/CppInterOp.cpp:1
    @@ -5869,7 +5869,14 @@ int Declare(const char* code, bool silent) {
     
     int Process(const char* code) {
       INTEROP_TRACE(code);
    -  return INTEROP_RETURN(getInterp().process(code));
    +  // Trap diagnostics like Declare: process's rc is kSuccess even when the
    +  // parse recovered from emitted errors or a wrapped expression failed at
    +  // run time, so callers cannot rely on it alone.
    +  clang::DiagnosticsEngine& Diag = getSema().getDiagnostics();
    +  clang::DiagnosticErrorTrap Trap(Diag);
    +  if (getInterp().process(code) != compat::Interpreter::kSuccess)
    +    return INTEROP_RETURN(1);
    +  return INTEROP_RETURN(Trap.hasErrorOccurred() ? 1 : 0);

    Can we add a test for this?

    aaronj0 aaronj0 commented on code on Oct 05, 2026 12:09 UTC
    Code Review
    unittests/CppInterOp/InterpreterTest.cpp:1
    @@ -427,6 +427,9 @@ TYPED_TEST(CPPINTEROP_TEST_MODE, Interpreter_Process) {
       EXPECT_FALSE(Cpp::Process("error_here;") == 0);
       // Linker/JIT error.
       EXPECT_FALSE(Cpp::Process("int f(); int res = f();") == 0);
    +  // Failed static initializer of a raw declaration.

    Cpp::Process fails on Cling, see https://github.com/root-project/root/pull/23610

    aaronj0 aaronj0 commented on code on Oct 05, 2026 12:14 UTC
    Code Review
    lib/CppInterOp/CppInterOp.cpp:1
    @@ -5869,7 +5869,14 @@ int Declare(const char* code, bool silent) {
     
     int Process(const char* code) {
       INTEROP_TRACE(code);
    -  return INTEROP_RETURN(getInterp().process(code));
    +  // Trap diagnostics like Declare: process's rc is kSuccess even when the
    +  // parse recovered from emitted errors or a wrapped expression failed at
    +  // run time, so callers cannot rely on it alone.
    +  clang::DiagnosticsEngine& Diag = getSema().getDiagnostics();
    +  clang::DiagnosticErrorTrap Trap(Diag);
    +  if (getInterp().process(code) != compat::Interpreter::kSuccess)
    +    return INTEROP_RETURN(1);
    +  return INTEROP_RETURN(Trap.hasErrorOccurred() ? 1 : 0);

    Done

    github-actions[bot] github-actions[bot] commented on Oct 05, 2026 12:17 UTC
    Bot

    clang-tidy review says "All clean, LGTM! :+1:"

    vgvassilev vgvassilev approved these changes on Oct 05, 2026 12:56 UTC
    Approved Reviewer

    Lgtm!

    github-actions[bot] github-actions[bot] commented on Oct 05, 2026 13:46 UTC
    Bot

    clang-tidy review says "All clean, LGTM! :+1:"

    Reviewers
    Assignees
    aaronj0 aaronj0
    Labels
    risk: low confidence: 85.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: 21% (LOW) · Higher = larger blast radius
    21%
    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: 85.5% · Lower = rushed or shallow review
    85.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: 3.1% · Safe to merge
    3.1%