fix: keep A8_UNORM out of the R8 texture format family #330

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

@⁠mauroalvare on GitHub · 2026-11-26 03:37 UTC · original
mauroalvare:codex/victory-a8-format-family → main · +227 −1 · 4 files · 1 commits · open

Change

Neptune's format-family table treated A8_UNORM as part of R8_TYPELESS. The shader-view materializer matched an R8_UNORM request to an A8_UNORM texture and substituted the alpha format. A shader then read alpha from the slot that should have received the incompatible-view fallback.

Keep A8_UNORM in its own family so the existing D3D12 view check rejects that pairing and emits a null SRV. This is in the resource and descriptor path of the Neptune runtime built by tools/lancer_victory.ps1. Microsoft lists casting within the bit layout as unavailable for A8_UNORM, and specifies zero reads from a null SRV. Format support at feature level 12.0 · CreateShaderResourceView

The change adapts AnoHunted's format-family fix from VIctory. The commit trailer and THIRD_PARTY.md record the source and licence. VIctory source commit

Verification

Base c4c93bdc413191a9dc909998d2d53080a3f0c880 and fix 9d50884cf96bc5fe7e3ec6f0743f1897a57b996c. For the baseline, add the GPU test file, its module declaration, and the family-boundary unit test from this PR. Run from third_party/victory, with VICTORY_D3D12_WARP unset for NVIDIA or set to 1 for WARP.

cargo test --locked --offline -p victory-gpu --lib --features diagnostics descriptor::host::alpha_view_tests::red_view_on_alpha_texture_reads_zero -- --exact --nocapture --test-threads=1
Adapter Base cross-view read Fixed cross-view read Compatible A8 control
GeForce RTX 5070 Ti, driver 621.40 0.2509804, accepted as format 65 0, rejected and null 0.2509804 on both revisions
WARP, Microsoft Basic Render Driver 0.2509804, accepted as format 65 0, rejected and null 0.2509804 on both revisions

The baseline readback assertion failed on each adapter. The fix reported 1 passed; 0 failed; 0 ignored with actual GPU readback on each.

  • cargo test --locked --offline -p victory-gpu --lib --features diagnostics resource::tests::alpha_format_stands_outside_the_red_typeless_family -- --exact --test-threads=1 failed on the base with family 60 for A8_UNORM. It passed with the fix.
  • cargo test --locked --offline -p victory-gpu --lib --features diagnostics -- --test-threads=1 reported 198 passed, 3 failed, 3 ignored. The matching main baseline had 196 passed, 3 failed, 3 ignored. 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.
  • cargo test --locked --offline -p victory-loader --test load_probe reported 2 passed.
  • cargo build --locked --offline --release -p victory passed.
  • cargo xtask policy reported asset policy: 200 files ok.
  • 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 -m ruff check --select W605,F,E9 PrototypeScarlett tests tools reported All checks passed!.
  • python -m pytest -rs with ANYXBOXX_REQUIRE_RUNTIME=1 on Python 3.13.15 reported 1665 passed in 77.14s (0:01:17) with no skips.

Oracle and test data

The fixture clears one texel of a synthetic A8_UNORM texture to alpha 64/255. It materializes a matching A8 view and a cross-family R8 request, then reads the alpha channel from both descriptor slots in one dispatch. An accepted baseline slot is checked for coercion to A8 before submission. The matching view identifies the initialized texel and the cross-family slot exercises the existing null SRV fallback.

Checklist

  • One change to alpha format-family handling.
  • The regression fails on the base and passes on the fix.
  • The commands and adapter results are recorded above.
  • Synthetic test input and third-party attribution verified.

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

**@⁠mauroalvare** on GitHub · 2026-11-26 03:37 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/330) `mauroalvare:codex/victory-a8-format-family` → `main` · +227 −1 · 4 files · 1 commits · open ## Change Neptune's format-family table treated `A8_UNORM` as part of `R8_TYPELESS`. The shader-view materializer matched an `R8_UNORM` request to an `A8_UNORM` texture and substituted the alpha format. A shader then read alpha from the slot that should have received the incompatible-view fallback. Keep `A8_UNORM` in its own family so the existing D3D12 view check rejects that pairing and emits a null SRV. This is in the resource and descriptor path of the Neptune runtime built by `tools/lancer_victory.ps1`. Microsoft lists casting within the bit layout as unavailable for `A8_UNORM`, and specifies zero reads from a null SRV. [Format support at feature level 12.0](https://learn.microsoft.com/en-us/windows/win32/direct3ddxgi/hardware-support-for-direct3d-12-0-formats) · [CreateShaderResourceView](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12device-createshaderresourceview) The change adapts AnoHunted's format-family fix from VIctory. The commit trailer and `THIRD_PARTY.md` record the source and licence. [VIctory source commit](https://github.com/Marvisak/VIctory/commit/97c8783f4a260996b602b75cabfe17568b1d1a26) ## Verification Base `c4c93bdc413191a9dc909998d2d53080a3f0c880` and fix `9d50884cf96bc5fe7e3ec6f0743f1897a57b996c`. For the baseline, add the GPU test file, its module declaration, and the family-boundary unit test from this PR. Run from `third_party/victory`, with `VICTORY_D3D12_WARP` unset for NVIDIA or set to `1` for WARP. ```powershell cargo test --locked --offline -p victory-gpu --lib --features diagnostics descriptor::host::alpha_view_tests::red_view_on_alpha_texture_reads_zero -- --exact --nocapture --test-threads=1 ``` | Adapter | Base cross-view read | Fixed cross-view read | Compatible A8 control | | --- | --- | --- | --- | | GeForce RTX 5070 Ti, driver 621.40 | `0.2509804`, accepted as format 65 | `0`, rejected and null | `0.2509804` on both revisions | | WARP, Microsoft Basic Render Driver | `0.2509804`, accepted as format 65 | `0`, rejected and null | `0.2509804` on both revisions | The baseline readback assertion failed on each adapter. The fix reported `1 passed; 0 failed; 0 ignored` with actual GPU readback on each. - `cargo test --locked --offline -p victory-gpu --lib --features diagnostics resource::tests::alpha_format_stands_outside_the_red_typeless_family -- --exact --test-threads=1` failed on the base with family 60 for `A8_UNORM`. It passed with the fix. - `cargo test --locked --offline -p victory-gpu --lib --features diagnostics -- --test-threads=1` reported 198 passed, 3 failed, 3 ignored. The matching `main` baseline had 196 passed, 3 failed, 3 ignored. 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`. - `cargo test --locked --offline -p victory-loader --test load_probe` reported 2 passed. - `cargo build --locked --offline --release -p victory` passed. - `cargo xtask policy` reported `asset policy: 200 files ok`. - `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 -m ruff check --select W605,F,E9 PrototypeScarlett tests tools` reported `All checks passed!`. - `python -m pytest -rs` with `ANYXBOXX_REQUIRE_RUNTIME=1` on Python 3.13.15 reported `1665 passed in 77.14s (0:01:17)` with no skips. ## Oracle and test data The fixture clears one texel of a synthetic `A8_UNORM` texture to alpha `64/255`. It materializes a matching A8 view and a cross-family R8 request, then reads the alpha channel from both descriptor slots in one dispatch. An accepted baseline slot is checked for coercion to A8 before submission. The matching view identifies the initialized texel and the cross-family slot exercises the existing null SRV fallback. ## Checklist - [x] One change to alpha format-family handling. - [x] The regression fails on the base and passes on the fix. - [x] The commands and adapter results are recorded above. - [x] Synthetic test input and third-party attribution verified. AI assistance was used for investigation, implementation, and verification with OpenAI Codex.
Treat alpha-only textures separately when matching a shader view to the
host resource. A rejected cross-family view uses the existing null SRV
fallback.

Verify the format boundary and read both slots in a synthetic D3D12
dispatch to catch accidental binding of the alpha texture again.

Source: Marvisak/VIctory 97c8783f4a260996b602b75cabfe17568b1d1a26
Co-authored-by: AnoHunted <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:43:18 +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/330/head:github-bot/gh-330'
git switch 'github-bot/gh-330'

Merge

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