Skip to content

UP-1: retain translated shaders across cache misses and write failures - #51

Merged
ShinniUwU merged 5 commits into
ProjectLeonidaL:mainfrom
JohnReedV:codex/up1-shader-cache-retention
Nov 26, 2026
Merged

ShinniUwU merged 5 commits into
ProjectLeonidaL:mainfrom
JohnReedV:codex/up1-shader-cache-retention

Conversation

@JohnReedV

@JohnReedV JohnReedV commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What changed

UP-1: adapts upstream VIctory bca3ecd. A successful shader translation is now returned directly on a cache miss, even when writing or publishing its entry fails. Previously that I/O error discarded a usable shader and could leave its pipelines' draws dropped for the rest of the run.

This removes the immediate reread/decode on misses and warns once with the failing cache destination. Actual translation errors still propagate, and cached entries still undergo decoding and corrupt-entry recovery. The existing source fingerprint invalidates older entries once, so warm the cache again before gameplay comparisons. UP-1 remains open for other upstream work.

How it was tested

  • Not run in game: game files are unavailable. Tests and benchmarks use original synthetic inputs; no gameplay, loading-time or FPS improvement is claimed.

Checks run on this branch:

  • cargo test --workspace --locked: 655 passed, 0 failed, 18 ignored
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
  • cargo xtask policy

Five shader-cache tests pass in release default and diagnostics builds, on native Windows and Proton 11 / Wine 11.0. The tests cover full shader metadata, disk hits, corrupt-entry recovery, failed translations, an unusable cache folder, publication collision and staging-file cleanup. The pinned a141614 baseline with only the new tests reproduces precisely the two recovery failures; its other three controls pass.

PR Windows CI passes both Clippy configurations and the complete workspace suite.

Dedicated Windows validation also runs all-target workspace checking/testing and doctests. Its source matches PR head ae91ac9d89a6789745a8b335b7eb35468b59a66e, with only the fork validation workflow added. Both release test inventories and the expected baseline failures are explicitly checked to prevent empty or skipped suites from passing.

Measured the complete production cached() calls before/after with a synthetic clone callback on an i9-14900KS, Pop!_OS 22.04/ext4, Rust 1.98.1 Windows release, offline Steam Flatpak Proton 11 / Wine 11.0. RTX 5090 / NVIDIA 580.173.02 is present but unused. Twelve paired rounds × 128 lookups per sample alternate implementation order; all 144 samples and 18,432 timed lookups are retained. Every returned field, persisted byte and hit/miss/translation count is verified.

Synthetic payload Before median miss After median miss Reduction
8 KiB 276.3 µs 204.8 µs 25.9%
64 KiB 297.5 µs 220.9 µs 25.7%
256 KiB 541.5 µs 330.2 µs 39.0%

Warm-hit paired median changes are -1.0%, -1.7%, +1.1%; no warm-hit improvement is claimed. Two 8 KiB miss pairs were slower after the change; every 64/256 KiB pair improved. These are absent application-cache entries with ordinary OS caching, not forced physical cold-disk reads. Timing excludes actual translation, setup, output verification, destruction and the caller's build fingerprint. Fork notes record the exact revisions, method and full ranges.

AI

  • AI-assisted: investigation, upstream adaptation, regression tests, benchmark, review and validation.

@JohnReedV
JohnReedV marked this pull request as ready for review November 26, 2026 20:38
@ShinniUwU
ShinniUwU merged commit 2f952dc into ProjectLeonidaL:main 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