docs(debt): measure v_interp f16 denormal modes 1/2 and directed rounding on gfx1036 #18026
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18026"
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?
Imported from boykopovar/AnyPS5. Originally posted by brumskysb on 2026-11-10T05:26:08Z.
What
Measures the gap clause of the v_interp_p1ll_f16, v_interp_p1lv_f16 and v_interp_p2_f16 entry of
docs/dev/debt/shader.md— "Denormal modes 1 and 2 (flush only inputs or only outputs) and rounding other than to nearest even are not measured and throw" — on a second RDNA2 part.Measured on gfx1036 (driver 31.0.22044.1) with the hardware oracle, wave32, one work-group, the parameters written to LDS by a compute dispatch and read with
v_interp_*(layout measured first: M0 is a byte address, attribute stride 48 bytes, P0 +0 / P10 +4 / P20 +32 for channel x):InterpolationModes.cppRowsin the 8 pinned modes reproduce 768/768 words of the gfx1035 table. That is a family-level reproduction (pin from gfx1035, this part gfx1036), not a re-measurement of the entry's numbers.v_add_f32/v_add_f16odd ties, 384/384.The recompiler still throws in all of these modes (
interpolationModeF16inAttributeInstructions.cpp, read at this base): the entry keeps "throw". That is a code reading; no code changes in this PR.Evidence (fixture, layout probe, row generators, runners, checkers, all 172 dumps as one bundle, per-dump SHA-256 ledger, claims worksheet, full results): https://gist.github.com/brumskysb/a48e81092e9a459dcac4ead9c5e72479
are,throw.; addedthrow. Measured on gfx1036 (driver 31.0.22044.1) with the hardware oracle at wave32, separate from the implementation: …,measured, and none of these modes is,on gfx1035. None of that is implemented: the recompiler still throws for denormal modes 1,2 and for rounding other than to nearest even, so these rows record hardware it does not yet model.The two removed words are re-added inside the longer clause; no measured condition was dropped.gabichuuuuu's non-blocking review asked for the gfx1036 measurement to stand apart from the implemented behaviour with an explicit "measured, not implemented, still throws". The measurement clause now opensMeasured on gfx1036 … separate from the implementation:and closes by saying none of it is implemented, becauseinterpolationModeF16(Translation/src/AttributeInstructions.cpp:109-118) throws for any round field other than 0 and any denormal field outside {0,3}. No measurement changed in that edit; the lengths quoted above are updated.Tested
gfx1036, driver 31.0.22044.1, Windows 11; harnesstools/hw-oraclethroughrig_runner.py, wave32, 32 rows, one work-group, LDS 4096, DX10 clamp 1, fp16_overflow 0.v_interp_p1ll_f16 v35, v30, attrN.x,v_interp_p2_f16 v36, v31, attrN.x, v32,v_interp_p1lv_f16 v37, v33, attrN.x, v34, thenv_readlane_b32/v_writelane_b32into lane N of v10..v12.step2_check.pyandstep3_check.pyrecompute every count from the dumps. GistREADME.md,dumps_bundle.jsonandstep3_check.pyraw-URL SHA-256 equal the local files.The replaced region, copied from
check_entry_edit.py's REPLACED REGION:before:
... Denormal modes 1 and 2 (flush only inputs or only outputs) and rounding other than to nearest even are not measured and throw. An unknown mode follows IEEE=0 with denormals kept. ...after:
... Denormal modes 1 and 2 (flush only inputs or only outputs) and rounding other than to nearest even throw. On a second part, RDNA2 (gfx1036, driver 31.0.22044.1), they were measured with the hardware oracle in wave32: bit 0 of each denormal field keeps the denormal inputs listed above for that precision and bit 1 its denormal result, at bothIEEE_MODEvalues with nearest-even rounding; with each denormal field 0 or 3, v_interp_p1ll_f16 and v_interp_p1lv_f16 round their f32 result by the f32 rounding mode and v_interp_p2_f16 its f16 result by the f16 one, in all four modes, and a flushed denormal result is a zero of its sign in every mode. Directed rounding with denormal modes 1 and 2, or with IEEE=1 and a flushing field, is not measured, and none of these modes is measured on gfx1035. An unknown mode follows IEEE=0 with denormals kept. ...Removed phrases declared to the gate:
areandand throw.— the clause loses only "are not measured and"; "throw" stays, and "not measured" moves to the conditions this campaign did not cover. The gfx1035 record, the NaN rules, "An unknown mode follows IEEE=0 with denormals kept" and the other two unconfirmed qualifiers (P10/P20 rounding, the tessellation path) are untouched.Notes
debt-lengthwarning: the entry grows from 2,102 to 2,955 characters; it was already 1,102 over the 1,000 guideline. No measured condition was compressed to fit; trimming the entry is its own PR.docs/dev/debt/shader.md(#17974, #17967, #17932, #17807, #17733, #17701) and none of them edits this entry (#17733 carries it only as diff context).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)Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-10T17:50:01Z.
Review: COMMENTED
Read
41bdb64537againstmain.Correctness.
TranslationContext::interpolationModeF16(Translation/src/AttributeInstructions.cpp:109-118) still throws whenmode & 0xf != 0or either denormal field is 1 or 2, and the entry keeps saying those modes and non-nearest rounding "throw", so the text stays consistent with the code. "An unknown mode follows IEEE=0 with denormals kept" matchesif (!floatMode.has_value()) return 0u(line 110). The sentence on main is unchanged since the PR base. The new gfx1036 paragraph is only a measurement record; the code does not implement it andagc_driver_interpolation_modeshas no gfx1036 rows pinned.Non-blocking. The entry is now one very long paragraph that mixes what is implemented with measurements the code does not use. A separate clause ("measured on gfx1036, not implemented, still throws") would make the open gap clearer. Same rig as #17807 and #18142 (gfx1036, driver 31.0.22044.1); no overlap with them.
Not run here; this is from reading the code.
AI-assisted: yes.