Repository navigation
Conversation
…ctions `CompiledFunctionRows` counts the rows processed by JIT-compiled expressions, once per function fused into the compiled expression, so a block of N rows through a compiled `plus(plus(a, multiply(b, 2)), 1)` adds 3N. `InterpretedFunctionRows` counts the rows processed by ordinary functions that run without JIT compilation, once per function, at the same places that count `FunctionExecute` (normal execution in `ExpressionActions` and lazy, short-circuit execution in `ColumnFunction::reduce`). Together they give the share of function evaluations that run compiled, which the existing block counters `FunctionExecute` and `CompiledFunctionExecute` cannot: they count blocks, and a compiled call of ten fused functions counts the same as one interpreted `plus`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Brings in #124680 and #126022, which the JIT correctness work stacked on this branch depends on. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Workflow [PR], commit [8e30ed0] Summary: ❌
AI ReviewSummaryAdds Missing context / blind spots
Findings
Tests
Final VerdictStatus: |
|
|
||
| auto jit_compiled_function = compiled_function_holder->compiled_function.compiled_function; | ||
| callJITFunction(jit_compiled_function, input_rows_count, columns.data()); | ||
| ProfileEvents::increment(ProfileEvents::CompiledFunctionRows, input_rows_count * fused_functions_count); |
There was a problem hiding this comment.
[P2] Use the same row unit for compiled and interpreted evaluations
This increment runs after the default implementations in IExecutableFunction have reduced the input, while InterpretedFunctionRows is incremented before those wrappers in ExpressionActions and ColumnFunction::reduce. For example, consider toString(x + x * 2) on a single 1000-row ColumnSparse with one nondefault value. The sparse wrapper calls the two-function JIT on its two stored values, adding 4 compiled rows, and preserves the sparse result. The interpreted toString also evaluates only those two stored values, but its counter adds 1000. The advertised compiled share is therefore about 0.4%, although two of the three function evaluations are compiled.
Please account for both events at the same boundary, either consistently counting logical rows or consistently counting the reduced rows actually evaluated. Apply the same rule to lazy execution and add a focused sparse-input regression test; the dense numbers cases do not exercise this mismatch.
| @@ -0,0 +1,30 @@ | |||
| -- Tags: no-fasttest | |||
There was a problem hiding this comment.
[P2] Handle the missing embedded compiler in MSan builds
The reference requires nonzero CompiledFunctionRows, but contrib/llvm-project-cmake/CMakeLists.txt also disables the embedded compiler by default for MSan. Setting compile_expressions = 1 cannot enable compilation in that binary. Consequently, the first query produces compiled/interpreted counts 0/3000 instead of 3000/0, and the mixed query produces 0/4000 instead of 3000/1000, so the new test deterministically fails in the MSan stateless lane.
Please add the necessary no-msan tag, as in 04930_jit_compiled_if_date_to_datetime.sql, or make the assertions account for whether the embedded compiler is available while preserving the absolute assertions on JIT-enabled builds.
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units11 translation units recompiled, 35 s compile time in total, 11 of them have a recent master baseline. Symbol sizes
|
CompiledFunctionRowscounts the rows processed by JIT-compiled expressions, once per function fused into the compiled expression, so a block of N rows through a compiledplus(plus(a, multiply(b, 2)), 1)adds 3N.InterpretedFunctionRowscounts the rows processed by ordinary functions that run without JIT compilation, once per function, at the same places that countFunctionExecute: normal execution inExpressionActions, and lazy (short-circuit) execution inColumnFunction::reduce.Together they give the share of function evaluations that run compiled, which the existing counters
FunctionExecuteandCompiledFunctionExecutecannot: they count blocks, and a compiled call of ten fused functions counts the same as one interpretedplus. This is the measurement for the work on expression compilation tracked in the issue below.Related: #126979
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Added profile events
CompiledFunctionRowsandInterpretedFunctionRows: the number of rows processed by JIT-compiled expressions (counted once per fused function) and by functions executed without compilation, so the share of a query that runs compiled can be seen insystem.query_log.Workflow [PR]
Sync PR [sync-upstream/pr/128973]