Repository navigation
Conversation
|
Tested
All 18 comparisons matched with MSVC The Vulkan side used the PR's replay callbacks to capture |
|
Tested 175b0ff on RTX 5070 (Blackwell, subgroup 32..32), NVIDIA 616.56, Windows 11 Pro 26200: pass, also merged onto current main (91b36cf, clean merge).
For comparison, #525's d3d12_clear_test fails on this GPU at the RGBA8_UNORM 0.5 tie (NVIDIA 0x7f, WARP 0x80), which this PR's tie rounding covers. |
|
Ran
The 10 differences are all sRGB, and they are exactly the So on Intel, leaving the sRGB curve to the GPU does not reproduce WARP byte-for-byte — the same 1-ulp |
|
Independent AMD validation of exact PR head PR head: full runtime build succeeded; CTest 19/19 passed. All four differences are the depth plane of
Baseline control: I built the same comparison fixture against the PR's base Integration note now that #388 has merged: I separately combined this head with #388 head However, the combined CPU CTest initially fails
Changing only those test expectations in the isolated combination gives CTest 24/24. That adjustment is local validation only, not pushed to either branch. Please include it when updating #521 onto the main containing #388. This is an integration-test expectation change, not evidence of a typeless GPU regression. The D24 fallback remains a separate inherited issue; I would not describe this AMD run as a full 178/178 pass. |
175b0ff to
f53f7de
Compare
|
Rebased after #525 merged: the branch is now one commit on main, f53f7de. It keeps only what #525 doesn't cover: round-half-to-even for UNORM/SNORM, the remaining format classes, sRGB alpha, D16, and the 178-case |
…D-45) Rebased onto main after ItsNotRexed#525, which added SNORM/SINT render targets for four formats. This keeps ItsNotRexed#525's formats and adds what it leaves out: - Normalised clears round to nearest even like D3D, so 0.5 on an 8-bit channel is 128 (NVIDIA's clears write 127). The layer hands Vulkan the exact fraction; NaN is 0 and out-of-range values clamp. Covers UNORM, SNORM (scale 127 or 32767, -1.0 is -127), the alpha of the sRGB formats, R10G10B10A2_UNORM and D16_UNORM depth. - More formats: R8/R8G8/R16/R16G16/R16G16B16A16 SNORM, R8/R16 SINT, R8/R16 UINT, R16_UNORM and R16G16_UNORM, with their copy sizes; SINT and UINT of every width clamp to the component range and truncate toward zero. - d3d12_clear_formats_test: 178 cases against WARP over UNORM, SNORM, sRGB, FLOAT, UINT, SINT and the four depth formats. typeless_rtv_test now expects the rounded UNORM value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
f53f7de to
a7b9ea1
Compare
|
Rebased again, onto main c432cdc (after #600), as a7b9ea1. The only conflict was |
|
I tested a7b9ea1 on an AMD Radeon 880M (AMD driver 26.11.2) and an NVIDIA RTX 5070 Laptop (617.42), Windows 11, MSVC 17.14: pass, with one finding for D24S8 on AMD.
Why this matters. On plain The 4 AMD differences are all D24_UNORM_S8_UINT depth cases, for example A note on ties. The spec rounds ties up, while this PR rounds half to even. They agree on every value 8-bit and 10-bit UNORM can produce, because 0.5 is the only tie there. AI-assisted (Claude Code). |
|
Replying to @AlxcBTW. There’s a baseline control for the D24 finding. On the RX 5700 XT, @73N1X ran the same comparison fixture on both AI-assisted. |
|
Tested a7b9ea1 merged onto main c432cdc on NVIDIA GeForce RTX 4060 Ti (Ada), driver 32.0.16.2124 (NVIDIA 621.24), Windows 11 Home 26300, MSVC 2022 / Ninja, Vulkan SDK 1.4.363: pass, and it fixes an existing failure on this card.
AI-assisted. |
|
Tested a7b9ea1 on RTX 4090 (driver 621.14), Windows 11 26200, MSVC 19.44: pass
No game files used. AI-assisted run (Claude Code). |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Updated to c0a92eb: main (aa2988c) merged in, clean.
I couldn't build locally (no C++ toolchain on this machine), so CI will be the first build of this merge. AI-assisted (Claude Code). |
|
Independent RTX 3090 verification of c0a92eb (validation on): targeted clears pass — 197 WARP readbacks, 178/178 format cases, 505 replay checks. The device test passes with 16 one-code plain-clear ties accepted; removing that acceptance fails with 16 AI-assisted (OpenCode) |
|
Tested c0a92eb on Windows 11, RTX 5080 (driver 616.92) and AMD Radeon iGPU gfx1036 (driver 26.10.1), MSVC RelWithDebInfo build of this head (it already contains
AI-assisted. |
|
TEST-919 comparison on RTX 5070, NVIDIA 610.88, Vulkan 1.4.341, Windows 11 build 26200, MSVC 19.44.35227, SDK 10.0.26100.0, RelWithDebInfo.
The five baseline default-clear differences are the reported four color formats and depth format 55 ( For all 14 typeless mismatches the layer bytes match WARP. This independently confirms the same-adapter tie issue reported on the RTX 3090 above. Synthetic fixtures only. AI-assisted. |
|
@NWX10, @sds-228's requested test update is up as NWX10#2, a fast-forward of c0a92eb that touches only |
|
TEST-919 check of this PR (head c0a92eb, main aa2988c merged in), run on an RTX 5080 (Linux, driver 580.65.06), runtime cross-built with clang-cl and run under Wine 11 on Xvfb. No code changed, nothing else posted. 1. This PR already registers the test. 2. The default mode could not be run to a result on this setup. Neither 3. A problem for Linux and Wine users once this merges. Both tests exit 1, not 77, when WARP is missing. With 4. What does run on the 5080 with this head ( AI-assisted. No game files. |
|
Tested c0a92eb on NVIDIA RTX 4070 SUPER (driver 616.92), Windows 11 26200, MSVC 14.44, Vulkan SDK 1.4.363, RelWithDebInfo, |
|
Tested Independent check of the rule in NWX10#2 (@marquezinii): before it was posted I had written the same acceptance separately (layer equals WARP byte for byte, host within one code per 8-bit, 16-bit or 10:10:10:2 component) and ran it here:
Code read of NWX10#2: same rule, and it clears the WARP readback when WARP fails to render, which my version didn't. One nit: No game files. AI-assisted (Claude Code). |
|
Tested c0a92eb on NVIDIA GeForce RTX 4060 Ti (Ada), driver 621.01, Windows 11 (MSVC 14.52, Visual Studio 2026): pass.
AI-assisted (Claude). |
Kam471
left a comment
There was a problem hiding this comment.
Verified c0a92ebc on Windows 11, RTX 5070 Ti (NVIDIA 621.24), matching the case #521 exists to fix:
d3d12_clear_test.exe(default mode) -> exit 0: RTV and DSV clears: 197 full/rectangle readbacks matched WARP, and 648 RGBA 3D-RTV texels match WARP/expected slices. This is the test that failed on main with the five 0x7f/0x80 and depth-55 differences.d3d12_clear_formats_test.exe-> exit 0: 178 matched WARP, 0 differ, 0 failed, covering UNORM/SNORM/SRGB/FLOAT/UINT/SINT and the depth/stencil planes; 0 formats unexposed and 0 skipped by WARP.ctest -R 'd3d12_clear'-> 2/2 passed (0.32 s / 0.29 s).
This also unblocks #4294's ctest registration. No blocking issue.
Flyander
left a comment
There was a problem hiding this comment.
Review of the current clear-rounding implementation.
| // changes the mode would round differently. floor() does not depend on it, and x + 0.5 is exact here (x is at most | ||
| // a float times 65535, well inside a double's 53 bits). | ||
| inline double round_half_even(double x) { | ||
| const double r = std::floor(x + 0.5); |
There was a problem hiding this comment.
[P2] Avoid the mode-sensitive addition for tiny positive values
x can be much smaller than one double ULP at 0.5 (for example, float denorm_min multiplied by 255). Under FE_UPWARD, x + 0.5 rounds to the next double above 0.5, so floor returns 1 and the clear becomes 1/255 instead of 0. This contradicts the comment that the sum is exact and breaks the intended rounding-mode independence for near-zero inputs. Please handle this range without adding the tiny value to 0.5, and include a near-zero case in the rounding-mode coverage.
Claimed in #374 as: D3D-45
What and why
D3D-45 asks for the clears to be compared with the host runtime across the format classes. This adds
d3d12_clear_formats_test(run explicitly, liked3d12_uint_clear_test, which it extends) and fixes what it found. It clears, copies the result into a readback buffer through D3D12 and compares the bytes with WARP's: 178 cases over UNORM, SNORM, SRGB, FLOAT, UINT and SINT render targets and the four depth formats (depth and stencil planes), each with a full clear and a rectangle clear.On main (4abd545) the test found two things, one commit each:
vkCmdClearColorImageand clear attachments write 127. The same step showed onR10G10B10A2_UNORM(0.5 -> 512),R16G16B16A16_UNORM, the alpha of the sRGB formats andD16_UNORMdepth. The layer now rounds the value itself and hands Vulkan the exact fraction, so no GPU can round it differently (NaN is 0, values outside 0..1 clamp, as in D3D). The sRGB colour channels stay with the GPU's curve.SNORM(6 formats),SINT(5),R8_UINT,R16_UINT,R16_UNORMandR16G16_UNORMgave "texture format not supported yet". They are mapped now, with their copy sizes, and clear like D3D: SINT clamps to the component range and truncates toward zero, SNORM rounds to nearest even on a scale of 127 or 32767 with -1.0 as -127.The conversions were measured against WARP, not taken from the documentation.
Tested
d3d12_clear_formats_test: 178 cases match WARP, with and withoutLEONIDA_VK_VALIDATION=1, no validation errors. Before the commits: 29 differ and 73 are not exposed (the test lists such formats as "not exposed" instead of failing, so it stays usable on a layer that lacks a format).ctest: 19/19.clear_color_test(CPU only) now also checks the rounded UNORM/SNORM values and the SINT and small UINT conversions (110 checks); withvulkan_replay.hfrom main its new checks fail (normalised clear: format 37 ... got 0.5, expected 0.501960814).d3d12_com_test,d3d12_vulkan_device_test,d3d12_descriptor_test,d3d12_uint_clear_test,vk_command_replay_testanddevice_proxy_test: exit 0 with and without validation.runtime/CMakeLists.txtandruntime/src/vulkan_replay.hnear the clear code; they merge with this one apart from adjacent lines, so whichever lands second needs a rebase.AI-assisted (Claude Code).
Checklist
docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code