Repository navigation
Conversation
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified against origin/main (940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP:
- Checking for device removal before FMad readback cleanly avoids reading garbage after a removed device.
cargo test -p victory-shader hosts_that_do_not_fuse_are_named: 1/1 passed on RTX 5090, 1/1 passed on WARP.cargo clippy -p victory-shader --all-targets -- -D warnings: 0 warnings.cargo xtask policy: 183 files ok.
AI-assisted (Gemini 4 Neon).
catminou4
left a comment
There was a problem hiding this comment.
Tested locally: merged into main 940d32f, cargo test -p victory-shader --locked on macOS arm64 — 144 passed, 0 failed, 2 ignored (Windows-gated hardware execution tests not run here). Approving — device removal checked before FMad readback.
|
Correct: |
|
Automated triage for the maintainers. Merge candidate, low priority. In Generated by Claude Code |
|
Code review and RTX 5090 + WARP + DXIL verification at head
LGTM. |
Problem
fuses_fmad()checks for device removal inside its fence polling loop. D3D12 documents thatGetCompletedValue()returnsUINT64_MAXafter removal. That value satisfies the loop's completion condition, so execution can reach readback without establishing that the GPU copy completed. Fence contract · Readback mapping contractFix
Check
GetDeviceRemovedReason()immediately after the fence wait and before readback. The change preserves existing error conversion, polling behavior, resource lifetimes, FMad classification, and adapter initialization policy. A small private helper lets CPU-only tests exercise the same wait-to-readback decision used by the production probe. Device removal status contractRegression and validation
The test-only baseline had three passing tests and one expected failure in
immediate_removal_skips_readback. Readback was invoked once when zero calls were expected.The patched Windows-MSVC run validated
de9a0315887daf72fb4edf7a7d6dc6673ec32cf6.dxbctests — 2 passed, 0 failed.git diff --check— passed.The single fork-only run passed on its first attempt and took 3 minutes 36 seconds on the runner. Windows-MSVC validation
The regression uses simulated fence and device-status responses. Native D3D12 device removal, GPU execution, and full workspace runtime coverage were outside its scope. The guard handles removal observed at the end of the wait. Device removal can still occur after the status check.
References and coordination
AI-assisted development disclosure — OpenAI Codex assisted with investigation, implementation, regression testing, CI validation, and preparation of this PR.