Repository navigation
Conversation
lukaslw-lab
approved these changes
Dec 2, 2026
lukaslw-lab
left a comment
Contributor
There was a problem hiding this comment.
Reviewed 7e2560a1 (draft) by reading the diff; not built or run.
Verdict: approve. Each new waterfall form still selects exactly the lanes whose key equals the read key, and every new scratch register is poisoned. No MUST.
- SHOULD Run a before/after
ps86census onf365f125. The W6 row (~115) comes from the shape sample. The waterfall walls on main (the key, descriptor and EXEC copies overlap376,the slot key is not shifted252,the image does not use the descriptor121) show how many stages reach this matcher, and the census would show how many it now clears. - NIT The poisoned-register loop (
gfx1013_direct_graphics.inl:2221) is also edited by #3834 (drop_compare_mask). This version already erases the compare masks, so on rebase it can absorb #3834's call. - Checked, no finding:
- Compare form (
gfx1013_pixel_waterfall.inl:69):v_cmp_eqinto VCC or a pair, then ans_and_saveexecatcmp.nexton that destination, gives the same partition asv_cmpx_eq. Both destinations are checked against the key, descriptor and EXEC copies, and are forgotten after the loop (:148). The key may be on either side of the compare. - A non-in-place shift must read the key and write an ordinary SGPR. The load must use that register as its offset, and the overlap checks cover it.
- Immediate offsets: an aligned
load.b(:92) becomesdescriptor.offset. In the lowering (:2248), the key is converted from bytes to slots beforebase_slotis added, the span moves by the same amount, and the wrap is checked. The bound-table path now accepts only offsets that are multiples of 32. readonly_imageadds only explicit-LOD forms plusget_resinfoandload_mip. Biased samples, implicit gathers and compares stay out.
- Compare form (
Tests: _controls (11 shapes, 16 refusals) is in the pr filter. _warp/_hardware (the offset mode at mip 1, plus sentinels) ran only locally.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extends native pixel descriptor waterfall recognition (
PixelWaterfalls, item W6 of #3814, ~115 stages) acrosss_clause,v_cmp_eq + s_and_saveexecpartition forms, non-in-place slot shifts, aligned SMEM immediate offsets, and additional read-only image operations.Part of #3814. Refs #3210, #3640, #3641, #3703, #3823.
(Opened as Draft per #3514 until an active review slot frees.)
Summary
src/gfx1013_pixel_waterfall.inl:s_clauseinidle, both operand orders forv_cmp_eq_{i32,u32}/v_cmpx_eq_{i32,u32}, and wave32/wave64v_cmp_eq_{i32,u32}+ immediates_and_saveexec_{b32,b64}(through VCC or SGPR pairs, poisoning compare/save destinations and checking all register overlap hazards).s_lshl_b32 sOff, sKey, 5(poisoningsOff), aligned 32-byte SMEM immediate offsets ((load.b & 31) == 0), and additional read-only float SRV image opcodes (image_load_mip1,image_get_resinfo14,image_sample_d34,image_sample_l36,image_gather4_l68,image_gather4_lz71) alongside0,32, and39.src/gfx1013_direct_graphics.inl&src/gfx1013_direct_compute.inl:descriptor.offset / 32with 32-bit wrap checks, and clearssaved_exec/invariant_entry_masks/compare_masks/broken_compare_maskson poisoned waterfall scratch registers.tests/native_pixel_waterfall_w6_check.py+tests/cmake/native_pixel_waterfall_w6.cmake+tests/native_sampled_pixel_gpu.cpp+docs/experiments/native-pixel-waterfall-w6.md+README.md:native_pixel_waterfall_w6_controls(runs inprCTest preset): 11 translated shapes + 16 refusal controls.native_pixel_waterfall_w6_{warp,hardware}: 4 GPU draws matching all 28 covered pixels + 4 sentinel pixels on WARP and RTX 5080.Verification
Host: Windows 11 (
10.0.26200.9974), MSVC C++20/W4(zero warnings on edited lines), inbox WARP (10.0.26100.9818), NVIDIA GeForce RTX 5080 (32.0.16.2140; D3D12 debug layer unavailable). Baseorigin/mainf365f125.ctest --preset pr --no-tests=error -R "^native_pixel_waterfall_w6_controls$": 1/1 passed (11 positive + 16 refusals).dev) & Release (release): 11/11 passed in both configs (native_pixel_waterfall_w6_*,native_indexed_pixel_texture_*,native_sampled_pixel_*,native_direct_container,native_graphics_wqm_*), zero skips.tests/bidi_controls_check.py,tests/docs_links_check.py,git diff --check origin/main..HEAD: all clean.