Repository navigation
SHADER-836: what tier C costs in pixels, at subgroup 64 and 32 on one AMD GPU - #7613
emirduran707 wants to merge 3 commits into
Conversation
…2 on one AMD GPU vk_ps_sweep takes VKS_SUBGROUP=32|64 and draws the pixel shader with that required subgroup size (subgroupSizeControl, fragment stage in requiredSubgroupSizeStages; exit 77 otherwise). ps_sweep.py run passes it with --subgroup, ps_sweep.py sample --tier-n samples each wave64_graphics tier on its own, and compare breaks the classes down by tier and tier C reason. On an RX 9060 XT (AMD 26.10.44), 360 translated pixel shaders, seed 836: tier A 93/93 the same at 64 and 32; tier B 3 of 27 differ (all carry readfirstlane-uniform); tier C 21 of 240 differ in the gradient variant, 6 in the zero variant. Re-draws at the same size are bit-identical. Counts only, in docs/shader_validation.md. AI-assisted (Claude Code). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested
AI-assisted. |
|
Tested What I ran: built
AI-assisted: yes (Claude ran the build and tests; results checked by me). |
…-exact counts and the clear-only denominator (SHADER-836) Ekabusto noted on ItsNotRexed#7613 that the tolerance compare calls bit-cast integer words equal (they are denormals). compare --exact now prints the same per-tier / per-reason breakdown; on the RX 9060 XT sample it gives the same 24 (t) and 9 (z) draws, and 104 of the 240 tier C shaders write only the clear colour. AI-assisted (Claude Code). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@Ekabusto thanks, that is a real gap, and the fixture check is a good one. In I re-ran it bit-exactly on my RX 9060 XT sample:
These are the same draws the tolerance compare reported, so on this sample no shader differs only in bit-cast integer words. The table stands. Your note also brought out a caveat, which I added to the doc. 104 of the 240 tier C draws are clear-only: they write nothing but the clear colour, mostly because they read a zeroed heap and discard. The meaningful rate is therefore 21 of the 136 that write, about 15 %. AI-assisted (Claude Code). |
|
Tested Ran:
No validation messages in any run.
No unit test covers AI-assisted: yes (Claude Code); results reviewed by me. |
…the tier breakdown (SHADER-836) job_env now sets VKS_SUBGROUP itself and counts it among the per-job variables it clears, so a value left in the shell no longer reaches runs made without --subgroup. New tests cover that and print_tier_breakdown (per tier, per tier C reason, a shader with two reasons, a sample made without --tier-n), the gaps alvaroolt listed on ItsNotRexed#7613. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@alvaroolt thanks for the run on both GPUs, and for the table. Your iGPU's exit 77 on 32 and 64 is the case the doc comment describes: that driver lists only the compute stage in You were right about the coverage gaps.
The second change also fixes a small bug.
AI-assisted (Claude Code). |
SHADER-836 (the pixel side; claim). The compile and size side is SHADER-836b, done by @Etr0p in #7333 without code. #7161 (@Invictus2076) covers the synthetic fixtures.
What
The two-GPU pixel sweep (
tools/ps_sweep.py,vk_ps_sweep) compares two 32-wide GPUs, so it cannot show tier C oftools/wave64_halves.py: a tier C shader is inexact the same way on both. An AMD RDNA GPU whose driver lists the fragment stage inrequiredSubgroupSizeStagescan draw one shader at subgroup 64 and again at 32. Only the subgroup size changes between the two draws.vk_ps_sweep:VKS_SUBGROUP=32|64setsVkPipelineShaderStageRequiredSubgroupSizeCreateInfoon the fragment stage and enablessubgroupSizeControl. The run exits 77 when the device cannot require that size. Without the variable nothing changes.ps_sweep.py run --subgroup Npasses the size on.ps_sweep.py sample --tier-n C=240,B=27,A=60samples eachwave64_graphicstier on its own. A rare tier gets the count asked for instead of its share of the population.sample.jsonrecords the tier and the reasons.ps_sweep.py compareadds a breakdown by tier, and for tier C by reason.docs/shader_validation.mdgets a new subsection with the measurement. It contains counts only.Result (RX 9060 XT, AMD 26.10.44, 360 pixel shaders, seed 836)
The table shows the gradient-texture variant. With fallback (zero) images, tier C drops to 2 + 4.
readfirstlane-uniform. I'll post that as afinding:in the coordination issue.Tested
python -I tests/test_ps_sweep.py: 24 tests, OK (3 skipped). A new test covers the tier-weighted sample.vk_ps_sweepbuilds and draws atVKS_SUBGROUP=64and32. Requiring 16, which the device does not offer, exits 77.sample.jsonstays local.AI-assisted (Claude Code).
🤖 Generated with Claude Code