Shaders found as is end where their header says, not at the end of the file (their hashes matched no run) #263
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/263"
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?
Imported from avatarmanz/VIctory-7900XTX. Originally posted by sharan104 on 2026-11-26T13:35:37Z.
apps/victory/src/shader.rssources()finds uncompressed containers by theirDXBCmagic. But it handed each one on as everything from its offset to the end of the file.Container::parsetolerates the trailing bytes, so nothing failed. Every caller that hashes or stores the bytes, though, took the whole tail:#hashthatshader-infoandtranslateprintVICTORY_TRANSLATE_ONLYtranslate --warm's matching against a run's logvictory shadersreplay --retranslate.cdxildumpsA run hashes only the container the title passes (
victory-gpupipeline.rs,shader()). So for raw containers no hash matched, andvictory shaderscached them under keys no run looks up. Each one also hashed the rest of the file, which is quadratic over a file with many containers.Fix: a raw container is cut to the total size in its header (offset
0x18), the same way SGD5 records already are. Containers whose header size runs past the file are dropped.Test:
shader::tests::raw_containers_end_where_their_header_saysuses synthetic containers with bytes before, between and after them. It checks each source is exactly its container, and that the same container hashes the same wherever it sits. It fails before the change and passes after it (10 runs out of 10).Results:
cargo test -p victory --lockedpasses.cargo clippy -p victory --all-targets --locked --no-deps -- -D warningsis clean, with and without--all-features.🤖 Generated with Claude Code
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.