/** * @fileoverview GaussianTrainDispatch — the seam between the compiler and the runner. * * A `GaussianTrainCompiler` emits a `GaussianTrainJob` whose `executor` field NAMES this module * (`@holoscript/engine/gpu/GaussianTrainRunner`) by string. Until this dispatcher existed, nothing * dereferenced that string — the compiler and the runner were two proven halves with no connective * tissue between them (flagged by the 2026-06-20 /critic review). `dispatchGaussianTrainJob` IS that * dereferencer: it takes a compiled job + a resolved dataset and routes a sovereign job onto the * native runner (remote jobs are rejected here — they belong to GaussianSplatBakingPipeline). * * It accepts a LOCAL structural subset of core's `GaussianTrainJob` (no cross-package import — engine * stays decoupled from the core barrel). The shapes are pinned by tests on both sides: the compiler * test asserts the emitted job has these fields; the dispatch test asserts they drive a real fit. * A full end-to-end test that feeds the compiler's LITERAL output through here (importing * GaussianTrainCompiler from @holoscript/core/compiler) is the remaining tightening — it needs core's * dist rebuilt to carry the export, so it lives in CI (core builds before engine), not this unit run. */ import { type TrainResult, type TrainView } from './GaussianTrainRunner'; import { type Gaussian3D } from './GaussianTrainer3D'; /** Structural subset of @holoscript/core `GaussianTrainJob` that the dispatcher routes. */ export interface DispatchableTrainJob { backend: 'sovereign' | 'remote'; hyperparams: { iterations: number; learningRates: { position: number; scale: number; rotation: number; opacity: number; color: number; }; dilation: number; /** Densify every N iters (0/absent = off). Maps to the runner's densification.interval. */ densifyInterval?: number; /** Gaussian-count cap. Maps to the runner's densification.maxGaussians. */ targetGaussians?: number; }; } /** * Dereference a compiled training job to its executor and run it. * - `sovereign` → the native GaussianTrainRunner (this path; $0). * - `remote` → rejected (route to GaussianSplatBakingPipeline → api.rendernetwork.com instead). * * @throws if the job is not sovereign, or has no views. */ export declare function dispatchGaussianTrainJob(job: DispatchableTrainJob, initial: Gaussian3D, views: TrainView[]): TrainResult; /** * GPU-accelerated variant. Same routing rules as `dispatchGaussianTrainJob` — sovereign only, * remote rejected — but dispatches the O(N×pixels) forward+backward rasterization to WGSL kernels. * * @param device A WebGPU device obtained from `navigator.gpu.requestAdapter()`. * @param bg Background colour for rendering (default [0,0,0]). * @param onProgress Called each iteration with (iterIndex, loss). */ export declare function dispatchGaussianTrainJobGPU(job: DispatchableTrainJob, initial: Gaussian3D, views: TrainView[], device: GPUDevice, bg?: readonly [number, number, number], onProgress?: (iter: number, loss: number) => void): Promise; //# sourceMappingURL=GaussianTrainDispatch.d.ts.map