Repository navigation
Enable JIT compilation on macOS - #100947
Conversation
The `APPLE` condition was disabling the embedded compiler (JIT) and DWARF parser on macOS. The comment only explains the MSAN exclusion, and the Apple exclusion appears to be a leftover from early days when LLVM didn't build cleanly on macOS. Remove it to enable JIT on macOS by default. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
Workflow [PR], commit [d19aa2d] Summary: ✅ AI ReviewSummaryThis PR removes the unconditional Missing context
ClickHouse Rules
Final VerdictStatus: ✅ Approve |
When cross-compiling to macOS, LLVM's `config-ix.cmake` detects `HAVE_LIBRT` from the Linux build host, but `librt` doesn't exist on macOS. The LLVM Orc JIT libraries (`LLVMOrcTargetProcess`, `LLVMOrcJIT`, `LLVMOrcDebugging`) link `rt` when `HAVE_LIBRT` is set, causing: `ld: library not found for -lrt`. Fix by setting `HAVE_LIBRT` to false for Apple targets before entering the LLVM subdirectory. https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=100947&sha=98ea2118ba286f3973765cc477b882e5ecd12080&name_0=PR&name_1=Build%20%28amd_darwin%29 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…es than `skip_first_lines` When `input_format_csv_skip_first_lines` or `input_format_tsv_skip_first_lines` is set to a value larger than the number of lines in the file, `skipPrefixBeforeHeader` enters an infinite loop doing `pread` at EOF. Each call to `readRow` succeeds with an empty result even at EOF, so the loop never terminates. Add an EOF check before each `readRow` call to break out of the loop when the file is exhausted. Found via AST fuzzer in Stress test (amd_msan) on PR #100947. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Algunenano
left a comment
There was a problem hiding this comment.
Seems to work fine:
:) SELECT
COUNT()
FROM
jit_test
WHERE
NOT ignore(a / b + c / d + e / f + g / h + i / j)
SETTINGS
compile_expressions = 0;
SELECT COUNT()
FROM jit_test
WHERE NOT ignore(((((a / b) + (c / d)) + (e / f)) + (g / h)) + (i / j))
SETTINGS compile_expressions = 0
Query id: 4d9b1028-d3aa-483b-a93a-2c682b905323
┌───COUNT()─┐
1. │ 200000000 │ -- 200.00 million
└───────────┘
1 row in set. Elapsed: 1.774 sec. Processed 190.86 million rows, 15.27 GB (107.58 million rows/s., 8.61 GB/s.)
Peak memory usage: 294.53 KiB.
:) SELECT
COUNT()
FROM
jit_test
WHERE
NOT ignore(a / b + c / d + e / f + g / h + i / j)
SETTINGS
compile_expressions = 1,
min_count_to_compile_expression = 1
SELECT COUNT()
FROM jit_test
WHERE NOT ignore(((((a / b) + (c / d)) + (e / f)) + (g / h)) + (i / j))
SETTINGS compile_expressions = 1, min_count_to_compile_expression = 1
Query id: e05cbfe2-85d5-4a6f-85af-3f8c9315eb23
┌───COUNT()─┐
1. │ 200000000 │ -- 200.00 million
└───────────┘
1 row in set. Elapsed: 0.211 sec. Processed 200.00 million rows, 16.00 GB (949.12 million rows/s., 75.93 GB/s.)
Peak memory usage: 295.34 KiB.
|
The Stress test (arm_msan) failure is fixed by #101239, which should be merged first. After it is merged, please update the branch to include the fix. |
|
The MSan stress test failure (MemorySanitizer: use-of-uninitialized-value, STID 4179-5154 or 4148-3044) is a known pre-existing issue unrelated to this PR. Fix: #102158 |
# Conflicts: # contrib/llvm-project-cmake/CMakeLists.txt
…ex_granularity (#104162) Random settings limit only had an upper bound on `index_granularity` and no limits on `index_granularity_bytes`. With no lower bound, the test runner randomized `index_granularity` down to 27 (and `index_granularity_bytes` can be as low as 1024), producing 7400+ granules over the 200K-row table. The 300s client timeout fired while `ALTER TABLE test MODIFY COLUMN json JSON SETTINGS mutations_sync=1` rewrote all parts. Each granule contributes per-mark overhead that compounds with MSan + WasmEdge slowdown plus parallel CI contention. CIDB shows the same failure across 3 unrelated runs in 30 days (PR #100947, master 76e37f1, PR #100375), all in `Stateless tests (amd_msan, WasmEdge, parallel, 1/2)`, all with `index_granularity` in {27, 18, 28}. Locally measured (debug build, 200K rows, JSON `ALTER MODIFY`): - default `index_granularity=8192` 24 granules, 0.21s - failing `index_granularity=27` 7408 granules, 1.62s - pathological `index_granularity_bytes=1024` 7408 granules, 1.62s - proposed floor `index_granularity=100, bytes=10000` 2001 granules, 0.59s Mirrors the limits already used by the source test `03246_alter_from_string_to_json.gen.sql` from which 03381 was derived. Per @alexey-milovidov's request on #100375 (comment)... Co-authored-by: Groene AI <[email protected]> Co-authored-by: Alexey Milovidov <[email protected]>
The
APPLEcondition was disabling the embedded compiler (JIT) and DWARF parser on macOS. The comment only explains the MSAN exclusion, and the Apple exclusion appears to be a leftover from early days when LLVM didn't build cleanly on macOS. Remove it to enable JIT on macOS by default.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Enable JIT compilation on macOS.
Documentation entry for user-facing changes
Version info
26.5.1.83