Shaders: VOP1 no-source ops stay one dword #473

Open
github-bot wants to merge 1 commit from github-bot/gh-473 into main AGit
Owner

@⁠davutsimsekk on GitHub · 2026-11-25 01:20 UTC · original
davutsimsekk:fix/vop1-no-operands → main · +23 −1 · 1 files · 1 commits · open

v_nop, v_pipeflush and v_clrexcp take no source, but the VOP1 decoder treated the 9-bit field as a source and added a literal/SDWA/DPP extension word whenever it matched 0xFF, 0xF9, 0xFA, 0xE9 or 0xEA. The field is a shader hash there (see fields.rs), so such a hash made the decoder consume the next instruction as an extension and misalign or fail.

These three opcodes are now always one dword; every other VOP1 is unchanged.

Test

vop1_without_operands_has_no_extension_word decodes v_nop and v_pipeflush with hash-like low bits and checks the next instruction is still s_endpgm at offset 4. On main decoding fails.

  • cargo test -p victory-shader --lib vop1_without_operands_has_no_extension_word: 1 passed
  • cargo clippy -p victory-shader --all-targets --locked -- -D warnings: clean
  • rustfmt --edition 2024 --check crates/victory-shader/src/gfx10/mod.rs: clean
  • No game data or GPU was used.
**@⁠davutsimsekk** on GitHub · 2026-11-25 01:20 UTC · [original](https://github.com/fxceless/victory-fork/pull/473) `davutsimsekk:fix/vop1-no-operands` → `main` · +23 −1 · 1 files · 1 commits · open `v_nop`, `v_pipeflush` and `v_clrexcp` take no source, but the VOP1 decoder treated the 9-bit field as a source and added a literal/SDWA/DPP extension word whenever it matched `0xFF`, `0xF9`, `0xFA`, `0xE9` or `0xEA`. The field is a shader hash there (see `fields.rs`), so such a hash made the decoder consume the next instruction as an extension and misalign or fail. These three opcodes are now always one dword; every other VOP1 is unchanged. ## Test `vop1_without_operands_has_no_extension_word` decodes `v_nop` and `v_pipeflush` with hash-like low bits and checks the next instruction is still `s_endpgm` at offset 4. On `main` decoding fails. - `cargo test -p victory-shader --lib vop1_without_operands_has_no_extension_word`: 1 passed - `cargo clippy -p victory-shader --all-targets --locked -- -D warnings`: clean - `rustfmt --edition 2024 --check crates/victory-shader/src/gfx10/mod.rs`: clean - No game data or GPU was used.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:44:09 +00:00
Author
Owner

@⁠avt0m4t48 on GitHub · 2026-11-25 01:41 UTC · original

I independently verified e98e7f29352c12156a756eb1b4a59fb035b55ca3 against its merge base a803c87c48078e57b296e06e08146d7ceca44530 using synthetic instruction words and separate Cargo target directories.

  • I swept all 512 low-field values for each of v_nop, v_pipeflush, and v_clrexcp, followed by s_endpgm. The base failed in exactly 15 cases (all three opcodes with each of the five extension markers). The PR head decoded all 1,536 cases as a one-dword VOP1 followed by s_endpgm at byte offset 4.
  • As controls, ordinary v_mov_b32 kept its extension and placed s_endpgm at byte offset 8 for all five markers on both commits. The register-source control placed it at offset 4 on both.
  • The head's Linux shader unit suite reported 172 passed and 2 ignored. The two independent fixture tests passed. cargo check --locked -p victory-shader --tests --target x86_64-pc-windows-msvc also passed. Runtime verification used Linux.
**@⁠avt0m4t48** on GitHub · 2026-11-25 01:41 UTC · [original](https://github.com/fxceless/victory-fork/pull/473#issuecomment-7149834306) I independently verified `e98e7f29352c12156a756eb1b4a59fb035b55ca3` against its merge base `a803c87c48078e57b296e06e08146d7ceca44530` using synthetic instruction words and separate Cargo target directories. - I swept all 512 low-field values for each of `v_nop`, `v_pipeflush`, and `v_clrexcp`, followed by `s_endpgm`. The base failed in exactly 15 cases (all three opcodes with each of the five extension markers). The PR head decoded all 1,536 cases as a one-dword VOP1 followed by `s_endpgm` at byte offset 4. - As controls, ordinary `v_mov_b32` kept its extension and placed `s_endpgm` at byte offset 8 for all five markers on both commits. The register-source control placed it at offset 4 on both. - The head's Linux shader unit suite reported 172 passed and 2 ignored. The two independent fixture tests passed. `cargo check --locked -p victory-shader --tests --target x86_64-pc-windows-msvc` also passed. Runtime verification used Linux.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/473/head:github-bot/gh-473'
git switch 'github-bot/gh-473'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-473'
git switch 'github-bot/gh-473'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-473'
git switch 'github-bot/gh-473'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-473'
git switch 'main'
git merge --squash 'github-bot/gh-473'
git switch 'main'
git merge --ff-only 'github-bot/gh-473'
git switch 'main'
git merge 'github-bot/gh-473'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.