Recompiler: round normalized buffer loads to nearest f32 #1830
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1840"
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 ivall/xcl. Originally posted by gloger2003 on 2026-11-24T21:38:41Z.
Part of #1414. Normalized buffer loads with f32 output now construct the rounded UNORM or SNORM result from the repeating binary expansion of the component magnitude. The conversion uses the leading 24 significant bits and the rounding bit. The odd denominator rules out a midpoint for interior values.
What is in it
emit.rsandlower_mem.rsimplement the same integer rounding in HLSL/DXC and direct DXIL, including the two-bit fractions and the signed lower clamp.tests.rschecks representative values for the 20 normalized layouts and all 256 UNORM8 input values. This commit consolidates the earlier UNORM8 fix and the remaining formats.Tested
dd16cc6, the expanded GPU test reported 163 differences in 17 formats in each backend. On this commit,gpu_normalized_buffer_formats_round_to_nearest_f32andgpu_typed_bufferpassed in each backend withXCL_DIRECT_DXIL=0and=1.cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --show-output: 893 passed, 0 failed, 42 ignored. The heap-window fallback test skipped in the default suite and passed separately with heap windows enabled.Regression run
Minecraft Preview. Both release runs used the same 1x MSAA profile.
Not tested
AI use
Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T22:50:39Z.
NVIDIA run: RTX 3070 8 GB, driver 616.56, Windows 11, debug,
41c88eamerged ontomain689f2db(clean).gpu_typed_buffer_unorm8_rounds_to_nearestandgpu_normalized_buffer_formats_round_to_nearest_f32: pass, with and withoutXCL_DIRECT_DXIL=1.buffer/format: 43 passed, 0 failed.AI-assisted (Claude Code). Synthetic tests only.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T01:03:39Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
upstream-sync referenced this pull request2026-11-25 04:08:41 +00:00
upstream-sync referenced this pull request2026-11-25 10:09:30 +00:00
upstream-sync referenced this pull request2026-11-25 12:04:57 +00:00
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-28T08:01:13Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:57:12Z.
Triage (#1607) – head
41c88eaNo other PR changes how normalized buffer loads round.
#1423 (same issue #1414) also edits
fmt_compinemit.rs, but for the channels a format lacks, so the two will conflict without duplicating each other. #683 changes the f32 -> UNORM/SNORM conversion, the other direction.No problems found in
fmt_norm_f32(HLSL and direct DXIL). It is used only when the destination is f32; D16 loads keep the old division.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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.