Repository navigation
Conversation
fmt_encode rounded every SNORM component to nearest even, so 0.5 and -0.5 stored 0 in the 2-bit W of 2_10_10_10_SNORM (0x28120100 for 0x68120100). RDNA2 stores +-1 from a magnitude of 0.5 up; its 8-, 10- and 16-bit SNORM components do round to nearest even (AnyPS5#25877, a store sweep of 75 formats on gfx1036). Both paths. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1b617e3 to
1e29ff4
Compare
|
A run with vkd3d-proton as the host D3D12 (DXIL → SPIR-V through dxil-spirv, then the NVIDIA Vulkan driver), so the DXIL goes through a different compiler than the native-Windows runs here: this PR's test passes. Tested
Not tested
AI use
|
|
Arc A770 verification of PR #2051 at Tested
$env:PR2051_TEST_EXE = 'L:/XclTooling/pr1512-tiling-edges-fddfa267/target/debug/build/xcl/97fdf2b9ff8e1482/out/xcl-97fdf2b9ff8e1482.exe'
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test {
& $env:PR2051_TEST_EXE 'gpu::recomp::tests::gpu_buffer_store_two_bit_snorm_rounds_half_away' --exact --nocapture --test-threads=1
}
Both runs acquired and released the Arc lock. Readback assertions matched these 32-bit words on both backends, with X = 0.5, Y = 0.25 and Z = −0.75.
Not tested The immediate binary32 neighbors of the half ties, including AI use T3 Code / Codex (gpt-6.2-sol) ran the checked-in test, verified the logs, and wrote this report. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
floor(|x| + 0.5) stored +-1 for the f32 neighbours just below +-0.5 (0x3effffff, 0xbeffffff): 0.49999997 + 0.5 rounds to 1.0 in f32, so W read 0x68120100 / 0xe8120100 instead of 0x28120100 on both paths (reported by nnonno91 on AMD). The 2-bit magnitude is at most 1, so compare it with 0.5 directly; +-0.5 still stores +-1. The test gains the two below-half inputs and their +-0.5 neighbours. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks nnonno91, that's a real bug. In f32, 0.49999997 + 0.5 rounds to exactly 1.0, so AI-assisted (Claude Code). |
|
Regression run of Against the limits in CONTRIBUTING.md: 104 % of AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, AI use: Claude Code (Claude Opus 5.5) built both trees and ran |
|
Please rebase onto |
98e83c0 to
372e66e
Compare
372e66e to
d25e85f
Compare
|
AMD synthetic GPU run of Tested
Not tested
AI use |
|
Here is the requested RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC. The 60 s offline runs used separate copies of the same starting profile and DXIL seed, no input, PSO preload off, a 16 GiB job commit cap, and a 12 GiB system commit floor. On the exact head, The smoke pair covers startup. AMD hardware, Wine, and world load were outside this test. AI-assisted. Codex (GPT-6, exact variant unavailable) ran the tests and drafted this report. |
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
|
Independent desktop NVIDIA verification of PR #2051 at head Environment
Targeted release tests & build (
|
| Command | Result |
|---|---|
cargo test --release -p xcl --lib gpu_buffer_store_two_bit_snorm_rounds_half_away -- --nocapture (3 consecutive runs) |
1 passed; 0 failed; 0 ignored; 1200 filtered out × 3 (0.27s, 0.22s, 0.23s, 0 skipped; live RTX 4060 execution) |
cargo test --release -p xcl --lib gpu_fmt_encode -- --nocapture (3 consecutive runs) |
2 passed; 0 failed; 0 ignored; 1199 filtered out × 3 (1.44s, 0.61s, 0.61s, 0 skipped; live RTX 4060 execution of gpu_fmt_encode_int_sat_and_f16_rtz and gpu_fmt_encode_direct_dxil_int_sat_and_f16_rtz) |
cargo test --release -p xcl --lib gpu::dxil:: -- --test-threads=4 (3 consecutive runs) |
147 passed; 0 failed; 3 ignored; 1051 filtered out × 3 (3.15s, 3.11s, 3.22s, 0 skipped) |
cargo build --release -p xcl |
Clean build (1m 04s, exit 0, 0 new warnings) |
Paired quiet 60 s retail smoke (title: 29640639)
Exact parent & merge-base (426a5a745db4d5e4b037449ede0b70cb342f5192, same machine):
xcl-smoke v1
commit: 426a5a745db4d5e4b037449ede0b70cb342f5192
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1591 (PresentX 1591)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14477 MB
PR #2051 (d25e85f1b183f8290dd1c9b6f5f9ecf79805873d):
xcl-smoke v1
commit: d25e85f1b183f8290dd1c9b6f5f9ecf79805873d
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1592 (PresentX 1593)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14443 MB
Runtime log observations (xcl.log)
9204log lines,0[ERROR]/ device-removal / panic lines (dxil_cache:449hits,11misses,11compilations,0compilation failures;228background pipelines,0failures).- Final draw/memory telemetry in log:
19543 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample14443 MB committed by the process; video memory 6115 MB local, 4653 MB non-local.
Limits of coverage
- Both HLSL and direct-DXIL 2-bit SNORM store rounding (half-away-from-zero and
< 0.5->0) were directly verified on the live RTX 4060 viagpu_buffer_store_two_bit_snorm_rounds_half_away(3/3),gpu_fmt_encode(2/2× 3), andgpu::dxil::(147/147× 3). - The 60 s retail smoke confirms zero runtime or shader-compilation regression (
11recompiled shaders,0failures; single-run frame/commit delta vs. parent reflects normal startup variance, not this PR); visual pixel-diff inspection of any retail2_10_10_10_SNORMoutput was not performed.
AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
fmt_encoderounded every SNORM component to nearest even. So 0.5 and −0.5 stored 0 in the 2-bit W of2_10_10_10_SNORM, where RDNA2 stores 1 and −1. Storing x = w = 0.5, y = 0.25, z = −0.75 gave0x28120100instead of0x68120100.Source for the rule: boykopovar/AnyPS5#25877 ran a store sweep of
tbuffer_store_format_xyzwin 75 formats on gfx1036. Only this 2-bit component differed from nearest-even rounding. 8-, 10- and 16-bit SNORM components and every UNORM width round to nearest even on the hardware too, so they stay as they are. These formats are common for packed normals and tangents, where the 2-bit component carries the handedness sign.What is in it
recomp/emit.rs: the SNORM arm offmt_encodeusessign(s) · floor(|s| + 0.5)when the component is 2 bits wide, andround(s)otherwise.dxil/lower_mem.rs: the same inLw::fmt_encode.recomp/tests.rs:gpu_buffer_store_two_bit_snorm_rounds_half_away. It stores eight W values (±0.5, ±1, 0.49, −0.75, 0.4999999, 0.5000001) with x = 0.5, y = 0.25, z = −0.75, and compares the packed words.98e83c0: the 2-bit magnitude (at most 1) is compared with 0.5 directly.floor(|x| + 0.5)rounded 0.49999997 + 0.5 to exactly 1.0 in f32, so0x3effffff/0xbeffffffstored ±1 (found by nnonno91). Exactly ±0.5 still stores ±1; other SNORM widths unchanged.Tested
d25e85f, as-is: Radeon RX 7800 XT (RDNA3, driver 32.0.31035.1003), Windows 11, debug, DXC 1.9.0.5512.gpu_buffer_store_two_bit_snorm_rounds_half_awaypasses;cargo test --workspace --no-fail-fast -- --test-threads=4: 1242 passed, 2 failed, 46 ignored. The 2 failures are not this PR's:fuzz_validate_and_gpu_1fails the same way onmain1a0bbe3there, andgpu_image_get_resinfo_past_last_levelcomes from this head's base, which predatesmain's fixea088a5.d25e85f1(rebased ontomain426a5a74, the firstmainwith green CI after5478c4a7, whose two failing tests main fixed in0d13b071), RTX 3070 (616.56):gpu_suite (--skip gpu_sparse_vram) 144 passed, 0 failed withXCL_DIRECT_DXIL=0and with=1.main426a5a74gives 143 passed on both.98e83c0, RTX 3070 (616.56): the test, extended with0x3effffff/0xbeffffff(W = 0) and0x3f000000/0xbf000000(W = ±1), fails at1e29ff4and passes after the fix withXCL_DIRECT_DXIL=0and1.gpu_suite: 133 passed with0; with1, 132 passed and 1 failed:gpu_image_get_resinfo_1d_array, which fails onmaintoo (Direct DXIL: image_get_resinfo of a 1D array gives the layers in y #2046).main5ce558f:mainfails on both paths (w = 0.5: 0x28120100, want 0x68120100). This branch passes withXCL_DIRECT_DXIL=0and1.gpu_tests (--skip gpu_sparse_vram): 133 passed withXCL_DIRECT_DXIL=0; with1, 132 passed and 1 failed,gpu_image_get_resinfo_1d_array, which also fails onmain5ce558f(Direct DXIL: image_get_resinfo of a 1D array gives the layers in y #2046 fixes it).dxil::andbuffer_formatunits: 138 passed.Regression run
Pair for the current head
d25e85fagainstmain1a0bbe3, run by thehollowedone (comment, thanks): RTX 3080 Ti (621.35), stockscripts/smoke.ps1, clean release builds, 60 s offline. Pasted unedited.Earlier: The earlier pair, comment, was for
98e83c0, before the rebase ontomain5478c4a7..A second pair, by ThiagoAlexsander on an RTX 5080 (comment, thanks):
main426a5a71529 frames shown, this headd25e85f1599, 0 crashes and 0 device removals on both.Not tested
AI use
🤖 Generated with Claude Code