Status: Accepted (2026-11-28, EN2). Works with DC2’s TRANSFORM op (shared/src/ops.ts, ADR 0103) and ChangeSet.transforms.
A move of a large selection used to be one SET per root. Above 200K roots the editor refused it, and each committed move re-derived every chunk it touched (~0.45 s for 5M shapes). DC2 added TRANSFORM { ids, dx, dy }, a parent-space translation of many roots. The change feed reports it as transforms: { roots, dx, dy }[], in apply order, with the roots and their descendants left out of changed. The goal is a commit without per-node derivation, right after the drag’s GPU preview.
DocSync.apply handles transforms before anything else in the change set, so the instance positions are still the ones on the GPU. If the same change set also moves nodes (STRUCTURE), every transform is re-derived instead.[primStart, subtreeEnd). Ranges are sorted (unless the roots already come in paint order) and merged when they touch. An overlap means a root inside another root’s subtree, which must move twice, so it is re-derived. A root under a rotated ancestor is also re-derived: its parent-space delta is not the page delta.Renderer.bakeTranslate runs VS_BAKE over the instances, one point each with the rasterizer off. It writes each instance’s 10 words back with (dx, dy) added to its centre: through an 8 MB temporary buffer, then copyBufferSubData. The program is compiled and linked when the renderer is created; Chrome links it in the GPU process, so the first bake does not block (it cost ~50 ms when linked on first use).(dx, dy) (padded by f32 rounding), and their LOD slots are translated in the same pass. Nothing is derived.node tools/bench/gpu-check.ts --big)| Case | doc.apply | engine CPU | GL calls | |—|—:|—:|—:| | 30 pages + 300K shapes, every top-level node (ranges) | 8.6 ms | 8.7 ms | 0.4 ms | | every other shape of 300K, selected (selection flags) | 2.4 ms | 5.2 ms | 0.06 ms | | 5M shapes, every shape | 455 ms | 58 ms | 0.1 ms |
The re-derive it replaces costs ~0.45 s (5M shapes) or ~0.41 s (website) of CPU.
f32(old + f32(d)), while a derivation from the doc gives f32(x_new + ...). They can differ by 1 ulp of the coordinate (invisible). Any later re-derivation of the chunk writes the doc’s values.Engine.verifyGpu() (tests and tools only) reads the GPU buffers back and compares them with a derivation from the doc.