Repository navigation
docs(debt): correct stale f64 denormal and RSRC1 float mode statements - #8281
Conversation
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
d393d26 to
921c8c2
Compare
harisibrar1
left a comment
There was a problem hiding this comment.
Checked against main:
- The
FLOAT_MODEf16/f64 denormal field is read by add/mul (Float64Instructions.cpp:20,43), min/max (:55), floor/ceil/fract/frexp_mant (:83-88), div_fixup (:184), the f64 compares (CompareInstructions.cpp:229) and the f64 ds min/max/cmpst (SharedMemoryInstructions.cpp:216-226). - The new list of arithmetic that does not read it is correct.
v_fma_f64,v_ldexp_f64,v_rcp_f64,v_rsq_f64,v_sqrt_f64andv_trig_preop_f64take the no-flush paths atVectorInstructions.cpp:966-990, andv_div_fmas_f64andv_div_scale_f64have no floatMode reference. DispatchFloatMode(ShaderRegistry.cpp:837-840, used atDispatch.cpp:157) returns the registered header's mode when the shader is registered and decodes the liveCOMPUTE_PGM_RSRC1otherwise. Draws useRegisteredFloatModeonly (DrawCapture.cpp:25).tests/Submit.cpp:715-732pins both cases.F64FmaSubnormals.cpp:216-233skips only without Float64, or on a mismatch when the target lacks f64 DenormPreserve, so the old unconditional "is skipped" was stale. Not checked: the CI run and the 2026-10-17 sweep behind the "13 of 23" correction.
Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
921c8c2 to
5fa23eb
Compare
5fa23eb to
571f687
Compare
The shader float mode entry said "Other f64 arithmetic does not model these denormal controls". On main, v_add_f64, v_mul_f64, v_floor_f64, v_ceil_f64, v_fract_f64, v_frexp_mant_f64, v_frexp_exp_i32_f64, v_div_fixup_f64, the f64 compares and ds_min/max/cmpst_f64 read the f16/f64 denormal field, and each has its own entry. The sentence now names the f64 arithmetic whose translation still does not read it. The v_floor_f64 entry said its modifier run used 16 of the 23 measured values. The run's list holds 13 of them plus -1.5, 2.75 and 1 - 2^-53. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
… mode Co-Authored-By: Claude <noreply@anthropic.com>
571f687 to
2e874e6
Compare
|
Checked the three rewritten debt statements against main: |
What
Four technical-debt statements are stale: three about f64 denormals (two went stale when #7036 and #7042 merged) and one about where a raw compute program's float mode comes from.
docs/dev/debt/libSceAgcDriver.md, shader float mode entry: "Other f64 arithmetic does not model these denormal controls." Onmainthe translation reads theFLOAT_MODEf16/f64 denormal field forv_min_f64andv_max_f64(this entry), the f64 compares,v_floor_f64,v_ceil_f64,v_fract_f64,v_frexp_mant_f64,v_frexp_exp_i32_f64,v_add_f64,v_mul_f64,v_div_fixup_f64andds_min/max/cmpst_f64, each with its own entry inshader.md. The sentence now names the f64 arithmetic that still does not read the field:v_fma_f64,v_div_fmas_f64,v_div_scale_f64,v_ldexp_f64,v_rcp_f64,v_rsq_f64,v_sqrt_f64andv_trig_preop_f64.docs/dev/debt/shader.md, the fix(shader): flush f64 floor, ceil, fract and frexp denormal inputs #7036 entry: "and 16 of them with neg and abs modifiers". The modifier run used 13 of the 23 values plus -1.5 (0xbff8000000000000), 2.75 (0x4006000000000000) and 1 - 2^-53 (0x3fefffffffffffff). The entry now says so.docs/dev/debt/shader.md, thev_fma_f64andv_div_fmas_f64entry: "Elsewhere (including lavapipe), the driver may flush f64 subnormals, andagc_driver_f64_fma_subnormalsis skipped."F64FmaSubnormals.cpp(lines 216-233 onmain) skips only without a device orshaderFloat64, or when a row differs and the target has no f64DenormPreserve; otherwise it runs. 5e00b26 (fix(shader): preserve f64 denormals when supported by Vulkan #2977) removed the unconditional skip without updating this sentence, and inmain's CI run 39390834287 the linux job, which runs on lavapipe, passes it (Test #524: agc_driver_f64_fma_subnormals ... Passed 0.14 sec). The sentence now reads "Elsewhere the driver may flush f64 subnormals, andagc_driver_f64_fma_subnormalsskips if it does."docs/dev/debt/libSceAgcDriver.md, the same shader float mode entry: "A title that rewrites RSRC1 at run time, or a raw compute program with no header, compiles with that mode or none." Since ee1e341 ("take an unregistered compute shader's float mode from the live COMPUTE_PGM_RSRC1", merged in feat(shader): track MODE rounding changes through the control flow graph #5180),Dispatch.cpp:167builds the float mode withDispatchFloatMode(ShaderRegistry.cpp:1120-1123), which decodes the liveCOMPUTE_PGM_RSRC1when the shader is not registered;testDispatchFloatModeintests/Submit.cppchecks it. Registered shaders and draws (DrawCapture.cpp:25) still take the header's mode. The sentence now reads "A registered shader keeps that mode when a title rewrites RSRC1; a raw compute program takes the live RSRC1."Docs only. No code changes.
Tested
Not built or run, because only docs change. What was checked:
main661f8b7, by reading the code (none of the files named here changed between it and 9d6adeb, which this branch is now on, exceptDispatch.cpp, where the call is now at line 167): the field (floatMode & 0x40/0x80) is read infloat64Operation(inputs of add, mul and frexp_exp, and add/mul results throughflushTinyF64Result),float64Unary(inputs of floor, ceil, fract and frexp_mant, and the fract result),minMaxF64andvDivFixupF64inFloat64Instructions.cpp,emitFloat64CompareinCompareInstructions.cpp, andfloatAtomicFlushinMemoryResourceHelpers.cpp(the f64 shared, buffer and flat atomics). The fma (float64Operationwithout the flush), div_fmas, div_scale, ldexp, rcp, rsq, sqrt and trig_preop paths do not read it. The SPIR-V backend receives no guest float mode for those opcodes.v_trunc_f64andv_rndne_f64(their entry says the results are the same either way), and the conversions andv_cmp_class_f64. A local sweep from 2026-10-17 (RX 6700 XT through HIP, against the recompiler before fix(shader): flush f64 floor, ceil, fract and frexp denormal inputs #7036 and fix(shader): flush v_add_f64 and v_mul_f64 denormals by the f64 field #7042) found thatv_cvt_i32_f64,v_cvt_u32_f64andv_cmp_class_f64matched the GPU in all four f16/f64 denormal modes.v_cvt_f32_f64differed on 3 of 29 rows, the same count in every f16/f64 mode, and on none with f32 denormals flushed. In the same sweep,v_ldexp_f64andv_fma_f64matched the GPU in mode 3 and not in modes 0 to 2.v_div_scale_f64, with src0 equal to the denominator or to the numerator, differed on 175 of 529 rows in modes 0 and 2 and on none in mode 3.v_trig_preop_f64was not swept.-v[4:5]for floor, frexp_mant and frexp_exp,|v[4:5]|for ceil and-|v[4:5]|for fract, at IEEE 0 and 1 with denorm16 0 to 3. Compared with the 23-value list of the sweep script, 13 of the 16 are among the 23 and 3 are not. That run's rows were not saved.main8651664, and the call again on 9d6adeb, by readingDispatchFloatModeandRegisteredFloatModeinShaderRegistry.cpp, their callers inDispatch.cppandDrawCapture.cpp, andtestDispatchFloatModeintests/Submit.cpp.python tools/check_conventions.py --base origin/mainwith this title and body: 0 errors and 2debt-lengthwarnings: the shader float mode entry (3249 characters; 3151 before this change) and thev_fma_f64entry (1081 characters; 1097 before, so this change shortens it).maine78acf4bdafor the conflict with feat(agc): emulate barycentrics in rect-list draws #8339 (merged) indocs/dev/debt/shader.md: main's text is kept and this PR's change is unchanged; the statements were rechecked on that commit.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 (attach them to this PR)🤖 Generated with Claude Code