compute: lower the depth sample CL variants #3619
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!3619
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3617"
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?
@lambirou on GitHub · 2026-11-30 14:57 UTC · original
lambirou:compute/sample-depth-cl→main· +2271 −40 · 6 files · 7 commits · openStacked on #3606 and #3616 (
compute/gather4-variants→compute/sample-cl): the diff includes those commits until they land. Rebase after they merge.Part of the MIMG slice (P6). This adds the twenty depth/gradient sample CL forms:
image_sample_c_cd*,image_sample_c_d_cl*,image_sample_cd_cl*andimage_sample_d_cl*, with the_cl,_oand_g16suffixes.The RDNA 2 operand order is respected: packed offset, comparison reference, gradients, U, V, LOD clamp. The LOD is computed at translation time from the static slopes and the base view size declared by
--sample-gradient-view WIDTH HEIGHT MIPS: the larger axis length, nearest mip, then the minimum-LOD clamp._g16packs U in the low half and V in the high half. Comparison forms usedmask:0x1, a single VGPR destination and a finite reference in [0, 1]; non-comparison forms usedmask:0xfand four VGPRs. Descriptors, the constant sampler, an unguarded lane, a single view and static operands are validated; dynamic or out-of-view cases are refused. The other sample suffixes fall through to the generic refusal.Tests
compute_store_aot_gfx1013_sample_depth_cl_warpand_hardwarepass: 26 cases and 5 mutants detected on WARP and the AMD Radeon RX 9060 XT (driver 32.0.32029.2010).gather4_l,gather4_variantsandsample_clstill pass on both adapters (8/8 in the combined run), andcompute_store_aot_gfx1013_image_store_warppasses.form_coverage_check.pypins exactly the twenty forms;docs_links_check.pypasses;compute_mimg_float_store_check.pypasses after restoring the generic refusal forimage_sample_l.Limits
The model loads a texel at an explicit mip; it does not prove the console's native derived LOD. Slopes, coordinates, offsets, references and clamps must be static and lane-uniform; coarse forms assume uniform slopes. No
llvm-mcround-trip, debug layer or console measurement was run. The sample_cl base/bias/compare forms keep their own record, and the BVH forms stay uncovered.AI-assisted.
@lambirou on GitHub · 2026-12-01 03:12 UTC · original · reviewed
Reviewed
a8db8d69against #3616 (ac19d70d), focusing on the depth/gradient delta; not built or run.Verdict: approve for this delta; merge after #3616. The twenty
_d_cl/_cd_clforms and their_g16/_ovariants use the explicit gradient path, not the bias path that #3616 must fix. The sampler checks, operand order, g16 unpacking, comparison direction and offset clamp match the existing sample-CL model.aot.sample_gradient_level, the same function as the translator, so a wrong gradient model would pass the draw. The cases use exact one/two-octave slopes; add one row whose expected level is hand-computed or comes from a desktop sampler, especially at a rounding boundary.sample_gradient_leveluses Python double intermediates forhypot/log2; the hardware path is float32. The exact slopes avoid the difference today, but a boundary row would either justify the double path or expose a float32 rounding difference._g16packs U/V in the low/high halves and refuses subnormal components; the_c_cd/_c_dcomparison forms take red DMASK 0x1 and a static reference; the descriptor/sampler checks match the sample-CL path; out-of-range gradients are refused rather than silently clamped.@R0Y00 on GitHub · 2026-12-03 11:42 UTC · original
At
2dfa8d42the gather4, sample-cl and sample-depth-cl fixtures passed on WARP and RTX 4060 Laptop, including their mutation controls, with the D3D12 debug layer enabled. The offset correction matches #3606. Please leave this stacked behind #3606 and #3616 while the base bias question is open, then refresh against the landed commits so the PR diff can be reviewed as a depth-sample delta.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.