Repository navigation
Use a hashed sparse mask in the short_circuit_compact_logical_masks performance test - #124417
Merged
egor-click merged 1 commit intoOct 11, 2026
Conversation
…erformance test Queries #0 and ClickHouse#1 selected every 64th row (`number % 64`). On arm their timing is bimodal per server process: in CIDB, 264 / 271 of ~3570 arm runs since the test was added moved more than 10% old-vs-new, while the six other queries of the same test moved in 2-4 runs and amd in 5-6 runs. Queries ClickHouse#6 / ClickHouse#7 run the same `extractMaskNumericImpl` instantiations with an 8-row period, and ClickHouse#4 / ClickHouse#5 with a dense 64-row mask, and are stable, so the noise depends on the 64-row period of a sparse mask, not on the cost of the mask loop. Select the sparse rows by `intHash32(number) % 64` instead: the density stays 1/64 and the queries still take the compact short-circuit path the test was added for, but the mask has no period. `cityHash64` of an integer is `intHash64`, so the selector uses a different hash to stay independent of the other two arguments: about half of the selected rows still reach the third argument, as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 2 rounds) plus my own review.
Second round: 0 findings. Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261007-113501 |
Contributor
|
Workflow [PR], commit [5239998] Summary: ✅
AI ReviewSummaryThis PR updates the sparse queries in Missing context / blind spots
Final Verdict✅ Acceptable as-is. No inline findings. |
egor-click
approved these changes
Oct 8, 2026
egor-click
enabled auto-merge
October 8, 2026 11:39
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.
Related: #123788
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not required: CI-only change.
Description
short_circuit_compact_logical_masks #0and#1(the sparseand/ormasks,number % 64) take one of two times on arm on the same code. On #123788 the dashboard scored#0+21% as a confirmed regression (arm 5/6 report): old 28.8-29.1 ms in 7 of 7 runs, new 33.2-35.3 ms in 6 of 7. On the previous head of that PR, the master server was the slow one.Runs moving >10% old vs new since #120520 added the test (2026-09-26):
#6/#7run the same mask loop (extractMaskNumericImpl) with an 8-row period, and#4/#5with a dense 64-row mask; both are stable, so the noise comes with the sparse 64-row period, not with the loop.I changed
#0and#1to select rows byintHash32(number) % 64: still 1/64 of the rows, still the compact short-circuit path this test was added for, but no period. NotintHash64:cityHash64of an integer isintHash64, so it would decide the second argument. About half of the selected rows still reach the third argument (78276 / 77901 for#0/#1).Validation (x86, master build):
perf.pyruns all 8 queries cleanly. Withshort_circuit_function_evaluation = 'force_enable', athrowIfon unselected rows in the second argument passes (it throwsCode: 395with'disable'), and athrowIfon selected rows in the third argument throws, so it is still reached. Medians of 30 interleaved rounds, 2 servers:#023.5-23.8 -> 26.6-26.7 ms,#123.9-24.1 -> 26.9-27.2 ms. I cannot measure arm locally; only the arm master census after merge can confirm the new form is stable.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/124417]
Version info
26.10.1.2160-master(included in26.10and later)