Repository navigation
Conversation
|
Independent check of
Tested
Not tested
This review was AI-assisted. |
|
Hardware check of Tested
Regression run PR ( Not tested
AI use
|
|
Both AMD (RX 9070 XT) and NVIDIA verification look great on |
cbb03e1 to
0f112d4
Compare
|
Rebased onto main 1a0bbe3: head Run on this head (Ryzen 9 5900X, Windows 11, MSVC): Not run on this head: the whole suite, and the AI-assisted (Claude Code). |
|
Verification on RTX 3060 Ti (Windows 11): merge conflict with current |
…time decode() looked an instruction up in a SipHash HashMap keyed by (encoding, opcode) for every primary encoding whose fixed bits matched, read each field one bit at a time, and built three Vecs per instruction (head, base words, final words). The recompiler reads its operands through the same field_value. - each primary encoding keeps a dense 1 << width(OP) table of its instructions (at most 1024 entries); the first instruction to claim an opcode keeps it, as the HashMap's or_insert did - bits() takes whole runs of a word at once; past the last word still reads 0 - the head and base words are a [u32; 5] on the stack; only Decoded::words is allocated Decoding the LLVM gfx10 corpus (23 812 instructions) and reading every operand field: 268 -> 149 ns per instruction in release, best of 15. Tests check bits() and every field of every encoding against the bit-at-a-time reference, the tables against a first-claim lookup, and Decoded::words against the instruction bytes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0f112d4 to
0ee075f
Compare
|
@DavidM1911 Rebased onto latest |
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
|
Nothing has happened on this PR for 3 days, so it is marked |
|
main already has this change. Commit 2159c3b (#1387, merged) changes AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
|
Closing as superseded: this change is already on Two independent checks found this: Foniass's close list on #1607 and ours against current AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents. |
The RDNA2 decoder is the first stage of every shader translation. The recompiler reads every operand through the same
field_value, so a faster decoder speeds up all of them. Per instruction,decode()used to:HashMap<(encoding, opcode), _>once for every primary encoding whose fixed bits matched,Vec<u32>: the head, the base words and the final words.What is in it
crates/xcl/src/gpu/rdna2.rsonly. Each primary encoding now keeps a dense1 << width(OP)table of its instructions (at most 1024 entries; the EXP encoding, which has no OP field, uses slot 0). When two instructions claim an opcode, the first one keeps it (spec before console extensions), as the oldor_insertdid, and the tables are still tried in spec priority order.bits()takes whole runs of a word at once. Bits past the last word still read as 0.[u32; 5]on the stack (the widest encoding is 160 bits). OnlyDecoded::wordsis allocated: 1 allocation per decode instead of 3.decode,field_value,Decoded) or to its results.Release microbenchmark (
#[ignore]d testgpu::rdna2::tests::bench_decode): it decodes the 23 812 instructions of the LLVM gfx10 disassembler corpus already intests/data/llvm-amdgpuand reads every operand field, as the recompiler does. Each figure is the best of 15 runs of 8 rounds. Before and after alternated, with a rebuild each time:origin/mainThat is ≈1.8× faster. The checksum over decoded lengths and field values is identical (
sink 1484757240) in every run.Tested
stable-x86_64-pc-windows-msvc; debug and release.bits_matches_one_at_a_time: every offset (also past the end) and every count 0..=64, on 0–6 random words, against the old bit-at-a-time loop.field_value_matches_one_at_a_time_for_every_field: every field of every encoding.opcode_tables_match_first_claim_lookup: every slot of every table against a first-claimHashMapbuilt like the old one.decoded_words_are_the_instruction_dwords: across the whole LLVM corpus, plus a trailing partial dword.llvm_gfx10_corpustest (name and length of 23 812 instructions) and the other decoder tests pass:cargo test --release -p xcl --lib rdna2: 13 passed, 2 ignored (one is the benchmark).cargo test --workspace --no-fail-fast -- --test-threads=4: lib 637 passed, 3 failed, 22 ignored; all integration tests pass (e2e 3/3). The three failures are GPU tests inhle::d3d12x(title_textures::placed_title_textures_share_vram_and_preserve_pixels,title_textures::transitions_apply_when_their_list_is_submitted,vram::d32s8_targets_take_their_own_size_of_video_memory). They fail the same way onorigin/mainon this machine, in two runs with main'srdna2.rs.cargo clippy -p xcl --all-targets: same warning counts asorigin/main(lib 422, lib test 632), so no new warnings.Regression run
main:
PR:
Not tested
AI use
🤖 Generated with Claude Code