Shader/GPU: recover wave64 split scalar masks and report GetDeviceRemovedReason #146

Closed
dutch2005 wants to merge 1 commit from upstream-pr/146 into main
dutch2005 commented 2026-11-25 16:59:51 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by dutch2005 on 2026-11-25T16:59:51Z.


Ports two clean fixes from DexNom/VIctory:

  1. crates/victory-shader/src/structure.rs (DexNom 76749ce): recover wave64 lane predicates when scalar masks are spilled and restored one 32-bit word at a time via s_mov_b32 chains (move_source), without crossing non-move ops or mismatched words.
  2. crates/victory-gpu/src/device.rs (DexNom 13185f5): wire ID3D12Device vtable slot 37 (0x128, GetDeviceRemovedReason) to removed_reason so healthy devices report S_OK (and removed host devices propagate their removal HRESULT) instead of returning E_NOTIMPL.

Verification

  • cargo test -p victory-shader --lib --locked -- --skip scalar_counted_in_: 265 passed, 0 failed, 6 ignored
  • cargo test -p victory-gpu --lib --locked -- --test-threads=1 --skip written_pages_are_reported_to_every_asker: 111 passed, 0 failed, 4 ignored (written_pages_are_reported_to_every_asker skipped as pre-existing #102; a_healthy_device_reports_no_removal verifies healthy 0x128 + isolated WARP RemoveDevice() removal error)
  • cargo clippy -p victory-shader -p victory-gpu --lib --tests --locked --no-deps: 0 warnings in structure.rs and device.rs
  • cargo xtask policy --staged: 2 files ok
  • cargo mutants --in-diff pra.diff: structure.rs 6/6 (2 caught, 4 unviable, 0 missed); device.rs 1/1 caught (0 missed)
<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:issue:6609500287 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/146). Originally posted by [dutch2005](https://github.com/dutch2005) on 2026-11-25T16:59:51Z. --- Ports two clean fixes from `DexNom/VIctory`: 1. **`crates/victory-shader/src/structure.rs` (`DexNom 76749ce`)**: recover wave64 lane predicates when scalar masks are spilled and restored one 32-bit word at a time via `s_mov_b32` chains (`move_source`), without crossing non-move ops or mismatched words. 2. **`crates/victory-gpu/src/device.rs` (`DexNom 13185f5`)**: wire `ID3D12Device` vtable slot 37 (`0x128`, `GetDeviceRemovedReason`) to `removed_reason` so healthy devices report `S_OK` (and removed host devices propagate their removal `HRESULT`) instead of returning `E_NOTIMPL`. ### Verification - `cargo test -p victory-shader --lib --locked -- --skip scalar_counted_in_`: **265 passed, 0 failed, 6 ignored** - `cargo test -p victory-gpu --lib --locked -- --test-threads=1 --skip written_pages_are_reported_to_every_asker`: **111 passed, 0 failed, 4 ignored** (`written_pages_are_reported_to_every_asker` skipped as pre-existing #102; `a_healthy_device_reports_no_removal` verifies healthy `0x128` + isolated WARP `RemoveDevice()` removal error) - `cargo clippy -p victory-shader -p victory-gpu --lib --tests --locked --no-deps`: 0 warnings in `structure.rs` and `device.rs` - `cargo xtask policy --staged`: **2 files ok** - `cargo mutants --in-diff pra.diff`: `structure.rs` **6/6** (2 caught, 4 unviable, 0 missed); `device.rs` **1/1** caught (**0 missed**)

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
Belobug/VIctory-Belobug-AMD!146
No description provided.