Shaders: add SQ_IMG_SAMP LOD-bias and no-mip range tests for emit/sampler.rs #1195

Manually merged
github merged 1 commit from gh-pr/1195/head into gh-pr/1195/base 2026-11-26 04:23:13 +00:00
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-24 16:23 UTC · original
geiyiliyabumo:test/shader-sampler → main · +32 −0 · 1 files · 1 commits · merged 2026-11-25 21:50 UTC

Summary

Closes #1018

Full verification details and change notes are documented in #1018 (commit ed1d9c7, based on main ffe310e).

 crates/victory-shader/src/emit/sampler.rs | 85 +++++++++++++++++++++++++++++++
 1 file changed, 85 insertions(+)

Verification (Windows 11 x64 MSVC)

  • rustfmt --edition 2024 --check on edited files: PASS
  • cargo xtask policy: PASS (zero game files/data)
  • cargo clippy --all-targets --locked -- -D warnings (default + --features diagnostics where applicable): PASS
  • Targeted & crate unit/GPU tests: PASS

AI-assisted; synthetic tests only, no game files.

**@⁠geiyiliyabumo** on GitHub · 2026-11-24 16:23 UTC · [original](https://github.com/Marvisak/VIctory/pull/1195) `geiyiliyabumo:test/shader-sampler` → `main` · +32 −0 · 1 files · 1 commits · merged 2026-11-25 21:50 UTC ### Summary Closes #1018 Full verification details and change notes are documented in #1018 (commit `ed1d9c7`, based on `main` `ffe310e`). ```text crates/victory-shader/src/emit/sampler.rs | 85 +++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) ``` ### Verification (Windows 11 x64 MSVC) - `rustfmt --edition 2024 --check` on edited files: **PASS** - `cargo xtask policy`: **PASS** (zero game files/data) - `cargo clippy --all-targets --locked -- -D warnings` (default + `--features diagnostics` where applicable): **PASS** - Targeted & crate unit/GPU tests: **PASS** *AI-assisted; synthetic tests only, no game files.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:23:11 +00:00
github manually merged commit a711eb3d31 into gh-pr/1195/base 2026-11-26 04:23:13 +00:00
Author
Owner

@⁠Aniseto on GitHub · 2026-11-24 16:59 UTC · original

Ran the emit::sampler tests at ed1d9c7:

Environment: Windows 11 Pro build 26200 x64, Intel Core i5-12400F, 64 GB RAM, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only) driver 32.0.16.2124, Rust 1.98.1 (pinned by rust-toolchain.toml), MSVC 14.44.35207, DXC 1.9.2609.5, debug build.

cargo test -p victory-shader sampler
6 passed; 0 failed; 0 ignored      (exit 0)

All six pass here: the eight address-mode encodings, anisotropy clamping plus comparison sampling, filters, reductions and border colours, the console-compiled sampler case, the signed 14-bit fixed-point LOD bias extremes, and the no-mip LOD range rule. This is a test-only PR, so the adapter is not the variable; the datapoint is the pinned 1.98.1 toolchain. No test report on it yet.

Not tested: a title using these samplers (no game data here), RDNA2/RDNA4 and Intel GPUs.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash 1017 - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; no game data was used.

**@⁠Aniseto** on GitHub · 2026-11-24 16:59 UTC · [original](https://github.com/Marvisak/VIctory/pull/1195#issuecomment-7138525528) Ran the `emit::sampler` tests at `ed1d9c7`: Environment: Windows 11 Pro build 26200 x64, Intel Core i5-12400F, 64 GB RAM, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only) driver 32.0.16.2124, Rust 1.98.1 (pinned by `rust-toolchain.toml`), MSVC 14.44.35207, DXC 1.9.2609.5, debug build. ``` cargo test -p victory-shader sampler 6 passed; 0 failed; 0 ignored (exit 0) ``` All six pass here: the eight address-mode encodings, anisotropy clamping plus comparison sampling, filters, reductions and border colours, the console-compiled sampler case, the signed 14-bit fixed-point LOD bias extremes, and the no-mip LOD range rule. This is a test-only PR, so the adapter is not the variable; the datapoint is the pinned 1.98.1 toolchain. No test report on it yet. Not tested: a title using these samplers (no game data here), RDNA2/RDNA4 and Intel GPUs. AI-assisted (OpenCode), model: **DeepSeek V4.1 Flash 1017** - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; no game data was used.
Author
Owner

@⁠Zipettte on GitHub · 2026-11-24 18:00 UTC · original

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at ed1d9c7: cargo test -p victory-shader passes, 125 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

**@⁠Zipettte** on GitHub · 2026-11-24 18:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/1195#issuecomment-7140018942) Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at ed1d9c7: `cargo test -p victory-shader` passes, 125 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:18 UTC · original · edited 2026-11-25 07:21 UTC

Automated triage for the maintainers.

Merge candidate (small). Update after your changes: the table-copy tests have been dropped. Two tests are left in crates/victory-shader/src/emit/sampler.rs. mip_lod_bias_decodes_signed_14bit_fixed_point_extremes checks the sign extension of the 14-bit, 8-fraction-bit LOD_BIAS field at its boundaries (0x1FFF, 0x2000, 0x3FFF). That is independent of the decoder's tables, and the existing tests do not cover it. no_mip_filter_forces_zero_lod_range_and_non_zero_preserves_it partly overlaps host_filter_falls_back_without_changing_reduction_or_lod, which already checks the zero LOD range for mip filter 0, but it adds the linear-mip case. It is test-only and merges cleanly.

CI: passing (check).


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/1195#issuecomment-7149411366) · edited 2026-11-25 07:21 UTC <!-- victory-triage v1 head=a711eb3d31d7c5d4ff0306f62ffe6d8fd71c6b13 verdict=merge-candidate at=2026-11-25T07:21:48Z --> Automated triage for the maintainers. **Merge candidate (small).** Update after your changes: the table-copy tests have been dropped. Two tests are left in `crates/victory-shader/src/emit/sampler.rs`. `mip_lod_bias_decodes_signed_14bit_fixed_point_extremes` checks the sign extension of the 14-bit, 8-fraction-bit `LOD_BIAS` field at its boundaries (`0x1FFF`, `0x2000`, `0x3FFF`). That is independent of the decoder's tables, and the existing tests do not cover it. `no_mip_filter_forces_zero_lod_range_and_non_zero_preserves_it` partly overlaps `host_filter_falls_back_without_changing_reduction_or_lod`, which already checks the zero LOD range for mip filter 0, but it adds the linear-mip case. It is test-only and merges cleanly. CI: passing (`check`). --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-25 02:16 UTC · original

Rebased cleanly onto \main\ (\ccfb029), updated anisotropic filter expectations for mip-point (\

**@⁠geiyiliyabumo** on GitHub · 2026-11-25 02:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/1195#issuecomment-7150519612) Rebased cleanly onto \main\ (\ccfb029\), updated anisotropic filter expectations for mip-point (\
Author
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-25 03:53 UTC · original

Updated per triage feedback: dropped the three table-copy tests and kept only the two independent \SQ_IMG_SAMP\ layout tests (\mip_lod_bias_decodes_signed_14bit_fixed_point_extremes\ and
o_mip_filter_forces_zero_lod_range_and_non_zero_preserves_it). Rebased onto \main\ (\940d32f); \cargo test -p victory-shader --locked emit::sampler::tests\ (6 passed, 0 failed), \cargo clippy -p victory-shader --all-targets --locked -- -D warnings, and \cargo xtask policy\ all pass.

**@⁠geiyiliyabumo** on GitHub · 2026-11-25 03:53 UTC · [original](https://github.com/Marvisak/VIctory/pull/1195#issuecomment-7152329558) Updated per triage feedback: dropped the three table-copy tests and kept only the two independent \SQ_IMG_SAMP\ layout tests (\mip_lod_bias_decodes_signed_14bit_fixed_point_extremes\ and \ o_mip_filter_forces_zero_lod_range_and_non_zero_preserves_it\). Rebased onto \main\ (\940d32f\); \cargo test -p victory-shader --locked emit::sampler::tests\ (6 passed, 0 failed), \cargo clippy -p victory-shader --all-targets --locked -- -D warnings\, and \cargo xtask policy\ all pass.
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1195
No description provided.