Fix signed zero precedence in shader division fixup #353

Open
github-bot wants to merge 1 commit from github-bot/gh-353 into main AGit
Owner

@⁠nawnie on GitHub · 2026-11-27 21:18 UTC · original
nawnie:fix/div-fixup-zero-priority → main · +140 −5 · 2 files · 1 commits · open

For v_div_fixup_f32, a NaN intermediate quotient can currently override the signed zero required when the numerator is zero or the denominator is infinite. Resolve those operand cases before handling a NaN quotient, while retaining the existing invalid-operation and input-NaN precedence.

This ports the selection-order correction also present in Marvisak/VIctory#200, credited to Nikita Romanovich. The separate exponent-difference underflow rule in that proposal is outside this change; this does not claim complete division emulation.

Validation:

  • cargo test --locked --offline -p victory-shader --lib emit::tests::div_fixup_corner_program_lowers_without_gpu -- --exact --nocapture passed.
  • The ignored div_fixup_corner_program_executes_on_gpu test passed all 12 synthetic cases on a GeForce RTX 4070 Ti SUPER using D3D12. This does not independently validate behavior against RDNA2 hardware.
  • git diff --check passed. Crate-wide cargo fmt -p victory-shader -- --check reports pre-existing formatting differences outside this change.

No gameplay or frame-rate improvement is claimed; this is a targeted shader-correctness fix.

**@⁠nawnie** on GitHub · 2026-11-27 21:18 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/353) `nawnie:fix/div-fixup-zero-priority` → `main` · +140 −5 · 2 files · 1 commits · open For `v_div_fixup_f32`, a NaN intermediate quotient can currently override the signed zero required when the numerator is zero or the denominator is infinite. Resolve those operand cases before handling a NaN quotient, while retaining the existing invalid-operation and input-NaN precedence. This ports the selection-order correction also present in [Marvisak/VIctory#200](https://github.com/Marvisak/VIctory/pull/200), credited to Nikita Romanovich. The separate exponent-difference underflow rule in that proposal is outside this change; this does not claim complete division emulation. Validation: - `cargo test --locked --offline -p victory-shader --lib emit::tests::div_fixup_corner_program_lowers_without_gpu -- --exact --nocapture` passed. - The ignored `div_fixup_corner_program_executes_on_gpu` test passed all 12 synthetic cases on a GeForce RTX 4070 Ti SUPER using D3D12. This does not independently validate behavior against RDNA2 hardware. - `git diff --check` passed. Crate-wide `cargo fmt -p victory-shader -- --check` reports pre-existing formatting differences outside this change. No gameplay or frame-rate improvement is claimed; this is a targeted shader-correctness fix.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 21:23:10 +00:00
Author
Owner

@⁠1tsethan on GitHub · 2026-11-27 23:01 UTC · original

Independent Windows validation of PR #353.

Tested commit: 6e6f87993f661dd592e21bbbde5e6e4589a2af17.

cargo test --locked -p victory-shader div_fixup_corner_program_lowers -- --nocapture --test-threads=1

Exit: 0.

  • test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 293 filtered out; finished in 0.00s

Tested commit: 6e6f87993f661dd592e21bbbde5e6e4589a2af17.

cargo test --locked -p victory-shader div_fixup_corner_program_executes_on_gpu -- --ignored --nocapture

Exit: 0.

  • test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 293 filtered out; finished in 2.11s

Independent verification with OpenAI Codex assistance. Windows 11 Pro build 26200; Rust 1.98.1 MSVC; Windows SDK libraries from Microsoft.Windows.SDK.CPP.x64 10.0.28000.2957. Test harness used an RTX 3070 Ti / AMD integrated-GPU host; adapter identity was not captured for every test. These are focused checks on the stated PR commit, not gameplay, FPS, or a merged-main integration result.

**@⁠1tsethan** on GitHub · 2026-11-27 23:01 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/353#issuecomment-7229803189) Independent Windows validation of PR #353. Tested commit: `6e6f87993f661dd592e21bbbde5e6e4589a2af17`. `cargo test --locked -p victory-shader div_fixup_corner_program_lowers -- --nocapture --test-threads=1` Exit: **0**. - test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 293 filtered out; finished in 0.00s Tested commit: `6e6f87993f661dd592e21bbbde5e6e4589a2af17`. `cargo test --locked -p victory-shader div_fixup_corner_program_executes_on_gpu -- --ignored --nocapture` Exit: **0**. - test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 293 filtered out; finished in 2.11s Independent verification with OpenAI Codex assistance. Windows 11 Pro build 26200; Rust 1.98.1 MSVC; Windows SDK libraries from Microsoft.Windows.SDK.CPP.x64 10.0.28000.2957. Test harness used an RTX 3070 Ti / AMD integrated-GPU host; adapter identity was not captured for every test. These are focused checks on the stated PR commit, not gameplay, FPS, or a merged-main integration result. <!-- victory-native-validation-20261128 -->
Author
Owner

@⁠cloph-dsp on GitHub · 2026-11-28 00:57 UTC · original

Independent local verification (Windows, Rust 1.100.0/MSVC, no game data):

  • PR #353 at head 6e6f87993f661dd592e21bbbde5e6e4589a2af17, merge base 0f0ada19095979e2192d1b5a98bb5297cf4d53ea.
  • cargo test --locked -p victory-shader --lib emit::tests::div_fixup_corner_program_lowers_without_gpu -- --exact --test-threads=1 --quiet → 1 passed, 0 failed, 293 filtered, exit 0.
  • git grep -F for the test name on the merge base returned no hits (test is new on this PR); git diff --check 0f0ada19 HEAD clean (2 files, +140/-5).
  • Used a per-worktree CARGO_TARGET_DIR with CARGO_BUILD_JOBS=2. An initial link failure (LNK1318, PDB FILE_SYSTEM) was a local disk-full condition, not a PR defect; after reclaiming build artifacts it linked and passed.
  • Only the named synthetic CPU test was replayed; full workspace suite and clippy were not run locally (no clippy component on this toolchain).
  • GPU/driver: N/A (CPU-only shader-lowering test). No game data, assets, extracted shaders, DRM or decrypt involved.

AI-assisted (Hy4 flash).

**@⁠cloph-dsp** on GitHub · 2026-11-28 00:57 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/353#issuecomment-7231318623) Independent local verification (Windows, Rust 1.100.0/MSVC, no game data): - PR #353 at head `6e6f87993f661dd592e21bbbde5e6e4589a2af17`, merge base `0f0ada19095979e2192d1b5a98bb5297cf4d53ea`. - `cargo test --locked -p victory-shader --lib emit::tests::div_fixup_corner_program_lowers_without_gpu -- --exact --test-threads=1 --quiet` → 1 passed, 0 failed, 293 filtered, exit 0. - `git grep -F` for the test name on the merge base returned no hits (test is new on this PR); `git diff --check 0f0ada19 HEAD` clean (2 files, +140/-5). - Used a per-worktree `CARGO_TARGET_DIR` with `CARGO_BUILD_JOBS=2`. An initial link failure (LNK1318, PDB FILE_SYSTEM) was a local disk-full condition, not a PR defect; after reclaiming build artifacts it linked and passed. - Only the named synthetic CPU test was replayed; full workspace suite and clippy were not run locally (no clippy component on this toolchain). - GPU/driver: N/A (CPU-only shader-lowering test). No game data, assets, extracted shaders, DRM or decrypt involved. AI-assisted (Hy4 flash).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/353/head:github-bot/gh-353'
git switch 'github-bot/gh-353'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-353'
git switch 'github-bot/gh-353'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-353'
git switch 'github-bot/gh-353'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-353'
git switch 'main'
git merge --squash 'github-bot/gh-353'
git switch 'main'
git merge --ff-only 'github-bot/gh-353'
git switch 'main'
git merge 'github-bot/gh-353'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.