Skip to content

D3D12.X: pipelines not built yet share the copies of equal shaders - #3505

Open
ArtuArtaza wants to merge 2 commits into
xcl-dev:mainfrom
ArtuArtaza:perf/share-pending-shader-copies
Open

ArtuArtaza wants to merge 2 commits into
xcl-dev:mainfrom
ArtuArtaza:perf/share-pending-shader-copies

Conversation

@ArtuArtaza

@ArtuArtaza ArtuArtaza commented Nov 30, 2026 •

Copy link
Copy Markdown

A pipeline made in the background keeps its description, with a copy of each shader's bytes, until a worker builds it (OwnedDesc); a lazy one keeps it until its first use, often the whole run. A retail title makes about 83,000 pipelines at its start (81,500 of them graphics) and about 2,000 of them are built in a run, so the copies of the rest stay for the whole session. device_x::intern_shader_blob already keeps one copy of each distinct shader for the tracked base pipelines (7e24237); own_shader and own_stream now take their copies from that pool.

The second commit makes the pool's copies Arc<Vec<u8>>: its weak entries kept the bytes of an Arc<[u8]> after their last owner went, until the next sweep (8,192 entries or more). That was there before this PR, which gives the pool more callers. Found by ettehn; that the compute build key has to change with it, and the shape, are thehollowedone's (comments below).

This is the idea of #827 (Cattn, open, conflicts with main) and part of #3091 (Prime1997, open, conflicts with main; its weak Vec entries too), written again on today's main because the pool it needs is there now.

What is in it

  • crates/xcl/src/hle/d3d12x/real.rs: own_shader and own_stream take their copies through device_x::intern_shader_blob. Test owned_descriptions_share_the_copies_of_equal_shaders (graphics and stream descriptions of equal bytes at other addresses hold one copy; other bytes hold their own; a copy outlives the descriptions that shared it).
  • crates/xcl/src/hle/d3d12x/device_x.rs: intern_shader_blob is pub(super); the pool, Base and the descriptions hold Arc<Vec<u8>> (same lookup, full compare and second lookup as before). Test the_pool_keeps_no_bytes_of_a_shader_without_owners: after the last owner goes the pool's entry is still there, and Windows says the pages of the bytes are free (VirtualQuery).
  • crates/xcl/src/hle/d3d12x/real/compute_build_key.rs, pso_async.rs (its tests): the build key holds the same Arc<Vec<u8>> as the description, so no second copy.

Tested

  • AMD Radeon RX 6700 XT (driver 32.0.21045.29003), Ryzen 5 5600X, 48 GB, Windows 11 build 26200.9974, rustc 1.100.0; tests in debug, title runs in release.
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4 on 12713ec6: 2834 passed, 3 failed, 51 ignored (43 test binaries). The 3 are 2 tests, and both fail the same way on unmodified main cfb9753a on this card (ran them there alone): gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form ((50, 0, 1, 5) against (50, 10045, 1, 5): what Recompiler: compact literal indices are read from one table word on AMD #3473 fixes) and gpu_two_pass_cache_e2e::two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (parent and child run, gpu_two_pass_cache_e2e.rs:472 and :584). 4 SKIPPED notices (no GPU_UPLOAD heaps, no heap windows, no Developer Mode).
  • The first test fails with its two lines put back to main (one copy of equal shaders), the second fails on the first commit c635d342 (the bytes go with their last owner); both pass on the head.
  • The branch merged into main 9dfbe3ea: no conflicts, cargo check -p xcl --all-targets passes.
  • The retail title, Series S profile (XCL_DEVICE_TYPE=lockhart), its opening area, XCL_PREPARE=0 XCL_PSO_AHEAD=0, first commit only, 240 s, four runs by turns on main 53e85fb1 with Recompiler: a pixel shader's carry ballot reads its quad lane by lane, not through quadOp #3455, xcl run: XCL_RT_LEAVE_OUT leaves out a title's ray-tracing programs #3302 and Recompiler: compact literal indices are read from one table word on AMD #3473 (earlier main did not get that far on this card without them) plus a counter of the copies made, and the same with the change (two runs each; the counter is not in this PR):
    • shader copies asked for: 155,648 in every run. Made: 155,648 (527 MB) without the change, 18,112 and 18,117 (143 MB) with it.
    • process commit at 236 s: 25,006 and 24,524 MB without, 23,718 and 24,079 MB with it (the driver cache warms from run to run, so only part of that is this change).
    • frames, video memory and errors: no difference that the runs' order does not explain (0 device removals, 0 crashes in all four).
  • The same on main 9dfbe3ea, first commit only, one run each of 150 s with cold caches: 155,648 copies (527 MB) made without, 17,705 (142 MB) with. The whole process' commit at the end shows no difference there (25,439 and 25,493 MB: the cold compiles and the heaps move it more than this does).
  • The same title for 60 s on main cfb9753a and on this PR's head, blocks below: peak commit 13,672 MB and 13,504 MB.

Regression run

main cfb9753a, then this PR's head:

xcl-smoke v1
commit: cfb9753a8cbf5517ee36914b7041cb62b4a97582
gpu: AMD Radeon RX 6700 XT
title: 2c508222
seconds: 60
exit: 0x0
frames shown: 1606 (PresentX 1606)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13672 MB
xcl-smoke v1
commit: 12713ec6a4f0f87320f7ee7206d64796ec69421f
gpu: AMD Radeon RX 6700 XT
title: 2c508222
seconds: 60
exit: 0x0
frames shown: 1577 (PresentX 1577)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13504 MB

Not tested

  • NVIDIA and Intel cards here (ettehn ran the first commit's tests on an RTX 5070 Ti Laptop); the Series X profile; the title past its first world load (its first-time shader compiles stop the frames here, on both sides).
  • The second commit's own effect on the title's memory: only the 60 s run above was made with it.
  • The time intern_shader_blob adds at pipeline creation (one fnv64 of the shader and a lock) was not measured on its own.

AI use

  • Claude Code with Claude Opus 5.5 found the copies, wrote the changes, the tests and this description, and ran the builds, the tests and the runs on my machine; Claude Fable 5.2 compared part of the runs. The pull request was submitted from my account at my request, in that session.

🤖 Generated with Claude Code

A pipeline made in the background keeps its description, with a copy of
each shader's bytes, until a worker builds it (`OwnedDesc`). A lazy one
keeps it until its first use, often the whole run. A retail title makes
about 83,000 pipelines at its start, 81,500 of them graphics, and about
2,000 are built in a run, so the copies of the rest stay.

`device_x::intern_shader_blob` already keeps one copy of each distinct
shader for the tracked base pipelines (7e24237). `own_shader` and
`own_stream` take their copies from that pool now.

Measured with a counter in both builds (not in this commit), Series S
profile, 240 s in the title's opening area: 155,648 shader copies asked
for, 527 MB of them made before, 143 MB (18,112) with the change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added area:d3d12 D3D12.X runtime, command lists, resources, sparse memory gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) labels Nov 30, 2026
@ettehn

ettehn commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Independent Windows check of c635d342 merged cleanly into d52ff48c. Release build, Rust 1.97.1 MSVC, RTX 5070 Ti Laptop system (621.24). The device-hook, owned-description and malformed-stream tests passed 25/25, with both D3D12 GPU cases running and no skips.

One lifetime detail is worth carrying over from #3091. The new own_shader / own_stream callers share live copies, but the pool stores Weak<[u8]>. Those weak entries still retain the entire inline slice allocation after the last owner drops it. On an insertion the pool sweeps only after the count threshold, initially 8,192 entries.

I compiled the current pool and hash function in an isolated Rust probe and counted live 256 KiB slice allocations. Holding 128 equal blobs used 32 MiB with standalone copies and 0.25 MiB with the pool. After dropping those owners and then making and dropping 128 distinct blobs one at a time, standalone copies held 0 MiB and the pool still held 32.25 MiB. All 129 weak entries failed to upgrade. Clearing those entries released all the counted allocations. #3091's Weak<Vec<u8>> approach would let the payload go at the last strong drop. These are synthetic allocation counts. I did not measure retail process commit or run the full workspace suite.

OpenAI Codex (GPT-6.2 Sol) assisted with source review and Windows verification.

@thehollowedone

Copy link
Copy Markdown
Contributor

Follow-up to ettehn’s retention report: one integration detail matters for the fix. ComputeBuildKey also owns an Arc<[u8]> for a compute shader. If the pool and OwnedDesc move to Arc<Vec<u8>> but the build key converts back to Arc<[u8]>, each pending compute recipe can still keep a second payload copy.

Please carry one shared Arc<Vec<u8>> through Base, OwnedDesc, and ComputeBuildKey. Keep the current hash/length lookup, full-byte collision check, and locked second lookup; pass slices explicitly to hashing. This follows the weak-Vec ownership pattern already in #3091.

Candidate shape
- Weak<[u8]> / Arc<[u8]>
+ Weak<Vec<u8>> / Arc<Vec<u8>>

- Arc::from(bytes)
+ Arc::new(bytes.to_vec())

- shaders_key(blobs)
+ shader_set_key(blobs.iter().map(|blob| blob.as_slice()))

Apply the shared type to the shader owners and the compute build key together. Add a regression that observes the backing buffer being released after the last strong owner drops while the weak index entry remains; Weak::upgrade() == None alone passes for both representations.

The pool's entries are weak, but an `Arc<[u8]>` holds its bytes in the
allocation its weak references keep: the bytes of a shader whose last
owner went stayed until the pool's next sweep (8,192 entries or more).
The copies are `Arc<Vec<u8>>` now, so they go with their last owner, as
in xcl-dev#3091. The bases, the descriptions of pipelines not built yet and the
compute build keys hold the same one.

Found by ettehn; the shape of the fix and the need to change the build
key with it are thehollowedone's (review of xcl-dev#3505).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the area:shaders Shader cache, PSO compilation, pipeline libraries, precompilation label Nov 30, 2026
@Aniseto

Aniseto commented Nov 30, 2026

Copy link
Copy Markdown

Ran the shared shader-copy tests at 12713ec6 on an NVIDIA Blackwell desktop part.

System

  • GPU: NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, mesh shaders), driver 32.0.16.2140 (621.40)
  • CPU: Intel Core i5-12400F, 64 GB RAM
  • OS: Windows 11 Pro build 26200 x64
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5
  • Build: debug

Results

  • XCL_ADAPTER=NVIDIA cargo test -p xcl --lib owned_descriptions_share_the_copies_of_equal_shaders -- --test-threads=1: 1 passed, 0 failed, 0 ignored.
  • XCL_ADAPTER=NVIDIA cargo test -p xcl --lib the_pool_keeps_no_bytes_of_a_shader_without_owners -- --test-threads=1: 1 passed, 0 failed, 0 ignored.

What this adds
Both tests pass on the current head: equal shader bytes are shared by the descriptions and the copy outlives its owners without keeping pool bytes. The thread already has an RTX 5070 Ti Laptop report on the first commit; this adds a desktop 5070 Ti run on driver 32.0.16.2140 at the final head. Synthetic tests only; no title memory measurement was made here.

Not tested
A retail title, a paired smoke run, the full workspace suite here, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - ran the commands above on this machine and wrote this report; no game data was used.

@ArtuArtaza

Copy link
Copy Markdown
Author

Thanks, you are both right. I reproduced it before changing anything: 128 blobs of 256 KB without owners still held 32,776 KB behind Weak<[u8]>, and 9 KB behind Weak<Vec<u8>>.

12713ec carries one Arc<Vec<u8>> through Base, OwnedDesc and ComputeBuildKey. The lookup, the full compare and the second lookup under the lock are the same, and OwnedDesc::shaders_key hashes the slices with shader_set_key.

The new test the_pool_keeps_no_bytes_of_a_shader_without_owners drops the last owner of a 4 MiB blob, checks that the pool's entry is still there, and asks VirtualQuery whether the pages are free. It fails on c635d34 and passes on the head. The suite, the merge check on main 9dfbe3e and the 60 s runs are in the description. The long title runs there are of the first commit; I did not repeat them with this one.

(Change and reply written by Claude Code with Claude Opus 5.5, sent from my account.)

@ArtuArtaza
ArtuArtaza marked this pull request as ready for review November 30, 2026 12:42
@github-actions github-actions Bot added needs-1st-check Passes gates; needs first independent merge-check (#3041) needs:amd-test Needs a test report or merge-check on an AMD GPU needs:nvidia-test Needs a test report or merge-check on an NVIDIA GPU labels Nov 30, 2026
@saintwolf

Copy link
Copy Markdown
Contributor

merge-check claim
head: 12713ec

@saintwolf

Copy link
Copy Markdown
Contributor

merge-check
base: 9dfbe3e
head: 12713ec
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2886 passed, 3 failed, 51 ignored; SKIPPED: 27 (22 no wave64, 2 no heap windows, 2 no xgameruntime.dll, 1 cannot disable the driver cache 0x887A002D); failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 (also fails on base 9dfbe3e alone) and two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs in gpu_two_pass_cache_e2e (unrelated); targeted tests passed (the_pool_keeps_no_bytes_of_a_shader_without_owners, owned_descriptions_share_the_copies_of_equal_shaders, build_key_shares_the_owned_shader_allocation)
review: none (read the full +95/-32 diff across device_x.rs, pso_async.rs, real.rs, and compute_build_key.rs: moves ShaderPool from Weak<[u8]> to Weak<Vec> so dropped blobs release their heap buffers immediately rather than waiting for the 8192-entry sweep, and carries one shared Arc<Vec> through Base, OwnedDesc (own_shader / own_stream), and ComputeBuildKey with fnv64+len lookup and full-byte equality checks; not tested: live retail title with ~83k pipelines)
performance: memory win for unbuilt/lazy pipelines sharing equal shaders, and immediate Vec buffer release when owners drop; adds an intern_shader_blob lookup/lock per shader in own_shader/own_stream
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 4070 SUPER (32.0.16.2140), AMD Ryzen 7 7800X3D, Windows 11 Pro 26300, rustc 1.100.0, debug / Antigravity (Gemini 4 Hydrogen)

@github-actions github-actions Bot added needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041) and removed needs-1st-check Passes gates; needs first independent merge-check (#3041) needs:nvidia-test Needs a test report or merge-check on an NVIDIA GPU labels Nov 30, 2026
@tiagonleal

tiagonleal commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

merge-check
base: 9dfbe3e
head: 12713ec
merge: clean
build: cargo build --workspace -> ok (also cargo build --release -p xcl)
tests: cargo test --workspace --no-fail-fast -j 8 -- --test-threads=4 -> 2887 passed, 1 failed, 51 ignored; SKIPPED: 24 lines, the same as on the base; failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, which fails the same way on the base alone (2885 passed, 1 failed, 51 ignored; #3513 fixes it). The two-pass cache e2e test that failed in the other check passed here. The new tests the_pool_keeps_no_bytes_of_a_shader_without_owners and owned_descriptions_share_the_copies_of_equal_shaders ran and passed. With own_shader put back to a private copy per description (Arc::new(bytes.to_vec()) at real.rs:8402), owned_descriptions_share_the_copies_of_equal_shaders fails at real.rs:8519 ("one copy of equal shaders"); file restored after.
review: whole diff read (+95/-32, 4 files). Sharing is decided by a full byte compare: intern_shader_blob (device_x.rs:389) looks up by (fnv64, len) and returns an existing copy only when existing.as_slice() == bytes (device_x.rs:396 outside the lock, device_x.rs:404 again under it), so two different shaders are never given one copy. On a key collision with both alive, the newer copy replaces the map entry (device_x.rs:412); the older one stays valid for its owners and only stops being shared. Locking is one global mutex, BASE_SHADERS (device_x.rs:374). The hash is taken outside it, the second compare and the insert under it, so two threads interning the same bytes end with one copy, and the extra to_vec (device_x.rs:400) is dropped. Lifetime: each OwnedDesc holds an Arc<Vec<u8>> per stage and points the descriptor at the Vec buffer (real.rs:8402-8404, stream at real.rs:8481). I found no make_mut, get_mut or write through those pointers in hle/d3d12x, so a shared buffer never moves or changes while a description points at it. A failed or cancelled build only drops its OwnedDesc; the bytes go with the last Arc, and the pool keeps a dead weak entry (the Arc and Vec header, no shader bytes) until the sweep at device_x.rs:408-411. Cost: one fnv64 over each shader at pipeline creation plus the global lock, and a full compare under the lock on a hit; not measured on its own. Overlap: #827 and #3091 change own_shader the same way (the PR says so), and #2297 changes the signature of own_shader; whichever lands second needs a rebase.
performance: scripts/smoke.ps1, 60 s of a retail title, release, after one warm-up run of the base: 1673 frames and 17222 MB peak commit against 1659 frames and 17322 MB on the base (warm-up: 1689, 17197 MB). No device removal, no crash. Pipelines at the end of the run, from the log: 60753 made (58011 graphics) on both, 2336 built against 2295; the built count rose run after run today as caches warmed, so I do not read that difference as this PR. The 100 MB commit difference is inside today's run-to-run spread, and 60 s in the menus does not show the copy savings the PR measures over 240 s. Not verified here: the title past its first world load, and the memory effect over a long run.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB (617.42, wave32), Ryzen 7 9800X3D, 32 GB, Windows 11 26300, rustc 1.100.0 / Claude Code (Claude Opus 5.5 ran the build, suite, tests and smoke, reviewed the diff against the merged source and wrote this)

  • Tiago

@github-actions github-actions Bot added ready-to-merge Has 2 independent safe merge-checks on current head (#3041) and removed needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041) needs:amd-test Needs a test report or merge-check on an AMD GPU labels Nov 30, 2026
@Kalmarv

Kalmarv commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Independent verification on RTX 5070 Ti (Windows 11, Ryzen 9 9950X, NVIDIA nvgpucomp64.dll 32.0.16.1074, DXC 1.9.2609), local merge of 12713ec6a4f0f87320f7ee7206d64796ec69421f onto main 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b:

  • Merge & build: Clean merge (+95/-32 across 4 files), cargo build --release -p xcl succeeded.
  • Targeted unit tests (--test-threads=1): 28 passed, 0 failed (hle::d3d12x::device_x::tests: 22/22 including the_pool_keeps_no_bytes_of_a_shader_without_owners; hle::d3d12x::real::compute_build_key::tests: 5/5 including build_key_shares_the_owned_shader_allocation; owned_descriptions_share_the_copies_of_equal_shaders: 1/1).
  • Code review: Read the full diff across device_x.rs, pso_async.rs, real.rs, and compute_build_key.rs. Switching ShaderPool from Weak<[u8]> to Weak<Vec<u8>> ensures shader byte buffers are freed immediately when the last strong Arc drops instead of waiting for the 8192-entry sweep, and own_shader / own_stream / ComputeBuildKey cleanly share the same Arc<Vec<u8>> with full-byte equality verification.
  • 60 s retail smoke (scripts/smoke.ps1, release):
xcl-smoke v1
commit: 219b1f309ed0f2ef72f10aeaee7d75427e25bf0a
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1701 (PresentX 1701)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17326 MB

(0 device removals, 0 crashes.)

Not tested here: Full cargo test --workspace locally and multi-minute in-world peak-commit delta past the opening menus.

Verdict: Safe to merge.

AI use: Antigravity assisted with merging locally, inspecting the diff, running the targeted tests and 60 s smoke, and drafting this report.

@ClosetPie107

Copy link
Copy Markdown

Test report for #3505 at 12713ec6a4f0f87320f7ee7206d64796ec69421f, against its merge-base with main, cfb9753a, under Wine on AMD.

Tested

Not tested

  • native Windows
  • NVIDIA
  • the gpu:: tests in the suite runs
  • the workspace's other crates and integration tests (only -p xcl --lib)
  • a game run (no regression block)

AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report.

@andresd-cerebras andresd-cerebras left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Withdrawn.

@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

merge-check
base: 7d86c5d
head: 12713ec
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2898 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: read the whole diff (device_x.rs, real.rs, real/compute_build_key.rs, pso_async.rs tests). Every background or lazy pipeline description now copies its shaders through intern_shader_blob, with the pool, Base and the compute build key holding Arc<Vec<u8>>. Findings: (1) it repeats the pending-recipe part of open #3091 (Arc<Vec<u8>>, own_shader / own_stream through a shared pool, the ComputeBuildKey type change), as the description says; a maintainer needs to pick one, and #3091 would then keep only its derived and base parts. (2) own_shader / own_stream (real.rs ~8288, ~8369) now run fnv64 over every shader on the creation thread, plus a full byte compare on a hit under the global BASE_SHADERS lock, and OwnedDesc::shaders_key (~8250-8253) hashes the same bytes twice more; reusing the interned hash would drop a pass. Not measured, as the description says. (3) the_pool_keeps_no_bytes_of_a_shader_without_owners (device_x.rs ~2112) depends on the process heap releasing a 4 MiB block's pages (it retries 8 times). Fine: descriptions, bases and build keys hold strong references until after the driver call returns and the pool holds only weak ones; nothing mutates the shared bytes and a hash hit is confirmed by comparing all bytes; the Arc<Vec<u8>> change fixes bytes being kept alive through weak entries.
performance: 60 s smoke of a retail title, main 7d86c5d vs this merge (05778095): 1663 -> 1662 frames shown (99 %; last presents per 2 s: 60 60 60), peak commit 17153 -> 17289 MB, 0 device removals, 0 crashes.
verdict: not yet: it duplicates the pending-recipe part of open #3091, and a maintainer has to pick one. Otherwise nothing blocks it: the suite passes, the smoke run is flat, and I found no bug in the diff
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5

AI-written and posted by Foniass without a human check of each point.

@github-actions github-actions Bot added checks-disagree Merge-checks disagree (safe vs not yet); needs maintainer/3rd look needs:amd-test Needs a test report or merge-check on an AMD GPU and removed ready-to-merge Has 2 independent safe merge-checks on current head (#3041) labels Dec 1, 2026
@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Triage (#1607) – head 12713ec

Same idea as #827: own_shader / own_stream share one copy of equal shader bytes. #827 adds its own weak pool in real.rs and conflicts with main. This PR reuses main's device_x::intern_shader_blob and also fixes the pool keeping Arc<[u8]> bytes alive through its weak entries (now Arc<Vec<u8>>). #3091 does the same as part of a larger change.
No problems found in the diff.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:d3d12 D3D12.X runtime, command lists, resources, sparse memory area:shaders Shader cache, PSO compilation, pipeline libraries, precompilation checks-disagree Merge-checks disagree (safe vs not yet); needs maintainer/3rd look gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) needs:amd-test Needs a test report or merge-check on an AMD GPU

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants