shader: name the root type of refused FSPX metadata records #85

Merged
Olima34 merged 2 commits from upstream-pr/85 into main 2026-11-26 14:58:52 +00:00
Olima34 commented 2026-11-26 13:52:09 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-26T13:52:09Z.


What this changes

The largest class of shader refusals in the latest tester logs (#66, #68: 53 and 54 compute shaders) is one message, malformed shader: an FSPX resource of an unknown root type, which metadata_resources gave for three different cases. Each now has its own message, naming the root type, so the next log says which fix is needed:

  • root type 0: FSPX metadata resource of root type 0: root constants in a compute shader (compute only; graphics takes them)
  • root types 5 and 6: ... a descriptor heap (SM 6.6 dynamic resources) (ResourceHeap, SamplerHeap; compute and graphics)
  • 2, 7 and above: ... an unknown root type

The record index is left out on purpose: translate tallies failures by message, so one line per cause keeps the counts together. A new ShaderError::FspxRoot variant carries the type. rejects_corrupt_fspx_parts now checks the exact text for root types 0, 5, 6, 2 and 7.

Likely follow-up, not in this PR: the heap case (b) looks small, since graphics already lowers SGPR-held heap addresses (emit/graphics.rs, resource.rs heap_base); compute root constants (a) need the one-dword-per-record size checked for compute.

How it was tested

  • cargo test -p victory-shader; the test fails on main (the old message)
  • cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings, also with --all-features
  • arm64 cargo test --workspace and cargo xtask policy
  • Ran the game: not done, no copy of it here

Checklist

  • No game files, game code, disassembly listings or SDK files are included
  • Guesses about undocumented console behaviour are marked in the code and in docs/native-host.md
  • New diagnostics are behind a VICTORY_* variable and documented (none added)
<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:6628113851 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/85). Originally posted by [Olima34](https://github.com/Olima34) on 2026-11-26T13:52:09Z. --- ## What this changes The largest class of shader refusals in the latest tester logs (#66, #68: 53 and 54 compute shaders) is one message, `malformed shader: an FSPX resource of an unknown root type`, which `metadata_resources` gave for three different cases. Each now has its own message, naming the root type, so the next log says which fix is needed: - root type 0: `FSPX metadata resource of root type 0: root constants in a compute shader` (compute only; graphics takes them) - root types 5 and 6: `... a descriptor heap (SM 6.6 dynamic resources)` (`ResourceHeap`, `SamplerHeap`; compute and graphics) - 2, 7 and above: `... an unknown root type` The record index is left out on purpose: `translate` tallies failures by message, so one line per cause keeps the counts together. A new `ShaderError::FspxRoot` variant carries the type. `rejects_corrupt_fspx_parts` now checks the exact text for root types 0, 5, 6, 2 and 7. Likely follow-up, not in this PR: the heap case (b) looks small, since graphics already lowers SGPR-held heap addresses (`emit/graphics.rs`, `resource.rs` `heap_base`); compute root constants (a) need the one-dword-per-record size checked for compute. ## How it was tested - [x] `cargo test -p victory-shader`; the test fails on `main` (the old message) - [x] `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings`, also with `--all-features` - [x] arm64 `cargo test --workspace` and `cargo xtask policy` - [ ] Ran the game: not done, no copy of it here ## Checklist - [x] No game files, game code, disassembly listings or SDK files are included - [x] Guesses about undocumented console behaviour are marked in the code and in docs/native-host.md - [x] New diagnostics are behind a `VICTORY_*` variable and documented (none added)
LakshanSivakumar commented 2026-11-26 14:54:46 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T14:54:46Z.

Review: APPROVED


Nice diagnostic, thanks. Good that the record index stays out of the message so the tallies group.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:review:6076249925 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/85#pullrequestreview-6076249925). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-26T14:54:46Z. **Review:** APPROVED --- Nice diagnostic, thanks. Good that the record index stays out of the message so the tallies group.
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
LakshanSivakumar/Native-Victory-macOS!85
No description provided.