Infinite canvas / engine architecture questions #106
Replies: 7 comments 13 replies
1) Scenelets/chunking vs a strong spatial index (and delaying chunked artifacts)Vello is already fast for me (e.g. ~90k circles at 60+ FPS). My bigger worry is indexing + invalidation:
I started integrating a scenelet/artifact/chunking system (I am already deep into it at this point), but it’s hard and adds overhead/complexity. One idea is:
Question: Also: do you run stress tests/benchmarks/flamegraphs for edit ops (duplicate/transform large selections)? |
2) Text pipeline design: one canonical pipeline vs multiple specialized onesI want to add text soon (shaping + layout). I read your text rendering lesson (shaping/layout + SDF/MSDF atlas). I’m trying to avoid building two permanent text systems. Question: Or is it worth maintaining a separate specialized pipeline in practice? Where do you draw the boundary (layout/shaping vs rasterization vs atlas vs rendering)? |
3) Raster brushes + collaboration: ops-only canonical state + deterministic local reconstructionFor raster painting, I’m considering keeping canonical state as ops/intent only:
I’m tempted to go GPU-first for the brush core (compute/render pipelines), but I know cross-device bit-exact determinism on GPUs is hard. Magma, Krita and others all do CPU brushes from what I can see. I think Procreate Silica engine runs GPU accelerated ones (but they clip to max canvas size (easier than infinite canvas), probably a Apple Silicon Metal limitation, not sure I haven't looked into it too deep yet). From what I can infer, Magma pushes image work into a WASM worker, uses a small-grid dirty-rect approach 100x100, and relies on specialized compression formats (QOIR (QOI-Rects for fast lossless) and GFWX (Graph/Good Fast Wavelet codec for lossy)) for fast transfer/storage. They also use SMID for CPU acceleration. Performance wise I found it really good overall. Its pretty impressive. Question: And would you go GPU-first for the brush core, or CPU-first with selective acceleration? Any practical advice for keeping this reliable on the web? |
4) Many images: pyramids / virtual-texture direction + non-destructive editsLong-term I want to support lots of images on the canvas:
I briefly looked at KTX2 as a GPU container, but:
One idea:
Questions: (I found Google Earth to be a good example for what I want to achieve here (without the sphere 🌏). BUT it is static generated and then streamed, not real time editable) And are compressed GPU containers like KTX2 still useful if users expect editable adjustments? |
5) Implementation choice: JS vs Rust/WASM (and messaging formats)I noticed you’re building a lot in JavaScript and I’m curious what trade-offs mattered in practice. Questions:
My intuition: latency isn’t the limiting factor for most interactions (outside brushes / high-frequency streams), but I’d love to hear what actually mattered in real usage. |
6) AI agent integration: overlay feature vs foundational engine decisionI saw you started integrating an AI agent. I want an agent to be a core tool too (commands, editing assistance, automation), ideally driven by the same operation protocol the editor uses. Question: Or are there engine/design decisions you wish you had made earlier to make agent integration clean (e.g., richer semantic ops, better introspection, deterministic replay hooks, better debug surfaces)? And maybe you have some thoughts on diff / review management in an infinite canvas system. I am currently working this out, one should always be able to see what has changed in Canvas/Nodes/Texts or other related editor parts, I am not aware of any kind of tool that does this. Maybe something like a simple before / after preview or a diff shape node that looks different and exits at the old and new position at the same time. |
|
I'm trying to use vello as rendering engine and looks good now! |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
TL;DR: I’m building a browser-first infinite canvas/editor engine (Rust + WASM + WebGPU/Vello) with a worker-based architecture and deterministic ops/log document model (collab + offline-first). I’m optimizing less for raw vector draw speed and more for indexing/invalidation + smooth large edits (duplicate/transform thousands of nodes) as scenes scale. I’m posting 6 architecture questions below; any pointers welcome. Also: if you know other real-time collaborative raster editors (besides magma), I’d love links.
Hi @xiaoiver, thanks for offering to reply here.
Hey everyone, I am Christoph (Germany). I’m building a browser-first infinite canvas / editor engine:
I would appreciate any thoughts on the following topics, can be off-topic too. Doing this more as a hobby at the moment and I still need to learn a lot.
Below I’ll post six architecture questions as separate comments (one per topic) so replies can stay threaded and searchable, never really used github discussions before, but I hope it helps.
Why I’m asking / what I’m optimizing for
I’m less worried about “raw rasterisation speed” (for vector work Vello is already fast enough), and more about:
Very rough editor stress tests I ran (anecdotal, not a scientific benchmark)
I’ve been testing a lot of modern editors to calibrate what “good” feels like. My basic stress tests are usually:
A few anecdotal observations from my machine Macbook Pro M4 (again: rough, likely influenced by UI/DOM/layout, data models, snapping, etc.):
I am still looking into performing a better cross-tool benchmark that evaluates different ops more deterministic. Adding Sketch, Affinity, Linearity and more tools for a more complete picture, also adding Vector tests in Clip Studio, Photoshop or other Raster tools with vector capabilities.
I’m sharing this not to “rank” tools, but to give context for the kinds of bottlenecks I’m trying to avoid (especially duplication/transform + maintaining correct z-order and hit-test behavior under large edits.)
Longer-term target
My near-term “stretch goal” is handling ~1,000,000 unique primitive vector shapes on an infinite canvas with reasonable interaction performance (I agree real-world documents often have fewer nodes, but I want a strong base, since I am long time user of most of these tools and I can feel the bad performance issues... Nothing is slowing down the creative process than bad fps). Very long term I am looking into unifying all kinds of editors into a realtime collaborative cross platform editing suite, like all adobe apps in one. I think it is possible ¯(°_o)/¯
Extra ask if anyone reads this long text (community)
If anyone knows other real-time collaborative raster editors (besides magma.com), I’d love links/pointers. I’m trying to study viable architectures for “raster + collaboration” early. But from what I found these are none existent. Same goes for CRDT realtime Video editors (has similar decode/encode complexity). Or even audio platforms (I saw a few), but essentially a DAW in Web with realtime editing.
I’ll post a few questions below as separate comments. Feel free to answer only what you have time for, partial pointers are very welcome. I am appreciating any kind of inputs honestly.
All reactions