Distinguish shader signatures in offline translation #881

Open
Lkxex wants to merge 1 commit from upstream-pr/882 into main
Lkxex commented 2026-11-25 11:41:06 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Lkxex on 2026-11-25T11:41:06Z.


Problem

victory translate currently deduplicates containers using only the DXIL part. Shader emission also reads the input, output and per-primitive signatures (ISG1, OSG1, PSG1) and pipeline validation info (PSV0). Two containers can share DXIL while requiring different emission or validation results. The scan currently skips the second container as a duplicate.

Fix

Include the parts consumed by the emitter in the deduplication key. Exact repeats and containers that only differ in unrelated parts still share one translation. The short code hash displayed in diagnostic output stays the same.

Validation

  • The synthetic regression fails before the fix and passes afterwards. It checks both distinct output signatures and an exact repeat.
  • cargo test --locked -p victory and git diff --check passed.

AI-assisted change. Validation used synthetic containers without game files.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6603663884 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/882). Originally posted by [Lkxex](https://github.com/Lkxex) on 2026-11-25T11:41:06Z. --- ### Problem `victory translate` currently deduplicates containers using only the DXIL part. Shader emission also reads the input, output and per-primitive signatures (`ISG1`, `OSG1`, `PSG1`) and pipeline validation info (`PSV0`). Two containers can share DXIL while requiring different emission or validation results. The scan currently skips the second container as a duplicate. ### Fix Include the parts consumed by the emitter in the deduplication key. Exact repeats and containers that only differ in unrelated parts still share one translation. The short code hash displayed in diagnostic output stays the same. ### Validation - The synthetic regression fails before the fix and passes afterwards. It checks both distinct output signatures and an exact repeat. - `cargo test --locked -p victory` and `git diff --check` passed. AI-assisted change. Validation used synthetic containers without game files.
avt0m4t48 commented 2026-11-25 12:07:04 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by avt0m4t48 on 2026-11-25T11:52:41Z.


Independent CPU-only check of the offline translation change at bda5b05c4afc981d01441fcd3a63da6d501dfceb against f85101b6095e8cf3cecf8f0647cc7f5428daa177. The GitHub test merge had the same source tree as the PR head.

I generated 23 synthetic containers with two compute code bodies. The base skipped 21 duplicates and emitted 2 shaders. The PR skips 6 duplicates, emits 14 shaders, and surfaces all 3 intentional truncated-signature errors that the base skipped. This covers changes to each of ISG1, OSG1, PSG1 and PSV0, plus exact repeats, part reordering, changes to an unrelated PRIV part, and distinct code. The short code hashes stayed stable. For each revision, one serial run and eight 8-worker runs produced the same multiset of emitted bytes. Both compute controls emitted byte-identical DXIL across revisions.

The Linux harness includes the original translation and scanner modules with the Windows-only paths stubbed. It also passed the PR's new unit test. The untouched CLI passed Windows MSVC cross-target cargo check --locked -p victory --all-targets --target x86_64-pc-windows-msvc --features blake3/pure on both revisions. The full Linux CLI build hit platform-gating errors on both. Windows linking, GPU execution, and Microsoft DXIL validation weren't exercised. All inputs were synthetic.

Verification assisted by Codex.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7161623399 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/882#issuecomment-7161623399). Originally posted by [avt0m4t48](https://github.com/avt0m4t48) on 2026-11-25T11:52:41Z. --- Independent CPU-only check of the offline translation change at `bda5b05c4afc981d01441fcd3a63da6d501dfceb` against `f85101b6095e8cf3cecf8f0647cc7f5428daa177`. The GitHub test merge had the same source tree as the PR head. I generated 23 synthetic containers with two compute code bodies. The base skipped 21 duplicates and emitted 2 shaders. The PR skips 6 duplicates, emits 14 shaders, and surfaces all 3 intentional truncated-signature errors that the base skipped. This covers changes to each of ISG1, OSG1, PSG1 and PSV0, plus exact repeats, part reordering, changes to an unrelated PRIV part, and distinct code. The short code hashes stayed stable. For each revision, one serial run and eight 8-worker runs produced the same multiset of emitted bytes. Both compute controls emitted byte-identical DXIL across revisions. The Linux harness includes the original translation and scanner modules with the Windows-only paths stubbed. It also passed the PR's new unit test. The untouched CLI passed Windows MSVC cross-target `cargo check --locked -p victory --all-targets --target x86_64-pc-windows-msvc --features blake3/pure` on both revisions. The full Linux CLI build hit platform-gating errors on both. Windows linking, GPU execution, and Microsoft DXIL validation weren't exercised. All inputs were synthetic. Verification assisted by Codex.
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/882:upstream-pr/882'
git switch 'upstream-pr/882'

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