← Back to Pull requests

Support tuple equality in CUDA kernels #401

Merged
atmnp merged 2 files (91 lines) on Oct 22, 2026 16:11 UTC
View on GitHub
atmnp atmnp commented on Oct 22, 2026 02:00 UTC
Author

Lower == and != through unrolled field comparisons, reusing scalar promotions and handling unequal lengths and nested tuples (src/numba_cuda_mlir/lowering/builtins.py:131-161).

Cover the reported kernel plus runtime, mixed-type, empty, nested, namedtuple and NaN comparisons (tests/test_tuple.py:10-65).

Fixes #371.

Diff: 91 lines (+91 / -0) across 2 files Reviewer: brandon-b-miller Review duration: 850m
All Vouch review confidence checks passed
Residual risk 0.09 = Change Risk (0.32) × (1 − Review Confidence (0.71)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.32 · 91 lines diff across 2 files
0.32
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.57 · 4 substantive comment(s)
0.57
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
71%
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.271
Real PR Conversation Timeline
6 items
copy-pr-bot[bot] copy-pr-bot[bot] commented on Oct 22, 2026 02:00 UTC
Bot

Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

coderabbitai[bot] coderabbitai[bot] commented on Oct 22, 2026 02:05 UTC
Bot

<!-- coderabbit-ai-generated:v1 -->

<!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- review_stack_entry_start -->

<a href="https://app.coderabbit.ai/change-stack/NVIDIA/numba-cuda-mlir/pull/401?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=3"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3" alt="Review in Change Stack →" height="32"></picture></a>

<!-- review_stack_entry_end -->
<!-- recent_review_start -->

No actionable comments were generated in the recent review. 🎉

<details>
<summary><strong>ℹ️ Recent review info</strong></summary>
<dl>
<dd>

<details>
<summary><strong>⚙️ Run configuration</strong></summary>
<dl>
<dd>

  • Configuration used: Repository: NVIDIA/numba-cuda-mlir/.coderabbit.yaml

  • Review profile: CHILL

  • Plan: Enterprise

  • Run ID: 4600cfce-f755-46bf-a68c-4c425bb0d259
  • </dd>
    </dl>
    </details>

    <details>
    <summary><strong>📥 Commits</strong></summary>
    <dl>
    <dd>

    Reviewing files that changed from the base of the PR and between 54013667d7bae06d8c853c0ead8a86ceacaa786d and 5520a0be67a428e92931a202e5aeb8fdcac1117f.

    </dd>
    </dl>
    </details>

    <details>
    <summary><strong>📒 Files selected for processing: 2</strong></summary>
    <dl>
    <dd>

    src/numba_cuda_mlir/lowering/builtins.py
    tests/test_tuple.py

    </dd>
    </dl>
    </details>

    Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

    </dd>
    </dl>
    </details>

    <!-- recent_review_end -->
    <!-- walkthrough_start -->

    <details>
    <summary><strong>📝 Walkthrough</strong></summary>
    <dl>
    <dd>

    important: Tuple equality and inequality now have lowerings for BaseTuple. Tests cover tuple and namedtuple comparisons in CUDA kernels.

    Changes: Tuple comparison

    |Layer / File(s)|Summary|
    |:---|:---|
    |Tuple comparison lowering and tests <br> src/numba_cuda_mlir/lowering/builtins.py, tests/test_tuple.py|Tuple equality returns false for different lengths and otherwise compares corresponding elements. Tuple inequality negates equality. Kernel tests cover varied values, element types, nested tuples, empty and mismatched-length tuples, and namedtuples.|

    Assessment against linked issues

    |Objective|Addressed|Explanation|
    |:---|:---|:---|
    |[#371] Support tuple equality in a kernel using element-wise equality for equal-length tuples.|✅||

    Suggested reviewers: ccam80

    </dd>
    </dl>
    </details>

    <!-- walkthrough_end -->
    <!-- change_assessment_start -->
    Priority: ➖ Normal

    <!-- change_assessment_commit:"5520a0be67a428e92931a202e5aeb8fdcac1117f" -->
    Change: Bug fix · Severity of issue fixed: Medium
    <!-- change_assessment_end -->
    <details>
    <summary><strong>Merge Risk:</strong> <strong>⚪ Minimal</strong> · up to <code>5520a</code></summary>
    <dl>
    <dd>

    <!-- final_review_risk_start -->
    <!-- final_review_risk_label
    Merge Risk: ⚪ Minimal · up to 5520a
    -->
    <!-- final_review_risk_coverage:{"sourceCommitId":"5520a0be67a428e92931a202e5aeb8fdcac1117f","coveredCommitId":"5520a0be67a428e92931a202e5aeb8fdcac1117f","kind":"reviewed"} -->

    Tuple equality and inequality have no identified merge-blocking issue; merge after normal checks.
    <!-- final_review_risk_end -->

    </dd>
    </dl>
    </details>
    <!-- autopilot:start -->

  • <!-- {"checkboxId":"2708ad07-9f24-4260-9c11-7dc76a49f2e3"} --> <strong title="Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts">Autofix</strong> · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

  • <!-- autopilot:end -->
    <!-- tips_start -->

    <sub>Comment @coderabbitai help to get the list of available commands.</sub>

    <!-- tips_end -->

    atmnp atmnp commented on Oct 22, 2026 14:16 UTC
    Author

    /ok to test 5520a0be67a428e92931a202e5aeb8fdcac1117f

    github-actions[bot] github-actions[bot] commented on Oct 22, 2026 14:27 UTC
    Bot

    Doc Preview CI
    :---:
    Preview removed because the pull request was closed or merged.
    <!-- Sticky Pull Request Commentpr-preview -->

    brandon-b-miller brandon-b-miller approved these changes on Oct 22, 2026 14:57 UTC
    Approved Reviewer

    LGTM.

    Assignees
    atmnp atmnp
    Labels
    risk: low confidence: 71.2% 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: 31.5% (LOW) · Higher = larger blast radius
    31.5%
    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: 71.2% · Lower = rushed or shallow review
    71.2%
    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: 9.1% · Safe to merge
    9.1%