victory-shader: prioritize zero operands in v_div_fixup_f32 #18
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T05:58:09Z.
Summary
Port upstream
trustno1-coder/VIctory-NVIDIAfeb90ad(originally6e6f87993f661dd592e21bbbde5e6e4589a2af17) intocrates/victory-shader/src/emit/lower.rsandcrates/victory-shader/src/emit/mod.rs:n_zero/d_infandn_inf/d_zerobefore applyingq_nan -> signed_infinv_div_fixup_f32lowering so division fixup corner cases with a NaN intermediate quotient prioritize zero and infinity operands accurately.div_fixup_corner_fixture(),div_fixup_corner_program_lowers_without_gpu, anddiv_fixup_corner_program_executes_on_gpucovering 12(q, den, num, expected)edge cases includingq=NaNwithnum=+-0andden=+-Inf.Rig Specs Tested On
13th Gen Intel(R) Core(TM) i7-13700FNVIDIA GeForce RTX 4060 Ti(8 GiBVRAM)32 GiBWindows 11 Home (Build 26300)/ NVIDIA Driver32.0.16.2124Run Settings & Profile
2932c16690cb41e56ed1ad8ea77c6a123041daa5(no separate live game binary test run for this isolated 5-line instruction fix;CIvalidates full workspace build +victory-shader+victory-gpu)N/A(unit / GPU shader harness)N/AN/AVICTORY_*Overrides:cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader div_fixup_corner_program_executes_on_gpu -- --ignored --test-threads=1v_div_fixup_f32corner-case inputs dispatched on hardware GPUMeasurements & Verification
N/A(shader instruction lowering & hardware compute verification; full CI build & suite pending/watched on PR)offN/A(unit / single-dispatch compute test)0cargo +1.98.1-x86_64-pc-windows-gnu xtask policy(294 files ok)cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask(6 passed; 0 failed)cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings(0warnings)cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features victory-gpu/diagnostics -- -D warnings(0warnings)cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader div_fixup -- --test-threads=1(1 passed; 0 failed; 1 ignored)cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader div_fixup_corner_program_executes_on_gpu -- --ignored --test-threads=1(1 passed; 0 failed)cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader valu_div_f32_sequence_executes_on_gpu -- --test-threads=1(1 passed; 0 failed)Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T06:03:10Z.
Automated triage for the maintainers (not an approval).
Verdict:
needs-gpu-test· CI (check):passingReview Summary
The
v_div_fixup_f32lowering fix incrates/victory-shader/src/emit/lower.rsis clean and matches AMD ISAV_DIV_FIXUP_F32precedence rules:make_infOR'dq_nanwithn_inf | d_zeroand was selected aftermake_zero, causingq = NaNto overridenum = ±0orden = ±Infand returnsigned_infinstead of signed zero (sign).n_nan -> n_qnan,d_nan -> d_qnan,invalid (both_inf | both_zero) -> kneg_qnan,make_inf (n_inf | d_zero) -> signed_inf,make_zero (d_inf | n_zero) -> sign,q_nan -> signed_inf, elsesigned_q. Sincemake_infandmake_zeroare mutually exclusive wheneverinvalidis false, this resolves all zero/infinity operands before falling back toq_nan -> signed_inf.crates/victory-shader/src/emit/mod.rs):div_fixup_corner_fixture()correctly encodesv_div_fixup_f32 v1, v1, v2, v3(0xD55F_0001, 0x040E_0501) across 12 lanes coveringq=NaNwith±0/±Inf,0/0,Inf/Inf, and sNaN quieting.needs-gpu-test: CI is passing, butdiv_fixup_corner_program_executes_on_gpuis marked#[ignore]and does not execute in CI; because this changes DXIL shader lowering invictory-shader, it warrants running the hardware D3D12 compute dispatch test locally before merging.Local GPU Verification
Generated with Antigravity CLI (
agy).