CLI: deduplicate translate containers by declared container bytes instead of DXIL payload alone #3003
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!3003
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3003"
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?
@fuzeofficlal on GitHub · 2026-11-26 03:05 UTC · original
fuzeofficlal:fix/cli-translate-container-dedup→main· +72 −1 · 1 files · 1 commits · openSummary
&bytes[..size]) inapps/victory/src/translate.rs::translateinstead of hashing only theDXIL/ACCCpart payload, matchingwarm()'s container-level deduplication.victory translatefrom silently skipping distinct containers that share an identicalDXIL/ACCCpayload but carry different container-level metadata/signatures (ISG1,OSG1,PSV0, etc.) read byemit::emit_with, while still deduplicating identical containers followed by differing trailing file bytes.ISG1signatures with identical payloads and identical containers with trailing padding bytes.Verification
cargo test -p victory --locked: 16 unit tests + 4 integration tests passed.cargo clippy -p victory --locked --all-targets -- -D warnings: 0 warnings.cargo xtask policy: 191 files ok.@oni-swr on GitHub · 2026-11-26 03:22 UTC · original
Independent Windows verification of
c84b7ee, compared with its exact parent63bcca4(currentmain): the change does what it says.Scope is the claim in #1633. I checked the head, the single parent, CLEAN state and green
checkbefore starting and again before posting. No overlapping run reports were found. Only synthetic DXBC bytes were used, with no game files.Host. Windows 11 Pro 10.0.26200, rustc and cargo 1.98.1,
-j 4 --locked, dedicated target directory,cargo clean -pbetween worktrees. No GPU is involved:Checks { host: None, validator: None }.Code check.
Container::parserejectstotal > data.len()ortotal < HEADER_SIZE, and the hash runs only after a successful parse, so&bytes[..size]cannot go out of bounds.Commands. Head:
cargo test -j 4 --locked -p victory -- --nocapture --test-threads=1. Parent: the PR's two tests copied unchanged into the parent'smod tests, plus the same temporary probe on both revisions (not committed), run withcargo test -j 4 --locked -p victory --bin victory -- dedup probe_3003 --nocapture.translate)dedup_keeps_distinct_input_signatures: differentISG1, identicalDXILpayloadleft: 1, right: 0)dedup_ignores_trailing_file_bytes: identical declared bytes + 16 zero trailing bytesPSV0part, larger declared size, identicalDXILpayloadSo on the parent, distinct declared containers with the same payload are collapsed. On the head they are kept apart, and identical declared bytes are still deduplicated whatever bytes follow them. The last row is a side effect: the digest is inside the declared bytes, so it now counts. That matches
warm()'s container-level key.Head full run: 17 unit tests (the 16 existing plus the probe) and 4 integration tests pass. Clippy and the asset policy were not re-run here.
AI-assisted: verification run and written by Claude Code (Claude Opus 5.5). The figures above come from these runs on this host.
@passerbyyhx on GitHub · 2026-11-26 03:42 UTC · original
I checked the emitted vertex shaders as a follow-up to the duplicate-count tests above. This was a CPU-only run of
victory translate --list --validateon Windows. A and B contain identical synthetic vertex instructions. Their input signatures name the same float4 registerINPUT_AandINPUT_B, respectively. The shader copies all four components toSV_Position.On the direct parent
63bcca43, a single worker emitted only A for the file order A/B/A and only B for B/A/B. Onc84b7eef, both orders emitted A and B and skipped the repeated container. With--jobs 4and A/B/A, the parent emitted A in this run and the PR emitted both.I read
ISG1from the emitted binaries. Each PR output matched its corresponding parent output byte-for-byte, passed the Windows SDK 10.0.28000.0 DXIL validator, and disassembled to four input loads and four output stores. Standalone reproducer and build commands.@Marvisak on GitHub · 2026-11-26 05:41 UTC · original
Automated triage for the maintainers.
Merge candidate.
translate()inapps/victory/src/translate.rsdeduplicated containers by a hash of theDXIL/ACCCpayload alone. Two containers with the same program but different signatures, which the translation depends on, were counted as one and the second was never translated or validated. The PR hashes the whole declared container (bytes[..size], the size at0x18), the same container-level key that the cache warm path already uses (blake3::hash(container)). I checked the slice bound:Container::parse(crates/victory-shader/src/dxbc.rs) already rejects a declared size above the data or below the header, and this code runs only after a successful parse, so it cannot go out of bounds. Bytes after the container in a raw source still don't count. One side effect: the 16-byte digest is now part of the key, so containers that differ only there are no longer merged. That matches the warm path. The two synthetic-container tests cover both cases.CI: passing (
check).Recommending a look, not approving.
Generated by Claude Code
@kotekompotek on GitHub · 2026-11-26 03:07 UTC · original · approved these changes
LGTM — hashing only the DXIL part collapsed distinct containers that shared DXIL but differed in signatures/metadata; hashing bytes[..size] (the DXBC size field at 0x18) covers the whole declared container, and the declared-boundary cut correctly keeps a raw source's trailing bytes out of the key. Both tests discriminate: distinct ISG1 semantics stay distinct, trailing padding still dedups.
@Dukestar69 on GitHub · 2026-11-26 09:10 UTC · original · approved these changes
Verified against
origin/main(63bcca4):cargo test -p victory -- --test-threads=1: 16 lib + 4 integration tests passed (includingtranslate::tests::dedup_ignores_trailing_file_bytesandtranslate::tests::dedup_keeps_distinct_input_signatures).cargo clippy -p victory --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Cleanly deduplicates translate containers by declared container bytes so distinct input signatures are preserved while trailing bytes are ignored.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@futurepro62 on GitHub · 2026-11-26 18:35 UTC · original
NVIDIA full-suite run, to go with the reports above by oni-swr, since none of them names a GPU run. Tested exact head
c84b7ee(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: 868 passed, 0 failed, 10 ignored.dedup_keeps_distinct_input_signatures,dedup_ignores_trailing_file_bytes.--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.