Recompiler: count split shader pieces in the cache budget #2475
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!2475
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2475"
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?
@Creaa on GitHub · 2026-11-25 19:41 UTC · original
Creaa:recompiler/split-cache-bytes-2454→main· +35 −9 · 1 files · 1 commits · openThe in-memory shader cache omitted the allocations for split compute pieces when it admitted an entry, then subtracted those allocations when it evicted the entry. The difference could exceed the remaining byte count. Fixes #2454.
What is in it
Insertion and eviction use the same size calculation. The cache checks the full size before copying the shader blob. A unit test checks admission at a tight limit and that eviction returns the byte count to zero.
Tested
398cefb,cargo test -p xcl --lib shader_cache_counts_split_pieces_against_its_budgetpassed.cargo build --workspacesucceeded.cargo test --workspace --no-fail-fast -- --test-threads=4reported 1414 passed, 0 failed, 46 ignored. The harness includes skipped GPU cases in its pass count. There were 29 SKIPPED messages for wave64 support, unsupported direct-DXIL cases, heap windows, D3D12 debug layers, and the driver cache setting that requires Developer Mode.Regression run
main:
this PR:
Not tested
The retail smoke run did not measure shader-cache pressure or establish whether the title evicted a split shader. The unit test exercises that path directly.
AI use
OpenAI Codex (GPT-6) verified the accounting discrepancy, wrote the patch and test, ran the checks and drafted this description.
@DavidM1911 on GitHub · 2026-11-25 20:34 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. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@SlopTart on GitHub · 2026-11-25 20:37 UTC · original
gpu_suite (cold cache): 164 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, and the promoted-UAV-clear driver gap, PR #2490); none caused by this PR. Notegpu_depth_buffer_created_for_unordered_access_is_placedis green on main now, #2466 did its job on this lane.Targeted run of
shader_cache_counts_split_pieces_against_its_budget: passed.@xpatfussy69x on GitHub · 2026-11-25 21:34 UTC · original
Test run on exact head
398cefb(398cefbcd74ab303442a2df2ca1dae13f884fab7, on its base06055a7), clean tree.Tested
cargo test --workspace -- --test-threads=4: 1414 passed, 0 failed, 46 ignoredV_MUL_F16/V_PK_MUL_F16/V_CVT_F16_F32(onmaintoo)cargo test -p xcl --lib shader_cache: 26 passed, 0 failed, includingshader_cache_counts_split_pieces_against_its_budgetmain, an entry with a 300- and a 200-byte dispatch-chain piece is counted as 94 bytes on insert and 594 on evictionRegression run (60 s, default settings)
main:
this PR:
No crash or device removal; frames 101 % of
main's, peak commit 100 %.Not tested
main(tested on its own base06055a7; it merges into6d12f58without conflicts)AI use
@thehollowedone on GitHub · 2026-11-25 21:58 UTC · original
Independent Windows check of #2475 head
398cefb, on its original base06055a7, with a clean checkout.Tested
cargo build --offline --locked --workspace: passed.cargo test --offline --locked -p xcl --lib shader_cache_tests --jobs 6 -- --test-threads=1: 24 passed, 0 failed, 0 ignored.cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4: 1,414 passed, 0 failed, 46 ignored. The output included 25 GPUSKIPPEDnotices for unsupported features; these were not counted as GPU coverage.I read the one-file diff. Cache admission and eviction now use the same size calculation, including split-piece vector capacities; the new test checks accounting, eviction to zero, and rejection at one byte below the entry cost. I found no concrete issue in that change.
Not tested: an AMD GPU, native wave64/per-lane features skipped on this adapter, or a retail title on this PR head. I did not run paired smoke; the earlier independent RTX 3060 report contains that separate evidence. This branch predates current main, so the counts above describe the exact PR head, not a rebased merge result.
AI-assisted: Codex (GPT-6, exact variant unavailable) reviewed the diff, ran the tests, and drafted this report.
@bmjask on GitHub · 2026-11-25 20:34 UTC · original · reviewed
No concrete correctness or accounting defect found. ShaderEntry::size centralizes piece-capacity accounting on insertion and eviction, restoring the cache.bytes invariant; exact-accounting/rejection tests and current Windows CI are green. The intentional exclusion of Vec/Arc/map metadata predates this patch and matches the existing model. I found no blocker.
@Prime1997 on GitHub · 2026-11-26 13:30 UTC · original · reviewed
Good within the targeted test scope; retain for integration. Counts dispatch-chain piece bytes against the in-memory shader-cache budget.
Reviewed PR head
398cefbcd74ab303442a2df2ca1dae13f884fab7. Tested an isolated, uncommitted merge-tree integration with latest mainb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7, tree84cb1f99d90a2f90d4d10f00cd41ccd718ee9e69; this is not a clean PR-head run. Integration source overlay SHA-256:c1d9562393880fe0ac48c6ab2ca9d9989ada7c0225a53285df83652bbfc23056.Measured: 1 passed, 0 failed, 0 ignored, 0 skipped. Exact selected filters, each run in a fresh process:
gpu::recomp::pso::shader_cache_tests::shader_cache_counts_split_pieces_against_its_budgetBuild:
cargo test --locked --offline -p xcl --lib --no-run --message-format=json --target-dir <isolated-target>. Run each:<test-exe> <exact-filter> --exact --test-threads=1 --nocapture. Private target/executable paths are placeholders. Windows 11 Pro 26200, i5-10400, 32 GiB, Rust 1.100.0 MSVC debug; private temporary/cache paths, two low-priority build jobs, 90-second per-test bound.Scope: A small synthetic cache-budget fixture checks piece-byte accounting and eviction without allocating a title-sized shader cache. No full suite, retail run, sustained memory pressure or performance benefit is established. Passing these fixtures is not merge certification.
AI use: Codex (GPT-6) inspected the changes and fixtures, ran the checks and verified raw receipts. Optional temporary Discord for coordinating contributor work, testing and comparing results.
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.