Skip to main content

Module l0

Module l0 

Source
Expand description

The L0 kernel adoption (CONS-CORE Phase C, step 1) — route a graph’s nodes and straight edges through the shared facett_core::render Canvas seam instead of graphview’s bespoke vello_cpu scene.

This is the opt-in alternative path. graphview’s crate::cpu::render stays the default + the pixel reference; this module lowers the same GraphModel / Decorations into the L0 SDF instance vocabulary (QuadInstance for node chips, LineInstance for straight edges) and hands them to a core Renderer — the same kernel the map skins draw through. The CPU lane (facett_core::render::CpuRenderer) is always available; with the gpu feature the L0 SDF wgpu pipeline can back the same instances.

Geometry note: the reference path draws rounded-rect chips + cubic edges. The L0 vocabulary is SDF circles/markers + straight capsules, so this path is a deliberately different (chip = rounded-square marker, edge = straight line) lowering — it is not byte-parity with cpu::render and so does not feed any golden. It exists to prove a graph routes through the core Canvas and renders non-blank; the curved-edge / rounded-rect parity is a follow-up (the L0 kernel would need a rounded-rect-with-border SDF + a cubic tessellation to lines).

Functions§

lower
Lower model (decorated, under camera) into the L0 SDF instance batches: node chips → rounded-square MarkerInstances (+ a ring CircleInstance where a decoration ring is set), straight edges → LineInstances. Returns (quads, lines) in the core’s screen-pixel contract.
render_to_rgba_l0
Render model (decorated, under camera) to a straight-RGBA8 Frame through the shared L0 Canvas — the CONS-CORE adoption path. backend selects the core renderer; today both arms use the CPU CpuRenderer (the GPU arm shares the same lowered instances — the live wgpu readback is the follow-up, exactly as graphview’s reference GPU arm).