CLI: list-diff compares two translate listings program by program #1541

Open
github-bot wants to merge 2 commits from github-bot/gh-1541 into main AGit
Owner

@⁠sinan-cmyk on GitHub · 2026-11-24 18:58 UTC · original
sinan-cmyk:cli-list-diff → main · +339 −0 · 3 files · 2 commits · open

Summary: victory list-diff <before> <after> [--top N] compares two translate --validate --list outputs program by program. The report names no program, so it can be posted as it is.

Why

Measuring a shader change on a dump means running translate --validate --list before and after the change and comparing the two listings. #1247 and its follow-ups do this for hundreds of PRs, and every person who measures writes their own comparison script. This adds one comparison to the CLI that everyone can share.

What it prints

  • programs in both listings, and the programs found in only one
  • programs validated before and after, with the net change
  • programs gained and lost, grouped by the failure reason they had in the other listing
  • programs that fail in both listings for a different reason, as (before → after) pairs, the first --top pairs (default 20)

The report has counts and failure reasons only, and never prints a program's label (labels carry the title's shader names). So the output can go into an issue or a PR under docs/asset-policy.md.

How a listing line is read

  • A program's label is the text before the first double space. The trailing at 0x… offset of the failing instruction is removed from the label. Otherwise a fix that moves a failure to a later instruction would look like a new program.
  • A program that fails in several passes (for example resources and I/O) has several lines. They are one outcome with all its reasons.
  • Header, summary, pair … lines and a leading BOM are skipped. A UTF-8 BOM appears when the listing is redirected from Windows PowerShell 5.1.

Checks

  • cargo test -p victory --bins listdiff: 5 synthetic tests, no game data. They cover label splitting, the skipped lines, several failures of one program, gained, lost and moved, and the report naming no program.
  • cargo clippy -p victory --all-targets: clean.
  • rustfmt --check on the changed files: clean. cargo xtask policy --staged passed in the pre-commit hook.
  • On a retail dump (1.0.2.1), the output agrees with my own script, program by program. #1402 against main: +1,688 gained, 0 lost, 916 programs with a changed reason. #1492 against #1402: 31 lost, as posted on #1492.

AI-assisted (Claude Code).

**@⁠sinan-cmyk** on GitHub · 2026-11-24 18:58 UTC · [original](https://github.com/Marvisak/VIctory/pull/1541) `sinan-cmyk:cli-list-diff` → `main` · +339 −0 · 3 files · 2 commits · open **Summary:** `victory list-diff <before> <after> [--top N]` compares two `translate --validate --list` outputs program by program. The report names no program, so it can be posted as it is. ## Why Measuring a shader change on a dump means running `translate --validate --list` before and after the change and comparing the two listings. #1247 and its follow-ups do this for hundreds of PRs, and every person who measures writes their own comparison script. This adds one comparison to the CLI that everyone can share. ## What it prints - programs in both listings, and the programs found in only one - programs validated before and after, with the net change - programs gained and lost, grouped by the failure reason they had in the other listing - programs that fail in both listings for a different reason, as (before → after) pairs, the first `--top` pairs (default 20) The report has counts and failure reasons only, and never prints a program's label (labels carry the title's shader names). So the output can go into an issue or a PR under `docs/asset-policy.md`. ## How a listing line is read - A program's label is the text before the first double space. The trailing ` at 0x…` offset of the failing instruction is removed from the label. Otherwise a fix that moves a failure to a later instruction would look like a new program. - A program that fails in several passes (for example resources and I/O) has several lines. They are one outcome with all its reasons. - Header, summary, `pair …` lines and a leading BOM are skipped. A UTF-8 BOM appears when the listing is redirected from Windows PowerShell 5.1. ## Checks - `cargo test -p victory --bins listdiff`: 5 synthetic tests, no game data. They cover label splitting, the skipped lines, several failures of one program, gained, lost and moved, and the report naming no program. - `cargo clippy -p victory --all-targets`: clean. - `rustfmt --check` on the changed files: clean. `cargo xtask policy --staged` passed in the pre-commit hook. - On a retail dump (1.0.2.1), the output agrees with my own script, program by program. #1402 against `main`: +1,688 gained, 0 lost, 916 programs with a changed reason. #1492 against #1402: 31 lost, as posted on #1492. AI-assisted (Claude Code).
Measuring a shader change on real data means running translate --validate
--list before and after it and comparing the listings; everyone doing so
writes their own script. list-diff prints programs validated before and
after, the programs gained and lost by failure reason, and the programs
that fail in both for a different reason. A program's several failure
lines are one outcome, and the offset of the failing instruction is not
part of its label, so a fix that moves a failure is not a new program.
The report names no program, so it can be posted under the asset policy.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:35:40 +00:00
Author
Owner

@⁠sinan-cmyk on GitHub · 2026-11-24 19:28 UTC · original

Thanks for the review. On your two points:

  1. The parsing and grouping are covered by unit tests in listdiff.rs, and they need no GPU. Programs found in only one listing are counted, not dropped. A failure whose instruction offset moves is the same program. A program with several failure lines is one outcome. A program that fails in both listings for another reason is listed as moved. 8584546 adds a test for a listing without program lines (made without --list): list-diff refuses it with an error instead of reporting zeros.
  2. With --top larger than the number of reason pairs, all pairs are printed and the "... more pairs" note is left out. The same commit adds a test for this.

6 tests pass, clippy is clean. AI-assisted (Claude Code).

**@⁠sinan-cmyk** on GitHub · 2026-11-24 19:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/1541#issuecomment-7142147479) Thanks for the review. On your two points: 1. The parsing and grouping are covered by unit tests in `listdiff.rs`, and they need no GPU. Programs found in only one listing are counted, not dropped. A failure whose instruction offset moves is the same program. A program with several failure lines is one outcome. A program that fails in both listings for another reason is listed as moved. 8584546 adds a test for a listing without program lines (made without `--list`): `list-diff` refuses it with an error instead of reporting zeros. 2. With `--top` larger than the number of reason pairs, all pairs are printed and the "... more pairs" note is left out. The same commit adds a test for this. 6 tests pass, clippy is clean. AI-assisted (Claude Code).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:30 UTC · original · edited 2026-11-25 22:26 UTC

Automated triage for the maintainers.

Needs rebase. This PR no longer merges cleanly into main: main has moved since the last triage, and the branch now conflicts in README.md and apps/victory/src/main.rs. It will be reviewed again once it is rebased onto current main.

Previous verdict for this head: merge candidate.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/1541#issuecomment-7149622356) · edited 2026-11-25 22:26 UTC <!-- victory-triage v1 head=1924cc4622b69f8215491525c5cb55580a0f3658 verdict=needs-rebase at=2026-11-25T22:29:00Z --> Automated triage for the maintainers. **Needs rebase.** This PR no longer merges cleanly into `main`: `main` has moved since the last triage, and the branch now conflicts in `README.md` and `apps/victory/src/main.rs`. It will be reviewed again once it is rebased onto current `main`. Previous verdict for this head: merge candidate. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠sinan-cmyk on GitHub · 2026-11-25 01:53 UTC · original

Rebased onto the current main (940d32f). There were two one-line conflicts: main added mod prebuild; and the translate --cache line in the README at the same places where this PR adds its own line. I kept both. The listing format that list-diff reads is unchanged on main ({label} {outcome} per program). On the rebased head: 6 tests pass, clippy is clean, rustfmt is clean on the changed files.

AI-assisted (Claude Code).

**@⁠sinan-cmyk** on GitHub · 2026-11-25 01:53 UTC · [original](https://github.com/Marvisak/VIctory/pull/1541#issuecomment-7150086825) Rebased onto the current `main` (940d32f). There were two one-line conflicts: `main` added `mod prebuild;` and the `translate --cache` line in the README at the same places where this PR adds its own line. I kept both. The listing format that `list-diff` reads is unchanged on `main` (`{label} {outcome}` per program). On the rebased head: 6 tests pass, clippy is clean, rustfmt is clean on the changed files. AI-assisted (Claude Code).
Author
Owner

@⁠StExpeditus on GitHub · 2026-11-25 09:19 UTC · original

Test report: RTX 5060 Ti (Blackwell), Windows 11 Pro 26200, driver 621.24. Branch at 1924cc4. cargo test --workspace --locked --no-fail-fast -> 702 passed, 5 failed, 10 ignored. The failures are the same 5 pre-existing NVIDIA 1M-view-heap-cap failures (also on main; see my reports on #2030 and #1940). Nothing introduced by this PR fails on this machine.

**@⁠StExpeditus** on GitHub · 2026-11-25 09:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/1541#issuecomment-7158184616) **Test report: RTX 5060 Ti (Blackwell), Windows 11 Pro 26200, driver 621.24.** Branch at `1924cc4`. `cargo test --workspace --locked --no-fail-fast` -> 702 passed, 5 failed, 10 ignored. The failures are the same 5 pre-existing NVIDIA 1M-view-heap-cap failures (also on main; see my reports on #2030 and #1940). Nothing introduced by this PR fails on this machine.
Author
Owner

@⁠cloph-dsp on GitHub · 2026-11-25 11:55 UTC · original

Independent local validation of PR #1541 (Windows, Rust 1.100.0/MSVC, head 1924cc4, no game data): cargo test --locked -p victory --bins listdiff -> 6 tests passed; cargo test --locked -p victory --bins -> 16 tests passed, exit 0. Synthetic CLI check with before.txt (UTF-8 BOM, multi-reason lines, at 0x... offsets) and after.txt: cargo run --locked -p victory -- list-diff ... --top 5 exited 0 and reported programs 5 in both (1 only before, 1 only after), validated 1 before, 2 after (+1), gained 2, lost 1, with expected gained/lost/reason-changed sections. Only pre-existing deprecation warnings. Not checked: real translate --validate --list output and --top edge cases beyond 5. AI-assisted (Hy4 flash). GPU/driver: N/A (CPU-only CLI). No game data, assets or extracted content used.

**@⁠cloph-dsp** on GitHub · 2026-11-25 11:55 UTC · [original](https://github.com/Marvisak/VIctory/pull/1541#issuecomment-7161691663) Independent local validation of PR #1541 (Windows, Rust 1.100.0/MSVC, head 1924cc4, no game data): `cargo test --locked -p victory --bins listdiff` -> 6 tests passed; `cargo test --locked -p victory --bins` -> 16 tests passed, exit 0. Synthetic CLI check with `before.txt` (UTF-8 BOM, multi-reason lines, ` at 0x...` offsets) and `after.txt`: `cargo run --locked -p victory -- list-diff ... --top 5` exited 0 and reported `programs 5 in both (1 only before, 1 only after)`, `validated 1 before, 2 after (+1)`, `gained 2, lost 1`, with expected gained/lost/reason-changed sections. Only pre-existing deprecation warnings. Not checked: real `translate --validate --list` output and `--top` edge cases beyond 5. AI-assisted (Hy4 flash). GPU/driver: N/A (CPU-only CLI). No game data, assets or extracted content used.
This pull request has changes conflicting with the target branch.
  • README.md
  • apps/victory/src/main.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1541/head:github-bot/gh-1541'
git switch 'github-bot/gh-1541'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1541'
git switch 'github-bot/gh-1541'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1541'
git switch 'github-bot/gh-1541'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1541'
git switch 'main'
git merge --squash 'github-bot/gh-1541'
git switch 'main'
git merge --ff-only 'github-bot/gh-1541'
git switch 'main'
git merge 'github-bot/gh-1541'
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/Marvisak--VIctory!1541
No description provided.