Shaders: preserve the unwritten high half of packed D16 image loads #1437
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!1437
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1437"
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?
@EatCodeSleep2 on GitHub · 2026-11-24 17:58 UTC · original
EatCodeSleep2:fix/preserve-d16-image-high-half-1242→main· +49 −4 · 2 files · 1 commits · openAddresses the destination register preservation part of VIC-BT-017 in #1242. An odd number of packed D16 image-load channels writes only the low half of the final destination VGPR. Merge that channel with the previous high half. Full channel pairs still overwrite both halves. The integer texel interpretation from the same audit finding is separate.
The synthetic GPU regression checks 1-, 2-, and 3-channel image loads against a 1x1 float texture. Upstream main returned 0x00003c00 instead of 0x5a5a3c00 for the one-channel case. The test passes with the fix. The expected high-half behavior is also recorded for GFX10 2D loads by the native hardware probe.
On Windows, 120 shader tests and strict shader Clippy passed. The existing v_med3_f32 host NaN test was excluded from the suite.
AI use: Codex wrote and tested the change.
@marquezinii on GitHub · 2026-11-24 18:33 UTC · original
Ran on an RTX 5070 (desktop, driver 621.40, the only adapter), Windows 11 26300, Rust 1.98.1 at
4cfae26.cargo test -p victory-shader --lib -- --test-threads=1 --nocapturegives 121 passed, 0 failed, 1 ignored.packed_image_load_keeps_unwritten_high_halfpasses on the hardware adapter and WARP. The only skips are the fourdiff_teststhat need the console compiler. This merges cleanly with #1441, and the shared test builder appears once.@AnoHunted on GitHub · 2026-11-24 18:38 UTC · original
Independent NVIDIA run. No game files were used.
Machine: Windows 11, NVIDIA GeForce RTX 5080, Rust 1.98.1, DXC
dxil.dll1.9.2609 (SDK 10.0.26100) validating.cargo test -p victory-shader --features host -- --test-threads=1with this PR:packed_image_load_keeps_unwritten_high_half.Not tested: the in-game effect; AMD. (Sibling #1441, the buffer version, reported separately.)
@sinan-cmyk on GitHub · 2026-11-24 20:43 UTC · original
Offline measurement on a retail dump, and the shader tests on Ada
Result: no count change against
main.Offline. I merged head
4cfae26ontomainffe310e(clean merge) and ranvictory translate --validate --listonshaders.rpf(1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result withmainprogram by program (25,889 programs). Validated: 21,724 onmain, 21,724 with this PR.No program changes its failure reason either. That is the expected result for a fix whose instructions sit behind the earlier failures on
main. The count shows that the change rejects nothing. It does not show whether the output is right.Tests: with the same merge,
cargo test --locked -p victory-shader --libpassed 121, failed 0. The bitcode benchmark is ignored, as onmain, where 120 pass. The run was on an RTX 4070 SUPER (Ada, 32-lane waves, driver 32.0.16.1088), the default adapter, withVICTORY_WARPunset.No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
@Marvisak on GitHub · 2026-11-25 03:27 UTC · original
Automated triage for the maintainers.
Needs work. For an odd number of packed D16
image_loadchannels, this keeps the last register's high half vialow_half(crates/victory-shader/src/emit/lower.rs, image result packing,op == 66only). CI passes. This changes emulation behaviour, but the only evidence is a link to a probe script in another project. Please put the measured result in the PR body: the GPU, and the register value before and after a 1- and 3-channel load. Please also say why sampled and gathered D16 results keep zeroing the high half when loads do not.Generated by Claude Code
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.