Add batch mode for JSONL function runs#595
Draft
dnagoda wants to merge 1 commit into
Draft
Conversation
This was referenced Jul 6, 2026
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.
📚 Stack (bottom → top)
--batch-full-outputopt-inRefs shop/issues-checkout#13420
Why
The
function-runneris used byfunction-rerunnerto replay productionfunction inputs for Checkout Blocks migration parity. Replaying hundreds of
thousands of inputs one process-per-input is dominated by process startup and
Wasm engine/module compilation, which is identical work repeated for every row.
What
Add a
--batchmode that reads newline-delimited JSON (JSONL) inputs from afile (
--input) or stdin and runs the function once per line:Engineand loads theModuleonce, then reusesthem across every input row — the expensive setup is amortized.
can parse results incrementally.
--batch-continue-on-errorkeeps processing on per-line read/parse/executefailures, emitting a
{"success":false,"error":...}record for the failingline; without it, batch mode fails fast on the first error.
Batch complete: N processed, S successful, E errorssummary tostderr so it never contaminates the JSONL on stdout.
Single-run behavior is unchanged — the existing path is factored into
run_single_modeand shares the same engine/module setup.Testing
cargo testcargo build --release