Skip to content

Integrate JiT compilation into CLI runtime - #2211

Merged
rafal-hawrylak merged 6 commits into
mainfrom
pr4c-jit-runtime
Aug 5, 2026
Merged

Integrate JiT compilation into CLI runtime#2211
rafal-hawrylak merged 6 commits into
mainfrom
pr4c-jit-runtime

Conversation

@rafal-hawrylak

Copy link
Copy Markdown
Collaborator

#2184 with extracted refactorings.

@rafal-hawrylak
rafal-hawrylak requested a review from a team as a code ownerJune 19, 2026 19:18
@rafal-hawrylak
rafal-hawrylak requested review from udim and removed request for a teamJune 19, 2026 19:18
@rafal-hawrylak

Copy link
Copy Markdown
CollaboratorAuthor

Need to address: #2184 (comment)

@rafal-hawrylak

rafal-hawrylak commented Jun 22, 2026

Copy link
Copy Markdown
CollaboratorAuthor

Need to address: #2184 (comment)

Solved in:

Comment threadcli/api/commands/jit/compiler.ts Outdated
Comment threadcli/api/commands/base_worker.ts Outdated
Comment threadcli/api/commands/build.ts Outdated
Comment threadcli/api/commands/base_worker.ts Outdated
Comment threadcli/api/commands/run.ts Outdated
Comment threadcli/api/commands/run.ts Outdated
Comment threadcli/api/utils/constants.ts Outdated
@rafal-hawrylak
rafal-hawrylakforce-pushed the pr4c-jit-runtime branch 2 times, most recently from 289c1c2 to 60be915CompareJuly 16, 2026 05:34
@rafal-hawrylak
rafal-hawrylak requested review from apilaskowski and ikholopov-omni and removed request for udimJuly 16, 2026 05:39
Comment threadcli/api/BUILD Outdated
Comment threadtesting/test.ts Outdated
Comment threadcli/api/commands/run.ts Outdated
- base_worker: drop redundant undefined guard around clearTimeout
(clearTimeout(undefined) is a documented no-op). Restore
runWorker's timeoutMillis to a required number and drop the
conditional setTimeout — matches main's contract; the earlier
loosening to number|undefined let JiT workers run without any
timeout when --jit-timeout was omitted.
- jit/compiler.ts: default timeoutMillis to
DEFAULT_COMPILATION_TIMEOUT_MILLIS at the .compile() entry point
(mirrors CompileChildProcess.compile), so JiT workers always
have a timeout even without --jit-timeout.
- build.ts: replace unsafe (action as any).jitCode cast with a
narrowing "jitCode" in action check.
- run.ts: flatten the outer try/catch that only wrapped the JiT-compile
try; the JiT-compile block already has its own try/catch. Extract the
action.tableType -> dataform.TableType mapping into tableTypeEnum.
Use \${e?.message || String(e)} when formatting a JiT compilation
error so an error thrown without a .message field still surfaces
something readable rather than "undefined".
- constants.ts: revert DEFAULT_COMPILATION_TIMEOUT_MILLIS to 60000
(main's value); the per-JiT timeout is configurable via
--jit-timeout.
- compiler.ts: keep the Array.from(response) conversion (child.send
uses JSON IPC by default, which serializes Uint8Array as
{"0":n,...} and Buffer.from() rejects that) but add a comment
documenting the constraint.
- BUILD: order load statements alphabetically to satisfy the
buildifier out-of-order-load lint.
- testing/test.ts: revert DEFAULT_TIMEOUT_MILLIS from 300000 back to
30000. The bump was unintended and would silently extend every
test's per-case timeout to 5 minutes.
Each JiT compile registered a cancel handler on the Runner's EventEmitter
but never removed it once the compile finished. A run with N JiT actions
therefore accumulated N stale listeners and eventually tripped the default
MaxListenersExceededWarning threshold.
Register the handler through a local variable and remove it in a finally
block so successful and failed compiles both clean up. Also drops a stray
trailing-whitespace line from the dryRun compiledSql branch (comment #2).

@apilaskowskiapilaskowski left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets also wait for review by @ikholopov-omni

@rafal-hawrylak
rafal-hawrylak merged commit ecc6d89 into mainAug 5, 2026
11 checks passed
@rafal-hawrylak
rafal-hawrylak deleted the pr4c-jit-runtime branch August 5, 2026 17:56
rafal-hawrylak added a commit that referenced this pull request Aug 25, 2026
…2256)
Fixes#2247. PR #2211 (JiT integration) silently changed --timeout from
compile-only to a whole-run wall-clock deadline, causing existing runs to
exit 1 with no output after the previously-effective compile duration.
- Restore --timeout to compile-only (matches 3.0.63 semantics and describe text).
- Add --execution-timeout (off by default) for the whole-run deadline.
- On TIMED_OUT/CANCELLED, print a top-level reason line so exit 1 is no
longer silent; propagate the cancel reason to per-action SKIPPED lines.
- When --timeout is passed without --execution-timeout, print an advisory
notice pointing at the new flag (JSON output unaffected).
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@rafal-hawrylak@apilaskowski@ikholopov-omni