4749 Commits

Author SHA1 Message Date
FredApps 7250c7070e Merge pull request #4341 from Terra854/fix/bend-it-overlap-4333
Two-Point Bend: keep the rigid tail intact past 180 degrees
2026-12-02 19:53:14 +01:00
FredApps f1549f6e5f Merge pull request #4340 from Terra854/fix/page-curl-seam-4332
Page Curl: remove the shading seam between curled and flat page
2026-12-02 19:53:04 +01:00
FredApps 714ef7e3f2 Merge pull request #4350 from Terra854/fix/nested-shape-group-move-4342
Timeline: move Trim Paths into shape groups
2026-12-02 19:52:13 +01:00
Terra854 dbdae9e894 fix(timeline): retain resolved same-parent shape drops 2026-12-02 12:35:54 +08:00
Terra854 ace3cbcda2 Timeline: move shape items between Contents groups 2026-12-02 11:47:10 +08:00
Terra854 d460b29f86 Render shape paint Composite within its group 2026-12-02 09:21:21 +08:00
Matthew Don a11548f909 feat(engine): reload external .ecproj edits into the live session (#4170)
* feat(engine): reload external .ecproj edits into the live session

Adds a project-file watcher on a worker thread (size + mtime stamps,
250 ms debounce, 1 s focused / 5 s unfocused) that wakes the UI only when
the open project's file changed. The UI applies the change on its own thread
through the existing file.revert -> replace_project path, so CLI/MCP edits
show in the running window without a restart.

Session.project_stamp is recorded on open/save so the app's own writes do
not reload themselves. A dirty session, active script or render job holds
the change and surfaces a status instead of discarding work; autosave is
paused while a change is pending.

Closes #4168

* fix(engine): close stamp races and correct reload guidance

- record the stamp only when the saved bytes are still on disk, so a
  concurrent external write is not mistaken for our own save
- read the project and its stamp as one observation when opening, retrying
  if the file changes mid-read
- install the watcher baseline with the loaded session stamp under one lock,
  and advance it only after the debounced change is published
- add tests for self-save acknowledgement, dirty guard and autosave pause
- replace the misleading Save-before-Revert status with Save a Copy guidance

Addresses CodeRabbit review on PR #4170

* fix(engine): handle unverified saves and stale reload reports

A save whose post-write byte check fails is marked unverified so the watcher
reports the first stamp of that path as an external edit instead of adopting
it as a baseline. Before reverting, compare the on-disk stamp with the
session stamp so a completed self-save does not discard undo history. Defer
reload while a script is waiting on a file dialog. Drop a failed reload
observation so it is retried only after a new stamp, not every frame.

Addresses the second CodeRabbit review on PR #4170

* fix(engine): require known stamp for reload shortcut and cache disk stamp

The stamp-matching shortcut only applies when the session stamp is known;
an unknown stamp keeps the observation pending. The on-disk stamp is read
once when a watcher observation is taken and carried through deferral,
avoiding file I/O on every frame.

Addresses the final CodeRabbit review on PR #4170

* fix(ui): keep recovery auto-saves while an external edit is pending

Auto-save writes recovery copies to their own files, never the project
file, so pausing it while a reload was pending only removed crash
recovery for unsaved local work. Keep it running, and hold it only when
the recovery target would alias the open project file.

Adds a regression proving the external project and the local recovery
copy both survive, and corrects the spec's wrong premise.

* fix(ui): check the autosave alias only on a due write; test every reload guard

Move the project-alias check into the engine write path
(autosave_tick_guarded) so it runs on the final WritePlan only when
auto-save is enabled and a write is due; idle frames do no file-system
work. Add regressions holding a pending external change for an active
script render, an open script file dialog and an active render job.

* test: add ignored measurement benches for the #4168 budgets

frame_tick_cost_of_project_reload: per-frame A/B of the UI tick with and
without tick_project_reload (p50/p95/p99/max over 100k ticks).
watcher_idle_cpu_and_reload_memory: watcher-only idle CPU (focused and
background), write->detect latency and RSS over 100 external saves.

* fix: rustfmt and strict clippy on the project reload watcher

Rewrite the watcher's recv loop as a while condition (clippy::while_let_loop)
with unchanged behaviour: a wake or a poll timeout runs one check, a dropped
Watcher (channel disconnected) ends the thread. Collapse the pending-change
if into its let chain, keep unwrap() inside test functions only, format both
files, and normalise project_reload.rs to LF like the rest of the tree.

---------

Co-authored-by: matthewdonsemail-lab <matthewdonsemail-lab@users.noreply.github.com>
Co-authored-by: FredApps <FredApps@users.noreply.github.com>
2026-12-02 00:55:37 +01:00
Nazar 242c47d226 Effect Controls: edit Dropdown Menu Control items (#4242)
* Effect Controls: edit Dropdown Menu Control items (#3645)

* Keep text undo with its dropdown item after reordering (#3645)

* fix(ui-egui): name Dropdown editor row actions by item

The string-list editor's up/down/remove buttons exposed only their glyphs
(↑ ↓ −) as AccessKit names, so a screen reader announced identical actions
on every row. Name them "<glyph> <action>, item N" (glyph first, translated)
and name each text field "Item N".

Adds a headless test that reads the accessibility tree with two items.

* test(ui-egui): install the headless runtime in the Dropdown editor tests

main now requires the runtime plugin in every test harness (e34fc9ec), so
the three Dropdown editor tests failed while building the app, before any
assertion ran. Install it the way the other Effect Controls tests do. The
assertions are unchanged.

---------

Co-authored-by: WillPastor <47420496+WillPastor@users.noreply.github.com>
2026-12-02 00:41:34 +01:00
Tareq Halaby 69fde80f69 refactor(i18n): prepare Arabic (ar) wiring, RTL layout, and catalog gating (#4149)
* feat(i18n): add Arabic (ar) UI localization and RTL support

* fix(i18n): correct hideOthers label and avoid auto-selecting Arabic without bundled font

* fix(i18n): allow explicit requested ?lang=ar while preserving auto-selection exclusion

* refactor(i18n): separate catalog to craft-i18n and keep RTL wiring in app

* fix(i18n): gate native Arabic on catalog loading and fallback Web stored preference

- Gate native Arabic availability in Settings and language() on loading the catalog
- Keep Arabic out of the Web picker and fall back stored 'ar' preferences to English on Web
- Add tests verifying the Web preference fallback and real Arabic translation on native

* fix(i18n): remove literal Arabic Services label (AGENTS.md §16) and isolate test fixture

* test(i18n): require catalogs for all shipped languages (AGENTS.md §31)
2026-12-02 00:40:45 +01:00
Terra854 351b0b4a20 Two-Point Bend: keep the overlapping rigid end intact 2026-12-02 01:37:50 +08:00
Terra854 a3f5ed3b52 Page Curl: join curved and flat back shading smoothly 2026-12-02 01:08:29 +08:00
Valentin Klein d4b2392f40 Render log says why a job renders on the CPU and names the GPU adapter (#3732)
* Render log: say why a GPU project renders on the CPU, and name the GPU adapter (#3727)

* WebM: the header, the size patch and delivering the file count as writing time; last_timing says whose it is (#3732 review)

* Export timing: label the initial compositor and attached GPU adapter, count frames that fell back to the CPU later

The timing line says "Initial compositor" and "attached GPU adapter" for the choice made at the
start. A frame asked of the GPU that ends with the GPU unavailable is counted in the new
gpu_fallback_frames, and the line reports it as "Later GPU fallback: N of M frames rendered on
the CPU after the GPU became unavailable". New test:
a_gpu_lost_after_the_start_is_reported_apart_from_the_initial_choice.

* Export timing: frames the probe drops do not count as a later GPU fallback

A device lost while Auto measures makes the job pick the CPU and drop the GPU's measured
frames, so only frames of a job that chose the GPU are counted.

* Export timing: count a GPU fallback when the frame is rendered, not from the adapter afterwards

The renderer now notes per frame whether the accelerator declined it while unavailable
(Renderer::comp_frame_noting_gpu_loss, passes::comp_frame_noting_gpu_loss), and the export
counts that. A frame the GPU rendered no longer counts when another frame in flight loses the
device before it is counted. The test renders two frames at once: frame 0 on the GPU while
frame 1 loses the device.

* Deferred readbacks: a frame that goes to the CPU after missed passes says whether the device was lost

in_passes records why it renders the frame without the accelerator (Passed::gpu_lost: the
device is no longer available, not passes run out on a healthy one), and
passes::comp_frame_noting_gpu_loss passes that on instead of dropping it with .value. New test:
a_deferred_frame_on_the_cpu_says_whether_the_device_was_lost.

---------

Co-authored-by: FredApps <FredApps@users.noreply.github.com>
2026-12-01 11:33:14 +01:00
Bar Borer f870db660b Text: Character and Paragraph changes reach all selected text layers (#2890)
* Text: Character and Paragraph changes reach all selected text layers (#2862)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Text: `layer.setText` reaches several layers through `selected` alone (#2862)

Drops the `layers` param, its docs/agents.md note and the tests that covered
only it or the merge key. The panels' behaviour is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Text: the layer-wide stroke order leaves a locked shown layer alone (#2862)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Text: `selected` with no layer to change is a no-op, and a per-character order resets them all (#2862)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Text: the panels show the first unlocked selected layer, not a locked one above it (#2862)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Properties: text rows change the edited layer's characters when another layer is first selected (#2862)

While a text layer was edited in the viewer and another layer was first in
the selection, the Properties text and paragraph rows dropped the edit's
range and changed the first layer's whole text instead. They now follow the
edited characters, as the Character panel does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* #2862: the text eyedropper writes to the layers that armed it

A whole-layer Fill or Stroke pick sent `selected: true` when it sampled, so
it reached the selection at the click, not the layers selected when it was
armed: with A+B armed and the selection changed to A+C, C took the colour.
The pick now captures the selected text layers when armed, and the viewer
sends them as `layer.setText {layers}`, skipping any that were deleted and
cancelling when none is left. `layer.setText` takes an explicit `layers`
list: the unlocked text layers in it change, whatever is selected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* #2862: the new text tests install the headless runtime like main's harnesses

Main's craft-libs runtime now refuses frames from a harness without its plugin (e34fc9ec), so the eight new Character tests build their harness with `framework::install_headless` too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* #2862: layer.setText refuses an explicit target it can't honour

A `layers` value that isn't a list, or a list given with a `range`, fell through to the layer and selection path and could edit a layer the caller didn't name. Both are now an error before anything changes. Without `layers`, the named layer (or the selection with `selected`) is still the default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 11:30:26 +01:00
Bar Borer b325b99f0f Puppet: a mesh that spreads a pin's pull and keeps its area (#2866) (#3066)
* Puppet: a mesh that spreads a pin's pull and keeps its area (#2866)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Puppet: adding a pin and solving agree on what the pin holds (#2866)

`puppet.addPin` chose a new pin's position by whether the click was on the deformed mesh, while the solve
chooses what the pin holds by whether its rest point is on the rest mesh. On a turned mesh a click just
off the outline unmaps to a rest point on the mesh: the pin held that point, but at the click, which
pulled the mesh over (6 px at a third of a turn).

Both now use `puppet::held_point`, and a pin that holds a point goes where that point is now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Tests: the off-mesh pin test checks a pin was added (#2866)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Puppet: a solve that fits a frame, shared by drawing and the overlay (#2866)

The solve was redone for the overlay after drawing, ran every refinement round however little they
moved, and built a fresh banded factor for each of up to five sets of stiffened weights, with room
for one of 320 MB.

- A round that moves no vertex 1e-4 px ends the refinement. On the far drags, the push, the cross
  and the S curve that changes no vertex by 1e-4 px, at 40 rounds or 200.
- Stiffened weights refactor into the same storage in the same order, and the factor's inner loops
  run over slices (same sums in the same order, so the same numbers).
- The factor is capped at 8 million values (64 MB). The densest mesh the tool builds (a target of
  20,000 triangles) needs 4.7 million; past the cap conjugate gradients solve the same system.
- Drawing and the overlay (`puppet.info`, adding a pin, the Puppet tools) share one cached solve.

On a 1280x720 solid with a far drag: 20,000 triangles 15.3 s to about 2.7 s, 10,000 2.2 s to about
0.8 s; with the pins at rest, 5.4 s to about 1 s.

The module doc now describes point pins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Tests: pin edge cases, the refinement mapping and smoothing (#2866)

- Mesh Rotation Refinement to rounds: the default (40), 0, negative, past the maximum, NaN and
  infinities.
- A pin on a vertex holds that vertex; one on an edge between two triangles holds the same point
  through either; one off the outline by round-off holds the point on it, and one further off its
  nearest vertex at the same offset; a Bend pin alone keeps its vertex in place.
- Smoothing falls back to the solve when the vertices don't match the mesh or no split is worth it,
  and every small triangle lies in the triangle its `parent` names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Puppet: the drawing keeps pins on their points and overlapping sheets apart (#2866)

- Smoothing bent the drawn mesh away from the points pins hold inside triangles: on the far drags
  and the S curve the image under a pin landed up to 10 px from it. The vertex gradients the
  smoothing uses now take the least change that puts each held point where the solve did (a few
  sweeps for pins sharing a vertex); edges still depend only on their two vertices, so no cracks.
- A 2x2 sample cell shared by two overlapping sheets coloured all its samples with the first
  sheet's read. A sheet whose source disagrees with the first's by more than 2 px now reads its own
  colour at its own first sample, weighted by its own samples; one sheet's cells read as before.
- The solver comparisons check both solves are the same length and finite before measuring how far
  apart they are (`f64::max` skips a NaN).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Puppet: held pins stay on their points together, and a narrow sheet in a pixel keeps its colour (#2866)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Puppet: the solve follows pins smoothly past what the mesh can give (#2866)

Stiffening triangles from the last solve's shape swung from pass to pass when
pins asked for more than the mesh could give, so half a pixel of drag moved
it hundreds of pixels. The stage is removed; the stress tests' limits are
set to what the solve now gives.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* #2866: bound the Puppet solver's pin system and keep saved rigs' look

The drawing's hold on pinned points solved one dense system over every
held pin: n x (n + 2) values and O(n^3) elimination per render, with n
uncapped. Points only meet through shared mesh vertices, so the system
now splits into groups of linked points; a group of up to 128 points is
solved exactly as before, a larger one by 32 passes of cyclic
projection, so memory and work grow linearly with the pin count.

Rigs saved before this change keep their look: a hidden Solver Version
parameter defaults to the current solve for new instances, and
migrate::legacy_default gives instances saved without it the first
solve, which renders through puppet/legacy.rs (main's solve and
drawing, bit-identical on four test rigs). The overlay and addPin's
placement follow the rig's version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: FredApps <FredApps@users.noreply.github.com>
2026-12-01 11:27:25 +01:00
Valentin Klein c228ce284b Reversed keyframes keep the shape of manually eased curves (#4283)
* Reversed keyframes keep the shape of manually eased value curves

Time-Reverse Keyframes and Paste Reversed Keyframes swapped the ease sides
but kept the signs of numeric component speeds, which are signed value
slopes. Mirror them now, while spatial and Orientation speeds along the
path or arc and progress eases of paths stay positive.

Fixes #4273

* Paste Reversed Keyframes flips ease speeds by the property pasted into

The sign of the speeds was decided by the copied property, so Scale keys
pasted reversed into Position got negated speeds, which run a motion path
backwards. Paste Reversed now swaps the sides and keys.paste flips the
speeds for each property the keys land in: value curves flip, motion paths
and Orientation stay positive.
2026-12-01 11:25:14 +01:00
Bar Borer 9f3e8ef810 Shapes: Add Merge Paths merges what's above it and paints the result (#2889)
* Shapes: Add Merge Paths merges what's above it and paints the result (#2175)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Tests: check the fix directly instead of assuming history or the tool's colour

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Shapes: only the Add menu's Merge Paths gets Mode Add and a paint (#2175)

Scripts keep Mode Merge and their own list: `layer.addShapeItem` does what
it did unless the menu passes `paint`, so the public `append` option goes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Shapes: Add Merge Paths' gradient runs across paths with no paint yet (#2175)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Shapes: a Repeater below an added Merge Paths doesn't widen its gradient (#2175)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Shapes: a Stroke among the paths doesn't widen an added Merge Paths' gradient (#2175)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Shapes: Add > Merge Paths gradient ignores an open line apart from the shapes (#2175)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Shapes: format the Merge Paths gradient test (#2175)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* #2175: saved projects keep their Merge Paths artwork

The renderer now drops every draw above a Merge Paths, as After Effects
does, so a project saved with painted groups above a Merge Paths and no
paint below it reopened blank (and exported blank).

Merge Paths gets a hidden Keep Group Paint property. New merges have it
off and render the After Effects way. A Merge Paths without it was saved
before this change: opening the project adds it on
(build::upgrade_shape_contents, next to Wiggle Paths' Spatial Phase),
and with it on, or missing, the renderer keeps the pre-#2175 rule
(drop only the paint above the merge in its own group, #1174), so saved
artwork renders as it did, with or without paint below the merge.

Tests: the #1174 pixel assertions come back as a saved-project case in
the render tests (as saved and as opened), and an engine test opens a
project file in the pre-PR shape, renders it, saves and reopens it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 11:21:08 +01:00
Bar Borer 0d33539240 Viewer: Shift on an edge handle keeps the layer's proportions (#2886)
* Viewer: Shift on an edge handle keeps the layer's proportions (#2860)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Tests: check the fix directly instead of assuming history or the tool's colour

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Viewer: one uniform branch in drag_ratio, and trim the Shift edge test (#2860)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Viewer: a Shift-dragged edge on the anchor keeps its scale wherever the press caught it (#2860)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Viewer: a Shift-dragged handle takes no snap that would throw it past the snap distance (#2860)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Viewer: a dragged handle's snap feedback shows only the snap it took (#2860)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Viewer: a Shift-dragged handle's snap feedback marks a point only when both axes land (#2860)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Viewer: a point a Shift-dragged handle reaches on one axis shows as the line it reached (#2860)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* #2860: group snap_handle's inputs instead of allowing the lint

The handle geometry (handle, anchor, layer-to-comp matrix, scaled axes,
Shift) moves into a HandleDrag struct, so snap_handle takes four
arguments and no longer needs allow(clippy::too_many_arguments) (rule 13).
No behaviour change; the tests keep their assertions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: FredApps <51426701+FredApps@users.noreply.github.com>
2026-12-01 11:19:34 +01:00
Valentin Klein 1f51eaadc7 Skip muted 3D Orientation keys when rotating a layer (#4279)
* Respect muted keys when evaluating 3D Orientation (#4270)

* Format the automatic Orientation ease fallback
2026-12-01 11:16:55 +01:00
Valentin Klein 5d6d457187 Splice formatted text and its character styles in one edit (#4277) 2026-12-01 11:14:33 +01:00
Valentin Klein 2848c104e3 #4271: Preserve mask curves when a key omits handles (#4278) 2026-12-01 11:11:51 +01:00
Valentin Klein ea81d31bf3 Keyframes: straight linear Position segments skip the arc-length table (#4272) (#4281) 2026-12-01 11:09:22 +01:00
Valentin Klein e093724e7a Gradient opacity stops given in any order in automation JSON now look the same as in ascending order (#4280)
* Gradient stops given out of order in automation JSON sample as if in order

Opacity stops of the plain form, and colour and opacity stops of the typed form, are sorted by position (stably) when coerced, as the plain form's colour stops already were.

* Gradient stops at positions 0 and -0 keep the order they were given in

The stop sort used total_cmp, which puts -0.0 before 0.0 although both are
the same position, so a stable sort reordered such stops. Compare equal
positions as equal, for colour and opacity stops in the plain and typed forms.
2026-12-01 11:00:56 +01:00
NetterSilver 7e8d42c9fe Render Queue: select several items and change them together; Add to Render Queue takes every selected comp (#3953)
* render queue: multi-select items and add several comps at once (#3726)

* render queue: Delete acts on the selection keyboard navigation just moved to

* render queue: install the headless framework in the selection tests

* render queue: Delete and Edit > Clear use the final selection; null items is an error

* render queue test: require every batch output to resolve
2026-12-01 10:55:15 +01:00
Bar Borer 672f776f99 Timeline: box selection selects keyframes live while it's dragged (#2858) (#2952)
* Timeline: box selection selects keyframes live while it is dragged (#2858)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Timeline: a Cmd/Ctrl box over keys alone adds to the selection, as Shift does (#2858)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Timeline: a box over keys alone clears the earlier selection first, as main's box does (#2858)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* #2858: marquee keeps its live selection in the UI and commits through commands

While a Timeline box is dragged, what it would select is a UI-side preview
(`TimelineState::marquee_preview`) that the rows draw as the selection; the
engine's selection is not written. The release runs main's `layer.select` and
`keys.select`, and Escape or any other end just drops the preview, so the
direct `Before::restore` writes are gone and the command journal replays to
the live selection (AGENTS.md rule 14).

Tests replay the journal on a fresh session after a Shift box that grows and
shrinks, and after a box cancelled with Escape; both fail on the previous
commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 10:51:45 +01:00
FredApps 678ec09a77 Make premultiplied RGB zero deterministic across platforms (#4257)
Co-authored-by: Fredrik Hallin <fredrik.hallin@guidelinegeo.com>
2026-11-29 06:07:03 +01:00
FredApps 45660841d5 test(media): make cancelled draft-switch regression deterministic (#4255)
* test(media): make cancelled draft-switch regression deterministic

* test(media): assert a submitted picture before cancelling the mode switch

---------

Co-authored-by: Fredrik Hallin <fredrik.hallin@guidelinegeo.com>
2026-11-29 06:06:57 +01:00
FredApps 4bf3e6d4e1 Suspend automatic preview caching during exports (#4248)
Co-authored-by: Fredrik Hallin <fredrik.hallin@guidelinegeo.com>
2026-11-28 20:57:56 +01:00
FredApps 3956c800aa Close texture-pool encoders after failed GPU submissions (#4246)
* Close texture-pool encoders after failed GPU submissions

* Register pool encoders only after device creation succeeds

---------

Co-authored-by: Fredrik Hallin <fredrik.hallin@guidelinegeo.com>
2026-11-28 20:41:30 +01:00
FredApps ce36eef5c1 Report timed-out script requests as unknown outcomes (#4247)
Co-authored-by: Fredrik Hallin <fredrik.hallin@guidelinegeo.com>
2026-11-28 20:41:09 +01:00
FredApps 143a8357da Keep layer property targets when duplicating compositions (#4229)
* Preserve layer-valued properties when duplicating a composition

* Keep explicit no-layer values while remapping duplicate targets

---------

Co-authored-by: Fredrik Hallin <fredrik.hallin@guidelinegeo.com>
2026-11-28 10:10:16 +01:00
FredApps 01060e212e Retire the GPU context after a polling panic (#4230)
* Retire GPU contexts when driver polling panics

* Avoid submitting frame cleanup work after GPU retirement

* Guard cleanup submission and reject results raced by device retirement

---------

Co-authored-by: Fredrik Hallin <fredrik.hallin@guidelinegeo.com>
2026-11-28 10:09:37 +01:00
FredApps 84c364f716 Recover project state when a script host disconnects (#4232)
* Recover the session if a script host loses its reply channel

* Reject oversized bridge requests before sending any bytes

* Keep pre-script undo history when a failed host leaves a group open

---------

Co-authored-by: Fredrik Hallin <fredrik.hallin@guidelinegeo.com>
2026-11-28 10:09:02 +01:00
FredApps 8300ee56d9 test(ui): follow macOS close and pointer conventions (#4227)
* test(ui): follow macOS close and pointer conventions

* Format the platform-specific Cryptomatte modifier test

---------

Co-authored-by: FredApps <FredApps@users.noreply.github.com>
Co-authored-by: Fredrik Hallin <fredrik.hallin@guidelinegeo.com>
2026-11-28 09:46:15 +01:00
Tiisetso Mosala 8aac28cf6c Quitting while preview frames render no longer crashes at exit (#3846) (#3847)
* #3846: stop the frame workers before the app exits

Rayon's pools don't join their threads, so on quit `main` could return
while a preview worker was still polling or reading back from the GPU.
The process's exit handlers then tore the Vulkan device down under that
worker: SIGSEGV (in the readback copy, or a freed dispatch table) or an
abort in the validation layer. `Frames::shutdown` drops the queued
frames, calls off the viewer's running ones and waits (up to 5 s) for
the frames still rendering; `on_exit` calls it first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Wait for all frame workers before tearing down the GPU

* Release the shutdown regression worker during test unwinding

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Fredrik Hallin <fredrik.hallin@guidelinegeo.com>
2026-11-28 09:34:44 +01:00
ViktorBystrov72 ebc1d0076b Preserve frozen Object Matte data on project import (#4126)
* Preserve frozen Object Matte data on project import

* Discard frozen mattes when import changes a nested source

* Verify frozen matte media and layer inputs on import

---------

Co-authored-by: ViktorBystrov72 <18964918+ViktorBystrov72@users.noreply.github.com>
Co-authored-by: Fredrik Hallin <fredrik.hallin@guidelinegeo.com>
2026-11-28 09:18:25 +01:00
MeanTemperature 1855d02c47 fix(render): Fill keeps a scaled-up text layer's working image small (#4158) (#4159)
* fix(render): Fill keeps a scaled-up text layer's working image small (#4158)

A layer's effect stack skips the cover of the whole layer rectangle only
when every effect is in SKIPS_COVER. Fill was not, so a text layer with
Fill scaled up to ~900 % got a working image the size of the scaled layer
rectangle on every frame, and a render reached tens of GB.

Fill without Invert only recolours pixels the layer already has (masked
or not), so it now skips the cover too. Inverted, it paints the layer's
transparent area and keeps it. The check reads the instance's Invert
value, so EffectSpec gains skips_cover_for(params).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(render): a feathered Fill keeps the cover (#4158)

With a feather, a Fill mask edge outside the painted pixels still blurs
into them, so the coverage has to be computed beyond the painted bounds.
Keep the cover when either feather is set; unfeathered Fill (the default)
still skips it. Adds a covered-reference test with a feathered mask whose
edge lies just outside the painted content (fails without this change).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 08:52:51 +01:00
MeanTemperature 61e4f00138 CLI renders keep at most 1 GB of decoded footage frames (#4157) (#4167)
* CLI: a headless session's footage frames keep at most 1 GB (#4157)

Since #3301 the footage frames may fill the caches' whole common budget,
and since #3941 the CLI's budget is that of the installed RAM. A one-pass
render reads each frame about once, so it kept gigabytes of frames it never
read again and was killed under a cgroup memory limit.

Session::footage_cap caps the footage frames (and decoded planes) below
the common budget; apply_cache_budgets honours it, so a new memory reading
or a settings change keeps it. headless_session() sets it to
HEADLESS_MEDIA_CACHE (1 GB, the footage cache's default in 0.24). The
desktop app keeps the whole budget.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(host): a headless session's footage cap is exactly HEADLESS_MEDIA_CACHE (#4157)

Assert the cap itself (or the budget, if smaller) rather than only that it
is below the budget, which a wrong cap above 1 GB would also pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 08:43:24 +01:00
Valentin Klein 7e7118f1a5 Overwriting a render no longer freezes the app on projects with many footage files (#3330)
* #3328: output guard checks file identity only where an alias is possible

The output guard opened every footage file of the project, for every check
of an output that existed, on the UI thread: minutes for long sequences on
a network share. It now compares only the files that can be the output
(folders on the output's volume, folders holding symbolic links), keeps the
identities it learnt in the session (folders that changed are looked at
again; Reload Footage forgets them), and does no file system call while its
lock is held.

render.frame checks and writes with one guard. A control request whose
sender stopped waiting is not run, and one tick runs control requests for at
most a tenth of a second; the rest follow in order on the next ticks.

* #3328: output guard compares paths only, no file is opened

Comparing file identities still cost a file open per footage frame when
folders were on the output's volume, and caching them invited races (#3330
review). The guard now compares paths by name once resolved: absolute, dot
segments resolved, one separator, Windows verbatim prefixes as the plain
path, without case on Windows and macOS. A link or hard link to footage
under another name is no longer recognised; the reported data loss (#1743)
is the same-path case. Render queue duplicate outputs compare by name too.

* #3328: drop the link identity tests of the render queue; test and doc review fixes

* #3328: a mapped network drive and its UNC path are one place

On Windows the output guard resolves each drive letter's root once per guard
(std::fs::canonicalize of `X:\`) and compares a path on that letter as the
place it resolves to: a mapped network drive as its \server\share path, a
subst drive as its folder. A root that can't be resolved keeps its letter.

* #3328: drive roots are looked up only where they can matter, and kept a minute

A drive letter's root is resolved only when the output and the protected
files are not all on one letter, or not all UNC paths: footage and output on
one mapped drive never wait for a disconnected drive or an empty removable
one. Resolved roots, failures too, are kept process-wide for 60 s.

* #3328: the 13,000-frame guard test counts file system lookups instead of timing them

* #3328: note why only Windows counts lookups in the 13,000-frame guard test

* #3328: queued outputs collide under drive and UNC spellings

* #3328: queued sequences and subst drives compare by the place they name

* #3328: queued outputs keep their resolved places instead of resolving per comparison

* #3328: cache_bench's play request carries the abandoned flag (main's example met the new ControlRequest field)

* Refuse an output in a folder linked to a source's folder

An output whose name matches no protected file now has its folder resolved on disk, once per folder per guard, and is compared again by name. An output in render-alias/, a symbolic link or junction to plates/, no longer replaces plates/source.exr. No protected file is looked at.

* Resolve both folders, and only for a source with the output's file name

The footage path as imported may itself run through a link (macOS /var is /private/var, Windows 8.3 names), so resolving only the output's folder missed it. Now an output whose path matches nothing is compared again only with sources of the same file name, both folders resolved once per guard. An output named like no source asks the file system nothing.
2026-11-28 08:25:14 +01:00
Anubhav-Rai ffc0ad89da Reduce Project and Remove Unused Footage keep the media an Essential Graphics override shows (#4129) (#4164) 2026-11-28 07:55:33 +01:00
Anubhav-Rai 988a7a7685 export: a failed or panicked export removes the files it opened, as a cancel does (#4142) (#4224) 2026-11-28 07:42:36 +01:00
ki2pixel 5b755e2978 media: keep shared video decoders running across in-flight frames (#4196)
* media: keep the running decoder across in-flight frames

* media: keep a full GOP of decoded frames

* media: keep decoding across a draft switch

* media: run ProRes bands on the decode pool

* media: report shared decoder counters in gop_stats

* media: guard shared cancellation in MediaPool

* media: test sequential playback with B-frames

* media: count all shared decoder routes

* media: cache each picture's actual draft state

* media: remember draft switches across failed requests

* media: keep the requested picture through cache trimming
2026-11-28 07:36:48 +01:00
FredApps 2b750011a7 Merge upstream main into gpu-upload-budget-3731 2026-11-26 21:17:44 +01:00
skylar taylor-barrick 225ab2f072 test(sam2): check transposed convolution with a rounding-aware oracle (#4124)
Merged within Executive 271's Fred-approved scope, on Fred's REST review 6076595648 given explicitly at 81a2ce21, with the fresh full bar verified at that head: CI green (Linux gate and all four instrumented shards, Sonar among them), CodeRabbit reviewed this head, zero unresolved threads. #4122 and #4123 are untouched by this.
2026-11-26 13:54:55 -06:00
Nazar 6002e6214f Helper host: video helper client with reply rules and gate tests (#4189)
* Helper host: video protocol types, reply rules and discovery

Part of RFC-0031, phase 1. The host side of docs/video-helper-protocol.md
that needs no process: the messages, what to do with each reply, and
finding the program. Starting the helper and the client come next.

- video::wire: encode.open/frame/flush/close, cancel, hello and the
  replies, as the page documents them; control lines are at most 1 MiB.
- video::jobs: job and frame ids, the 8 frame / 256 MiB budget and the
  "What EffectCraft does with each reply" table (accept, drop, job error,
  protocol break) as plain logic.
- video::check_hello and find_video_helper: the version and app_min
  checks, and the program is looked for only in helpers/ next to the
  executable. Effect-helper scans now skip it.

* Helper host: video helper client, stand-in helper and gate tests

Part of RFC-0031, phase 1. Starts a video helper and runs encode jobs
on it, following docs/video-helper-protocol.md and the reply rules
added in the previous commit.

- video::client: VideoHelper starts the program, checks its hello,
  opens encode jobs, sends pictures (waiting when 8 frames or 256 MiB
  are out), flushes, cancels and closes. Packets are copied out of the
  exchange file as they arrive. A crash, hang or broken reply stops the
  helper and fails the export; 3 stops turn it off. A refused job ends
  that job only.
- Stopping kills the helper process and waits at most 5 s, then drops
  the exchange file so a stray process can't touch a reused region. The
  spec no longer promises a process-group or job-object kill, which
  needs unsafe code; its wording follows what is implemented.
- tests/it/video.rs: a stand-in helper (this test binary, driven by a
  scenario) and 19 gate checks: crash, hang, bad and out-of-order
  replies, out-of-bounds packets, version mismatch, missing helper,
  lost device, packet_too_large as a job error, cancel, ignored
  cancel, 3 stops and retry.

* Helper host: harden the video client against a misbehaving helper

Review fixes on the video client and its tests.

- Packets in one reply may not add up to more than their region, so
  repeated references to the same bytes can't make the host copy them
  many times. The reader's queue is bounded; a helper that floods it
  waits on its own pipe.
- A picture is sized with checked arithmetic and refused over 256 MiB
  before any layout or exchange file growth; an encode.open that can't
  be written is refused before the job, its ids and regions exist.
- Waits end at their deadline even while replies keep arriving, a poll
  looks at a bounded number of late replies, the flush batch and
  encode.flushed share one timeout, and a timeout too long to represent
  no longer panics.
- close is private: a job is closed only after encode.flushed or
  cancelled. An unsent frame is given back when writing its planes
  fails; a failed copy of packets stops the helper without counting it
  as a crash.
- Contents/Helpers is searched only for an executable in
  Contents/MacOS. An incomplete base64 group is rejected.
- Tests assert the protocol diagnostic of each malformed reply and
  cover the flood, the flush deadline, oversized pictures and an
  oversized encode.open. The spec table drops every reply except
  cancelled for a failed job that has not been cancelled yet.

* Helper host: allow one encoder job at a time on a video helper

open_encoder accepted a second job while the first was open. If the
first job then reported an error while the client was waiting on the
second, the error was dropped and its caller only saw "no such video
job".

A second open is now refused with a request error until the first job
is finished or cancelled, so each job's error reaches its own caller.
The receiver state machine still tracks several jobs; only the client
API is single-job.

The gate test refuses a second open while one is active and accepts a
new one after finish and after cancel.

* Helper host: reject malformed base64 padding, align two protocol notes

base64_decode stripped every trailing "=", so "====" decoded to an
empty codec configuration that open_encoder then accepted. It now
accepts at most two "=" and only when the length is a multiple of 4.

The protocol page said job ids are never reused even after a restart,
but the counter is per process, and said nothing about replies that
were already queued when the frame timeout passed. Both now describe
what the client does.

* Helper host: fix two code comments about job id reuse

The comments on NEXT_JOB and Jobs::new said ids are never reused across
helper processes or restarts. The counter is per process and a new
helper starts from the highest id opened so far, so the comments now say
that, matching docs/video-helper-protocol.md.

* Helper host: cap the encoder delay a video helper may report

A helper-reported delay sized the flush region (and the exchange file) with
unchecked arithmetic. A delay over 64 is now a protocol break, the flush
region uses checked arithmetic, and the protocol page says so. Also moves a
test doc comment back onto the test it describes.

---------

Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
2026-11-26 20:47:36 +01:00
FredApps b602fc35f5 Merge branch 'main' into fix/3668-render-queue-duplicate-shortcut 2026-11-26 17:54:25 +01:00
FredApps 995039c7aa Merge branch 'main' into feat/import-photocraft 2026-11-26 17:17:26 +01:00
FredApps 6969ca541d Merge branch 'main' into issue-1963 2026-11-26 16:42:30 +01:00
FredApps 52b1d18833 Merge branch 'main' into camera-tools-2586 2026-11-26 16:07:34 +01:00
FredApps c1758a2667 Merge branch 'main' into export-log-phases-3713 2026-11-26 15:30:33 +01:00
FredApps ac45c3fe9e Merge branch 'main' into paste-text-style-3901 2026-11-26 15:03:43 +01:00