Keep shader metadata variants in the offline translation census #1183

Closed
github-bot wants to merge 1 commit from gh-pr/1183/head into gh-pr/1183/base
Owner

@⁠Jitheswar on GitHub · 2026-11-24 16:22 UTC · original
shader-census-container-identity → main · +67 −8 · 2 files · 1 commits · closed without merging

The offline translation census (victory translate) skipped a container as a duplicate when its DXIL part hashed the same as one already seen. The DXIL part alone leaves out the input, output and primitive signatures (ISG1, OSG1, PSG1) and the runtime info (PSV0), and emission reads all four. So two containers with the same native program but different signatures or mesh runtime info were counted once, and the second variant was never translated or reported.

What changes

  • emit::emission_metadata names the four parts emission reads. emit_with now takes them from it, so the census and the emitter agree on what matters.
  • The census key is the DXIL part plus those four. Each part is framed by its length, and a missing part gets a distinct marker, so a missing part, an empty part, and the same bytes moved into another part all give different keys.

Test: translate::tests::deduplication_includes_signature_and_runtime_parts builds synthetic containers. Reordering parts or adding an unrelated HASH part keeps the key. Changing a signature's bytes, moving bytes between signatures, adding an empty PSG1, or adding a PSV0 changes it.

Rebased onto 940d32f (upstream split emit into emit/emit_with; the metadata change now lives in emit_with). cargo test -p victory-shader passes (144). The victory app tests pass for the Windows target under Proton (11, including this test and upstream's emit_dump_inside_repo_is_refused). Windows-target clippy -D warnings is clean. No game data in the test.

AI-assisted (Claude Code, Codex).

🤖 Generated with Claude Code

**@⁠Jitheswar** on GitHub · 2026-11-24 16:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/1183) `shader-census-container-identity` → `main` · +67 −8 · 2 files · 1 commits · closed without merging The offline translation census (`victory translate`) skipped a container as a duplicate when its DXIL part hashed the same as one already seen. The DXIL part alone leaves out the input, output and primitive signatures (`ISG1`, `OSG1`, `PSG1`) and the runtime info (`PSV0`), and emission reads all four. So two containers with the same native program but different signatures or mesh runtime info were counted once, and the second variant was never translated or reported. **What changes** - `emit::emission_metadata` names the four parts emission reads. `emit_with` now takes them from it, so the census and the emitter agree on what matters. - The census key is the DXIL part plus those four. Each part is framed by its length, and a missing part gets a distinct marker, so a missing part, an empty part, and the same bytes moved into another part all give different keys. **Test:** `translate::tests::deduplication_includes_signature_and_runtime_parts` builds synthetic containers. Reordering parts or adding an unrelated `HASH` part keeps the key. Changing a signature's bytes, moving bytes between signatures, adding an empty `PSG1`, or adding a `PSV0` changes it. Rebased onto `940d32f` (upstream split `emit` into `emit`/`emit_with`; the metadata change now lives in `emit_with`). `cargo test -p victory-shader` passes (144). The `victory` app tests pass for the Windows target under Proton (11, including this test and upstream's `emit_dump_inside_repo_is_refused`). Windows-target clippy `-D warnings` is clean. No game data in the test. AI-assisted (Claude Code, Codex). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:22:48 +00:00
github-bot closed this pull request 2026-11-26 04:22:48 +00:00
Author
Owner

@⁠Zipettte on GitHub · 2026-11-24 18:00 UTC · original

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at d035f4d: cargo test -p victory -p victory-shader passes, 122 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

**@⁠Zipettte** on GitHub · 2026-11-24 18:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/1183#issuecomment-7140024909) Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at d035f4d: `cargo test -p victory -p victory-shader` passes, 122 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Author
Owner

@⁠Aniseto on GitHub · 2026-11-24 18:16 UTC · original

Ran the new census test at d035f4d:

Environment: Windows 11 Pro build 26200 x64, Intel Core i5-12400F, 64 GB RAM, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only) driver 32.0.16.2124, Rust 1.98.1 (pinned by rust-toolchain.toml), MSVC 14.44.35207, DXC 1.9.2609.5, debug build.

cargo test --workspace deduplication
1 passed; 0 failed; 0 ignored      (exit 0)

translate::tests::deduplication_includes_signature_and_runtime_parts passes. Small note for other testers: it lives in the victory app crate, not in victory-shader, so cargo test -p victory-shader deduplication finds nothing.

The test covers the key composition itself (signature and runtime parts change the hash), not a full census over a retail pack.

Not tested: a real offline translation census on a retail shader pack (no game data here), RDNA2/RDNA4 and Intel GPUs.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash 1017 - checked out the PR's head commit in a detached worktree, built it, ran the test, wrote this report; no game data was used.

**@⁠Aniseto** on GitHub · 2026-11-24 18:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/1183#issuecomment-7140399845) Ran the new census test at `d035f4d`: Environment: Windows 11 Pro build 26200 x64, Intel Core i5-12400F, 64 GB RAM, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only) driver 32.0.16.2124, Rust 1.98.1 (pinned by `rust-toolchain.toml`), MSVC 14.44.35207, DXC 1.9.2609.5, debug build. ``` cargo test --workspace deduplication 1 passed; 0 failed; 0 ignored (exit 0) ``` `translate::tests::deduplication_includes_signature_and_runtime_parts` passes. Small note for other testers: it lives in the `victory` app crate, not in `victory-shader`, so `cargo test -p victory-shader deduplication` finds nothing. The test covers the key composition itself (signature and runtime parts change the hash), not a full census over a retail pack. Not tested: a real offline translation census on a retail shader pack (no game data here), RDNA2/RDNA4 and Intel GPUs. AI-assisted (OpenCode), model: **DeepSeek V4.1 Flash 1017** - checked out the PR's head commit in a detached worktree, built it, ran the test, wrote this report; no game data was used.
Author
Owner

@⁠Jitheswar on GitHub · 2026-11-24 21:00 UTC · original

I verified d035f4d on main at ffe310e. The synthetic signature/runtime metadata regression passed on Linux with #1017 applied locally and in the combined Windows-target shader branch build under Proton.

Offline A/B on the retail GTA VI Xbox Series 1.0.2.1 shader archive produced the same 26,503 containers, 614 skipped duplicates, and 26,084 programs for both builds. Emission totals also matched. On this archive the finer key did not change the census counts. DXIL validation and host pipeline creation were outside this Linux comparison.

AI-assisted with Codex. No game data is included.

**@⁠Jitheswar** on GitHub · 2026-11-24 21:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/1183#issuecomment-7144360253) I verified `d035f4d` on `main` at `ffe310e`. The synthetic signature/runtime metadata regression passed on Linux with #1017 applied locally and in the combined Windows-target shader branch build under Proton. Offline A/B on the retail GTA VI Xbox Series 1.0.2.1 shader archive produced the same 26,503 containers, 614 skipped duplicates, and 26,084 programs for both builds. Emission totals also matched. On this archive the finer key did not change the census counts. DXIL validation and host pipeline creation were outside this Linux comparison. AI-assisted with Codex. No game data is included.
Author
Owner

@⁠Jitheswar on GitHub · 2026-11-24 21:57 UTC · original

Rebased onto 70564ae. The synthetic metadata-deduplication regression passed in the Windows-target workspace suite under Proton, and the same 66 tests failed as on the untouched base. Asset policy passed. This rebase check used synthetic tests. AI-assisted with Codex.

**@⁠Jitheswar** on GitHub · 2026-11-24 21:57 UTC · [original](https://github.com/Marvisak/VIctory/pull/1183#issuecomment-7145615759) Rebased onto `70564ae`. The synthetic metadata-deduplication regression passed in the Windows-target workspace suite under Proton, and the same 66 tests failed as on the untouched base. Asset policy passed. This rebase check used synthetic tests. AI-assisted with Codex.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:38 UTC · original · edited 2026-11-25 02:24 UTC

Automated triage for the maintainers.

Recommended for a maintainer's look. The offline census in apps/victory/src/translate.rs deduplicated containers by the DXIL part alone. emit_with also reads ISG1, OSG1, PSG1 and PSV0, so two containers that differ only in those parts were counted once. translation_key now hashes all five parts, each framed by its length with a marker for a missing part. emit::emission_metadata is the single list both sides use. The emitter refactor in emit/mod.rs does not change behaviour. The test checks that part order and unrelated parts don't matter, while changed, moved, empty or added metadata parts do. A tester measured no change in counts on the title's archive, so this is a correctness fix for the tool rather than a visible gain. It also touches translate.rs, like #1017 and #1185. CI is passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 00:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/1183#issuecomment-7148732136) · edited 2026-11-25 02:24 UTC <!-- victory-triage v1 head=34581536616f86115ffd00ba48a8ff5523975d7a verdict=merge-candidate at=2026-11-25T02:20:29Z --> Automated triage for the maintainers. Recommended for a maintainer's look. The offline census in `apps/victory/src/translate.rs` deduplicated containers by the DXIL part alone. `emit_with` also reads `ISG1`, `OSG1`, `PSG1` and `PSV0`, so two containers that differ only in those parts were counted once. `translation_key` now hashes all five parts, each framed by its length with a marker for a missing part. `emit::emission_metadata` is the single list both sides use. The emitter refactor in `emit/mod.rs` does not change behaviour. The test checks that part order and unrelated parts don't matter, while changed, moved, empty or added metadata parts do. A tester measured no change in counts on the title's archive, so this is a correctness fix for the tool rather than a visible gain. It also touches `translate.rs`, like #1017 and #1185. CI is passing. --- _Generated by [Claude Code](https://claude.ai/code)_

Pull request closed

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!1183
No description provided.