GPU: confirm relay readback fence completion #69

Open
github-bot wants to merge 1 commit from github-bot/gh-69 into main AGit
Owner

@⁠kyle7908 on GitHub · 2026-11-26 04:36 UTC · original
kyle7908:fix/dexnom-relay-readback-fence → main · +129 −1 · 2 files · 1 commits · open

Problem

The direct-queue relay readback path discards the result of WaitForSingleObject. It can then read mapped bytes, merge the result, and retire tracking before completion is established. In RayTime, the same wait also precedes a diagnostic timestamp readback. Device removal can signal pending fence events and causes GetCompletedValue to report UINT64_MAX.

Change

Require WAIT_OBJECT_0 and a completed fence value at or beyond the submitted value, with a separate check for UINT64_MAX. Preserve the native Win32 error on WAIT_FAILED. An unconfirmed completion takes the existing fatal path before timing data, mapped bytes, or tracking are consumed. Queue ordering and RayTime's packed readback and capture bookkeeping are preserved.

Reproduction and validation

  • On RayTime main at 64bd58f, a test-only version that modeled the unchecked wait by returning success passed the success control and failed all four negative cases. A failed wait, a nonsignaled wait, an incomplete fence, and the removal sentinel all advanced the synthetic readback and retirement markers.
  • With the check restored, all 12 relay tests passed in both default and diagnostics builds.
  • The opt-in synthetic GPU test passed with RayTime relay and capture enabled, including the overflow that falls back to direct-queue readback. It also passed with the stream timing probe enabled.
  • The Windows Rust workspace suite recorded 688 passed, 12 ignored, and 0 failed. Strict workspace Clippy passed with default and all features, along with the full and staged asset-policy checks, rustfmt for the new module, and independent review.

Actual GPU device-loss behavior has not been verified end to end. The negative cases use native Win32 event results and synthetic fence values. Validation used public source, authorized dependencies, and synthetic fixtures.

AI disclosure

OpenAI Codex assisted with reproduction, implementation, validation, and independent pre-submission review.

**@⁠kyle7908** on GitHub · 2026-11-26 04:36 UTC · [original](https://github.com/DexNom/VIctory/pull/69) `kyle7908:fix/dexnom-relay-readback-fence` → `main` · +129 −1 · 2 files · 1 commits · open ## Problem The direct-queue relay readback path discards the result of WaitForSingleObject. It can then read mapped bytes, merge the result, and retire tracking before completion is established. In RayTime, the same wait also precedes a diagnostic timestamp readback. Device removal can signal pending fence events and causes GetCompletedValue to report UINT64_MAX. ## Change Require WAIT_OBJECT_0 and a completed fence value at or beyond the submitted value, with a separate check for UINT64_MAX. Preserve the native Win32 error on WAIT_FAILED. An unconfirmed completion takes the existing fatal path before timing data, mapped bytes, or tracking are consumed. Queue ordering and RayTime's packed readback and capture bookkeeping are preserved. ## Reproduction and validation - On RayTime main at 64bd58f, a test-only version that modeled the unchecked wait by returning success passed the success control and failed all four negative cases. A failed wait, a nonsignaled wait, an incomplete fence, and the removal sentinel all advanced the synthetic readback and retirement markers. - With the check restored, all 12 relay tests passed in both default and diagnostics builds. - The opt-in synthetic GPU test passed with RayTime relay and capture enabled, including the overflow that falls back to direct-queue readback. It also passed with the stream timing probe enabled. - The Windows Rust workspace suite recorded 688 passed, 12 ignored, and 0 failed. Strict workspace Clippy passed with default and all features, along with the full and staged asset-policy checks, rustfmt for the new module, and independent review. Actual GPU device-loss behavior has not been verified end to end. The negative cases use native Win32 event results and synthetic fence values. Validation used public source, authorized dependencies, and synthetic fixtures. ## AI disclosure OpenAI Codex assisted with reproduction, implementation, validation, and independent pre-submission review.
Only consume relay readback bytes after the native wait succeeds and the private fence reaches the requested value. Send unconfirmed completion through the existing host failure path before merging bytes or retiring tracking state.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:25:14 +00:00
Author
Owner

@⁠Artking175 on GitHub · 2026-11-26 05:24 UTC · original

Independent Windows 10 check of 80f89c2. The five host::relay_fetch tests passed with diagnostics disabled and all five passed again with diagnostics enabled. This exercised the native Win32 event results and synthetic fence values, including the removal sentinel and preservation of the Win32 error. Actual device removal and relay throughput were outside this test.

**@⁠Artking175** on GitHub · 2026-11-26 05:24 UTC · [original](https://github.com/DexNom/VIctory/pull/69#issuecomment-7183452508) Independent Windows 10 check of `80f89c2`. The five `host::relay_fetch` tests passed with diagnostics disabled and all five passed again with diagnostics enabled. This exercised the native Win32 event results and synthetic fence values, including the removal sentinel and preservation of the Win32 error. Actual device removal and relay throughput were outside this test.
Author
Owner

@⁠kyle7908 on GitHub · 2026-11-26 05:49 UTC · original

@⁠Artking175 Thanks for taking the time to independently verify this on Windows 10! Really appreciate the additional validation across both diagnostics configurations.

**@⁠kyle7908** on GitHub · 2026-11-26 05:49 UTC · [original](https://github.com/DexNom/VIctory/pull/69#issuecomment-7183842817) @⁠Artking175 Thanks for taking the time to independently verify this on Windows 10! Really appreciate the additional validation across both diagnostics configurations.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/69/head:github-bot/gh-69'
git switch 'github-bot/gh-69'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-69'
git switch 'github-bot/gh-69'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-69'
git switch 'github-bot/gh-69'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-69'
git switch 'main'
git merge --squash 'github-bot/gh-69'
git switch 'main'
git merge --ff-only 'github-bot/gh-69'
git switch 'main'
git merge 'github-bot/gh-69'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.