Repository navigation
Conversation
A retail title submits 200k+ shader blobs across parallel loading threads while >98% are duplicates of ~3.6k-19k unique shaders. Previously shader::capture held the global STATE mutex across readable(), heap-copying every duplicate into a Vec, fnv64(), and classify(), and then ran account_xbox() (FSSM decompression and RDNA2 disassembly) synchronously on the title's loading threads. Validate readable(), hash the slice in place without copying duplicates, and classify unique blobs outside STATE. Offload non-dump account_xbox() to a low-priority worker thread (xcl-shader-stats) that stats() flushes with a bounded wait before reading STATE so report.json and e2e counts stay identical. Assisted-by: Antigravity IDE (Gemini 4 Neon)
Owner
Author
|
Upstream PR xcl-dev#1026 was closed or merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move shader validation, in-place FNV-1a hashing, and container classification outside the global
STATElock ingpu::shader::capture, and offload non-dumpaccount_xboxFSSM decompression and RDNA2 instruction counting to a low-priority background worker flushed byshader::stats().A retail title submits 200k+ shader blobs across parallel loading threads while >98% are duplicates of ~3.6k-19k unique shaders (e.g. 204,736 submissions for 3,579 unique shaders in the first 60 s, 15.67M RDNA2 instructions). Previously
shader::captureheld the globalSTATEmutex acrossreadable(), heap-copying every duplicate into aVec<u8>,fnv64(), andclassify(), and then ranaccount_xbox()synchronously on the title's loading threads.What is in it
crates/xcl/src/gpu/shader.rs: runreadable()andfnv64()directly on the borrowed slice outsideSTATE, skip allocatingVec<u8>on duplicate hashes, avoidStringallocations on existing stage/kind keys, classify unique blobs outsideSTATE, and offload non-dumpaccount_xbox()to a low-priorityxcl-shader-statsworker thread with a bounded flush instats().crates/xcl/src/gpu/shader.rs: unit tests covering concurrent multi-thread deduplication, deterministic worker flush onstats(), and unreadable-pointer rejection.Tested
rustc 1.98.0-nightly (096694416 2026-06-29)(x86_64-pc-windows-msvc), Windows SDK DXC 1.8.2502.11 (10.0.26100.0).cargo test -p xcl --lib gpu::shader::tests: 7 passed, 0 failed, 0 ignored..\scripts\test.ps1(debug): 675 passed, 3 failed (pre-existing Tests: placed_title_textures_share_vram_and_preserve_pixels fails now and then at its cubemap reuse check (main 9ce2070) xcl-dev/xcl#718 cubemap reuse flakeplaced_title_textures_share_vram_and_preserve_pixels+ 2PoisonErrorcascades), 21 ignored; 2 GPU tests skipped (no wave64:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware). On a second lib run (cargo test --workspace --tests -- --test-threads=4), all 3 Tests: placed_title_textures_share_vram_and_preserve_pixels fails now and then at its cubemap reuse check (main 9ce2070) xcl-dev/xcl#718 tests passed (677 passed, 1 failed from pre-existing Memory: a sparse alloc/free loop makes a new 64 MiB pool each cycle; lib tests fill a 12 GB card (#348's test) xcl-dev/xcl#913 OOM incross_queue_cycle_and_same_queue_fifo_do_not_deadlock, which passed in isolation: 1 passed, 0 failed).cargo test -p xcl --test '*' -- --test-threads=4(all integration tests includinge2e.rs): 41 passed, 0 failed, 20 ignored.scripts/smoke.ps1):report.jsonpreserved exactunique=3579,rdna2_instructions=15665903,xbox_hw_stages={"CS":2734,"PS":508,"VS":228}on bothmainand PR head, while frames shown increased from 500 to 694 in 60 s.Regression run
main:
PR:
Not tested
XCL_DUMP_SHADERS=1disk dump path (behavior unchanged, not exercised during smoke run).XCL_SAMPLE_*sample-data tests (environment variables unset).AI use
shader::capture, wrote the implementation, unit tests, commit message, and PR description; all builds, tests, and smoke runs were executed on the hardware named above.Mirror of xcl-dev#1026 (auto-synced, do not edit).