import { BicomplexJuliaField } from '@holotope/core'; import type { ComputeCapableRenderer } from './sliced-complex-gpu.js'; export interface ComplexQuadraticGPURecordBatch { readonly magnitudes: Float32Array; readonly potentials: Float32Array; readonly distances: Float32Array; readonly derivativeBounds: Float32Array; readonly iterations: Uint32Array; readonly escaped: Uint8Array; readonly orbitTraps: Float32Array; /** Packed [imaginary, real] final values. */ readonly finalPoints: Float32Array; } /** * One GPU evaluation read back, as a record of arrays rather than an array of * records. * * The buffers arrive from the device in that shape and are handed on * unchanged: repacking a million samples into objects to inspect a handful * would cost more than the evaluation did. `count` is the number of samples, * and every array holds one entry per sample except those marked below, which * hold four — the layout the shader wrote. */ export interface BicomplexJuliaGPURecordBatch { /** Samples evaluated; every array below is sized from this. */ readonly count: number; /** Escape-time value per sample. */ readonly values: Float32Array; /** Final orbit magnitude per sample. */ readonly magnitudes: Float32Array; /** Escape potential per sample. */ readonly potentials: Float32Array; /** Distance estimate per sample. */ readonly distances: Float32Array; /** Iterations taken before escaping or reaching the cap. */ readonly iterations: Uint32Array; /** Whether each sample escaped, as 0 or 1. */ readonly escaped: Uint8Array; /** Orbit-trap value per sample. */ readonly orbitTraps: Float32Array; /** Final orbit point, four entries per sample. */ readonly finalPoints: Float32Array; /** The two independent complex orbits the bicomplex iteration factors into, * retained separately because each escapes on its own schedule and the * combined record cannot show which one decided the result. */ readonly factors: readonly [ComplexQuadraticGPURecordBatch, ComplexQuadraticGPURecordBatch]; } /** * How far a GPU evaluation stands from the Float64 CPU reference. * * Two kinds of disagreement, judged differently and reported separately. * The counts are over decisions — whether a point escaped, and on which * iteration — which the two paths must reach identically, so any count above * zero is a real divergence rather than a tolerance to widen. The maxima are * over measured quantities, where Float32 and Float64 arithmetic cannot agree * exactly and only the size of the gap is meaningful. * * The comparison rounds each input to Float32 before evaluating on the CPU. * Without that, a difference would partly be the two paths having been given * different points, and the check would measure the conversion rather than the * arithmetic it exists to verify. * * The factor figures repeat the comparison one level down. A combined result * can agree while a factor does not, the other factor having decided the * outcome, so a divergence hides unless both levels are checked. */ export interface BicomplexJuliaGPUDifferential { /** Samples compared. */ readonly count: number; /** Samples where the two paths disagreed on escaping at all. */ readonly escapeMismatches: number; /** Samples where they escaped on different iterations. */ readonly iterationMismatches: number; /** The same disagreement counted within either factor orbit. */ readonly factorEscapeMismatches: number; /** Factor orbits that escaped on different iterations. */ readonly factorIterationMismatches: number; /** Largest absolute difference in escape-time value. */ readonly maxValueError: number; /** Largest absolute difference in distance estimate. */ readonly maxDistanceError: number; /** The same, within either factor. */ readonly maxFactorDistanceError: number; /** Largest absolute difference in any coordinate of a final point. */ readonly maxFinalPointError: number; /** The same, within either factor. */ readonly maxFactorFinalPointError: number; } /** Float32 compute realization of the exact bicomplex C x C factorization. */ export declare class BicomplexJuliaGPU { readonly field: BicomplexJuliaField; readonly count: number; private readonly computeNode; private readonly combinedMetrics; private readonly firstMetrics; private readonly firstState; private readonly firstFinal; private readonly secondMetrics; private readonly secondState; private readonly secondFinal; constructor(field: BicomplexJuliaField, positions: Float32Array | readonly number[]); dispatch(renderer: ComputeCapableRenderer): void; read(renderer: ComputeCapableRenderer): Promise; evaluate(renderer: ComputeCapableRenderer): Promise; } export declare function compareBicomplexJuliaGPU(field: BicomplexJuliaField, positions: Float32Array | readonly number[], gpu: BicomplexJuliaGPURecordBatch): BicomplexJuliaGPUDifferential; //# sourceMappingURL=bicomplex-julia-gpu.d.ts.map