model-writtenrun 7111 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Jun - Aug 2024 · 24 entries
- Joseph Koshakow opened the thread with fixes for regression-test failures under -ftrapv, introducing overflow helpers and replacing wrapping-dependent arithmetic in money output, numeric conversion, integer parsing and timestamps #1.
- Nathan Bossart favored reusable helpers, while Tom Lane explained the timestamp checks and requested a test around the PostgreSQL epoch; Joseph subsequently extended the fix to make_timestamp_internal() and the ECPG implementation #2 #3 #5 #7 #8 #9.
- Tom warned that regression tests exposed only a fraction of the risks, Andres Freund advocated development-time trapping and further analysis, and Peter Geoghegan argued that removing -fwrapv required demonstrated benefits; the general cleanup was treated as development-branch work rather than a backpatch candidate #3 #6 #11 #12 #13.
- Alexander Lakhin supplied additional money, date/time and array failures, followed by JSONB, refint and dynahash examples, expanding the investigation beyond the original regression failures #14 #17.
- Joseph added separate money overflow checks, extended them to floating-point arithmetic, and then added array-slice and JSONB patches; the money and array changes were identified as bugs that produced incorrect behavior even with -fwrapv #15 #18 #19 #20 #22.
- Nathan's money review led to shared arithmetic helpers and a decision to delegate floating-point corner cases to float8_mul()/float8_div(), check NaN results explicitly, and allow division by infinity consistently with other types #24 #26 #27 #28.
- The money component of Joseph's integrated series #31 landed as 4f96281587, with a reduced regression suite and an added division-by-zero case, and Nathan confirmed backpatching #32; the related bug report came from thread #72257, but the matching implementation was developed and posted in this thread.
- Jian He's array tests exposed changes in error behavior, prompting Joseph to split the checks and then try Nathan's wider-intermediate approach while removing the already committed money patch #30 #31 #33 #34.
- Matthew Kim joined with a century-conversion overflow patch for do_to_timestamp(), preserving Joseph's existing series alongside his new formatting.c change #38.
- Nathan settled the array calculation on checked subtraction followed by checked addition, Joseph restored the full-range regression case, and Jian agreed with the approach while also requesting portable JSONB constants #39 #40 #41 #42.
- The array component of #42 landed as 878e8c6be7, with tests moved under SQLSTATE-only verbosity to avoid platform-dependent MaxArraySize output, and was backpatched #43.
- Matthew removed the landed array patch and added a make_date() fix, but Nathan found that ignoring the overflow helper's return value produced bogus years on Windows; Matthew corrected that behavior #44 #46 #49.
- Renewed review of the original patch led Joseph to use an unsigned magnitude in cash_out() and simplify the absolute-value helpers instead of relying on leaving an overflowing signed value unchanged #47 #48.
- Jian reviewed the make_date() error behavior, Joseph clarified that the minimum signed integer was valid input, and Matthew added a separate Y,YYY conversion fix, completing three pending date/time patches #50 #51 #52 #53.
- Nathan prepared the original helper patch for commit using compiler overflow builtins and widened fallbacks; Heikki Linnakangas improved the casts and documentation, Joseph simplified pg_abs_s64(), and Jian caught an incorrectly unsigned 128-bit intermediate #54 #55 #56 #57 #58 #59 #60 #62.
- The original wrapping-removal work landed from #59 as 9e9a2b7031, incorporating the documentation rewrite and signedness correction, after which Nathan turned to JSONB #64 #65.
- Nathan changed the pending JSONB guards to use the newly available pg_abs_s32(), Joseph approved the revision, and 108d2adb9e landed from #65 with rearranged tests and an additional text-extraction test #66 #67.
- Alexander's immediate -ftrapv testing found that JSONB text extraction still overflowed, alongside separate 32-bit multiplication and bitmapset failures; Nathan supplied an inline JSONB fix and identified the bitmap macro responsible for the latter failure #68 #69.
- The JSONB follow-up landed as 1d80d6b50e, applying pg_abs_s32() to both jsonb_array_element_text() and jsonb_delete_idx() without a matching attached patchset #69 #71.
- Nathan proposed unsigned two's-complement arithmetic for bitmapset, and Joseph reported that it fixed the local failure while squashing Matthew's remaining date/time patches and cataloguing unresolved dynahash, refint and compiler-related problems #70 #72.
- Joseph replaced his proposed wider dynahash bucket type with an unsigned cast before shifting and added a next_pow2_int() limit adjustment; Alexander confirmed that the mask fix worked #73 #75.
- Alexander also pointed to a separate date/time bug report with further cases, and Nathan combined the pending date/time, dynahash and bitmapset changes while introducing signed-negation helpers #74 #76.
- Further testing exposed JSONB subscripting, window-function and architecture-specific trapping problems, leading Nathan to deprioritize broad cleanup and Joseph to step back while emphasizing that Matthew's date/time changes fixed real incorrect results #77 #78 #79.
- At the thread's end, the narrowed date/time fix was committed and the participants had agreed to close the commitfest entry, while the ISO-week hazard and broader trapping cleanup remained unresolved and neither removing -fwrapv nor enabling -ftrapv generally had been achieved #78 #79 #80 #81 #83 #85.
Dec 2024 · 3 entries
- After more than three months, Nathan revived only the date/time bug-fix portion, leaving the bitmapset and dynahash proposals out of the narrowed patch, and Joseph reviewed it favorably #80 #81.
- Nathan then preserved the original year for Windows error reporting and added checks for combined century/year, week and millisecond calculations; he documented the remaining isoweek2j() hazard instead of restructuring its callers' soft-error handling #82 #83.
- The date/time work landed from #83 as 0a27c3d0f7, with a corrected Y,YYY error code and simpler week-calculation temporaries; although Nathan staged backport variants, he ultimately declined backpatching because of possible int.h conflicts and the risk/reward balance #84 #85.