Name unsupported hardware SGPR inputs in shader diagnostics #2438

Closed
DoubleD17 wants to merge 1 commit from upstream-pr/2440 into main
DoubleD17 commented 2026-11-25 13:33:40 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DoubleD17 on 2026-11-25T13:33:40Z.


When the original translator rejects a hardware SGPR input, the diagnostic omits the register. Report the register when attribution is clear, keep the consumer offset and failure category, and keep the generic message at ambiguous joins. The adaptation preserves the original's pixel SGPR initialization and primitive-ordered pixel shading rules. Synthetic CPU tests on Windows x64 with Rust 1.98.1 MSVC passed 3 of 3 on 46dd398, covering s5 and s7 at the same consumer, both input orders at a dynamic join, and identical DXIL for the dead-read control. The existing POPS control passed, preserving rasterizer-ordered output and identifying s10 in the refusal outside ordered mode. The diagnostics CLI compiled and its grouping was checked by code review. The tests cover host diagnostics and synthetic translation. Adapted from fxceless/victory-fork #941.

AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6605667656 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2440). Originally posted by [DoubleD17](https://github.com/DoubleD17) on 2026-11-25T13:33:40Z. --- When the original translator rejects a hardware SGPR input, the diagnostic omits the register. Report the register when attribution is clear, keep the consumer offset and failure category, and keep the generic message at ambiguous joins. The adaptation preserves the original's pixel SGPR initialization and primitive-ordered pixel shading rules. Synthetic CPU tests on Windows x64 with Rust 1.98.1 MSVC passed 3 of 3 on 46dd398, covering s5 and s7 at the same consumer, both input orders at a dynamic join, and identical DXIL for the dead-read control. The existing POPS control passed, preserving rasterizer-ordered output and identifying s10 in the refusal outside ordered mode. The diagnostics CLI compiled and its grouping was checked by code review. The tests cover host diagnostics and synthetic translation. Adapted from [fxceless/victory-fork #941](https://github.com/fxceless/victory-fork/pull/941). AI-assisted.
DenRakEiw commented 2026-11-25 14:07:00 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T14:01:06Z.

Review: APPROVED


Verified against origin/main (940d32f) on Windows 11 + NVIDIA GeForce RTX 5090:

  • Naming unsupported hardware SGPR inputs in shader diagnostics while keeping dynamic joins generic and ignoring unconsumed inputs is clean and well-tested.
  • cargo test -p victory-shader emit::tests: 19/19 passed (including hardware_sgpr_input_refusal_names_the_register_at_the_export, hardware_sgpr_input_refusal_at_a_dynamic_join_stays_generic, and hardware_sgpr_input_read_without_a_consumer_still_translates).
  • cargo test -p victory translate::tests: 1/1 passed.
  • cargo clippy -p victory-shader -p victory --all-targets -- -D warnings: 0 warnings.
  • cargo xtask policy: 183 files ok.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6059001545 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2440#pullrequestreview-6059001545). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-25T14:01:06Z. **Review:** APPROVED --- Verified against `origin/main` (`940d32f`) on Windows 11 + NVIDIA GeForce RTX 5090: - Naming unsupported hardware SGPR inputs in shader diagnostics while keeping dynamic joins generic and ignoring unconsumed inputs is clean and well-tested. - `cargo test -p victory-shader emit::tests`: 19/19 passed (including `hardware_sgpr_input_refusal_names_the_register_at_the_export`, `hardware_sgpr_input_refusal_at_a_dynamic_join_stays_generic`, and `hardware_sgpr_input_read_without_a_consumer_still_translates`). - `cargo test -p victory translate::tests`: 1/1 passed. - `cargo clippy -p victory-shader -p victory --all-targets -- -D warnings`: 0 warnings. - `cargo xtask policy`: 183 files ok. AI-assisted (Gemini 4 Neon).
oni-swr commented 2026-11-25 14:07:30 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-25T13:50:08Z.


Verification — head 46dd398ff87600aa66a1b103a6ce4ba611bd872f

Environment: Windows 11 Pro 10.0.26200, rustc/cargo 1.98.1, DXC/dxil 1.8.2502.11 (Windows Kits 10.0.26100.0 x64). origin/main = 940d32f69b22265690a0b5a15d6ded572ba33baf; the PR is one commit set on top of it (merge-base = main), so the exact head was tested with no merge needed.

  • cargo test -p victory-shader --lib: 250 passed, 0 failed, 3 ignored. New tests hardware_sgpr_input_refusal_names_the_register_at_the_export (s5/s7 named), ..._at_a_dynamic_join_stays_generic and ..._read_without_a_consumer_still_translates all ran and passed.
  • cargo clippy -p victory-shader -p victory --all-targets -- -D warnings: clean. cargo xtask policy: ok.
  • Caveat: the victory-shader GPU tests (emit::valu_tests etc.) iterate over a hardware adapter and WARP and ignore VICTORY_D3D12_WARP, so this run was not WARP-only; they passed on both.
  • Note: touches emit/lower.rs like #2438 but in different hunks.

Read the full diff first: no process, network or filesystem code beyond what the PR describes; no game data, dumps, shader names or retail hashes involved.

Verified by Claude Code (Claude Sonnet 5.5), an AI assistant; this is a test report, not a code review or approval.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7164359089 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2440#issuecomment-7164359089). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-25T13:50:08Z. --- **Verification — head `46dd398ff87600aa66a1b103a6ce4ba611bd872f`** **Environment:** Windows 11 Pro 10.0.26200, rustc/cargo 1.98.1, DXC/dxil 1.8.2502.11 (Windows Kits 10.0.26100.0 x64). `origin/main` = `940d32f69b22265690a0b5a15d6ded572ba33baf`; the PR is one commit set on top of it (merge-base = main), so the exact head was tested with no merge needed. - `cargo test -p victory-shader --lib`: **250 passed, 0 failed, 3 ignored**. New tests `hardware_sgpr_input_refusal_names_the_register_at_the_export` (s5/s7 named), `..._at_a_dynamic_join_stays_generic` and `..._read_without_a_consumer_still_translates` all ran and passed. - `cargo clippy -p victory-shader -p victory --all-targets -- -D warnings`: clean. `cargo xtask policy`: ok. - **Caveat:** the victory-shader GPU tests (`emit::valu_tests` etc.) iterate over a hardware adapter *and* WARP and ignore `VICTORY_D3D12_WARP`, so this run was not WARP-only; they passed on both. - Note: touches `emit/lower.rs` like #2438 but in different hunks. Read the full diff first: no process, network or filesystem code beyond what the PR describes; no game data, dumps, shader names or retail hashes involved. _Verified by Claude Code (Claude Sonnet 5.5), an AI assistant; this is a test report, not a code review or approval._
catminou4 commented 2026-11-25 15:03:40 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T14:11:17Z.

Review: COMMENTED


Names unsupported hardware SGPR inputs in shader diagnostics (apps+shader). The shader-side enum addition looks consistent; the translate.rs error arm matches the existing pattern. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1. (victory-shader tests not run here — the crate compiles Windows-only paths in this PR's touch area.)

<!-- greyfinch-sync:Marvisak/VIctory:review:6059177360 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2440#pullrequestreview-6059177360). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T14:11:17Z. **Review:** COMMENTED --- Names unsupported hardware SGPR inputs in shader diagnostics (apps+shader). The shader-side enum addition looks consistent; the translate.rs error arm matches the existing pattern. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1. (victory-shader tests not run here — the crate compiles Windows-only paths in this PR's touch area.)
Marvisak commented 2026-11-25 16:09:40 +00:00 (Migrated from github.com)

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


Automated triage for the maintainers.

Merge candidate. This changes diagnostics only. When the lowering in crates/victory-shader/src/emit/lower.rs refuses a program for reading an SGPR the host has no value for, the error now names the register (new ShaderError::UnsupportedHardwareSgprInput). At a join of two such inputs it stays the generic "a hardware SGPR input". victory translate keeps grouping these under the same reason, with the register added to the example. I checked that only the emit stage can produce the new variant, so the other ShaderError::Unsupported arms in apps/victory/src/translate.rs are unaffected, and that the POPS collision-id test in synthetic_tests.rs still covers the ordered/unordered split. CI (check) passes.

Style note for the maintainer: the register travels as a string ("hardware SGPR input s<n>") through Val::Missing and is parsed back in unsupported with an expect. That works, but a typed reason would be cleaner if the maintainer prefers it. This is a recommendation to look, not an approval.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7167521669 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2440#issuecomment-7167521669). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T16:01:18Z. --- <!-- victory-triage v1 head=46dd398ff87600aa66a1b103a6ce4ba611bd872f verdict=merge-candidate at=2026-11-25T16:00:58Z --> Automated triage for the maintainers. **Merge candidate.** This changes diagnostics only. When the lowering in `crates/victory-shader/src/emit/lower.rs` refuses a program for reading an SGPR the host has no value for, the error now names the register (new `ShaderError::UnsupportedHardwareSgprInput`). At a join of two such inputs it stays the generic "a hardware SGPR input". `victory translate` keeps grouping these under the same reason, with the register added to the example. I checked that only the `emit` stage can produce the new variant, so the other `ShaderError::Unsupported` arms in `apps/victory/src/translate.rs` are unaffected, and that the POPS collision-id test in `synthetic_tests.rs` still covers the ordered/unordered split. CI (`check`) passes. Style note for the maintainer: the register travels as a string (`"hardware SGPR input s<n>"`) through `Val::Missing` and is parsed back in `unsupported` with an `expect`. That works, but a typed reason would be cleaner if the maintainer prefers it. This is a recommendation to look, not an approval. --- _Generated by [Claude Code](https://claude.ai/code)_
upstream-sync closed this pull request 2026-11-25 23:04:33 +00:00
Marvisak commented 2026-11-25 23:05:59 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T22:09:49Z.


Automated triage for the maintainers, second look (a review against current main, with builds and tests where they could change the verdict).

Closing because no title program reaches this refusal on main (hardware SGPR inputs already read as defined values there), so the message it improves is never shown. It also adds a public error variant and a string round trip that panics on a malformed reason.

If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7176015912 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2440#issuecomment-7176015912). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T22:09:49Z. --- Automated triage for the maintainers, second look (a review against current `main`, with builds and tests where they could change the verdict). Closing because no title program reaches this refusal on `main` (hardware SGPR inputs already read as defined values there), so the message it improves is never shown. It also adds a public error variant and a string round trip that panics on a malformed reason. If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

Pull request closed

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!2438
No description provided.