Commit Graph

183 Commits

Author SHA1 Message Date
bdf45c6030 Merge pull request #3954 from errusso
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:09:52 -05:00
7db1e35da1 Merge pull request #3949 from PeterGrieffindor
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:09:50 -05:00
57abbbe1a4 Merge pull request #3770 from Yawnz
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	docs/shader_validation.md
2026-11-22 23:08:23 -05:00
210813af2a Merge pull request #3666 from AwkGrep256
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	docs/design.md
#	docs/shader_validation.md
2026-11-22 23:08:11 -05:00
51013b44bf Merge pull request #3499 from Vonsek
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:07:34 -05:00
af1b3c96d2 Merge pull request #3061 from Vonsek
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	docs/shader_validation.md
2026-11-22 23:06:42 -05:00
fcda84bb0d Merge hw4-ps-oracle into hw4-ps-formats (#3499)
docs/shader_validation.md
tools/ps_oracle.py

AI-assisted.
2026-11-23 00:19:13 +01:00
f23b69060c 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.

- 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).
2026-11-22 23:40:40 +01:00
8744504763 Merge main into ps-helper-lanes (#3061 and #3273 are on main)
docs/design.md: main's versions of the rows next to "Whole-quad mode",
with this branch's edit of that row, once (a both-sides merge listed it
twice; test_docs_design_rows). docs/shader_validation.md: main's file
plus the helper-lane section, nothing else.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 01:40:15 +03:00
16a53cd532 shader_validation.md: cross-lane and DPP sweep hardware results on RDNA4 (gfx1201)
crosslane_fuzz.py --oracle hw on an RX 9070 XT (gfx1201, Adrenalin 26.11.2,
amdhip64_7.dll, AMD clang 23.0.0git from the rocm-sdk wheels):

- --dpp, seeds 1 to 8, 1,000 programs each: all 8,000 match (984 hyp_dpp,
  1,964 hyp_permlane, the counts of the RX 6700 XT run).
- --dpp-sweep --wave both: 14,412 cases, 14,412 match, 0 failing in every family.

Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
2026-11-23 00:37:22 +02:00
8c799453fb hw_oracle: an amdclang launcher on PATH is followed to the clang it is installed as
The rocm-sdk wheels put `amdclang` in the Python environment's Scripts (bin)
folder. find_clang() takes it first, because it is on PATH and lists the amdgcn
target, but ld.lld and amdgpu-arch sit beside the real clang, in the folder the
launcher reports as InstalledDir. With the wheels in a Python outside the
checkout the oracle then stopped with "no ld.lld next to the AMD clang", also
when HIP_PATH named a complete toolchain, and LEONIDA_AMD_CLANG was the only
way around it.

find_clang() now returns the clang in InstalledDir when the one it found has no
ld.lld beside it. A clang that has its linker is used where it was found, and a
launcher that names a folder without a clang is kept, so every setup that
worked resolves to the same compiler as before.

Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
2026-11-23 00:37:22 +02:00
3986b50821 Merge main into hw4-ps-oracle (#3061)
docs/shader_validation.md

AI-assisted.
2026-11-22 23:21:41 +01:00
e1b17b3a79 Merge pull request #3770 from Yawnz
# Conflicts:
#	docs/shader_validation.md
2026-11-22 17:03:40 -05:00
d672bc0330 Merge pull request #3734 from Vonsek 2026-11-22 17:03:32 -05:00
212dd72484 Merge pull request #3700 from Yawnz 2026-11-22 17:03:29 -05:00
8e31e26871 Merge pull request #3666 from AwkGrep256
# Conflicts:
#	docs/design.md
#	docs/shader_validation.md
2026-11-22 17:03:18 -05:00
980cef4c54 Merge pull request #3273 from AwkGrep256
# Conflicts:
#	docs/shader_validation.md
2026-11-22 17:01:12 -05:00
83473720a7 Merge pull request #3061 from Vonsek
# Conflicts:
#	docs/shader_validation.md
2026-11-22 17:00:29 -05:00
efa9dc1c5c Merge pull request #2886 from Jolymmiles
# Conflicts:
#	docs/testing.md
2026-11-22 17:00:01 -05:00
717cc69a8a Merge remote-tracking branch 'origin/main' into fix/image-fuzz-work-isolation
# Conflicts:
#	docs/shader_validation.md
2026-11-22 23:59:42 +02:00
9b7edc5add tools: isolate image fuzzer work output 2026-11-22 23:31:20 +02:00
bf73f8ea27 crosslane_fuzz: --ext adds wave64 carries, DS permutes, mask SALU with SCC and loops
Wave64 programs get v_*_co(_ci)_u32 through SGPR pairs and VCC, ds_bpermute_b32,
ds_permute_b32, ds_swizzle_b32, lane selects of 64 and up, the b64 mask ops with
an SCC probe, the saveexec/wrexec family, s_bfm_b64, s_wqm_b64 and SI_LOOP-shaped
loops. Seeds without the flag, and wave32 programs, are unchanged. The model was
checked on RDNA2 (gfx1036): 100/100 programs.

AI-assisted.
2026-11-22 22:26:44 +01:00
1f81022095 tools: isolate fuzzer work output per run 2026-11-22 23:23:06 +02:00
7353b6fbdd Merge branch 'radv-ps-oracle' into ps-helper-lanes
# Conflicts:
#	docs/design.md
#	docs/shader_validation.md
2026-11-23 00:18:06 +03:00
960466152f Merge branch 'pr3061-new' into radv-ps-oracle
# Conflicts:
#	docs/shader_validation.md
2026-11-23 00:17:29 +03:00
58bc80c331 tools: ps_helper_probe.py measures helper lanes at a triangle edge on RDNA2 (SHADER-681)
docs/design.md's whole-quad-mode row left helper-invocation behaviour at
triangle edges untested. The probe draws a triangle whose edge cuts 2x2
quads and runs seven wave64 raw-ISA pixel shaders through ps_oracle;
covered lanes read their helper neighbours through DPP quad_perm.

On gfx1036 (RADV, Mesa 26.3.1) all 10 checks hold: entry EXEC is the
covered pixels, s_wqm turns on exactly the quads with a covered pixel
(packed from lane 0), lane % 4 = (x & 1) + 2 (y & 1), helpers
interpolate their own pixel centre, their v0/v1 hold their own I/J
before s_wqm, and an exp vm with helpers on writes no pixel outside the
triangle. The design.md row now says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:13:40 +03:00
3a1ed28beb Merge main into hw4-ps-formats (#3499)
docs/shader_validation.md

AI-assisted.
2026-11-22 22:01:03 +01:00
dd0abd45b3 Merge main into hw4-ps-oracle (#3061)
docs/shader_validation.md

AI-assisted.
2026-11-22 21:57:30 +01:00
0d58747e0d ps_oracle: --format runs the pixel shader against other color targets
vk_harness takes VKH_COLOR_FORMAT=<VkFormat>:<bytes> for its color target
and writes the target's texels as stored. ps_oracle.py --format picks it
(the driver then picks the export format, as for a game pipeline), with
an integer-output const template for integer targets. docs gets the
export behaviour measured on gfx1036: 32_GR / 32_R take the last enabled
channels, a compr export reaches 16-bit UNORM/SNORM/UINT/SINT targets bit
for bit, FP16 targets get the halves as f16 (a NaN half becomes 0xfe00).

AI-assisted.
2026-11-22 21:42:29 +01:00
a66a71ffd3 Merge pull request #3318 from pmilewsskiedu-gif 2026-11-22 15:16:55 -05:00
608f33552d Merge pull request #3273 from AwkGrep256 2026-11-22 15:16:23 -05:00
3f2fc71fea Merge pull request #3191 from Weslley Couto
# Conflicts:
#	docs/design.md
2026-11-22 15:15:35 -05:00
1363748aeb Merge pull request #3061 from Vonsek
# Conflicts:
#	docs/shader_validation.md
2026-11-22 15:14:29 -05:00
ea09a5934b Merge pull request #2988 from Shrey Ratna 2026-11-22 15:13:51 -05:00
bb3bbeebe0 Merge pull request #2843 from Koro4e
# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-22 15:12:32 -05:00
825fc61a07 Merge pull request #2749 from jaybeebabageyus 2026-11-22 15:11:35 -05:00
777d218770 vk_compute_test: run 32-lane tests where the size is fixed but not requirable (MoltenVK)
MoltenVK reports subgroups 4..32 and requiredSubgroupSizeStages 0, so VKC_SUBGROUP_SIZE=32 printed "not available"
and the 32-lane compute tests skipped. The translator emits SPIR-V 1.5, where varying subgroup sizes are not allowed,
so Vulkan fixes SubgroupSize at the device's subgroupSize (32 there). vk_compute_test now runs a probe shader
(cs_wave_probe.comp, embedded) with the test's local size and flags first, checks every invocation's lane, subgroup
number and ballot width, and runs the test if they match. If they don't, the test fails (exit 1) instead of being
skipped. Full subgroups are requested where local size X is a multiple of maxSubgroupSize. Devices whose default
isn't the requested size keep printing "not available".
2026-11-23 00:04:20 +04:00
c82fbe37d1 Shader: flush legacy f32 multiply operands and results in default MODE
Match RDNA2 mode-0 denormal semantics and legacy zero override; flush product before output scaling and normalize modifier zeros. Add synthetic semantic/GPU fixtures and documentation. AI-assisted (GPT-6).
2026-11-22 15:03:13 -05:00
adefa18b13 tools: ps_oracle.py runs on Linux AMD GPUs (RADV backend)
RADV returns VK_KHR_pipeline_binary data as one binary per stage
(radv_shader_serialize), not the AMD Windows driver's single PAL ELF, so
ps_oracle exited 77 on every Linux AMD GPU. Find the pixel stage, its
code, sizes, num_vgprs/num_sgprs and rsrc1 by values that must agree
(radv_shader_info's size changes between Mesa versions), replace the
code and raise the VGPR counts. GFX10 only (GFX11+ is refused with
"unsupported architecture"); --set stays PAL-only.

Checked on gfx1036 (RADV RAPHAEL_MENDOCINO, Mesa 26.3.1); an RX 9070 XT
(RADV GFX1201) is refused with exit 77.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:45:59 +03:00
35a33bb29d Merge remote-tracking branch 'upstream/main' into shader-340-rdna1-denorm
# Conflicts:
#	docs/design.md
2026-11-22 16:45:30 -03:00
533d5533a6 SHADER-340: measure RDNA1 mad/mac denormal flush and flush before omod 2026-11-22 16:34:15 -03:00
4c414d1216 tools: ps_oracle.py runs hand-written RDNA2 pixel-shader ISA on AMD GPUs
hw_oracle launches compute kernels only. vk_harness can now write a
pipeline's VK_KHR_pipeline_binary data and build a pipeline from it
(VKH_BINARY_OUT / VKH_BINARY_IN). ps_oracle.py puts assembled ISA in
place of _amdgpu_ps_main in the driver's PAL ELF, raises the pixel
stage's register counts in the msgpack metadata, optionally changes
other metadata entries, and draws with it, reading every pixel's mrt0
words back.

Checked on gfx1036 (driver 26.10.1): v_interp of a varying and the
parameter words P0 / P10 come back as expected. Tests in
tests/test_ps_oracle.py, docs in docs/shader_validation.md.

AI-assisted.
2026-11-22 20:15:34 +01:00
820e9bc877 image_fuzz: accept the driver's one-ulp UNORM8 conversion in the translator oracle
The translated image_load fetches a UNORM texel through a float view, so the 8-bit -> float conversion is
the driver's. RDNA2 returns the correctly rounded c / 255; llvmpipe multiplies by an f32 1/255, one ulp
above it for 126 of the 256 byte values (27: 0x3dd8d8da, not 0x3dd8d8d9). The comparison was bit exact
and a run stops at its first mismatch, so on llvmpipe every run ended at its first R8G8B8A8_UNORM case
and the other formats never ran.

The translator oracle now accepts one ulp on a UNORM8 texel component, never on another format or on the
sentinels of registers dmask leaves unwritten, and the summary counts how many components needed it.
--oracle hw stays bit exact.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:01:57 +00:00
337f714c06 docs: drop stray duplicate fma_mix result rows
Two rows were appended after the prose with no table header; the same results are already in the table above.
2026-11-22 19:28:12 +01:00
3d293c2c82 Merge pull request #2551 from nonverifiedperson
# Conflicts:
#	docs/design.md
2026-11-22 13:16:07 -05:00
1c21007cea Merge pull request #2514 from Vonsek 2026-11-22 13:15:51 -05:00
eefaba67db Merge pull request #2431 from Vonsek 2026-11-22 13:15:16 -05:00
309915ac6f Merge pull request #2421 from Bora Sevim
# Conflicts:
#	docs/design.md
2026-11-22 13:15:13 -05:00
87f5e0dbf4 Merge pull request #2410 from d7ommy
# Conflicts:
#	docs/design.md
#	docs/shader_validation.md
2026-11-22 13:15:07 -05:00
6245dd09cf Merge pull request #2371 from Vonsek 2026-11-22 13:14:19 -05:00