Translate, shader-info: shaders are not saved into a source tree #2799

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

@⁠iBooM72 on GitHub · 2026-11-29 17:27 UTC · original
iBooM72:fix/shader-dump-policy → main · +70 −1 · 3 files · 1 commits · open

What it changes

Shaders saved by the tools come from the game, so rule #1 keeps them out of the repository. victory translate checked the folder for VICTORY_EMIT_DUMP with ensure_outside_repo, but three similar settings weren't checked:

Setting Command Before After
VICTORY_DUMP_MATCH translate saved the shader in a source tree refused
VICTORY_SHADER_SAVE shader-info saved the shader in a source tree refused
VICTORY_FAIL_DUMP translate not refused refused

Each folder is now checked before the command starts, as for VICTORY_EMIT_DUMP. A setting that names a folder inside a source tree stops the command even if nothing would have been saved. Other folders still work. There are no new dependencies, Cargo.lock doesn't change, and no shader cache needs rebuilding.

Not covered: settings used while the game runs. victory-gpu and victory-hle don't call this check themselves. Some of their settings also save game data: VICTORY_SHADER_SAVE during a run, VICTORY_DUMP_PSO and VICTORY_DESERIALIZE_DUMP, plus VICTORY_CAPTURE, VICTORY_RECORD, VICTORY_XMA_DUMP and VICTORY_AUDIO_CAPTURE in diagnostics builds. I found these by reading the code, haven't tested them, and may have missed others. Making victory-core a direct dependency of victory-gpu would change Cargo.lock, and so rebuild everyone's shader cache. #4985 (d5cc3461) adds that dependency, but VICTORY_RECORD is the only setting listed here that it checks. How would you like the rest to be handled?

How it was tested

  • GPU and profile: not applicable (offline tools). No game was run and no game data was used. Windows 11.
  • The new test runs both commands on a made-up 48-byte container. The source tree is a temporary folder with a .victory-root file. It also checks that folders outside a source tree are still allowed.
  • Before: the test failed. Run separately, VICTORY_DUMP_MATCH and VICTORY_SHADER_SAVE each saved the made-up shader in the marked folder. VICTORY_FAIL_DUMP wasn't refused either, but this container doesn't get far enough to be saved, so I haven't shown it saving a file.
  • After: the test passes. It fails if any one of the three checks is removed.
  • For shader changes, the wave sizes tested: not a shader change.
  • cargo test passed for the crates it touches: yes. cargo test --locked -p victory: 82 passed.
  • cargo xtask policy --staged passed. cargo clippy -p victory --all-targets --locked (without -D warnings) reports nothing in the app.
  • The three CI commands (tests with --no-fail-fast) fail here and on unmodified 829188e9. There are no new clippy errors, but both clippy commands stop before they reach this app. 6 tests failed here. 5 also failed in the full run on 829188e9. The other, host_list_uav_pool_lifecycle_retire_trim_and_info_queue, failed in 4 of 6 repeat runs there. This branch is still based on 829188e9. It merges cleanly with main at 5fabb46e, which still doesn't have these three checks. I haven't rerun the tests on that version.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related:
    • #2785 (50eb65ec) adds one of these checks. It was opened about 10 minutes before this PR, and I missed it. It makes the same VICTORY_SHADER_SAVE check in shader-info, plus other fixes to that command, but doesn't have the two translate checks. The two PRs conflict in shader.rs. If #2785 is merged first, I'll update this PR and remove its copy of that check.
    • #4984 adds a similar check for VICTORY_RECORD while the game runs (see "Not covered" above). The two merge cleanly.
    • 14 other open PRs change translate.rs, and #3458 also changes shader.rs. None of their changes to these two files or the app's tests mention these settings or ensure_outside_repo. This merges cleanly with #2289, #3063, #3458, #3687, #4233 and #4507. The others already conflict with main: #730, #1630, #1811, #2801, #2993, #3336, #3499 and #3852.

🤖 Generated with Claude Code

**@⁠iBooM72** on GitHub · 2026-11-29 17:27 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2799) `iBooM72:fix/shader-dump-policy` → `main` · +70 −1 · 3 files · 1 commits · open ## What it changes Shaders saved by the tools come from the game, so rule #1 keeps them out of the repository. `victory translate` checked the folder for `VICTORY_EMIT_DUMP` with `ensure_outside_repo`, but three similar settings weren't checked: | Setting | Command | Before | After | |---|---|---|---| | `VICTORY_DUMP_MATCH` | `translate` | saved the shader in a source tree | refused | | `VICTORY_SHADER_SAVE` | `shader-info` | saved the shader in a source tree | refused | | `VICTORY_FAIL_DUMP` | `translate` | not refused | refused | Each folder is now checked before the command starts, as for `VICTORY_EMIT_DUMP`. A setting that names a folder inside a source tree stops the command even if nothing would have been saved. Other folders still work. There are no new dependencies, `Cargo.lock` doesn't change, and no shader cache needs rebuilding. **Not covered:** settings used while the game runs. `victory-gpu` and `victory-hle` don't call this check themselves. Some of their settings also save game data: `VICTORY_SHADER_SAVE` during a run, `VICTORY_DUMP_PSO` and `VICTORY_DESERIALIZE_DUMP`, plus `VICTORY_CAPTURE`, `VICTORY_RECORD`, `VICTORY_XMA_DUMP` and `VICTORY_AUDIO_CAPTURE` in diagnostics builds. I found these by reading the code, haven't tested them, and may have missed others. Making `victory-core` a direct dependency of `victory-gpu` would change `Cargo.lock`, and so rebuild everyone's shader cache. #4985 (`d5cc3461`) adds that dependency, but `VICTORY_RECORD` is the only setting listed here that it checks. How would you like the rest to be handled? ## How it was tested - GPU and profile: not applicable (offline tools). **No game was run and no game data was used.** Windows 11. - The new test runs both commands on a made-up 48-byte container. The source tree is a temporary folder with a `.victory-root` file. It also checks that folders outside a source tree are still allowed. - Before: the test failed. Run separately, `VICTORY_DUMP_MATCH` and `VICTORY_SHADER_SAVE` each saved the made-up shader in the marked folder. `VICTORY_FAIL_DUMP` wasn't refused either, but this container doesn't get far enough to be saved, so I haven't shown it saving a file. - After: the test passes. It fails if any one of the three checks is removed. - For shader changes, the wave sizes tested: not a shader change. - `cargo test` passed for the crates it touches: yes. `cargo test --locked -p victory`: 82 passed. - `cargo xtask policy --staged` passed. `cargo clippy -p victory --all-targets --locked` (without `-D warnings`) reports nothing in the app. - The three CI commands (tests with `--no-fail-fast`) fail here and on unmodified `829188e9`. There are no new clippy errors, but both clippy commands stop before they reach this app. 6 tests failed here. 5 also failed in the full run on `829188e9`. The other, `host_list_uav_pool_lifecycle_retire_trim_and_info_queue`, failed in 4 of 6 repeat runs there. This branch is still based on `829188e9`. It merges cleanly with `main` at `5fabb46e`, which still doesn't have these three checks. I haven't rerun the tests on that version. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: - **#2785 (`50eb65ec`) adds one of these checks.** It was opened about 10 minutes before this PR, and I missed it. It makes the same `VICTORY_SHADER_SAVE` check in `shader-info`, plus other fixes to that command, but doesn't have the two `translate` checks. The two PRs conflict in `shader.rs`. If #2785 is merged first, I'll update this PR and remove its copy of that check. - **#4984** adds a similar check for `VICTORY_RECORD` while the game runs (see "Not covered" above). The two merge cleanly. - **14 other open PRs change `translate.rs`**, and #3458 also changes `shader.rs`. None of their changes to these two files or the app's tests mention these settings or `ensure_outside_repo`. This merges cleanly with #2289, #3063, #3458, #3687, #4233 and #4507. The others already conflict with `main`: #730, #1630, #1811, #2801, #2993, #3336, #3499 and #3852. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Saved shaders are game-derived, and rule #1 keeps them out of the
repository. `translate` checked VICTORY_EMIT_DUMP's folder, but not
those of VICTORY_FAIL_DUMP and VICTORY_DUMP_MATCH, and `shader-info`
did not check VICTORY_SHADER_SAVE's. Each is now refused before any
work, as VICTORY_EMIT_DUMP's is.

The test runs both commands on a made-up container, with a temporary
folder that has the source tree's marker.

The switches victory-gpu and victory-hle read in a run are not changed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 17:33:22 +00:00
Author
Owner

@⁠iBooM72 on GitHub · 2026-12-01 18:02 UTC · original

I've updated this PR's description. The code hasn't changed.

  • @⁠LgscobraPT, about #2785: it was opened about 10 minutes before this PR, and I missed it. It makes the same VICTORY_SHADER_SAVE check in shader-info, plus other fixes to that command, but doesn't have the two translate checks. The two PRs conflict in shader.rs. If #2785 is merged first, I'll update this PR and remove its copy of that check.
  • @⁠TheDarkDnKTv, about #4985: it makes victory-gpu depend on victory-core, the Cargo.lock change I ask about here. Of the settings listed under "Not covered", it only checks VICTORY_RECORD. The two PRs merge cleanly.
  • @⁠trustno1-coder: the question about how to handle the rest of those settings is still open.

I also updated the other related PRs and the notes on main. This PR merges cleanly with main at 5fabb46e, but I haven't rerun the tests on that version.

These checks and this comment were prepared with an AI assistant (Claude Code).

**@⁠iBooM72** on GitHub · 2026-12-01 18:02 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2799#issuecomment-7320288549) I've updated this PR's description. The code hasn't changed. - **@⁠LgscobraPT, about #2785:** it was opened about 10 minutes before this PR, and I missed it. It makes the same `VICTORY_SHADER_SAVE` check in `shader-info`, plus other fixes to that command, but doesn't have the two `translate` checks. The two PRs conflict in `shader.rs`. If #2785 is merged first, I'll update this PR and remove its copy of that check. - **@⁠TheDarkDnKTv, about #4985:** it makes `victory-gpu` depend on `victory-core`, the `Cargo.lock` change I ask about here. Of the settings listed under "Not covered", it only checks `VICTORY_RECORD`. The two PRs merge cleanly. - **@⁠trustno1-coder:** the question about how to handle the rest of those settings is still open. I also updated the other related PRs and the notes on `main`. This PR merges cleanly with `main` at `5fabb46e`, but I haven't rerun the tests on that version. *These checks and this comment were prepared with an AI assistant (Claude Code).*
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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/2799/head:github-bot/gh-2799'
git switch 'github-bot/gh-2799'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2799'
git switch 'github-bot/gh-2799'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2799'
git switch 'github-bot/gh-2799'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2799'
git switch 'main'
git merge --squash 'github-bot/gh-2799'
git switch 'main'
git merge --ff-only 'github-bot/gh-2799'
git switch 'main'
git merge 'github-bot/gh-2799'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!2799
No description provided.