Skip to main content

Module backend

Module backend 

Source
Expand description

Runtime backend selection — re-pointed to the L0 kernel (facett_core::render::backend) as of CONS-CORE Phase C. The policy (probe the hardware, then choose) now lives once in facett-core so the map skins and this graph engine decide identically; graphview re-exports the types here for back-compat, so every existing facett_graphview::{Backend, GpuProbe, decide} import (the benches, the example, nornir’s draw_graph) keeps resolving with zero source change.

vello is not GPU-only: the same scene rasterizes on the GPU (vello / the L0 SDF wgpu pipeline) when a usable adapter exists, and on the CPU (vello_cpu, multithreaded SIMD) when it doesn’t. The caller probes once and renders through whichever Backend decide returns.

Note one preserved nuance: graphview’s own CPU-force env var was FACETT_GRAPHVIEW_CPU; the core probe reads FACETT_RENDER_CPU. Both are honoured by GpuProbe::from_env here via the probe_from_env shim so a host that set either still forces CPU.

Structs§

GpuProbe
What a hardware probe found. The caller fills this (e.g. from a wgpu adapter enumeration, an env override, or a forced-CPU test flag); the policy — turning a probe into a pick — lives in decide so every surface decides identically.

Enums§

Backend
The chosen rasterizer.

Functions§

decide
THE picker: turn a GpuProbe into a Backend. GPU when usable and not forced off and the wgpu feature is compiled in; CPU otherwise. Keeping this pure (probe in, enum out) makes the policy trivially testable.
gpu_arm_compiled
Whether the GPU rasterization arm is compiled into this build of facett-core (i.e. the wgpu feature is on). The single source of truth for “can decide ever return Backend::GpuVello”. Re-pointed skins/engines (e.g. facett-graphview) should key their expectations off THIS, not their own crate’s feature flag — workspace feature-unification can light up facett-core/wgpu independently of a downstream crate’s own gpu feature.
probe_from_env
Build a GpuProbe from a detected-GPU flag, honouring both the core FACETT_RENDER_CPU override and graphview’s historical FACETT_GRAPHVIEW_CPU override (back-compat: hosts that set the old name still force the CPU path).