Shader tests: reject device loss before dispatch readback #1251
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!1251
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1251"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@JiyouProt on GitHub · 2026-11-26 02:27 UTC · original
JiyouProt:codex/shader-readback-device-loss→main· +84 −6 · 1 files · 1 commits · openemit::host::Host::dispatchcan reach readback after device removal: its removal check is insidewhile fence.GetCompletedValue() < 1, but D3D12 returnsUINT64_MAXfor a removed device. The loop therefore exits without checking that the device is still usable. Microsoft's fence contractCheck device status after the wait, before any output mapping, as the draw path already does. A small test-only helper keeps the dispatch and regression on the same path. Polling, resource lifetimes, shader lowering and runtime defaults are unchanged.
The regression first completes a normal queue-signalled fence, then removes an isolated child-process WARP device and checks a never-signalled fence. The original wait returned
Ok(())with its value atUINT64_MAX; the fixed wait returns the removal error. No physical adapter is removed. Older runtimes withoutID3D12Device5explicitly skip this native removal case.Scope and related work
Validation
removed is not completed: (). After: normal completion accepted and actual WARP removal rejected.cargo test --locked -p victory-shader --lib --no-fail-fast -j 4 -- --test-threads=4 --nocapture, Debug and Release (--release): 218 passed, 0 failed, 3 ignored each. Mainc74e173Debug: 217 passed, 0 failed, 3 ignored.c09c05e: shader library builds in Debug and Release; 20 further native regression runs pass, 10 in each configuration, with actual removal observed in every run.cargo clippy --locked -p victory-shader --all-targets -- -D warnings, default and--all-features: passed. Changed-file asset policy andgit diff --checkpassed. Three existing formatting differences elsewhere in this file were left alone.Limits
Shader-crate validation only; no full workspace, MSVC, AMD, physical-device-removal, D3D12 debug-layer or retail-title run. No FPS or gameplay fix claimed. Device removal can still occur after the final check; existing map errors continue to propagate.
AI-assisted: OpenAI Codex (GPT-6; exact model variant unavailable), investigation, implementation, native regression and validation. Publication authorized by the user.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.