Under Proton, mad() can be split into a multiply and an add, so wg_div / pd_div3 are 1 ULP off (upstream fix proposed)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 15/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- cpp
- Lĩnh vực
- computer-graphics
Hướng nghiên cứu
The payload names build_dx12.py, which strips precise marks from the division shaders, and clean/dx12/README.md, which documents the Windows driver's fused mad() behaviour. It also names native_helpers color_divide and native_direct_test check as the ULP measurements. The root cause and the proposed fix live upstream in dxil-spirv#365, so no change in this repository is clearly requested; confirm with the maintainer what, if anything, belongs here before starting.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Under Proton, WrongGPU's exact arithmetic is not exact everywhere. The cause is in the D3D12-to-Vulkan translation, not in WrongGPU, and a fix is proposed upstream: HansKristian-Work/dxil-spirv#365. This issue records what we found, for reference.
What happens
dxil-spirv translates mad() (DXIL FMad) to a SPIR-V Fma. It marks the Fma NoContraction only when the FMad carries dx.precise. Without that mark, RADV's compiler (ACO) may split the Fma into a multiply and an add. In wg_div, mad(-bs, y, 1.0f) became s_mul_f32 + s_sub_f32, and the remainder steps became v_mul_f32 + v_sub_f32. AMD's Windows driver keeps every non-precise mad() fused (clean/dx12/README.md), and wg_div and pd_div3 depend on that.
Measured on an RX 9070 XT (RADV) under GE-Proton 11-11, with vkd3d-proton 5b1089c8 + dxil-spirv#362:
native_helperscolor_divideagainst IEEE division (NumPy): 44,010 of 1,802,240 results 1 ULP off (51 of 110 divisors).native_direct_test check: the direct and staged routes differ by 1 inpost.historyfrom frame 3 (reset frame, exposure mode 0, pre-exposure 1.375).
In game, a difference this size is not visible. It matters for bit-exact comparisons run under Proton.
Fixes
- Upstream, dxil-spirv#365: every FMad's
FmagetsNoContraction. With it,color_dividehas 0 wrong results and the two routes give the same bits on all 8 frames. A timing A/B of Model M's frame showed +0.18%, inside the noise. In Cyberpunk, RR's frame time did not change. It reaches players once a vkd3d-proton with it ships in Proton. - Interim, no rebuild: vkd3d-proton's shader quirk. Create a text file with this line:
Then start the game with0000000000000000-ffffffffffffffff FORCE_NOCONTRACT_MATHVKD3D_SHADER_QUIRKS=<path to that file> %command%.color_dividethen also has 0 wrong results; Model M's frame A/B was +0.52%, inside the noise. Note that this applies to every shader in the game, not only WrongGPU's. I have not measured what it costs the game's own rendering.
Not a fix: precise
Marking the divisions' mad() calls precise would give dxil-spirv the dx.precise mark it needs. But build_dx12.py removes these marks on purpose, because AMD's Windows driver splits a precise mad(). Keeping them would trade the Proton problem for the same problem on Windows, so the fix belongs in the translation layer.
🤖 Generated with Claude Code
- Ngôn ngữ chính
- C++
- Star
- 12
- Fork
- 2
- Merge trung bình
- 3 giờ 10 phút
- Pull request đã merge (30 ngày)
- 171
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của phantoslayer21/wronggpu
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
phantoslayer21/wronggpu#275 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
phantoslayer21/wronggpu#274 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
phantoslayer21/wronggpu#241 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug build
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
phantoslayer21/wronggpu#234 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Launcher tests: "an older record: update available" fakes a version newer than the test buildĐang mởbug build
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
phantoslayer21/wronggpu#233 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của phantoslayer21/wronggpu
Issue tương tự
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
ReyeMe/SaturnRingLib#155 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Nheko-Reborn/nheko#2092 ·
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
isocpp/CppCoreGuidelines#2345 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 71/100
ROCm/rocm-libraries#16108 ·
Maintainer thường phản hồi trong vòng 2 ngày