Shaders: SP3 text names a discard's address and position target four #2800
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2800
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2800"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Moon0755 on GitHub · 2026-11-25 20:50 UTC · original
Moon0755:fix/sp3-text-llvm→main· +33 −9 · 1 files · 1 commits · openFound by running LLVM's GFX10 MC test vectors (64,006 runs of 38,981 encodings from
llvm/test/MC/AMDGPU) throughgfx10::decodeandInstruction::text, and sorting out the spelling differences. Two forms lost information in the text.Problem
s_dcache_discardands_dcache_discard_x2have no data operand but do have an address (LLVM:s_dcache_discard s[2:3], 0x64). The SMEM arm of the text wrote the base and offset only beside data, so these two printed bare, likes_dcache_inv, which really has none.pos4on GFX10 (LLVMET_POS4); the text hadpos0..pos3and printed<target 16>.Both are in the text only:
Fieldsalready holds the operands.Fix
The SMEM arm computes the offset before the data, and prints
base, offsetfor the two discards. The export arm names targets 12 to 16.Test
gfx10::sp3::tests::discards_name_their_address_and_position_four_its_target: three encodings from LLVM'sgfx10_asm_smem.s(immediate offset, SGPR offset, SGPR plus immediate) and one fromexp-gfx10.s. The project spells the immediate0x000064where LLVM has0x64.Verification
GitHub Actions on
windows-latest, on the fork, with the jobs narrowed tovictory-shaderandxtask:271 passed; 0 failed; 3 ignored;s_dcache_discardbare andexp <target 16>.The vector run itself is a throwaway test on a branch of the fork (run 45695432351); it is not part of this change. No decoded length differed from LLVM's and nothing panicked in the 64,006 runs.
Notes
fields.rs; the test is in another place ofsp3.rsand the four merge together without conflict.— Fable
@fuzeofficlal on GitHub · 2026-11-25 21:20 UTC · original
Reviewed and verified
604b0291on Windows 11 againstmain(13f91ca).SMEMoffbeforeif let Some(data)properly prints{base}, {off}for datalesss_dcache_discard/s_dcache_discard_x2(leavings_dcache_invunchanged), and extendingEXPposition targets12..=15->12..=16coverspos4with zero IR/lowering changes.cargo test --locked -p victory-shader --lib -- gfx10::: 17/17 passed (includingdiscards_name_their_address_and_position_four_its_target).cargo clippy --locked -p victory-shader --all-targets -- -D warnings(default &--features host): 0 warnings;cargo xtask policy: 184 files ok; cleangit merge-treevs13f91ca.@oni-swr on GitHub · 2026-11-25 21:27 UTC · original
Independent WARP/CPU verification of head
604b0291eadd296f01c2d8ddee475e8cb020dfc6, merged ontoorigin/main13f91caee25f2fdf2c062be5f7a27f058e51cbca(clean merge).Environment: Windows 11 Pro 26200, WARP only (
VICTORY_WARP=1,VICTORY_D3D12_WARP=1), Windows SDK 10.0.26100.0 x64dxil.dll1.8.2502.11 (VICTORY_DXIL).cargo test -j 4 -p victory-shader: 268 passed, 3 failed, 3 ignored. The baseline onorigin/mainwas 267/3/3, so there is 1 new passing test.synthetic_testswithno pipeline for a wave of 32, plusgathers_at_a_level_match_the_hardware.discards_name_their_address_and_position_four_its_targetfail):12..=15for the export target.s_dcache_discardarm. The output then shows the bares_dcache_discard,s_dcache_discard,s_dcache_discard_x2.cargo clippy -p victory-shader --all-targets -- -D warningswas clean, with and without--all-features.cargo fmt --all --check: 891 hunks, the same as the baseline (no new hunks).Diff review: no findings. The change is text only. Moving the
offcomputation ahead of the data branch doesn't change what is printed for forms that have data.s_dcache_invand friends still print bare, andpos4matches GFX10's export target 16. The test words are short encodings taken from LLVM's MC test files (interoperability constants), not title data.Not tested: physical GPU, retail title.
AI use: Claude Code (Claude Opus 5.5)
@Marvisak on GitHub · 2026-11-25 23:23 UTC · original
Automated triage for the maintainers.
A text-only fix in
operands(crates/victory-shader/src/gfx10/sp3.rs): the SMEM offset is now formatted before the data branch sos_dcache_discard/s_dcache_discard_x2print theirbase, offsetinstead of printing bare, and export target 16 is namedpos4(the12..=15range becomes12..=16). I checked that forms with data print the same as before,s_dcache_invstill prints bare, and nothing the lowering reads changes; the new test uses short instruction encodings from LLVM's MC tests. CI (check) passes.This is a recommendation for a maintainer to look, not an approval.
Generated by Claude Code
@kotekompotek on GitHub · 2026-11-25 21:13 UTC · original · reviewed
Correct:
s_dcache_discardhas no data operand, so hoisting theoffcomputation out of theif let Some(data)block lets the no-data arm emitbase, off— matching LLVM's spelling (s_dcache_discard s[2:3], 0x000064, register and immediate offsets).target 16 => pos4matches the exp encoding. Encodings cited from LLVM's MC tests. LGTM.@Dukestar69 on GitHub · 2026-11-26 02:51 UTC · original · approved these changes
Tested merged onto
origin/main(63bcca4) on Windows 11 x64:cargo test -p victory-shader --lib gfx10::sp3::tests: 9 passed, 0 failed (including newdiscards_name_their_address_and_position_four_its_target).cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@futurepro62 on GitHub · 2026-11-26 10:02 UTC · original
NVIDIA full-suite run, to go with the reports above by Dukestar69, fuzeofficlal, oni-swr, since none of them names a GPU run. Tested exact head
604b029(on its base13f91ca).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 774 passed, 0 failed, 9 ignored.discards_name_their_address_and_position_four_its_target.--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#2571), so without the skip the rest of that crate never reports;dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
@fuzeofficlal on GitHub · 2026-11-26 10:46 UTC · original · approved these changes
Clean text-only fix in
crates/victory-shader/src/gfx10/sp3.rs: hoisting the SMEMoffformatting ahead ofif let Some(data)prints{base}, {off}fors_dcache_discard/s_dcache_discard_x2while leavings_dcache_invand data-bearing SMEM ops unchanged, and extending12..=15to12..=16formats export target 16 aspos4.git merge-treeagainst63bcca43is clean.Verified locally on Windows 11 x64 (
604b0291):rustfmt --edition 2024 --check crates/victory-shader/src/gfx10/sp3.rs: cleancargo run --locked -p xtask -- policy: passed (184 files ok)cargo clippy -p victory-shader --all-targets --locked -- -D warnings(default and--all-features): cleancargo test -p victory-shader --lib --locked gfx10::: 17 passed, 0 failedView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.