Repository navigation
Conversation
The compact form (xcl-dev#3261) gives each block of a parameterized class its literal through two tables: a bit-packed index per block (xcl_lit_idx) and the pool of distinct literals (xcl_lit_pool). An index could straddle two words of xcl_lit_idx and was read with a two-word funnel extraction. AMD's driver (an RX 7800 XT, 32.0.32029, and a Ryzen 7800X3D's RDNA2 iGPU, 32.0.21030) gets the pool index wrong from that extraction: gpu_compact_form_with_micro_blocks_and_literal_table_runs_ as_the_plain_form read 0 for every literal (s1 = 0 instead of 10045), in native and split wave64. The same DXIL runs correctly on NVIDIA, and the index is right when used as a value; only its use as the next table's index goes wrong (with a clamp, it read the last pool entry). The index width is now a power of two, so an index never straddles two words and the lookup reads one word. The table grows at most 2x (an 8-bit index stays 8 bits; 9 bits take 16). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Follow-ups to the compact form's review on xcl-dev#3263 (KOLESNiii): - Plan::words(), which the table limit is checked against, now counts the block-PC table and the literal index and pool tables, so a program can no longer take the form with more table words than MAX_TABLE_WORDS. A plan with a PC table and no block literal no longer emits empty literal tables. - The block-PC table gets the literal index table's fix: entries of a power-of-two width, read from one word (entry_bits). The two-word read is what AMD's driver got wrong for the literal index; the PC values themselves read right on AMD in the new test, so this one is for consistency, not a seen failure. - The comments said repeated memory ops split out at >= 4 occurrences; the code does it at >= 2. - Tests for code that had none: a GPU run of blocks that share a class through the PC table, dead far-jump veneers left out (all of them in a compute program, all but the last in the kernel form) and a GPU run of that kernel form against the plain one, and words() against the table sizes in the DXIL. On the retail title nothing changes: none of its 768 compute programs that reach the compact plan has a literal or PC table. One of them has a 16121-word plan (19840 blocks), over main's former 12288-word limit and under the 32768 one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8d1bc67 to
70ed9c6
Compare
|
merge-check
|
|
@Foniass merge-check above: with |
Stacked on #3473; only the top commit (
70ed9c60) belongs here.Follow-ups to KOLESNiii's review of the compact form on #3263 (merged):
Plan::words(), which the table limit (MAX_TABLE_WORDS) is checked against, left out the block-PC table and the literal index and pool tables. A program could take the form with more table words than the limit. It now counts them. A plan with a PC table and no block literal no longer emits empty literal tables.xcl_pc) gets Recompiler: compact literal indices are read from one table word on AMD #3473's change: entries of a power-of-two width, read from one word (entry_bits). AMD's driver got the two-word read wrong for the literal index. In the new GPU test the PC values read right on AMD with the old read too, so this one is for consistency, not a failure I saw.>= 4occurrences; the code does it at>= 2.words()against the table sizes in the DXIL.On the 4th point,
MAX_TABLE_WORDS12288 → 32768 on every GPU: I kept 32768.What is in it
crates/xcl/src/gpu/dxil/compact.rs:Plan::words,Plan::pc_width,Plan::lit_pool,entry_bits, the one-word PC read, the commentscrates/xcl/src/gpu/dxil/compact_tests.rs:gpu_compact_form_with_a_block_pc_table_runs_as_the_plain_formdead_far_jump_veneers_are_left_out: all of them in a compute program, all but the last in the kernel formgpu_compact_form_without_dead_veneers_runs_as_the_plain_formthe_word_count_includes_the_pc_and_literal_tables: fails without thewords()change; it found the empty literal tables tooTested
XCL_ADAPTER=radeon), AMD Ryzen 7 7800X3D, Windows 11 build 26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), debug tests, release smokecargo test -p xcl --lib gpu::dxil::compact_tests -- --test-threads=1, 19 passed, 0 failed, on:XCL_SPLIT_WAVE64=0) and split (=1)cargo test --workspace --no-fail-fast -- --test-threads=4on 70ed9c6, rebased on main 86e86fc (5070 Ti): 2894 passed, 0 failed, 51 ignored. SKIPPED: 28 notices, almost allno wave64(the others: no D3D12 debug layer, heap windows off, driver cache needs Developer Mode). The narrower runs listed here are from before the rebase.xcl shaders shaders.rpf --direct --only cs --sample 0 --max-bytes 0). 768 reach the compact plan. None has a literal or PC table, so on this title the program choice is unchanged; their table sizes are the numbers above.Regression run
main:
this PR:
Not tested
AI use
🤖 Generated with Claude Code