Repository navigation
Conversation
lambirou
left a comment
There was a problem hiding this comment.
Reviewed a8db8d69 against #3614 (ac19d70d), focusing on the depth/gradient delta; not built or run.
Verdict: approve for this delta; merge after #3614. The twenty _d_cl/_cd_cl forms and their _g16/_o variants use the explicit gradient path, not the bias path that #3614 must fix. The sampler checks, operand order, g16 unpacking, comparison direction and offset clamp match the existing sample-CL model.
- SHOULD The fixture computes its expected mip with
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. - NIT
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. - Checked, no finding:
_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. - The inherited CL bias branch from #3614 remains in the diff; it will be fixed there before this PR is rebased.
|
At 2dfa8d4 the 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 #3604. Please leave this stacked behind #3604 and #3614 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. |
Stacked on #3604 and #3614 (
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.