Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

chroix-vello — migration TODO

Источник: dev/fera/chroix-vello/TODO.md (read-only; сгенерировано scripts/sync-docs.mjs)

Status snapshot (2026-10-17). Audit result: the migration off legacy vello 0.10 already landed in commit 7f94a95 (“feat: migrate to Sparse Strips line”): Cargo.toml is on vello_gpu 0.3 + vello_cpu 0.3 (u8_pipeline) + wgpu 30 per UI-FRAMEWORK-IDEAS-V2.md §16 (decided 2026-10-03). No vello 0.10 remnants in the tree. cargo check / clippy --all-targets / cargo test are green (11 tests).

What remains is the real gap: the GPU variant is a skeleton. VelloGpu::present returns Error::GpuUnimplemented; vello_gpu/wgpu are pinned in the build graph behind an allow(unused_imports) in src/gpu.rs.

  1. src/cpu.rs — cast_possible_truncation/cast_sign_loss on the f32→u16 resize narrowing; exact because the range is checked (0..=u16::MAX) one line above. Keep.
  2. src/gpu.rs — unused_imports on use {vello_gpu as _, wgpu as _}; placeholder pins. Must disappear when the GPU path is implemented (task G1–G4 below).

G1. GPU scene mapping (src/scene.rs, src/gpu.rs)

Section titled “G1. GPU scene mapping (src/scene.rs, src/gpu.rs)”
  • Map decoded ops onto vello_gpu’s Scene the same way VelloCpu::replay maps onto RenderContext (shared helpers in scene.rs already produce kurbo geometry — confirm one kurbo/peniko stack across both backends).
  • Defensive layer balancing identical to the CPU path (unbalanced Push/Pop must not panic).

G2. Device plumbing + offscreen target (src/gpu.rs)

Section titled “G2. Device plumbing + offscreen target (src/gpu.rs)”
  • VelloGpu::new(device, queue) — host owns adapter selection (framework owns process-wide GPU state; backend must not pick an adapter itself).
  • resize (re)creates the offscreen wgpu::Texture at viewport size (RENDER_ATTACHMENT | COPY_SRC | TEXTURE_BINDING).
  • Remove the allow(unused_imports) placeholder — imports become real.
  • present: decode → build Scene → render_to_texture → keep frame.
  • readback_rgba(): COPY_SRC texture → MAP_READ buffer → premultiplied RGBA bytes, same layout as VelloCpu::pixels() (4 bpp, row-major, top-to-bottom) so the two variants are directly comparable.
  • Transparent-base clear so empty display lists give (0,0,0,0), matching the CPU oracle.
  • GPU-available probe; skip (not fail) when no adapter — CI portability.
  • Differential tests: same encoded DLs as the CPU suite rendered through VelloGpu, pixels compared against VelloCpu output with a small tolerance (AA differs between rasterizers; solid interiors must match exactly or ±2).
  • Error paths: present without resize → NoSurface; bad buffer → Decode.
  • Rewrite src/gpu.rs module docs (skeleton notes are obsolete), src/lib.rs crate docs, error.rs (GpuUnimplemented likely goes away).
  • Conventional commit, green check/clippy/test, no push.
  • .cargo/config.toml (gitignored via .git/info/exclude) sets net.git-fetch-with-cli = true; a global git insteadOf rule rewrites the private the-fera/chroix-contract URL to the local checkout /home/nikki/dev/fera/chroix-contract. Committed manifest stays on git deps.
  • Test GPU: AMD RX 6600 (radv, Vulkan 1.4) — real hardware headless tests OK.