Shaders: bound the test host fence waits so a wedged device fails instead of hanging #3143
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!3143
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3143"
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?
@Mdemets on GitHub · 2026-11-26 10:10 UTC · original
Mdemets:contrib/fence-waits→main· +33 −21 · 1 files · 1 commits · openThree command-recording paths in the test host spin on
GetCompletedValue()withyield_now()and no deadline. A device that neither signals the fence nor reports itself removed wedges the test binary forever — the same shape as the world hang in #71 (a submission that never finishes and ends in a TDR), just observed from the suite instead of a title run.What changes
wait_for_fencehelper, poll every 2 ms, returns the device-removed reason exactly as the old loops did;VICTORY_WAIT_SECSraises the deadline for a deliberately long run;Verification
cargo check -p victory-shader --libclean on63bcca4.From the test fleet's branch (
c5eb934), where it stopped a wedged A5000 from hanging the suite for the rest of the night.@Dukestar69 on GitHub · 2026-11-26 10:29 UTC · original · approved these changes
Verified on RTX 5090 against
origin/main(63bcca4):cargo test -p victory-shader --lib emit::host:: -- --test-threads=1: passed (parallel_warp_pipelines_and_draws).cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Cleanly bounds test-host fence waits so a wedged device fails fast with an error instead of hanging CI/test runs.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@steven-seagull27 on GitHub · 2026-11-26 10:32 UTC · original · edited 2026-11-26 10:55 UTC
@Mdemets I tested the new wait helper on native Windows with an RTX 5080 (621.40) and built-in WARP. With a one-second deadline, both adapters accepted an immediate queue signal and a delayed fence signal. A healthy unsignaled fence returned the named timeout after 1,000–1,002 ms. Each case ran twice per adapter in a fresh process.
I found one case where the helper returns success before readback should proceed. In a separate process with no GPU work queued I called
ID3D12Device5::RemoveDeviceon the test process’s device. On both adapters the fence returnedUINT64_MAXand the removal reason was0x887A0005(DXGI_ERROR_DEVICE_REMOVED), yetwait_for_fencereturnedOk(())on all four runs at8cd3a449. The current>= 1check accepts the removal value before reading the removal reason. D3D12 fence return valuesThe attached change checks the removal reason after reading the fence and rejects the sentinel. All four removal runs returned an error with the patch. Healthy signals and timeouts still behaved as expected. I also switched the deadline comparison to elapsed time. With the largest accepted
u64timeout, the original helper panicked adding the duration toInstanteven on an already completed fence. The same fence returned immediately with the patch. The included regression creates private fences on a healthy device. Fix and regression testI also tested this with the latest shared-queue revision,
076c0e7eon #3093. The two PRs conflict at all three readback waits. The optional merge keeps one signal on the shared queue and uses the bounded wait for the requested fence value. Both adapters passed immediate and delayed signals, a wait for value 2 starting at 1, timeout, device removal, and the maximum timeout override. The hardware shared-queue test and existing WARP draw test also passed twice each. Tested integration branchAI-assisted patch and tests using synthetic D3D12 work on Windows.
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.