mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-02 22:30:20 -06:00
Repeating a duplicate or paste of a 12 MP layer cost as much as the first time because the GPU compositor's lower-stack cache stayed at the checkpoint of the first edit after it was filled: an edit higher up only checked that the layers below that checkpoint were unchanged, so every refresh re-ran all passes above it (in the #209 layered document, 87 of 110 passes over the 12 MP damage rect; the duplicate itself takes 0.3 ms, its tiles are already shared). Each cached chunk now remembers its own checkpoint. A render captures at the highest checkpoint below the edit, also where it resumed from a lower cached one, so the next refresh of that edit (its undo, redo or repetition) resumes just below it. Chunks a refresh doesn't reach keep their lower prefix; a chunk moved by a partial capture holds only that rectangle afterwards. Validity is unchanged: a chunk survives only while the layers below its checkpoint are untouched. Release perf_scenarios, layered group, Windows 11, RTX 5070 Ti, 7 interleaved runs: P9 p50 22-29 -> 12-17 ms, P11 p50 37-41 -> 11-18 ms; P8 and P10 fall too; P1-P7, P12 unchanged. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>