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

Manually merged
github merged 1 commit from github-bot/gh-85 into main 2026-11-26 15:00:16 +00:00 AGit
Owner

@⁠Olima34 on GitHub · 2026-11-26 13:52 UTC · original
Olima34:fix/fspx-root-type-refusals → main · +38 −6 · 3 files · 2 commits · merged 2026-11-26 14:58 UTC

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)
**@⁠Olima34** on GitHub · 2026-11-26 13:52 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/85) `Olima34:fix/fspx-root-type-refusals` → `main` · +38 −6 · 3 files · 2 commits · merged 2026-11-26 14:58 UTC ## 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)
Root constants in a compute shader, SM 6.6 descriptor heap records (root types 5 and 6) and genuinely unknown root types all ended in "an FSPX resource of an unknown root type". Each now has its own message with the root type number, so a tester log counts the refusals by cause and tells which fix is needed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 14:45:30 +00:00
github manually merged commit 531862c47b into main 2026-11-26 15:00:16 +00:00
Author
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-26 14:54 UTC · original · approved these changes

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

**@⁠LakshanSivakumar** on GitHub · 2026-11-26 14:54 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/85#pullrequestreview-6076249925) · **approved these changes** Nice diagnostic, thanks. Good that the record index stays out of the message so the tallies group.
This discussion has been locked. Commenting is limited to contributors.
No description provided.