* #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.
* 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>
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.
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.
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>
- 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).
* 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)
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.
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.
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.