model-writtenrun 1565 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Oleg Ivanov reported that corr() returned varying non-NULL results for constant inputs in #1; Laurenz Albe clarified the expected NULL result in #2, and Tom Lane traced the failure to roundoff in accumulated sums in #4.
- Dean Rasheed confirmed that both old and current algorithms mishandled constant-input correlation in #6, while questioning the runtime cost of extra state; Tom Lane's initial prototype in #7 tracked first values and a bitmask, measured roughly 2% overhead and retained the shared transition function for binary aggregates.
- Dean Rasheed proposed storing two common values with NaN sentinels in #8, and Tom Lane adopted that representation in #11 because its all-NaN behavior seemed preferable and its runtime was marginally better.
- Tom Lane explored making NaN override constant-input NULL results in #12, but favored NULL precedence in #14; Dean Rasheed's examples in #13 also exposed zero sums for nearly equal inputs and underflow in the correlation denominator.
- Tom Lane's completed patch in #15 extended the state to related aggregates and parallel combination, added regression coverage, retained zero-sum checks and introduced separate square roots plus clamping; platform-dependent rounding then prompted removal of stricter output precision in #16.
- Dean Rasheed proposed preserving exact zero sums during accumulation and exact averages for constant inputs in #17, then demonstrated accuracy loss from unconditional separate square roots in #18; Tom Lane incorporated both findings in #19, using separate roots only for product overflow or underflow.
- Tom Lane declined to extend the work to single-variable aggregates in #19, citing available numeric variants and potentially greater relative overhead, leaving that investigation to others.
- After Tom Lane proposed removing an accumulator guard in #20, Dean Rasheed explained the chosen NULL-versus-NaN semantics and requested clearer comments and an all-NaN test in #21; the final patch in #22 incorporated these changes and credited Dean as co-author.
- Dean Rasheed approved the final patch in #23, and Tom Lane announced its landing in #24 as 6498287696, with only a catalog-version bump and editorial changes; the catalog change prevented backpatching, and Dean's co-author status excludes him from suggested reviewers under the task rules.