fix(gpu): a background fence wait reports what went wrong instead of carrying on #242
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/trustno1-coder--VIctory-NVIDIA!242
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-242"
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?
@mutlusinan on GitHub · 2026-11-27 20:04 UTC · original
mutlusinan:fix/fence-wait-checks→main· +48 −16 · 1 files · 1 commits · openProblem
Two background threads wait on the host fence:
late_helper), which settles flights once the card has run them;relay_worker), which lands shader writes back into title memory.Both used
SetEventOnCompletion(target, event).is_ok()and ignored the result. If the call failed, the late helper went straight on to the landing step with nothing run — settling flights off a value the card never reached — and the relay slept 1 ms and retried in a loop.A removed device was worse than either:
GetCompletedValuereturnsu64::MAX, which compares greater than every target, so every wait returned immediately and everylandable()check treated all flights as done while the card had run nothing.Fix
checks the completion call, the wait's result and the fence value, and fails with a named context (
"late helper","relay") instead of carrying on. The relay also checks forcompleted == u64::MAXbefore landing anything.Verification
cargo check -p victory-gpu --all-targets --target x86_64-pc-windows-msvc --locked— clean.host_fence_completion_rejects_removed_device(not run here:victory-gpuneeds Windows to build).Ported from DexNom/VIctory
d036cea(pull request #1366), GPL-3.0.@mutlusinan on GitHub · 2026-11-27 20:21 UTC · original
Risk assessment (porting review)
SetEventOnCompletion, a failedWaitForSingleObject, or a fence value ofu64::MAXnow ends the run throughfail()(with the removal reason and the debug layer's message) instead of falling through to the landing step (late helper) or sleeping 1 ms and retrying (relay).fence_reachedtreatsu64::MAXas "never reached".mainate69e39c.@1tsethan on GitHub · 2026-11-27 23:00 UTC · original
Independent Windows validation of PR #242.
Tested commit:
671e25f9850abca01266bab096fed096b7fd0606.cargo test --locked -p victory-gpu host_fence_completion_rejects -- --nocapture --test-threads=1Exit: 0.
Coverage here is the fence-completion predicate test, not fault injection into an actual native wait.
Independent verification with OpenAI Codex assistance. Windows 11 Pro build 26200; Rust 1.98.1 MSVC; Windows SDK libraries from Microsoft.Windows.SDK.CPP.x64 10.0.28000.2957. Test harness used an RTX 3070 Ti / AMD integrated-GPU host; adapter identity was not captured for every test. These are focused checks on the stated PR commit, not gameplay, FPS, or a merged-main integration result.
@cloph-dsp on GitHub · 2026-11-28 02:20 UTC · original
Independent local verification (Windows, Rust 1.100.0/MSVC, no game data):
671e25f9850abca01266bab096fed096b7fd0606; the PR is a single commit on parent0cef07e9d766df48f0e95f13ce3bbbe2290fe9d3(1 file, +48/-16 incrates/victory-gpu/src/host.rs). NOTE: the shallow local clone cannot computegit merge-base origin/main <pr>(returns empty), so the PR's actual single-commit parent was used as the base.cargo test --locked -p victory-gpu --lib -- host::host_fence_completion_rejects_removed_device --exact --test-threads=1 --quiet→ 1 passed, 0 failed, 455 filtered, exit 0.git grep -Ffor the test name on the base returned no hits (test is new on this PR);git diff --check 0cef07e9 HEADclean.CARGO_TARGET_DIR(never shared) withCARGO_BUILD_JOBS=2.AI-assisted (Hy4 flash).
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.