Repository navigation
Conversation
|
Test report on RDNA2 discrete (RX 6800). Tested
Not tested
Report written with Claude Code (Claude Opus 5.5) from runs on this machine. |
|
Test report for #3473 at Tested
Not tested
AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report. |
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>
12d4f35 to
4afd8a5
Compare
|
Source review on head Keep the fast 200-copy case and let the 300-copy case execute its full chain. That checks the widened index against the plain form and the expected literal sum. This test is also present in stacked #3475, so the change should carry forward there. Candidate test-only diff (not run here)diff --git a/crates/xcl/src/gpu/dxil/compact_tests.rs b/crates/xcl/src/gpu/dxil/compact_tests.rs
@@
- st.sgpr[4] = 50;
let o = KernelOptions { wave64: true, split: runner::split_wave64(), mem_windows: 1, sampler_base: 0 };
for copies in [200, 300] {
+ st.sgpr[4] = if copies == 300 { 1500 } else { 50 };
let code = loads_and_literals(copies);
@@
- assert_eq!((c.sgpr[0], c.sgpr[1], c.sgpr[5], c.sgpr[8]), (50, (1000..1010).sum::<u32>(), 1, 5), "{copies} copies");
+ let end = if copies == 300 { 1300 } else { 1010 };
+ assert_eq!((c.sgpr[0], c.sgpr[1], c.sgpr[5], c.sgpr[8]), (st.sgpr[4], (1000..end).sum::<u32>(), 1, 5), "{copies} copies");I did not run this candidate or a GPU test. AI use: OpenAI Codex (GPT-6.2 Sol) checked the test path; OpenAI Codex (GPT-6.2 Astra) independently reviewed the index encoding and decoding. |
|
merge-check claim |
|
merge-check |
bmjask
left a comment
There was a problem hiding this comment.
Review of 4afd8a55: 1 finding(s). These are on lines outside the diff:
crates/xcl/src/gpu/dxil/compact.rs:828: Not certain about this one, because it rests on the PR's AMD diagnosis, which hasn't been confirmed: if the two-word read (shift and OR across two words) is what the AMD driver miscompiles, it's still used for two other tables. xcl_blocks (~828) is read that way, and its field is used as an index into xcl_steps / xcl_targets (~874, ~885), the same "extracted value used as the next table's index" pattern. A plan whose cb+pb width isn't a power of two (e.g. 11 or 13 bits) has entries that straddle words, so on RDNA2/3 the loop could jump to the wrong block. The xcl_pc table (pc_w = bits(max_pc_dw+1), ~848) is read the same way, where a wrong value would give S_GETPC bad addresses. Fixing the read pattern itself, or applying power-of-two widths to every packed table, would cover all three.
These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
|
merge-check
|
|
@Prime1997 could you take a look at this one for review and merge? My automated review notes are above, if any. |
Follow-up to #3261 (merged): on AMD the compact form read every parameterized literal as 0. moombathepilot's merge-check on #3261 found it on an RX 7800 XT (
gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form: s1 = 0 instead of 10045, native and split wave64). I reproduced it on this PC's RDNA2 iGPU (Ryzen 7 7800X3D, driver 32.0.21030), where the plain form gives 10045 and the same DXIL is right on NVIDIA.Cause: a block's literal comes through two tables, a bit-packed pool index per block (
xcl_lit_idx) and the pool (xcl_lit_pool). An index could straddle two words and was read with a two-word funnel extraction. On AMD:So this looks like an AMD driver miscompile of that pattern. The index width is now a power of two, so no index straddles two words and the lookup reads one word. The table grows at most 2x (8-bit indices stay 8 bits, 9 bits take 16).
What is in it
crates/xcl/src/gpu/dxil/compact.rs: power-of-two literal index width, one-word readcrates/xcl/src/gpu/dxil/compact_tests.rs:a_literal_index_is_read_from_one_word(new, runs without a GPU, fails without the fix: 2 reads of the table)Tested
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, 15 passed, 0 failed, on:XCL_SPLIT_WAVE64=0) and split (=1)cargo test --workspace --no-fail-fast -- --test-threads=4on 4afd8a5, rebased on main 86e86fc (5070 Ti): 2890 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.Regression run
main:
this PR:
Not tested
AI use
🤖 Generated with Claude Code