Shaders: d16 buffer loads of floats truncate on every host #2064
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!2064
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2064"
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?
@astrosteveo on GitHub · 2026-11-25 04:20 UTC · original
astrosteveo:fix/d16-buffer-toward-zero→main· +44 −4 · 2 files · 1 commits · openlegacyF32ToF16truncates on Windows but rounds to nearest under vkd3d-proton (RTX 5080, driver 620.73.04, Wine 11.22, vkd3d-proton 3.1). So a32_FLOATd16 format load there gives0x3c02for 1 + 3/2048 and infinity for 70000.d16_channelsnow uses the existingf16_toward_zerofor float formats. Other formats are unchanged: every 8- and 16-bit UNORM/SNORM code I probed (all 8-bit ones, 256 per 16-bit format) is right there today, and truncating them broke 123 of 256 8_UNORM codes.That RDNA2 truncates here is from #1927 and #1940; I did not measure it. The new test fails on
940d32fon this stack and passes with the change.victory-shader: 244 passed, 4 failed, all 4 also onmainhere. Clippy and policy clean.Overlap: conflicts with #1927 and #1940 in the same branch of
d16_channels(keep their integer and norm arms, use this one forNumeric::Float).Not covered:
buffer_load_format_d16_*through a typed view, where the format is unknown (as in #2006). Not tested: Windows, the title.🌴 AI-assisted, made with Claude Code · from astrosteveo/VIctory
@jeremygold02 on GitHub · 2026-11-25 04:35 UTC · original
Triage verdict — Keep the float-buffer rounding fix (
f7870d3)Evidence
Numeric::Floatarm. #1940 addresses the normalized-buffer arm in the same function, while #2030 concerns image reads. The typed float and normalized cases need distinct rounding behavior. Correction · Buffer branchChecks and limits
Next step
This verification was AI-assisted.
@sinan-cmyk on GitHub · 2026-11-25 09:18 UTC · original
Offline measurement on a retail dump
Result: no count change against
main.I merged head
f7870d3eontomain940d32f(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: 23,918 onmain, 23,918 with this PR.No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right.
No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
@Marvisak on GitHub · 2026-11-25 10:23 UTC · original · edited 2026-11-25 22:21 UTC
Automated triage for the maintainers.
Needs rebase. This PR no longer merges cleanly into
main:mainhas moved since the last triage, and the branch now conflicts incrates/victory-shader/src/emit/lower.rs. It will be reviewed again once it is rebased onto currentmain.Previous verdict for this head: merge candidate.
Generated by Claude Code
@steven-seagull27 on GitHub · 2026-11-26 01:58 UTC · original
@astrosteveo I resolved the conflict on your
f7870d3head with main63bcca43. The diff against main still contains your original D16 change and regression. The standalonetbuffer_d16_loads_cut_32_bit_floats_toward_zerotest passes here on Windows with the RTX 5080 and built-in Microsoft WARP. Fast-forwardable mergeThe broader D16 run also found zero FLOAT mismatches on both native Windows adapters before and after integrating your fix alongside the integer, normalized and scaled fixes. Your vkd3d-proton result remains the distinguishing cross-platform check. 77-format comparison
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.