Fp64FlavorSignals
Interface in Emulated f64
The device-identification signals recommendFp64Flavor and isAppleGpu read to pick the df64 flavour a device needs: 'integer' on Apple GPUs, where Metal runs underneath, and 'float' everywhere else.
import type { Fp64FlavorSignals } from 'typeshade'
The signature, the description and the examples come from the compiler's own source at commit 26de7be8.
Syntax
interface Fp64FlavorSignals { readonly adapterInfo?: { readonly vendor?: string; readonly architecture?: string } | null; readonly rendererString?: string | null; readonly userAgent?: string | null;}Description
The library cannot see a GPU itself, so the caller collects
whatever it has, a WebGPU adapter’s info, a WebGL2 UNMASKED_RENDERER_WEBGL string,
navigator.userAgent, and passes it here. Every field is optional, and any single
Apple-identifying signal is enough to select 'integer'. Passing none of them selects
'float', so an Apple device whose signals were never collected silently gets the wrong
flavour: df64 still compiles and runs, but its extended precision collapses to plain f32
once the shader compiler reassociates the error terms the float flavour depends on.
Instance properties
adapterInfooptionalread only{ readonly vendor?: string; readonly architecture?: string } | nullGPUAdapter.info(or any {vendor, architecture} shaped object). Apple reports vendor ‘apple’ (architecture like ‘apple’ / ‘metal-3’).rendererStringoptionalread onlystring | nullThe WebGL
UNMASKED_RENDERER_WEBGL(or RENDERER) string. Apple devices read like ‘ANGLE (Apple, ANGLE Metal Renderer: Apple M1, Unspecified Version)’ or ‘Apple GPU’.userAgentoptionalread onlystring | nullnavigator.userAgent, the fallback when the GPU strings are masked (iOS Safari always runs Metal underneath).
See also
Source
src/core/fp64/flavor-select.ts, line 38, at commit 26de7be8