Repository navigation
Conversation
This was referenced Nov 26, 2026
vanya890
marked this pull request as ready for review
November 26, 2026 20:12
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.
Summary
Port the scalar-memory correctness work from upstream Marvisak#1939 and Marvisak#3351 as one coherent change to
Lower::smem.OFFSETand SGPRSOFFSETbefore adding them, matching the RDNA2 SMEM address-component rules and upstream hardware readback.NUM_RECORDS * max(stride, 1)bounds for every dword ofs_buffer_load_dword*, returning zero for each out-of-range element, including wide loads.built_offset(src)in the bounds predicate. When combining it withSOFFSET, detect unsigned addition overflow and treat it as out-of-range. This addresses the P1 review finding on upstream Shaders: scalar code-table buffer loads keep NUM_RECORDS Marvisak/VIctory#3351 rather than copying that hunk verbatim.SOFFSET=0xe+ immediate2, dynamic descriptor extra 0/4/20, extra-only bounds, and an unsigned-overflowing dynamic extra.Upstream provenance
f7a44b768bce0a5dadc1c494d6b0359202d903e1: independent DWORD truncation.9cad6a17db5fcd95166d4644d842dcd522e5d5cd: code-tableNUM_RECORDS/stride bounds.s_bufferoperations), unsignedSOFFSET, low-bit alignment, and per-dword bounds behavior: https://www.amd.com/content/dam/amd/en/documents/radeon-tech-docs/instruction-set-architectures/rdna2-shader-instruction-set-architecture.pdfRegression coverage
s_buffer_load_truncates_terms_independently: hardware/WARP readback for unaligned immediate and SGPR offsets.scalar_buffer_loads_of_a_code_table_read_zero_past_num_records: stride 0/1/4, static bounds and wide-load per-dword zeroing.scalar_buffer_loads_of_a_code_table_keep_num_records_with_stride_and_soffset: unaligned terms, dynamic descriptor extra 0/4/20, extra-only bound, and overflow rejection.The GPU readback tests require WARP: they explicitly construct
Host::new(true)and panic if the WARP adapter is unavailable. Hardware execution is also tested when a hardware adapter is present; it is not required for CI success.Integration and validation
dev539687eaaeebced7cdce26a62d92a732adc5c963.agent/gpt6-smem-code-table-218.8653fce3a17c6c34891398eb527d87e37f3de30f.lower.rs: 523,465 UTF-8 bytes, 823 bytes under the 524,288-byte repository policy cap; exact-headrepository_passes_policypassed.victory-shader: 320 passed / 0 failed / 3 ignored.victory-gpu: 297 passed / 0 failed / 1 ignored.Host::new(true), so WARP was actually exercised; the run also reportsemit::host::tests::parallel_warp_pipelines_and_drawspassing.Ready for maintainer review. No merge performed.