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

Open
sinan-cmyk wants to merge 2 commits from upstream-pr/1541 into main
sinan-cmyk commented 2026-11-24 18:58:49 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-24T18:58:49Z.


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).

<!-- greyfinch-sync:Marvisak/VIctory:issue:6589182099 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1541). Originally posted by [sinan-cmyk](https://github.com/sinan-cmyk) on 2026-11-24T18:58:49Z. --- **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).
catminou4 commented 2026-11-24 20:02:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T19:20:59Z.

Review: COMMENTED


Static review only: apps/victory is Windows-only, so listdiff.rs cannot be compiled or tested on macOS. From the diff: the report deliberately carries only counts and failure reasons (no program labels, per docs/asset-policy.md) — good privacy hygiene for pasting into issues. The wiring adds a list-diff <before> <after> [--top N] subcommand and README documentation. Two suggestions: (1) the diff/aggregation logic in listdiff.rs is platform-independent pure Rust — consider unit tests for the parsing/grouping edge cases (missing programs, renamed failures, empty inputs) even though the crate only builds on Windows; (2) --top N behavior when N exceeds the bucket count. Not blocking.

<!-- greyfinch-sync:Marvisak/VIctory:review:6045812484 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1541#pullrequestreview-6045812484). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T19:20:59Z. **Review:** COMMENTED --- Static review only: `apps/victory` is Windows-only, so `listdiff.rs` cannot be compiled or tested on macOS. From the diff: the report deliberately carries only counts and failure reasons (no program labels, per `docs/asset-policy.md`) — good privacy hygiene for pasting into issues. The wiring adds a `list-diff <before> <after> [--top N]` subcommand and README documentation. Two suggestions: (1) the diff/aggregation logic in `listdiff.rs` is platform-independent pure Rust — consider unit tests for the parsing/grouping edge cases (missing programs, renamed failures, empty inputs) even though the crate only builds on Windows; (2) `--top N` behavior when N exceeds the bucket count. Not blocking.
sinan-cmyk commented 2026-11-24 20:03:10 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-24T19:28:28Z.


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).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7142147479 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1541#issuecomment-7142147479). Originally posted by [sinan-cmyk](https://github.com/sinan-cmyk) on 2026-11-24T19:28:28Z. --- 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).
Marvisak commented 2026-11-25 02:06:08 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:30:23Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7149622356 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1541#issuecomment-7149622356). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T01:30:23Z. --- <!-- 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)_
sinan-cmyk commented 2026-11-25 02:06:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-25T01:53:53Z.


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).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7150086825 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1541#issuecomment-7150086825). Originally posted by [sinan-cmyk](https://github.com/sinan-cmyk) on 2026-11-25T01:53:53Z. --- 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).
StExpeditus commented 2026-11-25 10:07:39 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by StExpeditus on 2026-11-25T09:19:48Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7158184616 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1541#issuecomment-7158184616). Originally posted by [StExpeditus](https://github.com/StExpeditus) on 2026-11-25T09:19:48Z. --- **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.
cloph-dsp commented 2026-11-25 12:03:56 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-25T11:55:44Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7161691663 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1541#issuecomment-7161691663). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-25T11:55:44Z. --- 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 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/1541:upstream-pr/1541'
git switch 'upstream-pr/1541'

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