chroix-vello — migration TODO
Источник:
dev/fera/chroix-vello/TODO.md(read-only; сгенерировано scripts/sync-docs.mjs)
chroix-vello — migration TODO
Section titled “chroix-vello — migration TODO”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.
allow() inventory (see commit abb3998)
Section titled “allow() inventory (see commit abb3998)”src/cpu.rs—cast_possible_truncation/cast_sign_losson the f32→u16 resize narrowing; exact because the range is checked (0..=u16::MAX) one line above. Keep.src/gpu.rs—unused_importsonuse {vello_gpu as _, wgpu as _}; placeholder pins. Must disappear when the GPU path is implemented (task G1–G4 below).
Stages
Section titled “Stages”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 wayVelloCpu::replaymaps ontoRenderContext(shared helpers inscene.rsalready 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 offscreenwgpu::Textureat viewport size (RENDER_ATTACHMENT | COPY_SRC | TEXTURE_BINDING). - Remove the
allow(unused_imports)placeholder — imports become real.
G3. Present + readback (src/gpu.rs)
Section titled “G3. Present + readback (src/gpu.rs)”-
present: decode → build Scene → render_to_texture → keep frame. -
readback_rgba(): COPY_SRC texture → MAP_READ buffer → premultiplied RGBA bytes, same layout asVelloCpu::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.
G4. Tests (tests/gpu_backend.rs)
Section titled “G4. Tests (tests/gpu_backend.rs)”- 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.
G5. Docs + commit
Section titled “G5. Docs + commit”- Rewrite
src/gpu.rsmodule docs (skeleton notes are obsolete),src/lib.rscrate docs, error.rs (GpuUnimplemented likely goes away). - Conventional commit, green check/clippy/test, no push.
Local dev notes (not committed)
Section titled “Local dev notes (not committed)”.cargo/config.toml(gitignored via.git/info/exclude) setsnet.git-fetch-with-cli = true; a global gitinsteadOfrule rewrites the privatethe-fera/chroix-contractURL 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.