Shaders: d16 buffer loads of floats truncate on every host #2062
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from Marvisak/VIctory. Originally posted by astrosteveo on 2026-11-25T04:20:04Z.
legacyF32ToF16truncates 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
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T04:31:11Z.
Review: APPROVED
Verified locally merged onto
origin/main(940d32f, Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC, withdxil.dllvalidator):cargo test -p victory-shader --lib tbuffer_d16_loads_cut_32_bit_floats_toward_zero— passed on both RTX 5090 hardware andVICTORY_D3D12_WARP=1cargo clippy -p victory-shader --all-targets— 0 warningscargo xtask policy— ok (183 files ok)Clean fix ensuring
d16float buffer loads truncate toward zero consistently on every host GPU, verified on RTX 5090 + WARP. Looks good.AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T04:33:52Z.
Review: APPROVED
Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main
940d32f69b,cargo test -p victory-shader --locked.144 passed / 0 failed / 2 ignored. d16 buffer loads of floats truncate on every host — consistent d16 truncation across hosts.
Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-25T04:35:34Z.
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.
Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-25T09:18:20Z.
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).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T10:23:27Z.
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
Imported from Marvisak/VIctory. Originally posted by steven-seagull27 on 2026-11-26T01:58:46Z.
@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
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.