Shaders: reuse the file buffer when loading unsplit cache entries #2594
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2594
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2594"
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?
@storrmzz on GitHub · 2026-11-26 01:01 UTC · original
storrmzz:shaders/reuse-cache-read-buffer→main· +77 −2 · 2 files · 1 commits · draftLoading a translated shader cache entry currently allocates a second payload-sized buffer after reading the file. Reuse the validated file buffer for entries without split pieces; split entries retain their existing allocation and validation behavior.
What is in it
pso.rs, with ownership/round-trip and malformed-entry tests; document it in README.Tested
cargo build --workspace --jobs 2: passed.cargo test --workspace --no-fail-fast --jobs 2 -- --test-threads=4 --nocapture: 1436 passed, 1 failed, 47 ignored; 11 SKIPPED subcases (six unsupported f16/conversion cases, one driver-cache test requiring Developer Mode, three missing-debug-layer cases, one unavailable heap-window case).gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1, seed 722; reproduced before this optimization on base08db802. No test was disabled to conceal it. The final branch is based onb49be18.rustc -O, alternating order, nine-round medians: 4-16 MiB entries loaded 27-35% faster, with approximately half the incremental heap peak. This does not measure game loading or FPS.Regression run
Not run: no unpacked retail title available. The required main/head smoke pair is still missing; this is draft material and cannot pass the runtime PR description gate yet.
Not tested
AI use
This PR was created with AI assistance from OpenAI Codex (gpt-6-astra).
@DavidM1911 on GitHub · 2026-11-26 01:13 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 26 ignored.Thanks!
— Devin
github-bot referenced this pull request2026-11-26 12:40:17 +00:00
@mokkamokacaffe on GitHub · 2026-11-26 13:25 UTC · original
Reviewed exact head
ae921b40fc1f4253ef186aeab389247bbf4302c3againstmainb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7. I found no logic issue requiring a code change.rest.is_empty()proves the validated DXIL payload reaches the end of the file buffer;b.len() - lentherefore identifies its start.copy_withinandtruncatedo not reallocate, which is pinned by the pointer/capacity regression.git diff --check origin/main...ae921b40passed.The same change appears in mega-PR #2778 as
355826c5, whose commit message says it was adapted from #2594. #2594 should remain the focused source of truth rather than being duplicated through #2787.Not tested
AI use
@mokkamokacaffe on GitHub · 2026-11-26 14:00 UTC · original
Tested
ae921b40fc1f4253ef186aeab389247bbf4302c3and upstreammainb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7.cargo test --workspace -- --test-threads=4stopped after the library suite with 1,308 passed, 3 failed, 27 ignored, and 349 explicitSKIPPEDmessages.--no-fail-fastand four test threads, the PR finished with 1,434 passed, 3 failed, and 47 ignored.mainfinished with 1,432 passed, 3 failed, and 47 ignored. Both logged 359 explicitSKIPPEDmessages. All three PR failures reproduced onmainwith matching errors.Regression run
Both release builds completed from clean worktrees. The smoke runs were blocked because no locally owned unpacked title was available. No
xcl-smokeblocks were generated.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.