← Back to Pull requests

Choose Int64 TileArray indices for long arrays #361

Closed
unknown closed this pull request without merging on Nov 27, 2026 07:20 UTC
View on GitHub
unknown unknown commented on Nov 25, 2026 14:00 UTC
Author

TileArray(arr) chose Int32 indices whenever every size and stride fit in Int32. An array with more than typemax(Int32) elements, such as a 65536×65536 matrix, passes that check while its element offsets don't fit. The address arithmetic cuTile does itself in the index type then overflows: the linear index in 2D gather/scatter and the base offset of @view. On an RTX 5080 with a 65536×65536 Int8 array:

| Access | before | after |
|---|---|---|
| ct.load of the last tile | correct | correct |
| @view a[:, N:N], then load | ERROR_ILLEGAL_ADDRESS | correct |
| ct.gather(a, (N, N)) | ERROR_ILLEGAL_ADDRESS | correct |

Tile loads and stores are unaffected because tileiras widens its own address computation.

The default now also requires the offset of the last element to fit, so every Int32-indexed array satisfies the invariant that all element offsets fit in its index type. cuTile Python instead keeps int32 shapes and widens gather/scatter offsets to 64 bits unconditionally. Enforcing the invariant at conversion fixes every I-typed offset computation at once, and arrays below 2³¹ elements keep the narrow path.

An explicit index=Int32 is still honored when sizes and strides fit, so it remains usable for kernels that only use tile loads and stores. The docs now spell out the caveat for gather, scatter and @view.

Diff: 171 lines (+128 / -43) across 2 files Reviewer: maleadt Review duration: 2479m
All Vouch review confidence checks passed
Residual risk 0.13 = Change Risk (0.35) × (1 − Review Confidence (0.64)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.35 · 171 lines diff across 2 files
0.35
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.308
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #361"
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: 35.2% (MEDIUM) · Higher = larger blast radius
35.2%
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: 12.7% · Safe to merge
12.7%