Repository navigation
Conversation
The libdrm launcher refused a kernel whose descriptor has a group segment and capped its output at 4096 words, so lds_fuzz --oracle hw was exit 77 on Linux and no LDS program ran on RDNA2 outside Windows. Both are now gone; docs/shader_validation.md records the gfx1036 counts. - drm.py: program COMPUTE_PGM_RSRC2.LDS_SIZE (bits 15..23, 512-byte units) from the descriptor's group segment instead of refusing it. The assembler leaves that field 0 (measured: 4096 bytes of LDS give group 4096 and rsrc2 0x84), so the launcher fills it as the HIP runtime does. Only scratch memory (private) and COMPUTE_PGM_RSRC3 stay unsupported. - hw_oracle_drm.c: the output buffer takes 1..16384 words, matching the Windows launcher, so a 64x64 image_fuzz case (16384 words) fits. - asm.py: a wrapped (non-raw) kernel's LDS goes into its descriptor too, so the Linux launcher has a group segment to read. - lds_fuzz.py: the "more than 4096 words" wording no longer applies. Tests: test_hw_oracle.py gains a descriptor unit test (group segment to LDS_SIZE, 65536 ceiling) and two OnHardware tests (a kernel that writes, barriers and reads back LDS; 8192 words from 1024 threads), plus a check that LDS reaches the descriptor and metadata of a wrapped kernel. Verified on the integrated Radeon of a Ryzen 7 7700X (gfx1036, RDNA2, Linux 7.3.5-zen1-1-zen, libdrm 2.4.134, AMD clang 23.1.5): lds_fuzz --oracle hw --programs 500 --seed 1 matches 0 of 1000 (wave32+wave64) mismatches, image_fuzz --oracle hw --programs 120 --seed 1 0 of 120. AI-assisted (OpenCode).
|
Code read and CPU test check of
|
The linux-gpu-tools job on ubuntu-24.04 uses the system's libvulkan-dev, whose headers are too old for VK_KHR_pipeline_binary (vk_harness.cpp uses VkPhysicalDevicePipelineBinaryFeaturesKHR unconditionally). Add the same Vulkan headers cache + sparse checkout that the windows job uses and pass VULKAN_SDK during configure, so the pinned vulkan-sdk-1.4.363.0 release shadows the system headers. This job was added in ItsNotRexed#144; the vulkan-headers cache step was left out.
|
The CI checks show several failures, but none are caused by the changes in this PR. All are pre-existing on upstream
This PR changes only:
Verified locally on gfx1036 (Ryzen 7 7700X): |
|
Tested
|
bobcatchris
left a comment
There was a problem hiding this comment.
Verified on a clean checkout of the head (Windows, Python 3.12, CPU only — the Linux/drm paths I could not execute):
python -I tests/test_hw_oracle.py— 46 OK, 2 skipped (the hardware-gated ones).lds_fuzz's delta is only the 77-message wording, matching the widened cause.- The CI change does not touch the llvm-18
llvm-mcpin (lines 291/326/366 unchanged), so it does not collide with BUILD-923/#802; it swaps the apt Vulkan headers for a pinned KhronosGroup/Vulkan-Headers checkout (sparse, include-only, cacheable,persist-credentials: false) and points CMake at it viaVULKAN_SDK— coherent and reproducible. - The fix itself is the right shape:
COMPUTE_PGM_RSRC2.LDS_SIZEderived from the descriptor's group segment (with the measured rsrc2 0x84 cross-check) is exactly what the HIP runtime does, and raising the C launcher's output cap to match the Windows one removes the artificial 4096-word ceiling rather than special-casing around it. - Still unsupported on purpose: private/scratch memory and COMPUTE_PGM_RSRC3 — documented, not silently passed through.
Approving. The gfx1036 counts in docs/shader_validation.md come from the author's hardware; I verified everything that runs without it.
AI-assisted.
|
Reviewed head The descriptor side lines up. Reading group/private at byte 0 and rsrc3/rsrc1/rsrc2/properties at byte 44 matches the amdhsa Launcher conventions check out: exit 2 on bad args (the words cap 1..16384 matches Tests: 46 pass, 2 skipped (no GPU), compileall clean. I also mutation-checked the new logic, floor division instead of the ceil, 65535 instead of 65536, not clearing the field before the OR, and a 14-bit shift instead of 15, each one is caught by the new tests. The red CI checks are the known pre-existing set. I reproduced the translator one at this head ( No blocking issues, LGTM. kapitche's merged-tree run at AI-assisted. |
|
Verified merged with main on Linux: tests/test_hw_oracle.py passes (46 tests, 2 hardware skips) and the f16_trans_sweep, lds_fuzz (+cli, +hw), f32_fuzz, crosslane and ds_permute suites are green. merge-tree with #4152 and with #4204 is conflict-free; on a 3954+4152 combined tree the CPU oracle tests and #4152's own test_image_fuzz_hw (29 passed, 1 skipped) pass, and the 3954+4204 combined workflow keeps llvm-21 with no llvm-18 references. The gfx1036 libdrm results themselves need AMD hardware and were not re-measured here. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
hw_oracle (Linux): run the LDS fuzzers through libdrm
The libdrm launcher refused a kernel whose descriptor has a group segment
and capped its output at 4096 words, so lds_fuzz --oracle hw was exit 77
on Linux and no LDS program ran on RDNA2 outside Windows. Both are now
gone; docs/shader_validation.md records the gfx1036 counts.
units) from the descriptor's group segment instead of refusing it. The
assembler leaves that field 0 (measured: 4096 bytes of LDS give group
4096 and rsrc2 0x84), so the launcher fills it as the HIP runtime does.
Only scratch memory (private) and COMPUTE_PGM_RSRC3 stay unsupported.
Windows launcher, so a 64x64 image_fuzz case (16384 words) fits.
so the Linux launcher has a group segment to read.
Tests: test_hw_oracle.py gains a descriptor unit test (group segment to
LDS_SIZE, 65536 ceiling) and two OnHardware tests (a kernel that writes,
barriers and reads back LDS; 8192 words from 1024 threads), plus a check
that LDS reaches the descriptor and metadata of a wrapped kernel. Verified
on the integrated Radeon of a Ryzen 7 7700X (gfx1036, RDNA2, Linux
7.3.5-zen1-1-zen, libdrm 2.4.134, AMD clang 23.1.5): lds_fuzz --oracle hw
--programs 500 --seed 1 matches 0 of 1000 (wave32+wave64) mismatches,
image_fuzz --oracle hw --programs 120 --seed 1 0 of 120.
AI-assisted (OpenCode).