Repository navigation
Bump vectorscan from 5.4.11 to 5.4.13 - #125774
alexey-milovidov merged 4 commits into
Conversation
Retarget the submodule from the ClickHouse fork to upstream VectorCamp/vectorscan and pin tag vectorscan/5.4.13 (acd7363aadea). The fork carried a single patch (moving `#include <vector>` out of the `HAVE_BOOST_CONTAINER_SMALL_VECTOR` fallback in `src/util/small_vector.h`); it is obsolete because upstream merged it (VectorCamp/vectorscan#359), so no fork branch is needed. Adapt the explicit source list in `contrib/vectorscan-cmake/CMakeLists.txt` to the upstream file changes: `src/fdr/teddy.c` -> `src/fdr/teddy.cpp`, drop `src/fdr/teddy_avx2.c`, add `src/fdr/teddy_fat.cpp`. `teddy_fat.cpp` is guarded by `HAVE_AVX2`, which is not defined in ClickHouse's non-fat build, so it compiles to nothing here. Update `contrib/vectorscan-cmake/common/hs_version.h` to 5.4.13 / 2026-08-23 (`HS_VERSION_STRING`, `HS_PATCH`); `HS_VERSION_32BIT` is left unchanged, as in the previous bump. The parser is not regenerated with ragel: upstream changed `Parser.rl` (new nested-class / `&&` rejection rules) but regenerating is a user-visible behaviour change deferred to a separate PR. Includes the upstream stack buffer overflow fix in `rvermicelliDoubleExecReal` (`src/nfa/vermicelli_simd.cpp`, fe94004d). Co-Authored-By: Claude Code <[email protected]>
|
Workflow [PR], commit [e6bbf53] Summary: ✅
AI ReviewSummaryUpdates Findings❌ Blockers
PR Metadata💡 With the current parser behavior,
Preserving the literal forms removes this metadata concern; documenting the rejection alone does not supply the missing compatibility path. Missing context / blind spots
Tests
Final Verdict❌ Block. Preserve previously accepted literal classes or add a compatibility path, cover that behavior with a focused stateless test, and obtain the relevant architecture CI results. Update the changelog if any syntax rejection remains. |
…submodule CI check `Check Submodules` rejects nested submodules; upstream 5.4.13 pins `simde`, which the ClickHouse build does not use. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=125774&sha=6969c28b51589a02c6a91ef0357874ef6e0cd2e4&name_0=PR&name_1=Build%20%28arm_tidy%2C%201%2F4%29 ClickHouse#125774 Co-Authored-By: Claude Fable 5.1 <[email protected]>
`src/parser/Parser.rl` and `src/parser/control_verbs.rl` changed between 5.4.11 and 5.4.13 (rejection of nested character classes and `&&` in character classes, cast cleanups), so the pre-generated `Parser.cpp` and `control_verbs.cpp` under `rageled_files/` were stale. Generated with ragel 7.0.0.12 (`nixpkgs#ragelDev`), default `-T0` code style, matching the style of the previous files. This ragel honours `alphtype unsigned char` and emits `unsigned char` tables, so the output does not depend on the signedness of `char` of the host: the `amd64` and `aarch64` copies are byte-identical. The regeneration recipe is documented in `contrib/vectorscan-cmake/CMakeLists.txt`. Related: ClickHouse#125774 Co-Authored-By: Claude Fable 5.1 <[email protected]>
| #line 1103 "Parser.rl" | ||
| {te = p;p = p - 1;{ | ||
| #line 1103 "Parser.rl" | ||
| throw LocatedParseError("Nested character classes are not supported"); } |
There was a problem hiding this comment.
[P1] Preserve previously supported literal characters inside classes
This new rejection also catches valid, previously supported character classes. For example, [[] is a class containing a literal [, so SELECT multiMatchAny('[', ['[[]']); previously returned 1; the regenerated parser now throws Nested character classes are not supported. Similarly, [a&&b] previously matched a, &, or b and now throws. These literal forms follow the ordinary PCRE character-class syntax, which treats [ specially inside a class when it introduces POSIX syntax.
This changes existing queries on both architectures, including stored filters using the multiMatch* and multiFuzzyMatch* functions. The upstream Java-style construct rejection needs to preserve existing literal-class forms, or be introduced with a compatibility control that retains their previous behavior. Please add a stateless regression for literal [ in a class. If rejecting these forms is retained as an intentional compatibility change, the PR category and changelog also need to describe the migration (escaping the literal [/& characters), rather than only announcing the dependency version.
There was a problem hiding this comment.
This change is okay to me. Let's accept.
The regenerated `Parser.cpp` and `control_verbs.cpp` compare the input, read through `const char *`, against `unsigned char` transition tables (the `.rl` files declare `alphtype unsigned char`). On amd64 `char` is signed, so every byte >= 0x80 is negative on the left side and never matches a table entry, and UTF-8 patterns are parsed incorrectly: `'(?i)привет'` fails with `Hexadecimal value is greater than \x10FFFF`, and `00926_multimatch`, `02226_analyzer_or_like_combine` and `04308_text_index_function_multiMatchAny_regex_cases` fail. Upstream `vectorscan` compiles exactly these two files with `-funsigned-char` (`RAGEL_C_FLAGS`); do the same here. On aarch64 `char` is already unsigned, so the flag is a no-op there. CI: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=125774&sha=c3e59208fae06b6b03964d52e01b29516d0ebeae&name_0=PR&name_1=Stateless%20tests%20%28amd_debug%2C%20parallel%29 Related: ClickHouse#125774 Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
@actueleai @alexey-milovidov — this PR looks backward incompatible but is categorized as Why: As merged, Suggested category: |
|
@actueleai @alexey-milovidov — title/description suggestions: Description (currently
Ignore if intentional. |
Backport #125774 to 26.9: Bump `vectorscan` from 5.4.11 to 5.4.13
Backport #125774 to 26.8: Bump `vectorscan` from 5.4.11 to 5.4.13
Backport #125774 to 26.7: Bump `vectorscan` from 5.4.11 to 5.4.13
Backport #125774 to 26.3: Bump `vectorscan` from 5.4.11 to 5.4.13
@actueleai @alexey-milovidov could you please take a look, this looks right |
|
@rschu1ze do we need this in 26.2? |
|
@zlareb1 Your question confuses me. The PR is in 26.2 Cloud. 26.2 OSS is no longer supported. |
|
yes, do we need to backport this in 26.2 cloud release @rschu1ze? asking since, I need to create a patch release |
The PR is backported to 26.2: https://github.com/ClickHouse/clickhouse-private/pull/81544 |
Yes, everything is right. We may use the "backward incompatible" label, but it is not necessary. |
No existing query number or text changes: 7 queries are disabled and the same 7 appended on `hits_10m_single` as 28-34. Queries 4, 7, 11, 15, 18, 21 (`multiMatchAny`) and 17 (`multiSearchFirstIndex`) scan all 100M `URL` values of `hits_100m_single` and take 1.16-1.52 s on MasterCI amd, 0.70-1.04 s on arm. The `vectorscan` database is compiled once and cached (0 global cache misses per measured run), so the time is the per-row scan. Each copy is the original with `hits_100m_single` -> `hits_10m_single` and nothing else; the file already runs its other `match`, `multiMatchAny` and `multiSearchAny` variants on that table. Probe on official MasterCI amd release builds (clickhouse local, 8 pinned cores): per-row user time copy x 10 / original 0.978-1.053 on e191b1a, 324e8a3 and fc8a493. On the ClickHouse#125774 merge (vectorscan 5.4.11 -> 5.4.13, e191b1a -> 324e8a3) the originals 4, 7, 11, 15, 18 move by 1.190, 1.211, 1.042, 1.249, 1.072 and their copies by 1.219, 1.241, 1.030, 1.280, 1.112 (retention 0.70-1.52); 17 and 21 stay flat in both. perf.py, two fc8a493 servers, 12 runs: copy / original 0.106-0.113, about 0.13-0.17 s projected on CI amd and 0.08-0.11 s on arm; per-row user time 0.99-1.03. On the final file perf.py measures the 28 enabled queries and none of the 7 disabled ones, also with --max-queries 10. Projected saving: about 37 s (amd) and 24 s (arm) of query time per master perf job. Related: ClickHouse#129258 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Bump
vectorscanfrom 5.4.11 to 5.4.13. The fork's single patch is in upstream 5.4.13, which also fixes a stack buffer overflow inrvermicelliDoubleExecReal. The submodule stays on the ClickHouse fork (branchClickHouse/vectorscan/5.4.13), whose only commit on top of upstream removes the nestedsimdesubmodule:Check Submodulesrejects recursive submodules, and thesimdebackend is not used by the ClickHouse build.ClickHouse-side changes
contrib/vectorscan-cmake/CMakeLists.txt— source list follows the Teddy reshuffle:teddy.c→teddy.cpp,teddy_avx2.c→teddy_fat.cpp.contrib/vectorscan-cmake/common/hs_version.h—HS_VERSION_STRINGandHS_PATCHupdated to 5.4.13.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Update
vectorscanto 5.4.13. Certainre2patterns inmatch,multiMatchAny, etc. may now throw an exception.Workflow [PR]
Sync PR [sync-upstream/pr/125774]
Version info
26.10.1.2423-master(included in26.10and later)26.9.20.14,26.8.28.13,26.7.31.12,26.3.52.9