/** * Parallel generation coordinator (`--jobs N`). * * Splits `[0, count)` into N contiguous ranges, renders each in a worker * thread to its own temp file, then concatenates the temp files IN ORDER to * the destination. Because Engine 2's value(i) is seekable, the workers need * no coordination and the concatenation is byte-identical to a single-threaded * `--jobs 1` run. A pure speed knob — it never changes the output. * * Only sound when: the streaming engine is active AND there are no inline * render-time generators (those draw from the sequential render prng — see * `hasInlineRenderGenerators`). The caller checks `parallelBlockReason` first * and falls back to single-threaded generation when it returns a reason. */ export { AUTO_JOBS_MIN_ROWS, parallelBlockReason, partitionRows, resolveJobCount, } from './parallel-plan.js'; export interface ParallelParams { readonly source: string; readonly seed: string; readonly count: number; /** * An OVERRIDE the caller actually asked for, never a default. `undefined` * means "whatever the config says", and it has to survive as `undefined` all * the way into the worker — filling it in with 'en' here is what made a * `local="ru"` config produce English data above the auto-parallel threshold. */ readonly locale: string | undefined; /** The project config's locale: a fallback for a config that names none. */ readonly defaultLocale?: string | undefined; readonly now: number; readonly dataPaths?: readonly string[] | undefined; readonly baseDir?: string | undefined; /** * The engine the caller FORCED (`--engine N`, `--stream`), or undefined for * "whatever the config allows". It has to reach every render this run makes * — the plan, the scan, the workers — because naming an engine is a promise * about refusals: a uniq too tight for engine 3's bounded repair must refuse * under `--engine 3`, exactly as it does single-threaded. Rendering with * `mode: "disk"` here instead is what turned that refusal into a silent * in-memory fallback per worker — and, at 8,000,000 medical rows, into an * out-of-memory crash reported against an engine that never ran. */ readonly engine?: 1 | 2 | 3 | undefined; readonly jobs: number; /** Destination file descriptor (1 for stdout, or an opened output file). */ readonly destFd: number; /** * Called as the run advances, with the WHOLE file's numbers. * * Every worker reports the rows it has finished; this adds them up, so a * watcher sees one run rather than N. Without it a parallel run was silent * until the moment it ended — and above a hundred thousand rows the CLI * chooses parallel by itself, which made silence the ordinary case. */ readonly onProgress?: ((progress: { phase: 'uniq-scan' | 'uniq-sort' | 'uniq-repair' | 'render'; done: number; total: number; }) => void) | undefined; } export declare function runParallel(params: ParallelParams): Promise; //# sourceMappingURL=parallel.d.ts.map