Footage cache (#3271): review fixes

- A covered batch is served before a remembered failure; failures are kept per request, so a
  broken part or too many channels never hides the picture; a picture too large with its
  effects' channels is read alone.
- Hostile headers: parts whose data window or uncompressed block is out of bounds are refused
  before any decoder sees them (index, reader and the image crate's whole-file path, import).
- Seek and read errors are transient (Stopped), not remembered; the copy path notes its file.
- The index drops the headers' other attributes and previews, is bounded by bytes and checks
  the file's identity before it is reused.
- A picture read alone isn't kept twice (plane store and frame cache).
- A waiter whose decodes keep being called off decodes a copy; rounds are bounded.
- The Cryptomatte probe asks with its own effect's need; animated parameters are found in
  nested groups.
- Test hooks and caps are keyed by path; new tests: data window offsets, failures per request,
  too large with channels, the file bound, hostile data windows, damaged files, rows and levels
  on every compression and on tiles.
This commit is contained in:
vangel76 committed 2026-11-08 02:43:58 +01:00
1 parent 63d32fa33e
commit bf48ec8b8e
14 files changed
+636 -174

No files matched your search

+1 -1
View File
@@ -20,7 +20,7 @@ mod create;
mod edit;
mod effect;
pub use effect::{CryptoCoverage, CryptoProbeJob, PLUGINS_DIR};
pub(crate) use effect::{CryptoProbeSlot, crypto_coverage, crypto_probe_job, crypto_probe_ready, keep_crypto_probe, kept_crypto_probe};
pub(crate) use effect::{CryptoProbeSlot, crypto_coverage, crypto_probe_job, crypto_probe_ready, keep_crypto_probe, kept_crypto_probe, moves};
pub mod essential;
pub mod expr_tools;
mod file;
+9 -2
View File
@@ -520,7 +520,14 @@ impl CryptoProbe {
reads: None,
};
let params = effectcraft_effects::flatten_params(g, &mut |pr| ctx.value(layer, pr));
let aux = r.layer_aux(&ctx, layer).ok_or(NO_CRYPTO)?;
// The channels the layer's effects read and this effect's (it may be switched off).
let own = match &g.kind {
effectcraft_project::GroupKind::Effect { effect } => effectcraft_effects::aux_needs(effect, &params),
_ => None,
};
let need =
r.layer_aux_need(&ctx, layer).union(own.map_or(effectcraft_raster::channels3d::AuxNeed::All, effectcraft_raster::channels3d::AuxNeed::Lookups));
let aux = r.layer_aux_with(&ctx, layer, &need).ok_or(NO_CRYPTO)?;
if !live() {
return Ok(None);
}
@@ -540,7 +547,7 @@ impl CryptoProbe {
}
/// Whether a property in `g` other than `skip` changes over time (keyframes or an expression).
fn moves(g: &PropGroup, skip: Option<Uid>) -> bool {
pub(crate) fn moves(g: &PropGroup, skip: Option<Uid>) -> bool {
g.children.iter().any(|c| match c {
effectcraft_project::Node::Prop(p) => Some(p.uid) != skip && (p.is_animated() || p.has_expression()),
effectcraft_project::Node::Group(g) => moves(g, skip),
+2 -3
View File
@@ -169,7 +169,7 @@ impl Session {
/// doesn't declare, or whose parameters change over time (keyframes, an expression), reads all
/// channels. Several layers of one file add up.
pub(crate) fn aux_needs(project: &effectcraft_project::Project) -> Vec<(String, effectcraft_raster::channels3d::AuxNeed)> {
use effectcraft_project::{GroupKind, ItemKind, LayerSource, Node};
use effectcraft_project::{GroupKind, ItemKind, LayerSource};
use effectcraft_raster::channels3d::AuxNeed;
let mut out: std::collections::BTreeMap<String, AuxNeed> = std::collections::BTreeMap::new();
for l in project.comps().flat_map(|(_, c)| c.layers.iter()).filter(|l| l.switches.effects) {
@@ -183,8 +183,7 @@ pub(crate) fn aux_needs(project: &effectcraft_project::Project) -> Vec<(String,
if !effectcraft_effects::reads_aux(effect) {
continue;
}
let moving = g.children.iter().any(|c| matches!(c, Node::Prop(p) if p.is_animated() || p.has_expression()));
let need = if moving {
let need = if commands::moves(g, None) {
AuxNeed::All
} else {
let params = effectcraft_effects::flatten_params(g, &mut |p| p.value.clone());