shader: pin the GFX10 operand-field decode rules with unit tests #305

Merged
AnastasisKon merged 1 commit from upstream-pr/305 into main 2026-11-27 11:54:01 +00:00
AnastasisKon commented 2026-11-27 10:49:16 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-27T10:49:16Z.


fields.rs had no tests of its own; its rules were only exercised indirectly through whole-program lowering tests. Add gfx10/fields_tests.rs (declared under cfg(test), so the build hash is unchanged) pinning Instruction::fields on hand-assembled words: source codes and the literal, per-opcode dword counts, wave64 lane-mask sizing, the madmk/madak literal positions, the SDWA and DPP16/DPP8 forms, VOP3 source counts and the VOP3B carry-out, and the SMEM/MUBUF/MIMG/DS/VINTRP/EXP field layouts.

What this changes

How it was tested

  • cargo test --target x86_64-apple-darwin -p victory-hle -p victory-loader -p victory
  • cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings
  • Ran the game (say how far it got), or not needed

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
<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:5525349397 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/305). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-27T10:49:16Z. --- fields.rs had no tests of its own; its rules were only exercised indirectly through whole-program lowering tests. Add gfx10/fields_tests.rs (declared under cfg(test), so the build hash is unchanged) pinning Instruction::fields on hand-assembled words: source codes and the literal, per-opcode dword counts, wave64 lane-mask sizing, the madmk/madak literal positions, the SDWA and DPP16/DPP8 forms, VOP3 source counts and the VOP3B carry-out, and the SMEM/MUBUF/MIMG/DS/VINTRP/EXP field layouts. ## What this changes <!-- One change per pull request. Name the issue you claimed for it: Refs #123 (or Closes #123). --> ## How it was tested - [ ] `cargo test --target x86_64-apple-darwin -p victory-hle -p victory-loader -p victory` - [ ] `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings` - [ ] Ran the game (say how far it got), or not needed ## 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
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!305
No description provided.