Report per-shader failure reasons during translate --warm #436

Open
github-bot wants to merge 1 commit from github-bot/gh-436 into a-publier AGit
Owner

@⁠feanorsun on GitHub · 2026-11-27 01:25 UTC · original
feanorsun:fix/warm-report-failure-reasons → a-publier · +81 −17 · 1 files · 1 commits · open

Refs #291

In the Wine reproduction, the command returned an error when it could not create the shader cache directory. With an existing read-only directory, it completed the scan and reported 1 do not translate. The write error itself was missing from the warm-up output.

Keep the error string returned by each warm_shader call. The summary now says failed and prints each distinct reason once, with its count. Newly translated shaders and cache hits keep their separate counts. Individual failures still allow the command to finish the batch.

Windows CPU verification

cargo test --offline --locked -j 1 -p victory --bin victory translate::tests::warm_report -- --list
cargo test --offline --locked -j 1 -p victory --bin victory translate::tests::warm_report -- --test-threads=1 --nocapture

The filter listed and ran two tests. With the original counting and output logic, both output assertions failed. After the change, both passed, with 25 tests filtered out.

The mixed case supplies one new translation, one cache hit, two identical synthetic cache write errors and a distinct translation error. It checks the full summary and both reason lines. The success case checks that the summary has no extra lines. These tests exercise the reporting code used by warm() with synthetic results. They require no shaders, GPU, or changes to filesystem permissions.

**@⁠feanorsun** on GitHub · 2026-11-27 01:25 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/436) `feanorsun:fix/warm-report-failure-reasons` → `a-publier` · +81 −17 · 1 files · 1 commits · open Refs #291 In the [Wine reproduction](https://git.gtahub.st/github/Belobug--VIctory-Belobug-AMD/issues/291), the command returned an error when it could not create the shader cache directory. With an existing read-only directory, it completed the scan and reported `1 do not translate`. The write error itself was missing from the warm-up output. Keep the error string returned by each `warm_shader` call. The summary now says `failed` and prints each distinct reason once, with its count. Newly translated shaders and cache hits keep their separate counts. Individual failures still allow the command to finish the batch. ## Windows CPU verification ```powershell cargo test --offline --locked -j 1 -p victory --bin victory translate::tests::warm_report -- --list cargo test --offline --locked -j 1 -p victory --bin victory translate::tests::warm_report -- --test-threads=1 --nocapture ``` The filter listed and ran two tests. With the original counting and output logic, both output assertions failed. After the change, both passed, with 25 tests filtered out. The mixed case supplies one new translation, one cache hit, two identical synthetic cache write errors and a distinct translation error. It checks the full summary and both reason lines. The success case checks that the summary has no extra lines. These tests exercise the reporting code used by `warm()` with synthetic results. They require no shaders, GPU, or changes to filesystem permissions.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:33:33 +00:00
Author
Owner

@⁠lvndrpup on GitHub · 2026-11-27 04:41 UTC · original · reviewed

Checked on Windows 11 build 26300, Rust 1.98.1, RTX 3060 Ti (driver 610.88), debug, with victory built at 4eb6cfd and at 08c405e. No game files here, so the containers fed to it are the 328 PC DXBC shaders in copies of Windows' own d2d1.dll and d3d11.dll; they all fail to translate, which is the path this PR changes.

4eb6cfd this PR
victory translate --warm all --jobs 4 <folder> 328 found: 0 translated now, 0 in the cache already, 328 do not translate, no reason 328 found: 0 translated now, 0 in the cache already, 328 failed then 328 converter shader.dxil v1: malformed shader: no DXIL part
cargo test -p victory --bin victory translate::tests 4 passed, both new warm_report_* among them
cargo clippy -p victory --no-deps --all-targets -- -D warnings, with and without --all-features clean

One thing to look at: the reasons are grouped by the whole error string, and ShaderError::Unsupported and ShaderError::Isa print GFX10 code at {offset:#x}: .... Plain translate drops the offset before grouping (translate.rs around 599-656 at 4eb6cfd, format!("emit: {what}") and the like), so its tally stays short. Here, a title with many shaders failing on the same unsupported instruction would get one line per shader, each with a count of 1. Not something I can show without the title's shaders; stripping the at 0x... part, or capping the list, would keep the summary readable.

Not tested: a cache write error (the case from #291). These shaders fail before anything is written, and I have no shader that translates.

**@⁠lvndrpup** on GitHub · 2026-11-27 04:41 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/436#pullrequestreview-6083570791) · **reviewed** Checked on Windows 11 build 26300, Rust 1.98.1, RTX 3060 Ti (driver 610.88), debug, with `victory` built at `4eb6cfd` and at `08c405e`. No game files here, so the containers fed to it are the 328 PC DXBC shaders in copies of Windows' own `d2d1.dll` and `d3d11.dll`; they all fail to translate, which is the path this PR changes. | | `4eb6cfd` | this PR | |---|---|---| | `victory translate --warm all --jobs 4 <folder>` | `328 found: 0 translated now, 0 in the cache already, 328 do not translate`, no reason | `328 found: 0 translated now, 0 in the cache already, 328 failed` then ` 328 converter shader.dxil v1: malformed shader: no DXIL part` | | `cargo test -p victory --bin victory translate::tests` | | 4 passed, both new `warm_report_*` among them | | `cargo clippy -p victory --no-deps --all-targets -- -D warnings`, with and without `--all-features` | | clean | One thing to look at: the reasons are grouped by the whole error string, and `ShaderError::Unsupported` and `ShaderError::Isa` print `GFX10 code at {offset:#x}: ...`. Plain `translate` drops the offset before grouping (`translate.rs` around 599-656 at `4eb6cfd`, `format!("emit: {what}")` and the like), so its tally stays short. Here, a title with many shaders failing on the same unsupported instruction would get one line per shader, each with a count of 1. Not something I can show without the title's shaders; stripping the `at 0x...` part, or capping the list, would keep the summary readable. Not tested: a cache write error (the case from #291). These shaders fail before anything is written, and I have no shader that translates.
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/436/head:github-bot/gh-436'
git switch 'github-bot/gh-436'

Merge

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