Repository navigation
Conversation
|
Independent native Windows NVIDIA RTX 5080 (wave32) + D3D12 debug layer build/test run and code review at head Code Review
Tested
Not tested
AI use: Antigravity (Gemini 4 Neon reviewed the diff; Gemini 4 Hydrogen ran the RTX 5080 workspace tests) drafted this report. |
|
Test run of Tested
Review: Reducing in turns ( Not tested: no retail title or regression run (I have no unpacked game), no Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code. |
|
Updated hardware check for new head Tested
Regression run PR ( Not tested
AI use
|
|
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. |
|
2| |
|
Updated AI-assisted (Claude Code). |
|
Test report: NVIDIA RTX 5060 Ti (wave32), head Tested
Not tested
AI use: Claude Code (Claude Opus 5.5) ran the commands above and wrote this report. No code changes. |
|
Tested on NVIDIA (32-lane waves): passes
Not tested: AMD, any title (no smoke run). AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report. |
|
@eizispark @Anon64 thanks for the smoke pairs. Both were made on AI-assisted (Claude Code). |
|
Regression pair for Tested
this PR, Presents per 2 s over the whole run (from the
Both runs are at the 60-a-window cap most of the time. The 63-frame gap is two single dips in the PR's run (36 against 50 at 6-8 s, 39 against 60 at 14-16 s) and a slow phase from about 44 s that both runs have (111 frames in the last 16 s against 138). On #1244 today the same slow phase gave one pair 87 % and the next 103 %, so one pair can't separate a few percent from run-to-run spread. Not tested
AI use: Claude Code (Claude Opus 5.5) |
|
Tested The checked-in Intel Arc A770 driver 32.0.101.9175, Ryzen 7 3800X, Windows 11 Enterprise Evaluation build 26200.9974, Rust 1.100.0 x86_64-pc-windows-msvc, and the unoptimized Cargo test profile with debug info disabled. The test logged dxcompiler and dxil 1.9.2609.5. The A770 capability probe reported an 8–32 lane range. The test used split wave64 and checked 64 logical lanes. $env:CARGO_TARGET_DIR = 'L:/XclTooling/pr1512-tiling-edges-fddfa267/target'
$env:TEMP = 'L:/XclTooling/pr818/run-20261125-023707-153/temp'
$env:TMP = $env:TEMP
$env:CARGO_BUILD_JOBS = '2'
$env:CARGO_INCREMENTAL = '0'
$env:CARGO_PROFILE_DEV_DEBUG = '0'
$env:CARGO_PROFILE_TEST_DEBUG = '0'
$env:XCL_ADAPTER = 'A770'
$env:XCL_DXC_DIR = "$env:LOCALAPPDATA/XclTooling/dxc-1.9.2609/bin/x64"
cargo test -p xcl --lib --locked --no-runThe prebuild exited 0 outside the GPU lock. The following block ran in & 'L:/XclTooling/Invoke-ArcTest.ps1' -Test {
& 'L:/XclTooling/CapabilityProbe/capabilities.exe'
& 'L:/XclTooling/pr1512-tiling-edges-fddfa267/target/debug/build/xcl/77aca8ccb20e299f/out/xcl-77aca8ccb20e299f.exe' 'gpu::recomp::tests::gpu_sin_cos_reduce_in_turns' --exact --nocapture --test-threads=1
}
Not tested Native wave64, the old lowering on Arc, other GPUs, the full workspace suite, and retail-title smoke runs. AI use Codex in T3 Code ( |
# Conflicts: # crates/xcl/src/gpu/recomp/emit.rs # crates/xcl/src/gpu/recomp/tests.rs
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
A sign-bit difference (0x80000000 = -0.0/negative NaN vs +0.0) in an f32 transcendental on the GPU — likely a — Devin |
…xcl-dev#796) v_sin_* / v_cos_* take the argument in turns. XCL emitted sin(x * 6.2831853f), which rounds the phase away at radian scale before any reduction: on an RTX 3070 sin(100000.125) gave 0.6716 for 0.7071, and ±MaxFloat gave NaN because the product overflows. The RDNA 2 ISA's own examples (p.142, p.149) have sin(-MaxFloat) = 0, cos(-MaxFloat) = 1, cos(0.25) = 0 and V_SIN_F16(0x7bff) = 0. sin_turns / cos_turns reduce exactly with x - trunc(x) first, return exact zeros at whole and half turns (sin) and quarter turns (cos), keep sin(-0) = -0, and give ±inf the ISA's 0xFFC00000 and a NaN itself on the bits (DXC's relaxed float math otherwise turned sin(inf) into 0 on the 3070). The f16 forms use the same helpers on the exact f32 value. gpu_sin_cos_reduce_in_turns checks every functional example the ISA prints for the four instructions plus whole, half and quarter turns and large arguments; it fails on main with 21 mismatches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e RDNA2 results luckyteagirl measured the native instructions on an RX 6800M (gfx1031) in xcl-dev#796 (comment). gpu_sin_cos_reduce_in_turns now uses those results as hardware rows: - f32: -0, 0.25 / -0.75, 0.5 / 8388607.5, ±MaxFloat, and ±Inf giving 0xFFC00000. Rows that used to check only "near ±1" now check exact bits. - f16: -0, 255, ±65504, and ±Inf giving 0xFE00. - 0.125 turns (f32 at 0.125, 255.125, 100000.125, 1000000.125, giving 0x3F3504F4 / 0x3F3504F3; f16 at 0.125, 255.125, giving 0x39A8): these values come from each GPU's own sine approximation, so they are compared within one ulp. On the RTX 3070, v_sin_f16 / v_cos_f16 of ±Inf gave 0x7FFF, because f32tof16 turns the f32 NaN into that value. They now take the infinity from the source bits and give 0xFE00. With clamp the NaN saturates as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…path does xcl-dev#818 moved the HLSL path's v_sin / v_cos (f32 and f16) to `sin_turns` / `cos_turns`: the argument reduced exactly (x - trunc(x)) before the scaling to radians, exact zeros at whole and half turns (sin, sin(±0) = x) and quarter turns (cos), and `trig_nonfinite` for ±inf (0xFFC00000) and NaN (itself, quiet); f16 ±inf gives 0xFE00 without clamp. The direct translator still took Sin / Cos of x · 2π, so `lower_dxil`'s `f32_programs_on_the_gpu`, which compares the two backends register for register, failed at v_sin_f32(-0.5): -0 from Sin(-3.1415927) on the direct path against the HLSL path's exact +0. `Lw::trig_turns` (prelude.rs) builds the HLSL helpers operation for operation; lower_valu.rs and lower_wide.rs lower the four instructions through it, the f16 path with the HLSL path's 0xFE00 select. No TRANSLATOR_VERSION bump: the direct translation cache keys on the hash of the gpu/dxil sources (XCL_DIRECT_DXIL_SOURCE_ID). A non-GPU test checks the container (validated when DXC's validator is present) for the Round_z, Sin / Cos and the selects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ce03d3e to
f73e6ea
Compare
|
@DavidM1911 Thanks, reproduced and fixed. On an RTX 3070 the test failed 3 of 3 with #818 merged onto Cause: #818 changed only the HLSL path, which now reduces Fix: Tested on the RTX 3070 (616.56): One thing nobody has measured, as far as I can find: which zero RDNA2 itself returns at a negative half turn. Both paths now give +0 there, following the HLSL helper. AI-assisted (Claude Code). Synthetic tests only. |
|
AMD synthetic GPU run of Tested
Not tested
AI use |
v_sin_*/v_cos_*take their argument in turns. XCL emittedsin(x * 6.2831853f), which rounds the phase away at radian scale before any reduction, so the error grows with the number of turns. ±MaxFloat overflows the product to infinity and gives NaN. The RDNA 2 ISA's functional examples (p.142 for f32, p.149 for f16) reduce in turns and accept every finite input:V_COS_F32(0.25) = 0,V_SIN_F32(-MaxFloat) = 0,V_COS_F32(-MaxFloat) = 1,V_SIN_F16(0x7bff) = 0. Mesa's ACO drops its explicitv_fractfrom GFX9 on ("before GFX9, v_sin_f32 and v_cos_f32 had a valid input domain of [-256, +256]").Fixes #796.
What is in it
crates/xcl/src/gpu/recomp/emit.rs: HLSL helperssin_turns/cos_turns(andtrig_nonfinite), used byv_sin_f32,v_cos_f32,v_sin_f16andv_cos_f16.x - trunc(x), which is exact in f32, and then scale.sin(-0) = -0.0xFFC00000and a NaN input gives itself, quiet. Without that guard, DXC's relaxed float math turnedsin(±inf)into 0 on the 3070 (inf - trunc(inf)was lost).crates/xcl/src/gpu/recomp/tests.rs: GPU testgpu_sin_cos_reduce_in_turns.sin/cos(2π·(x - trunc(x))), within 2^-16 (f32) or 2^-10 (f16) absolute.crates/xcl/src/gpu/dxil/prelude.rs,lower_valu.rs,lower_wide.rs(f73e6ea): the direct DXIL translator reduces in turns the same way.Lw::trig_turnsmirrorssin_turns/cos_turns/trig_nonfiniteop for op, for f32 and f16. Without it,lower_dxil::tests::f32_programs_on_the_gpu, which compares the two paths register for register, failed atv_sin_f32(-0.5)(direct -0 against HLSL +0), as DavidM1911 found. The direct cache keys on thegpu/dxilsources, so no version bump.Tested
AMD, run by oni-swr (comment, thanks) at the exact head
f73e6ea, as-is: Radeon RX 7800 XT (RDNA3, driver 32.0.31035.1003), Windows 11, debug, DXC 1.9.0.5512.gpu_sin_cos_reduce_in_turns(HLSL path),lower_dxil::tests::f32_programs_on_the_gpu(direct path; its f32-conversion case was SKIPPED on wave32 and wave64, per-lane form refused) and the newsin_and_cos_reduce_the_argument_in_turnspass;cargo test --workspace --no-fail-fast -- --test-threads=4: 1243 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. Only the default translator selection was run, so the two paths are covered by the two test functions, not by forcingXCL_DIRECT_DXIL.At
f73e6ea(this PR rebased ontomain426a5a74, plus the direct DXIL commit), RTX 3070 (616.56):lower_dxil::tests::f32_programs_on_the_gpupasses 3 of 3 (it failed 3 of 3 with the previous head merged ontomain96331383),f16_programs_on_the_gpupasses, andgpu_sin_cos_reduce_in_turnspasses withXCL_DIRECT_DXIL=0and=1.gpu_suite (--skip gpu_sparse_vram): 144 passed, 0 failed on both paths (main426a5a74: 143).NVIDIA GeForce RTX 3070, driver 616.56, AMD Ryzen 9 5950X, Windows 11 Pro 26100, rustc 1.100.0, debug, DXC 1.8.2502.11
cargo test --workspace --no-fail-fast -- --test-threads=4on baf0639: 705 passed, 0 failed, 41 ignoredSKIPPED GPU tests:
gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu_wave32_program_in_wave64_hardware(no wave64)The new test fails on
main(e50836b) with 21 mismatches, among themsin(100000.125) = 0.6716,sin(±MaxFloat)/cos(±MaxFloat)= NaN,cos(-0.75) = -1.9e-7,sin(12345.5) = 0.0061,V_SIN_F16(0x7bff) = 0xA648,V_COS_F16(0x7bff) = 0x3BFF. It passes with the change.Open PR Tests: f32 and f16 transcendentals on the GPU against f64 references #643's
gpu_transcendental_f32/_f16(its head 232ee73, applied locally on top) pass both onmainand with this change. Worst errors on the 3070 from its own output:mainTests: f32 and f16 transcendentals on the GPU against f64 references #643 can keep its tolerances. With this PR its 2^-10 absolute allowance for sin / cos could tighten to the D3D class it uses for the others, and its skip of inputs above 256 turns could go.
Regression run
Pair for the current head
f73e6eaagainstmain426a5a7, run by ThiagoAlexsander on the retail title (comment, thanks): RTX 5080 16 GB,scripts/smoke.ps1 -Seconds 60. Pasted as printed.Earlier pair, for an earlier head, from Kalmarv's run (#818 (comment)), thanks:
main:
PR:
Related: #2168. The HLSL path's default fast-math changes
v_sin/v_cosresults on AMD, and the HLSLsin_turns/cos_turnshelpers this PR adds aren't markedprecise, so an AMD run of this head mattered; oni-swr's run above passes these tests.Not tested
XCL_DIRECT_DXIL); native wave64. The test's wave64 program ran in the split form on the 3070.sin(0.5)) and at a negative whole turn: the ISA prints none. This PR returns +0, matchingV_SIN_F32(-MaxFloat) = 0x00000000.v_sin/v_cosnow does atrunc, a subtraction and two compares more.AI use
🤖 Generated with Claude Code