← Back to Pull requests

Lower one-argument atan, copysign, muladd and float === #327

Closed
unknown closed this pull request without merging on Oct 15, 2026 16:21 UTC
View on GitHub
unknown unknown commented on Oct 14, 2026 20:14 UTC
Author

Several common scalar functions fail to compile on main when broadcast over a tile:

| Function | Error |
|---|---|
| muladd (any float type) | muladd_float … has no Tile IR equivalent |
| copysign | copysign_float … has no Tile IR equivalent |
| atan(x) | the same, since Base's implementation calls copysign |
| isinf | tileiras: 'cuda_tile.cmpi' op operand #0 must be tile of i1 or i8 or i16 or i32 or i64 values, but got '!cuda_tile.tile<256xf32>' |

Changes:

  • muladd_float lowers to Tile IR's fma. muladd allows either a fused or an unfused computation, and Tile IR has a native fma.

  • copysign combines the magnitude bits of one operand with the sign bit of the other, as Tile IR has no copysign.

  • atan(x) maps to atan2(x, 1), as the two-argument form already does.

  • === was lowered to Intrinsics.cmpi for any operand type, so on floats it emitted a cmpi on float tiles. Base defines isinf(x::IEEEFloat) as abs(x) === oftype(x, Inf), so isinf hit this. === now lowers to a new Intrinsics.egal, which bitcasts float operands to unsigned integers of the same width (Base.uinttype) and then emits cmpi. This keeps ==='s bitwise meaning (-0.0 !== 0.0, NaN === NaN), and Intrinsics.cmpi stays integer-only, like Tile IR's cmpi. Integer operands emit the same cmpi as before.
  • Tests: device tests compare each function against the CPU, including isinf on ±Inf, NaN and floatmax, and muladd on Float64 values. A codegen test checks that float === emits bitcast followed by cmpi.

    Assisted by: Opus 5.5

    Diff: 198 lines (+148 / -50) across 2 files Reviewer: maleadt Review duration: 1206m
    All Vouch review confidence checks passed
    Residual risk 0.13 = Change Risk (0.36) × (1 − Review Confidence (0.64)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 198 lines diff across 2 files
    0.36
    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: 70%
    64%
    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.317
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #327"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 64% 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: 36.1% (MEDIUM) · Higher = larger blast radius
    36.1%
    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: 64% · Lower = rushed or shallow review
    64%
    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: 13% · Safe to merge
    13%