GPU: fix 3 encoding, fallback, and slice-panic bugs in shader_cache.rs with unit tests #1034
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T15:14:32Z.
Summary
Fixes 3 real bugs in
crates/victory-gpu/src/shader_cache.rsand expands deterministic synthetic unit tests from 2 to 12 passing tests.Because external PR creation is currently restricted (
collaborators_only), the CI-green branch is ready on my fork for cherry-pick / review:geiyiliyabumo/VIctory@test/gpu-shader-cachegeiyiliyabumo/VIctory@f4c4bd4(based onmainffe310e)Bugs Fixed (
crates/victory-gpu/src/shader_cache.rs)RootType::Other(x)was encoded as6 + x, causingOther(u32::MAX)to panic in debug and wrap into a named tag in release. Now encoded as tag wordOTHER_ROOT = 6followed by the rawu32value (lossless, unknown tags rejected).get_or_converteven after translation succeeded. Cache publication is now best-effort, reusing the translated result viaOnceLockwithout translating twice.convertsliced&input[32..]unconditionally (panicking on short input); now usessplit_at_checked(BUILD_LEN)and returns an error.Verification (Windows 11 x64 MSVC)
rustfmt --edition 2024 --check crates/victory-gpu/src/shader_cache.rs: PASScargo xtask policy: PASS (154 files ok)cargo clippy -p victory-gpu --all-targets --locked -- -D warnings(default +--features diagnostics): PASS (0 warnings)cargo test -p victory-gpu --locked -- shader_cache::: 12 passed, 0 failedAI-assisted; synthetic tests only, no game files.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T07:00:31Z.
Automated triage for the maintainers.
Fixed in
main: a failed cache write no longer fails the translation.cachedincrates/victory-gpu/src/shader_cache.rs(rewritten inc47b529, "Shader warm-up (translate --cache), a cache keyed by the translator") logs "shader cache entry not written" and translates without the cache. The other two cases cannot happen there:cachedalways prepends the 32-byte build fingerprint beforeconvertslices it, and no root type tag comes nearu32::MAX. The pull request for this branch, #1200, was closed for the same reasons.This issue will be closed in 48 hours unless the reporter replies or a maintainer removes the label.
Generated by Claude Code