Diagnostics: VICTORY_DUMP_REFUSED saves refused shaders' containers; an ignored test replays one compute pipeline #266

Open
icecreammule277-dot wants to merge 1 commit from upstream-pr/266 into main
icecreammule277-dot commented 2026-11-24 23:04:19 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by icecreammule277-dot on 2026-11-24T23:04:19Z.


Diagnostics, no change to rendering.

What

  • VICTORY_DUMP_REFUSED=<folder>: while building host pipelines, each refused shader's console container is written to <folder>/<hash>.<stage>.bin, so its translation can be replayed offline.
  • Shader::container() and a pub(crate) shader_cache::decode, so a replay can reach either a cache entry or a console container.
  • An ignored test, pipeline::host::tests::replay_compute_pipeline (VICTORY_REPLAY_FILE): builds the runtime's root signature and calls CreateComputePipelineState for one shader, in a process of its own. Knobs for narrowing a host compiler crash: VICTORY_REPLAY_NO_CMP=1 (comparison samplers as plain ones), VICTORY_REPLAY_SAMPLER_ORDER=rev (reverse the static samplers' registers), VICTORY_REPLAY_SAME_SAMPLER=n (every static sampler a copy of sampler n).

How it was used

This is how the AMD compiler crash behind #195 was found offline, with nothing running: dump the refused containers, then replay one per process. One container per process isolates an amdxc64.dll crash to a single program.

With it: of 113 refused compute programs, 9 crash with every shader-opt pass; the REUSE clean-up pass (bit 4 of VICTORY_SHADER_OPT) alone reproduces all 9, and every pass except REUSE builds all 183. #195 turns the REUSE pass off for compute.

Testing

cargo build and cargo test -p victory-gpu --lib compile.

🤖 Generated with Claude Code

<!-- greyfinch-sync:fxceless/victory-fork:issue:6593187868 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/266). Originally posted by [icecreammule277-dot](https://github.com/icecreammule277-dot) on 2026-11-24T23:04:19Z. --- Diagnostics, no change to rendering. ## What - **`VICTORY_DUMP_REFUSED=<folder>`**: while building host pipelines, each refused shader's console container is written to `<folder>/<hash>.<stage>.bin`, so its translation can be replayed offline. - `Shader::container()` and a `pub(crate)` `shader_cache::decode`, so a replay can reach either a cache entry or a console container. - An ignored test, `pipeline::host::tests::replay_compute_pipeline` (`VICTORY_REPLAY_FILE`): builds the runtime's root signature and calls `CreateComputePipelineState` for one shader, in a process of its own. Knobs for narrowing a host compiler crash: `VICTORY_REPLAY_NO_CMP=1` (comparison samplers as plain ones), `VICTORY_REPLAY_SAMPLER_ORDER=rev` (reverse the static samplers' registers), `VICTORY_REPLAY_SAME_SAMPLER=n` (every static sampler a copy of sampler `n`). ## How it was used This is how the AMD compiler crash behind #195 was found **offline, with nothing running**: dump the refused containers, then replay one per process. One container per process isolates an `amdxc64.dll` crash to a single program. With it: of 113 refused compute programs, 9 crash with every shader-opt pass; the REUSE clean-up pass (bit 4 of `VICTORY_SHADER_OPT`) alone reproduces all 9, and every pass except REUSE builds all 183. #195 turns the REUSE pass off for compute. ## Testing `cargo build` and `cargo test -p victory-gpu --lib` compile. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ericomeehan commented 2026-11-25 00:10:07 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by ericomeehan on 2026-11-24T23:25:04Z.


Replaying one pipeline per process is what pinned the REUSE crash in #195, so having this test in the tree is very useful.

One gap on current main: the dump sits in refuse(), but a pipeline the driver or its compiler refuses goes through the Err(e) arms in HostPipeline::new ("host pipeline refused" for compute and graphics, "host mesh pipeline refused", and "host root signature refused"), which log and return None without calling refuse(). So VICTORY_DUMP_REFUSED writes nothing for exactly the refusals the description mentions. Moving the dump into a small helper called from those arms (and perhaps where translated() fails) would cover them.

Two small things: container() landed between translated() and its doc comment, so translated() now carries two doc lines and container() the wrong one; and a README line reminding people not to attach the dumped containers to issues (they are the title's data, see docs/asset-policy.md) would help.

Written with an AI assistant (Claude).

<!-- greyfinch-sync:fxceless/victory-fork:comment:7147375283 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/266#issuecomment-7147375283). Originally posted by [ericomeehan](https://github.com/ericomeehan) on 2026-11-24T23:25:04Z. --- Replaying one pipeline per process is what pinned the REUSE crash in #195, so having this test in the tree is very useful. One gap on current main: the dump sits in `refuse()`, but a pipeline the driver or its compiler refuses goes through the `Err(e)` arms in `HostPipeline::new` ("host pipeline refused" for compute and graphics, "host mesh pipeline refused", and "host root signature refused"), which log and return `None` without calling `refuse()`. So `VICTORY_DUMP_REFUSED` writes nothing for exactly the refusals the description mentions. Moving the dump into a small helper called from those arms (and perhaps where `translated()` fails) would cover them. Two small things: `container()` landed between `translated()` and its doc comment, so `translated()` now carries two doc lines and `container()` the wrong one; and a README line reminding people not to attach the dumped containers to issues (they are the title's data, see `docs/asset-policy.md`) would help. Written with an AI assistant (Claude).
MamaLeVrai commented 2026-11-25 11:10:42 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by MamaLeVrai on 2026-11-25T10:59:28Z.


Test report: this PR's head no longer merges into main f85101b (RX 6950 XT machine; a trial merge): conflict in crates/victory-gpu/src/pipeline/host.rs. I did not resolve it. No game data.

AI-assisted (Claude Code); no game data.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7160440687 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/266#issuecomment-7160440687). Originally posted by [MamaLeVrai](https://github.com/MamaLeVrai) on 2026-11-25T10:59:28Z. --- Test report: this PR's head no longer merges into `main` `f85101b` (RX 6950 XT machine; a trial merge): conflict in `crates/victory-gpu/src/pipeline/host.rs`. I did not resolve it. No game data. AI-assisted (Claude Code); no game data.
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/266:upstream-pr/266'
git switch 'upstream-pr/266'

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