Repository navigation
Conversation
Carry acaracargo's normalization fix and its two regression tests from f4c03b5 and 0bca2d7. Round the significand/scale product once with integer arithmetic, rather than rounding an intermediate f32 product to a halfway value. Add an independent packed-color GPU test and document the behavior. Fixes xcl-dev#659 Co-authored-by: acaracargo <58486686+acaracargo@users.noreply.github.com> Assisted-by: Codex (GPT-6)
|
Thanks for extending my fix and for the attribution! I was actually preparing to open the original branch as a draft PR. I've also completed local retail regression runs, and @requiemsnkrp offered independent smoke testing on #659. Let's coordinate so we don't end up with duplicate PRs. I'm happy to help validate this version and get the fix merged. |
|
Test report for Tested
16 test binaries: 694 passed, 1 failed, 41 ignored. Same machine, This PR's tests:
Failures:
16 test binaries instead of SKIPPED (no wave64 on this GPU): AI use: Claude Code (Claude Opus 5.5) ran the builds and tests and wrote this report from their output. |
|
Regression runs for this PR's head main: this PR: Tested
Not tested
Report written with Claude Code (Claude Opus 5.5) from runs on this machine. |
|
Native RDNA2 ( This extends @luckyteagirl's 13-input native check on #659 to the whole problem set. I ran
The result was 0 in each of 11 MODE values: f32 round RNE / +inf / −inf / RTZ, f32 and f16 denormals flushed or kept, DX10_CLAMP 0/1 and IEEE 0/1. Each mode was set with The special inputs give the same result in all 1024 values of MODE[9:0], and every one matches this PR's helpers:
@Kadthicu's negative SNORM16 case on #659, Tested
Not tested
AI use
|
Fixes #659. Avoid rounding an FP32 product to a halfway value before converting it to UNORM/SNORM.
The runtime fix and first two regression tests are @acaracargo's existing proposal, carried from f4c03b5 and 0bca2d7. This PR adds independent packed-format coverage and native Windows validation. acaracargo is credited as a co-author in the commit.
What is in it
emit.rs: round the significand/scale product once with integer arithmetic, preserving clamps and NaN handling.tests.rs: the original two regressions plus eight packed UNORM/SNORM formats, with 64 boundary/edge vectors and different values per channel.Tested
Head:
02fd1b03c357e5cb4457ca56fd343202de1d3736(clean tree), based onmain91f9a5e9f03156ea82dc55a18f7704862da7a5db. Windows 11 Home 26300, Ryzen AI 7 350, Rust 1.98.1 MSVC, debug, DXC/DXIL 1.8.2502.11.XCL_ADAPTER=nvidia:cargo build --workspace --locked;cargo test --workspace --no-fail-fast --locked -- --test-threads=4:695 passed, 0 failed, 41 ignored. Two
SKIPPED: no wave64tests are included in that passed count:gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware. All three normalization regressions and the synthetic-title end-to-end test ran and passed.XCL_ADAPTER=radeon,XCL_REQUIRE_GPU=wave64:cargo test -p xcl --lib gpu_pknorm_f32_rounds_once -- --nocapture;cargo test -p xcl --lib norm_formats_round_once -- --nocapture;cargo test -p xcl --lib gpu_wave32_program_in_wave64_hardware -- --nocapture:3 normalization tests + 1 wave64 control passed, 0 failed/ignored/skipped.
maindd2ae9a, keeping tests but removing the runtime fix: 41 pknorm and 54 typed-store mismatches. The added packed-format test also fails (11_11_10_UNORM, got 6291458, expected 6291457).git diff --checkpassed.Regression run
Pending: matched
scripts/smoke.ps1runs on main and this PR's clean head. No complete retail title was available locally, so no smoke blocks were generated. Keeping this PR draft until that validation is available.Not tested
Retail gameplay/performance, real console rounding, Intel GPUs, and the full suite on AMD.
XCL_SAMPLE_*was unset, so opt-in real-game-data paths were not exercised.AI use