/** * WASM dispatch bridge for sort kernels — Slice 5.7a. * * Kernels covered: * - `sort_f64` — in-place ascending sort (NaN-last, returns same array). * - `argsort_f64` — return Int32Array of permutation indices (NaN-last). * - `rank_f64` — return Int32Array of ranks (0-indexed, NaN-last). * * Dispatch (for arrays ≥ WASM_SORT_THRESHOLD = 16 384 elements): * - `sort_f64` uses the AS managed kernel — now an INTROSORT (3-way quicksort + * median-of-3 + heapsort fallback), so duplicate-heavy input is O(n log n) * (the old Lomuto quicksort degraded to O(n²)); value-sort stays bit-identical. * - `argsort_f64` / `rank_f64` are repointed to AS (Phase 6): the AS * index sort now uses a STABLE total-order comparator (value, then original * index), so for tied values it returns the same permutation as the JS stable * reference (verified Phase 6 — exact match on tie-heavy + NaN input). * * Any thrown error is swallowed and the JS fallback runs — WASM is an * optimisation, not a correctness requirement. */ /** Minimum element count for WASM acceleration. */ export declare const WASM_SORT_THRESHOLD = 16384; /** JS fallback: sort Float64Array in-place (NaN-last). Returns same array. */ export declare function sortF64JS(data: Float64Array): Float64Array; /** JS fallback: return argsort permutation (NaN-last). */ export declare function argsortF64JS(data: Float64Array): Int32Array; /** JS fallback: return rank array (NaN-last). */ export declare function rankF64JS(data: Float64Array): Int32Array; /** * Sort `data` in place (ascending, NaN-last). * Returns the same array for convenience. * Uses WASM above {@link WASM_SORT_THRESHOLD}. */ export declare function sortF64Dispatch(data: Float64Array): Float64Array; /** * Return the argsort permutation for `data` (NaN-last) — STABLE. * After the call, `data[result[0]] ≤ data[result[1]] ≤ …`; equal values keep * their original input order, matching the JS stable reference. * * Uses the AS managed kernel above {@link WASM_SORT_THRESHOLD}: the AS index * sort now breaks value ties by original index (a strict total order), so it * yields the identical permutation to the JS stable sort on tie-heavy input * (verified Phase 6). Falls back to JS when wasm is unavailable / on any error. */ export declare function argsortF64Dispatch(data: Float64Array): Int32Array; /** * Return the rank array for `data` (0-indexed, NaN-last) — STABLE. * `result[i]` = position of `data[i]` in the sorted array. * * Uses the AS managed kernel above {@link WASM_SORT_THRESHOLD} (derived from the * stable AS argsort, so it matches the JS stable reference on ties — verified * Phase 6). Falls back to JS when wasm is unavailable / on any error. */ export declare function rankF64Dispatch(data: Float64Array): Int32Array; //# sourceMappingURL=wasm-bridge.d.ts.map