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

Merged
geiyiliyabumo merged 1 commit from upstream-pr/1195 into main 2026-11-25 21:50:07 +00:00
geiyiliyabumo commented 2026-11-24 16:23:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T16:23:48Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6586428676 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1195). Originally posted by [geiyiliyabumo](https://github.com/geiyiliyabumo) on 2026-11-24T16:23:48Z. --- ### 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.*
DenRakEiw commented 2026-11-24 17:03:46 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-24T16:27:25Z.

Review: APPROVED


Tested head ed1d9c7 (fast-forward on main ffe310e) on Windows 11 x64 (Rust 1.98.1 MSVC):

  • cargo test -p victory-shader sampler: 6 passed, 0 failed
  • cargo clippy -p victory-shader --all-targets: 0 warnings
  • cargo xtask policy: ok

Clean synthetic unit test coverage for emit/sampler.rs decoding paths. Approving.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6043237942 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1195#pullrequestreview-6043237942). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-24T16:27:25Z. **Review:** APPROVED --- Tested head `ed1d9c7` (fast-forward on `main` `ffe310e`) on Windows 11 x64 (Rust 1.98.1 MSVC): - `cargo test -p victory-shader sampler`: **6 passed, 0 failed** - `cargo clippy -p victory-shader --all-targets`: **0 warnings** - `cargo xtask policy`: ok Clean synthetic unit test coverage for `emit/sampler.rs` decoding paths. Approving. AI-assisted (Gemini 4 Neon).
Aniseto commented 2026-11-24 17:04:47 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Aniseto on 2026-11-24T16:59:46Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7138525528 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1195#issuecomment-7138525528). Originally posted by [Aniseto](https://github.com/Aniseto) on 2026-11-24T16:59:46Z. --- 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.
Zipettte commented 2026-11-24 18:06:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T18:00:22Z.


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).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7140018942 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1195#issuecomment-7140018942). Originally posted by [Zipettte](https://github.com/Zipettte) on 2026-11-24T18:00:22Z. --- 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)._
Marvisak commented 2026-11-25 02:05:51 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:18:19Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7149411366 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1195#issuecomment-7149411366). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T01:18:19Z. --- <!-- 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)_
geiyiliyabumo commented 2026-11-25 03:03:21 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-25T02:16:26Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7150519612 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1195#issuecomment-7150519612). Originally posted by [geiyiliyabumo](https://github.com/geiyiliyabumo) on 2026-11-25T02:16:26Z. --- Rebased cleanly onto \main\ (\ccfb029\), updated anisotropic filter expectations for mip-point (\
upstream-sync changed title from [PR #1195] Shaders: expand synthetic unit tests for emit/sampler.rs to [PR #1195] Shaders: add SQ_IMG_SAMP LOD-bias and no-mip range tests for emit/sampler.rs 2026-11-25 04:05:01 +00:00
catminou4 commented 2026-11-25 04:05:02 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T03:56:30Z.

Review: APPROVED


Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main 940d32f69b, cargo test -p victory-shader --locked.

149 passed / 0 failed / 2 ignored. Synthetic unit tests expanded for emit/sampler.rs (+5 tests) — sampler-emit coverage; good.

<!-- greyfinch-sync:Marvisak/VIctory:review:6051643359 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1195#pullrequestreview-6051643359). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T03:56:30Z. **Review:** APPROVED --- Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main 940d32f69b, `cargo test -p victory-shader --locked`. 149 passed / 0 failed / 2 ignored. Synthetic unit tests expanded for emit/sampler.rs (+5 tests) — sampler-emit coverage; good.
geiyiliyabumo commented 2026-11-25 04:07:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-25T03:53:06Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7152329558 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1195#issuecomment-7152329558). Originally posted by [geiyiliyabumo](https://github.com/geiyiliyabumo) on 2026-11-25T03:53:06Z. --- 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.
upstream-sync closed this pull request 2026-11-25 22:02:50 +00:00
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!1195
No description provided.