Shaders: a test that runs the LDS byte and half forms #1928
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!1928
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1928"
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?
@DiosET3RN0 on GitHub · 2026-11-29 03:07 UTC · original
DiosET3RN0:lds-subword-test→main· +96 −0 · 1 files · 1 commits · openNo issue. Follows #1920 (same file, same harness).
What it changes
The byte and half forms of the LDS instructions are lowered on a path of their own in
ds(a write is two atomics, clear then set; a read shifts and extends; the_d16reads merge into half of the old register). The tests inemit/lds.rsclassify these forms, but none executes one.This adds
ds_bytes_and_halves_keep_their_neighbours_and_extendtoemit/valu_tests.rs(+96 lines, the smallds_atencoder included; no change outside the test). It runs all 14 forms on the card:ds_write_b8/b16and their_d16_hiforms,ds_read_u8/i8/u16/i16, and the six_d16/_d16_hireads. Each form runs twice, with the place given by the address alone and with an offset in the instruction that is not a whole dword. It checks that a write leaves the bytes beside it, that a read extends by zero or by sign, and that a_d16read fills one half of its register and keeps the other. The reference is a plain byte model in the test.Naturally aligned places only, as the lowering takes them to be; what the console does with a half across two dwords is not in the tree, so the test does not go there.
How it was tested
main568c5e5. Unit test on the hardware adapter; no game run (no game files on this machine).cargo test -p victory-shader --locked ds_bytes_and_halves: passes (28 programs, about 9 s on the card).ds_read_i8; with the write's keep mask left out it fails atds_write_b8.WaveSize(32), which WARP refuses, so hardware only; on a machine without a hardware adapter the harness prints "not run").cargo testpassed for the crates it touches: yes, for this test; the wholevictory-shadersuite passed on this card at the same base for #1920 (396 passed).mainstops at its ownlower.rs:2356(#1855); with that one lint allowed,cargo clippy -p victory-shader --all-targets --locked -- -D warningsreports nothing.Checked for overlap
valu_tests.rs, this one sits besidedsand merges with it cleanly; #1623 inserts afterds_min_max_f32_are_atomic_across_waves, a different place. No open PR tests these forms.AI-assisted: yes (Claude Code)
🤖 Generated with Claude Code
@Dukestar69 on GitHub · 2026-11-29 03:33 UTC · original · approved these changes
Tested locally merged onto
main(568c5e5).crates/victory-shader/src/emit/valu_tests.rs.cargo test -p victory-shader --lib emit::valu_tests::ds_ -- --test-threads=1passed (3 passed; 0 failed, including the newds_bytes_and_halves_keep_their_neighbours_and_extendGPU execution test) with 0 warnings invalu_tests.rs.Solid hardware execution test covering LDS byte/half writes, neighbor preservation, and sign/zero extension. LGTM.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@tupacfan04 on GitHub · 2026-11-29 06:25 UTC · original
Ran this on an RTX 5070 12 GB (driver 621.40, 32-lane waves, Windows 11), cherry-picked onto main
e1f2eb6plus #1939:It passes, and it printed no "skipped" line, so I take it that it ran on the card. That is an inference though: unlike the wave tests (#1929 prints "ran on the hardware device: ..."), this one prints nothing on success, so a pass with a hardware run and a pass on a machine that quietly skipped look almost the same in CI output. A one-line "ran on the hardware device" print at the end would settle it.
Reading the test: the 4 write and 10 read forms are covered at aligned places only, which its own comment says. The LDS forms matter to us because three of the ray-tracing structure builder's programs only translate with
VICTORY_LDS_LAST_RESORT=1, so more coverage here is welcome.🤖 Generated with Claude Code
@upipibi on GitHub · 2026-11-29 23:07 UTC · original · edited 2026-11-29 23:08 UTC
Test report for #1928 (head
cc8d533d), merged onto main568c5e5d, on RTX 30. Synthetic tests only: no title run, no game files.Setup: RTX 3070, driver 621.40, Windows 11 (10.0.26100), rustc 1.98.1. Every step logged the GPU and driver from
nvidia-smi.Key test:
emit::valu_tests::ds_bytes_and_halves_keep_their_neighbours_and_extendVICTORY_WARP=1: fails, 3/3, atvalu_tests.rs:280:hardware: compute_pipeline failed: The parameter is incorrect.That is the harness failing to make its pipeline on WARP, before any LDS check. Othervalu_testsfail the same way on WARP on main here, so I read it as the WARP baseline of this harness, not as something this test adds.Negative control, and whether it really runs on the card: with the sign-extending shift of the signed byte/half reads in
emit/lower.rschanged from arithmetic to logical (signed reads then extend by zero), the test fails on the card atvalu_tests.rs:1709:hardware: ds 0x39 +0 at byte 0 of 0xa1b2c3d4, data 0x123485f6, left 212, right 4294967252. So a pass here is a run on the hardware device that compared results, not a quiet skip, which settles the question above for this card. A "ran on the hardware device" line on success would still help in CI output.cargo test -p victory-shader --lib --locked568c5e5dThe extra test is the PR's own.
Not tested: the PR on today's main, places that are not naturally aligned (the test does not go there), and any effect in a title.
Tested with the help of Claude Code (Claude Fable 5.2).
View 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.