/** * Rows held in memory while shuffling, when the caller identifies no window. * * Five 50,000-row groups span more than one output row-group and reach `wof-admin`'s whole * 13-country set, while a window below `ROW_GROUP_SIZE` draws from no more than one row-group. */ export declare const DEFAULT_SHUFFLE_WINDOW = 250000; /** * Seed for the shuffle when the caller names none, fixed rather than drawn so two builds * of one input write the same row order and a corpus is reproducible from its inputs. */ export declare const DEFAULT_SHUFFLE_SEED = 20260922; /** * Yield the input shuffled within a sliding window of `windowSize` rows, so memory is * bounded by the window rather than the input; `windowSize <= 1` yields the input unchanged * and consumes no random draw, keeping a no-shuffle build byte-identical. */ export declare function shuffleWithinWindow(rows: AsyncIterable, random: () => number, windowSize?: number): AsyncGenerator; /** * One split's rows as the corpus build writes them to parquet: shuffled within each source's run, * each source drawing from a generator seeded by the build's seed, the split's salt and the source id. * * Each split and source gets its own generator. * A file's row order depends only on that source's rows. row counts in other splits * or sources do not affect it. */ export declare function shuffleSplitRows(rows: AsyncIterable, opts: { seed: number; salt: number; window: number; }): AsyncGenerator; /** * The salt each split's shuffle seed adds to the build's seed. */ export declare const SPLIT_SHUFFLE_SALT: { readonly train: 0; readonly val: 1; readonly test: 2; }; /** * A 32-bit seed for one source's shuffle, from a base seed and the source id. */ export declare function sourceShuffleSeed(seed: number, source: string): number; /** * Yield rows shuffled within a sliding window per source, each source drawing from its own generator. * * A source's row order then depends only on its own rows, so a file holding one * source has bytes that no other source's rows can change. * The corpus build writes a source's rows contiguously, so the window is flushed * when the source changes and memory stays bounded by one window. * A source that recurs later keeps its generator's state. * * @param randomFor Called once per source for that source's generator. */ export declare function shuffleWithinSourceRuns(rows: AsyncIterable, randomFor: (source: string) => () => number, windowSize?: number): AsyncGenerator; //# sourceMappingURL=shuffle.d.ts.map