model-writtenrun 5892 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Feb - Apr 2021 · 7 entries
- John Naylor opened the thread with an SSE2 ASCII fast path for UTF-8 validation, motivated by bulk-input performance and the flexibility of the new string-validation API #1.
- Heikki Linnakangas suggested portable word-sized operations and sharing the ASCII check across encodings; John's measurements led to a uint64 implementation using encoding-specific function pointers #2 #3 #4.
- Heikki demonstrated much faster full UTF-8 validation through simdjson, identified unsafe unaligned loads in John's patch, and subsequently suggested a word-level zero-byte check #5 #8.
- John explored an embedded SSE algorithm separately, then rewrote the portable validator with an inline ASCII check and src/port scaffolding; Heikki's Raspberry Pi testing exposed a substantial regression on an older 32-bit ARM platform #9 #11 #12.
- John added a complete SIMD lookup-table implementation, configure detection, and regression tests, then repaired build selection and character-boundary accounting and supplied experimental stride and fallback deltas for the ARM concern #13 #14 #15.
- The next series added a SIMD ASCII shortcut and bundled Heikki's noError conversion prerequisite for testing, while separating and then dropping non-UTF-8 optimization because it needed more testing; subsequent revisions fixed Windows compatibility #16 #17 #18.
- Amit Khandekar confirmed portable-fallback improvements on Arm64, supporting John's decision to consolidate the 16-byte ASCII path; the April submission then rebased the remaining UTF-8 work without the bundled prerequisite #21 #22 #23 #24.
Jun - Aug 2021 · 11 entries
- After a two-month gap, John split the work into a smaller portable rewrite and an SSE companion so the portable improvement could be reviewed independently #25.
- Heikki proposed cheaper zero detection, Greg Stark caught a combination error, and Heikki corrected the arithmetic; John incorporated the result and expanded padded-input tests while simplifying the SSE tail path #26 #27 #35 #36.
- Heikki's next benchmarks showed the Raspberry Pi regression had disappeared but exposed a worst-case mixed-input slowdown, prompting John to check 8-byte halves separately and eventually simplify to a single 8-byte load #39 #40 #42.
- Heikki supplied separate long-input and tail loops to eliminate repeated length checks, but John's subsequent helper consolidation unexpectedly regressed performance, so the experimental series returned to Heikki's baseline #43 #45 #47 #52.
- Amit proposed reusing integer chunks for multibyte checks, and John tested several variants, but cross-platform regressions and Amit's Arm64 measurements prevented that approach from becoming the final implementation #46 #51 #54.
- Vladimir Sitnikov suggested a shift-based DFA; John's first experimental series combined it with several ASCII shortcuts but initially failed to provide a consistently better replacement #49 #53.
- Vladimir then proposed optimizing for valid input and deferring precise error handling, leading John to batch DFA processing and replay invalid input through the scalar path, producing much stronger and more consistent results #55 #57.
- Thomas Munro supplied experimental platform-neutral SIMD wrappers and NEON and AltiVec implementations; NEON benchmarked well on his Raspberry Pi, while the AltiVec experiment remained slower than the fallback #58 #62.
- John reunited the DFA and SSE implementations, extracted SIMD helpers, introduced branch-free ASCII accumulators, and selected a 16-byte portable stride after comparing several sizes #64.
- Vladimir caught a discarded DFA state update, which John fixed with pointer-based state updates and a regression test; further threshold testing reduced fast-path entry from 32 to 16 bytes #65 #68 #69 #70.
- John adapted an SMT-based packing technique to halve the DFA transition table to 32-bit entries, and Vladimir requested a stable source-reference URL for the explanatory comments #71 #72 #73.
Oct 2021 · 1 entry
- In October, John removed SIMD and its build machinery because the portable DFA already delivered substantial gains, leaving SIMD and the earlier single-character-validator improvements for possible future work #74.
Dec 2021 · 4 entries
- John briefly explored reusing the ASCII and DFA machinery for character counting, then exported is_valid_ascii() for reuse while keeping that additional optimization separate #75 #78.
- Heikki's final review requested clearer contracts and comments and questioned forced inlining choices; John addressed those points, simplified character-boundary detection, and retained a length-controlled ASCII loop for the submitted version #76 #78.
- John announced the push and committed the final submission unchanged as 911588a3f8; the thread ended with the portable optimization landed and SIMD deferred #79 #80.
- In August 2022, John implemented Heikki's previously deferred end-pointer suggestion from #76 in 6b41a1579b, a small discussion-derived cleanup with no matching attached patchset.