victory translate --hashes and translate-diff: compare two builds' emitted DXIL program by program #816

Open
JRamos1993 wants to merge 1 commit from upstream-pr/817 into main
JRamos1993 commented 2026-11-25 08:40:20 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by JRamos1993 on 2026-11-25T08:40:20Z.


Why

victory translate --validate reports how many programs validate, not which ones change. A PR can keep that count and still change the code of thousands of programs, or gain some and lose others.

I compared PRs this way tonight with a local patch, and it caught things the count alone hides:

This PR makes that check part of the tool, so anyone with the pack can run it.

What

  • victory translate --hashes (implies --list): each emitted program's line names dxil= and 16 hex digits of the BLAKE3 of its DXIL container, taken before the validator signs it.

    • Without --validate or --pipelines, an emitted program gets an emitted line to carry the hash.
    • Lines still end in their outcome ( validated, pipeline created, a reason), so existing greps keep working.
  • victory translate-diff <old list> <new list> [--keys]: compares two such lists by program (container hash and stage). It prints:

    • gained: programs the new list validates and the old does not, grouped by the old list's reason, with numbers left out so one kind of stop is one group;
    • lost: the reverse, grouped by the new list's reason;
    • DXIL changed: programs both validate whose hashes differ, when both lists were made with --hashes.

    --keys names the programs under each group. It reads only the two text files, so no GPU or pack is needed for the diff itself.

  • README: the two commands in the command list.

Example: main 9376fd6 against main with #699 merged. Both lists come from translate --validate --hashes over the retail pack; the output has no title data without --keys.

old          25889 programs, 25420 validated
new          25889 programs, 25562 validated
gained       (validated in the new list only; the old list's reason) 142
       39  validator: error: Container part 'Program Output Signature' does not match expected for module.
       39  validator: error: signature element TEXCOORD at location (#,#) size (#,#) has interpolation mode that differs …
       33  validator: error: Container part 'Program Input Signature' does not match expected for module.
       14  validator: error: signature element NORMAL at location (#,#) size (#,#) has interpolation mode that differs …
       11  validator: error: signature element SV_IsFrontFace at location (#,#) size (#,#) has interpolation mode …
        6  validator: error: signature element COLOR at location (#,#) size (#,#) has interpolation mode that differs …
lost         (validated in the old list only; the new list's reason) 0
DXIL changed 0 of the 25420 programs both validate (both lists with --hashes)

Tested

RTX 5090, Windows 11, main 9376fd6.

  • Deterministic: two translate --validate --hashes runs of this branch over the retail pack, then translate-diff: 0 gained, 0 lost, 0 of 25,420 changed.
  • Sensitive: the same hashes from 2119b0e against 310c6eb (with my local equivalent) differed for 8,514 programs.
  • The example above: this branch with #699 merged.
  • Unit tests: 4 new tests in translate_diff.
    • List lines: with and without a hash, a stop with an address, a validator message that has double spaces in it, summaries and duplicates.
    • Gains and losses grouped by reason; reasons that differ only in numbers forming one group; changed DXIL; nothing compared when a list has no hashes.
    • cargo test -p victory --locked: 5 passed, 0 failed.
  • Clippy: cargo clippy -p victory --all-targets --locked, with and without --all-features, gives no warnings in apps/victory.
    • With -D warnings, clippy stops earlier in victory-gpu on main itself (placed_filler_twins unused, sort_unstable_by_key in draw.rs, depth_written never read), files this PR does not touch.

Not tested

  • Lists made by an older victory (no dxil=): they compare for gains and losses, and the DXIL part says it needs --hashes.
  • Programs that appear twice with the same container hash and stage: the first line counts.

AI use

Claude Code with Claude Opus 5.5 wrote the change and the tests, ran the pack and wrote this description. The tests use synthetic list lines; nothing from the title is in the PR.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6600543817 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/817). Originally posted by [JRamos1993](https://github.com/JRamos1993) on 2026-11-25T08:40:20Z. --- ## Why `victory translate --validate` reports how many programs validate, not which ones change. A PR can keep that count and still change the code of thousands of programs, or gain some and lose others. I compared PRs this way tonight with a local patch, and it caught things the count alone hides: - **#713 loses 1,289 programs** that validate on `main`: https://github.com/fxceless/victory-fork/pull/713#issuecomment-7154258324 - **#716 changes the DXIL of 17,346 programs** without gaining or losing any: https://github.com/fxceless/victory-fork/pull/716#issuecomment-7154829891 - **#215's 59 changed programs** turned out to be only re-encoded: https://github.com/fxceless/victory-fork/pull/215#issuecomment-7154637608 - **#722's 22 programs are a subset of #699's 142**: https://github.com/fxceless/victory-fork/pull/699#issuecomment-7154258676 This PR makes that check part of the tool, so anyone with the pack can run it. ## What - **`victory translate --hashes`** (implies `--list`): each emitted program's line names `dxil=` and 16 hex digits of the BLAKE3 of its DXIL container, taken before the validator signs it. - Without `--validate` or `--pipelines`, an emitted program gets an `emitted` line to carry the hash. - Lines still end in their outcome (` validated`, ` pipeline created`, a reason), so existing greps keep working. - **`victory translate-diff <old list> <new list> [--keys]`**: compares two such lists by program (container hash and stage). It prints: - **gained:** programs the new list validates and the old does not, grouped by the old list's reason, with numbers left out so one kind of stop is one group; - **lost:** the reverse, grouped by the new list's reason; - **DXIL changed:** programs both validate whose hashes differ, when both lists were made with `--hashes`. `--keys` names the programs under each group. It reads only the two text files, so no GPU or pack is needed for the diff itself. - **README:** the two commands in the command list. **Example:** `main` `9376fd6` against `main` with #699 merged. Both lists come from `translate --validate --hashes` over the retail pack; the output has no title data without `--keys`. ``` old 25889 programs, 25420 validated new 25889 programs, 25562 validated gained (validated in the new list only; the old list's reason) 142 39 validator: error: Container part 'Program Output Signature' does not match expected for module. 39 validator: error: signature element TEXCOORD at location (#,#) size (#,#) has interpolation mode that differs … 33 validator: error: Container part 'Program Input Signature' does not match expected for module. 14 validator: error: signature element NORMAL at location (#,#) size (#,#) has interpolation mode that differs … 11 validator: error: signature element SV_IsFrontFace at location (#,#) size (#,#) has interpolation mode … 6 validator: error: signature element COLOR at location (#,#) size (#,#) has interpolation mode that differs … lost (validated in the old list only; the new list's reason) 0 DXIL changed 0 of the 25420 programs both validate (both lists with --hashes) ``` ## Tested RTX 5090, Windows 11, `main` `9376fd6`. - **Deterministic:** two `translate --validate --hashes` runs of this branch over the retail pack, then `translate-diff`: 0 gained, 0 lost, 0 of 25,420 changed. - **Sensitive:** the same hashes from `2119b0e` against `310c6eb` (with my local equivalent) differed for 8,514 programs. - **The example above:** this branch with #699 merged. - **Unit tests:** 4 new tests in `translate_diff`. - List lines: with and without a hash, a stop with an address, a validator message that has double spaces in it, summaries and duplicates. - Gains and losses grouped by reason; reasons that differ only in numbers forming one group; changed DXIL; nothing compared when a list has no hashes. - `cargo test -p victory --locked`: 5 passed, 0 failed. - **Clippy:** `cargo clippy -p victory --all-targets --locked`, with and without `--all-features`, gives no warnings in `apps/victory`. - With `-D warnings`, clippy stops earlier in `victory-gpu` on `main` itself (`placed_filler_twins` unused, `sort_unstable_by_key` in `draw.rs`, `depth_written` never read), files this PR does not touch. ## Not tested - Lists made by an older `victory` (no `dxil=`): they compare for gains and losses, and the DXIL part says it needs `--hashes`. - Programs that appear twice with the same container hash and stage: the first line counts. ## AI use Claude Code with Claude Opus 5.5 wrote the change and the tests, ran the pack and wrote this description. The tests use synthetic list lines; nothing from the title is in the PR.
MamaLeVrai commented 2026-11-25 11:10:34 +00:00 (Migrated from github.com)

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


Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present. I merged this PR's head eb721c4 into main 9376fd6 in a throwaway tree (no conflict). cargo clippy --workspace --all-targets --locked -- -D warnings fails with exactly the errors main itself has on this machine (placed_filler_twins never used, depth_written never read, in victory-gpu); with --all-features it fails with the same number of errors as main (4). This PR adds none and removes none. cargo test --workspace --locked: 544 passed, 0 failed, 10 ignored, two runs (main alone: 540 passed, 0 failed, 10 ignored). The title was not run, so this says nothing about in-game effect. No game data.

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

<!-- greyfinch-sync:fxceless/victory-fork:comment:7159388543 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/817#issuecomment-7159388543). Originally posted by [MamaLeVrai](https://github.com/MamaLeVrai) on 2026-11-25T10:12:55Z. --- Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present. I merged this PR's head `eb721c4` into `main` `9376fd6` in a throwaway tree (no conflict). `cargo clippy --workspace --all-targets --locked -- -D warnings` fails with exactly the errors `main` itself has on this machine (`placed_filler_twins` never used, `depth_written` never read, in `victory-gpu`); with `--all-features` it fails with the same number of errors as `main` (4). This PR adds none and removes none. `cargo test --workspace --locked`: 544 passed, 0 failed, 10 ignored, two runs (`main` alone: 540 passed, 0 failed, 10 ignored). The title was not run, so this says nothing about in-game effect. 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/817:upstream-pr/817'
git switch 'upstream-pr/817'

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