Repository navigation
[rocjitsu] Fix gfx1250 fpsan numerical failures - #7336
Merged
Merged
Conversation
kuhar
force-pushed
the
users/kuhar/gfx1250-fpsan-fixes
branch
2 times, most recently
from
June 16, 2026 23:56
c8cb76c to
ae42f21
Compare
kuhar
marked this pull request as ready for review
June 17, 2026 00:00
kuhar
force-pushed
the
users/kuhar/gfx1250-fpsan-fixes
branch
from
June 17, 2026 00:02
ae42f21 to
2d97875
Compare
Fix gfx1250-specific true16, conversion, atomic, wave, and WMMA/SWMMAC emulation issues found by the hip-fpsan suite. Add focused generator and execution regression coverage for the corrected paths. The latest local RocJITsu hip-fpsan matrix has 504 passed, 0 Failed, 17 SIGABRT, 1 SIGSEGV, and 2 skipped entries.
kuhar
force-pushed
the
users/kuhar/gfx1250-fpsan-fixes
branch
from
June 17, 2026 00:53
2d97875 to
b652e77
Compare
atgutier
reviewed
Jun 17, 2026
atgutier
left a comment
Contributor
There was a problem hiding this comment.
Just some agent comments
lialan
reviewed
Jun 18, 2026
atgutier
approved these changes
Jun 18, 2026
kuhar
added a commit
that referenced
this pull request
Oct 27, 2026
The CDNA5 descriptor tests in triton-lang/triton#12512 pass on hardware but fail under Rocjitsu. Crossing raw B128 accesses load and store one extra DWORD near NUM_RECORDS. - CDNA5 buffer bounds (PR #10362, f81f9d4): retain complete accesses, including exact fits, and apply the PR's stated end + 4 <= NUM_RECORDS rule to crossing raw vector accesses. Keep SOFFSET in the check and preserve structured and independent stride bounds. - GFX12 atomic returns (PR #7336, 3a4e98a): test TH[0] independently of the non-temporal and cascade bits. Returning modes 3, 5 and 7 otherwise omit the old value and select non-returning metadata and wait counters. - Signed scratch operands (CDNA5 PR #6673, f6aec50; RDNA4 PR #5053, ca4b97e): sign-extend scalar and vector offsets before combining them and before CDNA5 payload scaling. Compensated negative operands otherwise become large positive private offsets and fault. - CDNA GLOBAL operands (PR #5512, 5a107ce): zero-extend the 32-bit VGPR offset when a scalar base is present. High-bit offsets otherwise resolve four GiB below the intended address. Preserve absolute VGPR pairs and CDNA5 signed addressing. CDNA1-4 manuals and LLVM agree on the unsigned rule. For buffer bounds, the Triton PR measures aligned B128 crossings with four or eight bytes remaining. Other widths and byte-granular bounds follow its stated rule as a model choice pending gfx1250 qualification. Record that limit beside the implementation and regression expectations. Cover bounds, inactive lanes, signed and unsigned operand combinations, atomic writeback and wait counters, including image metadata. Validate 49 Gluon cases with matching ISA and 172 hardware comparisons each on gfx1201 and gfx1100. Audit gfx942/gfx950 buffer, scratch and atomic contracts against the manuals. The standard CTest sweep retains the same 31 baseline failures.
kuhar
added a commit
that referenced
this pull request
Oct 27, 2026
The CDNA5 descriptor tests in triton-lang/triton#12512 pass on hardware but fail under Rocjitsu. Crossing raw B128 accesses load and store one extra DWORD near NUM_RECORDS. - CDNA5 buffer bounds (PR #10362, f81f9d4): retain complete accesses, including exact fits, and apply the PR's stated end + 4 <= NUM_RECORDS rule to crossing raw vector accesses. Keep SOFFSET in the check and preserve structured and independent stride bounds. - GFX12 atomic returns (PR #7336, 3a4e98a): test TH[0] independently of the non-temporal and cascade bits. Returning modes 3, 5 and 7 otherwise omit the old value and select non-returning metadata and wait counters. - Signed scratch operands (CDNA5 PR #6673, f6aec50; RDNA4 PR #5053, ca4b97e): sign-extend scalar and vector offsets before combining them and before CDNA5 payload scaling. Compensated negative operands otherwise become large positive private offsets and fault. - CDNA GLOBAL operands (PR #5512, 5a107ce): zero-extend the 32-bit VGPR offset when a scalar base is present. High-bit offsets otherwise resolve four GiB below the intended address. Preserve absolute VGPR pairs and CDNA5 signed addressing. CDNA1-4 manuals and LLVM agree on the unsigned rule. For buffer bounds, the Triton PR measures aligned B128 crossings with four or eight bytes remaining. Other widths and byte-granular bounds follow its stated rule as a model choice pending gfx1250 qualification. Record that limit beside the implementation and regression expectations. Cover bounds, inactive lanes, signed and unsigned operand combinations, atomic writeback and wait counters, including image metadata. Validate 49 Gluon cases with matching ISA and 172 hardware comparisons each on gfx1201 and gfx1100. Audit gfx942/gfx950 buffer, scratch and atomic contracts against the manuals. The standard CTest sweep retains the same 31 baseline failures.
kuhar
added a commit
that referenced
this pull request
Oct 27, 2026
The CDNA5 descriptor tests in triton-lang/triton#12512 pass on hardware but fail under Rocjitsu. Crossing raw B128 accesses load and store one extra DWORD near NUM_RECORDS. - CDNA5 buffer bounds (PR #10362, f81f9d4): retain complete accesses, including exact fits, and apply the PR's stated end + 4 <= NUM_RECORDS rule to crossing raw vector accesses. Keep SOFFSET in the check and preserve structured and independent stride bounds. - GFX12 atomic returns (PR #7336, 3a4e98a): test TH[0] independently of the non-temporal and cascade bits. Returning modes 3, 5 and 7 otherwise omit the old value and select non-returning metadata and wait counters. - Signed scratch operands (CDNA5 PR #6673, f6aec50; RDNA4 PR #5053, ca4b97e): sign-extend scalar and vector offsets before combining them and before CDNA5 payload scaling. Compensated negative operands otherwise become large positive private offsets and fault. - CDNA GLOBAL operands (PR #5512, 5a107ce): zero-extend the 32-bit VGPR offset when a scalar base is present. High-bit offsets otherwise resolve four GiB below the intended address. Preserve absolute VGPR pairs and CDNA5 signed addressing. CDNA1-4 manuals and LLVM agree on the unsigned rule. - PC exports and targets (import handling #9844, e5109e3): apply the architecture's extension rule to GETPC, CALL and SWAPPC return addresses. RDNA4 zero-extends 48 bits; older targets sign-extend 48 bits and CDNA5 sign-extends 57 bits. Keep imported PCs as raw 48/57-bit addresses for instruction fetch, consistent with RFE, and preserve all CDNA5 target bits. Limit the positive linked-rel32 tag to 48-bit targets. Remove the negative tag on every target: it aliases ordinary sign-filled PC exports. Both forms otherwise corrupt valid 57-bit targets or older high-PC round trips when a load bias is present. For buffer bounds, the Triton PR measures aligned B128 crossings with four or eight bytes remaining. Other widths and byte-granular bounds follow its stated rule as a model choice pending gfx1250 qualification. Record that limit beside the implementation and regression expectations. Cover bounds, inactive lanes, signed and unsigned operand combinations, atomic writeback and wait counters, including image metadata. Validate 49 Gluon cases with matching ISA and 172 hardware comparisons each on gfx1201 and gfx1100. Audit gfx942/gfx950 buffer, scratch and atomic contracts against the manuals. The standard CTest sweep retains the same 31 baseline failures. Decode and execute PC regression cases on gfx1100, gfx1201, gfx950 and gfx1250, including high address bits, next-PC boundaries and operand aliasing. Follow SETPC/SWAPPC through real page tables to fetch a high mapped destination, including both relocation-tag collisions with a nonzero load bias. Older linked-rel32 debugger coverage is retained. These are manual/LLVM-backed simulation checks without physical high-address PC qualification. RDNA3/3.5 sign-filled exports follow LLVM against conflicting manual tables; record that choice beside the generator and test oracle. Add explicit test braces for GCC.
kuhar
added a commit
that referenced
this pull request
Oct 27, 2026
The CDNA5 descriptor tests in triton-lang/triton#12512 pass on hardware but fail under Rocjitsu. Crossing raw B128 accesses load and store one extra DWORD near NUM_RECORDS. - CDNA5 buffer bounds (PR #10362, f81f9d4): retain complete accesses, including exact fits, and apply the PR's stated end + 4 <= NUM_RECORDS rule to crossing raw vector accesses. Keep SOFFSET in the check and preserve structured and independent stride bounds. - GFX12 atomic returns (PR #7336, 3a4e98a): test TH[0] independently of the non-temporal and cascade bits. Returning modes 3, 5 and 7 otherwise omit the old value and select non-returning metadata and wait counters. - Signed scratch operands (CDNA5 PR #6673, f6aec50; RDNA4 PR #5053, ca4b97e): sign-extend scalar and vector offsets before combining them and before CDNA5 payload scaling. Compensated negative operands otherwise become large positive private offsets and fault. - CDNA GLOBAL operands (PR #5512, 5a107ce): zero-extend the 32-bit VGPR offset when a scalar base is present. High-bit offsets otherwise resolve four GiB below the intended address. Preserve absolute VGPR pairs and CDNA5 signed addressing. CDNA1-4 manuals and LLVM agree on the unsigned rule. - PC exports and targets (import handling #9844, e5109e3): apply the architecture's extension rule to GETPC, CALL and SWAPPC return addresses. RDNA4 zero-extends 48 bits; older targets sign-extend 48 bits and CDNA5 sign-extends 57 bits. Keep imported PCs as raw 48/57-bit addresses for instruction fetch, consistent with RFE, and preserve all CDNA5 target bits. Limit the positive linked-rel32 tag to 48-bit targets. Remove the negative tag on every target: it aliases ordinary sign-filled PC exports. Both forms otherwise corrupt valid 57-bit targets or older high-PC round trips when a load bias is present. For buffer bounds, the Triton PR measures aligned B128 crossings with four or eight bytes remaining. Other widths and byte-granular bounds follow its stated rule as a model choice pending gfx1250 qualification. Record that limit beside the implementation and regression expectations. Cover bounds, inactive lanes, signed and unsigned operand combinations, atomic writeback and wait counters, including image metadata. Validate 49 Gluon cases with matching ISA and 172 hardware comparisons each on gfx1201 and gfx1100. Audit gfx942/gfx950 buffer, scratch and atomic contracts against the manuals. The standard CTest sweep retains the same 31 baseline failures. Decode and execute PC regression cases on gfx1100, gfx1201, gfx950 and gfx1250, including high address bits, next-PC boundaries and operand aliasing. Follow SETPC/SWAPPC through real page tables to fetch a high mapped destination, including both relocation-tag collisions with a nonzero load bias. Older linked-rel32 debugger coverage is retained. These are manual/LLVM-backed simulation checks without physical high-address PC qualification. RDNA3/3.5 sign-filled exports follow LLVM against conflicting manual tables; record that choice beside the generator and test oracle. Add explicit test braces for GCC.
kuhar
added a commit
that referenced
this pull request
Oct 27, 2026
…14352) The CDNA5 descriptor tests in [triton-lang/triton#12512](triton-lang/triton#12512) pass on hardware but fail under Rocjitsu. Crossing raw B128 accesses load and store one extra DWORD near `NUM_RECORDS`. Auditing neighboring instructions and extension rules across gfx942/gfx950, gfx1100/gfx1201 and gfx1250 exposed further address and return defects. - **CDNA5 buffer bounds** (introduced by #10362, `f81f9d40db67`): keep complete accesses, including exact fits, and apply the Triton PR's stated `end + 4 <= NUM_RECORDS` rule to crossing raw vector accesses. Count `SOFFSET` and preserve structured and independent stride checks. - **GFX12 atomic returns** (introduced by #7336, `3a4e98a167e6`): test `TH[0]` independently of the non-temporal and cascade bits. Return modes 3, 5 and 7 otherwise omit the old value and select non-returning metadata and wait counters. - **GFX12 scratch operands** (CDNA5 #6673, `f6aec5064565`; RDNA4 #5053, `ca4b97ef2cc6`): sign-extend scalar/vector inputs before combining them and before CDNA5 payload scaling. Compensated negative inputs otherwise become large positive private offsets and fault. - **CDNA1–4 GLOBAL operands** (introduced by #5512, `5a107cebd601`): zero-extend the 32-bit VGPR offset when a scalar base is present. High-bit offsets otherwise address four GiB below the intended location. Preserve absolute VGPR pairs and the separate CDNA5 signed rule. - **PC extension and width**: GETPC, CALL and SWAPPC now export signed 48-bit PCs on older targets, zero-filled 48-bit PCs on RDNA4, and signed 57-bit PCs on CDNA5. SETPC/SWAPPC use raw masked 48/57-bit internal addresses so high targets remain fetchable through page tables. CDNA5 keeps all 57 target bits and bypasses linked-rel32 tags. The ambiguous negative tag is removed on every target so sign-filled PC exports round-trip with a load bias; 48-bit targets retain the positive tag covered by gfx950 debugger integration. Previously high PCs exposed the wrong upper bits or lost valid target bits. The generator and its 40 emitted PC handlers agree. RDNA3/3.5 sign-filled exports follow LLVM against conflicting manual tables; high-address PC behavior has no physical qualification. The gfx1250 buffer evidence covers aligned B128 crossings with four/eight bytes remaining. Other widths and byte-granular bounds follow the Triton PR's stated rule as model choices pending gfx1250 hardware qualification; the source and tests say so explicitly. The gfx942/gfx950 manual audit preserves the existing legacy scratch policy where no legal allocated-input mismatch was demonstrated. Local validation: - 49 Gluon cases pass through matching descriptor/instruction ISA. The installed Triton predates the new descriptor frontend API, so this is an ISA-equivalent replay, not a rebuild of that API. - 172 saved physical gfx1201 comparisons and 172 physical gfx1100 comparisons match simulation: buffer bounds, atomic return controls, legal scratch operands and GLOBAL offsets. The buffer-clamp rule remains CDNA5-specific. - gfx942 and gfx950 buffer/atomic/scratch/GLOBAL contracts were checked against their manuals and LLVM. All eight compiled HIP GLOBAL load/store simulation cases pass; no physical gfx942/gfx950 qualification is claimed. - 28 PC test groups cover gfx1100/gfx1201/gfx950/gfx1250, including next-PC boundaries, target width and SWAPPC operand aliasing. The original handlers fail 11 of the initial 16 groups. Page-table-backed fetch and nonzero-load-bias tests also reproduce the additional import/relocation gaps; all 28 final PC groups pass, including GETPC-to-SETPC/SWAPPC round trips with a nonzero load bias. Encodings were independently verified with LLVM. Four groups execute the destination through real page tables, including both 57-bit relocation-tag collisions. These are source-backed simulation checks without physical high-address PC qualification. - After rebasing onto current `develop`, the project builds and all 2,851 generator checks pass, with 46 skipped. Earlier GCC syntax checks cover the atomic and PC test translation units with `-Werror=dangling-else`; explicit braces fix the reported CI build error. Changed-file formatting hooks pass. - Rebase validation passes all 313 focused CTests, including PC, address, atomic and newly landed fork/join coverage. Standard CTest retains exactly the same 31 baseline failure names and classifications: 31/9181 after rebasing versus 31/9010 before rebasing. No new failure names.
ywang103-amd
pushed a commit
that referenced
this pull request
Oct 28, 2026
…14352) The CDNA5 descriptor tests in [triton-lang/triton#12512](triton-lang/triton#12512) pass on hardware but fail under Rocjitsu. Crossing raw B128 accesses load and store one extra DWORD near `NUM_RECORDS`. Auditing neighboring instructions and extension rules across gfx942/gfx950, gfx1100/gfx1201 and gfx1250 exposed further address and return defects. - **CDNA5 buffer bounds** (introduced by #10362, `f81f9d40db67`): keep complete accesses, including exact fits, and apply the Triton PR's stated `end + 4 <= NUM_RECORDS` rule to crossing raw vector accesses. Count `SOFFSET` and preserve structured and independent stride checks. - **GFX12 atomic returns** (introduced by #7336, `3a4e98a167e6`): test `TH[0]` independently of the non-temporal and cascade bits. Return modes 3, 5 and 7 otherwise omit the old value and select non-returning metadata and wait counters. - **GFX12 scratch operands** (CDNA5 #6673, `f6aec5064565`; RDNA4 #5053, `ca4b97ef2cc6`): sign-extend scalar/vector inputs before combining them and before CDNA5 payload scaling. Compensated negative inputs otherwise become large positive private offsets and fault. - **CDNA1–4 GLOBAL operands** (introduced by #5512, `5a107cebd601`): zero-extend the 32-bit VGPR offset when a scalar base is present. High-bit offsets otherwise address four GiB below the intended location. Preserve absolute VGPR pairs and the separate CDNA5 signed rule. - **PC extension and width**: GETPC, CALL and SWAPPC now export signed 48-bit PCs on older targets, zero-filled 48-bit PCs on RDNA4, and signed 57-bit PCs on CDNA5. SETPC/SWAPPC use raw masked 48/57-bit internal addresses so high targets remain fetchable through page tables. CDNA5 keeps all 57 target bits and bypasses linked-rel32 tags. The ambiguous negative tag is removed on every target so sign-filled PC exports round-trip with a load bias; 48-bit targets retain the positive tag covered by gfx950 debugger integration. Previously high PCs exposed the wrong upper bits or lost valid target bits. The generator and its 40 emitted PC handlers agree. RDNA3/3.5 sign-filled exports follow LLVM against conflicting manual tables; high-address PC behavior has no physical qualification. The gfx1250 buffer evidence covers aligned B128 crossings with four/eight bytes remaining. Other widths and byte-granular bounds follow the Triton PR's stated rule as model choices pending gfx1250 hardware qualification; the source and tests say so explicitly. The gfx942/gfx950 manual audit preserves the existing legacy scratch policy where no legal allocated-input mismatch was demonstrated. Local validation: - 49 Gluon cases pass through matching descriptor/instruction ISA. The installed Triton predates the new descriptor frontend API, so this is an ISA-equivalent replay, not a rebuild of that API. - 172 saved physical gfx1201 comparisons and 172 physical gfx1100 comparisons match simulation: buffer bounds, atomic return controls, legal scratch operands and GLOBAL offsets. The buffer-clamp rule remains CDNA5-specific. - gfx942 and gfx950 buffer/atomic/scratch/GLOBAL contracts were checked against their manuals and LLVM. All eight compiled HIP GLOBAL load/store simulation cases pass; no physical gfx942/gfx950 qualification is claimed. - 28 PC test groups cover gfx1100/gfx1201/gfx950/gfx1250, including next-PC boundaries, target width and SWAPPC operand aliasing. The original handlers fail 11 of the initial 16 groups. Page-table-backed fetch and nonzero-load-bias tests also reproduce the additional import/relocation gaps; all 28 final PC groups pass, including GETPC-to-SETPC/SWAPPC round trips with a nonzero load bias. Encodings were independently verified with LLVM. Four groups execute the destination through real page tables, including both 57-bit relocation-tag collisions. These are source-backed simulation checks without physical high-address PC qualification. - After rebasing onto current `develop`, the project builds and all 2,851 generator checks pass, with 46 skipped. Earlier GCC syntax checks cover the atomic and PC test translation units with `-Werror=dangling-else`; explicit braces fix the reported CI build error. Changed-file formatting hooks pass. - Rebase validation passes all 313 focused CTests, including PC, address, atomic and newly landed fork/join coverage. Standard CTest retains exactly the same 31 baseline failure names and classifications: 31/9181 after rebasing versus 31/9010 before rebasing. No new failure names.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Fix gfx1250-specific true16, conversion, atomic, wave, and WMMA/SWMMAC emulation issues found by the hip-fpsan suite.
Technical Details
JIRA ID
N/A
Test Plan
Unit test + iree e2e tests.
Rerun the generator across all isa targets.
Test Result
All good.
Submission Checklist