← Back to Pull requests

Add large-scale-diff decimal arithmetic integration tests #17121

Closed
unknown closed this pull request without merging on Dec 01, 2026 05:09 UTC
View on GitHub
unknown unknown commented on Nov 24, 2026 10:27 UTC
Author

Fixes #16895.
Depends on NVIDIA/cudf-spark-jni#5544. (merged now)

Description

Add PySpark CPU/GPU integration test coverage in integration_tests/src/main/python/arithmetic_ops_test.py for large-scale-difference DECIMAL128 addition, subtraction, and integer division with single-partition batches exceeding 256 rows (length=600, num_slices=1). Existing integration tests did not trigger the CUDA 12.9 ptxas sm_120 miscompile in cudf-spark-jni's pow_ten because none of the pairs in test_addition_subtraction_mixed exceeded precision 38 (so rescale drop was always 0), test_int_division_mixed had a maximum scale difference of 5 (never 14, 16, or 18), and two_col_df defaults to num_slices=None (defaultParallelism), which can split 2048 rows into partitions of 256 rows or fewer.

Added tests:

  • test_decimal_addition_subtraction_large_scale_diff: covers Decimal(18,0) +/- Decimal(30,30), Decimal(38,17) +/- Decimal(31,0), Decimal(23,0) +/- Decimal(30,30), and Decimal(38,22) +/- Decimal(31,0) (rescale drops 11 and 16, including Decimal(38,6) clamping without overflowing random inputs to NULL).

  • test_decimal_int_division_large_scale_diff: covers Decimal(12,1) DIV Decimal(20,15), Decimal(12,1) DIV Decimal(22,17), Decimal(18,2) DIV Decimal(24,18), and Decimal(12,1) DIV Decimal(24,19) (scale differences 14, 16, and 18, with lhs integer width larger than rhs so DecimalGen produces non-zero quotients rather than zeros that would mask downward pow_ten truncation).
  • Validation:

  • Latest commit (b90db65c3): validated locally on Blackwell (sm_120) against the release/26.12 build of NVIDIA/cudf-spark-jni#5544 (49618a37), and passed python3 -m py_compile and git diff --check.

  • GitHub checks (CPU CI gate, mvn[compile,RAT,scalastyle,docgen], pr-description-check, signoff-check, license-header-check) all passed.

  • Not yet validated in Blossom CI against a published cudf-spark-jni:26.12.0-SNAPSHOT containing NVIDIA/cudf-spark-jni#5544.
  • AI assistance (Devin) was used to prepare the tests and this pull request description; the author reviewed the diff and description before publication.

    Checklists

    Documentation

  • Updated for new or modified user-facing features or behaviors

  • No user-facing change
  • Testing

  • Added or modified tests to cover new code paths

  • Covered by existing tests

  • (Please provide the names of the existing tests in the PR description.)
  • Not required
  • Performance

  • Tests ran and results are added in the PR description

  • Issue filed with a link in the PR description

  • Not required — test-only change; no runtime code or artifacts modified.
  • Diff: 342 lines (+256 / -86) across 4 files Reviewer: res-life Review duration: 9762m
    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 · 342 lines diff across 4 files
    0.42
    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%
    60%
    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.349
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #17121"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.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: 42.3% (MEDIUM) · Higher = larger blast radius
    42.3%
    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: 60.5% · Lower = rushed or shallow review
    60.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: 16.7% · Safe to merge
    16.7%