Diagnostics: missing textures as checkerboards, PIX captures from a run, slow driver compiles named, per-stage clean-up switch #687

Open
abilliontokens wants to merge 8 commits from upstream-pr/687 into main
abilliontokens commented 2026-11-25 04:30:10 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by abilliontokens on 2026-11-25T04:30:10Z.


Debugging aids for the problems reported most in this repo: black or missing surfaces, mosaic blocks from the shader clean-up passes (#310), long first-launch stalls, and refused pipelines. All are diagnostics-only except the slow-compile log line and the cache-key byte. Stacked on #617 (scripts/bench.ps1); the first two commits here are #617's.

What each one is for

Switch / change Answers
VICTORY_DEBUG_NULL_VIEWS=1 Is a black surface a missing texture? 2D texture slots that would read zeros read a checkerboard instead: magenta where the title made a view the host has no texture for (not uploaded, unmapped, refused), cyan where there is no view at all (unwritten, or past NVIDIA's 1,000,000-view cap). Black that stays black is the title's own: unlit or drawn black.
VICTORY_PIX=<dir> What did this draw read and write? Loads the newest installed PIX's WinPixGpuCapturer.dll before the host device. A file named capture put in the folder saves the next frame(s) as frame-<n>.wpix. PIX then shows each draw's DXIL, views, samplers and targets, plus pixel history.
No pipeline library under PIX Under PIX's capturer the runtime rejects the saved library ("created for a different version"), and PIX's own was then saved over it. In one run that replaced 426 MB with 848 bytes, and the next normal run made every pipeline again. Under VICTORY_PIX the library is neither opened nor saved.
"slow driver compile of a host pipeline" log line Why are the first minutes so slow? Every driver compile of 2 s or more is logged, naming the shaders. On an RTX 5060 Ti (driver 621.24), 24 pipelines took 2–128 s each (313 s in all) on the second launch, almost all CS_RaytracingResolve variants. The frame line showed only a "being made" count.
VICTORY_SHADER_OPT_STAGES=ps,ms,... Which stage's clean-up breaks? Limits VICTORY_SHADER_OPT's module passes to the named stages; part of the shader cache key. Bisecting #310 in pixel shaders then doesn't remake every compute pipeline (see the line above).
scripts/bench.ps1 -PixAt <s> Takes one PIX capture that many seconds into the world, plus the same frame as a PNG.
scripts/bench.ps1 -Victory <exe> Runs another diagnostics build, so a run can go on while the tree rebuilds, or two builds can be compared. With -Victory, the summary names the build by file and time.
bench summaries Total and slowest driver compile time per run.
frame::tests::waits_end_on_ticks_and_count_frames The flip part of the test used a 5 ms interval. With a shader translation running beside cargo test, the flips came out 7 ticks apart ([21, 28, 35, 42]). At 50 ms it passes under 8 busy threads and a running title.

README documents the switches, including that VICTORY_D3D12_DEBUG=1 needs Windows' Graphics Tools (Add-WindowsCapability -Online -Name Tools.Graphics.DirectX~~~~0.0.1.0). Without them, the debug layer quietly does nothing.

Checked

RTX 5060 Ti 16 GB, driver 621.24, Windows 11 26200, PIX 2611.19:

  • VICTORY_PIX: the capturer loaded, and frame-4305.wpix (2.1 GB) was written at the asked-for moment. The library-wipe guard was written after that run showed the problem.
  • VICTORY_DEBUG_NULL_VIEWS=1: the stand-in textures were made and used by the view paths (logged on first use). In the prologue cell, no magenta or cyan pixels reached the screen in any captured frame. So the black jumpsuit there is not a missing 2D texture; it is light or a dropped pass.
  • Slow-compile line: 24 to 380 lines per run, depending on cache state.
  • cargo clippy --workspace --all-targets --all-features -- -D warnings: clean.
  • Without --all-features: fails only on the pre-existing placed_filler_twins warning, as main does (#491 / #530).
  • Tests: cargo test -p victory-gpu --lib 113 passed; -p victory-shader 2 new tests (stage switch parsing) pass. cargo xtask policy: ok.

Not checked:

  • PIX with a pipeline library on AMD.
  • The checkerboard on 1D/3D/cube slots. Those still read zeros by design: a stand-in of another dimension is a view mismatch.

AI-assisted (Claude Code). Runs and checks done on the machine above.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6597236925 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/687). Originally posted by [abilliontokens](https://github.com/abilliontokens) on 2026-11-25T04:30:10Z. --- Debugging aids for the problems reported most in this repo: black or missing surfaces, mosaic blocks from the shader clean-up passes (#310), long first-launch stalls, and refused pipelines. All are `diagnostics`-only except the slow-compile log line and the cache-key byte. Stacked on #617 (`scripts/bench.ps1`); the first two commits here are #617's. ## What each one is for | Switch / change | Answers | |---|---| | `VICTORY_DEBUG_NULL_VIEWS=1` | Is a black surface a missing texture? 2D texture slots that would read zeros read a checkerboard instead: **magenta** where the title made a view the host has no texture for (not uploaded, unmapped, refused), **cyan** where there is no view at all (unwritten, or past NVIDIA's 1,000,000-view cap). Black that stays black is the title's own: unlit or drawn black. | | `VICTORY_PIX=<dir>` | What did this draw read and write? Loads the newest installed PIX's `WinPixGpuCapturer.dll` before the host device. A file named `capture` put in the folder saves the next frame(s) as `frame-<n>.wpix`. PIX then shows each draw's DXIL, views, samplers and targets, plus pixel history. | | No pipeline library under PIX | Under PIX's capturer the runtime rejects the saved library ("created for a different version"), and PIX's own was then saved over it. In one run that replaced 426 MB with 848 bytes, and the next normal run made every pipeline again. Under `VICTORY_PIX` the library is neither opened nor saved. | | "slow driver compile of a host pipeline" log line | Why are the first minutes so slow? Every driver compile of 2 s or more is logged, naming the shaders. On an RTX 5060 Ti (driver 621.24), 24 pipelines took 2–128 s each (313 s in all) on the second launch, almost all `CS_RaytracingResolve` variants. The frame line showed only a "being made" count. | | `VICTORY_SHADER_OPT_STAGES=ps,ms,...` | Which stage's clean-up breaks? Limits `VICTORY_SHADER_OPT`'s module passes to the named stages; part of the shader cache key. Bisecting #310 in pixel shaders then doesn't remake every compute pipeline (see the line above). | | `scripts/bench.ps1 -PixAt <s>` | Takes one PIX capture that many seconds into the world, plus the same frame as a PNG. | | `scripts/bench.ps1 -Victory <exe>` | Runs another diagnostics build, so a run can go on while the tree rebuilds, or two builds can be compared. With `-Victory`, the summary names the build by file and time. | | bench summaries | Total and slowest driver compile time per run. | | `frame::tests::waits_end_on_ticks_and_count_frames` | The flip part of the test used a 5 ms interval. With a shader translation running beside `cargo test`, the flips came out 7 ticks apart (`[21, 28, 35, 42]`). At 50 ms it passes under 8 busy threads and a running title. | README documents the switches, including that `VICTORY_D3D12_DEBUG=1` needs Windows' Graphics Tools (`Add-WindowsCapability -Online -Name Tools.Graphics.DirectX~~~~0.0.1.0`). Without them, the debug layer quietly does nothing. ## Checked RTX 5060 Ti 16 GB, driver 621.24, Windows 11 26200, PIX 2611.19: - **`VICTORY_PIX`:** the capturer loaded, and `frame-4305.wpix` (2.1 GB) was written at the asked-for moment. The library-wipe guard was written after that run showed the problem. - **`VICTORY_DEBUG_NULL_VIEWS=1`:** the stand-in textures were made and used by the view paths (logged on first use). In the prologue cell, no magenta or cyan pixels reached the screen in any captured frame. So the black jumpsuit there is not a missing 2D texture; it is light or a dropped pass. - **Slow-compile line:** 24 to 380 lines per run, depending on cache state. - **`cargo clippy --workspace --all-targets --all-features -- -D warnings`:** clean. - **Without `--all-features`:** fails only on the pre-existing `placed_filler_twins` warning, as main does (#491 / #530). - **Tests:** `cargo test -p victory-gpu --lib` 113 passed; `-p victory-shader` 2 new tests (stage switch parsing) pass. `cargo xtask policy`: ok. Not checked: - PIX with a pipeline library on AMD. - The checkerboard on 1D/3D/cube slots. Those still read zeros by design: a stand-in of another dimension is a view mismatch. AI-assisted (Claude Code). Runs and checks done on the machine above.
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/687:upstream-pr/687'
git switch 'upstream-pr/687'

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/687'
git switch 'upstream-pr/687'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/687'
git switch 'upstream-pr/687'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/687'
git switch 'main'
git merge --squash 'upstream-pr/687'
git switch 'main'
git merge --ff-only 'upstream-pr/687'
git switch 'main'
git merge 'upstream-pr/687'
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
fxceless/victory-fork!687
No description provided.