Skip to content

GPU: verify successful and refused shader-cache entries - #1

Merged
yefan911 merged 1 commit into
yefan911:fix/shader-refusal-cache-integrityfrom
XeNS1:codex/shader-cache-integrity-all-20261126
Nov 26, 2026
Merged

yefan911 merged 1 commit into
yefan911:fix/shader-refusal-cache-integrityfrom
XeNS1:codex/shader-cache-integrity-all-20261126

Conversation

@XeNS1

@XeNS1 XeNS1 commented Nov 26, 2026 •

Copy link
Copy Markdown

Follow-up to Marvisak/VIctory#3098, offered against its existing author branch. This preserves both of yefan911's commits and adds one commit addressing the triage request to cover successful entries too.

A same-length edit to a cached successful entry can still parse: flipping one byte in the synthetic DXIL returned the changed bytes as a cache hit; flipping byte 4 changed the stage from PS to VS. The refusal-only digest does not cover either case.

Append one BLAKE3 digest over the complete serialized entry, including its tag, DXIL, resource metadata, or refusal reason. Decode verifies this digest before interpreting fields; mismatches take the existing cache-miss/retranslation path. The format tags are VSH2 / VSF3. This stays in shader_cache's serialization layer because the generic Cache stores opaque converter bytes and returns paths to those raw bytes; no generic-cache API or publication changes are needed.

The existing build fingerprint includes shader_cache.rs, so this encoding change selects a fresh shader-cache namespace. Existing translated entries will be rebuilt once. Successful entries gain 32 bytes; each cache read verifies the full payload. This detects accidental corruption, not the source of the damage. No claim of in-game performance improvement.

Validation, native Linux x86-64 / Rust 1.100.0 / two build jobs:

  • An external Cargo harness imports the actual shader_cache.rs and the actual victory-shader / victory-pipeline crates, without behavior stubs. All 7 module tests pass, including every byte changed in success/refusal records, every truncation, extra bytes, valid-digest malformed fields, and disk corruption followed by exactly one retranslation and then a cache hit.
  • The two new success-corruption regressions fail on edd8d50: 4 pass / 2 fail before the fix, 7 pass / 0 fail after it.
  • All 7 victory-pipeline tests pass. Strict all-target harness Clippy, changed-file rustfmt, repository asset policy (191 files), staged policy and diff checks pass.
  • cargo check --locked --offline --target x86_64-pc-windows-msvc -p victory-gpu --lib --tests --all-features --features blake3/pure passes. The official Rust 1.100 MSVC target std was verified against the installed toolchain manifest SHA-256. This is a compile check, not Windows execution; Rust 1.100 emits two unchanged Atomic::fetch_update deprecation warnings in object.rs.
  • Full Windows CI awaits repository-owner approval. A temporary validation draft in our fork was closed because its workflow did not start.

All fixtures are synthetic; no game files or GPU execution used. No dependencies or CI files changed. AI-assisted: OpenAI Codex.

Coordination claim.

@yefan911
yefan911 merged commit 359fab3 into yefan911:fix/shader-refusal-cache-integrity Nov 26, 2026
1 check passed
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