CLI: keep distinct DXIL dumps when shader labels collide #3029
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!3029
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3029"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@passerbyyhx on GitHub · 2026-11-26 03:56 UTC · original
passerbyyhx:fix/translate-dump-filenames→main· +40 −10 · 1 files · 2 commits · openvictory translate --listcan report two emitted and validated shaders while leaving only one.dxilinVICTORY_EMIT_DUMP. On63bcca43,pass-a.binandpass_a.binat offset zero both wrotepass_a_bin_0x0_Vs.dxil. Reversing the input order changed which shader survived. Long labels with the same final 100 characters also collided.This keeps the 100-byte stem limit and puts the readable, sanitized source label first. A 128-bit BLAKE3 suffix identifies the full original label and the native program’s index in its source container. The index is assigned before translation. Changing the emitted bytes leaves the filename stable across emitter revisions.
The index resolves a real collision inside a single input. A synthetic DXBC with two native VS entries produces two different validated DXIL outputs. Both lines are displayed as
two-vs.bin@0x0 Vs. Each dump matched a separate translation of its source program. I then changed only LLVM producer metadata in a local emitter build. Both outputs changed and passed Windows SDK validation again. Ona495ecf5, neither filename matched the first run. Onfa57db39, both filenames matched and a repeat into the same directory left exactly the two updated files.I also checked punctuation, truncation to 100 bytes, and packed records under
--jobs 4. Eight simultaneous CLI processes using the same output directory retained both expected outputs. The CLI package passed all 19 tests, strict all-targets/all-features Clippy passed, and the changed Rust file passed rustfmt.Original synthetic CLI fixture · Coordination claim
@fuzeofficlal on GitHub · 2026-11-26 04:00 UTC · original · approved these changes
Reviewed
a495ecf5againstmain(63bcca43):VICTORY_EMIT_DUMPfilename collisions:dump_filenamehashes length-prefixedlabelplus emitteddxilbytes with BLAKE3 and keeps a readable ASCII suffix within a 100-byte stem, avoiding overwrites across truncated labels, sanitization collisions (-vs_), and distinct DXIL outputs sharing a label.@kotekompotek on GitHub · 2026-11-26 04:37 UTC · original · approved these changes
LGTM — keying on len+label+dxil discriminates both label collisions and same-label different shaders; the ASCII map makes the byte slice safe, suffix budget keeps the 100-char stem. Test hits both collision directions and the over-length case.
@Marvisak on GitHub · 2026-11-26 06:17 UTC · original · edited 2026-11-26 08:26 UTC
Automated triage for the maintainers.
Merge candidate (recommending a look, not approving). Thanks for the update. In
fa57db3,dump_filename(apps/victory/src/translate.rs) no longer hashes the emitted DXIL, so a shader keeps its dump name across emitter revisions. The readable, sanitised label now comes first (its last 67 characters), followed by a 32-hex BLAKE3 suffix of the full label and the program index, which keeps the stem at 100 bytes.On your reply: you're right about the index.
translateloops over every entrynative_programsreturns for one container, and two entries of the same stage share a label, so a key built from the label alone would overwrite one of them. The index comes fromenumerate()over the parsed programs, before translation, so it is stable from run to run.checkhas only this one caller, andblake3is already a dependency of the app. The new test covers names that differ only in punctuation, a different index, and long labels with the same tail.CI:
checkpassing.Generated by Claude Code
@passerbyyhx on GitHub · 2026-11-26 07:43 UTC · original
Updated in
fa57db39. Dump filenames now start with the readable source label and no longer depend on emitted DXIL bytes. I kept the source program index in the hash because a single input can contain two native entries of the same stage. The CLI validated two distinct VS programs from one synthetic DXBC and printedtwo-vs.bin@0x0 Vsfor both. A label-only key would overwrite one of them. The index comes from the parsed input, before either entry is translated.I tested the same input with two local emitter builds that differ only in LLVM producer metadata. Both DXIL outputs changed and still validated. On the previous PR revision neither filename joined across builds; on
fa57db39both joined, and rerunning into the same directory left exactly two files. The PR description has the other collision and concurrency checks.@Dukestar69 on GitHub · 2026-11-26 10:10 UTC · original · approved these changes
Verified against
origin/main(63bcca4):cargo test -p victory -- --test-threads=1: 15 lib + 4 integration tests passed (includingtranslate::tests::dump_names_distinguish_full_source_labels_and_native_programs).cargo clippy -p victory --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Cleanly keeps DXIL dump filenames distinct when shader labels collide.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@fuzeofficlal on GitHub · 2026-11-26 10:46 UTC · original · approved these changes
dump_filenameinapps/victory/src/translate.rscleanly resolves label sanitization collisions, long-label tail collisions, and multiple native programs sharing a stage within one container. Slicing after ASCII mapping stays UTF-8 safe, the 100-byte stem budget is respected, and hashing the full label plus fixed-widthprogram_indexkeeps dump names stable across emitter changes.Verified locally on Windows 11 x64 (
fa57db39):rustfmt --edition 2024 --check apps/victory/src/translate.rs: cleancargo run --locked -p xtask -- policy: passed (191 files ok)cargo clippy -p victory --all-targets --locked -- -D warnings(default and--all-features): cleancargo test -p victory --locked(default and--all-features): 19 passed, 0 failed eachOptional follow-up: surfacing
std::fs::writeerrors whenVICTORY_EMIT_DUMPpoints to a missing directory.@futurepro62 on GitHub · 2026-11-26 18:53 UTC · original
NVIDIA full-suite run, to go with the reports above by fuzeofficlal, since none of them names a GPU run. Tested exact head
fa57db3(on its base63bcca4).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 867 passed, 0 failed, 10 ignored.dump_names_distinguish_full_source_labels_and_native_programs.--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#2571), so without the skip the rest of that crate never reports;dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.