compute: lower the MIMG sample CL variants #3616
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!3616
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3614"
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:27 UTC · original
lambirou:compute/sample-cl→main· +1391 −40 · 6 files · 6 commits · openStacked on #3606 (
compute/gather4-variants): the slice extends the gather4 variant table and its coverage pin, so the diff includes that commit until #3606 lands. Rebase after it merges.Part of the MIMG slice (P6). This adds the eight non-depth
sample_clforms:image_sample_cl,image_sample_cl_o,image_sample_b_cl,image_sample_b_cl_o,image_sample_c_cl,image_sample_c_cl_o,image_sample_c_b_clandimage_sample_c_b_cl_o. Theclsuffix applies the LOD clamp (the same minimum-LOD interpretation as the pixel_clpath),oadds the texel offset,bthe bias andc/c_bthe depth comparison with its reference.Refusals: dynamic coordinates, offsets, biases, references or clamps; out-of-range bias/clamp/reference values; the DMASK one-hot/full rules; a missing or moving sampler; and the descriptor guards of the neighbouring sample forms. The depth
_d_cl/_cd_cl/_g16families and the BVH forms stay out of this slice.Tests
compute_store_aot_gfx1013_sample_cl_warpand_hardwarepass: 16 cases and 4 mutants, 0 mismatch on WARP and the AMD Radeon RX 9060 XT (driver 32.0.32029.2010).compute_store_aot_gfx1013_gather4_land_variantsstill pass on both adapters;pixel_aot_sample_clamp4/4;form_coverage_check.pyanddocs_links_check.pypass.Limits
The desktop model loads the selected texel at an explicit mip; it does not prove the console's native derived LOD. The
_CLmeaning remains the minimum-LOD interpretation (LLVM/Mesa) rather than the ISA table's upper bound. Nollvm-mcround-trip or console measurement was run.AI-assisted.
71d4146d5dtoac19d70d24@lambirou on GitHub · 2026-12-01 03:11 UTC · original · reviewed
Reviewed
ac19d70dagainst #3606 (46d53f76), focusing on the sample-CL delta; not built or run.Verdict: changes requested. The
_clmodel applies the bias before the clamp aslod = max(bias, clamp), but the compute path has zero derivatives. With zero derivatives the implicit LOD islog2(0) = -inf; a finite bias leaves it at-inf, the sampler's MIN_LOD (0) clamps it to 0, and only the_clminimum can raise it. A bias must not raise the selected mip.tools/compute_store_aot.py, sample-CL branch (lod = max(bias if bias is not None else 0.0, clamp)): use the clamped implicit LOD instead, e.g.max(clamp, 0.0)when a clamp is present and0.0otherwise. The current rowsb_cl_lod1(bias 1, clamp 0),b_cl_bias_rounds(1.5, 0) andb_cl_bias_above_clamp(2, 1) expect mips 1, 2 and 2; under the corrected rule they read 0, 0 and 1. The comparison rowsc_b_cl_less,c_b_cl_equalandc_b_cl_o_lod1have the same problem. Updatesample_cl_level,sample_cl_caseand the expected words.sample_cl_levelrepeats the translator's formula, so the draw cannot catch this error. After the fix, use an independent expected mip for at least the bias-above-clamp row (desktop sampler or hand-computed).is_word(reference)and validates the[0, 1]range only when the value is a literalint. The docs claim a reference in[0, 1]; either refuse a non-literal reference or emit the same range check.max(bias, clamp)expression is inherited in the gather4 variant branch from #3606 and is already covered by the review there. Fixing #3606 will also update this stacked diff.Checked, no finding: operand order (offset, bias, reference, U, V, clamp), the one-hot DMASK and red-channel comparison rules, the descriptor/sampler validation, and the
_oedge clamp. The stack order remains #3606 → this PR → #3619.@R0Y00 on GitHub · 2026-12-03 06:53 UTC · original
The #3606 stack now has a reproduced offset/clamp edge failure in its inherited gather4 helpers. The review on #3606 has the synthetic cases and exact WARP/RTX readbacks. Please carry that fix into the base first, then rebase #3616 and #3619 and rerun their sample tests alongside the gather4 edge cases.
@R0Y00 on GitHub · 2026-12-03 11:41 UTC · original
At
cbc9fb4athe offset correction matches #3606 and both draw-mimg-gather4 and draw-mimg-sample-cl passed on WARP and RTX 4060 Laptop, including their mutation controls, with the D3D12 debug layer enabled. The branch still carries the #3606 bias forms and remains stacked behind its open bias/zero-derivative review. Once the base lands, please make the PR diff show just the sample CL behavior and rerun checks.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.