Console UAV barriers for all resources; v_fract_f32 of ±inf / NaN gives NaN (NVIDIA) #68
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!68
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/68/head"
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?
@Foniass on GitHub · 2026-11-22 23:26 UTC · original
Foniass:nvidia-uav-barriers-fract→main· +52 −2 · 3 files · 2 commits · merged 2026-11-23 09:59 UTCTwo small fixes for NVIDIA found while working on wave64 programs on 32-lane GPUs (#67). They are independent of it.
Console UAV barriers apply to all resources
Translated shaders reach title memory through XCL's memory-window buffers, which are different D3D12 resources over the same memory as the title's buffers and textures. A UAV barrier the title issues for its own resource, or a transition into or out of
UNORDERED_ACCESS, therefore did not order the shaders' window accesses. AMD drivers wait and flush on any UAV barrier, but NVIDIA's need not, so a pass could read what the previous one is still writing. That is a possible cause of NVIDIA-only flicker.resource_barrier_xnow sends one UAV barrier with no resource (all UAV accesses) per batch that has a UAV barrier or a transition from or toUNORDERED_ACCESS. That costs about the same as one barrier per resource. Not reproduced without a game; the test title's command lists go through this path and pass.v_fract_f32of ±inf / NaN gives NaN, as on RDNAfract_fclampedx - floor(x)withmin(). HLSLminreturns its non-NaN operand, sofract(±inf)andfract(NaN)came out as 0.99999994 on an RTX 5070 Ti. RDNA computesx - floor(x)kept below 1.0, so ±inf gives NaN and NaN passes through. A compare-and-select does the same now. The new testgpu_fract_f32_edgesfails with the old helper. It needs wave64 like the other recompiler GPU tests, so on NVIDIA it runs only together with #67, where it was verified. Pixel and vertex shaders, which do run on NVIDIA today, use the same helper.Tests
RTX 5070 Ti: workspace, release: 373 passed, 0 failed, 34 ignored; the 39
SKIPPED …: no wave64lines are the same as on main. AMD not run: the machine's AMD iGPU is disabled.🤖 Generated with Claude Code
github-bot referenced this pull request2026-11-26 04:19:41 +00:00
@Foniass on GitHub · 2026-11-23 02:39 UTC · original
Note for merging: this conflicts with #46 only in
gpu/recomp/tests.rs, where both add a test at the same spot (gpu_fract_f32_edgeshere,gpu_f64_compares_with_nanand the rest there). Keeping both sides resolves it.@certified-retart on GitHub · 2026-11-23 03:00 UTC · original
Tested PR #68 (
319bcd6) on Windows 10 (with D3D12 Agility SDK 1.620.2 via #75 for SM 6.6+ on Win10) across two GPUs:gpu_fract_f32_edgesexecuted live and passed (0.12s).gpu_fract_f32_edgesskips as-written (no wave64) because it guards ongpu_ready()rather thangpu_ready_wave32().gpu_ready_wave32(),gpu_fract_f32_edgesexecuted live on the RTX 5070 and passed (0.35s), confirming±inf→NaN,NaN→NaN, and-(2^-25)→0x3F7F_FFFFon Blackwell hardware.(Note for after #71 merges: switching
gpu_fract_f32_edgestogpu_ready_wave32()will let this NVIDIA-specific regression test run automatically on wave32 NVIDIA GPUs too.)@ivall on GitHub · 2026-11-23 09:59 UTC · original
Merged. Checked on an RX 9070 (RDNA4):
cargo test --workspacewith the retail samples (shader pack, console DLLs, texture archive) – natively, and withXCL_SPLIT_WAVE64=1(new inba905cf: forces the split wave64 form on RDNA, which runs both wave sizes, so the NVIDIA path can be checked on AMD). XDefiant (title screen correct, 6 299 translated pipelines, 0 translation errors), Minecraft and Unicorn Overlord run.