Tests: validate copied D3D12 descriptors through GPU-visible semantics #1355

Merged
73N1X merged 2 commits from upstream-pr/1355 into main 2026-11-29 08:16:56 +00:00
73N1X commented 2026-11-28 17:55:47 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by 73N1X on 2026-11-28T17:55:47Z.


Summary

Replace the driver-specific comparison of opaque D3D12 descriptor bytes with a functional GPU-side regression test.

The new test executes a synthetic compute shader to verify that descriptors preserve their intended behavior, regardless of their internal driver representation.

Coverage

  • Thread-local staging descriptor isolation.
  • Correct buffer offset and dimensions.
  • First and last valid DWORD reads.
  • Out-of-bounds reads returning zero.
  • Descriptor replacement with a different offset and length.
  • Null descriptor behavior.
  • Staged descriptor copying enabled and disabled.
  • Device health after execution.

Validation

  • Standard configuration, staging enabled: PASS.
  • Standard configuration, staging disabled: PASS.
  • Diagnostics configuration, staging enabled: PASS.
  • Diagnostics configuration, staging disabled: PASS.
  • Cargo check in both configurations: PASS.
  • Staged asset policy: PASS.
  • Git diff check: PASS.

The full repository asset policy currently reports a pre-existing bindings.ini allowlist violation, unrelated to this patch.

Runtime impact

None expected. All changes are confined to the test module under #[cfg(test)]. Existing NVIDIA-specific optimizations and descriptor handling remain unchanged.

No game assets are included. NVIDIA hardware validation is still requested.

Based on upstream commit 9ce3cf9e.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5543042682 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1355). Originally posted by [73N1X](https://github.com/73N1X) on 2026-11-28T17:55:47Z. --- ## Summary Replace the driver-specific comparison of opaque D3D12 descriptor bytes with a functional GPU-side regression test. The new test executes a synthetic compute shader to verify that descriptors preserve their intended behavior, regardless of their internal driver representation. ## Coverage - Thread-local staging descriptor isolation. - Correct buffer offset and dimensions. - First and last valid DWORD reads. - Out-of-bounds reads returning zero. - Descriptor replacement with a different offset and length. - Null descriptor behavior. - Staged descriptor copying enabled and disabled. - Device health after execution. ## Validation - Standard configuration, staging enabled: PASS. - Standard configuration, staging disabled: PASS. - Diagnostics configuration, staging enabled: PASS. - Diagnostics configuration, staging disabled: PASS. - Cargo check in both configurations: PASS. - Staged asset policy: PASS. - Git diff check: PASS. The full repository asset policy currently reports a pre-existing `bindings.ini` allowlist violation, unrelated to this patch. ## Runtime impact None expected. All changes are confined to the test module under `#[cfg(test)]`. Existing NVIDIA-specific optimizations and descriptor handling remain unchanged. No game assets are included. NVIDIA hardware validation is still requested. Based on upstream commit `9ce3cf9e`.
babuakhil commented 2026-11-28 20:24:05 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by babuakhil on 2026-11-28T20:24:05Z.


Ran this on NVIDIA hardware: GeForce RTX 3060, Windows 11, Rust 1.98.1 (pinned). Applied on top of current main (9300875); cherry-picks cleanly.

The new test passes on the RTX 3060, with the values the GPU read back exactly as expected:

Run first second null Result
staging on (default) a5000010 a500010f 0 400 a5000020 a500009f 0 200 0 0 0 0 pass
VICTORY_VIEW_COPY=0 same same same pass
--all-features (diagnostics) same same same pass

Whole workspace, with this stacked on #1290 (which fixes the clippy/policy failures already on main):

  • both clippy builds (-D warnings, with and without --all-features): pass
  • xtask policy: pass
  • cargo test --workspace --locked --no-fail-fast, three runs: 1129/1129, 1129/1129, and 1128/1129 (one watch::tests failure, below)

Without #1290 underneath, clippy and policy fail only on what already fails on main (the four lints and bindings.ini); this PR adds nothing there.

The watch failure is not this PR. cargo test -p victory-gpu --lib, 20 runs each side:

  • without this PR (main + #1290): 1 of 20 failed (what_is_put_in_beside_the_guards_is_told_at_every_view)
  • with it: 2 of 20 failed (what_the_kernel_writes_through_is_not_guarded_for_another_view, faults_that_take_no_lock_tell_the_same)

Same rate within noise, different watch tests each time: the existing flakiness mentioned on #1267.

One small thing: the test prints first:/second:/null: and NV03_GPU_SEMANTICS_PASS copy=… on every run. Handy for this round of hardware checks, but probably worth removing before merge, since the assertions already say all of it.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7245258946 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1355#issuecomment-7245258946). Originally posted by [babuakhil](https://github.com/babuakhil) on 2026-11-28T20:24:05Z. --- Ran this on NVIDIA hardware: **GeForce RTX 3060**, Windows 11, Rust 1.98.1 (pinned). Applied on top of current `main` (`9300875`); cherry-picks cleanly. **The new test passes on the RTX 3060**, with the values the GPU read back exactly as expected: | Run | first | second | null | Result | |---|---|---|---|---| | staging on (default) | `a5000010 a500010f 0 400` | `a5000020 a500009f 0 200` | `0 0 0 0` | pass | | `VICTORY_VIEW_COPY=0` | same | same | same | pass | | `--all-features` (diagnostics) | same | same | same | pass | **Whole workspace, with this stacked on #1290** (which fixes the clippy/policy failures already on `main`): - both clippy builds (`-D warnings`, with and without `--all-features`): pass - `xtask policy`: pass - `cargo test --workspace --locked --no-fail-fast`, three runs: 1129/1129, 1129/1129, and 1128/1129 (one `watch::tests` failure, below) Without #1290 underneath, clippy and policy fail only on what already fails on `main` (the four lints and `bindings.ini`); this PR adds nothing there. **The `watch` failure is not this PR.** `cargo test -p victory-gpu --lib`, 20 runs each side: - without this PR (`main` + #1290): 1 of 20 failed (`what_is_put_in_beside_the_guards_is_told_at_every_view`) - with it: 2 of 20 failed (`what_the_kernel_writes_through_is_not_guarded_for_another_view`, `faults_that_take_no_lock_tell_the_same`) Same rate within noise, different `watch` tests each time: the existing flakiness mentioned on #1267. One small thing: the test prints `first:/second:/null:` and `NV03_GPU_SEMANTICS_PASS copy=…` on every run. Handy for this round of hardware checks, but probably worth removing before merge, since the assertions already say all of it.
73N1X commented 2026-11-28 23:45:00 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by 73N1X on 2026-11-28T23:45:00Z.


Thanks @babuakhil for the NVIDIA validation and regression analysis.

Addressed the review feedback in 65677f0 by removing the temporary diagnostic output. All semantic assertions and test logic remain unchanged.

Post-change validation on the RX 5700 XT:

  • Standard and diagnostics, staging enabled and disabled: all four tests passed.
  • Staged asset policy: passed.

The PR has been updated. No additional changes were introduced.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7247638101 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1355#issuecomment-7247638101). Originally posted by [73N1X](https://github.com/73N1X) on 2026-11-28T23:45:00Z. --- Thanks @babuakhil for the NVIDIA validation and regression analysis. Addressed the review feedback in `65677f0` by removing the temporary diagnostic output. All semantic assertions and test logic remain unchanged. Post-change validation on the RX 5700 XT: - Standard and diagnostics, staging enabled and disabled: all four tests passed. - Staged asset policy: passed. The PR has been updated. No additional changes were introduced.
iBooM72 commented 2026-11-28 23:50:28 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by iBooM72 on 2026-11-28T23:50:28Z.


Tested 65677f04 on a GeForce RTX 4070 Ti 12 GB (driver 621.01), Windows 11 build 26300, Rust 1.98.1. Both commits cherry-pick cleanly onto main (d4b5d517).

The new test passed all 80 runs, with none skipped:

Build Staging on VICTORY_VIEW_COPY=0
Default 20/20 20/20
--all-features 20/20 20/20
  • GPU: all runs used VICTORY_ADAPTER=4070. One extra run per setup, with a temporary check of the D3D12 device's adapter LUID, confirmed the RTX 4070 Ti. That check wasn't in the 80 runs.
  • Clippy: no new warnings compared with main, with or without --all-features (run without -D warnings, because main already fails with it).

I ran only this test with the PR applied, not the full suite. On main without the PR, one full run gave 1,305 passed, 59 ignored and 1 failed: repository_passes_policy, because lower.rs is over the size limit (#1429).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7247698422 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1355#issuecomment-7247698422). Originally posted by [iBooM72](https://github.com/iBooM72) on 2026-11-28T23:50:28Z. --- Tested `65677f04` on a **GeForce RTX 4070 Ti 12 GB** (driver 621.01), Windows 11 build 26300, Rust 1.98.1. Both commits cherry-pick cleanly onto `main` (`d4b5d517`). **The new test passed all 80 runs, with none skipped:** | Build | Staging on | `VICTORY_VIEW_COPY=0` | |---|---:|---:| | Default | 20/20 | 20/20 | | `--all-features` | 20/20 | 20/20 | - **GPU:** all runs used `VICTORY_ADAPTER=4070`. One extra run per setup, with a temporary check of the D3D12 device's adapter LUID, confirmed the RTX 4070 Ti. That check wasn't in the 80 runs. - **Clippy:** no new warnings compared with `main`, with or without `--all-features` (run without `-D warnings`, because `main` already fails with it). I ran only this test with the PR applied, not the full suite. On `main` without the PR, one full run gave 1,305 passed, 59 ignored and 1 failed: `repository_passes_policy`, because `lower.rs` is over the size limit (#1429).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
trustno1-coder/VIctory-NVIDIA!1355
No description provided.