Repository navigation
Shaders: s_ttracedata_imm is SOPP opcode 0x28, not 0x26 - #276
Conversation
The SOPP table had s_ttracedata_imm at 0x26, as Mesa's opcode list does; RDNA2 encodes it at 0x28 (AMD's RDNA2 ISA, LLVM's GFX10 tables and disassembler tests). A shader with the thread-trace marker decoded it as an unknown opcode and failed to translate, though the IR drops the marker as harmless.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested PR #276 at head
Behavior covered: Checks the GFX10 opcode table decodes s_ttracedata_imm as SOPP opcode 0x28. |
mercuryVM
left a comment
There was a problem hiding this comment.
Tested 79fb722 on Windows 11, RTX 5070, MSVC: cargo test --workspace --no-fail-fast passes (265 passed, 0 failed), including s_ttracedata_imm_is_sopp_0x28. victory translate <title exe> --validate --pipelines gives the same counts before and after: 12 of 12 programs emitted, 12 validated, 12 pipelines.
- 0x28 matches the RDNA2 ISA and LLVM's GFX10 SOPP tables. After the change the table has nothing at 0x26 and no second entry at 0x28, so it introduces no collision.
- The test decodes the LLVM disassembler-test word, and also checks that
ir::buildaccepts it, which is where the "unknown opcode" refusal came from.
No issues found. If the table really comes from Mesa's aco_opcodes.py, it may be worth reporting the 0x26 there too.
AI-assisted (Claude Code).
…ode 0x28, not 0x26 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Shaders: s_ttracedata_imm is SOPP opcode 0x28, not 0x26
Shaders: s_ttracedata_imm is SOPP opcode 0x28, not 0x26
… not 0x26) into the integration Merged cleanly. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
What's wrong
The SOPP opcode table in
gfx10/opcodes.rshass_ttracedata_immat opcode0x26. RDNA2 encodes it at0x28:S_TTRACEDATA_IMMas SOPP opcode 40 (0x28).S_TTRACEDATA_IMM : SOPP_Real_32_gfx10_gfx13<0x028>, and its disassembler tests (gfx10_sopp.txt) decode0x34,0x12,0xa8,0xbfass_ttracedata_imm 0x1234.aco_opcodes.py, which has0x26. That's where the wrong number came from.s_ttracedata_immis a thread-trace marker, andir.rsalready lists it inDROPPEDas having no effect. But the real encoding (0xBFA8xxxx) decodes with no name, soir::buildrefuses the whole shader with "unknown opcode":What the fix does
The table entry moves from
0x026to0x028. The table stays sorted, and nothing else changes.How it behaves after the fix
A shader with a thread-trace marker decodes it as
s_ttracedata_imm. The IR drops it as intended, and the shader translates. Nothing else encodes0x26, so nothing that decoded before decodes differently now.Tests
The new test
s_ttracedata_imm_is_sopp_0x28(inopcodes.rs) decodes0xBFA81234and checks two things: the name iss_ttracedata_imm, andir::buildaccepts a program containing it.I ran
cargo test --workspaceon GitHub'swindows-latestwith Rust 1.98.1 fromrust-toolchain.toml:victory-shaderhas 70 passed, the other crates have 0 failed.main: it fails at the decode:left: None(no name for0xBFA81234),right: Some("s_ttracedata_imm").--test-threads=1. With 4 threads, the shader crate's GPU tests sometimes crash on that runner (Tests: victory-shader tests crash (0xC0000005) when several tests use WARP devices in parallel #181, Shaders: share and serialize WARP host operations across threads #244).Not tested: a title shader that carries the marker.