mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:10:52 +01:00
[PR #59] GPU fixture for the packed integer dot products (cs_w32_dot_int) #112
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#112
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/59
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:old-pr/9781📝 Commits (3)
2395050GPU fixture for global_atomic_csub / buffer_atomic_csub, and a "; mcpu:" fixture header55f5f11tests/conftest.py: assemble a fixture for its "; mcpu:" target tood24ef75GPU fixture for the packed integer dot products (cs_w32_dot_int)📊 Changes
8 files changed (+274 additions, -28 deletions)
View changed files
📝
docs/design.md(+2 -2)📝
runtime/test/shaders/build.py(+14 -3)📝
runtime/test/shaders/check.py(+7 -2)➕
runtime/test/shaders/cs_global_csub.asm(+138 -0)➕
runtime/test/shaders/cs_w32_dot_int.asm(+62 -0)📝
scripts/run_gpu_tests.py(+36 -14)📝
tests/conftest.py(+11 -5)📝
tests/test_rdna2_decode.py(+4 -2)📄 Description
Original description (mentions and
#Nreferences are disabled; the numbers refer to the old repository):Claim: https://github.com/ItsNotRexed/Leonida/issues/9522#issuecomment-7114878745 (new TEST item)
Re-submission of
#9672, which was closed in the PR cleanup. It builds on#7237by@xelerb-debug(also closed in the cleanup): that PR's two commits, the; mcpu:fixture header and itscs_global_csubfixture, are included here unchanged and keep@xelerb-debugas their author; this PR's own change is the last commit. If#7237is re-opened and merged first, this reduces to that last commit.What and why
docs/design.md's "Packed integer dot products" row is CPU-checked (tests/semantic) and measured withtools/hw_oracle, but no checked-in fixture runs the translation ofv_dot2_i32_i16,v_dot2_u32_u16,v_dot4_u32_u8,v_dot8_i32_i4orv_dot8_u32_u4on a GPU.runtime/test/shaders/cs_w32_dot_int.asmis a wave32 dump likecs_w32_new_ops/cs_w32_dot2_f16: lane 0 stores eight words, each derived in the file header from the row's rule (element products + S2, sign- or zero-extended elements, 32-bit wrap;clampsaturates the exact sum):v_dot2_i32_i160x0003fffe, 0x0005fff9, 100v_dot2_u32_u160xffff8001, 0xffff0003, 0xffffff000xffff7f04v_dot4_u32_u80x80ff0102, 0x7f02ff03, 5v_dot8_i32_i40x8f01f7a3, 0x12345678, -3v_dot8_u32_u47v_dot2_u32_u16 … clamp0xffffffff0xffffffffv_dot2_i32_i16 … clamp0x80008000twice,-20x7ffffffe: the products overflow, the sum does not, so no saturationv_dot2_i32_i16 … clamp0x80008000twice,00x7fffffffOut 1 and 3/4 use the same bits signed and unsigned, so a signedness mix-up changes a word; out 6 vs 7 checks that clamp saturates the exact sum, not a wrapped one.
Registered in
check.py(WAVE32_DUMPS+ expected words) andrun_gpu_tests.py(the three wave32 lists). The design row gets one sentence. The VOP2v_dot*c_*forms don't assemble with llvm-mc for gfx1013 or gfx1030, so they stay CPU-checked; the sentence says so.Tested
Windows 11, NVIDIA GeForce RTX 3070 (Ampere), driver 621.01, MSVC 19.44 (VS 2022 Build Tools), Vulkan SDK 1.4.363.1, llvm-mc 23.1.6 (conda-forge, AMDGPU), Python 3.12.10, on this branch (rebased onto
main2d53a8055):run_gpu_tests.py --filter cs_w32_dot: translated +spirv-val, PASS:129 4294934276 17032 4294967258 260 4294967295 2147483646 2147483647, all eight as derived.build.py+check.py:cs_w32_dot_int ok,cs_global_csub ok(#7237's fixture, still passing after the rebase).tests/test_rdna2_decode.pywithLLVM_MCset: the llvm-mc parity check passes on both new fixtures; it later fails oncs_w32_permlane_fi.asmandps_w64_a_discard.asm, exactly as onmain(#8044covers the permlane one).tests/test_run_gpu_tests.py,tests/test_runner_calls_all_tests.py,tests/test_rdna2_decode.py,tests/test_design_contract_rows.py,tests/test_docs_links.py,tests/test_docs_repo_paths.py: OK.tests/test_shader_checks.pyhas the same 15 failures with and without this change (the onesmainalready has,#7122).scripts/check_no_game_data.pyon the new fixture anddocs/design.md: clean.AMD:
@ThomasSAMPran it on an RX 9070 XT (RDNA4, Windows): the same eight words, plus a negative control (a zero-extendedv_dot8_i32_i4changes only out[3]); see the comments. An RDNA2 run is still open.AI-assisted: yes (Claude).
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.