GPU tests: the castable pair is two host textures where the host refuses castable formats #1764

Open
AgneyaK wants to merge 1 commit from upstream-pr/1765 into main
AgneyaK commented 2026-11-24 22:10:17 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by AgneyaK on 2026-11-24T22:10:17Z.


a_texture_written_in_one_format_reads_in_another_through_a_placed_view (added in 13bbd6f) fails on main 70564ae on a host that refuses castable formats:

assertion `left == right` failed: round 0: one host texture
  left: false
 right: true

Why. On the Intel Iris Xe (driver 32.0.101.5763) D3D12_FEATURE_D3D12_OPTIONS12 reports RelaxedFormatCastingSupported = false and EnhancedBarriersSupported = false. CreateCommittedResource3 then refuses the castable list resource::castable(42) builds (21 formats), and refuses each of them alone too. make_texture falls back to a plain texture, as designed ("the host refuses castable formats: textures of one memory in other formats get their own host texture"). So the R32_UINT / R9G9B9E5 pair gets two host textures, and alias_copy bridges them.

Change (test only, +5 lines). The test expects one host texture only where the host took the castable formats (the host copy's castable list is not empty). Otherwise it expects two textures and a copy, and still checks the texels.

Tested (Windows 11 26300, Rust 1.98.1):

host before after
Intel Iris Xe (DXGI adapter 0, what the tests use here) fails at round 0 passes: two textures, one copy, texels as expected
NVIDIA RTX 3050 6 GB Laptop, driver 32.0.16.2124 (local adapter patch, not in this PR) passes passes: one texture, no copy
WARP (--features diagnostics, VICTORY_D3D12_WARP=1) passes passes
  • cargo clippy -p victory-gpu --all-targets --locked -- -D warnings: clean. cargo xtask policy: ok.
  • cargo test -p victory-gpu on the Iris Xe: 76 passed, 2 failed. The two are the heap-cap tests in #1744 (dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views), which fail the same way on main. I left them alone on purpose: their HEAP_VIEWS assertion is what the shaders rely on (NULL_BUFFER_VIEW sits at HEAP_VIEWS - 2, past a capped 1,000,000-view heap; see #1754).

Not tested: the title (this PR changes only a test).

AI use: Claude Code (Claude Opus 5.5) found this, wrote the change and ran the tests; the results are from the runs described.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:6592410985 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1765). Originally posted by [AgneyaK](https://github.com/AgneyaK) on 2026-11-24T22:10:17Z. --- `a_texture_written_in_one_format_reads_in_another_through_a_placed_view` (added in `13bbd6f`) fails on `main` `70564ae` on a host that refuses castable formats: ``` assertion `left == right` failed: round 0: one host texture left: false right: true ``` **Why.** On the Intel Iris Xe (driver 32.0.101.5763) `D3D12_FEATURE_D3D12_OPTIONS12` reports `RelaxedFormatCastingSupported = false` and `EnhancedBarriersSupported = false`. `CreateCommittedResource3` then refuses the castable list `resource::castable(42)` builds (21 formats), and refuses each of them alone too. `make_texture` falls back to a plain texture, as designed ("the host refuses castable formats: textures of one memory in other formats get their own host texture"). So the R32_UINT / R9G9B9E5 pair gets two host textures, and `alias_copy` bridges them. **Change (test only, +5 lines).** The test expects one host texture only where the host took the castable formats (the host copy's `castable` list is not empty). Otherwise it expects two textures and a copy, and still checks the texels. **Tested** (Windows 11 26300, Rust 1.98.1): | host | before | after | |---|---|---| | Intel Iris Xe (DXGI adapter 0, what the tests use here) | fails at round 0 | passes: two textures, one copy, texels as expected | | NVIDIA RTX 3050 6 GB Laptop, driver 32.0.16.2124 (local adapter patch, not in this PR) | passes | passes: one texture, no copy | | WARP (`--features diagnostics`, `VICTORY_D3D12_WARP=1`) | passes | passes | - `cargo clippy -p victory-gpu --all-targets --locked -- -D warnings`: clean. `cargo xtask policy`: ok. - `cargo test -p victory-gpu` on the Iris Xe: 76 passed, 2 failed. The two are the heap-cap tests in #1744 (`dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views`), which fail the same way on `main`. I left them alone on purpose: their `HEAP_VIEWS` assertion is what the shaders rely on (`NULL_BUFFER_VIEW` sits at `HEAP_VIEWS - 2`, past a capped 1,000,000-view heap; see #1754). Not tested: the title (this PR changes only a test). AI use: Claude Code (Claude Opus 5.5) found this, wrote the change and ran the tests; the results are from the runs described. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
catminou4 commented 2026-11-24 23:05:17 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T22:18:31Z.

Review: COMMENTED


Static review only: Windows-only code (D3D12/windows_sys/Win32) — nothing compiles or runs on macOS; source review of the diff.

Test-only PR: the castable pair is now two host textures where the host refuses castable resources — adjusts the test fixture to host capabilities. 24 lines, no product code. Fine.

<!-- greyfinch-sync:Marvisak/VIctory:review:6048297015 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1765#pullrequestreview-6048297015). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T22:18:31Z. **Review:** COMMENTED --- Static review only: Windows-only code (D3D12/windows_sys/Win32) — nothing compiles or runs on macOS; source review of the diff. Test-only PR: the castable pair is now two host textures where the host refuses castable resources — adjusts the test fixture to host capabilities. 24 lines, no product code. Fine.
DesertGamer commented 2026-11-24 23:05:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DesertGamer on 2026-11-24T22:12:01Z.


VIctory V2: community PRs, merged and tested

Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch.

Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1).

⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.

Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help:
https://DesertGamer/VIctory-V2

Unofficial community fork of Marvisak/VIctory, GPL-3.0.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7145931134 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1765#issuecomment-7145931134). Originally posted by [DesertGamer](https://github.com/DesertGamer) on 2026-11-24T22:12:01Z. --- ### VIctory V2: community PRs, merged and tested Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch. **Where it stands today:** launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1). :warning: Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk. Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help: https://DesertGamer/VIctory-V2 *Unofficial community fork of Marvisak/VIctory, GPL-3.0.*
Vedoxdev123 commented 2026-11-24 23:06:06 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Vedoxdev123 on 2026-11-24T23:00:32Z.


Tested on Windows with AMD Ryzen 5 5600X + NVIDIA GeForce RTX 4060:

cargo test -p victory-gpu --lib -> 76 passed; 2 failed; 1 ignored (matches main; the 2 failures are the known 1,000,000 view heap cap tests tracked in #1744).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7146903380 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1765#issuecomment-7146903380). Originally posted by [Vedoxdev123](https://github.com/Vedoxdev123) on 2026-11-24T23:00:32Z. --- Tested on Windows with AMD Ryzen 5 5600X + NVIDIA GeForce RTX 4060: `cargo test -p victory-gpu --lib` -> **76 passed; 2 failed; 1 ignored** (matches `main`; the 2 failures are the known 1,000,000 view heap cap tests tracked in #1744).
Marvisak commented 2026-11-25 04:07:01 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T03:41:14Z.


Automated triage for the maintainers.

Merge candidate. Test-only: a_texture_written_in_one_format_reads_in_another_through_a_placed_view now expects one shared host texture only where the host copy's castable list is not empty, and still checks the texels. This matches main's resource.rs: when the host refuses castable formats, the list is cleared and a plain texture is made, so on hosts without relaxed format casting (Intel Iris Xe) the pair has two textures bridged by a copy. Hosts that accept castable formats keep the original assertion. CI has not run.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7152148725 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1765#issuecomment-7152148725). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T03:41:14Z. --- <!-- victory-triage v1 head=d02e007b7973f3553aea3bca28bfa30d08340e9f verdict=merge-candidate at=2026-11-25T03:43:40Z --> Automated triage for the maintainers. **Merge candidate.** Test-only: `a_texture_written_in_one_format_reads_in_another_through_a_placed_view` now expects one shared host texture only where the host copy's `castable` list is not empty, and still checks the texels. This matches `main`'s `resource.rs`: when the host refuses castable formats, the list is cleared and a plain texture is made, so on hosts without relaxed format casting (Intel Iris Xe) the pair has two textures bridged by a copy. Hosts that accept castable formats keep the original assertion. CI has not run. --- _Generated by [Claude Code](https://claude.ai/code)_
mercuryVM commented 2026-11-25 06:02:00 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-25T05:41:13Z.

Review: APPROVED


Tested d02e007 on Windows 11, RTX 5070, MSVC: builds, clippy -D warnings clean with and without --all-features, cargo test --workspace --no-fail-fast 730 passed on our fork main; the 9 failures are the ones that fail on that main without this PR (host validator and environment).

  • Tying the expectation to a.castable.is_empty() follows make_texture's documented fallback. A host that refuses the castable list gets a plain texture, so the R32_UINT/R9G9B9E5 pair becomes two host textures, and the test still checks the texels through alias_copy.
  • The RTX 5070 here takes the castable formats, so this runs the one-texture branch as before. I didn't have a host without relaxed casting to exercise the other branch.

Merged into our fork's main.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6052415536 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1765#pullrequestreview-6052415536). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-25T05:41:13Z. **Review:** APPROVED --- Tested d02e007 on Windows 11, RTX 5070, MSVC: builds, clippy `-D warnings` clean with and without `--all-features`, `cargo test --workspace --no-fail-fast` 730 passed on our fork main; the 9 failures are the ones that fail on that main without this PR (host validator and environment). - Tying the expectation to `a.castable.is_empty()` follows `make_texture`'s documented fallback. A host that refuses the castable list gets a plain texture, so the R32_UINT/R9G9B9E5 pair becomes two host textures, and the test still checks the texels through `alias_copy`. - The RTX 5070 here takes the castable formats, so this runs the one-texture branch as before. I didn't have a host without relaxed casting to exercise the other branch. Merged into our fork's main. AI-assisted (Claude Code).
astrosteveo commented 2026-11-25 06:02:00 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by astrosteveo on 2026-11-25T05:43:53Z.

Review: APPROVED


Read the diff at d02e007 and ran the test merged onto main 940d32f (no conflicts) on a third kind of host that refuses castable formats: Arch Linux, Wine 11.22, vkd3d-proton, RTX 5080, driver 620.73.04.

result of a_texture_written_in_one_format_reads_in_another_through_a_placed_view
main fails (draw.rs:2185)
with this PR passes, the texel checks included

The change is right as I read it: castable is empty exactly when the host refused the list, and the copy is still checked there. I have also run the whole suite with this PR as part of a local build with other PRs, with no new failure.


Co-Authored-By: Claude Opus 5.5 <[email protected]>

<!-- greyfinch-sync:Marvisak/VIctory:review:6052439402 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1765#pullrequestreview-6052439402). Originally posted by [astrosteveo](https://github.com/astrosteveo) on 2026-11-25T05:43:53Z. **Review:** APPROVED --- Read the diff at `d02e007` and ran the test merged onto `main` `940d32f` (no conflicts) on a third kind of host that refuses castable formats: Arch Linux, Wine 11.22, vkd3d-proton, RTX 5080, driver 620.73.04. | | result of `a_texture_written_in_one_format_reads_in_another_through_a_placed_view` | |---|---| | `main` | fails (`draw.rs:2185`) | | with this PR | passes, the texel checks included | The change is right as I read it: `castable` is empty exactly when the host refused the list, and the copy is still checked there. I have also run the whole suite with this PR as part of a local build with other PRs, with no new failure. --- <sub>Co-Authored-By: Claude Opus 5.5 &lt;[email protected]&gt;</sub>
fyernald commented 2026-11-25 17:02:52 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fyernald on 2026-11-25T16:28:19Z.

Review: APPROVED


Verified on the host this is for: Windows 10 Pro 22H2 (19045), RTX 3080 (617.42). The in-box runtime there has no ID3D12Device10.

  • On main + #486 (needed for these tests to run on Windows 10), a_texture_written_in_one_format_reads_in_another_through_a_placed_view fails every run: round 0: one host texture, left: false, right: true.
  • With this PR at d02e007, it passes. The rest of victory-gpu is unchanged: 141 passed, 2 failed, and those 2 are the heap-cap tests (FIND-9).
  • With #2357 and #2461 also applied, victory-gpu passes 143 / 0 and victory-shader 247 / 0.

The check is exact, not just loose enough to pass. make_texture clears castable_formats on both paths that skip castable creation: a plain CreatePlacedResource, and the plain committed fallback. So a.castable.is_empty() holds exactly when the host made two textures.

Note for the maintainers: #2251 changes the same lines in draw.rs with a stricter version of this check (a castable family that matches the read format). Only one of the two is needed.

<!-- greyfinch-sync:Marvisak/VIctory:review:6061164018 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1765#pullrequestreview-6061164018). Originally posted by [fyernald](https://github.com/fyernald) on 2026-11-25T16:28:19Z. **Review:** APPROVED --- Verified on the host this is for: **Windows 10 Pro 22H2 (19045), RTX 3080 (617.42)**. The in-box runtime there has no `ID3D12Device10`. - On `main` + #486 (needed for these tests to run on Windows 10), `a_texture_written_in_one_format_reads_in_another_through_a_placed_view` fails every run: `round 0: one host texture`, `left: false`, `right: true`. - With this PR at `d02e007`, it passes. The rest of `victory-gpu` is unchanged: 141 passed, 2 failed, and those 2 are the heap-cap tests (`FIND-9`). - With #2357 and #2461 also applied, `victory-gpu` passes 143 / 0 and `victory-shader` 247 / 0. The check is exact, not just loose enough to pass. `make_texture` clears `castable_formats` on both paths that skip castable creation: a plain `CreatePlacedResource`, and the plain committed fallback. So `a.castable.is_empty()` holds exactly when the host made two textures. Note for the maintainers: #2251 changes the same lines in `draw.rs` with a stricter version of this check (a castable family that matches the read format). Only one of the two is needed.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1765:upstream-pr/1765'
git switch 'upstream-pr/1765'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1765'
git switch 'upstream-pr/1765'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1765'
git switch 'upstream-pr/1765'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1765'
git switch 'main'
git merge --squash 'upstream-pr/1765'
git switch 'main'
git merge --ff-only 'upstream-pr/1765'
git switch 'main'
git merge 'upstream-pr/1765'
git push origin 'main'
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
Marvisak/VIctory!1764
No description provided.