Recompiler: round normalized buffer loads to nearest f32 #1840
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1840
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@gloger2003 on GitHub · 2026-11-24 21:38 UTC · original
gloger2003:fix/normalized-buffer-load-rounding→main· +223 −32 · 3 files · 1 commits · draftPart 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
@upipibi on GitHub · 2026-11-24 22:50 UTC · original
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.
@DavidM1911 on GitHub · 2026-11-25 01:03 UTC · original
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!
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.