Commit Graph
264 Commits
Author SHA1 Message Date
vangel76 3c48ddc72c OpenEXR limit: planes let go that are still in memory count toward the limit, so a request is refused for now rather than read beside them (#3750 review) 2026-11-18 13:07:17 +01:00
vangel76 0f872a46a6 Merge branch 'plane-store-on-craft-exr' into decode-cap-on-craft-exr 2026-11-18 13:03:28 +01:00
vangel76 c2c40200f6 Caching: the test of a still cached twice checks that its memory goes once nobody holds it (#3750 review) 2026-11-18 13:03:27 +01:00
vangel76 596a5ac55d Merge branch 'plane-store-on-craft-exr' into decode-cap-on-craft-exr 2026-11-18 13:03:07 +01:00
vangel76 9bbc0847ad Caching: a still cached both whole and as a frame can be let go, and a plane entry without memory to seal it is skipped (#3750 review) 2026-11-18 12:57:37 +01:00
vangel76 f0725e18bb OpenEXR limit: a decode thread that took over a decode lets the held planes go itself, and the region test reads the footage's size (#3750 review) 2026-11-17 18:12:03 +01:00
vangel76 6bee053990 Merge branch 'plane-store-on-craft-exr' into decode-cap-on-craft-exr
# Conflicts:
#	crates/media/src/exr_planes.rs
2026-11-17 17:40:27 +01:00
vangel76 3494ef8552 Caching: an oversized Cryptomatte plane stays beside held ones, disk copies are made a job at a time, and the review tests prove what they claim (#3750 review) 2026-11-17 17:40:16 +01:00
vangel76 e6a3c32357 OpenEXR limit: planes let go are gone before the request is read, a claimed decode without memory isn't read again, and the oversized-header test keeps the fixed limit (#3750 review) 2026-11-17 17:05:03 +01:00
vangel76 79fdc7b21b Merge branch 'plane-store-on-craft-exr' into decode-cap-on-craft-exr
# Conflicts:
#	crates/media/src/exr_planes.rs
2026-11-17 17:00:55 +01:00
vangel76 5d0bfe7869 Caching: memory is let go only where it frees memory, Purge keeps nothing decoding meanwhile, and regions read the rows they show (#3750 review)
- Cryptomatte planes: a plane a render holds is not offered for its gone channels, and the entry
  limit holds while renders hold every plane.
- Footage frames and whole stills held elsewhere are not offered to the memory accountant.
- Purge (clear frames) makes decodes in flight stale: their frames are not kept or joined.
- Plane store: a size refusal of a merged decode is not handed to a request that fits alone;
  slimming a shared set and copies for the disk cache take memory fallibly, and planes the disk
  cache can't take are not copied.
- Disk cache: the plane encoder's scratch is taken fallibly; no memory skips the entry.
- Region of interest: rows follow the projected transform of a 2D layer under a 3D parent, and
  a frame of another size than its footage is read whole.
- The box filter's work bound is checked without a wall clock.
2026-11-17 17:00:29 +01:00
vangel76 c12320771c Merge branch 'plane-store-on-craft-exr' into decode-cap-on-craft-exr 2026-11-17 11:10:48 +01:00
vangel76 fc4eddf2d5 Merge upstream/main into the plane store branch (#3301)
# Conflicts:
#	Cargo.toml
2026-11-17 11:10:07 +01:00
vangel76 c205773d92 Caching: memory is counted where it is held, and whole layers stay whole under a viewer region (#3301 review)
- The memory accountant is offered only layer buffers and preview frames nobody
  else holds, so what it counts as freed is freed; the frame cache's recycled
  buffers count and go first.
- A Cryptomatte plane over the matte cache's own limit is kept only where the
  common budget trims it.
- Disk cache entries read back take their buffers fallibly: memory the system
  can't give is a miss.
- The Layer panel, sampleImage and effect inputs read whole footage frames under
  a viewer region of interest.
- A 16K Cryptomatte source at half resolution is box-filtered, not looked up
  nearest-neighbour.
- The System Compatibility Report shows the cache budget in force.
- A Project panel thumbnail render never starts under a key held back from an
  earlier state.
- Convert Expression to Keyframes makes no keys on a property that can't be
  animated.
2026-11-17 11:09:13 +01:00
vangel76 ba2cb5f759 OpenEXR limit: one decompressed block stays at 8 GiB whatever memory a read may use (#3749 review)
The read's limit (the floor or the memory budget) bounds the planes it
allocates; one block the decompressor allocates whole is capped apart, at
the fixed floor (8 GiB, 512 MiB in the browser), with craft-exr's
max_block_bytes. A larger block is a damaged or hostile header, refused
for its size before anything is read. That refusal doesn't depend on the
limit, so remembering it for requests asking at least as much stays
right; after a limit change it is only decided once more.
2026-11-16 23:38:19 +01:00
vangel76 c0c53353fe OpenEXR limit: memory the system refuses is neither remembered nor read again at once, and never handed to the whole file's decode (#3749 review)
craft-exr's OutOfMemory is now a refusal of its own (ReadError::OutOfMemory,
Refused::NoMemory) instead of a failed read: the store doesn't remember it,
doesn't retry it or read a copy, and a picture without memory for its
effects' channels is read alone, else refused with the reason, as for a
file too large; never the image crate's decode of the whole file. The
planes held, copied into a request's new set, are reserved fallibly too;
a copy for the disk cache that can't be had is not written. The tests
that set the process-wide disk cache take turns, and a test shows that
an unreadable request stays refused when the decode limit changes.
2026-11-16 23:35:44 +01:00
vangel76 f08a2290c2 OpenEXR limit: the planes a request ends with count together, held and from the disk cache too (#3749)
The limit applied to the planes read from the file just now, so planes held in
memory or handed back by the disk cache were never counted and repeated
requests could pass it. It now applies to what the request ends with, asked
before anything is read or allocated. When the held planes don't fit with the
missing ones they are let go and the request is read on its own; only a
request that doesn't fit alone is refused.
2026-11-16 23:11:26 +01:00
vangel76 a7e7cb6b6a OpenEXR limit: only a refusal for size depends on the limit's generation; sequentially consistent counters (#3749 review) 2026-11-16 23:10:29 +01:00
vangel76 bdf500f4ba OpenEXR limit: a refusal for size is decided anew when the limit changes; a failed reading is asked twice (#3749 review) 2026-11-16 23:09:59 +01:00
vangel76 b591f95ce4 OpenEXR: a file's channels may take what the machine's RAM allows, not a fixed 8 GiB (#3749)
The limit of one read is decided here (the 8 GiB floor, or the memory
budget when that is more) and handed to craft-exr as the read's max_bytes,
so the planes it reserves and the largest block it decompresses follow it.
craft-exr reserves the planes fallibly, so the reader's own fallible plane
allocation is not needed: memory the system can't give is a read that
failed just now (read_error), a plane over the limit a refusal for size.
2026-11-16 23:09:47 +01:00
vangel76 ea4ac2e5ed Refuse OpenEXR blocks larger than their chunk can hold
craft-exr now holds every block to what its chunk's bytes can
decompress to, using the ratio the index was built with: the index is
built with craft-exr's default ratio (no longer unbounded), a file with
such a block is refused when indexed and by safe_to_decode before the
image crate sees it, and each read checks it again. Memory the system
refuses during a read is a read that failed just now, not remembered,
instead of a file too large.
2026-11-16 23:07:23 +01:00
vangel76 c1aea6d65a Bound OpenEXR pictures in memory and keep effects' depth fill
The picture of an OpenEXR file (also the black one of a file without a
main picture) is checked before anything is read: no larger than a
still may decode to and than one read of the file may allocate, else
refused with the reason instead of allocated. Import refuses such a
picture as other stills. The fill of a picture channel in a part named
like depth is the background depth again, as effects read it; the
picture is 0 outside that part's data window when composed instead.
A read decompresses on at most four threads of its own, none for a
small file.
2026-11-16 22:59:38 +01:00
vangel76 d671f6e45b Show an OpenEXR file's main picture as After Effects does
The picture of an OpenEXR file is now craft-exr's main picture: the
unprefixed R, G, B (and A) of the first part that has all three, else
the first part's unprefixed Y (and A) as grey. A file of named layers
only (Blender's ViewLayer.Combined.R, a compositor's Image.R) has none
and shows black at its display window's size, opaque, as After Effects
shows it; it still imports and its layers stay readable by effects
(EXtractoR, Cryptomatte, the 3D Channel effects).

The own picture choice (the beauty pass by name, data passes, the first
channel as grey) is gone. The picture's channels keep a fill of 0
outside the data window even in a part named like depth, so the picture
of such a file stays what the image crate shows. The golden hashes of
the named-layer files are re-pinned (their channels are unchanged), and
the docs describe the new rule.
2026-11-16 22:30:46 +01:00
vangel76 ccd4c75f4f Keep refusing damaged OpenEXR headers before a decoder sees them
safe_to_decode accepts a file only when its headers index (or name a
compression or part kind this reader doesn't cover); damaged headers,
offset tables longer than the file, oversized parts and failed reads
are refused again, as the old lenient parse did. Indexing also refuses
a channel list the exr crate's validation refused (a zero sampling
factor or one not dividing the data window, channels out of order),
since headers are now read leniently only. Follows craft-exr's new
UnsupportedCompression error kind for HTJ2K and its non-exhaustive
error enum. The damaged-file test now checks that the good files index
and read and that damaged ones reach the reader.
2026-11-16 22:02:29 +01:00
vangel76 58038903bd Read OpenEXR planes through craft-exr's seekable reader
The plane store's index and reader now use craft_exr::seek: Index::build
reads and checks the headers and offset tables, read_planes fetches only
the chunks of the requested channels, rows and level. The app keeps what
is its own: the file identity, plane names and aliases, Cryptomatte
manifests, the picture's channels, the memory cap of one read and its
message, cancellation and the error mapping. The own chunk reading,
batching and header parsing are gone, and the exr crate is only a
dev-dependency of effectcraft-media now (the tests write files with it).
2026-11-16 21:45:05 +01:00
vangel76 9ff031c5f1 Merge upstream/main into the plane store branch (#3301)
Conflicts: Cargo manifests (craft-libs pins from main, plus memory-stats, exr and
half for effectcraft-media), exr_channels.rs (the plane store's version; main's
craft-exr channel decode is replaced by the plane store until craft-exr reads
from a seekable source), pool.rs (frame_px takes the rows of #3271 and the
forget generation of #2042), session open/forget (main's forget_files plus the
reload counter), Project panel thumbnails (main's Thumb types, keyed by content).
2026-11-16 20:57:45 +01:00
Dylan M. Taylor e9d5f37561 test: use valid encoded PCE layout for AAC downmix parity 2026-11-16 11:09:24 -05:00
ash 5300531387 Merge pull request #2042 from arnav-hiwarkar/perf/close-project-frees-caches
Close, New and Open Project free the closed project's memory
2026-11-16 17:27:13 +05:30
FredApps 3570d59d43 media, export: read MPEG TS AAC config and check encoders with craft-libs, drop four filmcraft pins
crates/media reads the MPEG TS/PS stream FilmCraft's source plays with
craft_media::mpegts and LATM configuration with craft_audio::aac::latm_config.
The VP9, HEVC and AV1 encoder round-trip tests decode with craft-video's
decoders. filmcraft-mpegts, filmcraft-vp9, filmcraft-hevc and filmcraft-av1
are no longer direct dependencies (storytold/craft-libs#781).
2026-11-16 11:18:56 +01:00
FredApps da6e5b874c fix(media): refuse an oversized GIF canvas before scanning its frames 2026-11-16 09:45:16 +01:00
FredApps 9e27d5a0a5 fix(media): keep every decoded GIF and WebP frame past the probe frame count 2026-11-16 09:14:28 +01:00
FredApps dd850f92a9 Merge remote-tracking branch 'upstream/main' into codex/effectcraft-gif-webp-decode-shared
# Conflicts:
#	Cargo.toml
#	crates/media/Cargo.toml
2026-11-16 08:25:10 +01:00
Dylan M. Taylor 186661829a media: decode animated GIF and WebP through craft-gif and craft-webp frames
Carved out of #3649. craft_gif::frames and craft_webp::frames replace the
image crate's animation decoders in gif_anim and webp_anim, with the same
frame, byte and canvas limits and the same damaged-tail behaviour (frames
decoded before the damage are kept). craft-gif and craft-webp are pinned to
craft-libs main 948b5c23 with the frames feature.
2026-11-16 08:18:00 +01:00
FredApps 234273d9b8 docs(exr): note the shared decoder's all-channel data-window bound 2026-11-16 07:44:53 +01:00
Dylan M. Taylor 85903800dd Account selected EXR planes per part and skip unused parts 2026-11-15 14:46:37 -05:00
vangel76 932e029592 Localizer: keep the adoption guard until the adopted copies and free-space reading are published (#3301 review) 2026-11-15 20:28:43 +01:00
vangel76 f4a8c88349 Merge upstream/main into cache-defaults-3298 2026-11-15 20:28:43 +01:00
Dylan M. Taylor d2d3f47d92 Merge main and isolate shared EXR decoder revision 2026-11-15 14:08:54 -05:00
.CooCoo 7cbefaf70f Import: VectorCraft documents import through the PDF they carry (#2901)
* Import: VectorCraft documents import through the PDF they carry

File > Import reads a .vectorcraft file through the PDF that VectorCraft
saves in it with Create PDF-Compatible File, one page per artboard, as
footage or as a composition with one layer per PDF layer. The PDF is read
with craft-doc from craft-libs (plain or compressed files, the PDF inline
or after the JSON). A PDF after the JSON may be as large as a PDF file
EffectCraft imports (512 MiB). A document saved without that option gives
an import error that names it.

craft-doc, craft-vectorcraft-format (tests only) and craft-ecproj-format
are pinned to craft-libs fa1a6574; craft-ecproj-format is unchanged
between ca1b5e2e and that commit.

* Import: show file errors returned by the import dialog

* Keep dropped-file import errors alongside local drop errors

* Import: preserve every file error across background jobs and UI notices

* Import: queue pending errors with bounded notification details

* Import: a damaged VectorCraft preview no longer stops the carried PDF

The importer read every rendition with craft_doc::renditions and then
picked the PDF, so a preview whose base64 was invalid or whose data lay
past the end of the file made the whole import fail. It now reads only
the PDF with craft_doc::rendition, from storytold/craft-libs#546, and
never decodes the preview. A document without a PDF still reports
NoCarriedPdf.

* Import: dismissing a picked import's error status acknowledges its details

A picked or menu import queued its error details with the status
report_import_errors set ("first (and 1 more)"), and show_result_errors
then replaced that status with "first; second". The two never matched,
so clicking the status left the details queued and they showed again.
Import commands now move the queued details to the status that replaces
it, also when After Effects project errors lead it. Other commands'
statuses never take over an import's details.
2026-11-15 03:45:56 -05:00
Dylan M. Taylor dc2380b070 fix(ci): stabilize macOS dialog and EXR cache tests (#3704)
* fix(ci): stabilize macOS dialog and EXR cache tests

* style: format file dialog test helpers
2026-11-14 20:08:47 -05:00
Dylan M. Taylor 9bb7b55e0d refactor(exr): decode channels with shared craft exr 2026-11-13 17:11:03 +00:00
vangel76 4829a83d30 Merge upstream/main into cache-defaults-3298 2026-11-13 12:39:55 +01:00
Dylan M. Taylor 92274ec914 Merge remote-tracking branch 'origin/main' into codex/778-effect-migration
# Conflicts:
#	crates/aep/src/container.rs
#	crates/aep/src/container/footage.rs
#	crates/aep/tests/it/container/robustness.rs
#	crates/model/src/fbx.rs
#	crates/model/src/gltf.rs
#	crates/model/src/obj.rs
2026-11-13 02:26:44 +00:00
Altynzhan KarybaiandClaude Sonnet 5.5 4035d18132 SVG: support static pattern fills and strokes (#2732)
* fix(svg): support static SVG patterns

* fix(svg): cache patterns per viewport

* fix(svg): share cached pattern content

* fix(svg): harden pattern cache keys

* fix(svg): harden pattern inheritance and caching

* Preserve SVG pattern fallback paint

* Format SVG pattern fallback conversion

* Harden SVG pattern resource bounds

* Fix SVG pattern test formatting

* fix(svg): bound hostile path and raster work

* Bound SVG ellipse expansion

* fix(ui-egui): suppress clippy warnings on wasm target

Rename unused `frame` parameter to `_frame` in draw_inner since
pointer_wrap::finish_native is cfg'd out on wasm32. Guard State::disabled
field with #[cfg(any(not(target_arch = "wasm32"), test))] so it only
exists where it's read (finish_frame on native + tests).

* fix: resolve clippy warnings blocking CI

- Rename unused `frame` parameter to `_frame` in draw_inner (wasm target)
- Guard State::disabled field with cfg(native + test) (wasm target)
- Replace chunks_exact(2) with as_chunks::<2>() in SVG polyline/polygon parsing

* fix(svg): budget raster work by affected region and report refusals

Address review on #2732: the finite-work guards charged the whole canvas,
dropping valid sparse art (8x8 image scaled to 1px on 2049x2049, 2x2 rect
under a 1,028-element clip on 512x512, one of six 2x2 rects sharing a 1x1
pattern on 3840x2160).

- Build fill/stroke/image/clip coverage over the device region only and
  charge that region; remaining whole-canvas passes are charged to a
  render-wide pixel budget (caps are not raised).
- Add try_rasterize/try_rasterize_with returning RasterError; rasterize
  keeps its signature. media layered decode now surfaces refusals.
- Pattern content reached through href inherits styles from the owning
  pattern; device_region falls back to the full canvas on non-finite input.
- Document new items and the limits in the svg README; regression tests.

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

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-12 21:12:42 +01:00
arnav-hiwarkar 0635f2496d #2042: review fixes for closing a project's thumbnails
- CancellableFootage calls off vector_frame too: a closed project's SVG / PDF thumbnail stops
  before it rasterises, like a viewer frame nobody waits for.
- replace_project forgets every footage file once and clears the layer cache and the
  Cryptomatte probe once, instead of once per footage item.
- The through-Close test covers comp thumbnails (layer cache and footage) as well as footage
  ones, and fails with a timeout instead of hanging.
- Docs: forget is also how a closed project's files go.
2026-11-12 19:32:06 +05:30
arnav-hiwarkar 2da516ed84 #2042: a decode in flight when its file is forgotten keeps nothing
The media pool counts forgets and frame clears. A read-ahead (sequential playback's next frame,
on its own thread) carries the count it was queued at and decodes nothing once a forget came
after it; any decode keeps its frame only if no forget came while it ran. A viewer playing a
movie at Close, or any reader decoding through it, can no longer bring the closed project's
frames back after Session::replace_project forgot them.
2026-11-12 19:05:59 +05:30
vangel76 dcd46af227 Merge upstream/main into cache-defaults-3298 2026-11-12 12:36:34 +01:00
Dylan M. Taylor a287044644 Media: check still, EXR channel, GIF and WebP canvas sizes before allocating
* fix(media): check still, EXR channel, GIF and WebP canvas sizes before allocating

* address review: GIF frame allocation limit, lower wasm32 still limit, no EXR fallback after a size-limit error

* address review: the 2^25-pixel still limit also applies on 32-bit native targets

* Media: raise the still pixel limit to 2^28 (16384 x 16384) on 64-bit targets
2026-11-12 06:29:46 -05:00
Dylan M. Taylor 6e1dd08147 Import: a 3D model's left-out textures reach the user as an import warning
* Import: a model's left-out parts reach the user as an import warning (Model::warnings, Importer::probe_noting)

* Import: a model's left-out parts reach the user as an import warning
2026-11-12 06:29:14 -05:00
Dylan M. Taylor 1ae04027df fix app adapters for shared format readers 2026-11-12 06:23:01 +00:00