Repository navigation
docs(shader): measure explicit-LOD gather level selection on gfx1036 - #23856
Merged
oneandonlydean merged 1 commit intoNov 19, 2026
Merged
Conversation
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.
What
Measures the level selection of the [Explicit-LOD gathers] entry of
docs/dev/debt/shader.md(added by #12790): "(image_gather4_l, 2D, no offset or depth compare) are emulated, not measured on hardware" and its "Unverified there:" list. No code changes.Measured on gfx1036 (driver 31.0.22044.1) with the hardware oracle, wave32. Fixture:
image_gather4_lDIM 2D through a 2D T# over the surface ofImageGatherLod.cpp(16x16, 5 levels,8_8_8_8_UNORM, linear, every level's 2x2 footprint distinct so the returned words name the level), T#/S# words from a generator;image_sample_lsiblings as controls. 128 LODs per dispatch: -1 to 5 in 1/16 steps, the exactn + 0.5ties, and probes just below and above them.v_mov_b32 v10, 0x2aprobe 32 of 32;image_load_mipreads each of the 5 levels 32 of 32 (levels stored smallest-first; a largest-first control is 32 of 32 wrong);image_sample_landimage_gather4_lat integer LOD 0..4 each read their own level 32 of 32.n + 0.5and the tie goes up (0.5 -> 1, 1.5 -> 2, 2.5 -> 3, 3.5 -> 4); probes 1/4096 to 1/512 below 0.5 and 1/1024 below 1.5 also go up, 1/256 below 0.5 stays at 0.LOD_BIAS(+1.0, -0.5, +0.25) is added before the S#MIN_LOD/MAX_LODclamps;image_sample_lpicks the same level as the gather 128 of 128.MIP_FILTERnone reads the T#MIN_LODrounded down (1.75 -> 1, 2.5 -> 2) at every LOD; the T#MIN_LODis applied after the S#MAX_LOD; linearMIP_FILTERgather returns the same words as point 128 of 128 (theimage_sample_lcontrol blends, so the field is live);LOD_BIAS_SECraw 0x08/0x10/0x30 changes nothing (384 of 384 lanes).MIN_LODbefore S#MAX_LOD: 128). 18 mutation controls fire, no-op silent.verify_lod.py, imports neither the fixture nor the checker; rebuilds the surface and asserts its hash, decodes every T#/S# from the bodies, predicts all 16 output words per lane): 0 of 43,008 words off, the 84 linear-blendimage_sample_llanes within 0.074/255; it also rejectsMIP_FILTERnone rounding the T#MIN_LOD(256 lanes off); 19 mutation controls each fire from that passing baseline. A model that also rounds the LOD to 1/256 first matches every lane; that is a fit to the sub-1/256 probes, not a measured mechanism, and is not written into the entry.Code reading (not a measurement): the shader rounds with
GLSLstd450Ceiloflod + 0.5minus 1 (core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp:1083), so it gathers one level lower than the hardware at an exact tie. This PR records that in the entry and does not change the code.Evidence (runners, every dump, claims worksheets, checker, verifier, overlap sweeps, SHA-256 ledger): https://gist.github.com/brumskysb/a8b17ad91187303d26c28b05510a6a50
Tested
gfx1036, driver 31.0.22044.1, Windows 11. Harness:tools/hw-oraclevia the campaign'srigio.py(in the gist).aa698cdc08, themainfetched before the edit; it changes only line 307 ofdocs/dev/debt/shader.md.The edit removes "not measured on hardware" and the "Unverified there:" lead, keeps the shader's rules verbatim as the description of what the emulation does, and adds one measured sentence after them.
Before:
After:
Added sentence:
CHANGE SUMMARY (from the gate):
Removed phrases declared to the gate:
emulated, not measured on hardware:,shader. Unverified there:. "emulated" and "shader" are re-added; "not measured" is re-added for mirror-once, +-2^24, wave64 and the PS5's gfx1013. The sentences on tables, border modes, offsets, compares, arrays, 3D, cube,image_gather4_band 1D are unchanged.Notes
debt-length: the entry grows from 975 to 1,425 characters, over the 1,000 guideline (CI warning). It was already at 975, and every added clause is a measured condition or a still-unmeasured scope; trimming it is left to a separate PR rather than dropping a condition here.LOD_BIAS_SECvalues, T# base level above 0, other formats and surfaces, wave64, other parts, and the console's gfx1013.overlap_sweep.pyonaa698cdc08(2,006 open PRs, 86 candidates, 86 evaluated, 0 hits; controls A/B fire, C silent). No open PR edits this entry.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attached to this PR)