model-writtenrun 8783 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Keisuke Kuroda reported slower floating-point calculations in PostgreSQL 12 than PostgreSQL 11 and supplied a macro-restoration patch, developed with help from Amit Langote, that substantially reduced excess isinf() calls #1.
- Amit identified reversed check ordering as a central problem #3, while Tom Lane supported restoring short-circuit evaluation through a macro #4 and Andres Freund proposed moving repeated error reports into shared functions to reduce code size #6.
- Compiler comparisons showed that simply reversing conditions inside the inline helpers was insufficient, whereas restoring the macro improved performance; after Andres questioned unoptimized builds, Amit repeated the comparison with optimization enabled and confirmed the GCC improvement #9 #10 #14 #15.
- Emre Hasegeli polished Kuroda's patch with explanatory comments, unlikely() annotations, complete removal of the inline helpers, and the remaining geometry call-site conversion #12.
- Tels requested clearer evaluation-order documentation and pointed out no-op checks #13, while Amit requested matching btree_gist changes #16; Emre incorporated the comment and btree_gist updates but deferred changing trigonometric overflow behavior to separate work #17.
- Andres objected to removing an interface from a stable branch #19, then proposed replacing the generic checking abstraction with direct conditions and shared error functions #23; Tom agreed, and they settled on retaining unused compatibility helpers in PostgreSQL 12 #24 #25 #26.
- Emre submitted the resulting rewrite, which directly checked results before operands, centralized overflow and underflow errors, removed ineffective checks, and omitted the earlier btree_gist edits #28.
- Tom requested documentation for the error helpers, and Andres requested noreturn annotations, proper void signatures, and unlikely() around the result checks themselves; Tom accepted these refinements #29 #30 #31 #32 #33.
- Tom committed #28 with moderate edits as 607f8ce74d, additionally centralizing division-by-zero errors and removing compatibility helpers only from the development branch; he left unrelated isinf() annotations outside this change #34.
- The thread ended with the fix landed and backpatched: Amit confirmed development-branch performance was again comparable to PostgreSQL 11 #36, and Kuroda confirmed improvement on PostgreSQL 12's stable branch with GCC 4.8.5 #37.