Skip to content

Distinguish shader signatures in offline translation - #882

Open
Lkxex wants to merge 1 commit into
fxceless:mainfrom
Lkxex:fix/translate-shader-signatures
Open

Lkxex wants to merge 1 commit into
fxceless:mainfrom
Lkxex:fix/translate-shader-signatures

Conversation

@Lkxex

@Lkxex Lkxex commented Nov 25, 2026

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants