Recompiler: simplify typed buffer component decoding #1647
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!1647
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1647"
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?
@coolpersonnn on GitHub · 2026-11-24 18:39 UTC · original
coolpersonnn:codex/shader-compile-optimization→main· +71 −17 · 2 files · 1 commits · openPart of #1269. Simplify the HLSL inlined for each dynamic typed-buffer component on the default translation path and the fallback from #1426. Each supported component fits in one dword, so the decoder can extract it directly, share signed and unsigned normalization, and expand the small packed floats without exponentiation.
What is in it
crates/xcl/src/gpu/recomp/emit.rsemits the smaller component decoder.crates/xcl/src/gpu/recomp/tests.rschecks the format table and verifies decoded values from unaligned buffers on the GPU at-O0and-O3.Tested
f860750on Ryzen 9 9950X3D, RTX 5090 (621.01), Windows 11 build 26300, rustc 1.100.0 and DXC 1.8.2502.11..\scripts\test.ps1withXCL_ADAPTER=nvidiareported 961 passed, 0 failed and 43 ignored. The harness reported 23 GPU skips.XCL_SAMPLE_*fixtures were unset for the rebased suite.GPU coverage skips on the rebased head
The original measurements below were taken before this rebase.
.\scripts\test.ps1withXCL_ADAPTER=nvidiaandXCL_SAMPLE_RPFset reported 860 passed, 0 failed, 42 ignored. GPU skips weregpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).9e3831e. Ranxcl shaders <dir> --precompile --only cs --windows 4 --split 1, then--pipelinesagainst the populated DXIL cache with XCL's PSO disk cache off. One format-heavy sample went from 427,204 to 386,108 DXIL bytes and from 17.04 to 13.30 s in the cold pipeline pass (median of two cold runs per build, one cached pair excluded). The giant-O0sample went from 29,750,432 to 26,752,196 bytes and from 129.72 to 118.35 s for translation plus DXC. Both driver passes exceeded 90 s.Regression run
Main
PR head
Not tested
AI use
Codex (GPT-6 family, exact model variant unavailable) profiled the workload, wrote the code and tests, ran the checks, and prepared this description.
T3 Code / Antigravity resolved the current rebase. Codex (GPT-6 family, exact model variant unavailable) verified the resolution, reran the checks, and updated this description.
@nnonno91 on GitHub · 2026-11-24 18:47 UTC · original
Independent AMD check at
a632fbbd10dbd1a7e0cc03f5dc48670beee32ec0.Tested
XCL_ADAPTER='AMD Radeon'.cargo build --workspace --lockedpassed.cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --show-outputreported 860 passed, 0 failed, 42 ignored. One GPU skip is included in that pass count (heap_window_out_of_memory_falls_back_to_the_switch_form, heap windows off). The bundled title test passed.XCL_REQUIRE_GPU=wave64,mesh,cargo test --locked -p xcl --lib -- buffer_format gpu_typed_buffer_loads_and_stores --test-threads=1 --show-outputgave 5 passed, 0 failed, 0 ignored, 0 skips.c160d86ef2efe3a07e4dfb473e4fa72eafb413c0:cargo test --locked -p xcl --test typed_buffer_probe -- --exact typed_buffer_formats_across_wave_sizes_and_byte_alignments --nocapture --test-threads=1. It ran the 11 fixtures fromgpu_buffer_format_component_decode(including the invalid descriptor) at starting byte offsets 0, 1, 2 and 3, on wave32 and native wave64, at DXC-O0and-O3. Both runs passed with 0 skips. Each build matched all 33,792 expected component values bit for bit across 176 dispatches.The generated DXIL for that one synthetic dynamic-format shader was smaller in all four builds:
-O0-O3-O0-O3Not tested
Heap-window mode, retail shader packs and title smoke, compile or pipeline timings.
AI use
OpenAI Codex (GPT-6 family, exact variant unavailable) adapted the temporary probe, ran the tests, and drafted this report.
@DavidM1911 on GitHub · 2026-11-24 21:06 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@throny on GitHub · 2026-11-25 09:20 UTC · original
Test report for exact head
f860750.Tested
cargo build --workspace && cargo test --workspace -- --test-threads=4onf860750as it is (its own base): 961 passed, 0 failed, 43 ignored.SKIPPED: 23 lines (no wave64 on this adapter, and the like).scripts/smoke.ps1, the retail title, 60 s, release builds,main568e7dbfirst, then this head:main:
PR:
Not tested: AMD, the head merged onto current
main, a world load.AI use: Claude Code (Claude Opus 5.5) ran this and wrote the report; the diff was read for safety by a Claude Opus 5.5 sub-agent before it was built.
@futurepro62 on GitHub · 2026-11-26 05:41 UTC · original
NVIDIA and AMD full-suite run, to go with the reports above by throny, since none of them covers AMD. Tested exact head
f860750d(on its basec4d37be).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 956 passed, 0 failed, 43 ignored. SKIPPED (no wave64):a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu,a_per_lane_2d_or_3d_group_runs_on_the_gpu,coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu,cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.buffer_format_components_fit_in_one_dword,gpu_buffer_format_component_decode.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 961 passed, 0 failed, 43 ignored. SKIPPED:f16_programs_on_the_gpu(f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).--skipleaves out tests that fail on mainb49be183too, not because of this PR. On NVIDIA:heap_window_out_of_memory_falls_back_to_the_switch_form(#1651), the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputests,const_and_null_mask_operands_agree_with_hlsl_on_the_gpuandmask_ff0_and_flbit_agree_with_hlsl_on_the_gpu(follow-up on #1651) fail becauserunner::skip_testturns their skips into failures underXCL_REQUIRE_GPU=mesh, andgpu::dxil::fuzz_testsseeds 70, 545, 1019 and 1507 failCreateComputePipelineStatewithE_OUTOFMEMORYon this card (drivers 616.64 and 621.40). On AMD:fuzz_validate_and_gpu_1fails on seed 540 (res[833]0x7 vs CPU 0x6). The AMD run does not setXCL_REQUIRE_GPU.Not tested
AI use
@DavidM1911 on GitHub · 2026-11-26 05:58 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
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.