[rocjitsu] Model GFX9/CDNA buffer range checking - #10928
Open
feikou wants to merge 1 commit into
Open
Conversation
✅ All Policy Checks Passed
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🚫 Please fix the failed policies before requesting reviews. The following policy checks failed:
The |
On gfx950 the MUBUF range check counts SOFFSET and the instruction
offset (VOFFSET + inst_offset wraps to 32 bits, SOFFSET does not),
clamps dwordx{2,3,4} loads and stores per dword, byte-checks a strided
resource addressed without IDXEN, and writes zeros to LDS for
out-of-range lanes of LDS-destination loads. Apply that rule on
CDNA1-4, reusing element_lane_masks for the per-dword clamp; RDNA and
gfx1250 are unchanged. Adds VM and address-calculation tests.
feikou
force-pushed
the
rocjitsu-gfx9-buffer-range-check
branch
from
August 29, 2026 01:54
4052166 to
64fa405
Compare
feikou
marked this pull request as ready for review
August 29, 2026 01:56
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
CDNA buffer range checking didn't match gfx950 hardware. This fixes, for CDNA1-4:
dwordx{2,3,4}loads and stores; format ops, atomics and MTBUF stay all-or-nothing.buffer_load ... ldswrite zeros to LDS instead of being skipped.Previously the simulator ignored SOFFSET, dropped whole lanes, index-checked any strided buffer, and left LDS untouched.
Technical Details
shared/addr_calc_buffer.h: CDNA1-4 take a GFX9 range-check path; per-dword results go throughelement_lane_masks(feat(rocjitsu): cdna5 OOB behavior implementation #10362). RDNA and gfx1250 are unchanged.vm/amdgpu/memory_pipeline.cpp: on CDNA1-4, out-of-range lanes of LDS loads write zeros.The ISA docs and LLVM say SOFFSET isn't part of the check, but gfx950 hardware includes it, so this follows the hardware. ADD_TID_ENABLE addressing and DATA_FORMAT = 0 aren't modelled.
Issue Tracking
No existing issue. Related: #10362, #10192.
Test Plan
An encoded-kernel test on cdna1-4 (
MubufRangeCheckTest), direct address-calculation tests on cdna3/cdna4 (CdnaAddrCalcTest.Mubuf*), and one RDNA3 case to confirm that path is unchanged.Test Result
The new tests fail on
developand pass with this change. Expected values were measured on gfx950 (ROCm 7.2). The rest ofctestis unchanged and no generated files change.Submission Checklist