[rocjitsu][consan] Preserve per-entry ABI in prepared images #16514
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.45) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 428 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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.363
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #16514"
general
weight: 0.35
hanhanW
Whole-image preparation rejects compiler metadata such as hidden arguments and required workgroup shapes. Shared validation also requires every entry to have a zero-sized private segment, so a native sibling can prevent preparation even when only other kernels are selected for instrumentation.
Separate metadata consistency from instrumentation eligibility. Recognize supported hidden arguments,
constantbuffer pointers, power-of-two kernarg alignment and required workgroup shapes while retaining argument width, offset and bounds checks:Carry each entry's
.kernarg_segment_alignand.reqd_workgroup_sizethrough preparation, saved facts and artifact verification. At runtime, usemax(metadata alignment, HSA alignment)for kernarg admission and reject launches that differ from the original required shape. Preserve workgroup identity sources and existing multi-workgroup, barrier and loop report layouts.Extend the entry wire format and change the producer compatibility token. Older artifacts must be regenerated.
Example walkthrough
Select A/B in an image containing A, B and C. The extended ABI fixture has these original requirements (sizes are in bytes):
| Entry | Kernarg | Alignment | LDS | Private | Required workgroup |
|-------|---------|-----------|-----|---------|--------------------|
| A | 16 | 8 | 8 | 0 |
64x1x1|| B | 32 | 8 | 256 | 0 |
64x1x1|| C | 24 | 32 | 64 | 68 |
32x2x1|Preparation produces one replacement image:
A's original argument block contains
seedat offset 0, a four-bytehidden_block_count_xat offset 4 and an output pointer at offset 8. The existing wrapper mechanism retains those bytes and appends two pointers:Offsets 0..15 are the original arguments; 16..31 are the extension. The existing entry prologue restores the original guest kernarg pointer. This change lets metadata admission and saved ABI facts honor that layout.
A launch with grid
256x1x1and workgroup64x1x1still has four workgroups and eight wave32 report rows. Workgroup32x1x1is rejected despite being below the maximum size, because it violates A's required shape.C can remain native with its 68-byte private segment and 32-byte alignment. Preserving its
32x2x1requirement does not add 2D native dispatch support: the controlled native launch profile still requires one 1D workgroup.