Skip to content

[pull] master from ClickHouse:master - #8

Merged
pull[bot] merged 12 commits into
erickirt:masterfrom
ClickHouse:master
Dec 11, 2024
Merged

pull[bot] merged 12 commits into
erickirt:masterfrom
ClickHouse:master

Conversation

@pull

@pull pull Bot commented Dec 11, 2024 •

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

@pull pull Bot added the ⤵️ pull label Dec 11, 2024
@pull
pull Bot merged commit 88f7b53 into erickirt:master Dec 11, 2024
pull Bot pushed a commit that referenced this pull request Jul 16, 2025
…ary bridge cleanup

<details>

<summary>stacktrace</summary>

    #5  DB::ContextSharedMutex::lockSharedImpl (this=this@entry=0x7ffff5b96040) at /src/ch/clickhouse/src/Interpreters/Context.cpp:1036
            watch = {start_ns = 98678735300141, stop_ns = 0, clock_type = 4, is_running = true}
            increment = {what = <optimized out>, amount = 1}
    #6  0x00005555699352d6 in DB::SharedMutexHelper<DB::ContextSharedMutex, DB::SharedMutex>::lock_shared (this=0x7ffff5b96040) at /src/ch/clickhouse/src/Common/SharedMutexHelper.h:70
    #7  DB::SharedLockGuard<DB::ContextSharedMutex>::SharedLockGuard (mutex_=..., this=<optimized out>) at /src/ch/clickhouse/src/Common/SharedLockGuard.h:19
    #8  DB::ContextSharedPart::getConfigRef (this=0x7ffff5b96000) at /src/ch/clickhouse/src/Interpreters/Context.cpp:760
    #9  DB::Context::getConfigRef (this=<optimized out>) at /src/ch/clickhouse/src/Interpreters/Context.cpp:1590
    #10 0x000055556450941c in DB::ProxyConfigurationResolverProvider::get (request_protocol=DB::ProxyConfiguration::Protocol::HTTP) at /src/ch/clickhouse/src/Common/ProxyConfigurationResolverProvider.cpp:161
    #11 0x00005555669ea75f in DB::BuilderRWBufferFromHTTP::create (this=0x7fffffffa848, credentials_=...) at /src/ch/clickhouse/src/IO/ReadWriteBufferFromHTTP.cpp:814
    #12 0x000055556cea0035 in DB::ExternalDictionaryLibraryBridgeHelper::bridgeHandShake (this=0x7ffd60c4ca18) at /src/ch/clickhouse/src/BridgeHelper/ExternalDictionaryLibraryBridgeHelper.cpp:79
    #13 0x000055556cea1f34 in DB::ExternalDictionaryLibraryBridgeHelper::removeLibrary (this=0x7ffff5b96044) at /src/ch/clickhouse/src/BridgeHelper/ExternalDictionaryLibraryBridgeHelper.cpp:186
    #14 0x0000555566cb0248 in DB::LibraryDictionarySource::~LibraryDictionarySource (this=0x7ffd60c78318) at /src/ch/clickhouse/src/Dictionaries/LibraryDictionarySource.cpp:70
    #15 0x000055556708d775 in std::__1::__shared_count::__release_shared[abi:ne190107]() (this=0x7ffd60c78300) at /src/ch/clickhouse/contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:156
    #16 std::__1::__shared_weak_count::__release_shared[abi:ne190107]() (this=0x7ffd60c78300) at /src/ch/clickhouse/contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:185
    #17 std::__1::shared_ptr<DB::IDictionarySource>::~shared_ptr[abi:ne190107]() (this=0x7ffd60c605b0) at /src/ch/clickhouse/contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:668
    #18 DB::HashedDictionary<(DB::DictionaryKeyType)0, false, false>::~HashedDictionary (this=0x7ffd60c60398) at /src/ch/clickhouse/src/Dictionaries/HashedDictionary.h:378
    #19 0x0000555569a9c477 in std::__1::__shared_count::__release_shared[abi:ne190107]() (this=0x7ffd60c60380) at /src/ch/clickhouse/contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:156
    #20 std::__1::__shared_weak_count::__release_shared[abi:ne190107]() (this=0x7ffd60c60380) at /src/ch/clickhouse/contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:185
    #21 std::__1::shared_ptr<DB::IExternalLoadable>::~shared_ptr[abi:ne190107]() (this=0x7ffff4832560) at /src/ch/clickhouse/contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:668
    #22 DB::ExternalLoader::LoadingDispatcher::Info::~Info (this=0x7ffff4832548) at /src/ch/clickhouse/src/Interpreters/ExternalLoader.cpp:719
    #23 std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, DB::ExternalLoader::LoadingDispatcher::Info>::~pair (this=0x7ffff4832530, this@entry=0x7ffd60c60390) at /src/ch/clickhouse/contrib/llvm-project/libcxx/include/__utility/pair.h:65
    #24 __destroy_at<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, DB::ExternalLoader::LoadingDispatcher::Info>, 0> (__loc=__loc@entry=0x7ffff4832530) at /src/ch/clickhouse/contrib/llvm-project/libcxx/include/__memory/construct_at.h:67
    #25 0x0000555569a9c628 in destroy<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, DB::ExternalLoader::LoadingDispatcher::Info>, void, 0> (__p=0x7ffff5b96044, __p@entry=0x7ffff4832530) at /src/ch/clickhouse/contrib/llvm-project/libcxx/include/__memory/allocator_traits.h:339
    #28 std::__1::unique_ptr<std::__1::__hash_node<std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, DB::ExternalLoader::LoadingDispatcher::Info>, void*>, std::__1::__hash_node_destructor<std::__1::allocator<std::__1::__hash_node<std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, DB::ExternalLoader::LoadingDispatcher::Info>, void*> > > >::~unique_ptr[abi:ne190107]() (this=<optimized out>) at /src/ch/clickhouse/contrib/llvm-project/libcxx/include/__memory/unique_ptr.h:261
    #31 DB::ExternalLoader::LoadingDispatcher::setConfiguration (this=this@entry=0x7ffecad4c300, new_configs=...) at /src/ch/clickhouse/src/Interpreters/ExternalLoader.cpp:495
    #32 0x0000555569a9116d in DB::ExternalLoader::reloadConfig (this=0x7ffecb3fd740, repository_name=...) at /src/ch/clickhouse/src/Interpreters/ExternalLoader.cpp:1533
    #33 DB::ExternalLoader::addConfigRepository(std::__1::unique_ptr<DB::IExternalLoaderConfigRepository, std::__1::default_delete<DB::IExternalLoaderConfigRepository> >) const::$_0::operator()() const (this=<optimized out>) at /src/ch/clickhouse/src/Interpreters/ExternalLoader.cpp:1334
    #34 std::__1::__invoke[abi:ne190107]<DB::ExternalLoader::addConfigRepository(std::__1::unique_ptr<DB::IExternalLoaderConfigRepository, std::__1::default_delete<DB::IExternalLoaderConfigRepository> >) const::$_0&>(DB::ExternalLoader::addConfigRepository(std::__1::unique_ptr<DB::IExternalLoaderConfigRepository, std::__1::default_delete<DB::IExternalLoaderConfigRepository> >) const::$_0&) (__f=...) at /src/ch/clickhouse/contrib/llvm-project/libcxx/include/__type_traits/invoke.h:149
    #35 std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:ne190107]<DB::ExternalLoader::addConfigRepository(std::__1::unique_ptr<DB::IExternalLoaderConfigRepository, std::__1::default_delete<DB::IExternalLoaderConfigRepository> >) const::$_0&>(DB::ExternalLoader::addConfigRepository(std::__1::unique_ptr<DB::IExternalLoaderConfigRepository, std::__1::default_delete<DB::IExternalLoaderConfigRepository> >) const::$_0&) (__args=...) at /src/ch/clickhouse/contrib/llvm-project/libcxx/include/__type_traits/invoke.h:224
    #36 std::__1::__function::__default_alloc_func<DB::ExternalLoader::addConfigRepository(std::__1::unique_ptr<DB::IExternalLoaderConfigRepository, std::__1::default_delete<DB::IExternalLoaderConfigRepository> >) const::$_0, void ()>::operator()[abi:ne190107]() (this=<optimized out>) at /src/ch/clickhouse/contrib/llvm-project/libcxx/include/__functional/function.h:210
    #37 std::__1::__function::__policy_invoker<void ()>::__call_impl[abi:ne190107]<std::__1::__function::__default_alloc_func<DB::ExternalLoader::addConfigRepository(std::__1::unique_ptr<DB::IExternalLoaderConfigRepository, std::__1::default_delete<DB::IExternalLoaderConfigRepository> >) const::$_0, void ()> #38 0x0000555569966aaa in std::__1::__function::__policy_func<void ()>::operator()[abi:ne190107]() const (this=0x7ffff5b96044) at /src/ch/clickhouse/contrib/llvm-project/libcxx/include/__functional/function.h:716
    #39 std::__1::function<void()>::operator() (this=0x7ffff5b96044) at /src/ch/clickhouse/contrib/llvm-project/libcxx/include/__functional/function.h:989
    #40 BasicScopeGuard<std::__1::function<void()> >::invoke (this=0x7ffff5b96044) at /src/ch/clickhouse/base/base/../base/scope_guard.h:101
    #41 BasicScopeGuard<std::__1::function<void()> >::reset (this=0x7ffff5b96044) at /src/ch/clickhouse/base/base/../base/scope_guard.h:63
    #42 DB::ContextSharedPart::shutdown (this=0x7ffff5b96000) at /src/ch/clickhouse/src/Interpreters/Context.cpp:909
    #43 0x00005555644cf5cb in DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&)::$_3::operator()() const (this=this@entry=0x7fffffffc870) at /src/ch/clickhouse/programs/server/Server.cpp:1257
    #44 0x00005555644b4439 in BasicScopeGuard<DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&)::$_3>::invoke (this=0x7fffffffc870) at /src/ch/clickhouse/base/base/../base/scope_guard.h:101
    #45 BasicScopeGuard<DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&)::$_3>::~BasicScopeGuard (this=0x7fffffffc870) at /src/ch/clickhouse/base/base/../base/scope_guard.h:50
    #46 DB::Server::main (this=0x7fffffffe4c8) at /src/ch/clickhouse/programs/server/Server.cpp:2788
    #47 0x0000555572cbbee9 in Poco::Util::Application::run (this=0x7fffffffe4c8) at /src/ch/clickhouse/base/poco/Util/src/Application.cpp:315
    #48 0x000055556449c390 in DB::Server::run (this=0x7fffffffe4c8) at /src/ch/clickhouse/programs/server/Server.cpp:610
    #49 0x0000555564499aec in mainEntryClickHouseServer (argc=6, argv=0x7ffff67ecdc0) at /src/ch/clickhouse/programs/server/Server.cpp:397
    #50 0x000055555dc994c2 in main (argc_=<optimized out>, argv_=<optimized out>) at /src/ch/clickhouse/programs/main.cpp:340

</details>
pull Bot pushed a commit that referenced this pull request Nov 19, 2025
…y names

When ClickHouse encounters a distributed table directory with a name that:
- starts with the pattern `shardN_all_replicas` (e.g., `shard3_all_replicas_bkp`)
- but doesn't end with exactly `_all_replicas`

It would crash with a segmentation fault due to out-of-bounds array access.

Trace example:
```
* thread #1, name = 'clickhouse-serv', stop reason = signal SIGSEGV
  * frame #0: 0x000000001194481b clickhouse-server`DB::Cluster::Address::Address(DB::Cluster::Address const&) + 27
    frame #1: 0x0000000011944550 clickhouse-server`void std::__1::vector<DB::Cluster::Address, std::__1::allocator<DB::Cluster::Address> >::__push_back_slow_path<DB::Cluster::Address const&>(DB::Cluster::Address const&&&) + 208
    frame #2: 0x00000000129a6c35 clickhouse-server`DB::StorageDistributed::parseAddresses(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const + 3349
    frame #3: 0x00000000129a589b clickhouse-server`DB::StorageDistributed::getDirectoryQueue(std::__1::shared_ptr<DB::IDisk> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 3675
    frame #4: 0x00000000129a3f22 clickhouse-server`DB::StorageDistributed::initializeDirectoryQueuesForDisk(std::__1::shared_ptr<DB::IDisk> const&) + 2082
    frame #5: 0x000000000f681c48 clickhouse-server`DB::ThreadPoolCallbackRunnerLocal<void, ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true> >, std::__1::function<void ()> >::operator()(std::__1::function<void ()>&&, Priority)::'lambda'()::operator()() + 136
    frame #6: 0x000000000f68286c clickhouse-server`std::__1::packaged_task<void ()>::operator()() + 44
    frame #7: 0x000000000d83335b clickhouse-server`ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true> >::ThreadFromThreadPool::worker() + 2395
    frame #8: 0x000000000d839e23 clickhouse-server`void std::__1::__function::__policy_invoker<void ()>::__call_impl<std::__1::__function::__default_alloc_func<ThreadFromGlobalPoolImpl<false, true>::ThreadFromGlobalPoolImpl<void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true> >::ThreadFromThreadPool::*)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true> >::ThreadFromThre
adPool*>(void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true> >::ThreadFromThreadPool::*&&)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true> >::ThreadFromThreadPool*&&)::'lambda'(), void ()> >(std::__1::__function::__policy_storage const*) + 99
    frame #9: 0x000000000d830602 clickhouse-server`ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::worker() + 2242
    frame #10: 0x000000000d8379ba clickhouse-server`_ZNSt3__114__thread_proxyB6v15007INS_5tupleIJNS_10unique_ptrINS_15__thread_structENS_14default_deleteIS3_EEEEMN14ThreadPoolImplINS_6threadEE20ThreadFromThreadPoolEFvvEPSA_EEEEEPvSF_ + 90
```
pull Bot pushed a commit that referenced this pull request May 13, 2026
…tion` regressions

`generate_table_function #1` (8 integer column types, 1B rows) regresses ~18% and `#5`
(Date/DateTime, 1B rows) regresses ~16% on AMD release.

`fillColumnWithRandomData` is a big switch over `TypeIndex` that constructs a fresh
column for every block.  At `-march=x86-64-v3` the SLP vectorizer lowers the implicit
~32-byte zero-init of each newly-allocated `ColumnVector`/`ColumnString` to a
`vpxor xmm0; vmovdqu ymm0` pair (29 occurrences in PR vs 0 in master).  Each YMM
store dirties the upper YMM state, so clang inserts a `vzeroupper` (30 inserted)
before every external call from the dispatcher (`operator new`,
`PODArrayBase::reallocPowerOfTwoElements`, etc.) - the per-block dispatch ends up
bracketed by ~30 SSE/AVX transitions for no benefit (the inner PCG generation loop
is byte-equivalent to master's).

The inlined PCG inner loop is the dominant per-row cost, but at v3 the broader
function bloats from 16654 to 18241 bytes (+10%) and the cumulative `vzeroupper`
overhead in the per-block dispatch is what surfaces as the +15-18% regression.
The integer/Date paths are uniformly affected; Decimal/Float paths (#7/#8/#9)
do not regress because they go through a different per-element loop with no YMM
zero-init.

Compiling at v2 keeps the XMM-only zero-init that does not require `vzeroupper`.
The hot PCG inner loop's quality is not affected (master is already at v2 and
generates the same scalar code).

Local Sapphire Rapids LTO (max_threads=12, 10 iter):
  - `#1`:                      master 0.521s, PR 0.521s  (was 0.614s, +18%)
  - `#5`:                      master 0.177s, PR 0.178s  (was 0.208s, +16%)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
pull Bot pushed a commit that referenced this pull request Jul 18, 2026
Address review (blocker #9): a whitespace-only scratch tab is pruned on
reload because `(r.query || '').trim() === ''`, but `writeHistoryEntry`
had encoded that whitespace into the URL hash, so `has_url_query` is
`true`. The two "authoritative URL" branches in `reconcileStartup`
(`play.html`) then fired on `has_url_query` and recreated the blank tab,
and the trailing `scheduleSave` wrote it straight back to `IndexedDB` —
so whitespace-only scratch tabs still survived a plain reload, defeating
the pruning.

Add `stale_blank_reload_bare` (a `stale_blank_reload` whose URL query is
itself blank by the same `trim` rule) and treat it exactly like a bare
`?tab=`: non-authoritative in the saved-tabs "open new tab" branch, the
no-saved-tabs "adopt bootstrap" branch, the URL parameter rebuild, and
the deferred auto-run. A NON-blank hash on a stale reload is instead a
genuine unsaved edit that never reached `IndexedDB` before the reload,
so it stays authoritative and the tab is recreated with that real query,
preserving the edit.

Validated with node --check on the extracted script and a 13-scenario
branch-logic simulation covering the reviewer's exact repro (both
saved-survivor and no-survivor cases), the unsaved-edit preservation
case, and regressions for the earlier blockers (#6 external bare link,
#7 rename-before-reload, #8 duplicate-title survivor), plain load,
external shared links, and run-backed empty editors.
pull Bot pushed a commit that referenced this pull request Aug 21, 2026
…nger adds

The previous commit claimed the pruning was not measurable. That was measured on the wrong shape: a
20M x 5M join where every left row matches one right row is dominated by the probe, and the columns
that go away are a small part of the work. The win scales with the number of result rows, and CI found
it on the shapes that have many - `join_nullable_keys_small_table` #5 and #9 and `join_main_loop` #8,
all of them `count()` over a join with disjuncts, went -30%, -34% and -16% on ARM.

Reproduced locally against a build of the parent commit, min of five runs, `max_threads = 8`:

  200M left rows, 1000 right, two `UInt64` keys, count only   424 -> 243 ms
  20M left rows, `String` keys                                102 ->  83 ms,  31 -> 1 MiB
  one of the two keys selected, so only the other one goes    432 -> 390 ms
  RIGHT, which also emits the non-joined right rows           134 -> 138 ms (unchanged)

The test covers those four shapes.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_016QJvAjMfovbKtDsMW9mDbF
pull Bot pushed a commit that referenced this pull request Sep 21, 2026
`ThreadPoolImpl::scheduleImpl` handed its `wait_microseconds` parameter
straight to `std::condition_variable::wait_for`, which evaluates the wait
as `steady_clock::now() + duration` in nanoseconds, multiplying a
microsecond duration by 1'000. The parameter is a `uint64_t`, while the
settings that feed it are `Int64` microsecond timespans, so a negative
timeout arrives as a huge unsigned count and that multiplication
overflows `Int64`. UBSan aborts the server; a release build wraps to a
deadline in the past, so the schedule fails at once with
`Cannot schedule a task: no free thread` instead of waiting.

The setting that reaches it is `lock_acquire_timeout`:
`MergeTreeDataSelectExecutor::filterPartsByPrimaryKeyAndSkipIndexes`
passes `lock_acquire_timeout.totalMicroseconds()` to `scheduleOrThrow`
when it analyses the primary key of several parts in parallel.

Found on master in the stress test:
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=a54f19b0b7169af771a26d449065c368684b07a3&name_0=MasterCI&name_1=Stress%20test%20%28amd_asan_ubsan%29

    /ClickHouse/contrib/llvm-project/libcxx/include/__chrono/duration.h:93:79: runtime error:
    signed integer overflow: -100000000000000000 * 1000 cannot be represented in type '_Ct'
    #5  std::condition_variable::wait_for<...>(...)      condition_variable.h:193
    #6  ThreadPoolImpl<...>::scheduleImpl<void>(...)     src/Common/ThreadPool.cpp:470
    #7  ThreadPoolImpl<...>::scheduleOrThrow(...)        src/Common/ThreadPool.cpp:655
    #8  DB::MergeTreeDataSelectExecutor::filterPartsByPrimaryKeyAndSkipIndexes(...)
                                    src/Storages/MergeTree/MergeTreeDataSelectExecutor.cpp:1286

Clamp the count with a new `saturatedMicroseconds`, the microsecond-typed
sibling of the `saturatedMilliseconds` and `saturatedSeconds` helpers,
which covered every millisecond- and second-typed `wait_for` but not this
microsecond one. The pool cannot reuse the millisecond clamp because
`wait_microseconds` must keep sub-millisecond resolution. A count above
the one-year cap keeps meaning "wait until a thread frees up", the same
thing the existing clamp already does for a huge positive timeout.
pull Bot pushed a commit that referenced this pull request Sep 27, 2026
The fixture rows are arrayResize([toUInt64(number)], N) = [number, 0, ..., 0],
and `x -> x > 3` is true only for element 1. So arrayFirst (queries #8 and #10)
stops at the first element it checks, while arrayLast (#9 on the 32-element
table, #11 on the 128-element one) walks backward over 31 or 127 rejected
elements per row before it reaches element 1. The lambda, the tables and the
output reservation are the same for the twins; only the backward scan differs.

Only the scanning queries are bimodal. Performance comparison runs between
2026-09-12 and 2026-09-26, client_time, runs moving more than 15% either way:

  arm: #8 4 of 3868, #9 336 of 3630 (37 of 384 on master),
       #10 4 of 3843, #11 178 of 3708 (17 of 398 on master)
  amd: #8 0 of 1107, #9 17 of 1053, #10 1 of 1086, #11 40 of 1051

The moves go both ways in about equal numbers (arm #9: 156 slower, 180
faster), so they do not come from the compared builds. On arm the slow level
is extra user CPU time on identical work: over the 156 runs where the new
server was slow, #9 user time was 54.1 -> 63.3 ms, with the same soft page
faults (816 vs 815), system time (1.45 vs 1.49 ms) and memory usage. On PR
ClickHouse#117153 (arm 1/6, job 107092288374) all 7 runs of #9 took 53.1-53.6 ms on
one server and 63.1-64.4 ms on the other, where #11 stayed fast. The learned
in-tree thresholds of #9 and #11 are 27% and 23%, and the performance
dashboard scored that +19.2% as a confirmed regression.

Change the predicate of #9 and #11 to `x -> x = 0`. It is true for the
trailing zero, which is the element arrayLast checks first, so all four
filter-path queries evaluate the lambda over every element and then stop at
their first check, like the stable arrayFirst twins. The query order and
count are unchanged, so the query indices keep their identity. The new query
texts start without learned thresholds.

Cost: no query times a backward scan over many rejected elements any more
(the arrayFirst queries never timed a long forward one). The output
reservation the test was added for is still measured.

Local check on x86 with the official 26.10.1.761 master build, perf.py, 7
runs: old #9 108.0 ms vs #8 63.7 ms; new #9 74.3 ms vs #8 75.1 ms, new #11
56.9 ms vs #10 59.8 ms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant