Repository navigation
Conversation
Created using spr 1.3.7
bacek
pushed a commit
that referenced
this pull request
May 14, 2026
Under x86-64-v3 + ThinLTO the auto-vectorizer/unroller produces a 16-YMM scratch zero-init followed by per-byte scatter writes in `stringJaccardIndex`. The combination causes store-buffer pressure and partial store-forwarding stalls on Intel cores, regressing the `string_similarity` perf test #10 by ~17%. Compiling this file at v2 keeps the SSE-only sequence (`memset@plt` + XMM intersection/union loop) that matches master's performance. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
bacek
pushed a commit
that referenced
this pull request
Nov 16, 2026
The collation sort (#2, 5M rows) and the single-column string sort (#3, 20M rows) take 1.2-1.9 s on MasterCI on both arches. They get disabled="1" (text and number unchanged) and are appended as #9 and #10 on a quarter of the rows with max_block_size = 16384, a quarter of the default 65409. `numbers_mt` hands out blocks of exactly max_block_size rows, so each copy has as many blocks as its original (77 and 306): the same number of cursors in every per-stream merge and the same 16-stream final merge, with a quarter of the rows per block. EXPLAIN PIPELINE of each original and its copy is identical (16 streams). Measured on official MasterCI release builds, two servers pinned to 24 cores of one NUMA node, perf.py, 25 runs: copy / original time 0.248 (#2) and 0.252 (#3), projected CI medians 380 / 487 ms amd, 298 / 483 ms arm. On the builds before/after ClickHouse#115869 (sorted array of cursors) #2 is 1.161x faster and its copy 1.159x; on those before/after ClickHouse#126829 (cheaper collation) 2.179x and 2.111x; #3 and its copy show no change on either pair (1.005 / 1.008, 1.004 / 1.001), as the heap guard should. #0 and #1 stay as they are: on this rig the ClickHouse#115869 change did not show on them beyond the A/A resolution, so there was no measured guarantee that copies would keep their sensitivity. About 32 s (amd) and 29 s (arm) of query time less per master performance job; 9 queries stay enabled, so all of them still run. Related: ClickHouse#129258 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WasmTimeCompartment::getMemoryusedptr + size >= memory_span.size()which has two bugs:
Off-by-one: a slice that exactly reaches the end of memory
(
ptr + size == memory_span.size()) is a valid access but wasincorrectly rejected.
Unsigned integer overflow:
WasmPtrandWasmSizeTare bothuint32_t. Withptr = 0xFFFFFFFF, size = 1the addition wraps to0, the check passes, andmemory_span[0xFFFFFFFF]is accessed faroutside the WASM linear memory, breaking sandbox isolation.
Fix: rewrite the check as
size > memory_span.size() || ptr > memory_span.size() - size,which avoids any addition and correctly accepts the boundary case.
The WasmEdge backend is not affected (it delegates bounds checking to
WasmEdge_MemoryInstanceGetPointer).Co-Authored-By: Claude Sonnet 4.6 [email protected]
commit-id:e31f0f25