shader: lower experimental gfx1030 2D gradient sample clamps #2753
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!2753
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2753"
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?
@stan495 on GitHub · 2026-11-26 06:00 UTC · original
stan495:codex/gfx1030-mimg-gradient-clamp-independent→main· +189 −34 · 5 files · 1 commits · draftBehavior
Extend the opt-in gfx1030
--sample-clamp-mips2D experiment to eight ordinary gradient forms:image_sample_d_cl,image_sample_d_cl_o,image_sample_cd_cl,image_sample_cd_cl_o, and their_g16counterparts. Translate to desktopSampleGradwith the explicit gradients, optional immediate offset, and a known minimum LOD. The existing 2D sampler profile still applies: point mip selection, zero sampler bias and minimum LOD, and a maximum LOD that includes the view. The instruction clamp must be a known finite LOD in the view; coarse forms still require statically known finite slopes. Comparison sampling is not part of this patch.The new forms still report
Unsupported instructionby default, with the instruction name andrequires --sample-clamp-mipshint. Existing plain-clamp diagnostics and the unclamped gradient test file are unchanged. The gradient fixture also rejects an out-of-view clamp, a wrong address width,a16, a read beforevmcnt(0), and non-finite coarse slopes.Based on
594bb3ce639be18bd8b28cf950f362506d275b66, which contains #1638. Replays the ordinary gradient-clamp patch from stan495/Xbox2Windows#19. Refs #809 (related MinLod reproduction; does not close it).This is an experimental draft. Desktop minimum LOD is not proof of native gfx1030 clamp direction. The fixture records no semantic coverage for these eight forms. Capture native readback both below and above the clamp on each encoding before promoting them.
Offline verification on
0c31840ffcfc3779c6a1e3521ef03809116ac377All four commands passed in LLVM 15. The eight new encodings passed the assembly, disassembly, intrinsic address-order and container CLI checks. Four plain/bias clamp and eight unclamped gradient forms passed regressions.
All eight commands passed; the compile checks used DXC 1.9.2602.17.
rdna2_tools_check.pyreported 138 passing subtests and 19 internal skips out of 157.git diff HEAD^ HEAD --checkpassed.git merge-tree --write-tree <base-or-head> HEADwas clean for upstream594bb3ce, #274872f443fb, and fork #18fb02ff90. The older fork #21 (c8b0bd8c) and #22 (02f40ab7) heads conflicted on shared files in simulation; the tested refreshed heads (ebbea156,b0f8da17) did not. The integration coordinator also verified the cumulative eight-head stack, including the gather changes, against594bb3ce: ordinary-first and comparison-first produced the same merged tree. These simulations are not execution evidence.Windows desktop verification on
0c31840ffcfc3779c6a1e3521ef03809116ac377From the topic worktree, using its
dev(Debug) preset, the shared development Python environment, and a short gitignored temporary directory:The build succeeded with MSVC 19.44.35230.0 and DXC 1.9.2602.17. CTest finished in 167.83 s: 19 passed, 0 failed, 0 capability skips (8 hardware, 8 WARP, 3 non-rendering tests). The passing
rdna2_tools_checkreported 138 passes and 19 internal skips out of 157 Python subtests. The short temp path avoids the long-path extractor errors recorded separately on the earlier replay; that earlier run is not included in this result.Windows 11 build
26300.9974; D3D12 debug layer unavailable on both adapters.pixel_aot_sample_gradient_clamp_hardwarepassed in 17.43 s on Intel Arc B390, driver32.0.101.8509.pixel_aot_sample_gradient_clamp_warppassed in 9.88 s on Microsoft Basic Render Driver (WARP), driver10.0.26100.9818.For each adapter, all eight translated forms and independent direct HLSL
SampleLevelcontrols matched the full 8×8 RGBA CPU reference at both LODs. All 16 mutated images also matched their own full CPU reference and failed against the original expectation. The first readback mismatches forimage_sample_d_clwere at(0,0)in red on both adapters:0.5(0x3f000000)0.25(0x3e800000)0.75(0x3f400000)0.5(0x3f000000)The same CTest JUnit and matching form records count 43 gfx1030 forms, including 26 MIMG forms, from the passing LOD, offset, ordinary and coarse gradient, compare-sample and gather regression fixtures. The two experimental gradient-clamp fixtures emit no
FORM_COVERAGE_RECORD: 0 of the eight new forms are added to native semantic coverage. The tests execute translated and direct desktop DXIL, not native gfx1030 code.Desktop verification on
0c31840ffcfc3779c6a1e3521ef03809116ac377CTest: 19 passed, 0 failed, 0 capability skips.
rdna2_tools_checkreports 19 LLVM-dependent internal skips separately. On Windows 11 build26300.9974with the D3D12 debug layer unavailable, WARP10.0.26100.9818and Intel Arc B390 driver32.0.101.8509matched the full CPU reference using both translated shaders and the directSampleLevelcontrol. At(0,0)in the 8x8image_sample_d_clfixture, dropping the floor changed red from0.5to0.25; zeroing the higher gradient changed red from0.75to0.5. Both mutants matched their own CPU images. Same-run records cover 26/111 gfx1030 MIMG forms from the targeted regressions; none of the eight experimental forms add coverage. These are desktop results, not native gfx1030 execution.On the earlier local replay (
2942f24ec6f2c58487d816b91c77a10abe8eb9ca), 18 tests passed, with one unrelatedrdna2_tools_checkfailure caused by the long Windows temporary path. A separate rerun of that regression with a shortTMPandTEMPpassed. The clean-head suite above used the short paths from the start.Before opening this PR,
git merge-tree --write-treecompleted cleanly against upstream5f27d8cf658cf11ea720fca8149e4f6cce6b7517and with the planned comparison-gradient and gather batches in order. This is separate from the execution results.AMD desktop verification on
0c31840ffcfc3779c6a1e3521ef03809116ac377Tested clean head
0c31840ffcfc3779c6a1e3521ef03809116ac377on Windows 11 build10.0.26200.9974with MSVC19.44.35228.0, DXC1.8.2502.11, Python3.12.10(out/pe-env), short temp directory (out/t), and D3D12 debug layer enabled (debug_errors=0 debug_warnings=0on all draws).rdna2_tools_check.py:Ran 157 tests,OK (skipped=19)LLVM-dependent internal subtests).1002:744c, driver32.0.32029.2010) + WARP (10.0.26100.9818): 19 passed, 0 failed, 0 capability skips (pixel_aot_sample_gradient_clamp_hardwarepassed in12.40 s,pixel_aot_sample_gradient_clamp_warppassed in8.04 s;rdna2_tools_checkpassed with 19 internal LLVM skips). Same-run form coverage: 43/1863 gfx1030 forms (26/111 MIMG forms) from regression fixtures; 0 of the 8 experimental gradient-clamp forms added.1002:164e, driver32.0.21045.29003):pixel_aot_sample_gradient_clamp_hardwarepassed in12.22 s(1 passed, 0 failed).SampleLevelcontrols matched the 8×8 RGBA CPU reference (max_absolute_error=0,debug_errors=0 debug_warnings=0). First mutation mismatches forimage_sample_d_clat(0,0)red (channel=0):raised(0.50x3f000000->0.250x3e800000) andhigher(0.750x3f400000->0.50x3f000000). These remain desktop DXIL results, not native gfx1030 execution.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.