Commit Graph
1187 Commits
Author SHA1 Message Date
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
FredApps 2b750011a7 Merge upstream main into gpu-upload-budget-3731 2026-11-26 21:17:44 +01:00
NazarandFredApps 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 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 28fc5906d3 Merge main into fix/3668-render-queue-duplicate-shortcut
Conflict in crates/ui-egui/tests/it/ui_shortcut_scopes.rs: kept this PR's press/press_in split (press and release, shared context) and main's framework::install_headless call, now made on every context the tests create.
2026-11-26 19:26:23 +07:00
FredApps 0760042742 Merge pull request #3993 from nazar-gavrylyk/docs/hardware-video-protocol
Docs: propose the video helper protocol for hardware encoding (RFC-0031)
2026-11-26 10:07:25 +01:00
FredApps 8d9aaf1055 Reconcile PhotoCraft import with current EffectCraft dependencies 2026-11-26 08:54:52 +01:00
aiongg 47ab68c218 Merge pull request #4153 from aiongg/minimal-port-next
EffectCraft: move to craft-libs next (minimal port)
2026-11-25 23:09:14 -05:00
skylar taylor-barrick 9111eaa73c Switch on supervised nightlies on the nightly-signer branch (#4175)
Supervised nightly switch-on, merged under Skylar's explicit Nightly 758 override after green CI, CodeRabbit on this head with no open threads, Sonar passing, and an independent adversarial review with no blockers.
2026-11-25 21:05:26 -06:00
aiongg 57d7b0dd1b Merge main into the minimal port
Conflicts: crates/ui-egui/src/lib.rs (module list: kept the port's capture module and main's channel module).
2026-11-25 06:36:34 +00:00
Dylan M. Taylor 59aed45057 packaging(linux): support co-installable nightly packages (#4154)
Linux nightly packaging by @dylanmtaylor, with the per-app Nightly flavor commits stacked on his branch.

Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com>
2026-11-24 19:38:19 -06:00
aiongg dbbf485774 Repin craft-libs to dock-gaps 4e806d57a5: panel focus on DockAreaOutput::pressed, document tab sources, tests on next's ids 2026-11-24 21:09:54 +00:00
aiongg 74ba361444 dock: EffectCraft's panels on next's DockArea
- dock_ui: DockArea over the given workspace (one Arc kept while equal), a
  Tracked spec model (tab names, label swatches, the Timeline's comps as
  panel documents), EffectCraft's lock and panel menu in each group header,
  DockConfig from the old style flags (side edge zones, Maximize Frame,
  Close Other Panels in Group, float on empty drop, title bars only move,
  wheel selects tabs, tab close buttons, native windows), DockArea::raise
  for a floating panel shown by a command, window_files per panel,
  automation ids from DockAreaOutput::sources.
- dock_command: the window.panel.* and ui.dock vocabulary, app-local.
- Lock Workspace is UiState::dock_locked, saved in the workspaces file; an
  earlier file's own workspace lock carries over once.
- Native window places of earlier files are dropped: the dock places its
  OS windows again (native_outer and the place sanitizing go).
- Floating-window keys and text-field edits go through the window host.
- Tests: next's constructors; ui_dock_resize goes (divider geometry is the
  dock's own behaviour, with its trials).
2026-11-24 19:17:33 +00:00
nazar-gavrylyk ccb628207f #805: Docs: define how a flush's packets and encode.flushed are accepted 2026-11-24 20:14:12 +01:00
nazar-gavrylyk cfc57d390a #805: Docs: reflow the error bullet in the video protocol 2026-11-24 19:42:23 +01:00
nazar-gavrylyk 7e9fc1e49e #805: Docs: rewrap a line in the video protocol 2026-11-24 19:42:13 +01:00
nazar-gavrylyk 6581b6f937 #805: Docs: align the video protocol with RFC-0031 D3 and fix reply rules 2026-11-24 19:42:05 +01:00
nazar-gavrylyk a0ef54fac1 Merge remote-tracking branch 'upstream/main' into docs/hardware-video-protocol 2026-11-24 19:41:21 +01:00
FredApps 786e9b033f Merge branch 'main' into fix/1955-producer-history 2026-11-25 00:00:45 +07:00
Valentin Klein 525dcfc0d8 Browse… buttons in a script's own dialogs and panels open the file dialog instead of doing nothing (#3253)
* Scripts: a ScriptUI Browse… button opens the file dialog

Fixes #2778.
Fixes #2894.

File.openDialog, File.saveDialog, Folder.selectDialog and the instance
openDlg / saveDlg / selectDlg were stubs that returned null, so a script
dialog's or a dockable ScriptUI panel's Browse… button did nothing.

On a script-host thread, in an app that shows them, the script now asks
for the dialog (Session::script_ui.file_dialogs, each with an id), hands
the session back like a modal dialog's show() does and waits for the
answer: a File (an array with multiSelect), a Folder, or null when
cancelled. The script's filter becomes the dialog's (its name, "All Files"
for *.*); without extensions every file shows. Headless runs, the Script
Console, the web and Shutdown scripts get null at once.

The app shows the dialog after the pass's events: blocking on Windows
(Hooks::pick_file_dialog), without blocking on macOS and Linux, one at a
time; a non-blocking dialog that ends without answering counts as
cancelled. scriptui.fileDialogs lists the waiting dialogs and
scriptui.fileDialog answers one (refused while file access is confined,
and refused to scripts). A dialog leaves the list only when its script
has the answer; the script's windows refuse events meanwhile, except
scriptui.close, which cancels the file dialog first. A script host that
ends takes its dialogs with it.

* Scripts: carry a file dialog's prompt, start location and filter to the native dialog (#2778)

serve_file_dialogs collected the script's prompt, start folder and save filter
but dropped them at the host boundary. FileDialog::Script now carries prompt and
start, and new ScriptFolder and ScriptSave requests carry the folder dialog's
prompt/start and the save dialog's prompt and whole filter (label, extensions,
any file) instead of the default name's extension. Both the blocking and the
non-blocking host dialogs apply title, initial directory and filters; Save also
goes through the blocking hook where one is set. Hook-level regression test
asserts all three requests.

* Scripts: a hidden window paints so a script's file dialog is shown (#3253 review)

* Scripts: formatting (#3253)
2026-11-22 12:58:56 -06:00
NullTron 5fe33d0a9b fix(effects): sample particle producers at their birth time (#1955) 2026-11-22 02:24:47 +05:30
nazar-gavrylyk 5b2ee09762 #805: Docs: drop a stopped helper's exchange file and bound the stop wait 2026-11-20 20:40:09 +01:00
nazar-gavrylyk dede545a7f #805: Docs: keep a job's regions until every helper process has exited 2026-11-20 20:33:00 +01:00
nazar-gavrylyk 7233dda4b0 #805: Docs: retire a job's frames on cancel or helper exit 2026-11-20 20:25:53 +01:00
nazar-gavrylyk 41a4eae706 #805: Docs: define how an error and encode.close retire a job 2026-11-20 20:18:50 +01:00
nazar-gavrylyk a2e62b438a #805: Docs: specify packet framing, offsets, flush and error replies 2026-11-20 20:10:37 +01:00
nazar-gavrylyk e495469969 #805: Docs: propose the video helper protocol for hardware encoding (RFC-0031)
Specify phase 1 of RFC-0031 in docs/video-helper-protocol.md, marked
proposed: how a video helper is started and found, the hello version
check, the 8-bit 4:2:0 picture format, the encode.* messages with
slots, limits, cancel and per-frame timeouts, and what happens when a
hardware export fails. Decoding is reserved for phase 2.

external-helpers.md gets a pointer to the new page.
2026-11-20 19:38:13 +01:00
dotCooCoo f5bbbd2d64 Merge main into feat/import-photocraft 2026-11-19 07:28:11 -08:00
vangel76 98ada1e8ff Watch Folder renders take the host's memory budget; docs and test comment (#3941 review) 2026-11-19 10:37:00 +01:00
vangel76 6bea5fa6ae Merge upstream/main into cache-defaults-3298 2026-11-19 10:21:55 +01:00
vangel76 34a1c88930 Reap a killed nvidia-smi on a thread of its own, tell why it gave no output, restore the test budget on failure, clearer cap docs 2026-11-18 17:38:13 +01:00
vangel76 3d3abd9561 Give the held-output test room to start, retry reaping on a loaded machine, clearer budget docs 2026-11-18 16:31:12 +01:00
vangel76 ec3116f04d Keep nvidia-smi from holding the caller; never take another card's memory
Read nvidia-smi's output on a thread of its own and stop at the same
timeout, so a process it leaves behind holding the pipe cannot block.
Reap a program killed at the timeout, waiting at most 200 ms.
When the adapter's own nvidia-smi line (or a line of its device id) has
no size, the memory is unknown instead of another card's.
A memory cap override that is not a number now behaves like no override
for both the cap and the upload budget.
The upload-budget test sets a budget that fits before its first phase,
and the docs say how a set cap lowers the default upload budget.
2026-11-18 16:24:46 +01:00
vangel76 a987ed1216 Read NVIDIA video memory with nvidia-smi when the OS does not report it
The proprietary NVIDIA driver on Linux has no sysfs file for the card's
memory, so the upload budget stayed at 1.5 GiB there. When the adapter is
NVIDIA and nothing else reported its memory, run nvidia-smi once (no console
window, 3 s timeout, cached) and take the line of the adapter's PCI address,
else of its device id, else the smallest card.
2026-11-18 15:29:51 +01:00
FredApps e2b17586c0 Merge main into feat/import-photocraft 2026-11-18 20:20:08 +07:00
vangel76 1032cb6490 Merge remote-tracking branch 'upstream/main' into gpu-upload-budget-3731
# Conflicts:
#	Cargo.lock
2026-11-18 12:56:47 +01:00
vangel76 3641cb38a8 Merge remote-tracking branch 'upstream/main' into export-log-phases-3713
# Conflicts:
#	crates/export/src/lib.rs
#	crates/export/src/webm.rs
#	crates/export/src/webm_av1.rs
2026-11-18 12:54:29 +01:00
arnav-hiwarkar c07dbf32ca Merge remote-tracking branch 'upstream/main' into fix/3464-drop-shadow-softness-range 2026-11-17 20:54:02 +05:30
arnav-hiwarkar eb14583749 Merge remote-tracking branch 'upstream/main' into fix/3467-radial-blur-amount-range
# Conflicts:
#	crates/aep/src/export/fx_defs.rs
#	crates/engine/src/tests/effect_ranges.rs
#	docs/effects-parity.md
2026-11-17 18:34:15 +05:30
arnav-hiwarkar 7f14df8355 Merge upstream main into fix/3460-gaussian-blur-range
Keeps the Gaussian Blur (#3460) and Sharpen (#3466) tests in
crates/effects/src/misc.rs; Sharpen's code is as main has it.
2026-11-17 18:08:30 +05:30
ash a188867a42 Merge pull request #3810 from arnav-hiwarkar/fix/3466-sharpen-amount-range
Sharpen: Amount takes After Effects' 0..4000 range (#3466)
2026-11-17 18:06:39 +05:30
arnav-hiwarkar ff9584fa64 Merge remote-tracking branch 'upstream/main' into fix/3467-radial-blur-amount-range
# Conflicts:
#	crates/engine/src/tests/effect_ranges.rs
#	docs/effects-parity.md
2026-11-17 17:57:33 +05:30
arnav-hiwarkar 69666e68c7 Merge upstream main into fix/3460-gaussian-blur-range
Keeps the Gaussian Blur (#3460) and Turbulent Displace (#3469) rows in
the engine range test and the effects parity log.
2026-11-17 17:57:21 +05:30
arnav-hiwarkar 95685d8d41 Merge remote-tracking branch 'upstream/main' into fix/3469-turbulent-displace-amount-range
# Conflicts:
#	docs/effects-parity.md
2026-11-17 17:26:50 +05:30
arnav-hiwarkar 83285272e3 Merge upstream main into fix/3460-gaussian-blur-range
Keeps the Gaussian Blur (#3460), Fractal Noise (#3486) and CC Power Pin
(#3492) rows in the effects parity log.
2026-11-17 17:25:22 +05:30
arnav-hiwarkar ffdcdb507d Merge remote-tracking branch 'upstream/main' into fix/3464-drop-shadow-softness-range 2026-11-17 17:25:13 +05:30
arnav-hiwarkar cebe224d85 Merge remote-tracking branch 'upstream/main' into fix/3467-radial-blur-amount-range
# Conflicts:
#	docs/effects-parity.md
2026-11-17 17:24:34 +05:30