fix: validate the host format of texture UAVs #320

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

@⁠mauroalvare on GitHub · 2026-11-26 02:49 UTC · original
mauroalvare:codex/victory-typed-uav-support → main · +315 −13 · 3 files · 1 commits · open

Change

descriptor::host::fits in Neptune accepted a D32_FLOAT UAV on a UAV-enabled R32_TYPELESS texture because the two formats belong to the same family. Both tested D3D12 adapters report that D32_FLOAT lacks typed view and store support. The baseline repro stops at the eligibility assertion before submitting the unsupported descriptor to the native API.

Check the device's typed UAV and typed store flags after resolving the actual host view format, including sRGB aliases and target stand-ins. Cache the result per format for the runtime's D3D12 device and route unsupported views to the existing null descriptor fallback. This is in the texture UAV materializer used by the Neptune runtime built by tools/lancer_victory.ps1. D3D12 format support 1 · D3D12 format support 2

The format check adapts the approach from Marvisak/VIctory to Neptune's existing format resolution. The source and licence are recorded in THIRD_PARTY.md and the commit trailers.

Verification

Base c4c93bdc413191a9dc909998d2d53080a3f0c880 and fix 11cc463aeb25d6b79670e963e846e3742c5ad1f7. To reproduce the baseline, add typed_uav_tests.rs and its #[cfg(test)] module declaration from this PR to the base revision. Run from third_party/victory. Leave VICTORY_D3D12_WARP unset for hardware or set it to 1 for WARP.

cargo test --locked --offline -p victory-gpu --lib --features diagnostics descriptor::host::typed_uav_tests::a_texture_uav_requires_a_writable_host_format -- --exact --nocapture --test-threads=1
Adapter Base Fix
GeForce RTX 5070 Ti, driver 621.40 fits=true, test fails fits=false, 1 passed
WARP, Microsoft Basic Render Driver fits=true, test fails fits=false, 1 passed

Both adapters reported D32_FLOAT support1=0x3110b0, support2=0x200. Actual compute readback on the fix returned null UAV read=0x00000000, valid UAV retained=0x13579bdf on both adapters. The targeted runs had no skips.

The B5G5R5A1_UNORM case from VIctory has a different host format on these devices. Neptune already resolves it to R8G8B8A8_UNORM (28) on the 5070 Ti, where the original format lacks typed view and store support. WARP retains B5G5R5A1_UNORM (86), which supports both. The eligibility test passes on the effective format in both cases.

  • cargo build --locked --offline --release -p victory passed.
  • cargo test --locked --offline -p victory-loader --test load_probe reported 2 passed.
  • cargo xtask policy reported asset policy: 200 files ok.
  • cargo test --locked --offline -p victory-gpu --lib --features diagnostics -- --test-threads=1 reported 197 passed, 3 failed, 3 ignored on the fix. The base reported 196 passed, 3 failed, 3 ignored with the new test filtered out. The same assertions failed in spans_say_the_next_start_and_the_lowest_level_viewed, warp_card_fetch_copies_flagged_pieces_to_their_slots, and warp_card_patch_writes_the_masked_bytes_and_no_others.
  • python -m ruff check --select W605,F,E9 PrototypeScarlett tests tools reported All checks passed!.
  • cmake -S runtime -B runtime/build -A x64 and cmake --build runtime/build --config Release --parallel 2 passed.
  • cargo build --release --locked --offline --manifest-path rust/Cargo.toml passed. cargo test --release --locked --offline --manifest-path rust/Cargo.toml reported 12 passed in total.
  • python tools/build_tombox.py built all 10 open-source DLLs from the pinned TomBox revision f89e4106fe8a1728515afa34ceb5097132cadcda.
  • python -m pytest -rs with ANYXBOXX_REQUIRE_RUNTIME=1 on the configured Python 3.13.15 environment reported 1665 passed in 72.88s (0:01:12) with no skips.

Oracle and test data

The test creates a 1×1 texture and uses CheckFeatureSupport as the descriptor eligibility oracle. It then runs a synthetic one-thread compute shader through a valid slot and the null slot from Neptune's descriptor materializer. The readback checks the null read and the retained marker after a write to the null slot. The shader and texture are generated by the test. D3D12 null UAV semantics

Checklist

  • Single change to texture UAV eligibility.
  • Regression fails on the base and passes on the fix.
  • Commands and results recorded above.
  • Synthetic test data and source attribution checked.

AI assistance was used for investigation, implementation, and verification with OpenAI Codex.

**@⁠mauroalvare** on GitHub · 2026-11-26 02:49 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/320) `mauroalvare:codex/victory-typed-uav-support` → `main` · +315 −13 · 3 files · 1 commits · open ## Change `descriptor::host::fits` in Neptune accepted a `D32_FLOAT` UAV on a UAV-enabled `R32_TYPELESS` texture because the two formats belong to the same family. Both tested D3D12 adapters report that `D32_FLOAT` lacks typed view and store support. The baseline repro stops at the eligibility assertion before submitting the unsupported descriptor to the native API. Check the device's typed UAV and typed store flags after resolving the actual host view format, including sRGB aliases and target stand-ins. Cache the result per format for the runtime's D3D12 device and route unsupported views to the existing null descriptor fallback. This is in the texture UAV materializer used by the Neptune runtime built by `tools/lancer_victory.ps1`. [D3D12 format support 1](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ne-d3d12-d3d12_format_support1) · [D3D12 format support 2](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ne-d3d12-d3d12_format_support2) The format check adapts the approach from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/commit/ea488a9f9901e4375c547a57795ae8cb79d577a4) to Neptune's existing format resolution. The source and licence are recorded in `THIRD_PARTY.md` and the commit trailers. ## Verification Base `c4c93bdc413191a9dc909998d2d53080a3f0c880` and fix `11cc463aeb25d6b79670e963e846e3742c5ad1f7`. To reproduce the baseline, add `typed_uav_tests.rs` and its `#[cfg(test)]` module declaration from this PR to the base revision. Run from `third_party/victory`. Leave `VICTORY_D3D12_WARP` unset for hardware or set it to `1` for WARP. ```powershell cargo test --locked --offline -p victory-gpu --lib --features diagnostics descriptor::host::typed_uav_tests::a_texture_uav_requires_a_writable_host_format -- --exact --nocapture --test-threads=1 ``` | Adapter | Base | Fix | | --- | --- | --- | | GeForce RTX 5070 Ti, driver 621.40 | `fits=true`, test fails | `fits=false`, 1 passed | | WARP, Microsoft Basic Render Driver | `fits=true`, test fails | `fits=false`, 1 passed | Both adapters reported `D32_FLOAT support1=0x3110b0, support2=0x200`. Actual compute readback on the fix returned `null UAV read=0x00000000, valid UAV retained=0x13579bdf` on both adapters. The targeted runs had no skips. The `B5G5R5A1_UNORM` case from VIctory has a different host format on these devices. Neptune already resolves it to `R8G8B8A8_UNORM` (28) on the 5070 Ti, where the original format lacks typed view and store support. WARP retains `B5G5R5A1_UNORM` (86), which supports both. The eligibility test passes on the effective format in both cases. - `cargo build --locked --offline --release -p victory` passed. - `cargo test --locked --offline -p victory-loader --test load_probe` reported 2 passed. - `cargo xtask policy` reported `asset policy: 200 files ok`. - `cargo test --locked --offline -p victory-gpu --lib --features diagnostics -- --test-threads=1` reported 197 passed, 3 failed, 3 ignored on the fix. The base reported 196 passed, 3 failed, 3 ignored with the new test filtered out. The same assertions failed in `spans_say_the_next_start_and_the_lowest_level_viewed`, `warp_card_fetch_copies_flagged_pieces_to_their_slots`, and `warp_card_patch_writes_the_masked_bytes_and_no_others`. - `python -m ruff check --select W605,F,E9 PrototypeScarlett tests tools` reported `All checks passed!`. - `cmake -S runtime -B runtime/build -A x64` and `cmake --build runtime/build --config Release --parallel 2` passed. - `cargo build --release --locked --offline --manifest-path rust/Cargo.toml` passed. `cargo test --release --locked --offline --manifest-path rust/Cargo.toml` reported 12 passed in total. - `python tools/build_tombox.py` built all 10 open-source DLLs from the pinned TomBox revision `f89e4106fe8a1728515afa34ceb5097132cadcda`. - `python -m pytest -rs` with `ANYXBOXX_REQUIRE_RUNTIME=1` on the configured Python 3.13.15 environment reported `1665 passed in 72.88s (0:01:12)` with no skips. ## Oracle and test data The test creates a 1×1 texture and uses `CheckFeatureSupport` as the descriptor eligibility oracle. It then runs a synthetic one-thread compute shader through a valid slot and the null slot from Neptune's descriptor materializer. The readback checks the null read and the retained marker after a write to the null slot. The shader and texture are generated by the test. [D3D12 null UAV semantics](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12device-createunorderedaccessview) ## Checklist - [x] Single change to texture UAV eligibility. - [x] Regression fails on the base and passes on the fix. - [x] Commands and results recorded above. - [x] Synthetic test data and source attribution checked. AI assistance was used for investigation, implementation, and verification with OpenAI Codex.
Resolve the texture UAV format before checking typed UAV and typed store
support on the host device. Use the existing null descriptor fallback
when the format is unsupported.

Exercise the same materializer with a synthetic texture and verify that
dispatches through a null slot leave the valid slot's data intact.

Source: Marvisak/VIctory ea488a9f9901e4375c547a57795ae8cb79d577a4
Co-authored-by: lhnizdo <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:42:57 +00:00
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/320/head:github-bot/gh-320'
git switch 'github-bot/gh-320'

Merge

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